/*
 * css/pages/catalogue.css: /models, /pricing and /calculator (group catalogue, SPEC 12 C6).
 * Colours come from css/tokens.css only; shared components (chips, states, buttons, tables) from css/site.css.
 * Layout: centred page head, then a 232px facet rail beside the list (the rail becomes a Filters sheet under 860px).
 */

/* ------------------------------------------------------------------------------------------------ page head */
.cat-head {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 20px;
  padding-block: calc(var(--section) * .7) calc(var(--section) * .42);
}
.cat-head .lede { max-width: 62ch; margin-inline: auto; }
.cat-head__status { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; min-height: 24px; }
.cat-head__status .sk { width: 168px; height: 24px; border-radius: var(--r-pill); }
.cat-head__note { font-size: 13.5px; line-height: 1.5; color: var(--muted); }

/* ------------------------------------------------------------------------------------------------ catalogue layout */
.cat { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; padding-bottom: var(--section); align-items: start; }
.cat-rail-home { display: none; }
@media (min-width: 860px) {
  .cat { grid-template-columns: 208px minmax(0, 1fr); gap: 40px; }
  .cat-rail-home { display: block; }
}
@media (min-width: 1280px) { .cat { grid-template-columns: 232px minmax(0, 1fr); gap: 56px; } }
.cat-main { min-width: 0; }

