/* =====================================================================
   Asrix Mindgate – interface theme
   Corporate · technology · interactive. Royal blue → green gradient,
   HUD framing for proof objects. Light + dark.
   ===================================================================== */
:root {
  --brand-red: #ee0000;
  --royal: #2348d6;
  --royal-2: #3b63f0;
  --navy: #0e1f5b;
  --green: #12b76a;
  --mint: #5fe0a8;
  --grad: linear-gradient(115deg, #1d3fc9 0%, #2a6be8 38%, #13a6a0 72%, #12b76a 100%);
  --grad-soft: linear-gradient(115deg, rgba(35,72,214,.10), rgba(18,183,106,.10));

  --bg: #f4f7fe;
  --bg-2: #eaf0fc;
  --surface: #ffffff;
  --surface-2: #f7f9ff;
  --line: #d9e2f5;
  --line-2: #c4d1ee;
  --text: #0c1838;
  --text-2: #3c4a6e;
  --muted: #6a7799;
  --accent: var(--royal);
  --accent-ink: #ffffff;
  --ok: #0e9f5c;
  --ok-bg: #e3f7ee;
  --warn: #b26b00;
  --warn-bg: #fff3dc;
  --bad: #c62f3b;
  --bad-bg: #fde8ea;
  --info: #2348d6;
  --info-bg: #e6edff;
  --shadow: 0 1px 2px rgba(14,31,91,.06), 0 8px 24px -12px rgba(14,31,91,.18);
  --shadow-lg: 0 30px 60px -30px rgba(14,31,91,.35);
  --hud: rgba(35,72,214,.55);
  --grid: rgba(35,72,214,.06);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 20px;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Sora", "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #060d22; --bg-2: #0a1530; --surface: #0d1938; --surface-2: #111f44; --line: #1d2d58; --line-2: #2a3d72;
    --text: #e8eeff; --text-2: #b4c1e6; --muted: #8392bd; --accent: #5b82ff; --accent-ink: #04112e;
    --ok: #3ddc97; --ok-bg: rgba(61,220,151,.12); --warn: #ffbe55; --warn-bg: rgba(255,190,85,.12);
    --bad: #ff6b78; --bad-bg: rgba(255,107,120,.12); --info: #8aa6ff; --info-bg: rgba(91,130,255,.14);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 30px -16px rgba(0,0,0,.7); --shadow-lg: 0 30px 70px -30px rgba(0,0,0,.8);
    --hud: rgba(95,224,168,.55); --grid: rgba(91,130,255,.07); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #060d22; --bg-2: #0a1530; --surface: #0d1938; --surface-2: #111f44; --line: #1d2d58; --line-2: #2a3d72;
  --text: #e8eeff; --text-2: #b4c1e6; --muted: #8392bd; --accent: #5b82ff; --accent-ink: #04112e;
  --ok: #3ddc97; --ok-bg: rgba(61,220,151,.12); --warn: #ffbe55; --warn-bg: rgba(255,190,85,.12);
  --bad: #ff6b78; --bad-bg: rgba(255,107,120,.12); --info: #8aa6ff; --info-bg: rgba(91,130,255,.14);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 30px -16px rgba(0,0,0,.7); --shadow-lg: 0 30px 70px -30px rgba(0,0,0,.8);
  --hud: rgba(95,224,168,.55); --grid: rgba(91,130,255,.07); color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font: 400 16px/1.6 var(--font); color: var(--text); background: var(--bg);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px; background-attachment: fixed; min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; color: var(--text); }
h1 { font-size: clamp(2rem, 4.6vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.2rem); font-weight: 650; }
h3 { font-size: 1.2rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 1em; max-width: 72ch; }
small, .small { font-size: .86rem; }
code, .mono, kbd { font-family: var(--mono); font-size: .86em; }
.hash { font-family: var(--mono); font-size: .8rem; word-break: break-all; color: var(--text-2); }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgba(35,72,214,.25); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.wrap-narrow { width: min(820px, 100% - 32px); margin-inline: auto; }
.section { padding: clamp(48px, 7vw, 96px) 0; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } .span2 { grid-column: auto; } }

