/* The comparison page (/vertailu). Tokens and base styles come from styles.css. */

.compare__snapshot { margin: -6px 0 0; color: var(--muted); font-size: 0.9rem; max-width: 46rem; }

.compare__main { display: grid; gap: 20px; }

/* ---- headline cards ---- */

.headline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 8px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 5px solid var(--green);
  border-radius: var(--radius);
  padding: 16px;
  min-width: 0;
}
.stat__title { margin: 0 0 12px; font-size: 1rem; line-height: 1.3; }
.stat__values { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat__cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat__label { color: var(--muted); font-size: 0.85rem; }
.stat__number { font-size: 2.2rem; font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; }
.stat__cell--current .stat__number { color: var(--muted); }
.stat__number--win { color: var(--green); }
.stat .stat__number--text { font-size: 1.15rem; font-weight: 700; line-height: 1.3; padding-top: 0.6rem; }
.stat__note { margin: 10px 0 0; color: var(--muted); font-size: 0.85rem; }

/* ---- blocks ---- */

.block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.block h2 { margin: 0 0 4px; font-size: 1.2rem; }
.block__lead { margin: 0 0 12px; color: var(--muted); font-size: 0.95rem; max-width: 52rem; }

/* ---- breadth table ---- */

.breadth { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.breadth th, .breadth td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: bottom; }
.breadth thead th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.breadth tbody th { font-weight: 600; }
.breadth__num, .breadth__pair { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.breadth thead th { white-space: normal; }
.breadth__hint { display: block; font-weight: 400; font-size: 0.75rem; }
.breadth__current { color: var(--muted); }
.breadth__slash { color: var(--line); }
.breadth__ours { font-weight: 700; }
.breadth__ours--win { color: var(--green); }

/* ---- speed ---- */

.speed { display: grid; gap: 14px; margin: 0; }
.speed__item { display: grid; grid-template-columns: minmax(10rem, 14rem) 1fr; gap: 4px 16px; }
.speed dt { font-weight: 600; }
.speed dd { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.speed__pair { display: flex; flex-direction: column; gap: 2px; }
.speed__value { font-variant-numeric: tabular-nums; }
.speed__note { color: var(--muted); font-size: 0.85rem; }

/* ---- fairness ---- */

.fairness p { margin: 0 0 8px; }
.fairness__counts { font-weight: 600; }
.fairness__note { color: var(--muted); font-size: 0.85rem; }

/* ---- per query list ---- */

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin: 0 0 8px; }
.filters select { font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.filters__diff { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.filters__diff input { width: 18px; height: 18px; accent-color: var(--green); }
.filters__count { margin: 0 0 12px; color: var(--muted); font-size: 0.9rem; }

.queries { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.query { border: 1px solid var(--line); border-left: 5px solid #b7b1a6; border-radius: 12px; padding: 12px 14px; min-width: 0; }
.query--better { border-left-color: var(--green); }
.query--worse { border-left-color: var(--warn); }
.query__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; margin-bottom: 8px; }
.query__text { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.query__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.query__type { color: var(--muted); font-size: 0.85rem; }
.query__try { font-size: 0.9rem; font-weight: 600; color: var(--green); }
.query__note { margin: 8px 0 0; padding: 6px 10px; background: #fbf3d9; border-radius: 8px; font-size: 0.85rem; }

.badge { padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; background: var(--bg); color: var(--muted); }
.badge--better { background: var(--green-soft); color: var(--green); }
.badge--worse { background: #f6e1dc; color: var(--warn); }

.query__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qcol { min-width: 0; padding: 10px 12px; background: var(--bg); border-radius: 10px; }
.qcol__title { margin: 0; font-size: 0.9rem; }
.qcol__interp { margin: 2px 0 6px; color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
.qcol__count { margin: 0; font-weight: 700; }
.qcol__count--zero { color: var(--warn); }
.qcol__breaking { margin: 2px 0 0; font-size: 0.85rem; color: var(--green); }
.qcol__breaking--bad { color: var(--warn); }
.qcol__top { margin: 8px 0 0; padding-left: 1.2em; font-size: 0.85rem; display: grid; gap: 4px; }
.qcol__top li { overflow-wrap: anywhere; }
.flag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; background: #f6e1dc; color: var(--warn); font-size: 0.75rem; font-weight: 600; }

/* ---- phones ---- */

@media (max-width: 899px) {
  .headline { grid-template-columns: 1fr; gap: 12px; }
  .stat__number { font-size: 1.9rem; }
  .speed__item { grid-template-columns: 1fr; }
  .block { padding: 12px; }
}

@media (max-width: 599px) {
  .query__cols { grid-template-columns: 1fr; gap: 8px; }
  .breadth { font-size: 0.85rem; }
  .breadth th, .breadth td { padding: 6px 3px; }
  .breadth__hint { font-size: 0.7rem; }
}
