/* ==========================================================================
   ETON DSP Release Platform — visual system (ETON Control Center parity)
   Mirrors the desktop app's design language: warm radial-dark background,
   flat orange accent (#ff8451), neutral #1a/#1f/#22 surfaces, Futura PT,
   ghost controls that light up orange when active, soft layered elevation.
   Tokens + values taken from the GUI's shared/brand/brand.css + eton.css.
   Every selector from the previous stylesheet is preserved.
   ========================================================================== */

/* --- Futura PT (ETON brand face, bundled from the GUI) --------------------- */
@font-face {
  font-family: "Futura PT";
  src: url("fonts/futura-pt/futura-pt-book.woff2") format("woff2"),
       url("fonts/futura-pt/futura-pt-book.woff") format("woff");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Futura PT";
  src: url("fonts/futura-pt/futura-pt-bold.woff2") format("woff2"),
       url("fonts/futura-pt/futura-pt-bold.woff") format("woff");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  color-scheme: dark;

  /* Base + surfaces (ETONCC neutral dark stack) */
  --bg: #060606;
  --bg-soft: #141414;
  --surface: #1a1a1a;
  --surface-soft: #1f1f1f;
  --surface-raised: #222222;
  --gradient-0: #413d30;   /* warm olive top of the page radial */
  --gradient-1: #1a1a1a;

  /* Hairlines */
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.32);
  --hairline: rgba(255, 255, 255, 0.06);

  /* Text */
  --text: #f4f6f9;
  --muted: #98a1b0;
  --dim: #7e8794;

  /* Accent + status */
  --accent: #ff8451;
  --accent-bg: rgba(255, 132, 81, 0.15);
  --accent-border: rgba(255, 132, 81, 0.4);
  --ink: #1a0f06;                     /* dark text on the orange accent */
  --red: #ff5347;
  --orange: #ff8451;
  --amber: #ffb84d;
  --green: #57d06a;
  --blue: #9fb1c6;                    /* soft steel, only for OS glyphs */
  --brand: linear-gradient(180deg, #ffa878 0%, #ff8451 55%, #f4692f 100%);

  /* Radii (ETONCC) */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Elevation (ETONCC elev scale + top-lit inner highlight + accent glow) */
  --shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 14px 40px -10px rgba(0, 0, 0, 0.55), 0 4px 8px rgba(0, 0, 0, 0.25);
  --edge: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --glow-accent: 0 0 22px -6px rgba(255, 132, 81, 0.6);

  --font: "Futura PT", "Futura", "Century Gothic", "Segoe UI", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 90% 60% at 50% -8%, var(--accent-bg), transparent 60%),
    radial-gradient(circle at 50% 34%, var(--gradient-0), var(--gradient-1) 72%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}
/* Headings / buttons / strong use the Futura Bold cut (brand parity). */
h1, h2, h3, h4, h5, h6, strong, b, button, .btn { font-weight: 700; }

a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-bg); color: #fff; }

code {
  color: #ffd0b6;
  font-family: var(--mono);
  font-size: 0.9em;
  padding: 0.12em 0.4em;
  border-radius: var(--radius-sm);
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
}

/* Custom scrollbar */
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.16) transparent; }
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-thumb {
  border: 3px solid transparent; border-radius: 999px;
  background: rgba(255, 255, 255, 0.14) content-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.26) content-box; }

/* --------------------------------------------------------------------------
   Shell + top bar
   -------------------------------------------------------------------------- */
.page-glow { display: none; }

.portal-shell {
  width: min(1200px, calc(100% - 40px));
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 16px 0 64px;
}
.is-login .portal-shell {
  width: min(440px, calc(100% - 32px));
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  align-items: center;
}

.portal-topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
  max-width: 100%;
  min-width: 0;
  margin-bottom: 26px;
  padding: 0 10px 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(34, 34, 34, 0.9), rgba(14, 14, 14, 0.86));
  box-shadow: var(--shadow), var(--edge);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
.is-login .portal-topbar {
  position: static;
  justify-content: space-between;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  color: var(--text);
  white-space: nowrap;
}
.brand-logo { display: block; color: var(--text); line-height: 0; }
.brand-logo svg { display: block; height: 17px; width: auto; }
.brand-mark { font-size: 24px; line-height: 0.95; font-weight: 700; letter-spacing: 0; }
.brand-sub {
  padding-left: 12px;
  border-left: 1px solid var(--line);
  color: var(--dim);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  line-height: 1;
  text-transform: uppercase;
}
.brand-lockup:hover .brand-sub { color: var(--accent); }
.brand-lockup:focus-visible {
  outline: none;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 2px var(--accent-border);
}

.portal-nav {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
.portal-nav > a,
.nav-admin summary {
  position: relative;
  flex: 0 0 auto;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease;
}
.portal-nav > a:hover,
.nav-admin summary:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}
.portal-nav > a.active,
.nav-admin.is-current summary,
.nav-admin details[open] summary {
  color: var(--accent);
  background: var(--accent-bg);
}
.portal-nav > a:focus-visible,
.nav-admin summary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-border);
}

