/*
 * /compare only (loaded through `styles` in app/site.php): a compact
 * comparison matrix.
 *
 * Dark mode exists on this page alone, and only when the visitor picks it
 * with the Light / Dark switch (compare.js sets body[data-theme]; the choice
 * is not saved). The default is light, like the rest of the site.
 */

/* --------------------------------------------------------- dark theme -- */

body.page-compare[data-theme="dark"] {
  color-scheme: dark;
  --ink: #EEF1F5; --text: #C9D1DB; --muted: #9DA8B7; --faint: #7D8796; --charcoal: #D5DBE4;
  --paper: #0F1722; --paper-2: #141E2B; --paper-3: #1C2838; --white: #172233;
  --line: #2A3647; --line-strong: #3E4C60;
  --teal: #86CAC3; --teal-soft: #16302E; --copper-deep: #EBA585; --copper-soft: #3A2318;
  --st-available: #93D3A8; --st-available-bg: #15301F; --st-development: #E8C27E; --st-development-bg: #31260F;
  --st-planned: #AFC5E2; --st-planned-bg: #1B293B; --st-evaluation: #C2BAB0; --st-evaluation-bg: #26231F;
  --cx-lead: #1A2C2B; --cx-lead-line: #4F8F89;
}

body.page-compare { --cx-lead: #E6F0EE; --cx-lead-line: #8DBDB8; }

/* Pieces of site.css with fixed light colors. */
body.page-compare[data-theme="dark"] .site-header { background: rgba(15, 23, 34, 0.96); }
body.page-compare[data-theme="dark"] .brand__mark { fill: #DCE3EC; }
body.page-compare[data-theme="dark"] .btn--primary, body.page-compare[data-theme="dark"] .section--dark a.btn--primary, body.page-compare[data-theme="dark"] .share-float__button, body.page-compare[data-theme="dark"] .status--current { background: #A4451F; }
body.page-compare[data-theme="dark"] .btn--primary:hover, body.page-compare[data-theme="dark"] .share-float__button:hover { background: #8E3B1A; }
body.page-compare[data-theme="dark"] .status--concept { color: #CDB6DA; background: #2A2131; }
body.page-compare[data-theme="dark"] {
  --mx-yes: #6FCF97; --mx-partial: #F2C14E; --mx-addon: #7FB2F0; --mx-no: #F08A80; --mx-planned: #A3ADBB;
  --mx-ou: rgba(197, 90, 43, 0.13); --mx-ou-head: #2A1C16; --mx-row: rgba(255, 255, 255, 0.025); --mx-group: #1A2533;
}
body.page-compare {
  --mx-yes: #1E7F4A; --mx-partial: #B26B00; --mx-addon: #2462B0; --mx-no: #C2372B; --mx-planned: #677285;
  --mx-ou: rgba(197, 90, 43, 0.07); --mx-ou-head: #F6E6DC; --mx-row: rgba(16, 24, 40, 0.025); --mx-group: #ECE8DF;
  background: var(--paper);
}

/* ------------------------------------------------------------- frame -- */

.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mx-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.cmp { padding: 1.25rem 0 2.5rem; }
.cmp-wrap { width: 100%; max-width: 88rem; margin: 0 auto; padding: 0 var(--gutter); }
.cmp-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 0.9rem; }
.cmp-head .crumbs { margin: 0 0 0.35rem; }
.cmp-head h1 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.15rem); line-height: 1.15; margin: 0 0 0.4rem; }
.cmp-intro { margin: 0; max-width: 62rem; font-size: 0.95rem; color: var(--muted); }

.cmp-theme { display: inline-flex; flex: none; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.cmp-theme[hidden] { display: none; }
.cmp-theme button { font: 500 0.78rem/1 var(--sans); color: var(--text); background: transparent; border: 0; padding: 0.45rem 0.75rem; min-height: 2rem; cursor: pointer; }
.cmp-theme button + button { border-left: 1px solid var(--line-strong); }
.cmp-theme button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ----------------------------------------------------------- toolbar -- */

.mx-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin: 0 0 0.6rem; }
.mx-bar[hidden] { display: none; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; background: var(--white); }
.seg label { position: relative; margin: 0; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 0.42rem 0.75rem; font: 500 0.8rem/1.2 var(--sans); color: var(--text); text-transform: none; letter-spacing: 0; white-space: nowrap; }
.seg label + label span { border-left: 1px solid var(--line-strong); }
.seg input:checked + span { background: var(--ink); color: var(--paper); }
.seg input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: -3px; }
.mx-search, .mx-cat { margin: 0; }
.mx-bar input[type="search"], .mx-bar select { font-size: 0.82rem; min-height: 2.05rem; padding: 0.3rem 0.6rem; width: auto; }
.mx-bar input[type="search"] { width: 13rem; }
.mx-bar__btns { display: inline-flex; gap: 0.35rem; margin-left: auto; }
.mx-btn { font: 500 0.78rem/1 var(--sans); color: var(--text); background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 0.45rem 0.65rem; min-height: 2.05rem; cursor: pointer; }
.mx-btn:hover { border-color: var(--ink); }
.mx-note { margin: 0 0 0.5rem; font-size: 0.82rem; color: var(--muted); border-left: 3px solid var(--copper); padding: 0.15rem 0 0.15rem 0.6rem; }
.mx-note[hidden] { display: none; }
.mx-note strong { color: var(--ink); }

.mx-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; list-style: none; margin: 0 0 0.5rem; padding: 0; font-size: 0.76rem; color: var(--muted); }
.mx-legend li { display: inline-flex; align-items: center; gap: 0.3rem; margin: 0; }
.mx-legend li + li { margin-top: 0; }
.mx-legend__count { margin-left: auto !important; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ matrix -- */

.mx { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 0.85rem; line-height: 1.3; margin: 0; background: var(--white); border: 1px solid var(--line); }
.mx caption { caption-side: top; }
.mx-col-f { width: 31%; }
.mx-col-ou { width: 25%; }
.mx th, .mx td { padding: 0.42rem 0.7rem; border: 0; border-bottom: 1px solid var(--line); vertical-align: middle; text-align: left; text-transform: none; letter-spacing: 0; }
.mx thead th { position: sticky; top: var(--header-h); z-index: 6; background: var(--white); border-bottom: 2px solid var(--line-strong); padding: 0.5rem 0.7rem; font: 600 0.86rem/1.2 var(--sans); color: var(--ink); }
.mx thead .mx-h--f { font: 500 0.7rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); vertical-align: bottom; }
.mx thead .mx-h--ou { background: var(--mx-ou-head); box-shadow: inset 0 3px 0 var(--copper); }
.mx-prod { display: inline-flex; align-items: center; gap: 0.5rem; }
.mx-prod small { display: block; font: 400 0.7rem/1.2 var(--sans); color: var(--muted); margin-top: 0.1rem; }
.mx-logo { width: 1.25rem; height: 1.25rem; flex: none; color: var(--ink); }
.mx tbody th { font-weight: 400; color: var(--text); }
.mx tbody tr[data-row]:nth-child(odd) > * { background-image: linear-gradient(var(--mx-row), var(--mx-row)); }
.mx tbody tr[data-row]:hover > * { background-image: linear-gradient(rgba(42, 127, 120, 0.07), rgba(42, 127, 120, 0.07)); }
.mx td.mx-ou { background-color: var(--mx-ou); }
.mx tr.is-target > * { box-shadow: inset 0 0 0 2px var(--teal); }
.mx tr[data-row] { scroll-margin-top: calc(var(--header-h) + 4rem); }

