/* Skyrim Loadsmith: dark Nordic grimoire design system. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-main: #050509;
  --bg-panel: #111119;
  --bg-panel-alt: #161623;
  --bg-sunken: rgba(5, 5, 12, 0.7);
  --bg-chip: rgba(255, 255, 255, 0.03);
  --bg-hover: rgba(255, 255, 255, 0.04);
  --bg-active: rgba(201, 169, 107, 0.1);

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text-main: #f2f2f2;
  --text-secondary: #c0c0c0;
  --text-muted: #9a9a9a;
  --text-dim: #7c7c84;

  --accent-gold: #c9a96b;
  --accent-gold-bright: #e4c787;
  --accent-gold-soft: rgba(201, 169, 107, 0.22);
  --accent-gold-glow: rgba(201, 169, 107, 0.35);
  --accent-blue: #4ea7d8;
  --accent-blue-soft: rgba(78, 167, 216, 0.25);
  --accent-green: #4a9e6a;
  --accent-green-soft: rgba(74, 158, 106, 0.25);
  --accent-red: #d0564a;
  --accent-red-soft: rgba(208, 86, 74, 0.25);
  --accent-orange: #d98a3d;
  --accent-orange-soft: rgba(217, 138, 61, 0.25);
  --accent-purple: #9b7acc;

  --viz-gold: #b98c3c;
  --viz-blue: #3489c0;
  --viz-track: rgba(255, 255, 255, 0.06);
  --viz-grid: rgba(255, 255, 255, 0.07);

  --sev-critical: var(--accent-red);
  --sev-serious: var(--accent-orange);
  --sev-warning: var(--accent-gold);
  --sev-info: var(--accent-blue);

  --shadow-soft: 0 20px 40px rgba(0, 0, 0, 0.7);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow-gold: 0 0 20px rgba(201, 169, 107, 0.2);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  --transition-fast: 150ms ease-out;
  --transition-medium: 250ms ease-out;

  --fs-xs: 0.875rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.5rem;
  --fs-2xl: clamp(1.75rem, 2.4vw, 2.25rem);

  --header-h: 64px;
  --gutter: 24px;
  --row-h: 64px;
  --font-ui: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Cinzel", Georgia, serif;
  color-scheme: dark;
}

html { scroll-behavior: smooth; }
html, body { min-height: 100%; }

body {
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--text-main);
  background:
    radial-gradient(circle at 0 0, #26262f 0, transparent 45%),
    radial-gradient(circle at 100% 100%, #23232c 0, transparent 50%),
    radial-gradient(circle at 50% 0, #1e1e28 0, var(--bg-main) 60%);
  background-color: var(--bg-main);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 2px; border-radius: 4px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 300; padding: 8px 14px; background: var(--bg-panel); border: 1px solid var(--accent-gold); border-radius: var(--radius-pill); }
.skip-link:focus { left: 12px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.04em; line-height: 1.25; }
h1 { font-size: var(--fs-2xl); color: var(--accent-gold); text-shadow: 0 0 18px rgba(0, 0, 0, 0.9); }
h2 { font-size: var(--fs-lg); color: var(--text-main); }
h3 { font-size: var(--fs-sm); color: var(--text-secondary); }

/* --- Header --- */
.app-header {
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(to right, rgba(0, 0, 0, 0.88), rgba(5, 5, 12, 0.92));
  backdrop-filter: blur(16px);
}
.header-inner {
  display: flex; align-items: center; gap: 20px;
  min-height: 64px; padding: 8px var(--gutter);
}
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-orb {
  width: 38px; height: 38px; border-radius: 50%; position: relative; flex-shrink: 0;
  border: 1px solid var(--accent-gold); box-shadow: var(--shadow-glow-gold);
  background: radial-gradient(circle at 30% 30%, #f7f3e3 0, #c9a96b 18%, #6c4a2e 45%, #050509 75%);
}
.brand-orb::after { content: ""; position: absolute; inset: 22%; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.7); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { font-family: var(--font-display); font-size: 1.2rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-gold); }
.brand-sub { font-size: var(--fs-xs); color: var(--text-muted); }

.tabs { display: flex; gap: 2px; flex-wrap: nowrap; }
.tabs a {
  padding: 7px 14px; border-radius: var(--radius-pill); border: 1px solid transparent;
  color: var(--text-muted); font-size: var(--fs-sm); font-weight: 500; transition: all var(--transition-fast);
  white-space: nowrap;
}
.tabs a:hover { color: var(--text-main); border-color: var(--border-medium); background: var(--bg-hover); }
.tabs a[aria-current="page"] {
  color: var(--accent-gold-bright); border-color: var(--accent-gold-soft);
  background: radial-gradient(circle at 30% 0, var(--accent-gold-soft), transparent 70%);
}

