/* =====================================================================
   mixerfirmware.com — BoxCast dark theme (v2)
   ---------------------------------------------------------------------
   Design tokens are the source of truth. The DS-aligned semantic tokens
   (--color-*) carry the official BoxCast dark values; the short legacy
   vars (--bg, --surface, --muted, …) are aliases onto them so existing
   components pick up the palette without per-rule edits.
   Dark values per BoxCast Design System (Remote Mix Black #121419 page /
   brand black #1D1F2A card / bx-grey ramp) + the v2 Claude Design mock.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;800&family=Roboto:wght@400;500;700&display=swap');

/* ---- Design tokens ---- */
:root {
  /* Surfaces (dark) */
  --color-page:          #121419;   /* Remote Mix Black — app background */
  --color-surface:       #1d1f2a;   /* brand black — cards / panels */
  --color-hero:          #161922;   /* gradient-framed hero interior */
  --color-input:         #1a1d27;   /* form controls */
  --color-raised:        #2e2f38;   /* raised surface — hovered rows */
  --color-sidebar:       #0e1016;   /* app-shell rail, slightly under page */

  /* Borders */
  --color-border:        #3a3f47;
  --color-border-subtle: rgba(255, 255, 255, 0.06);
  --color-hairline:      rgba(255, 255, 255, 0.07);
  --color-field-border:  rgba(255, 255, 255, 0.12);

  /* Text */
  --color-text:          #e8eaed;   /* body */
  --color-heading:       #ffffff;   /* headings / strong */
  --color-muted:         #9d9ea3;   /* secondary */
  --color-faint:         #6e6f76;   /* labels / meta */

  /* Brand / accent */
  --color-link:          #0cd6e9;   /* Arctic — link/accent on dark */
  --color-accent:        #00a3bb;   /* accessible BoxCast blue — hover/darker */
  --color-brand-purple:  #8c4ee8;   /* Shallot — MSA promo */
  --color-success:       #38a250;
  --color-warning:       #fb8c00;
  --color-error:         #ff3939;

  /* ---- Legacy aliases (map old vars onto the tokens above) ---- */
  --bg:      var(--color-page);
  --surface: var(--color-surface);
  --text:    var(--color-text);
  --muted:   var(--color-muted);
  --border:  var(--color-border);
  --cyan:    var(--color-link);
  --blue:    var(--color-accent);
  --purple:  var(--color-brand-purple);
  --sunset:  rgb(250, 76, 60);
  --success: var(--color-success);
  --warn:    var(--color-warning);
  --err:     var(--color-error);

  /* Geometry */
  --radius:    6px;
  --radius-lg: 10px;
  --radius-pill: 9999px;
  --header-h: 48px;
  --sidebar-w: 264px;
  --max-w:   1180px;
  --pad-x:   34px;

  /* Type — BoxCast: Montserrat display, Roboto body */
  --font-body:    "Roboto", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-display: "Montserrat", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-mono:    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  /* legacy aliases */
  --font-head: var(--font-display);
  --font-em:   var(--font-display);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: #c7c9cf;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cyan); text-decoration: none; transition: color .15s; }
a:hover { color: var(--color-accent); text-decoration: none; }
::selection { background: rgba(0, 163, 187, .35); }
img { max-width: 100%; height: auto; display: block; }
code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; }

/* ---- App shell ---- */
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 200;
  background: var(--color-surface); color: var(--color-heading);
  border: 1px solid var(--color-border); border-radius: 6px;
  padding: 8px 14px; font-size: 13px; transition: top .15s;
}
.skip-link:focus { top: 8px; text-decoration: none; }

.app-shell { display: flex; min-height: 100vh; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}
/* First content block on a page that has no hero above it */
.container.page-top { padding-top: 30px; }

