:root {
  --black: #080706;
  --black2: #0e0c0a;
  --ink: #14100c;
  --panel: rgba(20, 16, 12, .76);
  --panel2: rgba(14, 12, 10, .7);
  --cream: #ece4d6;
  --muted: #8c8175;
  --dim: #5f574c;
  --gold: #c6a564;
  --gold-light: #e7cf95;
  --gold-dark: #a8854a;
  --green: #9fb98a;
  --red: #d98a6a;
  --line: #2a241d;
  --line-strong: #3a322a;
  --shadow: 0 50px 120px -50px rgba(0, 0, 0, .92);
  --shadow-soft: 0 28px 70px -42px rgba(0, 0, 0, .9);
  --sans: 'Archivo', system-ui, -apple-system, sans-serif;
  --serif: 'Bodoni Moda', Georgia, serif;
  --mono: 'JetBrains Mono', Menlo, monospace;
}

* { box-sizing: border-box; }

html {
  color-scheme: dark;
  background: var(--black);
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  font-family: var(--sans);
  background:
    radial-gradient(1100px 600px at 82% -12%, rgba(198, 165, 100, .12), transparent 60%),
    radial-gradient(800px 700px at -10% 35%, rgba(198, 165, 100, .05), transparent 55%),
    var(--black);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: 0;
  opacity: .22;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='900' viewBox='0 0 1600 900'%3E%3Cg fill='none' stroke='%23c6a564' stroke-opacity='.25' stroke-width='1'%3E%3Cpath d='M710 5c-55 70-81 142-38 205 43 62 130 75 166 134 36 60-10 137 25 205 35 70 146 92 207 143 61 52 71 132 35 202'/%3E%3Cpath d='M805 10c-40 60-54 124-10 174 44 50 119 62 146 117 27 55-17 120 18 177 35 58 135 78 190 126 55 48 60 118 24 184'/%3E%3Cpath d='M905 6c-27 54-27 111 19 151 46 41 109 52 130 99 21 47-18 102 18 151 36 50 122 67 169 109 47 42 48 102 12 161'/%3E%3Cpath d='M1008 18c-14 43-4 86 40 117 45 31 96 43 111 79 15 36-17 80 18 119 35 39 107 53 146 85 39 32 37 79 4 125'/%3E%3Cpath d='M1114 20c-3 34 16 65 56 88 40 24 78 35 88 61 10 27-14 61 18 90 32 30 87 42 117 65 30 24 24 58-4 90'/%3E%3C/g%3E%3Cg fill='%23c6a564' fill-opacity='.18' font-family='monospace' font-size='16'%3E%3Ctext x='980' y='128'%3E+12%3C/text%3E%3Ctext x='925' y='278'%3E+4%3C/text%3E%3Ctext x='896' y='382'%3E0%3C/text%3E%3Ctext x='874' y='493'%3E-4%3C/text%3E%3Ctext x='918' y='654'%3E-8%3C/text%3E%3C/g%3E%3C/svg%3E");
  background-position: center top;
  background-size: cover;
  mix-blend-mode: screen;
  animation: contourDrift 24s ease-in-out infinite alternate;
}

body::after {
  z-index: 0;
  opacity: .22;
  background:
    radial-gradient(circle at 22% 18%, rgba(225, 201, 133, .14), transparent 22%),
    radial-gradient(circle at 86% 62%, rgba(143, 176, 121, .10), transparent 20%),
    linear-gradient(90deg, rgba(237,230,214,.05), transparent 18%, transparent 82%, rgba(176,137,76,.06));
  animation: ambientBreath 9s ease-in-out infinite alternate;
}

button, input, select {
  font: inherit;
}

button, a {
  -webkit-tap-highlight-color: transparent;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .2;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.08) 0 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 3px 3px, 42px 42px, 42px 42px;
  mask-image: linear-gradient(180deg, #000, transparent 88%);
  z-index: 0;
  animation: grainShift 1.8s steps(2) infinite;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 70px;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(16px, 4vw, 48px);
  background: rgba(8, 7, 6, .82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-grid;
  grid-template-columns: 38px auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  color: var(--cream);
  text-decoration: none;
}

.brand-mark {
  grid-row: 1 / span 2;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--gold-light);
  font-family: var(--serif);
  border-radius: 50%;
  background: rgba(176, 137, 76, .08);
}