.nav-admin {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  margin-left: 4px;
  padding-left: 10px;
}
.nav-admin::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--line);
}
.nav-admin summary {
  list-style: none;
  appearance: none;
  -webkit-appearance: none;
}
.nav-admin summary::-webkit-details-marker { display: none; }
.nav-admin summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 140ms ease, margin-top 140ms ease;
}
.nav-admin details[open] summary::after {
  margin-top: 2px;
  transform: rotate(-135deg);
}
.nav-admin-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  min-width: 188px;
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #242424, #161616);
  box-shadow: var(--shadow-lg), var(--edge);
}
.nav-admin-panel a {
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: color 140ms ease, background 140ms ease;
}
.nav-admin-panel a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav-admin-panel a.active { color: var(--accent); background: var(--accent-bg); }
.nav-admin-panel a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-border);
}

.topbar-end {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
}
.is-login .topbar-end { padding-left: 0; }

.session-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 220px;
}
.session-user {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}
.session-logout {
  flex: 0 0 auto;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}
.session-logout:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
}
.session-logout:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-border);
}
.portal-main { min-width: 0; }

/* Hosted DSP workspace: keep the Platform identity/session bar while giving
   the Control Center the rest of the viewport. */
.portal-mode-dsp {
  overflow: hidden;
}
.portal-mode-dsp .portal-shell {
  width: min(1800px, calc(100% - 24px));
  height: 100vh;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
}
.portal-mode-dsp .portal-topbar {
  position: static;
  flex: 0 0 auto;
  margin-bottom: 10px;
}
.portal-mode-dsp .portal-main {
  min-height: 0;
  flex: 1 1 auto;
}
.dsp-embed {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #0c0c0c;
  box-shadow: var(--shadow-lg), var(--edge);
}
.dsp-embed iframe {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #0c0c0c;
}
.dsp-embed-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.dsp-embed-open {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(12, 12, 12, 0.82);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 140ms ease, color 140ms ease, border-color 140ms ease;
}
.dsp-embed:hover .dsp-embed-open,
.dsp-embed-open:focus-visible {
  opacity: 1;
}
.dsp-embed-open:hover {
  color: var(--accent);
  border-color: var(--accent-border);
}

@media (max-width: 980px) {
  .portal-mode-dsp {
    overflow: auto;
  }
  .portal-mode-dsp .portal-shell {
    min-height: 100vh;
    height: auto;
  }
  .portal-mode-dsp .portal-main {
    min-height: 720px;
  }
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.28);
}
.lang-switch a {
  min-height: 26px;
  min-width: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  transition: color 140ms ease, background 140ms ease;
}
.lang-switch a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.lang-switch a.active { color: var(--ink); background: var(--accent); }
.lang-switch a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-border);
}

/* --------------------------------------------------------------------------
   Hero panel
   -------------------------------------------------------------------------- */