/* ------------------------------------------------------------- topbar */
.topbar { position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(160%) blur(12px); background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 20px; height: 74px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 1.08rem; color: var(--text); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand small { display: block; font: 500 .7rem/1 var(--font); color: var(--muted); letter-spacing: 0; margin-top: 3px; }
.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a { padding: 8px 12px; border-radius: 999px; color: var(--text-2); font-weight: 500; font-size: .94rem; }
.nav a:hover, .nav a.active { background: var(--surface); color: var(--text); text-decoration: none; box-shadow: inset 0 0 0 1px var(--line); }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer; }
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); padding: 3px; }
.lang-switch a { padding: 4px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.lang-switch a.on { background: var(--grad); color: #fff; }
.lang-switch a:hover { text-decoration: none; }
.nav-toggle { display: none; }
@media (max-width: 980px) {
  .nav { display: none; position: absolute; top: 74px; left: 0; right: 0; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px 16px; margin: 0; }
  .nav.open { display: flex; }
  .nav-toggle { display: inline-grid; }
  .top-actions .btn-ghost.hide-sm { display: none; }
}

/* ------------------------------------------------------------- buttons */
.btn { --b: var(--accent); display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 10px; border: 1px solid transparent; font: 600 .95rem/1.1 var(--font); cursor: pointer; transition: transform .12s ease, box-shadow .15s ease, background .15s ease; color: var(--text); background: var(--surface); text-decoration: none !important; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 20px -10px rgba(35,72,214,.7); }
.btn-primary:hover { box-shadow: 0 12px 28px -10px rgba(18,183,106,.6); }
.btn-ghost { border-color: var(--line-2); background: transparent; }
.btn-ghost:hover { background: var(--surface); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: .84rem; border-radius: 8px; }
.btn-lg { padding: 15px 24px; font-size: 1.02rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ------------------------------------------------------------- surfaces */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(18px, 2.4vw, 28px); box-shadow: var(--shadow); }
.panel-flat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.panel-tint { background: var(--grad-soft); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }
.panel h3:first-child, .panel-flat h3:first-child, .panel h2:first-child { margin-top: 0; }
.divide > * + * { border-top: 1px solid var(--line); }

/* HUD frame: corner brackets for proof objects (certificates, hashes, verifiers) */
.hud { position: relative; }
.hud::before, .hud::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid var(--hud); pointer-events: none; }
.hud::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: 6px; }
.hud::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: 6px; }
.hud-label { font: 500 .78rem/1 var(--mono); color: var(--muted); display: flex; align-items: center; gap: 8px; }
.hud-label .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(18,183,106,.18); }

/* ------------------------------------------------------------- forms */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--text); }
.field { margin-bottom: 16px; }
.hint { font-size: .82rem; color: var(--muted); margin-top: 5px; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font: 400 .96rem/1.4 var(--font); transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(35,72,214,.15); background: var(--surface); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .92rem; color: var(--text-2); cursor: pointer; }
.check input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--royal); flex: none; }
.form-error { color: var(--bad); font-size: .85rem; margin-top: 5px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span { display: block; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); font-weight: 500; font-size: .92rem; }
.choice input:checked + span { border-color: var(--accent); background: var(--info-bg); box-shadow: inset 0 0 0 1px var(--accent); }
.choice input:focus-visible + span { outline: 3px solid var(--mint); }

.dropzone { border: 2px dashed var(--line-2); border-radius: var(--r); padding: 28px; text-align: center; background: var(--surface-2); cursor: pointer; transition: border-color .2s, background .2s; }
.dropzone.drag { border-color: var(--green); background: var(--ok-bg); }
.file-list { list-style: none; padding: 0; margin: 12px 0 0; }
.file-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); margin-bottom: 6px; font-size: .88rem; }

/* ------------------------------------------------------------- badges, alerts */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { color: var(--ok); background: var(--ok-bg); }
.badge-warn { color: var(--warn); background: var(--warn-bg); }
.badge-bad { color: var(--bad); background: var(--bad-bg); }
.badge-info { color: var(--info); background: var(--info-bg); }
.badge-muted { color: var(--muted); background: var(--bg-2); }
.chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--bg-2); color: var(--text-2); font-size: .8rem; border: 1px solid var(--line); }

.alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r); border: 1px solid; font-size: .93rem; margin-bottom: 16px; }
.alert .ic { flex: none; margin-top: 2px; }
.alert-info { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--text); }
.alert-ok, .alert-success { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.alert-warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.alert-error, .alert-bad { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.banner-low { background: var(--bad); color: #fff; font-weight: 700; padding: 12px 16px; border-radius: 10px; font-family: var(--display); letter-spacing: -.01em; }
.banner-disputed { background: repeating-linear-gradient(-45deg, var(--warn-bg), var(--warn-bg) 12px, transparent 12px, transparent 24px); border: 2px solid var(--warn); color: var(--warn); font-weight: 700; padding: 10px 14px; border-radius: 10px; }
.notice { font-size: .82rem; color: var(--muted); border-left: 3px solid var(--line-2); padding-left: 12px; }

/* ------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: .8rem; background: var(--surface-2); }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.kv { display: grid; grid-template-columns: minmax(130px, 34%) 1fr; gap: 0; font-size: .92rem; }
.kv > div { padding: 9px 0; border-bottom: 1px solid var(--line); }
.kv > div:nth-child(odd) { color: var(--muted); padding-right: 14px; }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }

/* ------------------------------------------------------------- hero */
.hero { position: relative; padding: clamp(40px, 7vw, 88px) 0 clamp(40px, 6vw, 72px); overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -40% -10% auto auto; width: 70vw; height: 70vw; background: radial-gradient(closest-side, rgba(35,72,214,.22), transparent 70%); pointer-events: none; }
.hero::after { content: ""; position: absolute; inset: auto auto -50% -15%; width: 60vw; height: 60vw; background: radial-gradient(closest-side, rgba(18,183,106,.18), transparent 70%); pointer-events: none; }
.hero .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
@media (max-width: 960px) { .hero .wrap { grid-template-columns: 1fr; } }
.hero h1 { max-width: 15ch; }
.hero h1 .line2 { display: block; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(1.05rem, 1.4vw, 1.2rem); color: var(--text-2); max-width: 56ch; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 30px; }

/* Live stamp console – the signature interactive element */
.stamp { background: var(--navy); color: #dfe8ff; border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-lg); border: 1px solid rgba(95,224,168,.25); position: relative; overflow: hidden; }
:root[data-theme="dark"] .stamp { background: #08132f; }
.stamp::before { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 50%, rgba(95,224,168,.03) 50%); background-size: 100% 4px; pointer-events: none; }
.stamp .hud-label { color: #8fa4d9; }
.stamp input { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.16); color: #fff; font-family: var(--font); }
.stamp input::placeholder { color: #7f91c4; }
.stamp-out { margin-top: 14px; display: grid; gap: 10px; }
.stamp-row { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: baseline; font-size: .82rem; }
.stamp-row span:first-child { color: #8fa4d9; }
.stamp-row .v { font-family: var(--mono); color: var(--mint); word-break: break-all; }
.stamp-row .v.dim { color: #c8d4ff; }
.merkle { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.merkle i { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; position: relative; }
.merkle i::after { content: ""; position: absolute; inset: 0; width: var(--p, 0%); background: linear-gradient(90deg, #3b63f0, #5fe0a8); transition: width .5s ease; }

/* Auth panel on landing */
.auth-card { padding: 0; overflow: hidden; }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button, .tabs a { flex: 1; padding: 14px; background: none; border: 0; font: 600 .95rem var(--font); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; text-align: center; }
.tabs .on { color: var(--text); border-bottom-color: var(--royal); }
.tab-body { padding: 22px; }
.tab-pane[hidden] { display: none; }

/* ------------------------------------------------------------- process steps (true sequence) */
.steps { counter-reset: s; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.step { counter-increment: s; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); position: relative; }
.step::before { content: counter(s); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--grad); color: #fff; font: 700 .85rem var(--display); margin-bottom: 10px; }
.step h4 { margin-bottom: 4px; }
.step p { font-size: .88rem; color: var(--text-2); margin: 0; }
.step.decision { border-style: dashed; border-color: var(--warn); }

.does { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.does > div { padding: 24px; }
.does > div + div { border-left: 1px solid var(--line); background: var(--surface-2); }
.does ul { list-style: none; padding: 0; margin: 0; }
.does li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: .95rem; }
.does li:last-child { border: 0; }
@media (max-width: 700px) { .does { grid-template-columns: 1fr; } .does > div + div { border-left: 0; border-top: 1px solid var(--line); } }

.price { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; }
.price .amount { font: 700 clamp(2.6rem, 6vw, 4.2rem)/1 var(--display); letter-spacing: -.04em; }
.price .amount sup { font-size: .4em; vertical-align: top; margin-right: 4px; color: var(--muted); }
@media (max-width: 700px) { .price { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------- score gauge */
.gauge { --v: 0; --c: var(--ok); width: 150px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--v) * 1%), var(--bg-2) 0); position: relative; flex: none; }
.gauge::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--surface); }
.gauge b { position: relative; font: 700 2.4rem/1 var(--display); }
.gauge small { position: relative; display: block; text-align: center; color: var(--muted); font-size: .72rem; margin-top: 2px; }
.gauge.low { --c: var(--bad); } .gauge.mid { --c: var(--warn); } .gauge.high { --c: var(--ok); }
.gauge-sm { width: 64px; } .gauge-sm::before { inset: 6px; } .gauge-sm b { font-size: 1.1rem; }

/* ------------------------------------------------------------- timeline (pipeline status) */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 18px 34px; }
.timeline li::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .node { position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--surface); display: grid; place-items: center; }
.timeline li.done .node { background: var(--ok); border-color: var(--ok); color: #fff; }
.timeline li.active .node { border-color: var(--royal); box-shadow: 0 0 0 5px rgba(35,72,214,.18); animation: pulse 1.4s ease-in-out infinite; }
.timeline li.fail .node { background: var(--bad); border-color: var(--bad); color: #fff; }
.timeline li.done::before { background: var(--ok); }
.timeline .t { font-weight: 600; font-size: .94rem; }
.timeline .d { font-size: .82rem; color: var(--muted); }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(35,72,214,.05); } }

/* ------------------------------------------------------------- wizard */
.wizard-steps { display: flex; gap: 6px; margin-bottom: 22px; flex-wrap: wrap; }
.wizard-steps span { flex: 1; min-width: 110px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: .82rem; color: var(--muted); font-weight: 600; }
.wizard-steps span.on { border-color: var(--royal); color: var(--text); box-shadow: inset 0 -3px 0 var(--royal); }
.wizard-steps span.done { color: var(--ok); }
.wpane[hidden] { display: none; }

/* ------------------------------------------------------------- app shell (dashboard/admin) */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: calc(100vh - 74px); }
.side { border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); padding: 18px 12px; position: sticky; top: 74px; height: calc(100vh - 74px); overflow-y: auto; }
.side a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; font-size: .93rem; }
.side a:hover { background: var(--surface); text-decoration: none; color: var(--text); }
.side a.active { background: var(--info-bg); color: var(--accent); }
.side .grp { font-size: .76rem; color: var(--muted); padding: 16px 12px 6px; font-weight: 600; }
.side .count { margin-left: auto; background: var(--warn-bg); color: var(--warn); border-radius: 999px; padding: 0 8px; font-size: .74rem; font-weight: 700; }
.main { padding: clamp(18px, 3vw, 36px); min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(1.5rem, 2.4vw, 2rem); margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
@media (max-width: 900px) { .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; display: flex; overflow-x: auto; gap: 4px; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); } .side .grp { display: none; } .side a { white-space: nowrap; } }

.kpi { padding: 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.kpi .n { font: 700 1.9rem/1.1 var(--display); letter-spacing: -.02em; }
.kpi .l { color: var(--muted); font-size: .85rem; }
.kpi.accent { background: var(--grad); color: #fff; border: 0; }
.kpi.accent .l { color: rgba(255,255,255,.8); }

.sub-card { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 16px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.sub-card:hover { border-color: var(--line-2); text-decoration: none; box-shadow: var(--shadow); }
.sub-card .meta { font-size: .82rem; color: var(--muted); }
@media (max-width: 600px) { .sub-card { grid-template-columns: auto 1fr; } .sub-card > :last-child { grid-column: 1 / -1; } }

.empty { text-align: center; padding: 48px 20px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); color: var(--text-2); }
.empty .ic { color: var(--accent); margin-bottom: 8px; }

/* ------------------------------------------------------------- certificate view */
.cert { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(20px, 3vw, 36px); box-shadow: var(--shadow-lg); }
.cert-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 18px; }
.cert-id { font: 600 1.3rem var(--mono); letter-spacing: .02em; }
.cert-qr svg, .cert-qr img { width: 112px; height: 112px; background: #fff; padding: 6px; border-radius: 8px; }
.cert-qr svg path { fill: #0c1838; }
.match { padding: 14px 0; border-bottom: 1px solid var(--line); }
.match:last-child { border: 0; }
.bar { height: 6px; border-radius: 3px; background: var(--bg-2); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--grad); }
.inid { display: grid; grid-template-columns: 52px 1fr; gap: 6px 10px; font-size: .92rem; }
.inid .n { font-family: var(--mono); color: var(--muted); }
.side-by-side { display: grid; grid-template-columns: 1.2fr .8fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .side-by-side { grid-template-columns: 1fr; } }
.manuscript { white-space: pre-wrap; font-size: .95rem; line-height: 1.7; max-height: 70vh; overflow: auto; }
.legal { font-size: .95rem; }
.legal h1 { font-size: 2rem; } .legal h2 { font-size: 1.35rem; margin-top: 1.8em; } .legal h3 { font-size: 1.08rem; margin-top: 1.4em; }
.legal table { font-size: .84rem; margin: 1em 0; border: 1px solid var(--line); }
.legal ul, .legal ol { padding-left: 1.3em; }

/* ------------------------------------------------------------- toast & misc */
.toast-host { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: grid; gap: 8px; }
.toast { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--royal); border-radius: 10px; padding: 12px 16px; box-shadow: var(--shadow-lg); font-size: .92rem; max-width: 360px; animation: toastIn .25s ease; }
.toast.ok { border-left-color: var(--ok); } .toast.error { border-left-color: var(--bad); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
.copy { cursor: pointer; border: 0; background: none; color: var(--muted); padding: 2px; vertical-align: middle; }
.copy:hover { color: var(--accent); }
.pager { display: flex; gap: 6px; margin-top: 16px; }
.pager a, .pager span { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: .86rem; }
.pager .on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
details.box { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 0 16px; }
details.box summary { cursor: pointer; padding: 14px 0; font-weight: 600; list-style: none; }
details.box summary::after { content: "+"; float: right; color: var(--muted); }
details.box[open] summary::after { content: "–"; }
details.box[open] { padding-bottom: 14px; }
pre.json { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; overflow: auto; font: .78rem/1.5 var(--mono); max-height: 420px; }

/* ------------------------------------------------------------- footer */
.footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 40px; padding: 40px 0 28px; font-size: .9rem; }
.footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; }
.footer h4 { font-size: .9rem; margin-bottom: 10px; }
.footer a { display: block; color: var(--text-2); padding: 3px 0; }
.footer .legalline { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
@media (max-width: 800px) { .footer .cols { grid-template-columns: 1fr 1fr; } }

/* Install wizard */
.install-shell { min-height: 100vh; display: grid; place-items: start center; padding: 40px 16px; }
.install-card { width: min(860px, 100%); }
.req { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; font-size: .9rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .topbar, .footer, .side, .no-print { display: none !important; }
  body { background: #fff; }
}

/* ------------------------------------------------------------- Asrix brand */
.brand-mark { border-radius: 8px; }
.brand-tag { white-space: nowrap; letter-spacing: .01em; }
.brand-tag .tg-c, .tagline .tg-c { color: var(--brand-red); font-weight: 700; }
.brand-tag .tg-v, .tagline .tg-v { color: var(--text); font-weight: 700; }
@media (max-width: 1180px) { .brand-tag { display: none !important; } }
.wordmark { display: inline-block; line-height: 0; }
.wordmark img { height: 40px; width: auto; }
.wm-on-light { display: none; }
:root[data-theme="light"] .wm-on-light { display: inline; }
:root[data-theme="light"] .wm-on-dark { display: none; }
.tagline { font: 500 .86rem/1.4 var(--display); color: var(--text-2); margin: 12px 0 0; letter-spacing: .01em; }
.company { font-style: normal; display: grid; grid-template-columns: 2fr 1fr 1.2fr; gap: 20px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .84rem; color: var(--text-2); line-height: 1.6; }
.company a { display: inline; padding: 0; }
@media (max-width: 800px) { .company { grid-template-columns: 1fr; } }
.hero-tagline { font: 600 clamp(.9rem, 1.2vw, 1rem)/1.3 var(--display); color: var(--text-2); margin: 0 0 18px; display: flex; align-items: center; gap: 10px; }
.hero-tagline img { width: 26px; height: 26px; border-radius: 6px; }

/* Header lockup: asrix. wordmark + product + standard tagline */
.brand-lockup { display: inline-flex; flex-direction: column; gap: 4px; color: var(--text); text-decoration: none !important; flex: none; }
.lockup-top { display: inline-flex; align-items: flex-end; gap: 10px; line-height: 1; }
.lockup-top img { height: 28px; width: auto; display: block; }
.lockup-product { font: 600 1.02rem/1 var(--display); color: var(--text); padding-left: 10px; border-left: 2px solid var(--line-2); margin-bottom: 2px; letter-spacing: -.01em; }
.lockup-tag { font: 500 .68rem/1.2 var(--display); color: var(--text-2); white-space: nowrap; letter-spacing: .015em; }
.lockup-tag .tg-c, .tagline .tg-c { color: var(--brand-red); font-weight: 700; }
@media (max-width: 420px) { .lockup-tag { font-size: .58rem; } .lockup-top img { height: 24px; } }

.lockup-top img.wm-on-light { display: none; }
:root[data-theme="light"] .lockup-top img.wm-on-light { display: block; }
:root[data-theme="light"] .lockup-top img.wm-on-dark { display: none; }
.nav .m-only { display: none; }
@media (max-width: 980px) { .nav .m-only { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 10px; margin-top: 6px; border-top: 1px solid var(--line); } .nav .m-only a { padding: 6px 12px; } }
@media (max-width: 600px) { .top-actions > :not(.nav-toggle) { display: none !important; } .topbar .wrap { gap: 10px; } }