.brand-word {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: .34em;
  line-height: 1;
}

.brand-version {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .18em;
}

.nav {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.nav button,
.nav a,
.command-sidebar button {
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  border-radius: 4px;
  padding: 9px 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-decoration: none;
}

.nav button:hover,
.nav a:hover,
.command-sidebar button:hover,
.command-sidebar button.active {
  color: var(--gold-light);
  background: rgba(231, 207, 149, .055);
}

body:not([data-auth-state="signed-in"]) .member-only,
body:not([data-admin-state="admin"]) .admin-only {
  display: none !important;
}

.auth-slot {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.screen {
  min-height: calc(100vh - 76px);
  display: none;
  position: relative;
  z-index: 1;
  padding: clamp(22px, 5vw, 64px);
}

.screen.active {
  display: block;
  animation: rise .42s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes contourDrift {
  from { transform: translate3d(-10px, -8px, 0) scale(1.02); }
  to { transform: translate3d(12px, 10px, 0) scale(1.05); }
}

@keyframes ambientBreath {
  from { opacity: .16; transform: scale(1); }
  to { opacity: .28; transform: scale(1.04); }
}

@keyframes grainShift {
  0% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(1px, -1px, 0); }
  100% { transform: translate3d(-1px, 1px, 0); }
}

.hero-grid,
.teaser-grid,
.auth-page,
.report-layout,
.command-layout {
  max-width: 1240px;
  margin: 0 auto;
  min-width: 0;
}

.hero-copy,
.auth-copy,
.instrument-card,
.score-card,
.unlock-card,
.report-hero,
.command-main {
  min-width: 0;
}

.hero-grid {
  min-height: calc(100vh - 184px);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .72fr);
  align-items: center;
  gap: clamp(28px, 6vw, 86px);
}

.system-label {
  margin: 0 0 16px;
  color: var(--gold-light);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
}

h1, h2, h3, p {
  margin-top: 0;
}

h1 {
  max-width: min(13ch, 100%);
  margin-bottom: 22px;
  font-family: var(--serif);
  font-size: 66px;
  line-height: .95;
  letter-spacing: 0;
  font-weight: 500;
  overflow-wrap: break-word;
}

h2 {
  font-family: var(--serif);
  font-size: 42px;
  line-height: 1.02;
  letter-spacing: 0;
  font-weight: 500;
}

h3 {
  font-size: 20px;
}

.lead {
  max-width: 46ch;
  color: var(--muted);
  font-size: 14px;
  font-weight: 300;
  line-height: 1.65;
}

.hero-actions,
.unlock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

button,
.ghost,
.gold {
  min-height: 50px;
  border-radius: 4px;
  padding: 0 24px;
  border: 1px solid var(--line-strong);
  color: var(--cream);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  transition: transform .18s ease, filter .18s ease, border-color .18s ease, color .18s ease;
}

button:hover,
.ghost:hover,
.gold:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

.gold {
  color: #1a1408;
  background: linear-gradient(180deg, var(--gold-light), var(--gold-dark));
  border-color: transparent;
  font-weight: 600;
}

.small {
  min-height: 38px;
  padding: 0 14px;
  font-size: 12px;
}

.hidden {
  display: none !important;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.trust-row span {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 8px 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.instrument-card,
.score-card,
.unlock-card,
.auth-box,
.report-hero,
.command-main,
fieldset,
.legal-page,
.legal-grid article {
  background: linear-gradient(180deg, rgba(20, 16, 12, .6), rgba(8, 7, 6, .4));
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  position: relative;
}

.instrument-card::before,
.score-card::before,
.unlock-card::before,
.auth-box::before,
.report-hero::before,
.command-main::before,
fieldset::before,
.legal-page::before,
.legal-grid article::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(231,207,149,.035), transparent 28%),
    repeating-linear-gradient(115deg, rgba(231,207,149,.035) 0 1px, transparent 1px 22px);
  opacity: .8;
}

.instrument-card {
  min-height: 600px;
  padding: 28px;
  display: grid;
  align-content: center;
  gap: 26px;
  overflow: hidden;
}

.ring-wrap {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.ring {
  width: min(280px, 70%);
  aspect-ratio: 1;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(231, 207, 149, .14), transparent 58%);
  box-shadow: inset 0 0 0 22px rgba(8, 7, 6, .82);
}

.ring span {
  font-family: var(--serif);
  font-size: 82px;
  line-height: .82;
  font-weight: 600;
}

.ring small {
  color: var(--muted);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .12em;
}

.orbit {
  position: absolute;
  inset: 14%;
  border: 1px dashed rgba(225, 201, 133, .18);
  border-radius: 50%;
  animation: orbitSpin 18s linear infinite;
}

.o2 {
  inset: 2%;
  transform: rotate(24deg);
  animation-duration: 28s;
  animation-direction: reverse;
}

@keyframes orbitSpin {
  to { transform: rotate(360deg); }
}

.flow-steps {
  display: grid;
  gap: 10px;
}

.flow-steps div,
.ready-item,
.mini-card,
.notification-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(231, 207, 149, .035);
}