.header-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.build-switch select { max-width: 230px; }
.budget-pill {
  display: grid; gap: 4px; min-width: 190px; white-space: nowrap; padding: 6px 12px; border-radius: var(--radius-md);
  border: 1px solid var(--border-medium); background: var(--bg-sunken);
}
.budget-pill .bp-row { display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-xs); color: var(--text-secondary); }
.budget-pill .bp-row strong { color: var(--text-main); font-weight: 600; }
.budget-pill.over { border-color: var(--accent-red-soft); }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border-medium); background: var(--bg-hover); color: var(--text-secondary);
  transition: all var(--transition-fast);
}
.icon-btn:hover { color: var(--accent-gold-bright); border-color: var(--accent-gold-soft); }

/* --- Layout --- */
.view { display: block; padding: 20px var(--gutter) 40px; max-width: 1800px; margin: 0 auto; outline: none; }
.loading { padding: 60px 0; text-align: center; color: var(--text-muted); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head p { color: var(--text-secondary); max-width: 760px; }
.page-head .eyebrow { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-muted); margin-bottom: 4px; }

.panel {
  background: linear-gradient(145deg, var(--bg-panel), var(--bg-panel-alt));
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); padding: 16px 18px; min-width: 0;
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-head h2 { font-size: var(--fs-base); text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-secondary); }
.panel-head .meta { font-size: var(--fs-xs); color: var(--text-muted); }
.panel-note { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 10px; }

.grid { display: grid; gap: 16px; }
.overview-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }

/* --- Stat tiles --- */
.tile { display: flex; flex-direction: column; gap: 8px; }
.tile-label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); }
.tile-value { font-family: var(--font-display); font-size: 2rem; color: var(--accent-gold-bright); line-height: 1.1; }
.tile-value small { font-family: var(--font-ui); font-size: var(--fs-sm); color: var(--text-muted); margin-left: 6px; }
.tile-sub { font-size: var(--fs-sm); color: var(--text-secondary); }
.tile-sub a { color: var(--accent-gold); }