.hero-panel {
  position: relative;
  overflow: hidden;
  padding: 32px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(120% 150% at 0 0, var(--accent-bg), transparent 44%),
    linear-gradient(180deg, var(--surface-raised), var(--surface));
  box-shadow: var(--shadow-lg), var(--edge);
}
.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--brand);
}
.hero-panel::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -6%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 132, 81, 0.14), transparent 62%);
  pointer-events: none;
}
.hero-content {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
}
.hero-title {
  margin: 0;
  font-size: clamp(32px, 4.4vw, 46px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: 0.005em;
  color: var(--text);
}
.hero-copy {
  max-width: 730px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.6;
}

.hero-visual {
  position: relative;
  width: 164px;
  min-height: 120px;
  display: grid;
  align-content: end;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0.18));
  box-shadow: var(--edge);
}
.scope-chip {
  justify-self: start;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-bg);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
}
.hero-meters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  align-items: end;
  height: 74px;
}
.meter {
  position: relative;
  height: 50%;
  border-radius: 3px 3px 2px 2px;
  background: linear-gradient(to top, #f4692f, var(--accent) 60%, #ffc79f);
  box-shadow: 0 0 12px -2px rgba(255, 132, 81, 0.5);
  transform-origin: bottom;
  animation: eq-bounce 2.6s ease-in-out infinite;
}
.hero-meters .meter:nth-child(1) { animation-delay: -0.2s; }
.hero-meters .meter:nth-child(2) { animation-delay: -1.1s; }
.hero-meters .meter:nth-child(3) { animation-delay: -0.6s; }
.hero-meters .meter:nth-child(4) { animation-delay: -1.7s; }
@keyframes eq-bounce {
  0%, 100% { transform: scaleY(0.82); }
  50% { transform: scaleY(1.04); }
}
.meter-36 { height: 36%; } .meter-40 { height: 40%; } .meter-42 { height: 42%; }
.meter-44 { height: 44%; } .meter-46 { height: 46%; } .meter-50 { height: 50%; }
.meter-55 { height: 55%; } .meter-56 { height: 56%; } .meter-58 { height: 58%; }
.meter-62 { height: 62%; } .meter-64 { height: 64%; } .meter-68 { height: 68%; }
.meter-70 { height: 70%; } .meter-72 { height: 72%; } .meter-78 { height: 78%; }
.meter-82 { height: 82%; } .meter-86 { height: 86%; } .meter-88 { height: 88%; }
.meter-90 { height: 90%; } .meter-92 { height: 92%; } .meter-94 { height: 94%; }
.meter-96 { height: 96%; }

/* --------------------------------------------------------------------------
   Metric grid
   -------------------------------------------------------------------------- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.metric {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  background-image: var(--surface-gradient-raised, linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 60%));
  box-shadow: var(--shadow), var(--edge);
  transition: border-color 160ms ease, transform 160ms ease;
}
.metric::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  width: 28px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--brand);
}
.metric:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.metric span {
  display: block;
  color: var(--dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.metric strong {
  display: block;
  margin-top: 9px;
  overflow-wrap: anywhere;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Cards + generic layout
   -------------------------------------------------------------------------- */
.card,
.login-card,
.release-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 55%);
  box-shadow: var(--shadow), var(--edge);
}
.card,
.login-card { padding: 22px; margin-bottom: 16px; }
.login-card {
  position: relative;
  overflow: hidden;
  padding: 32px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), var(--edge);
}
.login-card::after {
  content: "";
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 380px;
  height: 260px;
  background: radial-gradient(circle, rgba(255, 132, 81, 0.16), transparent 66%);
  pointer-events: none;
}
.login-beacon {
  width: 46px;
  height: 5px;
  margin-bottom: 20px;
  border-radius: 999px;
  background: var(--brand);
  box-shadow: var(--glow-accent);
}
.card h2,
.login-card h2 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 700;
}
.hint {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 11.5px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.grid,
.release-grid,
.split-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}
.split-grid { grid-template-columns: minmax(300px, 0.9fr) minmax(320px, 1.1fr); }

.section-heading,
.section-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 14px;
}
.section-heading h2,
.section-toolbar h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.section-heading span,
.section-toolbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

/* Quick filter chips */
.filter-panel { padding: 16px; }
.quick-filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }
.quick-filter {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}
.quick-filter span {
  min-width: 22px;
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.quick-filter:hover,
.quick-filter.active {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-bg);
}
.quick-filter.active span { background: var(--accent); color: var(--ink); }

.filter-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.5fr) auto;
  gap: 12px;
  align-items: end;
}
.form-field, .form-row { min-width: 0; }
.form-row { margin-bottom: 14px; }
.form-row:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Release cards (generic)
   -------------------------------------------------------------------------- */
.release-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
}
.release-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.release-title { min-width: 0; }
.release-title strong { display: block; font-size: 17px; font-weight: 700; line-height: 1.2; }
.release-title span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.release-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.release-meta {
  display: flex; flex-wrap: wrap; gap: 7px;
  color: var(--dim); font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.release-meta span {
  min-height: 23px; display: inline-flex; align-items: center;
  padding: 0 8px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
}
.release-notes { color: var(--muted); white-space: pre-wrap; font-size: 13px; line-height: 1.55; }
.file-group-label {
  margin: 2px 0 -4px; color: var(--dim);
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
}
.file-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line);
}
.file-strip .mono { min-width: 0; word-break: break-word; }
.platform-actions {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px; margin-top: auto;
}
.platform-download {
  min-height: 64px; display: grid; grid-template-columns: 36px minmax(0, 1fr);
  align-items: center; gap: 12px; padding: 11px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.22);
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.platform-download:hover {
  transform: translateY(-2px);
  border-color: var(--accent-border);
  background: var(--accent-bg);
}
.platform-mark {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--accent-border); border-radius: var(--radius-md);
  background: var(--accent-bg); color: var(--accent); font-weight: 700;
}
.platform-download strong, .platform-download em { display: block; min-width: 0; }
.platform-download strong { font-size: 13px; }
.platform-download em {
  margin-top: 3px; color: var(--muted); font-size: 11px; font-style: normal; word-break: break-word;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
label {
  display: block; margin: 0 0 7px; color: var(--dim);
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
}
input, select, textarea {
  width: 100%; min-height: 40px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04); color: var(--text);
  padding: 9px 12px; font: inherit; font-size: 14px;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
input::placeholder, textarea::placeholder { color: var(--dim); }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
  background: rgba(0, 0, 0, 0.25);
}
select {
  appearance: none; -webkit-appearance: none;
  background-color: rgba(0, 0, 0, 0.28);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2398a1b0' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
}
textarea { min-height: 138px; resize: vertical; line-height: 1.5; }

