/* betzcas-compare.css — comparator, tools and editorial components.
   Loaded AFTER /assets/betzcas-mx.css (tokens --brand, --bg, --panel, --text, --dim, --line, --warn).
   Mobile-first. No web fonts, no framework. */

:root {
  --ok: #6ee7a8;
  --ok-bg: rgba(110,231,168,0.10);
  --bad: #fca5a5;
  --bad-bg: rgba(252,165,165,0.10);
  --unk: #cbd5e1;
  --unk-bg: rgba(203,213,225,0.08);
  --focus: #c4b5fd;
}
.wrap.wide { max-width: 1120px; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; color: #000; padding: 10px 14px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }

/* header / nav ------------------------------------------------------- */
header.site { flex-wrap: wrap; }
nav.top { display: flex; flex-wrap: wrap; gap: 4px 4px; }
nav.top a { margin-left: 0; padding: 8px 10px; font-size: 0.85rem; border-radius: 8px; min-height: 44px; display: inline-flex; align-items: center; }
nav.top a[aria-current="page"] { color: var(--text); background: rgba(255,255,255,0.07); }

/* answer box / summary ---------------------------------------------- */
.answer { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 8px; padding: 16px 18px; margin: 0 0 22px; font-size: 1.02rem; }
.answer strong { color: var(--text); }
.meta-line { color: var(--dim); font-size: 0.82rem; margin-bottom: 18px; }
.meta-line a { color: var(--brand-soft); }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin: 0 0 22px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.kpi b { display: block; font-size: 1.5rem; line-height: 1.2; }
.kpi span { color: var(--dim); font-size: 0.8rem; }

/* badges (never rely on colour alone: each carries text) ------------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; line-height: 1.6; border: 1px solid transparent; white-space: nowrap; }
.badge.ok { color: var(--ok); background: var(--ok-bg); border-color: rgba(110,231,168,0.35); }
.badge.warn { color: var(--warn); background: var(--warn-bg); border-color: rgba(240,180,94,0.4); }
.badge.bad { color: var(--bad); background: var(--bad-bg); border-color: rgba(252,165,165,0.35); }
.badge.unk { color: var(--unk); background: var(--unk-bg); border-color: rgba(203,213,225,0.25); }
.badge.src { color: var(--brand-soft); background: rgba(139,107,245,0.10); border-color: rgba(139,107,245,0.35); }

/* filter bar --------------------------------------------------------- */
.filters { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 0 0 14px; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.filters label { display: block; font-size: 0.8rem; color: var(--dim); margin-bottom: 4px; }
.filters input[type="search"], .filters select { width: 100%; min-height: 44px; padding: 8px 10px; font: inherit; color: var(--text); background: #14141f; border: 1px solid rgba(255,255,255,0.22); border-radius: 8px; }
.filters .check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.filters .check input { width: 22px; height: 22px; accent-color: var(--brand); }
.filters .check label { margin: 0; color: var(--text); font-size: 0.9rem; }
.filters button, .btn-s { min-height: 44px; padding: 8px 14px; font: inherit; font-weight: 700; color: var(--text); background: transparent; border: 1px solid rgba(255,255,255,0.3); border-radius: 8px; cursor: pointer; }
.filters button:hover, .btn-s:hover { border-color: var(--brand-soft); color: var(--brand-soft); }
.result-count { color: var(--dim); font-size: 0.85rem; margin: 6px 0 10px; }
.no-js-note { color: var(--dim); font-size: 0.85rem; }
.js .no-js-note { display: none; }
.filters, .compare-panel[data-js] { }
html:not(.js) .filters { display: none; }

/* data table --------------------------------------------------------- */
.table-wrap { position: relative; border: 1px solid var(--line); border-radius: 10px; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.86rem; min-width: 0; }
table.data caption { text-align: left; padding: 10px 12px; color: var(--dim); font-size: 0.82rem; }
table.data thead th { position: sticky; top: 0; background: #1a1530; color: #ddd6fe; text-align: left; padding: 10px 12px; white-space: nowrap; z-index: 1; }
table.data thead th button { all: unset; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; min-height: 24px; }
table.data thead th button:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
table.data th[aria-sort="ascending"] button::after { content: "▲"; font-size: 0.7em; }
table.data th[aria-sort="descending"] button::after { content: "▼"; font-size: 0.7em; }
table.data tbody th { text-align: left; font-weight: 700; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tbody tr:hover { background: rgba(255,255,255,0.03); }
table.data td.sel { width: 1%; }
table.data td.sel input { width: 22px; height: 22px; accent-color: var(--brand); }
table.data .dom { font-weight: 700; word-break: break-word; }
table.data .sub { color: var(--dim); font-size: 0.78rem; display: block; }
table.data a { color: var(--brand-soft); }
.small { font-size: 0.82rem; color: var(--dim); }

/* phones: each row becomes a labelled card (roles keep table semantics) */
@media (max-width: 760px) {
  table.data.cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.data.cards, table.data.cards tbody, table.data.cards tr, table.data.cards td, table.data.cards tbody th { display: block; width: 100%; }
  table.data.cards tr { padding: 12px 12px 6px; border-bottom: 1px solid var(--line); }
  table.data.cards tbody th, table.data.cards td { border: 0; padding: 4px 0; }
  table.data.cards td::before { content: attr(data-label); display: block; color: var(--dim); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.4px; }
  table.data.cards td.sel { width: 100%; }
  table.data.cards td.sel::before { display: none; }
  table.data.cards td.sel label { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; }
}

/* non-card tables scroll horizontally instead of squeezing */
.table-wrap { overflow-x: auto; }
table.data:not(.cards) { min-width: 540px; }
@media (max-width: 760px) { table.data.cards { min-width: 0; } table.data.cards caption { display: block; width: 100%; } }

/* side-by-side panel (matrix table: criteria x operators) ------------- */
.compare-panel { margin: 22px 0; }
.compare-panel[hidden] { display: none; }
table.matrix { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 0.85rem; }
table.matrix th, table.matrix td { padding: 10px 12px; border: 1px solid var(--line); vertical-align: top; text-align: left; }
table.matrix thead th { background: #1a1530; color: #ddd6fe; }
table.matrix tbody th { background: rgba(255,255,255,0.03); width: 22%; min-width: 130px; }
.matrix-scroll { overflow-x: auto; border-radius: 10px; }
.matrix-scroll:focus-visible { outline: 2px solid var(--focus); }

/* generic content ----------------------------------------------------- */
.toc { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin: 0 0 24px; }
.toc ol { padding-left: 20px; }
.toc a { color: var(--brand-soft); }
.card-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 14px 0 24px; }
.card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; color: var(--text); text-decoration: none; }
.card:hover, .card:focus-visible { border-color: var(--brand-soft); }
.card h3 { font-size: 1rem; margin: 0 0 6px; }
.card p { color: var(--dim); font-size: 0.88rem; margin: 0; }
.card .go { display: inline-block; margin-top: 8px; color: var(--brand-soft); font-size: 0.82rem; font-weight: 700; }
@media (min-width: 700px) { .card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } .kpis { grid-template-columns: repeat(4, minmax(0,1fr)); } .filters { grid-template-columns: 2fr 1fr 1.4fr 1fr 1fr; align-items: end; } }

/* calculator --------------------------------------------------------- */
.calc { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 0 0 24px; }
.calc-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 700px) { .calc-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.field label { display: block; font-size: 0.85rem; margin-bottom: 4px; }
.field .hint { color: var(--dim); font-size: 0.76rem; margin-top: 3px; }
.field input, .field select { width: 100%; min-height: 44px; padding: 8px 10px; font: inherit; color: var(--text); background: #14141f; border: 1px solid rgba(255,255,255,0.22); border-radius: 8px; }
.field input[aria-invalid="true"] { border-color: var(--bad); }
.field .err { color: var(--bad); font-size: 0.78rem; min-height: 1.1em; }
.results { margin-top: 16px; display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 700px) { .results { grid-template-columns: repeat(3, minmax(0,1fr)); } }
.res { background: #14141f; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.res b { display: block; font-size: 1.25rem; }
.res span { color: var(--dim); font-size: 0.78rem; }
.calc .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.disclaimer { margin-top: 14px; padding: 12px 14px; border-left: 4px solid var(--warn); background: var(--warn-bg); border-radius: 6px; font-size: 0.88rem; }

/* change log timeline ------------------------------------------------- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { border-left: 2px solid var(--line); padding: 0 0 22px 18px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.timeline time { font-weight: 700; display: block; }
.timeline h3 { font-size: 1rem; margin: 2px 0 6px; }
.timeline dl { margin: 6px 0 0; font-size: 0.88rem; }
.timeline dt { color: var(--dim); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.4px; margin-top: 8px; }
.timeline dd { margin: 0; }
.timeline a { color: var(--brand-soft); }

/* definition table (ficha) -------------------------------------------- */
table.spec { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.spec th, table.spec td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.spec th { width: 28%; min-width: 120px; color: var(--text); background: rgba(255,255,255,0.03); }
@media (max-width: 560px) { table.spec th, table.spec td { display: block; width: 100%; } table.spec th { border-bottom: 0; padding-bottom: 2px; } }

.sponsor { margin: 22px 0; padding: 16px; border: 1px dashed rgba(255,255,255,0.25); border-radius: 12px; }
.sponsor p { margin-bottom: 10px; }
.disclosure { font-size: 0.8rem; color: var(--dim); }
.btn-link { display: inline-block; min-height: 44px; padding: 11px 22px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), #4c2fc7); color: #fff; font-weight: 800; text-decoration: none; }
.btn-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.content-block a, .answer a, .intro a { color: var(--brand-soft); text-decoration: underline; text-underline-offset: 2px; }
@media print { header.site, .filters, .sponsor, nav.top { display: none; } body { background: #fff; color: #000; } }
tr[hidden], .compare-panel[hidden], [hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* contrast + robustness overrides (shared footer text was #6b7280 = 4.07:1) */
footer.legal, footer.legal p, footer.legal .flinks { color: #a7adba; }
main a:not(.card):not(.btn-link):not(.btn-s):not(.hrb-banner-link), .card .go { color: #b9aaff; }
main a.card { color: var(--text); }
.hrb-banner-wrap img { max-width: 100%; height: auto; display: block; }
.hrb-banner-wrap { max-width: 520px; margin: 0 auto; }
table.data tbody th { background: transparent; color: var(--text); }