.mx-gh th { padding: 0; background: var(--mx-group); border-bottom: 1px solid var(--line-strong); }
.mx-gh button { display: flex; align-items: center; gap: 0.45rem; width: 100%; background: transparent; border: 0; padding: 0.4rem 0.7rem; font: 600 0.8rem/1.2 var(--sans); color: var(--ink); text-align: left; cursor: pointer; }
.mx-gh button:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.mx-chev { width: 0.9rem; height: 0.9rem; flex: none; transition: transform 0.12s; }
.is-closed .mx-chev { transform: rotate(-90deg); }
.is-closed tr[data-row] { display: none; }
.mx-n { font: 400 0.72rem/1 var(--mono); color: var(--muted); }
.mx tbody[hidden] { display: none; }
.mx-empty { text-align: center !important; color: var(--muted); padding: 1rem !important; }

.mx-v { position: relative; display: inline-flex; align-items: center; gap: 0.35rem; max-width: 100%; }
.mx-v.has-tip { cursor: help; }
.mx-name.has-tip { text-decoration: underline dotted var(--line-strong); text-underline-offset: 3px; }
.mx-v:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 2px; }
.mx[data-view="final"] .v-now, .mx[data-view="now"] .v-final { display: none; }
.mx-i { width: 1.05rem; height: 1.05rem; flex: none; }
.mx-i--yes { color: var(--mx-yes); }
.mx-i--partial { color: var(--mx-partial); }
.mx-i--addon { color: var(--mx-addon); }
.mx-i--no { color: var(--mx-no); }
.mx-i--planned, .mx-i--unk, .mx-i--na { color: var(--mx-planned); }
.mx-t { font-size: 0.76rem; color: var(--muted); line-height: 1.25; }
.mx-tip { display: none; position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: max-content; max-width: min(19rem, 75vw); padding: 0.5rem 0.65rem; background: var(--ink); color: var(--paper); font: 400 0.76rem/1.4 var(--sans); border-radius: 4px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); white-space: normal; text-align: left; }
.mx td:last-child .mx-tip, .mx td:nth-child(3) .mx-tip { left: auto; right: 0; }
.has-tip:hover > .mx-tip, .has-tip:focus > .mx-tip { display: block; }
.mx-foot { margin: 0.6rem 0 0; font-size: 0.78rem; color: var(--muted); }