.flow-steps b,
.ready-item span {
  color: var(--gold-light);
  font-family: var(--mono);
  font-size: 12px;
}

.flow-steps span,
.ready-item {
  color: var(--muted);
}

.readiness {
  display: grid;
  gap: 10px;
  margin: 26px 0;
}

.ready-item.on {
  color: var(--cream);
  border-color: rgba(143, 176, 121, .48);
}

.teaser-grid,
.auth-page,
.report-layout {
  min-height: calc(100vh - 184px);
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.score-card,
.unlock-card,
.auth-box,
.report-hero {
  padding: clamp(22px, 4vw, 42px);
}

.big-score,
.report-score span {
  font-family: var(--serif);
  font-size: 138px;
  line-height: .82;
  letter-spacing: 0;
  font-weight: 600;
}

.unlock-card p,
.auth-copy p,
.report-hero p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.auth-copy ol {
  margin: 24px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
}

.fallback-auth {
  display: grid;
  gap: 12px;
}

label,
legend {
  color: var(--cream);
  font-size: 14px;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 10, 8, .48);
  color: var(--cream);
  padding: 0 12px;
}

input::placeholder {
  color: rgba(140, 129, 117, .72);
}

.fallback-auth p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.onboarding-shell {
  max-width: 1100px;
  margin: 0 auto;
}

.onboarding-head {
  max-width: 760px;
  margin-bottom: 24px;
}

.onboarding-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

fieldset {
  padding: 18px;
  display: grid;
  gap: 14px;
  min-width: 0;
}

legend {
  padding: 0 8px;
  color: var(--gold-light);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
}

fieldset label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

fieldset input[type="radio"],
fieldset input[type="checkbox"] {
  width: auto;
  min-height: auto;
  margin-right: 8px;
  accent-color: var(--gold);
}

.report-layout {
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
}

.report-score {
  display: grid;
  gap: 10px;
  margin: 18px 0 24px;
}

.report-score small {
  color: var(--muted);
  font-family: var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(237, 230, 214, .035);
  box-shadow: var(--shadow-soft);
}

.metric-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.metric-card b {
  color: var(--cream);
}

.metric-card span {
  color: var(--gold-light);
  font-family: var(--mono);
}

.bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(237, 230, 214, .08);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
  animation: barGlow 3.8s ease-in-out infinite alternate;
}

@keyframes barGlow {
  from { filter: saturate(1); }
  to { filter: saturate(1.35) brightness(1.06); }
}

.metric-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 12px 0 0;
}

.command-layout {
  min-height: calc(100vh - 184px);
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
}