.changelog-legend {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.changelog-editor { display: grid; gap: 12px; }
.changelog-langs { display: grid; gap: 10px; }
.changelog-lang {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.22);
}
.changelog-lang-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.changelog-lang-head label {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
.changelog-lang-code {
  min-width: 38px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.changelog-lang textarea { min-height: 112px; width: 100%; }
.changelog-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.changelog-add-row input { flex: 1 1 auto; min-width: 0; }
.changelog-add-row button { flex: 0 0 auto; min-height: 40px; }

.release-changelog-list {
  margin: 0;
  padding: 0 0 0 1.15em;
  display: grid;
  gap: 6px;
}
.release-changelog-list li { padding-left: 2px; }
.release-changelog-text { white-space: pre-wrap; }
input[type="file"] {
  padding: 9px; color: var(--muted); cursor: pointer;
}
input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 8px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06); color: var(--text);
  font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  transition: background 140ms ease;
}
input[type="file"]::file-selector-button:hover { background: rgba(255, 255, 255, 0.12); }

.form-card { max-width: 1000px; }
.field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.form-section { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.form-section-head {
  display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; margin-bottom: 16px;
}
.form-section-head > span {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  background: var(--brand); color: var(--ink);
  font-size: 12px; font-weight: 700;
  box-shadow: var(--glow-accent);
}
.form-section-head strong { display: block; font-size: 15px; font-weight: 700; }
.form-section-head p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.bundle-summary {
  display: grid; gap: 5px; margin: 14px 0 2px; padding: 14px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.24);
}
.bundle-summary span {
  color: var(--dim); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
}
.bundle-summary strong, .bundle-summary code { min-width: 0; word-break: break-word; }

.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 9px; }
.check-row {
  min-height: 40px; display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03); color: var(--muted);
  text-transform: none; letter-spacing: 0; font-size: 13.5px; font-weight: 700;
  cursor: pointer; transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}
.check-row:hover { border-color: var(--line-strong); color: var(--text); }
.check-row:has(input:checked) {
  border-color: var(--accent-border);
  background: var(--accent-bg);
  color: var(--text);
}
.check-row input {
  min-height: auto; width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer;
}
.user-list { display: grid; gap: 12px; }
.user-editor {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(170px, 1fr) minmax(170px, 1fr) auto minmax(240px, 1.4fr) auto;
  gap: 12px; align-items: end; padding: 15px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface-soft);
  transition: border-color 140ms ease;
}
.user-editor:hover { border-color: var(--line-strong); }
.user-editor .form-row { margin-bottom: 0; }
.user-identity { display: grid; gap: 4px; }
.user-identity strong { font-size: 15px; font-weight: 700; }

/* --------------------------------------------------------------------------
   Buttons — primary = solid orange; secondary = ghost (ETONCC style)
   -------------------------------------------------------------------------- */
.btn, button {
  min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--accent); border-radius: var(--radius-md);
  background: var(--accent); color: var(--ink);
  padding: 0 18px; font: inherit; font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer;
  box-shadow: var(--glow-accent), var(--edge);
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}
.btn:hover, button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 0 24px -6px rgba(255, 132, 81, 0.75), var(--edge);
}
.btn:active, button:active { transform: scale(0.985); }
.btn:focus-visible, button:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--accent-bg), var(--glow-accent);
}
.btn.secondary, button.secondary {
  background: transparent;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 60%);
  border-color: var(--line-strong); color: var(--text);
  box-shadow: var(--edge);
}
.btn.secondary:hover, button.secondary:hover {
  background: rgba(255, 255, 255, 0.06); border-color: var(--accent-border);
  color: var(--text); box-shadow: var(--edge); filter: none;
}
.btn.danger, button.danger {
  background: transparent;
  border-color: rgba(255, 83, 71, 0.45); color: #ff8a7e;
  box-shadow: var(--edge);
}
.btn.danger:hover, button.danger:hover {
  background: rgba(255, 83, 71, 0.14); border-color: var(--red);
  color: #ffb4ac; box-shadow: var(--edge); filter: none;
}

/* --------------------------------------------------------------------------
   Pills / badges
   -------------------------------------------------------------------------- */
.pill {
  min-height: 24px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 10px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
}
.pill.stable, .pill.published {
  background: rgba(87, 208, 106, 0.14); color: #a6f0b1; border: 1px solid rgba(87, 208, 106, 0.36);
}
.pill.beta {
  background: rgba(255, 184, 77, 0.14); color: #ffdca0; border: 1px solid rgba(255, 184, 77, 0.38);
}
.pill.internal {
  background: rgba(255, 83, 71, 0.15); color: #ffb3ac; border: 1px solid rgba(255, 83, 71, 0.4);
}
.pill.draft {
  background: rgba(255, 255, 255, 0.07); color: var(--muted); border: 1px solid var(--line);
}
.pill.archived {
  background: rgba(255, 255, 255, 0.03); color: var(--dim); border: 1px solid var(--line);
}
.pill.windows, .pill.macos, .pill.macos-arm64, .pill.macos-x64, .pill.linux, .pill.all {
  background: var(--accent-bg); color: #ffcbb0; border: 1px solid var(--accent-border);
}
/* Published but not yet announced: visible to signed-in users only. Dashed so
   it reads as a temporary state rather than another channel. */