/* --- Buttons and inputs --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px;
  padding: 6px 14px; border-radius: var(--radius-pill); border: 1px solid var(--border-medium);
  background: var(--bg-hover); color: var(--text-main); font-size: var(--fs-sm); font-weight: 500;
  white-space: nowrap; transition: all var(--transition-fast);
}
.btn:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--border-strong); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { border-color: var(--accent-gold-soft); background: linear-gradient(135deg, rgba(201, 169, 107, 0.35), rgba(201, 169, 107, 0.1)); color: var(--accent-gold-bright); }
.btn-primary:hover { background: linear-gradient(135deg, rgba(201, 169, 107, 0.5), rgba(201, 169, 107, 0.2)); box-shadow: var(--shadow-glow-gold); }
.btn-danger { border-color: var(--accent-red-soft); color: #ec8a80; background: linear-gradient(135deg, rgba(208, 86, 74, 0.28), rgba(208, 86, 74, 0.08)); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-main); background: var(--bg-hover); }
.btn-sm { min-height: 30px; padding: 3px 10px; font-size: var(--fs-xs); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.input, select, textarea {
  width: 100%; min-height: 38px; padding: 7px 12px; border-radius: var(--radius-md);
  border: 1px solid var(--border-medium); background: rgba(0, 0, 0, 0.45); color: var(--text-main);
  font-size: var(--fs-sm); transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { min-height: 220px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--fs-xs); line-height: 1.5; resize: vertical; }
.input::placeholder, textarea::placeholder { color: var(--text-dim); }
.input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-gold-soft); box-shadow: 0 0 0 2px var(--accent-gold-soft); }
.search { position: relative; }
.search .input { padding-left: 38px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dim); pointer-events: none; }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
kbd { font-family: var(--font-ui); font-size: var(--fs-xs); color: var(--text-muted); border: 1px solid var(--border-medium); border-radius: 5px; padding: 0 6px; background: var(--bg-chip); }

.segmented { display: inline-flex; border: 1px solid var(--border-medium); border-radius: var(--radius-pill); padding: 3px; background: var(--bg-sunken); flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; color: var(--text-muted); padding: 5px 14px; border-radius: var(--radius-pill); font-size: var(--fs-sm); font-weight: 500; }
.segmented button[aria-pressed="true"] { background: var(--accent-gold-soft); color: var(--accent-gold-bright); }
.segmented button:hover:not([aria-pressed="true"]) { color: var(--text-main); }

.check { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-secondary); cursor: pointer; padding: 3px 0; }
.check input { accent-color: var(--accent-gold); width: 16px; height: 16px; }
.check .count { margin-left: auto; color: var(--text-dim); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }

/* --- Chips and severity --- */
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-medium); background: var(--bg-chip); font-size: var(--fs-xs);
  color: var(--text-secondary); white-space: nowrap; line-height: 1.6;
}
.chip-gold { border-color: var(--accent-gold-soft); color: var(--accent-gold-bright); background: rgba(201, 169, 107, 0.08); }
.chip-blue { border-color: var(--accent-blue-soft); color: #8ccbee; }
.chip-green { border-color: var(--accent-green-soft); color: #86c9a0; }
.chip-red { border-color: var(--accent-red-soft); color: #ec8a80; }
.chip-btn { cursor: pointer; }
.chip-btn:hover { border-color: var(--accent-gold-soft); color: var(--text-main); }
.chip-btn[aria-pressed="true"] { border-color: var(--accent-gold); color: var(--accent-gold-bright); background: var(--bg-active); }

.sev { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.sev::before { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 0.75rem; color: #0b0b10; font-weight: 700; }
.sev-critical { color: #ec8a80; }
.sev-critical::before { content: "\00d7"; background: var(--sev-critical); }
.sev-serious { color: #ebb27a; }
.sev-serious::before { content: "!"; background: var(--sev-serious); }
.sev-warning { color: var(--accent-gold-bright); }
.sev-warning::before { content: "\25b2"; font-size: 0.6rem; background: var(--sev-warning); }
.sev-info { color: #8ccbee; }
.sev-info::before { content: "i"; background: var(--sev-info); }

/* --- Charts --- */
.meter { position: relative; height: 12px; border-radius: var(--radius-pill); background: var(--viz-track); overflow: hidden; display: flex; gap: 2px; }
.meter > span { display: block; height: 100%; }
.meter .m-used { background: var(--viz-gold); border-radius: var(--radius-pill) 0 0 var(--radius-pill); }
.meter .m-pending { background: repeating-linear-gradient(45deg, var(--viz-blue) 0 4px, rgba(52, 137, 192, 0.55) 4px 8px); }
.meter .m-over { background: var(--sev-critical); }
.meter-sm { height: 6px; }
.meter-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: var(--fs-xs); color: var(--text-secondary); }
.meter-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.barlist { display: grid; gap: 6px; }
.barlist-row { display: grid; grid-template-columns: minmax(120px, 34%) 1fr auto; align-items: center; gap: 10px; font-size: var(--fs-xs); padding: 3px 4px; border-radius: var(--radius-sm); }
.barlist-row.clickable { cursor: pointer; }
.barlist-row.clickable:hover { background: var(--bg-hover); }
.barlist-label { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barlist-track { height: 10px; background: var(--viz-track); border-radius: 0 var(--radius-pill) var(--radius-pill) 0; overflow: hidden; }
.barlist-fill { height: 100%; background: var(--viz-gold); border-radius: 0 4px 4px 0; min-width: 2px; }
.barlist-value { color: var(--text-main); font-variant-numeric: tabular-nums; text-align: right; min-width: 64px; }

.runway svg { display: block; width: 100%; height: auto; overflow: visible; }
.runway .axis text { fill: var(--text-muted); font-size: 13px; font-family: var(--font-ui); }
.runway .grid line { stroke: var(--viz-grid); }
.runway .used { fill: rgba(185, 140, 60, 0.28); stroke: var(--viz-gold); stroke-width: 2; }
.runway .need { stroke: var(--viz-blue); stroke-width: 2; fill: none; }
.runway .limit { stroke: var(--sev-critical); stroke-width: 1.5; stroke-dasharray: 6 4; }
.runway .fail { fill: var(--sev-critical); stroke: var(--bg-panel); stroke-width: 2; }
.runway .tier-line { stroke: var(--border-strong); stroke-dasharray: 2 4; }
.runway .tier-label { fill: var(--text-muted); font-size: 13px; }
.runway .hover-line { stroke: var(--text-secondary); stroke-width: 1; }
.runway .hit { fill: transparent; }

.tooltip {
  position: fixed; z-index: 500; pointer-events: none; max-width: 320px; padding: 8px 12px;
  background: #0d0d14; border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  box-shadow: var(--shadow-card); font-size: var(--fs-xs); color: var(--text-secondary);
}
.tooltip strong { display: block; color: var(--text-main); font-size: var(--fs-sm); margin-bottom: 2px; }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 16px; }
.tooltip .tt-row b { color: var(--text-main); font-weight: 600; font-variant-numeric: tabular-nums; }

/* --- Catalog --- */
.catalog { display: grid; grid-template-columns: 290px minmax(0, 1fr) 420px; gap: 16px; align-items: start; }
.facets { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100dvh - var(--header-h) - 32px); overflow: auto; padding-right: 4px; }
.facet { padding: 12px 0; border-bottom: 1px solid var(--border-subtle); }
.facet:last-child { border-bottom: 0; }
.facet > h3, .facet > summary { font-family: var(--font-ui); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); margin-bottom: 8px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.facet > summary::-webkit-details-marker { display: none; }
.facet > summary::after { content: "+"; color: var(--text-dim); }
.facet[open] > summary::after { content: "\2212"; }
.facet .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.llo-tree { display: grid; gap: 2px; }
.llo-tree .nav-group { margin-top: 6px; }
.llo-tree .nav-name { font-size: var(--fs-xs); color: var(--accent-gold); text-transform: uppercase; letter-spacing: 0.08em; padding: 4px 0; display: flex; justify-content: space-between; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; }
.llo-tree .nav-name[aria-pressed="true"] { color: var(--accent-gold-bright); text-decoration: underline; }

.results { min-width: 0; }
.results-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.results-head .count { font-size: var(--fs-sm); color: var(--text-secondary); margin-right: auto; }
.results-head select { width: auto; }
.active-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.vlist { position: relative; height: calc(100dvh - var(--header-h) - 150px); min-height: 420px; overflow: auto; border: 1px solid var(--border-medium); border-radius: var(--radius-lg); background: var(--bg-sunken); }
.vlist-inner { position: relative; }
.mod-row {
  position: absolute; left: 0; right: 0; height: var(--row-h); display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 92px 84px 44px; align-items: center; gap: 10px;
  padding: 0 12px; border-bottom: 1px solid var(--border-subtle); cursor: pointer;
}
.mod-row:hover { background: var(--bg-hover); }
.mod-row.selected { background: var(--bg-active); box-shadow: inset 3px 0 0 var(--accent-gold); }
.mod-row .pos { color: var(--accent-gold); font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; }
.mod-row .pos.none { color: var(--text-dim); font-family: var(--font-ui); }
.mod-row .pos.inferred, .lo-llo.inferred { color: var(--text-muted); font-weight: 500; }
.mod-main { min-width: 0; }
.mod-title { font-weight: 600; font-size: var(--fs-base); color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mod-meta { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mod-size { font-size: var(--fs-sm); text-align: right; font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.mod-likes { font-size: var(--fs-xs); text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.toggle-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-medium); background: var(--bg-hover);
  color: var(--text-secondary); font-size: 1.15rem; line-height: 1; display: grid; place-items: center;
}
.toggle-btn:hover { border-color: var(--accent-gold-soft); color: var(--accent-gold-bright); }
.toggle-btn.on { background: var(--accent-gold-soft); color: var(--accent-gold-bright); border-color: var(--accent-gold); }
.empty { padding: 40px 16px; text-align: center; color: var(--text-muted); }

/* --- Detail --- */
.detail { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100dvh - var(--header-h) - 32px); overflow: auto; }
.detail h2 { font-family: var(--font-display); font-size: 1.3rem; color: var(--accent-gold-bright); text-transform: none; letter-spacing: 0.02em; }
.detail .by { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 2px; }
.detail .facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.detail .fact { background: var(--bg-sunken); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 8px 10px; }
.detail .fact span { display: block; font-size: var(--fs-xs); color: var(--text-muted); }
.detail .fact b { font-size: var(--fs-sm); color: var(--text-main); font-weight: 600; }
.detail .desc { font-size: var(--fs-sm); color: var(--text-secondary); white-space: pre-line; max-height: 320px; overflow: auto; padding-right: 6px; }
.detail .notes { margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--accent-gold); background: rgba(201, 169, 107, 0.06); border-radius: 0 var(--radius-md) var(--radius-md) 0; font-size: var(--fs-sm); color: var(--text-secondary); white-space: pre-line; }
.detail section { margin-top: 16px; }
.detail section h3 { font-family: var(--font-ui); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); margin-bottom: 6px; }
.rel-list { list-style: none; display: grid; gap: 6px; }
.rel-list li { font-size: var(--fs-sm); color: var(--text-secondary); padding: 8px 10px; background: var(--bg-sunken); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.rel-list li .q { display: block; font-size: var(--fs-xs); color: var(--text-muted); margin-top: 3px; font-style: italic; }
.rel-list button.link, button.link { border: 0; background: none; color: var(--accent-gold); text-decoration: underline; text-underline-offset: 2px; padding: 0; text-align: left; font-size: inherit; }
.impact { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-md); border: 1px solid var(--border-medium); background: var(--bg-sunken); font-size: var(--fs-sm); color: var(--text-secondary); }
.impact.bad { border-color: var(--accent-red-soft); }
.links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.detail-close { display: none; }
.drawer {
  position: fixed; top: var(--header-h); right: 0; bottom: 0; width: min(460px, 100vw); max-height: none; z-index: 150;
  border-radius: 0; transform: translateX(105%); transition: transform var(--transition-medium);
}
.drawer.open { transform: none; box-shadow: var(--shadow-soft); }
.drawer .detail-close { display: inline-flex; }

/* --- Load order --- */
.lo-layout { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 16px; align-items: start; }
.lo-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.lo-toolbar .grow { flex: 1; }
.lo-summary { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: var(--fs-sm); color: var(--text-secondary); padding: 10px 14px; margin-bottom: 12px; border-radius: var(--radius-md); border: 1px solid var(--border-medium); background: var(--bg-sunken); }
.lo-summary strong { color: var(--text-main); }
.lo-list { list-style: none; border: 1px solid var(--border-medium); border-radius: var(--radius-lg); background: var(--bg-sunken); overflow: hidden; }
.lo-tier { display: flex; justify-content: space-between; gap: 10px; padding: 8px 14px; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent-gold); background: rgba(201, 169, 107, 0.06); border-bottom: 1px solid var(--border-subtle); }
.lo-tier span:last-child { color: var(--text-muted); text-transform: none; letter-spacing: 0; }
.lo-row {
  display: grid; grid-template-columns: 22px 44px 48px minmax(0, 1fr) 90px 120px 76px; align-items: center; gap: 8px;
  min-height: 56px; padding: 6px 12px; border-bottom: 1px solid var(--border-subtle); background: transparent;
}
.lo-row:last-child { border-bottom: 0; }
.lo-row:hover { background: var(--bg-hover); }
.lo-row.selected { background: var(--bg-active); box-shadow: inset 3px 0 0 var(--accent-gold); }
.lo-row.dragging { opacity: 0.4; }
.lo-row.drop-before { box-shadow: inset 0 3px 0 var(--accent-gold); }
.lo-row.drop-after { box-shadow: inset 0 -3px 0 var(--accent-gold); }
.lo-row.flag-critical { box-shadow: inset 3px 0 0 var(--sev-critical); }
.lo-row.flag-serious { box-shadow: inset 3px 0 0 var(--sev-serious); }
.lo-row.moved .lo-idx { color: var(--accent-blue); }
.handle { cursor: grab; color: var(--text-dim); font-size: 1.1rem; text-align: center; user-select: none; }
.lo-idx { font-size: var(--fs-xs); color: var(--text-muted); text-align: right; font-variant-numeric: tabular-nums; }
.lo-llo { color: var(--accent-gold); text-align: center; font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
.lo-llo.none { color: var(--text-dim); font-family: var(--font-ui); }
.lo-dl { font-size: var(--fs-xs); text-align: right; font-variant-numeric: tabular-nums; }
.lo-dl.ok { color: var(--text-muted); }
.lo-dl.bad { color: #ec8a80; font-weight: 600; }
.lo-actions { display: flex; gap: 4px; justify-content: flex-end; }
.mini-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--text-muted); font-size: 1rem; line-height: 1; }
.mini-btn:hover { border-color: var(--border-medium); color: var(--text-main); background: var(--bg-hover); }
.badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }

.side { display: grid; gap: 16px; position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100dvh - var(--header-h) - 32px); overflow: auto; }
.issue-list { list-style: none; display: grid; gap: 8px; }
.issue { padding: 10px 12px; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); background: var(--bg-sunken); }
.issue-head { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.issue-title { font-size: var(--fs-sm); color: var(--text-main); font-weight: 500; margin-top: 4px; }
.issue-ev { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 4px; font-style: italic; }
.issue-src { font-size: var(--fs-xs); color: var(--text-dim); margin-top: 2px; }
.issue .btn-row { margin-top: 8px; }
.issue-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }

.add-list { list-style: none; display: grid; gap: 4px; max-height: 360px; overflow: auto; }
.add-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; font-size: var(--fs-xs); padding: 6px 8px; border-radius: var(--radius-sm); background: var(--bg-sunken); }
.add-list li span:first-child { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add-list li span:last-child { color: var(--text-main); font-variant-numeric: tabular-nums; }

/* --- LLO guide --- */
.llo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(520px, 1fr)); gap: 16px; }
.llo-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.llo-table th, .llo-table td { padding: 8px 6px; border-bottom: 1px solid var(--border-subtle); text-align: left; vertical-align: top; }
.llo-table th { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.llo-table td.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-secondary); white-space: nowrap; }
.llo-table .llo-pos { color: var(--accent-gold); font-weight: 600; font-variant-numeric: tabular-nums; }
.llo-table .llo-desc { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
.llo-table tr:last-child td { border-bottom: 0; }

/* --- Data page --- */
.data-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: var(--fs-sm); }
.kv dt { color: var(--text-muted); }
.kv dd { color: var(--text-main); font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid var(--border-subtle); text-align: left; vertical-align: top; }
.table th { background: rgba(5, 5, 12, 0.6); color: var(--text-muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: 0; }

/* --- Dialog and toast --- */
.dialog {
  margin: auto; width: min(760px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0;
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg); color: var(--text-main);
  background: linear-gradient(145deg, var(--bg-panel), var(--bg-panel-alt)); box-shadow: var(--shadow-soft);
}
.dialog::backdrop { background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(6px); }
.dialog-body { padding: 20px 22px; display: grid; gap: 14px; }
.dialog-body h2 { font-size: 1.25rem; color: var(--accent-gold-bright); }
.dialog-body p { color: var(--text-secondary); font-size: var(--fs-sm); }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border-subtle); flex-wrap: wrap; }
.field { display: grid; gap: 6px; font-size: var(--fs-sm); color: var(--text-secondary); }
.field small { color: var(--text-muted); font-size: var(--fs-xs); }
.match-table { max-height: 340px; overflow: auto; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); z-index: 1000;
  display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-radius: var(--radius-pill);
  background: var(--bg-panel); border: 1px solid var(--accent-gold-soft); box-shadow: var(--shadow-card);
  font-size: var(--fs-sm); opacity: 0; pointer-events: none; transition: all var(--transition-medium);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast button { border: 0; background: none; color: var(--accent-gold-bright); font-weight: 600; text-decoration: underline; }