/* ---- Sidebar rail ---- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--color-sidebar);
  border-right: 1px solid var(--color-border-subtle);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 90;
}
.sidebar-brand {
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--color-border-subtle);
}
.sidebar-logo { width: 100%; height: auto; display: block; }
.sidebar-title {
  margin-top: 14px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--color-heading);
}
.sidebar-sub { margin-top: 2px; font-size: 12px; color: var(--color-faint); }

.sidebar-nav { padding: 18px 14px 8px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-label {
  padding: 0 8px 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  color: #57585f; text-transform: uppercase;
}
.side-link {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px; border-radius: 7px;
  font-size: 14px; color: var(--color-text);
  transition: background .12s, color .12s;
}
.side-link:hover { background: rgba(255,255,255,.04); color: var(--color-heading); text-decoration: none; }
.side-link.active { background: rgba(0,163,187,.14); color: var(--color-heading); box-shadow: inset 2px 0 0 var(--color-link); }
.side-link .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--color-link); flex-shrink: 0; }
.side-link .label-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 9px; }
.side-link .count { font-size: 12px; color: var(--color-faint); font-variant-numeric: tabular-nums; flex-shrink: 0; }

.sidebar-foot {
  margin-top: auto;
  padding: 16px 22px 20px;
  border-top: 1px solid var(--color-border-subtle);
  display: flex; flex-direction: column; gap: 8px;
}
.sidebar-foot a { font-size: 13px; color: var(--color-muted); }
.sidebar-foot a:hover { color: var(--color-heading); }

/* ---- Main column ---- */
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-main > main { flex: 1; padding: 0; }

/* ---- Mobile top bar + drawer (hidden on desktop) ---- */
.mobile-bar { display: none; }
.sidebar-overlay { display: none; }

/* ---- Footer ---- */
.site-footer {
  margin-top: 64px;
  border-top: 1px solid var(--color-hairline);
  padding: 30px 0 44px;
  text-align: center;
}
.footer-logo { height: 24px; width: auto; display: inline-block; opacity: .85; }
.footer-disclaimer {
  margin: 16px auto 0;
  max-width: 720px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--color-faint);
}
.footer-disclaimer a { color: var(--color-link); }

/* ---- Page header (interior pages; the home page has none) ---- */
.page-hero {
  padding: 34px 0 0;
  margin-bottom: 10px;
}
.page-hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: var(--color-heading);
  margin: 10px 0 0;
}
.page-hero .tagline {
  margin-top: 10px;
  color: var(--color-muted);
  font-size: 16px;
  max-width: 560px;
}
.accent-cyan  { color: var(--cyan); }
.accent-blue  { color: var(--blue); }
.accent-purple{ color: var(--purple); }

/* ---- Breadcrumb ---- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: #74747a;
}
.breadcrumb a { color: var(--color-muted); }
.breadcrumb a:hover { color: var(--cyan); }
.breadcrumb span { color: #4a4b52; }

/* ---- Search box ---- */
.search-wrap {
  position: relative;
  max-width: 560px;
}
.search-wrap input {
  width: 100%;
  padding: 11px 40px 11px 44px;
  background: var(--color-input);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-pill);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.search-wrap input::placeholder { color: #5a5b62; }
.search-wrap input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0, 163, 187, 0.16);
}
.search-wrap input::-webkit-search-cancel-button { display: none; }
.search-wrap .search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-faint);
  pointer-events: none;
  display: flex;
}
.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-clear[hidden] { display: none; }
.search-clear:hover { background: rgba(255, 255, 255, 0.16); }

/* ---- Model grid ---- */
.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 14px;
}
.model-card {
  background: var(--surface);
  border: 1px solid var(--color-hairline);
  border-radius: 9px;
  padding: 16px 18px;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  flex-direction: column;
}
.model-card:hover {
  border-color: rgba(0, 163, 187, 0.5);
  background: #222530;
  text-decoration: none;
}
.model-card.seq:hover {
  border-color: rgba(251, 140, 0, 0.5);
  background: #22252f;
}
.model-card-ver {
  font-size: 12px;
  color: var(--muted);
}
.model-card-ver .no-fw {
  color: var(--muted);
  font-style: italic;
}
.model-card[data-hidden="true"] { display: none; }