.command-sidebar {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 7, 6, .58);
  padding: 18px;
  align-self: start;
  position: sticky;
  top: 100px;
}

.command-sidebar h2 {
  font-size: 32px;
  margin-bottom: 18px;
}

.command-sidebar button {
  width: 100%;
  justify-content: flex-start;
  border-radius: 9px;
  margin-bottom: 4px;
  min-height: 40px;
}

.command-main {
  min-height: 640px;
  padding: clamp(18px, 3vw, 34px);
}

.legal-links {
  display: flex;
  gap: 14px;
  margin-top: 18px;
}

.legal-links button {
  min-height: auto;
  padding: 0;
  border: 0;
  color: var(--dim);
  background: transparent;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
}

.site-footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: clamp(14px, 4vw, 38px);
  flex-wrap: wrap;
  padding: 24px clamp(16px, 4vw, 48px) 34px;
  border-top: 1px solid var(--line);
  background: rgba(8, 7, 6, .74);
}

.site-footer a,
.site-footer button {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer button:hover {
  color: var(--gold-light);
}

.legal-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 48px);
}

.legal-page h2 {
  max-width: 760px;
  margin-bottom: 28px;
}

.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.legal-grid article {
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

.legal-grid article h3 {
  margin-bottom: 10px;
}

.legal-grid article p {
  color: var(--muted);
  font-weight: 300;
  line-height: 1.55;
}

.consent-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.consent-actions button,
.consent-actions a {
  min-height: 34px;
  padding: 0 10px;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  color: var(--gold-light);
  font-family: var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
}

.admin-shell {
  display: grid;
  gap: 16px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-tabs button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: rgba(8, 7, 6, .34);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.admin-tabs button.active {
  border-color: rgba(231, 207, 149, .5);
  color: var(--gold-light);
  background: rgba(231, 207, 149, .06);
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.product-toolbar {
  grid-template-columns: minmax(180px, 1fr) minmax(150px, .7fr) auto auto;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(231, 207, 149, .035);
}

.admin-summary b,
.admin-summary span {
  display: block;
}

.admin-summary b {
  color: var(--gold-light);
  font-family: var(--mono);
  font-size: 18px;
}

.admin-summary span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.admin-workbench {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(320px, 1.1fr);
  gap: 14px;
  min-height: 420px;
}

.admin-list,
.admin-detail,
.admin-email-log {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 7, 6, .32);
  padding: 12px;
}

.admin-list {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: 540px;
  overflow: auto;
}

.admin-row {
  width: 100%;
  min-height: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 16, 12, .56);
  color: var(--cream);
  text-align: left;
  letter-spacing: 0;
  text-transform: none;
}

.admin-row.selected,
.admin-row:hover {
  border-color: rgba(231, 207, 149, .42);
  background: rgba(231, 207, 149, .06);
}

.admin-row span,
.admin-row b,
.admin-row small {
  display: block;
}

.admin-row small {
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .02em;
}

.status {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  text-transform: uppercase;
}

.status.active { color: var(--green); }
.status.draft { color: var(--gold-light); }
.status.locked { color: var(--gold-light); }
.status.banned,
.status.deleted { color: var(--red); }

.admin-user-head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.avatar {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #17130e;
  background: var(--gold-light);
  font-weight: 700;
}

.admin-user-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-actions button {
  min-height: 36px;
  padding: 0 11px;
  font-size: 10px;
}

.admin-actions .danger {
  color: #271008;
  background: linear-gradient(180deg, #e8a286, var(--red));
  border-color: transparent;
}

.admin-email-log {
  display: grid;
  gap: 8px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.product-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(8, 7, 6, .32);
  box-shadow: var(--shadow-soft);
}

.product-card header,
.tier-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.product-card h3 {
  margin: 0;
}

.product-card > p {
  margin: 12px 0 16px;
  color: var(--muted);
  line-height: 1.5;
}

.tier-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.tier-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(231, 207, 149, .035);
}

.tier-row b,
.tier-row small {
  display: block;
}

.tier-row small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.wide {
  grid-column: span 2;
}

.mini-card {
  display: block;
  min-height: 150px;
}

.mini-card h3 {
  margin-bottom: 10px;
}

.mini-card p {
  color: var(--muted);
  line-height: 1.45;
}

.notification-stack {
  display: grid;
  gap: 8px;
}

.notification-row b,
.notification-row small,
.notification-row em {
  display: block;
}

.notification-row small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.35;
}