/* --- Research --- */
.research-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.research-tiles .tile-value { font-size: 1.7rem; }
.research-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
.research-nav { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100dvh - var(--header-h) - 32px); overflow: auto; padding: 10px; display: grid; gap: 2px; }
.rn-label { font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); padding: 10px 8px 4px; }
.rn-label:first-child { padding-top: 2px; }
.rn-item { display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left; padding: 6px 8px; border: 1px solid transparent; border-radius: var(--radius-sm); background: none; color: var(--text-secondary); font-size: var(--fs-sm); }
.rn-item:hover { background: var(--bg-hover); color: var(--text-main); }
.rn-item[aria-current="true"] { color: var(--accent-gold-bright); border-color: var(--accent-gold-soft); background: var(--bg-active); }
.rn-item .count { color: var(--text-dim); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; white-space: nowrap; }
.research-main { min-width: 0; display: grid; gap: 12px; align-content: start; }
.rm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.rm-head h2 { font-size: var(--fs-xl); color: var(--accent-gold-bright); }
.rm-head p { color: var(--text-secondary); font-size: var(--fs-sm); max-width: 760px; margin-top: 2px; }
.rm-counts { display: flex; gap: 6px; flex-wrap: wrap; }
.research-side { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100dvh - var(--header-h) - 32px); overflow: auto; }
.research-side h2 { font-family: var(--font-display); font-size: 1.15rem; color: var(--accent-gold-bright); letter-spacing: 0.02em; text-transform: none; }
.research-side h2 .link { color: inherit; }
.research-side .eyebrow { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); margin-bottom: 2px; }
.research-side section { margin-top: 14px; }
.research-side section h3 { font-family: var(--font-ui); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); margin-bottom: 6px; }
.research-side .facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0 8px; }
.research-side .fact { background: var(--bg-sunken); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 7px 10px; min-width: 0; }
.research-side .fact span { display: block; font-size: var(--fs-xs); color: var(--text-muted); }
.research-side .fact b { display: block; font-size: var(--fs-sm); color: var(--text-main); font-weight: 600; overflow-wrap: anywhere; }
.research-side .fact small { font-size: var(--fs-xs); color: var(--text-dim); }
.research-side .q, .rs-claims .q { display: block; font-size: var(--fs-xs); color: var(--text-muted); font-style: italic; margin-top: 3px; }
.rs-summary { font-size: var(--fs-sm); color: var(--text-secondary); margin-top: 10px; }
.rs-quote { font-size: var(--fs-sm); color: var(--text-secondary); font-style: italic; margin-top: 6px; }
.rs-desc { color: var(--text-main); margin-top: 4px; }
.rs-meta { font-size: var(--fs-xs); color: var(--text-dim); margin-top: 3px; }
.rs-status { display: flex; gap: 10px; align-items: center; margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-md); border: 1px solid var(--border-medium); background: var(--bg-sunken); font-size: var(--fs-sm); color: var(--text-secondary); }
.rs-status strong { color: var(--text-main); }
.dim { color: var(--text-dim); }
.tt-quote { font-style: italic; margin-top: 3px; }