/* ---- v2 archive: sticky search + sections + cards ---- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(18, 20, 25, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border-subtle);
  padding: 14px var(--pad-x);
}
.topbar-inner { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.topbar .search-wrap { flex: 1; min-width: 220px; }
.topbar-controls { display: flex; align-items: center; gap: 14px; margin-left: auto; flex-shrink: 0; }

/* MSA toggle switch */
.switch { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #b7b9c0; cursor: pointer; user-select: none; white-space: nowrap; }
.switch-input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { width: 34px; height: 20px; border-radius: var(--radius-pill); background: rgba(255,255,255,.14); position: relative; transition: background .15s; flex-shrink: 0; }
.switch-knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch-input:checked + .switch-track { background: var(--color-accent); }
.switch-input:checked + .switch-track .switch-knob { left: 16px; }
.switch-input:focus-visible + .switch-track { outline: 2px solid var(--color-link); outline-offset: 2px; }

/* Sort select */
.sort-select {
  appearance: none; -webkit-appearance: none;
  background: var(--color-input); border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--color-text); font-family: var(--font-body); font-size: 13px;
  padding: 8px 30px 8px 12px; border-radius: 8px; outline: none; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.sort-select:focus { border-color: var(--color-accent); }

/* Empty state */
.empty-state {
  margin-top: 28px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 56px 24px;
  text-align: center;
}
.empty-title { font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--color-text); }
.empty-sub { margin-top: 8px; font-size: 15px; color: #8a8b91; }
.empty-state .btn { margin-top: 18px; }

.results-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin: 38px 0 0;
}
.results-title {
  font-family: var(--font-display); font-weight: 800; font-size: 20px;
  letter-spacing: 0.01em; color: var(--color-heading);
}
.results-count { font-size: 13px; color: #74747a; font-variant-numeric: tabular-nums; }

.make-section { margin-top: 36px; scroll-margin-top: 88px; }
.make-section[data-hidden="true"] { display: none; }
.make-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.make-name {
  font-family: var(--font-display); font-weight: 800; font-size: 15px;
  letter-spacing: 0.02em; color: var(--color-text); margin: 0; white-space: nowrap;
}
.make-count { font-size: 12px; color: var(--color-faint); font-variant-numeric: tabular-nums; }
.make-rule { flex: 1; height: 1px; background: var(--color-hairline); }

/* card internals */
.model-card { gap: 0; padding: 16px 18px; }
.mc-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mc-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-success); flex-shrink: 0; }
.model-card.seq .mc-dot { background: var(--color-warning); }
.model-card-name {
  font-family: var(--font-body); font-size: 15px; font-weight: 700; color: #f3f4f6;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mc-bottom {
  margin-top: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.ver-badge {
  font-size: 12.5px; font-weight: 500; color: #5fd6e6;
  background: rgba(0, 163, 187, 0.13); padding: 3px 10px; border-radius: var(--radius-pill);
}
.mc-bottom .no-fw { color: var(--color-faint); font-style: italic; font-size: 12.5px; }
.mc-bottom .ext-link { color: var(--color-link); font-size: 13px; }
.mc-bottom .seq-badge {
  margin-left: auto; margin-right: 0; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--color-warning); border: 1px solid rgba(251, 140, 0, 0.6);
  border-radius: var(--radius-pill); padding: 2px 8px; vertical-align: baseline;
}

/* ---- Section headers ---- */
.section-label {
  font-family: var(--font-em);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin: 28px 0 16px;
}

