/* Midas multi-store pages — VERSION 2 "Instrument Cluster" (compare-2.php, overview-2.php)
   Same identity as the v2 store report: dark cockpit, hazard stripe, Chakra Petch + Manrope,
   Chart.js charts. Prints on a light palette with the Pinnacle footer. */
:root {
  --bg: #0d0e10; --panel: #16181b; --panel-2: #1c1f23; --line: #272b31; --grid: #23272c;
  --ink: #f1f2f4; --muted: #9097a1; --accent: #ffd100; --red: #ff4b3e;
  --good: #34d27b; --warn: #ffb020; --bad: #ff5a4f;
  --a: #3fb6e8; --b: #ffd100; --a-soft: rgba(63, 182, 232, .16); --b-soft: rgba(255, 209, 0, .14);
  --tip: #f1f2f4; --tip-ink: #0d0e10;
  --font-display: "Chakra Petch", "Rajdhani", "Arial Narrow", sans-serif;
  --font-body: "Manrope", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #e9ebee; --panel: #ffffff; --panel-2: #f4f5f7; --line: #dcdfe4; --grid: #e8eaee;
    --ink: #121417; --muted: #5c636d; --good: #138a47; --warn: #b47300; --bad: #d02c21; --red: #d7261b;
    --a: #1f8fc4; --b: #c99a00; --a-soft: rgba(31, 143, 196, .12); --b-soft: rgba(201, 154, 0, .14);
    --tip: #121417; --tip-ink: #ffffff; color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #e9ebee; --panel: #ffffff; --panel-2: #f4f5f7; --line: #dcdfe4; --grid: #e8eaee;
  --ink: #121417; --muted: #5c636d; --good: #138a47; --warn: #b47300; --bad: #d02c21; --red: #d7261b;
  --a: #1f8fc4; --b: #c99a00; --a-soft: rgba(31, 143, 196, .12); --b-soft: rgba(201, 154, 0, .14);
  --tip: #121417; --tip-ink: #ffffff; color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.45; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- top bar ---------- */
.top { background: linear-gradient(180deg, #000 0%, #121417 100%); color: #fff; position: relative; }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: repeating-linear-gradient(-45deg, #ffd100 0 14px, #000 14px 28px); }
.top-in { max-width: 1240px; margin: 0 auto; padding: 18px 20px 22px; display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; }
.id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.logo { height: 50px; width: auto; flex: none; display: block; }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #9aa1ab; }
.title { font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 4.2vw, 40px); line-height: 1.05; margin: 2px 0 0; text-transform: uppercase; letter-spacing: .02em; }
.tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.pick { display: grid; gap: 4px; }
.pick label { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #9aa1ab; }
.pick select { font: inherit; font-weight: 700; font-size: 15px; padding: 9px 36px 9px 12px; border-radius: 8px; border: 1px solid #33373e; background: #1b1e22 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23ffd100' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 12px center; color: #fff; appearance: none; min-width: 200px; }
.pick select:focus-visible { outline: 2px solid #ffd100; outline-offset: 2px; }
.pick.a select { box-shadow: inset 4px 0 0 #3fb6e8; } .pick.b select { box-shadow: inset 4px 0 0 #ffd100; }
.vs { font-family: var(--font-display); font-weight: 700; color: #ffd100; font-size: 18px; padding-bottom: 9px; }
.btn { font: inherit; font-weight: 800; font-size: 14px; display: inline-flex; gap: 8px; align-items: center; background: #ffd100; color: #000; border: 0; border-radius: 8px; padding: 10px 16px; cursor: pointer; }
.btn:hover { background: #ffe14d; } .btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.btn svg { width: 16px; height: 16px; }

/* ---------- layout ---------- */
.main { max-width: 1240px; margin: 0 auto; padding-inline: 20px; padding-block: 24px 36px; display: grid; gap: 24px; }
.row { display: grid; gap: 18px; min-width: 0; }
.row.r-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.row.r-75 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.col { min-width: 0; display: grid; gap: 10px; align-content: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; min-width: 0; }
.h { font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.h small { font-family: var(--font-body); letter-spacing: 0; text-transform: none; font-size: 13px; }
.k { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.banner { background: var(--panel); border: 1px solid var(--warn); color: var(--warn); border-radius: 8px; padding: 10px 14px; font-weight: 700; font-size: 14px; }
.good { color: var(--good); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.muted { color: var(--muted); }
.canvas { position: relative; width: 100%; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.legend i { display: inline-block; width: 12px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* ---------- loading ---------- */
.loading { text-align: center; padding: 70px 20px; color: var(--muted); }
.spin { width: 40px; height: 40px; border: 4px solid var(--panel-2); border-top-color: var(--accent); border-radius: 50%; margin: 0 auto 14px; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { max-width: 460px; margin: 14px auto 0; height: 8px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s; }

/* ---------- compare: scoreboard ---------- */
.board { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 0; padding: 0; overflow: hidden; }
.side { padding: 20px 22px; display: grid; gap: 6px; }
.side.a { background: linear-gradient(90deg, var(--a-soft), transparent); border-left: 4px solid var(--a); }
.side.b { background: linear-gradient(270deg, var(--b-soft), transparent); border-right: 4px solid var(--b); text-align: right; }
.side .nm { font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1.05; text-transform: uppercase; }
.side .meta { font-size: 13px; color: var(--muted); }
.side .chips { display: flex; gap: 8px; flex-wrap: wrap; }
.side.b .chips { justify-content: flex-end; }
.chip { background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 700; }
.mid { display: grid; place-items: center; padding: 14px 20px; text-align: center; }
.score { font-family: var(--font-display); font-weight: 700; font-size: 58px; line-height: 1; font-variant-numeric: tabular-nums; }
.score .sa { color: var(--a); } .score .sb { color: var(--b); } .score .dash { color: var(--muted); margin: 0 8px; font-size: 38px; }

/* ---------- compare: tug-of-war rows ---------- */
.tug { display: grid; gap: 0; }
.tug-grp { font-size: 11.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 14px 0 6px; border-bottom: 1px solid var(--line); }
.tug-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tug-row:last-child { border-bottom: 0; }
.tv { font-variant-numeric: tabular-nums; }
.tv b { font-size: 17px; }
.tv small { display: block; font-size: 12px; color: var(--muted); }
.tv.a { text-align: right; } .tv.b { text-align: left; }
.tv.win b { color: var(--ink); } .tv:not(.win) b { color: var(--muted); }
.tv.a.win b::after { content: " ◀"; color: var(--a); font-size: 12px; }
.tv.b.win b::before { content: "▶ "; color: var(--b); font-size: 12px; }
.tm { display: grid; gap: 6px; text-align: center; }
.tm .lbl { font-weight: 800; font-size: 13.5px; }
.split { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--panel-2); }
.split i { display: block; height: 100%; }
.split .sa { background: var(--a); } .split .sb { background: var(--b); }
.split .gap { width: 2px; background: var(--panel); }

/* ---------- tech lists ---------- */
.tl { list-style: none; margin: 10px 0 0; padding: 0; }
.tl li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tl li:last-child { border-bottom: 0; }
.tl .r { font-family: var(--font-display); font-weight: 700; color: var(--muted); text-align: center; }
.tl .n { font-weight: 700; overflow-wrap: anywhere; }
.tl .s { font-weight: 800; font-variant-numeric: tabular-nums; }
.tl-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.tl-head .nm { font-family: var(--font-display); font-weight: 700; font-size: 20px; text-transform: uppercase; }
.panel.a { box-shadow: inset 0 3px 0 var(--a); } .panel.b { box-shadow: inset 0 3px 0 var(--b); }

/* ---------- overview ---------- */
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; min-width: 0; }
.tile .v { font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1.1; margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.tile .s { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.ins { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ins article { background: var(--panel-2); border-radius: 8px; padding: 14px 16px; border-left: 3px solid var(--line); }
.ins article.good { border-left-color: var(--good); } .ins article.warn { border-left-color: var(--warn); } .ins article.bad { border-left-color: var(--bad); }
.ins h3 { margin: 0 0 4px; font-size: 16px; font-weight: 800; color: var(--ink); text-wrap: balance; }
.ins p { margin: 0; font-size: 14px; color: var(--muted); }
.heat-wrap { overflow-x: auto; }
table.heat { border-collapse: separate; border-spacing: 3px; width: 100%; min-width: 980px; font-variant-numeric: tabular-nums; font-size: 13px; }
.heat th { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 4px 6px; text-align: center; vertical-align: bottom; }
.heat th.l, .heat td.l { text-align: left; }
.heat td { padding: 7px 6px; text-align: center; border-radius: 4px; font-weight: 700; white-space: nowrap; }
.heat td.l { font-weight: 800; background: transparent; padding-left: 0; }
.heat td.l small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.heat td.h-good { background: rgba(52, 210, 123, .20); color: var(--good); }
.heat td.h-warn { background: rgba(255, 176, 32, .18); color: var(--warn); }
.heat td.h-bad { background: rgba(255, 90, 79, .18); color: var(--bad); }
.heat td.h-na { background: var(--panel-2); color: var(--muted); }
.heat td.sc { background: var(--panel-2); color: var(--ink); }
.heat-key { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.heat-key i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; }
.leader { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.leader li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: center; }
.leader li:last-child { border-bottom: 0; }
.leader .r { font-family: var(--font-display); font-weight: 700; text-align: center; color: var(--muted); }
.leader li:first-child .r { background: var(--accent); color: #000; border-radius: 4px; }
.leader .n { font-weight: 700; overflow-wrap: anywhere; } .leader .n small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.leader .v { font-weight: 800; font-variant-numeric: tabular-nums; }
.checks { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; }

/* ---------- footer ---------- */
.foot { max-width: 1240px; margin: 0 auto; padding-inline: 20px; padding-block: 0 30px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; color: var(--muted); font-size: 13px; }
.foot a { color: var(--muted); }
.print-only, .print-foot { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .row.r-2, .row.r-75 { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ins { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .board { grid-template-columns: minmax(0, 1fr); }
  .side.b { text-align: left; border-right: 0; border-left: 4px solid var(--b); background: linear-gradient(90deg, var(--b-soft), transparent); }
  .side.b .chips { justify-content: flex-start; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tug-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tug-row .tm { grid-column: 1 / -1; grid-row: 1; }
  .pick { flex: 1 1 150px; } .pick select { min-width: 0; width: 100%; }
  .logo { height: 40px; }
}
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } .progress i { transition: none; } }


.signout { color: #9aa1ab; font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; align-self: flex-end; padding: 10px 4px; }
.signout:hover { color: #fff; }
.signout:focus-visible { outline: 2px solid #ffd100; outline-offset: 2px; }
/* ---------- print (light palette, landscape, Pinnacle footer) ---------- */
@page { size: letter landscape; margin: 11mm 11mm 16mm; }
@media print {
  :root { --bg: #ffffff; --panel: #ffffff; --panel-2: #f2f3f5; --line: #d7dade; --grid: #e6e8eb;
          --ink: #111111; --muted: #555a62; --good: #0f7a3a; --warn: #9a6000; --bad: #bf1f16; --red: #c21d13;
          --a: #1f8fc4; --b: #c99a00; --a-soft: rgba(31, 143, 196, .10); --b-soft: rgba(201, 154, 0, .12); color-scheme: light; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; font-size: 12px; }
  .no-print, .signout { display: none !important; }
  .print-only { display: block; }
  .top-in { padding: 10px 0 14px; max-width: none; }
  .logo { height: 38px; }
  .main { max-width: none; padding: 12px 0 0; gap: 14px; }
  .panel, .tile { break-inside: avoid; }
  .sec { break-inside: avoid; }
  .row.r-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .row.r-75 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .ins { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .heat-wrap { overflow: visible; }
  table.heat { min-width: 0; font-size: 10.5px; }
  .heat td { padding: 4px 3px; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }
  .foot { display: none; }
  .print-foot { display: none !important; }   /* footer comes from @page margin boxes (report-multi.js) */
  .h { break-after: avoid; }
  .col, .row, .board, .tiles, .ins { break-inside: avoid; }
  .col.can-break, .col.can-break .panel { break-inside: auto; }
  .tug-row, .tug-grp { break-inside: avoid; }
  .tug-grp { break-after: avoid; }
  .canvas { height: auto !important; }
  .canvas canvas { width: 100% !important; height: auto !important; }
}