/* Each statement type sets one color pair; cells, keys, and chips read it. */
.mx-incompatible { --st-bg: rgba(208, 86, 74, 0.45); --st-fg: #f6b2aa; }
.mx-includes { --st-bg: rgba(217, 138, 61, 0.42); --st-fg: #f5c896; }
.mx-overlap { --st-bg: rgba(217, 138, 61, 0.24); --st-fg: #ebb27a; }
.mx-requires { --st-bg: rgba(78, 167, 216, 0.3); --st-fg: #a9daf5; }
.mx-caution { --st-bg: rgba(201, 169, 107, 0.3); --st-fg: var(--accent-gold-bright); }
.mx-patch { --st-bg: rgba(155, 122, 204, 0.34); --st-fg: #d2bdf2; }
.mx-unverified { --st-bg: rgba(155, 122, 204, 0.12); --st-fg: #b9a6d8; }
.mx-compatible { --st-bg: rgba(74, 158, 106, 0.36); --st-fg: #a6dcbb; }
.mx-after { --st-bg: rgba(255, 255, 255, 0.08); --st-fg: var(--text-secondary); }
.mx-none { --st-bg: transparent; --st-fg: var(--text-dim); }

.mx-panel { display: grid; gap: 10px; }
.mx-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.mx-coverage { font-size: var(--fs-sm); color: var(--text-secondary); max-width: 720px; }
.mx-coverage strong { color: var(--text-main); }
.mx-wrap { overflow: auto; max-height: min(72vh, 980px); border: 1px solid var(--border-medium); border-radius: var(--radius-lg); background: var(--bg-sunken); }
.matrix { border-collapse: separate; border-spacing: 2px; font-size: var(--fs-xs); }
.matrix thead th { position: sticky; top: 0; z-index: 2; background: #0d0d14; padding: 4px 0; }
.matrix .mx-corner { left: 0; z-index: 4; min-width: 240px; }
.mx-col { width: 32px; font-weight: 500; }
.mx-num { width: 32px; border: 0; background: none; color: var(--text-muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; padding: 2px 0; }
.mx-col.hl .mx-num, .mx-row.hl .mx-name { color: var(--accent-gold-bright); }
.mx-row { position: sticky; left: 0; z-index: 1; background: #0d0d14; padding: 0; text-align: left; font-weight: 400; }
.mx-name { display: flex; align-items: center; gap: 6px; width: 240px; border: 0; background: none; color: var(--text-secondary); font-size: var(--fs-xs); padding: 0 8px 0 6px; height: 32px; text-align: left; }
.mx-name:hover .mx-label { color: var(--text-main); text-decoration: underline; }
.mx-idx { width: 22px; flex-shrink: 0; color: var(--text-dim); text-align: right; font-variant-numeric: tabular-nums; }
.mx-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-row.partner .mx-label { font-style: italic; color: var(--text-muted); }
.mx-in { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-gold); flex-shrink: 0; }
.mx-cell { width: 32px; height: 32px; padding: 0; border-radius: 5px; background: var(--st-bg); color: var(--st-fg); }
.mx-cell.mx-none { background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.09) 0 2px, transparent 2px 6px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); }
.mx-cell.mx-unverified { box-shadow: inset 0 0 0 1px rgba(185, 166, 216, 0.55); }
.mx-cell.mx-self { background: rgba(255, 255, 255, 0.015); }
.mx-btn { position: relative; width: 32px; height: 32px; border: 0; border-radius: 5px; background: transparent; color: inherit; font-size: var(--fs-sm); font-weight: 700; line-height: 1; }
.mx-btn:hover { box-shadow: inset 0 0 0 1px var(--text-secondary); }
.mx-btn.multi::after { content: ""; position: absolute; top: 3px; right: 3px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.mx-cell.sel .mx-btn { box-shadow: inset 0 0 0 2px var(--accent-gold-bright); }
.mx-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--fs-xs); color: var(--text-secondary); }
.mx-legend li { display: inline-flex; align-items: center; gap: 6px; }
.mx-legend .count { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.mx-key { display: inline-grid; place-items: center; width: 22px; height: 22px; flex-shrink: 0; border-radius: 5px; background: var(--st-bg); color: var(--st-fg); font-weight: 700; font-size: var(--fs-xs); }
.mx-key.mx-none { background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.09) 0 2px, transparent 2px 6px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); }
.mx-key.mx-unverified { box-shadow: inset 0 0 0 1px rgba(185, 166, 216, 0.55); }
.rs-status .mx-key { width: 30px; height: 30px; font-size: 1rem; }
.chip.mx-chip { border-color: var(--st-bg); color: var(--st-fg); }
.chip.mx-none { border-color: var(--border-medium); }

.rs-mods .rs-group th { background: rgba(201, 169, 107, 0.06); color: var(--accent-gold); text-transform: uppercase; letter-spacing: 0.1em; font-size: var(--fs-xs); }
.rs-mods tr.selected td { background: var(--bg-active); }
.rs-mods td { vertical-align: middle; }
.rs-mods td:first-child { min-width: 240px; }
.rs-name { color: var(--text-main); text-decoration: none; font-weight: 600; }
.rs-name:hover { text-decoration: underline; }
.rs-sum { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
.rs-stacks { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.rs-stack { display: grid; gap: 10px; align-content: start; }
.rs-stack .panel-head { margin-bottom: 0; }
.rs-stack-list { display: grid; gap: 4px; padding-left: 20px; font-size: var(--fs-sm); color: var(--text-secondary); }
.rs-stack-list li { padding-left: 2px; }
.rs-stack-list li > * { margin-right: 6px; }
.rs-size { color: var(--text-muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.rs-caveats { list-style: none; display: grid; gap: 4px; font-size: var(--fs-xs); color: var(--text-muted); font-style: italic; }
.rs-claim { color: var(--text-main); margin-top: 6px; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25); }

/* --- Responsive --- */
@media (max-width: 1500px) {
  .catalog { grid-template-columns: 260px minmax(0, 1fr) 380px; }
  .lo-layout { grid-template-columns: minmax(0, 1fr) 400px; }
  .research-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .research-side {
    position: fixed; top: var(--header-h); right: 0; bottom: 0; width: min(440px, 100vw); max-height: none; z-index: 150;
    border-radius: 0; transform: translateX(105%); transition: transform var(--transition-medium);
  }
  .research-side.open { transform: none; box-shadow: var(--shadow-soft); }
  .research-side .detail-close { display: inline-flex; }
}
@media (max-width: 1100px) {
  .research-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1400px) {
  .header-inner { gap: 14px; }
  .tabs a { padding: 7px 10px; }
}
@media (max-width: 1280px) {
  .catalog { grid-template-columns: 250px minmax(0, 1fr); }
  .catalog .detail {
    position: fixed; top: var(--header-h); right: 0; bottom: 0; width: min(440px, 100vw); max-height: none; z-index: 150;
    border-radius: 0; transform: translateX(105%); transition: transform var(--transition-medium);
  }
  .catalog .detail.open { transform: none; }
  .detail-close { display: inline-flex; }
  .span-8, .span-7 { grid-column: span 12; }
  .span-5, .span-4 { grid-column: span 6; }
  .span-3 { grid-column: span 6; }
}
@media (max-width: 1100px) {
  .lo-layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; max-height: none; }
  .header-inner { flex-wrap: wrap; }
  .header-tools { margin-left: 0; width: 100%; }
  .build-switch { flex: 1; }
  .build-switch select { max-width: none; }
}
@media (max-width: 860px) {
  :root { --gutter: 16px; }
  .catalog { grid-template-columns: minmax(0, 1fr); }
  .facets { position: static; max-height: none; }
  .facets .facet-collapsible:not([open]) > *:not(summary) { display: none; }
  .span-6, .span-5, .span-4, .span-3 { grid-column: span 12; }
  .llo-grid { grid-template-columns: minmax(0, 1fr); }
  .mod-row { grid-template-columns: 40px minmax(0, 1fr) 76px 40px; }
  .mod-row .mod-likes { display: none; }
  .lo-row { grid-template-columns: 22px 34px minmax(0, 1fr) 78px; grid-template-areas: "h i m s" "h i b a"; row-gap: 2px; }
  .lo-row .handle { grid-area: h; }
  .lo-row .lo-idx { grid-area: i; }
  .lo-row .lo-llo { display: none; }
  .lo-row .mod-main { grid-area: m; }
  .lo-row .mod-size { grid-area: s; }
  .lo-row .lo-dl { grid-area: b; text-align: left; }
  .lo-row .lo-actions { grid-area: a; }
  .barlist-row { grid-template-columns: minmax(96px, 40%) 1fr auto; }
  /* The header scrolls away on phones; drawers then cover the full height. */
  .app-header { position: static; }
  .drawer, .catalog .detail { top: 0; z-index: 200; }
  .vlist { height: calc(100dvh - 140px); }
  .header-inner { gap: 10px; }
  .tabs { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .tabs a { padding: 6px 8px; font-size: var(--fs-xs); text-align: center; border-color: var(--border-subtle); }
  .header-tools { flex-wrap: wrap; }
  .build-switch { flex: 1 1 100%; }
  .budget-pill { flex: 1; min-width: 0; }
  .brand-sub { display: none; }
  .research-layout { grid-template-columns: minmax(0, 1fr); }
  .research-nav { position: static; max-height: none; display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding: 8px; }
  .research-nav .rn-label { display: none; }
  .rn-item { width: auto; flex-shrink: 0; white-space: nowrap; border-color: var(--border-subtle); }
  .research-side { top: 0; z-index: 200; }
  .research-tiles .tile-value { font-size: 1.4rem; }
  .matrix .mx-corner { min-width: 150px; }
  .mx-name { width: 150px; }
  .rs-stacks { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