.notification-row em {
  color: var(--gold-light);
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  text-transform: uppercase;
}

.user-chip {
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 6px 5px 5px;
}

.user-chip span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #17130e;
  background: var(--gold-light);
  border-radius: 50%;
  font-weight: 700;
}

.user-chip button {
  min-height: 30px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(16px);
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  max-width: min(520px, calc(100vw - 32px));
  padding: 14px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(12, 10, 8, .92);
  color: var(--cream);
  box-shadow: var(--shadow);
  transition: opacity .18s ease, transform .18s ease;
}

.toast.on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.ok {
  border-color: rgba(159, 185, 138, .48);
}

.toast.warn {
  border-color: rgba(217, 138, 106, .58);
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr auto;
    height: auto;
  }

  .nav {
    order: 3;
    grid-column: 1 / -1;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .hero-grid,
  .teaser-grid,
  .auth-page,
  .report-layout,
  .command-layout,
  .onboarding-grid {
    grid-template-columns: 1fr;
  }

  .instrument-card {
    min-height: auto;
  }

  .dashboard-grid,
  .metric-grid,
  .legal-grid,
  .product-grid,
  .admin-workbench {
    grid-template-columns: 1fr;
  }

  .admin-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wide {
    grid-column: auto;
  }

  .command-sidebar {
    position: static;
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 10px 12px;
    gap: 10px;
  }

  .brand {
    grid-template-columns: 34px auto;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-word {
    font-size: 12px;
  }

  .auth-slot {
    display: none;
  }

  .nav {
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 5px;
  }

  .nav button,
  .nav a {
    flex: 1 0 calc(25% - 5px);
    min-width: 74px;
    padding: 9px 7px;
    text-align: center;
    letter-spacing: .16em;
  }

  .screen {
    min-height: auto;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    padding: 18px 12px 38px;
  }

  .hero-grid,
  .teaser-grid,
  .auth-page,
  .report-layout {
    min-height: auto;
  }

  h1 {
    max-width: min(100%, 330px);
    font-size: 34px;
    line-height: 1;
    overflow-wrap: break-word;
    word-break: normal;
    text-wrap: pretty;
  }

  h2 {
    max-width: min(100%, 330px);
    font-size: 34px;
    line-height: 1.03;
    overflow-wrap: break-word;
    text-wrap: pretty;
  }

  h3 {
    font-size: 18px;
  }

  .lead,
  .unlock-card p,
  .auth-copy p,
  .report-hero p {
    font-size: 16px;
    max-width: min(34ch, 100%);
    overflow-wrap: anywhere;
  }

  .auth-page,
  .auth-box,
  .fallback-auth,
  .fallback-auth p {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .auth-box {
    overflow: hidden;
  }

  .fallback-auth p {
    max-width: 300px;
  }

  .hero-actions,
  .unlock-actions {
    display: grid;
  }

  .hero-actions > *,
  .unlock-actions > *,
  .fallback-auth button,
  #finishOnboardingBtn,
  #saveReportBtn {
    width: 100%;
  }

  .instrument-card {
    padding: 18px;
  }

  .ring span {
    font-size: 58px;
  }

  .big-score,
  .report-score span {
    font-size: 94px;
  }

  .score-card,
  .unlock-card,
  .auth-box,
  .report-hero,
  .command-main {
    padding: 18px;
  }

  .command-main {
    min-height: 420px;
  }

  .admin-toolbar,
  .product-toolbar,
  .admin-summary {
    grid-template-columns: 1fr;
  }

  .admin-actions {
    justify-content: flex-start;
  }

  .command-sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .command-sidebar .system-label,
  .command-sidebar h2 {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