/* ---- Make page model list ---- */
.model-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.model-list-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: border-color 0.15s;
}
.model-list-item:hover { border-color: var(--cyan); text-decoration: none; }
.model-list-info { flex: 1; }
.model-list-name {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.model-list-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.model-list-ver { font-size: 13px; color: var(--cyan); white-space: nowrap; }

/* ---- Firmware version table ---- */
.fw-table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
}
.fw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.fw-table th {
  padding: 13px 18px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #57585f;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.fw-table td {
  padding: 16px 18px;
  vertical-align: middle;
  white-space: nowrap;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.fw-table td pre { white-space: pre-wrap; }
.fw-table tbody tr:first-child td { border-top: none; }
.fw-table td strong {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.01em;
  color: var(--color-heading);
}
.fw-badge-latest {
  background: var(--color-link);
  color: #0c1418;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  margin-left: 8px;
  text-transform: uppercase;
  vertical-align: middle;
}

/* ---- Checksum field ---- */
.sha-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sha-field {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--color-muted);
  background: #14171f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 7px 11px;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: text;
  user-select: all;
}
.copy-btn {
  background: #20232d;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 6px;
  color: #b7b9c0;
  font-family: var(--font-body);
  font-size: 12px;
  padding: 7px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.12s, border-color 0.12s;
}
.copy-btn:hover { color: var(--color-heading); border-color: var(--color-accent); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--color-link); color: #0c1418; }
.btn-primary:hover { background: #fff; color: #0c1418; }
.btn-outline {
  background: transparent; border: 2px solid var(--color-accent); color: var(--color-link);
}
.btn-outline:hover { background: var(--color-accent); color: #0c1418; }
.btn-sm { padding: 6px 14px; font-size: 12.5px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:disabled:hover { background: var(--color-link); color: #0c1418; }

/* ---- Firmware check widget ---- */
.fw-check-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin: 24px 0;
  max-width: 480px;
}
.fw-check-widget h3 {
  font-family: var(--font-em);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}
.fw-check-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.fw-check-input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.fw-check-input:focus { border-color: var(--cyan); }
#fw-check-result { font-size: 14px; }
#fw-check-result:not(:empty) { margin-top: 16px; }
.result-ok    { color: var(--success); }
.result-update{ color: var(--warn); }
.result-err   { color: var(--err); }

/* ---- Stat boxes ---- */
.stat-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  flex: 1;
  min-width: 120px;
}
.stat-num {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--cyan);
}
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---- Prose (about/trust/takedown) ---- */
.prose { max-width: 720px; padding-top: 8px; }
.prose h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.01em;
  margin: 32px 0 10px;
  color: var(--color-text);
}
.prose h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  margin: 22px 0 8px;
  color: var(--cyan);
}
.prose p { margin-bottom: 14px; font-size: 15px; line-height: 1.7; color: var(--muted); }
.prose ul { margin: 0 0 14px 20px; font-size: 15px; line-height: 1.7; color: var(--muted); }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--cyan); }
.prose code {
  background: #1a1c28;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 13px;
}

/* ---- Info boxes ---- */
.info-box {
  background: var(--color-input);
  border: 1px solid var(--color-hairline);
  border-left: 3px solid var(--blue);
  border-radius: 11px;
  padding: 20px 24px;
  margin: 24px 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
}
.info-box.warn { border-left-color: var(--warn); }
.info-box.success { border-left-color: var(--success); }
.info-box strong { color: var(--text); }
.info-box p { color: var(--muted); font-size: 14px; margin: 6px 0 12px; }
.model-card-ver .ext-link { color: var(--cyan); font-size: 13px; }