/* ---------------------------------------------------------------- end -- */

.cmp-end { margin-top: 1.25rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 2rem; }
.cmp-disclaimer { margin: 0; font-size: 0.8rem; color: var(--muted); max-width: 62rem; }
.cmp-cta { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }

/* ------------------------------------------------------------- small -- */

@media (max-width: 64rem) {
  .mx-bar__btns { margin-left: 0; }
  .mx-col-f { width: 34%; }
  .mx-col-ou { width: 24%; }
}
@media (max-width: 40rem) {
  .cmp-head { flex-direction: column; align-items: flex-start; }
  .mx-bar input[type="search"] { width: 100%; }
  .mx-search, .mx-cat { flex: 1 1 100%; }
  .mx-bar select { width: 100%; }
  .seg { flex: 1 1 100%; }
  .seg label { flex: 1; }
  .seg span { text-align: center; padding: 0.42rem 0.4rem; }
  .mx { font-size: 0.76rem; }
  .mx-col-f { width: 37%; }
  .mx-col-ou { width: 23%; }
  .mx th, .mx td { padding: 0.38rem 0.35rem; }
  .mx thead th { padding: 0.45rem 0.35rem; font-size: 0.74rem; }
  .mx-prod small, .mx-logo { display: none; }
  .mx-t { font-size: 0.66rem; }
  .mx-v { flex-wrap: wrap; gap: 0.15rem; }
  .mx-legend__count { margin-left: 0 !important; }
}

@media print {
  .mx-bar, .cmp-theme, .mx-tip { display: none !important; }
  .mx thead th { position: static; }
  .is-closed tr[data-row] { display: table-row; }
}