.pill.unlisted {
  background: rgba(147, 178, 255, 0.13); color: #c6d6ff; border: 1px dashed rgba(147, 178, 255, 0.5);
}
.platform-version-unlisted {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 8px 0 0; font-size: 12px; color: var(--muted);
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td {
  text-align: left; padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: top;
}
.table thead th {
  position: sticky; top: 0;
  color: var(--dim); font-size: 10px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase;
  background: var(--surface);
}
.table tbody tr { transition: background 140ms ease; }
.table tbody tr:hover { background: rgba(255, 132, 81, 0.05); }
.table tbody tr:last-child td { border-bottom: 0; }
.table-notes { max-width: 340px; white-space: pre-wrap; color: var(--muted); }

/* --------------------------------------------------------------------------
   Alerts + empty states
   -------------------------------------------------------------------------- */
.alert {
  position: relative;
  border-radius: var(--radius-md); padding: 13px 15px 13px 16px; margin-bottom: 16px;
  font-size: 13.5px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.28);
  box-shadow: var(--edge);
}
.alert::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; border-radius: 4px 0 0 4px;
}
.alert.error { border-color: rgba(255, 83, 71, 0.42); color: #ffc4bf; background: rgba(255, 83, 71, 0.08); }
.alert.error::before { background: var(--red); }
.alert.ok { border-color: rgba(87, 208, 106, 0.42); color: #b0f2ba; background: rgba(87, 208, 106, 0.08); }
.alert.ok::before { background: var(--green); }

.empty-state { text-align: center; padding: 40px 24px; }
.empty-state strong { display: block; margin-bottom: 8px; font-size: 16px; }

/* --------------------------------------------------------------------------
   Download workbench (sidebar variant — retained)
   -------------------------------------------------------------------------- */
.download-workbench {
  display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start;
}
.download-sidebar {
  position: sticky; top: 88px; display: grid; gap: 12px; padding: 16px;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface-raised); box-shadow: var(--shadow), var(--edge);
}
.download-brand { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.download-brand span,
.download-toolbar span,
.download-stat span,
.download-row-kicker,
.download-file span {
  color: var(--dim); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
}
.download-brand strong { display: block; margin-top: 8px; font-size: 22px; font-weight: 700; line-height: 1.05; }
.download-brand p { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.download-stat {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 46px; padding: 11px; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.2);
}
.download-stat strong { font-size: 18px; font-weight: 700; line-height: 1; text-align: right; font-variant-numeric: tabular-nums; }
.download-filter-form {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px; align-items: end;
}
.download-filter-form .form-row { margin-bottom: 0; }
.download-sidebar .download-filter-form { grid-template-columns: 1fr; padding-top: 4px; }
.download-sidebar .download-filter-form button { margin-top: 4px; }
.download-note {
  display: grid; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.2);
}
.download-note span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.download-note a {
  color: var(--accent); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
}
.download-main { min-width: 0; display: grid; gap: 14px; }
.download-toolbar {
  min-height: 84px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 160% at 0 0, var(--accent-bg), transparent 48%),
    var(--surface-raised);
  box-shadow: var(--shadow), var(--edge);
}
.download-toolbar h1 { margin: 6px 0 0; font-size: 34px; font-weight: 700; line-height: 1; }
.download-tabs { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.download-tabs a {
  min-height: 34px; display: inline-flex; align-items: center; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(0, 0, 0, 0.22);
  color: var(--muted); font-size: 11px; font-weight: 700;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}
.download-tabs a:hover,
.download-tabs a.active {
  color: var(--accent); border-color: var(--accent-border); background: var(--accent-bg);
}
.download-empty {
  display: grid; gap: 8px; padding: 34px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg);
  background: rgba(0, 0, 0, 0.16); text-align: center;
}
.download-empty strong { font-size: 16px; }
.download-empty span { color: var(--muted); font-size: 13px; }
.download-list { display: grid; gap: 12px; }
.download-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 340px); gap: 16px; padding: 18px;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface-raised); box-shadow: var(--shadow), var(--edge);
}
.download-row-main { min-width: 0; }
.download-row-kicker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.download-row-kicker span:last-child { color: var(--accent); }
.download-row h2 { margin: 0; overflow-wrap: anywhere; font-size: 21px; font-weight: 700; line-height: 1.2; }
.download-row-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.download-row-meta span {
  min-height: 23px; display: inline-flex; align-items: center; padding: 0 8px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(0, 0, 0, 0.2);
  color: var(--dim); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.download-row p { margin: 12px 0 0; color: var(--muted); white-space: pre-wrap; font-size: 13px; line-height: 1.55; }
.download-row-files { display: grid; align-content: start; gap: 8px; }
.download-file {
  min-width: 0; display: grid; gap: 4px; padding: 12px;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(0, 0, 0, 0.22);
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.download-file:hover {
  transform: translateY(-2px); border-color: var(--accent-border); background: var(--accent-bg);
}
.download-file strong { min-width: 0; overflow-wrap: anywhere; font-size: 13px; line-height: 1.25; }
.download-file em { color: var(--muted); font-size: 11px; font-style: normal; }
.download-file.is-primary { border-color: var(--accent-border); }
.download-file.is-missing { color: var(--dim); font-size: 13px; border-style: dashed; }

/* --------------------------------------------------------------------------
   Public download page (centered variant — the live one)
   -------------------------------------------------------------------------- */
.download-page { width: min(1000px, 100%); margin: 0 auto; }
.download-header { text-align: center; margin: 30px auto 28px; }
.download-header .eyebrow { justify-content: center; }
.download-header h1 {
  margin: 0; font-size: clamp(30px, 4.2vw, 42px); font-weight: 700; line-height: 1.04; color: var(--text);
}
.download-header p { max-width: 640px; margin: 12px auto 0; color: var(--muted); font-size: 15.5px; line-height: 1.55; }
.download-summary { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.download-summary div {
  position: relative; overflow: hidden; min-width: 200px; text-align: center;
  padding: 14px 22px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface-raised); box-shadow: var(--shadow), var(--edge);
}
.download-summary span,
.platform-version-head span,
.platform-column-head span,
.platform-download-button span,
.firmware-download-line span {
  color: var(--dim); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
}
.download-summary strong { display: block; margin-top: 7px; font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.download-controls { display: grid; gap: 12px; margin-bottom: 18px; }
.download-public-note {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface-raised); color: var(--muted); font-size: 13.5px;
}
.download-public-note a { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }

.platform-version-list { display: grid; gap: 16px; }
.platform-version-card {
  position: relative; overflow: hidden;
  padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface-raised); box-shadow: var(--shadow), var(--edge);
  transition: border-color 160ms ease, transform 160ms ease;
}
.platform-version-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.platform-version-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.platform-version-head h2 { margin: 6px 0 0; font-size: 25px; font-weight: 700; line-height: 1.1; }
.platform-version-date {
  flex: 0 0 auto; color: var(--muted); font-size: 12px; font-weight: 700;
  padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: rgba(0, 0, 0, 0.24);
}
.platform-version-notes {
  margin: 14px 0 0;
  padding-top: 4px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}
.platform-version-notes > summary {
  list-style: none;
  appearance: none;
  -webkit-appearance: none;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  user-select: none;
}
.platform-version-notes > summary::-webkit-details-marker { display: none; }
.platform-version-notes > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 140ms ease, margin-top 140ms ease;
}
.platform-version-notes[open] > summary::after {
  margin-top: 2px;
  transform: rotate(-135deg);
}
.platform-version-notes > summary:focus-visible {
  outline: none;
  border-radius: 6px;
  box-shadow: 0 0 0 2px var(--accent-border);
}
.platform-version-notes-body {
  max-height: min(48vh, 420px);
  overflow: auto;
  margin: 0 0 8px;
  padding: 8px 2px 4px;
}
.platform-download-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.platform-column {
  min-width: 0; display: grid; align-content: start; gap: 10px; padding: 14px;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(0, 0, 0, 0.2);
}
.platform-column-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.platform-column-head strong { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.os-glyph { width: 17px; height: 17px; flex: 0 0 auto; color: var(--blue); }
.os-glyph-tux { color: initial; }
.platform-download-button {
  min-width: 0; display: grid; gap: 4px; padding: 12px;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft);
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.platform-download-button:hover {
  transform: translateY(-2px); border-color: var(--accent-border); background: var(--accent-bg);
}
.platform-download-button strong { min-width: 0; overflow-wrap: anywhere; font-size: 13px; line-height: 1.25; }
.platform-download-button em { color: var(--muted); font-size: 11px; font-style: normal; }
.platform-missing {
  min-height: 70px; display: flex; align-items: center; justify-content: center; padding: 12px;
  border: 1px dashed var(--line); border-radius: var(--radius-md); color: var(--dim); font-size: 13px; text-align: center;
}
.firmware-download-line {
  display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.2);
}
.firmware-download-line span { display: inline-flex; align-items: center; gap: 7px; }
.firmware-download-line strong { min-width: 0; overflow-wrap: anywhere; font-size: 13.5px; font-weight: 700; }
.firmware-download-line em { color: var(--muted); font-size: 11px; font-style: normal; }
.fw-glyph { width: 15px; height: 15px; flex: 0 0 auto; color: var(--blue); }