/* facets (heyaskr rail: titled groups, 34px rows, mono counts, active on the accent tint) */
.cat-rail { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.facet { min-width: 0; }
.facet__head { margin-bottom: 8px; }
.facet__title { font: 600 11px/1.4 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text); }
.facet__sub { margin-top: 2px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.facet__list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.facet__btn {
  width: 100%; min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 10px; border-radius: var(--r2); font-size: 14px; line-height: 1.3; color: var(--body); text-align: left;
  transition: background-color var(--t2) var(--ease-out), color var(--t1);
}
.facet__btn:hover { background: var(--panel-2); color: var(--text); }
.facet__btn[aria-pressed="true"] { background: var(--accent-tint); color: var(--text); }
.facet__btn[aria-pressed="true"] .facet__n { color: var(--accent); }
.facet__btn:disabled { color: var(--muted); background: transparent; cursor: not-allowed; }
.facet__label { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.facet__label .icon { width: 16px; height: 16px; color: var(--muted); }
.facet__btn[aria-pressed="true"] .facet__label .icon { color: var(--accent); }
.facet__n { flex: none; font: 500 11px/1 var(--font-mono); color: var(--faint); font-variant-numeric: tabular-nums; }
.facet__foot { margin-top: 10px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.facet__foot strong { color: var(--dim); font-weight: 600; }
.facet__scroll { max-height: 330px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-right: 2px; }
.facet__filter { margin-bottom: 8px; }
.facet__filter .input { height: 36px; padding: 0 10px; font-size: 14px; }
.facet__none { padding: 6px 10px; font-size: 13px; color: var(--muted); }
@media (max-width: 859px) {
  .facet__btn { min-height: 44px; }
  .facet__filter .input { height: 44px; font-size: 16px; }
}
/* inside the Filters sheet the dialog body scrolls, so the provider list does not */
.cat-sheet .cat-rail { gap: 24px; }
.cat-sheet .facet__scroll { max-height: none; overflow: visible; }

/* toolbar */
.cat-tools { display: flex; flex-wrap: wrap; gap: 10px; }
.search { position: relative; display: block; flex: 1 1 280px; min-width: 0; }
.search > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-left: 42px; }
.search .input::-webkit-search-cancel-button { cursor: pointer; }
.cat-sort { display: block; flex: 1 1 200px; min-width: 0; max-width: 240px; }
.cat-filters-btn { height: 48px; flex: none; }
.cat-filters-btn__n {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill);
  background: var(--accent-tint); color: var(--accent); font: 600 11px/1 var(--font-mono);
}
@media (min-width: 860px) { .cat-filters-btn { display: none; } }
@media (max-width: 859px) { .cat-sort { max-width: none; } }
.cat-count { margin-top: 14px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.cat-count strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.cat-active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.fchip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px 0 12px; max-width: 100%;
  border-radius: var(--r-pill); border: 1px solid var(--accent-line); background: var(--accent-tint);
  color: var(--text); font-size: 13.5px; font-weight: 500; white-space: nowrap;
}
.fchip .icon { width: 16px; height: 16px; color: var(--muted); }
.fchip:hover .icon { color: var(--text); }
.cat-active .btn--quiet { min-height: 32px; font-size: 14px; }
@media (max-width: 819px) { .fchip { height: 44px; } .cat-active .btn--quiet { min-height: 44px; } }

/* ------------------------------------------------------------------------------------------------ model rows (/models) */
.cat-list { margin-top: 16px; }
.mlist { list-style: none; border: 1px solid var(--line); border-radius: var(--r3); background: var(--panel); overflow: hidden; box-shadow: var(--shadow-card); }
.mlist__group {
  padding: 12px 16px; background: var(--panel-3); border-top: 1px solid var(--line-row);
  font: 600 11px/1.4 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent);
}
.mlist__group:first-child { border-top: 0; }
.mrow {
  display: grid; align-items: center; column-gap: 16px; row-gap: 4px; padding: 14px 16px;
  border-top: 1px solid var(--line-row); transition: background-color var(--t1);
  grid-template-columns: 28px minmax(0, 1fr) auto;
  grid-template-areas: "mono who act" "mono price act" "mono meta meta";
}
.mrow:first-child { border-top: 0; }
.mrow:hover { background: var(--panel-2); }
.mono-tile {
  grid-area: mono; align-self: start; width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--r2);
  background: var(--panel-2); color: var(--dim); font: 600 13px/1 var(--font-mono); text-transform: uppercase;
}
.mrow:hover .mono-tile { background: var(--panel-3); }
.mrow__who { grid-area: who; min-width: 0; }
.mrow__name { font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--text); overflow-wrap: anywhere; }
.mrow__prov { margin-top: 1px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.mrow__id, .mrow__type, .mrow__ctx { display: none; }
.mrow__id { grid-area: id; min-width: 0; font: 400 12.5px/1.4 var(--font-mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow__type { grid-area: type; }
.mrow__ctx { grid-area: ctx; font: 400 12.5px/1.4 var(--font-mono); color: var(--muted); white-space: nowrap; }
.mrow__meta { grid-area: meta; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; font: 400 12.5px/1.5 var(--font-mono); color: var(--muted); }
.mrow__meta-id { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow__price { grid-area: price; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mrow__usd { font: 500 13px/1.4 var(--font-mono); color: var(--dim); font-variant-numeric: tabular-nums; }
.mrow__per { color: var(--muted); font-weight: 400; }
.mrow__turn { font: 500 12.5px/1.4 var(--font-mono); color: var(--accent); font-variant-numeric: tabular-nums; }
.mrow__free { font: 600 13px/1.4 var(--font-mono); color: var(--accent); }
.mrow__varies, .mrow__unlisted { font: 500 13px/1.4 var(--font-mono); color: var(--muted); }
.mrow__act { grid-area: act; justify-self: end; }
.mrow__chat { gap: 6px; padding: 0 12px; }
.mrow__chat .icon { width: 16px; height: 16px; }
.mrow__api { font: 600 11px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0 6px; }
.tchip {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); font: 600 11px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap;
}
/* 860 to 1439: two lines, price and action on the right */
@media (min-width: 860px) {
  .mrow {
    grid-template-columns: 28px minmax(0, 1fr) minmax(150px, auto) auto;
    grid-template-areas: "mono who price act" "mono meta price act";
  }
  .mrow__price { align-items: flex-end; text-align: right; }
}
/* 1440 and up: the full heyaskr row */
@media (min-width: 1440px) {
  .mrow {
    grid-template-columns: 28px minmax(0, 1.35fr) minmax(0, 1.1fr) 104px 72px minmax(170px, 1fr) 84px;
    grid-template-areas: "mono who id type ctx price act";
    row-gap: 0;
  }
  .mrow__id, .mrow__ctx { display: block; }
  .mrow__type { display: block; }
  .mrow__meta { display: none; }
  .mono-tile { align-self: center; }
}
.cat-more { display: flex; justify-content: center; margin-top: 20px; }
.cat-notes { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 28px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.cat-notes li { padding-left: 1.2em; text-indent: -1.2em; }
.cat-notes li::before { content: "/"; color: var(--accent); font-family: var(--font-mono); margin-right: .55em; }
.cat-notes .link { color: var(--dim); }
.cat-notes .btn--quiet { min-height: 0; font-size: 13.5px; text-indent: 0; }
.cat-notes .btn--quiet::before { content: none; }
.cat-list .state { margin-top: 0; }
.sk-row { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 16px; padding: 16px; border-top: 1px solid var(--line-row); }
.sk-row:first-child { border-top: 0; }
.sk-row .sk--tile { width: 28px; height: 28px; border-radius: var(--r2); }

/* ------------------------------------------------------------------------------------------------ pricing */
.askstrip {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-top: 16px;
  padding: 16px 20px; border: 1px solid var(--accent-line); border-left: 3px solid var(--accent); border-radius: var(--r3);
  background: linear-gradient(90deg, var(--accent-tint), var(--panel) 70%);
}
.askstrip p { flex: 1 1 320px; font-size: 15px; line-height: 1.55; color: var(--dim); }
.askstrip strong { color: var(--text); font-weight: 600; }
.ptable-wrap { margin-top: 16px; }
.ptable thead th { color: var(--accent); }
.ptable th, .ptable td { padding: 12px 16px; }
.ptable .ptable__model { min-width: 0; font-weight: 400; }
.ptable__who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ptable__who .mono-tile { align-self: center; }
.ptable__name { display: block; font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--text); overflow-wrap: anywhere; }
.ptable__prov { display: block; font-size: 13px; line-height: 1.4; color: var(--muted); }
.ptable__unit { font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.ptable td.num { font: 500 13.5px/1.4 var(--font-mono); color: var(--dim); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ptable td.num.is-free { color: var(--accent); font-weight: 600; }
.ptable td.num.is-quiet { color: var(--muted); }
.ptable .num-head { text-align: right; }
@media (max-width: 639px) {
  .ptable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .ptable tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; padding: 14px 16px; border-bottom: 1px solid var(--line-row); }
  .ptable tbody tr:last-child { border-bottom: 0; }
  .ptable tbody th, .ptable tbody td { display: block; padding: 0; border: 0; }
  .ptable .ptable__model { grid-column: 1 / -1; }
  .ptable .ptable__unit { grid-column: 1 / -1; padding-left: 40px; white-space: normal; }
  .ptable td.num { text-align: left; padding-left: 40px; white-space: normal; }
  .ptable td.num + td.num { padding-left: 0; }
  .ptable td.num::before { content: attr(data-label); display: block; font: 600 11px/1.4 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
}
.fees { padding-block: var(--section); }
.fees .lede { margin-top: 16px; }
.fees__wrap { margin-top: 28px; }
.fees__table th[scope="row"] { color: var(--text); font-weight: 600; white-space: nowrap; }
.fees__table td.num { font: 500 13.5px/1.5 var(--font-mono); color: var(--dim); white-space: nowrap; }
.fees__table td.fees__to { font-size: 14.5px; line-height: 1.5; color: var(--body); min-width: 16ch; }
.fees__table .is-planned { color: var(--muted); }
.fees__note { margin-top: 16px; font-size: 14.5px; color: var(--muted); }
.fees__pending { display: block; font-size: 12.5px; color: var(--warn); white-space: normal; }
@media (max-width: 719px) {
  .fees__table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .fees__table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; padding: 16px; border-bottom: 1px solid var(--line-row); }
  .fees__table tbody tr:last-child { border-bottom: 0; }
  .fees__table tbody th, .fees__table tbody td { display: block; padding: 0; border: 0; }
  .fees__table th[scope="row"] { grid-column: 1 / -1; font-size: 16px; }
  .fees__table td.fees__to { grid-column: 1 / -1; min-width: 0; }
  .fees__table td::before { content: attr(data-label); display: block; font: 600 11px/1.4 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
}
.faq-sec { padding-block: var(--section); }
.faq-sec .faq { margin-top: 28px; max-width: 880px; }

/* ------------------------------------------------------------------------------------------------ calculator */
.calc-head__line { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; font-size: 14.5px; color: var(--muted); }
.calc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: start; padding-bottom: var(--section); }
@media (min-width: 1024px) { .calc { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 64px; } }
.calc-controls { display: flex; flex-direction: column; gap: 36px; min-width: 0; }
.calc-step { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.calc-q { padding: 0; font: 600 17px/1.4 var(--font-body); color: var(--text); }
.calc-q__n { font-family: var(--font-mono); font-weight: 600; color: var(--accent); margin-right: .35em; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  min-width: 64px; height: 44px; padding: 0 16px; border-radius: var(--r2); border: 1px solid var(--line-strong); background: var(--panel);
  font: 600 15px/1 var(--font-mono); color: var(--dim); font-variant-numeric: tabular-nums;
  transition: background-color var(--t2), border-color var(--t2), color var(--t1);
}
.pill:hover { border-color: var(--line-input); color: var(--text); }
.pill[aria-pressed="true"] { background: var(--accent-tint); border-color: var(--accent-line); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent-line); }
.calc-other { max-width: 280px; }
.calc-range { display: flex; flex-direction: column; gap: 10px; }
.calc-range__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.calc-range__row label { font-size: 15px; color: var(--dim); }
.calc-readout { font: 600 20px/1 var(--font-mono); color: var(--text); font-variant-numeric: tabular-nums; }
.range {
  width: 100%; height: 44px; margin: 0; background: transparent; accent-color: var(--action); cursor: pointer;
}
.range:focus-visible { outline-offset: 4px; }
.calc-range__ends { display: flex; justify-content: space-between; font: 400 11.5px/1.4 var(--font-mono); color: var(--faint); }
.calc-model .select { max-width: 100%; }
.calc-result { position: relative; display: flex; flex-direction: column; gap: 20px; border-color: var(--line-strong); }
@media (min-width: 1024px) { .calc-result { position: sticky; top: calc(var(--header-h) + 24px); } }
.calc-figure { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.calc-figure__n { font: 400 clamp(40px, 5vw, 60px)/1.05 var(--font-display); color: var(--accent); letter-spacing: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.calc-figure__u { font: 600 18px/1.3 var(--font-body); color: var(--dim); }
.calc-line { font-size: 16px; line-height: 1.55; color: var(--body); }
.calc-line strong { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.bars { display: flex; flex-direction: column; gap: 14px; padding-top: 18px; border-top: 1px solid var(--line); }
.bar__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); }
.bar__row strong { font: 600 15px/1.2 var(--font-mono); color: var(--text); font-variant-numeric: tabular-nums; }
.bar__track { height: 6px; margin-top: 8px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
[data-theme="light"] .bar__track { background: var(--line); }
.bar__fill { display: block; height: 100%; width: var(--w, 0%); border-radius: 3px; background: var(--line-strong); transition: width var(--t3) var(--ease-out); }
[data-theme="light"] .bar__fill { background: var(--line-input); }
.bar__fill--accent { background: var(--accent) !important; }
.calc-book { font-size: 14px; line-height: 1.55; color: var(--dim); }
.calc-fine { padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.6; color: var(--muted); }
.calc-gw { font-size: 13.5px; line-height: 1.55; color: var(--dim); padding: 12px 14px; border-radius: var(--r2); background: var(--panel-2); border-left: 3px solid var(--muted); }
.calc-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.calc-actions .btn { flex: 1 1 auto; }
@media (min-width: 480px) { .calc-actions .btn { flex: 0 0 auto; } }
.calc-result .skeleton { gap: 14px; }
.facet__why { display: block; margin-top: 6px; color: var(--muted); }
.fees__sk:empty { display: none; }
.fees__sk { padding: 16px; }
.fees__sk .state { border: 0; }
.calc-step .seg { align-self: flex-start; }