/* ---- MSA promo banner ---- */
.msa-banner {
  margin-top: 26px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(140, 78, 232, 0.35);
  background: linear-gradient(100deg, #1e1338 0%, #2b1a52 50%, #331f63 100%);
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.msa-banner-lead { flex: 1 1 340px; display: flex; align-items: center; gap: 26px; min-width: 0; }
.msa-banner-logo { height: 42px; width: auto; flex-shrink: 0; }
.msa-banner-text { min-width: 0; }
.msa-banner-text strong {
  display: block;
  font-family: var(--font-display); font-weight: 800; font-size: 20px;
  letter-spacing: .01em; color: #a97ef0;
}
.msa-banner-text p { margin-top: 5px; font-size: 16px; color: #b9b3ca; }
.msa-banner .btn {
  flex-shrink: 0; background: var(--purple); color: #fff;
  font-size: 15px; padding: 12px 24px; border-radius: 9px;
}
.msa-banner .btn:hover { background: #fff; color: var(--purple); }

/* Sequestered (non-MSA-verified) devices */
.seq-badge { display:inline-block; font-size:10px; text-transform:uppercase; letter-spacing:.04em;
  color:var(--warn); border:1px solid var(--warn); border-radius:4px; padding:1px 5px;
  margin-left:6px; vertical-align:middle; }
.model-card.seq { opacity:.9; }
.other-section { margin-top:44px; border-top:1px solid var(--border); padding-top:22px; }
.section-label.other { color:var(--muted); }
.other-desc { color:var(--muted); font-size:13px; max-width:760px; margin:4px 0 18px; line-height:1.55; }
.section-sublabel { font-size:14px; color:var(--text); margin:18px 0 8px; font-family:var(--font-em); }

/* ---- v2 detail page ---- */
.btn-lg { padding: 13px 26px; font-size: 15px; border-radius: var(--radius-pill); }

.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-top: 18px; }
.detail-head-main { min-width: 0; }
.detail-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-link); }
.detail-head h1 {
  font-family: var(--font-display); font-weight: 800; font-size: 44px; line-height: 1.05;
  letter-spacing: .01em; color: var(--color-heading); margin: 8px 0 0;
}
.detail-badges { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.badge { font-size: 11px; font-weight: 700; letter-spacing: .03em; border-radius: var(--radius-pill); padding: 3px 11px; border: 1px solid transparent; }
.badge-msa { color: #5fd07a; background: rgba(56,162,80,.13); border-color: rgba(56,162,80,.4); }
.badge-sha { color: #5fd6e6; background: rgba(0,163,187,.13); border-color: rgba(0,163,187,.4); }
.detail-meta { font-size: 13px; color: #74747a; }

.fw-status-hero {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--color-hero);
  margin: 32px 0;
  scroll-margin-top: 24px;
}
.fw-status-hero > .fw-status-frame { padding: 2px; background: linear-gradient(100deg, var(--color-accent), var(--color-brand-purple)); }
.fw-status-inner { background: var(--color-hero); border-radius: 12px; padding: 28px 32px; }
.eyebrow-accent { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--color-link); }
.fw-status-inner h2 {
  font-family: var(--font-display); font-weight: 800; font-size: 24px;
  letter-spacing: .01em; color: var(--color-heading); margin: 10px 0 0;
}
.fw-status-inner .fw-check-row { margin-top: 20px; max-width: 520px; }

/* Firmware Health Check hero (archive home) */
.hc-hero { margin: 0; }
.hc-hero .fw-status-inner { padding: 30px 34px; }
.hc-hero h1 {
  font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1.1;
  letter-spacing: .01em; color: var(--color-heading); margin: 12px 0 0;
}
.hc-sub { color: var(--color-muted); font-size: 16px; margin: 10px 0 0; max-width: 560px; }
.hc-row { margin-top: 24px; display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.hc-field { flex: 1; min-width: 180px; }
.hc-field label { display: block; font-size: 12px; font-weight: 600; color: #8a8b91; margin-bottom: 7px; }
.hc-select, .hc-input {
  width: 100%; box-sizing: border-box; background: var(--color-input);
  border: 1px solid var(--color-field-border); color: var(--color-text);
  font-family: var(--font-body); font-size: 15px; padding: 12px 14px; border-radius: 9px; outline: none;
}
.hc-select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 32px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.hc-select:focus, .hc-input:focus { border-color: var(--color-accent); }
.hc-row .btn { font-size: 15px; padding: 13px 26px; }
#hc-result:not(:empty) { margin-top: 22px; }
.hc-banner {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03); padding: 18px 22px;
}
.hc-icon { width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; color: #0c1418; background: var(--color-faint); }
.hc-text { flex: 1; min-width: 200px; }
.hc-title { font-family: var(--font-display); font-weight: 800; font-size: 17px; color: var(--color-text); }
.hc-detail { margin-top: 3px; font-size: 14px; color: #b7b9c0; }
.hc-ok   { border-color: rgba(56,162,80,.5);  background: rgba(56,162,80,.10); }
.hc-warn { border-color: rgba(251,140,0,.5);  background: rgba(251,140,0,.10); }
.hc-info { border-color: rgba(0,163,187,.4);  background: rgba(0,163,187,.08); }
.hc-ok .hc-icon { background: var(--color-success); } .hc-ok .hc-title { color: #5fd07a; }
.hc-warn .hc-icon { background: var(--color-warning); } .hc-warn .hc-title { color: #f7a53a; }
.hc-info .hc-icon { background: var(--color-link); } .hc-info .hc-title { color: var(--color-link); }

.section-eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--color-faint); margin: 44px 0 16px; }
#fw-versions { scroll-margin-top: 20px; }

.detail-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 44px; scroll-margin-top: 24px; }
.detail-card { background: var(--color-input); border: 1px solid var(--color-hairline); border-radius: 11px; padding: 22px 24px; }
.detail-card-msa { border-left: 3px solid var(--color-success); }
.detail-card-title { font-family: var(--font-display); font-weight: 800; font-size: 15px; letter-spacing: .01em; color: var(--color-text); }
.detail-card p { margin: 10px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--color-muted); }
.detail-card a { display: inline-block; margin-top: 8px; font-size: 14px; }
@media (max-width: 680px) { .detail-cards { grid-template-columns: 1fr; } .detail-head h1 { font-size: 30px; } }

/* Download license-agreement modal */
.dl-modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,.66); display:flex;
  align-items:center; justify-content:center; z-index:1000; padding:20px; }
.dl-modal-overlay[hidden] { display:none; }
.dl-modal { background:var(--surface); border:1px solid var(--border); border-radius:10px;
  max-width:640px; width:100%; max-height:84vh; display:flex; flex-direction:column; padding:22px; }
.dl-modal h2 { font-size:18px; margin:0 0 6px; color:var(--text); }
.dl-modal-sub { font-size:13px; color:var(--muted); margin:0 0 12px; line-height:1.5; }
.dl-modal-sub a { color:var(--cyan); }
.dl-modal-body { overflow-y:auto; background:var(--bg); border:1px solid var(--border);
  border-radius:6px; padding:12px; font-size:11.5px; line-height:1.5; color:var(--muted);
  white-space:pre-wrap; max-height:42vh; margin-bottom:14px; }
.dl-modal-agree { display:flex; gap:8px; align-items:flex-start; font-size:13px;
  color:var(--text); margin-bottom:16px; cursor:pointer; }
.dl-modal-agree input { margin-top:3px; }
.dl-modal-actions { display:flex; justify-content:flex-end; gap:10px; }
.dl-modal-actions .dl-cancel { background:transparent; border:1px solid var(--border); color:var(--muted); }
.dl-accept[disabled] { opacity:.45; cursor:not-allowed; }

/* ---- Responsive ---- */

/* Sidebar collapses to a slide-in drawer */
@media (max-width: 900px) {
  .mobile-bar {
    display: flex; align-items: center; gap: 14px;
    padding: 10px 16px;
    background: var(--color-sidebar);
    border-bottom: 1px solid var(--color-border-subtle);
    position: sticky; top: 0; z-index: 80;
  }
  .mobile-brand img { height: 24px; width: auto; }
  .sidebar-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 4px;
    width: 40px; height: 40px; padding: 10px;
    background: transparent; border: 1px solid var(--color-border);
    border-radius: 8px; cursor: pointer;
  }
  .sidebar-toggle span { display: block; height: 2px; background: var(--color-text); border-radius: 2px; }

  .app-shell { flex-direction: column; }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.4);
  }
  .app-shell.nav-open .sidebar { transform: translateX(0); }
  .app-shell.nav-open .sidebar-overlay {
    display: block; position: fixed; inset: 0;
    background: rgba(0,0,0,.5); z-index: 85;
  }
  .topbar { position: static; }
}

@media (max-width: 680px) {
  :root { --pad-x: 20px; }
  .page-hero h1 { font-size: 26px; }
  .hc-hero h1 { font-size: 26px; }
  .hc-hero .fw-status-inner { padding: 22px 20px; }
  .fw-status-inner { padding: 22px 20px; }
  .msa-banner { padding: 20px; }
  .msa-banner-lead { flex-basis: 100%; gap: 16px; }
  .msa-banner-logo { height: 32px; }
  .topbar-controls { margin-left: 0; }
  .msa-banner-text strong { font-size: 17px; }
  .msa-banner-text p { font-size: 14px; }
  .model-grid { grid-template-columns: 1fr 1fr; }
  .stat-row { flex-direction: column; }
  .fw-table { font-size: 12px; }
  .sha-field { max-width: 160px; }
}
@media (max-width: 400px) {
  .model-grid { grid-template-columns: 1fr; }
}