/* --------------------------------------------------------------------------
   Tools & Downloads (free-form utility files)
   -------------------------------------------------------------------------- */
.tools-group { margin-top: 26px; }
.tools-group-title {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin: 0 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--hairline);
}
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tool-card {
  display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 16px;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface-raised); box-shadow: var(--shadow), var(--edge);
}
.tool-card-body { display: grid; gap: 8px; }
.tool-card-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.tool-card-head h3 { margin: 0; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.tool-card-desc { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.tool-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 2px; }
.tool-file { font-size: 12px; font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.tool-tag {
  font-size: 11px; color: var(--muted); padding: 1px 8px;
  border: 1px solid var(--line); border-radius: 999px;
}
.tool-sha { font-size: 11px; color: var(--dim); }
.tool-download { margin-top: auto; text-align: center; }

/* --------------------------------------------------------------------------
   Wizard preset designer
   -------------------------------------------------------------------------- */
.preset-guide h2 { margin-bottom: 14px; }
.preset-guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.preset-guide-grid div {
  min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.2);
}
.preset-guide-grid strong { display: block; font-size: 13.5px; font-weight: 700; }
.preset-guide-grid p { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }

.preset-workbench { display: grid; grid-template-columns: 274px minmax(0, 1fr); gap: 16px; align-items: start; }
.preset-sidebar {
  position: sticky; top: 88px; display: grid; gap: 12px; padding: 16px;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface-raised); box-shadow: var(--shadow), var(--edge);
}
.preset-tabs { display: grid; gap: 7px; }
.preset-tabs a {
  min-height: 42px; display: flex; align-items: center; padding: 0 13px;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(0, 0, 0, 0.22);
  color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}
.preset-tabs a:hover,
.preset-tabs a.active {
  color: var(--accent); border-color: var(--accent-border); background: var(--accent-bg);
}
.preset-wide { width: 100%; }
.preset-main { min-width: 0; }
.preset-form { display: grid; gap: 14px; }
.preset-card-list { display: grid; gap: 14px; }
.preset-editor-card {
  min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface-raised); box-shadow: var(--shadow), var(--edge);
}
.preset-card-head, .preset-channel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.preset-card-head { margin-bottom: 16px; }
.preset-channel-head { margin-top: 16px; padding-top: 4px; }
.preset-card-title { min-width: 0; }
.preset-card-title span, .preset-channel-head > span {
  display: block; color: var(--dim); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
}
.preset-card-title strong { display: block; margin-top: 5px; overflow-wrap: anywhere; font-size: 18px; font-weight: 700; line-height: 1.15; }
.preset-remove, .preset-row-remove { flex: 0 0 auto; }
.preset-field-grid { grid-template-columns: minmax(150px, 0.8fr) minmax(190px, 1fr) minmax(220px, 1.3fr); }
.preset-signal-list { display: grid; gap: 8px; margin-top: 10px; }
.preset-signal-row, .layout-channel-row { min-width: 0; display: grid; gap: 9px; align-items: center; }
.preset-signal-row { grid-template-columns: 54px minmax(180px, 1fr) auto; }
.layout-channel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 10px; }
.layout-channel-row {
  grid-template-columns: 54px minmax(180px, 1fr) 132px; padding: 9px;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(0, 0, 0, 0.2);
}
.preset-channel-number {
  display: inline-flex; align-items: center; justify-content: center; min-height: 26px; padding: 0 8px;
  border-radius: var(--radius-sm); background: var(--accent-bg); border: 1px solid var(--accent-border);
  color: var(--accent); font-family: var(--mono); font-size: 11px; font-weight: 700;
}
.preset-dot-editor { display: grid; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.preset-dot-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 14px; align-items: start; }
.mini-car-preview {
  position: relative; overflow: hidden; width: 100%; aspect-ratio: 1 / 1.25;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 80% at 50% 0, var(--accent-bg), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.28));
  box-shadow: var(--edge);
}
.mini-car-preview::before,
.mini-car-preview::after,
.mini-car-body { content: ""; position: absolute; pointer-events: none; }
.mini-car-preview::before {
  inset: 8% 24% 8%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 44% 44% 18% 18% / 22% 22% 16% 16%;
  background: rgba(255, 255, 255, 0.03);
}
.mini-car-preview::after {
  left: 32%; right: 32%; top: 18%; height: 20%;
  border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 40% 40% 10% 10%;
  background: var(--accent-bg);
}
.mini-car-body {
  left: 26%; right: 26%; bottom: 18%; height: 34%;
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 18%;
}
.preset-dot-marker {
  position: absolute; z-index: 2; width: 15px; height: 15px; transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.95); border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.55), 0 0 0 4px rgba(255, 255, 255, 0.06);
}
.preset-dot-list { display: grid; gap: 8px; }
.preset-dot-row {
  min-width: 0; display: grid; grid-template-columns: 58px 78px 78px minmax(190px, 1fr) auto; gap: 9px;
  align-items: end; padding: 9px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(0, 0, 0, 0.2);
}
.preset-dot-row label { margin: 0; }
.preset-dot-row input { min-height: 38px; }
.preset-color-cell { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 7px; }
.preset-color-cell input[type="color"] { min-width: 0; min-height: 38px; padding: 4px; cursor: pointer; }
.cable-matrix-wrap {
  overflow-x: auto; margin-top: 10px; padding-bottom: 6px;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(0, 0, 0, 0.2);
}
.cable-matrix { border-collapse: collapse; min-width: 100%; font-size: 11px; }
.cable-matrix th, .cable-matrix td { padding: 2px; text-align: center; white-space: nowrap; }
.cable-matrix thead th { color: var(--dim); font-size: 10px; letter-spacing: 0.08em; }
.cable-matrix tbody th, .cable-matrix thead th:first-child {
  position: sticky; left: 0; z-index: 1; background: var(--surface-raised);
  color: var(--accent); font-family: var(--mono); font-size: 11px; padding: 0 8px;
}
.cable-matrix-cell {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 46px; height: 38px; margin: 0 auto; padding: 0; cursor: pointer;
  border: 0; background: transparent; color: var(--accent); font: inherit;
}
.cable-matrix-cell::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}
.cable-matrix-cell:hover { background: var(--accent-bg); }
.cable-matrix-cell.is-active { background: var(--accent-bg); }
.cable-matrix-cell.is-active::before { display: none; }
.cable-matrix-cell [data-cell-mark] {
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
}
.cable-matrix-cell:not(.is-active) [data-cell-mark]:empty { display: none; }

/* --------------------------------------------------------------------------
   Motion preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .portal-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    height: auto;
    gap: 8px 12px;
    padding: 10px 12px;
    position: static;
    top: 0;
    border-radius: 12px;
  }
  .brand-lockup { grid-column: 1; grid-row: 1; }
  .topbar-end { grid-column: 2; grid-row: 1; }
  .portal-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
    row-gap: 4px;
    overflow: visible;
  }
  .portal-nav > a,
  .nav-admin summary { padding: 0 9px; }
  .nav-admin { margin-left: 0; padding-left: 8px; }
  .session-chip { max-width: none; }
  .is-login .portal-topbar {
    display: flex;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
}

@media (max-width: 980px) {
  .hero-content { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .metric-grid,
  .download-workbench,
  .preset-workbench,
  .filter-form,
  .download-filter-form,
  .split-grid,
  .field-grid,
  .user-editor { grid-template-columns: 1fr; }
  .filter-action, .filter-action button { width: 100%; }
  .download-sidebar, .preset-sidebar { position: static; }
  .download-toolbar, .download-row { grid-template-columns: 1fr; }
  .download-summary,
  .platform-download-grid,
  .firmware-download-line,
  .preset-field-grid,
  .layout-channel-grid,
  .preset-guide-grid,
  .preset-dot-layout { grid-template-columns: 1fr; }
  .platform-version-head { flex-direction: column; }
  .download-toolbar { align-items: stretch; flex-direction: column; }
  .download-tabs { justify-content: flex-start; }
  .preset-signal-row, .layout-channel-row, .preset-dot-row { grid-template-columns: 1fr; }
  .preset-card-head, .preset-channel-head { align-items: stretch; flex-direction: column; }
}

@media (max-width: 760px) {
  .brand-sub { display: none; }
  .session-user { display: none; }
  .nav-admin { padding-left: 0; }
  .nav-admin::before { display: none; }
  .table-wrap { overflow: visible; }
  .table, .table thead, .table tbody, .table tr, .table th, .table td { display: block; }
  .table thead { display: none; }
  .table tr {
    margin-bottom: 12px; padding: 14px; border: 1px solid var(--line);
    border-radius: var(--radius-md); background: var(--surface-soft);
  }
  .table td {
    display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 10px; padding: 8px 0; border: 0;
  }
  .table td::before {
    content: attr(data-label); color: var(--dim); font-size: 10px; font-weight: 700;
    letter-spacing: 0.12em; text-transform: uppercase;
  }
  .table td .pill,
  .table td .release-badges { justify-self: start; }
  .table tbody tr:last-child td { border-bottom: 0; }
  .table-notes { max-width: none; }
}

@media (max-width: 560px) {
  .changelog-add-row { flex-direction: column; align-items: stretch; }
  .portal-shell { width: min(100% - 24px, 1200px); padding-top: 12px; }
  .is-public .brand-sub { display: none; }
  .hero-panel { padding: 24px 20px; }
  .section-heading, .section-toolbar, .release-head, .file-strip {
    align-items: stretch; flex-direction: column;
  }
  .release-badges { justify-content: flex-start; }
  .btn, button { width: 100%; }
  .form-actions { display: grid; }
}
