/* ==========================================================================
   Revo design system
   Pretendard · light/dark · mobile-first responsive
   ========================================================================== */

@font-face {
  font-family: "Pretendard Variable";
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
  src: url("/static/fonts/PretendardVariable.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Pretendard JP Variable";
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
  src: url("/static/fonts/PretendardJPVariable.woff2") format("woff2-variations");
}

/* --------------------------------------------------------------- tokens */

:root {
  --font-sans: "Pretendard Variable", "Pretendard JP Variable", Pretendard,
    -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto,
    "Helvetica Neue", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --font-mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --brand-1: #4f46e5;
  --brand-2: #7c3aed;
  --brand-3: #06b6d4;
  --brand-grad: linear-gradient(120deg, #4f46e5 0%, #7c3aed 45%, #06b6d4 100%);
  --brand-grad-soft: linear-gradient(120deg, rgba(79, 70, 229, .16), rgba(6, 182, 212, .16));

  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px; --sp-20: 80px;

  --header-h: 64px;
  --sidebar-w: 268px;
  --container: 1280px;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --dur: .28s;
}

/* Light theme (default) */
:root,
:root[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-elev: #ffffff;
  --bg-soft: #f0f2f8;
  --bg-inset: #eaedf5;
  --surface: rgba(255, 255, 255, .86);
  --surface-2: rgba(255, 255, 255, .68);
  --border: rgba(15, 23, 42, .09);
  --border-strong: rgba(15, 23, 42, .16);
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #7c8698;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow: 0 4px 16px rgba(15, 23, 42, .07), 0 1px 3px rgba(15, 23, 42, .05);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .12), 0 4px 12px rgba(15, 23, 42, .06);
  --glow: 0 10px 40px rgba(79, 70, 229, .18);
  --aurora-1: rgba(99, 102, 241, .22);
  --aurora-2: rgba(6, 182, 212, .18);
  --aurora-3: rgba(168, 85, 247, .16);
  --track: rgba(15, 23, 42, .08);
  --scrim: rgba(15, 23, 42, .45);
  --code-bg: #0f172a;
  --code-fg: #e2e8f0;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #070a14;
  --bg-elev: #0e1322;
  --bg-soft: #131a2c;
  --bg-inset: #0a0f1c;
  --surface: rgba(18, 24, 40, .82);
  --surface-2: rgba(24, 31, 50, .6);
  --border: rgba(148, 163, 184, .14);
  --border-strong: rgba(148, 163, 184, .26);
  --text: #eef2ff;
  --text-2: #a8b3cf;
  --text-3: #6f7c99;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow: 0 8px 28px rgba(0, 0, 0, .45);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, .6);
  --glow: 0 12px 50px rgba(99, 102, 241, .35);
  --aurora-1: rgba(99, 102, 241, .3);
  --aurora-2: rgba(6, 182, 212, .22);
  --aurora-3: rgba(168, 85, 247, .24);
  --track: rgba(148, 163, 184, .16);
  --scrim: rgba(2, 6, 16, .7);
  --code-bg: #060a14;
  --code-fg: #cbd5e1;
  color-scheme: dark;
}

/* ---------------------------------------------------------------- reset */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "tnum" 0;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}

img, video, canvas { max-width: 100%; height: auto; display: block; }

/* Icons: default to a text-relative size so viewBox-only SVGs never expand to
   fill their container. Any explicit `.container svg { width: … }` rule below
   wins by specificity, so purpose-built icons keep their intended size. */
svg {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  display: inline-block;
  vertical-align: -0.18em;
}
.badge svg, .chip svg, .pill svg, .tiny svg { width: 1em; height: 1em; vertical-align: -0.14em; }
.label svg { width: 1.05em; height: 1.05em; }
/* icons inside flex rows don't need baseline shift */
.row svg, .btn svg, .side-link svg, .dd-menu svg, .stat-icon svg,
.si svg, .mi svg, .tl-dot svg, .tick svg, .icon-btn svg { vertical-align: middle; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.25; letter-spacing: -.02em; font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--sp-6) 0; }

::selection { background: rgba(124, 58, 237, .28); }

:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
  border-radius: 6px;
}

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

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong); border-radius: 99px;
  border: 3px solid transparent; background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: content-box; }

/* ------------------------------------------------------------- utilities */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 40px);
}
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.wrap { flex-wrap: wrap; }
.gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); } .gap-4 { gap: var(--sp-4); }
.gap-5 { gap: var(--sp-5); } .gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }
.between { justify-content: space-between; }
.center { justify-content: center; }
.end { justify-content: flex-end; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.grow { flex: 1 1 auto; min-width: 0; }
.mt-2 { margin-top: var(--sp-2); } .mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); } .mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mb-2 { margin-bottom: var(--sp-2); } .mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.tiny { font-size: 12px; }
.small { font-size: 13px; }
.bold { font-weight: 700; }
.mono { font-family: var(--font-mono); font-variant-ligatures: none; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tnum { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.gradient-text {
  background: var(--brand-grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.full { width: 100%; }

/* ---------------------------------------------------------------- aurora */

.aurora {
  position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none;
  background: var(--bg);
}
.aurora::before,
.aurora::after {
  content: ""; position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: .9;
}
.aurora::before {
  width: 70vmax; height: 70vmax; top: -28vmax; left: -14vmax;
  background: radial-gradient(circle at 30% 30%, var(--aurora-1), transparent 62%);
  animation: drift1 26s ease-in-out infinite alternate;
}
.aurora::after {
  width: 62vmax; height: 62vmax; top: 8vmax; right: -20vmax;
  background: radial-gradient(circle at 70% 40%, var(--aurora-2), transparent 62%);
  animation: drift2 32s ease-in-out infinite alternate;
}
.aurora i {
  position: absolute; width: 52vmax; height: 52vmax; left: 34%; top: 44vmax;
  border-radius: 50%; filter: blur(100px);
  background: radial-gradient(circle, var(--aurora-3), transparent 60%);
  animation: drift3 40s ease-in-out infinite alternate;
}
.aurora .grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 20%, transparent 78%);
  opacity: .55;
}
@keyframes drift1 { to { transform: translate3d(8vmax, 6vmax, 0) scale(1.12); } }
@keyframes drift2 { to { transform: translate3d(-10vmax, 4vmax, 0) scale(1.08); } }
@keyframes drift3 { to { transform: translate3d(6vmax, -8vmax, 0) scale(1.15); } }

/* --------------------------------------------------------------- buttons */

.btn {
  --btn-bg: var(--bg-elev);
  --btn-fg: var(--text);
  --btn-border: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2);
  padding: 10px 18px;
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 14px; font-weight: 600; letter-spacing: -.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              opacity var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
  text-align: center;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0) scale(.985); }
.btn[disabled], .btn.is-loading { opacity: .55; pointer-events: none; }

.btn-primary {
  --btn-border: transparent;
  background: var(--brand-grad);
  background-size: 160% 160%;
  color: #fff;
  box-shadow: var(--glow);
}
.btn-primary:hover { background-position: 100% 0; box-shadow: 0 14px 44px rgba(99, 102, 241, .42); }

.btn-ghost { --btn-bg: transparent; --btn-border: var(--border-strong); }
.btn-ghost:hover { background: var(--bg-soft); }

.btn-soft { --btn-bg: var(--bg-soft); --btn-border: transparent; }
.btn-soft:hover { background: var(--bg-inset); }

.btn-danger { --btn-bg: transparent; --btn-border: rgba(239, 68, 68, .4); --btn-fg: var(--danger); }
.btn-danger:hover { background: rgba(239, 68, 68, .1); }

.btn-ok { --btn-bg: var(--ok); --btn-border: transparent; --btn-fg: #fff; }
.btn-ok:hover { filter: brightness(1.07); }

.btn-sm { padding: 6px 13px; min-height: 34px; font-size: 13px; }
.btn-xs { padding: 4px 10px; min-height: 28px; font-size: 12px; border-radius: 999px; }
.btn-lg { padding: 14px 28px; min-height: 52px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { padding: 0; width: 40px; height: 40px; min-height: 40px; border-radius: 12px; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-sm svg, .btn-xs svg { width: 15px; height: 15px; }

/* --------------------------------------------------------------- surfaces */

.card {
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: clamp(18px, 2.4vw, 26px);
  position: relative;
  overflow: hidden;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}
/* whisper-thin highlight along the top edge for depth (light + dark) */
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent);
  opacity: .6; pointer-events: none;
}
[data-theme="dark"] .card::before {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .14), transparent);
}
.card-hover { cursor: default; }
.card-hover:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg), 0 18px 44px rgba(99, 102, 241, .14);
  transform: translateY(-4px);
}
.card-flush { padding: 0; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-4);
}
.card-title { font-size: 15px; font-weight: 700; letter-spacing: -.015em; }
.card-sub { font-size: 12.5px; color: var(--text-3); }
.card-pad { padding: clamp(16px, 2.4vw, 24px); }

.glass-line {
  position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

/* ----------------------------------------------------------------- badges */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.6;
  border: 1px solid transparent; white-space: nowrap;
  background: var(--bg-soft); color: var(--text-2);
}
.badge-ok      { background: rgba(16, 185, 129, .13); color: #059669; border-color: rgba(16,185,129,.25); }
.badge-warn    { background: rgba(245, 158, 11, .14); color: #d97706; border-color: rgba(245,158,11,.28); }
.badge-danger  { background: rgba(239, 68, 68, .13);  color: #dc2626; border-color: rgba(239,68,68,.26); }
.badge-info    { background: rgba(59, 130, 246, .13); color: #2563eb; border-color: rgba(59,130,246,.26); }
.badge-brand   { background: rgba(124, 58, 237, .13); color: #6d28d9; border-color: rgba(124,58,237,.26); }
[data-theme="dark"] .badge-ok     { color: #34d399; }
[data-theme="dark"] .badge-warn   { color: #fbbf24; }
[data-theme="dark"] .badge-danger { color: #f87171; }
[data-theme="dark"] .badge-info   { color: #60a5fa; }
[data-theme="dark"] .badge-brand  { color: #c4b5fd; }

.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.dot-pulse { position: relative; }
.dot-pulse::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  background: currentColor; opacity: .35; animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(.7); opacity: .5; }
  70% { transform: scale(2.1); opacity: 0; }
  100% { opacity: 0; }
}

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface-2);
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  backdrop-filter: blur(10px);
}
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 7px;
  background: var(--bg-soft); border: 1px solid var(--border);
  font-size: 11.5px; font-weight: 600; color: var(--text-2);
  font-family: var(--font-mono);
}

/* ------------------------------------------------------------------ forms */

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.label {
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  display: flex; align-items: center; gap: 6px;
}
.label .req { color: var(--danger); }
.hint { font-size: 11.5px; color: var(--text-3); }

.input, .select, .textarea {
  width: 100%;
  padding: 11px 14px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 14px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              background var(--dur) var(--ease);
  appearance: none;
  -webkit-appearance: none;
}
.textarea { min-height: 108px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, .14);
}
.input:disabled, .select:disabled { opacity: .6; cursor: not-allowed; }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c8698' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 17px;
  padding-right: 38px;
}
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-right: 44px; }
.input-affix {
  position: absolute; right: 12px; font-size: 12px; color: var(--text-3);
  font-weight: 600; pointer-events: none;
}
.input-icon-btn {
  position: absolute; right: 6px; width: 32px; height: 32px;
  display: grid; place-items: center; border: 0; background: transparent;
  color: var(--text-3); cursor: pointer; border-radius: 8px;
}
.input-icon-btn:hover { background: var(--bg-soft); color: var(--text); }

.form-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
}

.check {
  display: inline-flex; align-items: center; gap: 9px;
  cursor: pointer; font-size: 13.5px; user-select: none;
}
.check input { width: 18px; height: 18px; accent-color: var(--brand-1); cursor: pointer; }

.switch { position: relative; display: inline-block; width: 44px; height: 25px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; cursor: pointer; border-radius: 999px;
  background: var(--track); transition: background var(--dur) var(--ease);
}
.switch span::before {
  content: ""; position: absolute; height: 19px; width: 19px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease);
}
.switch input:checked + span { background: var(--brand-1); }
.switch input:checked + span::before { transform: translateX(19px); }

.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 999px; overflow-x: auto; max-width: 100%;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg a, .seg button {
  padding: 7px 15px; border-radius: 999px; border: 0; background: transparent;
  font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer;
  white-space: nowrap; transition: all var(--dur) var(--ease);
}
.seg a:hover, .seg button:hover { color: var(--text); }
.seg a.active, .seg button.active {
  background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------------------------ table */

.table-wrap {
  width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
}
table.tbl { min-width: 100%; font-size: 13.5px; }
table.tbl th {
  text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-3);
  padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.tbl td {
  padding: 13px 14px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.tbl tbody tr { transition: background var(--dur) var(--ease); }
table.tbl tbody tr:hover { background: var(--bg-soft); }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Mobile: turn rows into stacked cards */
@media (max-width: 720px) {
  table.tbl.responsive, table.tbl.responsive tbody, table.tbl.responsive tr,
  table.tbl.responsive td { display: block; width: 100%; }
  table.tbl.responsive thead { display: none; }
  table.tbl.responsive tr {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 6px 2px; margin-bottom: 10px; background: var(--bg-elev);
  }
  table.tbl.responsive td {
    border: 0; display: flex; justify-content: space-between; align-items: center;
    gap: 14px; padding: 8px 14px; text-align: right;
  }
  table.tbl.responsive td::before {
    content: attr(data-label);
    font-size: 11.5px; font-weight: 700; letter-spacing: .03em;
    text-transform: uppercase; color: var(--text-3);
    text-align: left; flex: none;
  }
  table.tbl.responsive td:empty { display: none; }
}

/* ------------------------------------------------------------------ stats */

.stat-grid {
  display: grid; gap: var(--sp-4);
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  position: relative; overflow: hidden;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
/* modern top accent that lights up on hover (replaces the old corner blob) */
.stat::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--brand-grad); opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.stat:hover::before { opacity: 1; }
.stat:hover {
  transform: translateY(-4px); border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}
.stat-label {
  font-size: 12px; font-weight: 600; color: var(--text-3);
  display: flex; align-items: center; gap: 7px; position: relative; z-index: 1;
}
.stat-value {
  font-size: clamp(24px, 3.6vw, 32px); font-weight: 800; letter-spacing: -.03em;
  margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.12;
  position: relative; z-index: 1;
}
.stat-value .unit { font-size: .5em; font-weight: 700; color: var(--text-3); margin-left: 3px; }
.stat-foot { font-size: 12px; color: var(--text-3); margin-top: 5px; position: relative; z-index: 1; }
.stat-icon {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: var(--brand-grad-soft); color: var(--brand-2); flex: none;
}
[data-theme="dark"] .stat-icon { color: #a5b4fc; }
.stat-icon svg { width: 18px; height: 18px; }

.trend { font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.trend-up { color: var(--ok); }
.trend-down { color: var(--danger); }

/* ------------------------------------------------------------------ meter */

.meter {
  height: 8px; border-radius: 999px; background: var(--track);
  overflow: hidden; position: relative; width: 100%;
}
.meter > i {
  display: block; height: 100%; border-radius: 999px;
  background: var(--brand-grad); background-size: 200% 100%;
  transition: width .7s var(--ease);
}
.meter.thin { height: 5px; }
.meter.tall { height: 12px; }
.meter.ok > i { background: linear-gradient(90deg, #10b981, #34d399); }
.meter.warn > i { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.meter.danger > i { background: linear-gradient(90deg, #ef4444, #f87171); }

.meter-row { display: grid; grid-template-columns: 74px 1fr 52px; gap: 12px; align-items: center; }
.meter-row .k { font-size: 12px; color: var(--text-2); font-weight: 600; }
.meter-row .v {
  font-size: 12.5px; font-weight: 700; text-align: right;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 420px) { .meter-row { grid-template-columns: 60px 1fr 46px; gap: 8px; } }

/* gauge ring */
.gauge { position: relative; width: 108px; height: 108px; flex: none; }
.gauge svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.gauge circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.gauge .bg { stroke: var(--track); }
.gauge .fg { stroke: url(#gaugeGrad); transition: stroke-dashoffset 1s var(--ease); }
.gauge .val {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
}
.gauge .val small { display: block; font-size: 10px; font-weight: 600; color: var(--text-3); }

/* ------------------------------------------------------------------ alert */

.alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--bg-soft);
  font-size: 13.5px; line-height: 1.6;
}
.alert svg { width: 19px; height: 19px; flex: none; margin-top: 1px; }
.alert-ok { background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.3); color: #047857; }
.alert-warn { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.3); color: #b45309; }
.alert-danger { background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.3); color: #b91c1c; }
.alert-info { background: rgba(59,130,246,.1); border-color: rgba(59,130,246,.3); color: #1d4ed8; }
[data-theme="dark"] .alert-ok { color: #6ee7b7; }
[data-theme="dark"] .alert-warn { color: #fcd34d; }
[data-theme="dark"] .alert-danger { color: #fca5a5; }
[data-theme="dark"] .alert-info { color: #93c5fd; }

.empty {
  text-align: center; padding: clamp(28px, 6vw, 56px) 20px; color: var(--text-3);
}
.empty svg { width: 42px; height: 42px; margin: 0 auto 14px; opacity: .45; }
.empty p { font-size: 13.5px; max-width: 42ch; margin-inline: auto; }

/* ------------------------------------------------------------------ modal */

.modal {
  position: fixed; inset: 0; z-index: 200;
  display: none; align-items: center; justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}
.modal.open { display: flex; }
.modal-scrim {
  position: absolute; inset: 0; background: var(--scrim);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fadeIn .2s var(--ease);
}
.modal-box {
  position: relative; width: 100%; max-width: 620px;
  max-height: min(88vh, 900px); overflow-y: auto;
  background: var(--bg-elev); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  animation: popIn .3s var(--ease);
  overscroll-behavior: contain;
}
.modal-box.wide { max-width: 860px; }
.modal-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 20px 22px 14px;
  background: var(--bg-elev); border-bottom: 1px solid var(--border);
}
.modal-body { padding: 20px 22px; }
.modal-foot {
  position: sticky; bottom: 0;
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
  padding: 14px 22px 20px; background: var(--bg-elev);
  border-top: 1px solid var(--border);
}
@media (max-width: 560px) {
  .modal { padding: 0; align-items: flex-end; }
  .modal-box { max-width: none; max-height: 92dvh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-foot .btn { flex: 1 1 140px; }
  @keyframes popIn { from { transform: translateY(28px); opacity: .6; } to { transform: none; opacity: 1; } }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { transform: translateY(14px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }

body.modal-open { overflow: hidden; }

/* ------------------------------------------------------------- public nav */

.topbar {
  position: sticky; top: 0; z-index: 90;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.topbar.scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }
.topbar .container { height: 100%; display: flex; align-items: center; gap: var(--sp-5); }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.03em; }
.brand-mark {
  width: 46px; height: 46px; flex: none;
  object-fit: contain; background: transparent;
  filter: drop-shadow(0 4px 14px rgba(99, 102, 241, .35));
  transition: transform .4s var(--ease), filter .4s var(--ease);
  transform-origin: 50% 50%;
}
.brand { cursor: pointer; }
.brand:hover .brand-mark {
  transform: scale(1.1) rotate(-8deg);
  filter: drop-shadow(0 8px 22px rgba(124, 58, 237, .6));
}
.brand-text { font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.brand-tag { font-size: 10.5px; color: var(--text-3); font-weight: 600; letter-spacing: .02em; }

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  padding: 9px 16px; border-radius: 11px; font-size: 15.5px; font-weight: 600;
  color: var(--text-2); transition: all var(--dur) var(--ease); position: relative;
}
.nav-links a:hover { color: var(--text); background: var(--bg-soft); }
.nav-links a::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: 4px; height: 2px;
  border-radius: 2px; background: var(--brand-grad); transform: scaleX(0);
  transform-origin: left; transition: transform var(--dur) var(--ease);
}
.nav-links a:hover::after { transform: scaleX(1); }

.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-2); transition: all var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--bg-soft); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.has-badge { position: relative; }
.icon-btn .nb {
  position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; display: grid; place-items: center;
  padding: 0 4px; border: 2px solid var(--bg);
}

/* dropdown */
.dd { position: relative; }
.dd-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 120;
  min-width: 200px; padding: 6px;
  background: var(--bg-elev); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: all .2s var(--ease);
  max-height: 70vh; overflow-y: auto;
}
.dd.open .dd-menu { opacity: 1; visibility: visible; transform: none; }
.dd-menu a, .dd-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border-radius: 9px; border: 0; background: transparent;
  font-size: 13.5px; font-weight: 500; color: var(--text-2);
  cursor: pointer; text-align: left; transition: all .15s var(--ease);
}
.dd-menu a:hover, .dd-menu button:hover { background: var(--bg-soft); color: var(--text); }
.dd-menu a.active, .dd-menu button.active { color: var(--brand-2); font-weight: 700; }
.dd-menu hr { margin: 6px 4px; }
.dd-menu .dd-head {
  padding: 8px 12px 4px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-3);
}
.dd-menu svg { width: 16px; height: 16px; flex: none; }

/* mobile menu */
.burger { display: none; }
.mobile-nav {
  position: fixed; inset: var(--header-h) 0 0; z-index: 88;
  background: var(--bg); padding: 20px clamp(16px, 5vw, 28px) 40px;
  overflow-y: auto; display: none; flex-direction: column; gap: 6px;
  animation: slideDown .25s var(--ease);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  padding: 14px 16px; border-radius: 12px; font-size: 15px; font-weight: 600;
  color: var(--text-2); border: 1px solid transparent;
}
.mobile-nav a:hover, .mobile-nav a:active { background: var(--bg-soft); color: var(--text); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

@media (max-width: 1040px) {
  .nav-links { display: none; }
  .burger { display: grid; }
}

/* ---------------------------------------------------------------- landing */

.hero { position: relative; padding: clamp(48px, 9vw, 108px) 0 clamp(40px, 7vw, 88px); }
.hero-grid {
  display: grid; gap: clamp(28px, 5vw, 56px);
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center;
}
@media (max-width: 1024px) { .hero-grid { grid-template-columns: 1fr; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 6px 14px 6px 8px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  backdrop-filter: blur(10px);
}
.eyebrow .tag {
  padding: 2px 9px; border-radius: 999px; background: var(--brand-grad);
  color: #fff; font-size: 11px; font-weight: 700;
}

.hero h1 {
  font-size: clamp(30px, 5.6vw, 56px);
  line-height: 1.14; letter-spacing: -.04em; font-weight: 800;
  margin: 20px 0 18px;
  overflow-wrap: break-word; word-break: keep-all;
}
.hero .lead {
  font-size: clamp(14.5px, 1.6vw, 17px); color: var(--text-2);
  max-width: 56ch; line-height: 1.75; word-break: keep-all;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
@media (max-width: 480px) { .hero-cta .btn { flex: 1 1 100%; } }

.hero-panel {
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: clamp(16px, 2.4vw, 24px);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  position: relative; overflow: hidden;
}
.hero-panel::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,.1), transparent 45%);
  pointer-events: none;
}

.section { padding: clamp(48px, 8vw, 96px) 0; position: relative; }
.section-head { max-width: 720px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head h2 {
  font-size: clamp(24px, 3.6vw, 38px); letter-spacing: -.035em;
  line-height: 1.2; margin: 12px 0 14px; word-break: keep-all;
}
.section-head p { color: var(--text-2); font-size: clamp(14px, 1.5vw, 16px); word-break: keep-all; }
.eyebrow-text {
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}

.grid-3 { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(272px, 1fr)); }
.grid-2 { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-4 { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.feature { position: relative; }
.feature .ico {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: var(--brand-grad); color: #fff; box-shadow: var(--glow); margin-bottom: 16px;
}
.feature .ico svg { width: 22px; height: 22px; }
.feature h3 { font-size: 17px; margin-bottom: 9px; letter-spacing: -.02em; }
.feature p { font-size: 13.5px; color: var(--text-2); line-height: 1.72; word-break: keep-all; }

.check-list { display: flex; flex-direction: column; gap: 11px; }
.check-list li { display: flex; gap: 11px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); }
.check-list .tick {
  width: 20px; height: 20px; border-radius: 50%; flex: none; margin-top: 1px;
  background: rgba(16, 185, 129, .15); color: var(--ok);
  display: grid; place-items: center;
}
.check-list .tick svg { width: 12px; height: 12px; }

.steps { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); counter-reset: step; }
.step { position: relative; }
.step .num {
  display: inline-block; margin-bottom: 12px;
  font-size: 13px; font-weight: 800; letter-spacing: .12em; line-height: 1.1;
  background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.step h4 { font-size: 15.5px; margin-bottom: 8px; }
.step p { font-size: 13px; color: var(--text-2); line-height: 1.7; word-break: keep-all; }

.cta-band {
  border-radius: var(--radius-xl);
  padding: clamp(28px, 5vw, 56px);
  background:
    radial-gradient(ellipse at 15% 20%, rgba(99,102,241,.28), transparent 55%),
    radial-gradient(ellipse at 85% 80%, rgba(6,182,212,.24), transparent 55%),
    var(--bg-elev);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: space-between;
  gap: clamp(20px, 4vw, 44px); flex-wrap: wrap;
}
.cta-band h2 { font-size: clamp(21px, 3vw, 30px); letter-spacing: -.03em; word-break: keep-all; }
.cta-band p { color: var(--text-2); margin-top: 10px; font-size: 14px; word-break: keep-all; }
@media (max-width: 640px) { .cta-band .btn { flex: 1 1 100%; } }

/* footer */
.site-footer { border-top: 1px solid var(--border); padding: clamp(32px, 5vw, 56px) 0 40px; margin-top: 40px; }
.footer-grid {
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  align-items: flex-start;
}
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { font-size: 13px; color: var(--text-3); }
.footer-links a:hover { color: var(--text); }

/* ----------------------------------------------------------- portal shell */

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

.sidebar {
  width: var(--sidebar-w); flex: none;
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  z-index: 70;
}
.sidebar-head {
  padding: 18px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 3px; }
.sidebar-foot { padding: 14px; border-top: 1px solid var(--border); }

.side-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px; border-radius: 12px;
  color: var(--text-2); transition: all var(--dur) var(--ease);
  position: relative; border: 1px solid transparent;
}
.side-link:hover { background: var(--bg-soft); color: var(--text); }
.side-link.active {
  background: var(--brand-grad-soft); color: var(--text);
  border-color: rgba(124, 58, 237, .25);
}
.side-link.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--brand-grad);
}
.side-link .si {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: grid; place-items: center; background: var(--bg-soft);
  transition: all var(--dur) var(--ease);
}
.side-link.active .si { background: var(--brand-grad); color: #fff; }
.side-link .si svg { width: 16px; height: 16px; }
.side-link .st { min-width: 0; }
.side-link .st b { display: block; font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; }
.side-link .st span { display: block; font-size: 11px; color: var(--text-3); }
.side-link .count {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
}

.side-group {
  padding: 14px 14px 6px; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: var(--text-3);
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.portal-header {
  position: sticky; top: 0; z-index: 60;
  height: var(--header-h); flex: none;
  display: flex; align-items: center; gap: 12px;
  padding: 0 clamp(14px, 2.5vw, 28px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
.portal-title { min-width: 0; }
.portal-title b { display: block; font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.portal-title span { display: block; font-size: 11.5px; color: var(--text-3); }

.portal-body {
  flex: 1; padding: clamp(16px, 2.6vw, 30px);
  padding-bottom: max(clamp(16px, 2.6vw, 30px), env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: clamp(16px, 2.2vw, 22px);
}

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(21px, 3vw, 28px); letter-spacing: -.03em; }
.page-head p { color: var(--text-2); font-size: 13.5px; margin-top: 6px; word-break: keep-all; }
.page-head .actions { display: flex; gap: 9px; flex-wrap: wrap; }

.sidebar-scrim {
  position: fixed; inset: 0; z-index: 69; background: var(--scrim);
  backdrop-filter: blur(3px); display: none;
}
.sidebar-scrim.open { display: block; animation: fadeIn .2s var(--ease); }

@media (max-width: 1024px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-102%); transition: transform .3s var(--ease);
    box-shadow: var(--shadow-lg);
    width: min(300px, 86vw);
  }
  .sidebar.open { transform: none; }
  .portal-body { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
}
.side-collapse { display: none; }
@media (min-width: 1025px) {
  .side-toggle { display: none !important; }
  .side-collapse { display: grid; }
  .sidebar { transition: width .26s var(--ease); }

  /* collapsed: icon rail only */
  .shell.collapsed .sidebar { width: 78px; }
  .shell.collapsed .sidebar-head { justify-content: center; padding: 18px 0; }
  .shell.collapsed .brand-text, .shell.collapsed .brand-tag { display: none; }
  .shell.collapsed .side-link { justify-content: center; padding: 11px 0; }
  .shell.collapsed .side-link .st { display: none; }
  .shell.collapsed .side-link.active::before { left: 0; }
  .shell.collapsed .side-link .count {
    position: absolute; top: 3px; right: 12px; margin: 0;
    min-width: 16px; height: 16px; font-size: 10px;
  }
  .shell.collapsed .side-group { height: 1px; padding: 0; margin: 10px 16px; overflow: hidden;
    background: var(--border); color: transparent; font-size: 0; }
  .shell.collapsed .sidebar-foot .st,
  .shell.collapsed .sidebar-foot .side-link > svg { display: none; }
  .shell.collapsed .sidebar-foot .side-link { justify-content: center; padding: 8px 0; }
  .shell.collapsed .sidebar-foot .dd-menu { width: 230px; left: 8px; }
}

/* mobile bottom tab bar for portals */
.tabbar {
  display: none;
  position: sticky; bottom: 0; z-index: 65;
  background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
  padding: 6px 6px max(6px, env(safe-area-inset-bottom));
}
.tabbar-inner { display: flex; }
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 4px; border-radius: 12px; color: var(--text-3);
  font-size: 10.5px; font-weight: 600;
}
.tabbar a.active { color: var(--brand-2); }
[data-theme="dark"] .tabbar a.active { color: #a5b4fc; }
.tabbar a svg { width: 20px; height: 20px; }
@media (max-width: 720px) { .tabbar { display: block; } }

/* ------------------------------------------------------------ node cards */

.node-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; position: relative; overflow: hidden;
  transition: all var(--dur) var(--ease);
}
.node-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.node-card .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.node-name { font-size: 14.5px; font-weight: 700; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.node-host { font-size: 11.5px; color: var(--text-3); font-family: var(--font-mono); }
.node-specs { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 14px; }
.node-metrics { display: flex; flex-direction: column; gap: 9px; }
.node-spark { height: 42px; margin-top: 12px; }

/* -------------------------------------------------------------- timeline */

.timeline { display: flex; flex-direction: column; gap: 2px; }
.tl-item { display: flex; gap: 13px; padding: 9px 0; position: relative; }
.tl-item:not(:last-child)::before {
  content: ""; position: absolute; left: 13px; top: 30px; bottom: -4px;
  width: 1px; background: var(--border);
}
.tl-dot {
  width: 27px; height: 27px; border-radius: 50%; flex: none; z-index: 1;
  display: grid; place-items: center; background: var(--bg-soft);
  border: 1px solid var(--border); color: var(--text-3);
}
.tl-dot svg { width: 13px; height: 13px; }
.tl-dot.success { background: rgba(16,185,129,.14); color: var(--ok); border-color: rgba(16,185,129,.3); }
.tl-dot.warning { background: rgba(245,158,11,.14); color: var(--warn); border-color: rgba(245,158,11,.3); }
.tl-dot.critical { background: rgba(239,68,68,.14); color: var(--danger); border-color: rgba(239,68,68,.3); }
.tl-body { min-width: 0; flex: 1; }
.tl-body b { font-size: 13px; font-weight: 600; display: block; }
.tl-body span { font-size: 11.5px; color: var(--text-3); }

/* ---------------------------------------------------------------- charts */

.chart-box { position: relative; width: 100%; }
.chart-box canvas { width: 100% !important; }
.chart-h-sm { height: 140px; }
.chart-h { height: 220px; }
.chart-h-lg { height: 300px; }
@media (max-width: 640px) { .chart-h-lg { height: 230px; } .chart-h { height: 190px; } }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 6px; }

/* ------------------------------------------------------------------ misc */

.kv { display: grid; grid-template-columns: minmax(90px, auto) 1fr; gap: 10px 18px; font-size: 13.5px; }
.kv dt { color: var(--text-3); font-size: 12.5px; }
.kv dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .kv { grid-template-columns: 1fr; gap: 3px 0; } .kv dd { margin-bottom: 10px; } }

.code {
  background: var(--code-bg); color: var(--code-fg);
  border-radius: var(--radius-sm); padding: 14px 16px;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.7;
  overflow-x: auto; white-space: pre; border: 1px solid var(--border-strong);
}
.copy-row { display: flex; gap: 8px; align-items: center; }

.toast-host {
  position: fixed; z-index: 300; left: 50%; transform: translateX(-50%);
  bottom: max(24px, env(safe-area-inset-bottom)); display: flex; flex-direction: column;
  gap: 10px; width: min(420px, calc(100vw - 32px)); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 16px; border-radius: var(--radius-sm);
  background: var(--bg-elev); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 500;
  animation: toastIn .3s var(--ease); pointer-events: auto;
}
.toast.out { animation: toastOut .25s var(--ease) forwards; }
.toast svg { width: 18px; height: 18px; flex: none; }
.toast.ok svg { color: var(--ok); }
.toast.err svg { color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(.97); } }

.skeleton {
  background: linear-gradient(90deg, var(--bg-soft) 25%, var(--bg-inset) 50%, var(--bg-soft) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

.avatar {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: var(--brand-grad); color: #fff; letter-spacing: -.02em;
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; border-radius: 9px; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; border-radius: 16px; }

.mode-card {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--dur) var(--ease); background: var(--bg-elev);
  position: relative;
}
.mode-card:hover { border-color: var(--brand-2); background: var(--bg-soft); }
.mode-card input { position: absolute; opacity: 0; pointer-events: none; }
.mode-card .mi {
  width: 36px; height: 36px; border-radius: 11px; flex: none; display: grid; place-items: center;
  background: var(--bg-soft); color: var(--text-2); transition: all var(--dur) var(--ease);
}
.mode-card .mi svg { width: 18px; height: 18px; }
.mode-card b { display: block; font-size: 13.5px; }
.mode-card span { display: block; font-size: 11.5px; color: var(--text-3); line-height: 1.55; }
.mode-card:has(input:checked) {
  border-color: var(--brand-2); background: var(--brand-grad-soft);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .12);
}
.mode-card:has(input:checked) .mi { background: var(--brand-grad); color: #fff; }

.progress-steps { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-3); flex-wrap: wrap; }
.progress-steps .ps { display: flex; align-items: center; gap: 7px; }
.progress-steps .ps .n {
  width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg-soft); font-size: 11px; border: 1px solid var(--border);
}
.progress-steps .ps.active { color: var(--text); }
.progress-steps .ps.active .n { background: var(--brand-grad); color: #fff; border-color: transparent; }

/* ---------------------------------------------------- global progress bar */
.revo-progress {
  position: fixed; inset: 0 auto auto 0; height: 3px; width: 0;
  z-index: 9999; pointer-events: none; border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, #4f46e5, #7c3aed, #06b6d4, #7c3aed, #4f46e5);
  background-size: 300% 100%;
  box-shadow: 0 0 10px rgba(124, 58, 237, .7), 0 0 20px rgba(6, 182, 212, .4);
  opacity: 0; transition: width .2s var(--ease), opacity .35s var(--ease);
  animation: progFlow 1.4s linear infinite;
}
.revo-progress.on { opacity: 1; }
.revo-progress::after {
  content: ""; position: absolute; right: 0; top: 0; height: 100%; width: 90px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .85));
  animation: progGlow 1s ease-in-out infinite;
}
@keyframes progFlow { to { background-position: 300% 0; } }
@keyframes progGlow { 0%, 100% { opacity: .3; } 50% { opacity: .9; } }

/* fancy loading button */
.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  border-radius: 50%; animation: spin .6s linear infinite;
}
.btn-ghost.is-loading::after, .btn-soft.is-loading::after { border-color: var(--border-strong); border-top-color: var(--brand-2); }
@keyframes spin { to { transform: rotate(360deg); } }

/* indeterminate bar for inline waits */
.bar-indeterminate { height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; position: relative; }
.bar-indeterminate::before {
  content: ""; position: absolute; inset: 0; width: 40%;
  background: var(--brand-grad); background-size: 200% 100%; border-radius: 999px;
  animation: barSlide 1.1s var(--ease) infinite, progFlow 1.4s linear infinite;
}
@keyframes barSlide { 0% { left: -40%; } 100% { left: 100%; } }

/* print */
@media print {
  .sidebar, .portal-header, .topbar, .tabbar, .btn, .aurora { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Splash / launch screen
   Shown on a cold start only (see the pre-paint script in base.html). The
   markup is always present so it can render before any JS runs; `data-splash`
   on <html> is what makes it visible, and revo.js clears it.
   ═══════════════════════════════════════════════════════════════════════════ */
.splash {
  position: fixed; inset: 0; z-index: 200;
  display: none; place-items: center;
  background: var(--bg);
  /* Cover the notch area too, so the launch screen looks native. */
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}
:root[data-splash="on"] .splash { display: grid; }
/* Belt and braces: if JS never runs, the splash fades itself out rather than
   permanently covering the page. */
:root[data-splash="on"] .splash { animation: splashFail 0s linear 4s forwards; }
@keyframes splashFail { to { opacity: 0; visibility: hidden; } }

:root[data-splash="on"] body { overflow: hidden; }
.splash.is-done {
  animation: splashOut .52s var(--ease) forwards;
  pointer-events: none;
}
@keyframes splashOut {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.04); visibility: hidden; }
}

.splash::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(46vmax 46vmax at 22% 18%, var(--aurora-1), transparent 62%),
    radial-gradient(40vmax 40vmax at 82% 82%, var(--aurora-3), transparent 60%);
  filter: blur(18px); opacity: .85;
  animation: splashGlow 3.4s var(--ease) infinite alternate;
}
@keyframes splashGlow {
  from { transform: scale(1) translateY(0); opacity: .6; }
  to   { transform: scale(1.18) translateY(-3%); opacity: .95; }
}

.splash-inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-4);
  padding: var(--sp-6);
}

.splash-mark { position: relative; display: grid; place-items: center; width: 120px; height: 120px; }
.splash-mark img {
  width: 72px; height: 72px; object-fit: contain;
  animation: markIn .9s var(--ease) both;
}
@keyframes markIn {
  0%   { opacity: 0; transform: scale(.6) rotate(-25deg); }
  60%  { opacity: 1; transform: scale(1.08) rotate(4deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

.splash-ring { position: absolute; inset: 0; width: 120px; height: 120px; transform: rotate(-90deg); }
.splash-ring circle { fill: none; stroke-width: 3; stroke-linecap: round; }
.splash-ring .ring-track { stroke: var(--border); opacity: .6; }
.splash-ring .ring-spin {
  stroke: var(--brand-2);
  stroke-dasharray: 90 240;
  animation: ringSpin 1.25s linear infinite;
}
@keyframes ringSpin { to { stroke-dashoffset: -330; } }

.splash-word { display: flex; gap: 1px; font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.splash-word span {
  background: var(--brand-grad); -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: letterIn .6s var(--ease) both;
  animation-delay: calc(.18s + var(--i) * .07s);
}
@keyframes letterIn {
  from { opacity: 0; transform: translateY(14px) scale(.9); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}

.splash-tag {
  font-size: 12.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-3);
  animation: fadeUp .6s var(--ease) .5s both;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.splash-bar {
  width: 168px; height: 3px; border-radius: 999px; overflow: hidden;
  background: var(--track); margin-top: var(--sp-2);
  animation: fadeUp .5s var(--ease) .62s both;
}
.splash-bar i {
  display: block; height: 100%; width: 40%; border-radius: 999px;
  background: var(--brand-grad); background-size: 200% 100%;
  animation: barSlide 1.05s var(--ease) infinite, progFlow 1.4s linear infinite;
}

/* A splash that animates is decoration; without motion, skip straight to the app. */
@media (prefers-reduced-motion: reduce) {
  :root[data-splash="on"] .splash { display: none; }
  :root[data-splash="on"] body { overflow: auto; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PWA install prompt + offline page
   ═══════════════════════════════════════════════════════════════════════════ */
.install-bar {
  position: fixed; z-index: 90;
  left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right));
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: none; gap: var(--sp-3); align-items: center;
  padding: var(--sp-3) var(--sp-4);
  background: color-mix(in srgb, var(--bg-elev) 94%, transparent);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: fadeUp .4s var(--ease) both;
}
.install-bar.show { display: flex; }
.install-bar img { width: 38px; height: 38px; border-radius: 10px; flex: none; }
.install-bar .ib-text { min-width: 0; flex: 1; }
.install-bar .ib-text b { display: block; font-size: 13.5px; }
.install-bar .ib-text span { font-size: 11.5px; color: var(--text-3); }
/* Keep the bar clear of the mobile tab bar. */
@media (max-width: 720px) {
  .install-bar { bottom: calc(66px + env(safe-area-inset-bottom)); }
}

.offline-wrap { min-height: 100dvh; display: grid; place-items: center; padding: var(--sp-6); }
.offline-card { text-align: center; max-width: 420px; display: flex; flex-direction: column; gap: var(--sp-3); align-items: center; }
.offline-icon {
  width: 68px; height: 68px; display: grid; place-items: center; border-radius: 20px;
  background: var(--brand-grad-soft); color: var(--brand-2); margin-bottom: var(--sp-2);
}
.offline-icon svg { width: 30px; height: 30px; }
.offline-card h1 { font-size: 22px; }
.offline-card p { color: var(--text-2); font-size: 14px; }

/* ═══════════════════════════════════════════════════════════════════════════
   SSH access panel
   ═══════════════════════════════════════════════════════════════════════════ */
.cmd-block {
  display: flex; align-items: center; gap: var(--sp-3);
  margin-top: var(--sp-3); padding: var(--sp-3) var(--sp-4);
  background: var(--code-bg); color: var(--code-fg);
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  cursor: pointer; transition: border-color var(--dur) var(--ease);
}
.cmd-block:hover, .cmd-block:focus-visible { border-color: var(--brand-2); }
.cmd-block code {
  font-family: var(--font-mono); font-size: 13px; flex: 1; min-width: 0;
  /* A long host+port must wrap rather than widen the card. */
  overflow-wrap: anywhere; white-space: pre-wrap;
}
.cmd-block .cmd-copy { flex: none; opacity: .7; display: grid; place-items: center; }
.cmd-block .cmd-copy svg { width: 16px; height: 16px; }

.access-kv dd { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.access-kv .secret { letter-spacing: .08em; }
.icon-btn.xs { width: 28px; height: 28px; flex: none; border-radius: 8px; }
.icon-btn.xs svg { width: 14px; height: 14px; }
.quota-tbl td, .quota-tbl th { white-space: nowrap; }
.badge.xs { padding: 0 5px; font-size: 9.5px; }

.cap-row { display: flex; flex-direction: column; gap: 5px; }
.field-err { color: var(--danger); font-weight: 600; }
.input.is-invalid, .select.is-invalid { border-color: var(--danger); }
.input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, .18); }

/* ═══════════════════════════════════════════════════════════════════════════
   Responsive corrections
   Two-column `.grid-2` layouts that pages override with explicit fr tracks lose
   `auto-fit`, so they never collapse on their own. Force one column on narrow
   viewports, and rein in the fixed-width cells the audit flagged.
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr) !important; }
}
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .stat-value { font-size: clamp(20px, 6vw, 26px); }
  /* Fixed 2-up grids in the hero panel and node wizard. */
  .hero-panel .grid, .mode-grid { grid-template-columns: minmax(0, 1fr) !important; }
}
@media (max-width: 420px) {
  .gauge { width: 88px; height: 88px; }
}

/* The 721–1024px band had no navigation but the hamburger: keep the tab bar
   until the sidebar becomes permanent. */
@media (max-width: 1024px) {
  .tabbar { display: block; }
  /* Reserve room so the sticky tab bar never covers the last row of content. */
  .portal-body { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
}

/* Long unbroken tokens (agent tokens, log paths) must not widen their card. */
.code { overflow-wrap: anywhere; }
.card { overflow-x: clip; }
dl.kv dd { min-width: 0; overflow-wrap: anywhere; }
.truncate { max-width: 100%; }

/* Tap targets: 44px is the accessibility floor on touch devices. */
@media (hover: none) and (pointer: coarse) {
  .btn, .icon-btn, .side-link, .tabbar a, .dd-menu a, .dd-menu button {
    min-height: 44px;
  }
  .btn-sm { min-height: 40px; }
  .icon-btn.xs { min-height: 34px; width: 34px; height: 34px; }
  /* iOS zooms the page when focusing a field below 16px. */
  .input, .select, .textarea { font-size: 16px; }
}

/* Honour the display-mode: in a standalone window there is no browser chrome,
   so the app owns the full safe area. */
@media all and (display-mode: standalone) {
  .install-bar { display: none !important; }
  .portal-header { padding-top: env(safe-area-inset-top); height: auto; min-height: var(--header-h); }
  .topbar { padding-top: env(safe-area-inset-top); }
}

/* Haptics are hardware; this only reflects the *visual* half of a tap so a
   press feels acknowledged on devices that cannot vibrate. */
@media (hover: none) and (pointer: coarse) {
  .btn:active, .icon-btn:active, .tabbar a:active, .side-link:active, .mode-card:active {
    transform: scale(.97);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Environment blueprint picker
   ═══════════════════════════════════════════════════════════════════════════ */
.env-grid {
  display: grid; gap: var(--sp-3);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.env-card {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease),
              transform var(--dur) var(--ease);
  position: relative;
}
.env-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.env-card input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
.env-card:has(input:checked), .env-card.is-on {
  border-color: var(--brand-2);
  background: var(--brand-grad-soft);
}
.env-card:has(input:focus-visible) { outline: 2px solid var(--brand-2); outline-offset: 2px; }

.env-card .ec-icon {
  flex: none; width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 11px; background: var(--bg-inset); color: var(--brand-2);
}
.env-card .ec-icon svg { width: 19px; height: 19px; }
.env-card .ec-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.env-card .ec-body b { font-size: 13.5px; }
.env-card .ec-body span { overflow-wrap: anywhere; }
.env-card .ec-check {
  flex: none; width: 20px; height: 20px; border-radius: 999px;
  display: grid; place-items: center;
  background: var(--brand-2); color: #fff; opacity: 0; transform: scale(.6);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.env-card .ec-check svg { width: 12px; height: 12px; }
.env-card:has(input:checked) .ec-check, .env-card.is-on .ec-check { opacity: 1; transform: scale(1); }

/* The allocation-page variant is a form with its own button, so it stacks. */
.env-card.as-form { flex-wrap: wrap; cursor: default; }
.env-card.as-form .btn { margin-left: auto; }

.env-run { border: 1px solid var(--border); border-radius: var(--radius-xs); padding: var(--sp-3); }
.env-log {
  margin-top: var(--sp-2); max-height: 260px; overflow: auto;
  font-size: 11.5px; white-space: pre-wrap; overflow-wrap: anywhere;
}
.dot-pulse {
  display: inline-block; width: 6px; height: 6px; border-radius: 999px;
  background: currentColor; margin-right: 5px;
  animation: dotPulse 1.1s var(--ease) infinite;
}
@keyframes dotPulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }

.svc-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2);
}
.svc-card .cmd-block { margin-top: var(--sp-2); }

/* ═══════════════════════════════════════════════════════════════════════════
   Landing: share-and-earn section
   ═══════════════════════════════════════════════════════════════════════════ */
.share-section { position: relative; overflow: hidden; }
.share-hero {
  display: grid; gap: var(--sp-6);
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: center;
  padding: var(--sp-8);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--brand-grad-soft);
}
.share-lead h3 {
  font-size: clamp(20px, 2.8vw, 30px); line-height: 1.25; margin: var(--sp-3) 0 var(--sp-3);
}
.share-lead p { color: var(--text-2); font-size: 14.5px; line-height: 1.7; }
.badge-brand {
  background: var(--brand-grad); color: #fff; border: 0;
  font-weight: 700; letter-spacing: .02em;
}
.share-stats { display: grid; gap: var(--sp-3); }
.share-stat {
  display: flex; align-items: baseline; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.share-stat b {
  font-size: clamp(24px, 3.4vw, 34px); font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: var(--brand-grad); -webkit-background-clip: text; background-clip: text;
  color: transparent; line-height: 1;
}
.share-stat span { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.block { display: block; }
.mt-6 { margin-top: var(--sp-6); }

@media (max-width: 900px) {
  .share-hero { grid-template-columns: minmax(0, 1fr); padding: var(--sp-5); }
  .share-stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Contribution form + Revo Points
   ═══════════════════════════════════════════════════════════════════════════ */
.probe-box {
  padding: var(--sp-4); border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm); background: var(--bg-inset);
}
.probe-result {
  margin-top: var(--sp-3); padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-xs); font-size: 12.5px;
  border: 1px solid var(--border); background: var(--bg-elev);
}
.probe-result.is-good { border-color: var(--ok); }
.probe-result.is-bad  { border-color: var(--danger); }
.probe-result dl.kv { margin: 0; }
.probe-result dt { font-size: 11px; }

.check-list { list-style: none; display: flex; flex-direction: column; gap: var(--sp-2); }
.check-list li { display: flex; gap: var(--sp-2); align-items: flex-start; font-size: 12.5px; color: var(--text-2); }
.check-list svg { width: 15px; height: 15px; flex: none; color: var(--ok); margin-top: 1px; }

.point-hero {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-6); flex-wrap: wrap;
  background: var(--brand-grad-soft);
}
.point-balance {
  font-size: clamp(34px, 6vw, 52px); font-weight: 800; line-height: 1;
  background: var(--brand-grad); -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.point-hero-stats { display: flex; gap: var(--sp-6); flex-wrap: wrap; }
.point-hero-stats > div { display: flex; flex-direction: column; gap: 2px; }
.point-hero-stats b { font-size: 19px; }
.point-hero-stats span { font-size: 11.5px; color: var(--text-3); }

.redeem-row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-xs);
  flex-wrap: wrap;
}
.redeem-row .qty { width: 68px; flex: none; }

.ledger { max-height: 560px; overflow-y: auto; }
.ledger-row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border);
}
.ledger-row:last-child { border-bottom: 0; }
.ledger-amount { font-weight: 700; font-size: 13px; min-width: 62px; text-align: right; }
.ledger-amount.is-plus  { color: var(--ok); }
.ledger-amount.is-minus { color: var(--danger); }

@media (max-width: 560px) {
  .point-hero { flex-direction: column; align-items: flex-start; }
  .point-hero-stats { gap: var(--sp-4); }
  .redeem-row .qty { width: 100%; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Revo Points: shop, rate card, ledger calculation
   ═══════════════════════════════════════════════════════════════════════════ */
.section-sub { font-size: 15px; font-weight: 700; }
.shop-cats { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.cat-chip { cursor: pointer; border: 1px solid var(--border); background: var(--surface); }
.cat-chip svg { width: 14px; height: 14px; }
.cat-chip.is-on {
  border-color: var(--brand-2); background: var(--brand-grad-soft); color: var(--brand-2);
}

.shop-grid {
  display: grid; gap: var(--sp-4);
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.shop-card {
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: var(--sp-4); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.shop-card:hover {
  border-color: var(--border-strong); transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.shop-thumb {
  height: 86px; display: grid; place-items: center; border-radius: var(--radius-xs);
  background: var(--brand-grad-soft); color: var(--brand-2);
}
.shop-thumb svg { width: 34px; height: 34px; }
.shop-card.is-credit .shop-thumb { background: var(--bg-inset); }
.shop-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.shop-body b { font-size: 13.5px; line-height: 1.35; }
.shop-price { display: flex; align-items: baseline; gap: 5px; margin-top: var(--sp-2); flex-wrap: wrap; }
.shop-price b { font-size: 19px; color: var(--brand-2); }
.shop-price > span:first-of-type { font-size: 12px; font-weight: 700; color: var(--brand-2); }
.shop-foot { display: flex; gap: var(--sp-2); align-items: center; }
.shop-foot .qty { width: 62px; flex: none; }
.shop-foot .btn { flex: 1; }

.rate-grid { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.rate-card {
  display: flex; gap: var(--sp-3); padding: var(--sp-4);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.rate-value { display: flex; align-items: baseline; gap: 4px; }
.rate-value b { font-size: 22px; color: var(--brand-2); }
.rate-value span { font-size: 11px; color: var(--text-3); }

.formula-box {
  display: flex; flex-direction: column; gap: 5px;
  padding: var(--sp-4); border-radius: var(--radius-xs);
  background: var(--code-bg); color: var(--code-fg);
}
.formula-box code { font-family: var(--font-mono); font-size: 12.5px; overflow-wrap: anywhere; }

.rule-list { padding-left: 20px; display: flex; flex-direction: column; gap: var(--sp-2); }
.rule-list li { font-size: 12.5px; color: var(--text-2); line-height: 1.6; }

details.calc { margin-top: var(--sp-2); }
details.calc summary { cursor: pointer; color: var(--brand-2); font-weight: 600; }
.calc-tbl { width: 100%; margin-top: var(--sp-2); border-collapse: collapse; }
.calc-tbl td { padding: 4px 6px; font-size: 11.5px; border-bottom: 1px solid var(--border); }
.calc-tbl td:first-child { color: var(--text-3); white-space: nowrap; }
.calc-tbl .calc-sum td { font-weight: 600; }
.calc-tbl .calc-total td { font-weight: 800; color: var(--brand-2); border-bottom: 0; }

@media (max-width: 480px) {
  .shop-grid { grid-template-columns: minmax(0, 1fr); }
  .shop-foot { flex-wrap: wrap; }
  .shop-foot .qty { width: 100%; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Revo Points mall — product cards with illustrations
   ═══════════════════════════════════════════════════════════════════════════ */
.mall-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 42%);
  gap: var(--sp-6); align-items: center;
  padding: var(--sp-6); border-radius: var(--radius-lg);
  background: var(--brand-grad-soft); border: 1px solid var(--border);
}
.mall-hero-copy h2 { font-size: clamp(20px, 3vw, 30px); margin: var(--sp-3) 0 var(--sp-2); }
.mall-hero-price { display: flex; align-items: baseline; gap: 6px; margin-top: var(--sp-3); }
.mall-hero-price b { font-size: 32px; color: var(--brand-2); }
.mall-hero-price > span:first-of-type { font-size: 15px; font-weight: 700; color: var(--brand-2); }
.mall-hero-img { width: 100%; height: auto; border-radius: var(--radius-sm); display: block; }

.mall-bar { display: flex; gap: var(--sp-4); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.mall-filter { display: flex; align-items: center; gap: var(--sp-2); cursor: pointer; white-space: nowrap; }

.mall-grid {
  display: grid; gap: var(--sp-4);
  grid-template-columns: repeat(auto-fill, minmax(224px, 1fr));
}
.mall-card {
  display: flex; flex-direction: column; gap: var(--sp-2);
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
.mall-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}
.mall-thumb {
  position: relative;
  /* Matches the SVG ground so the illustration blends into the card instead of
     sitting on a visible panel of its own. */
  background: #f7f5ff;
}
[data-theme="dark"] .mall-thumb { background: #ece9fb; }
.mall-thumb img { width: 100%; height: auto; display: block; }
.mall-badge {
  position: absolute; top: 8px; right: 8px;
  padding: 3px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  border: 1px solid var(--border); color: var(--text-2);
  backdrop-filter: blur(8px);
}
.mall-badge.is-low { color: #fff; background: var(--danger); border-color: transparent; }
.mall-body { display: flex; flex-direction: column; gap: 3px; padding: 0 var(--sp-4); min-width: 0; flex: 1; }
.mall-body b { font-size: 13.5px; line-height: 1.35; }
.mall-price { display: flex; align-items: baseline; gap: 5px; padding: 0 var(--sp-4); flex-wrap: wrap; }
.mall-price b { font-size: 20px; color: var(--brand-2); }
.mall-price > span:first-of-type { font-size: 12px; font-weight: 700; color: var(--brand-2); }
.mall-foot { display: flex; gap: var(--sp-2); align-items: center; padding: var(--sp-3) var(--sp-4) var(--sp-4); }
.mall-foot .qty { width: 60px; flex: none; }
.mall-foot .btn { flex: 1; }

.shop-admin-thumb { width: 56px; height: 35px; border-radius: 6px; display: block; }
.img-preview { display: flex; gap: 6px; flex-wrap: wrap; }
.img-preview img { width: 52px; height: 33px; border-radius: 5px; border: 1px solid var(--border); }

@media (max-width: 860px) {
  .mall-hero { grid-template-columns: minmax(0, 1fr); }
  .mall-hero-img { max-width: 320px; margin: 0 auto; }
}
@media (max-width: 480px) {
  .mall-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--sp-3); }
  .mall-body b { font-size: 12.5px; }
  .mall-price b { font-size: 17px; }
  .mall-foot { flex-wrap: wrap; }
  .mall-foot .qty { width: 100%; }
}
.mall-asof { padding: 0 var(--sp-4); }

/* ═══════════════════════════════════════════════════════════════════════════
   hidden must actually hide
   A class that sets `display` (e.g. .mall-card{display:flex},
   .form-grid{display:grid}) has the same specificity as the UA's [hidden] rule
   but is declared later, so it silently wins and the element stays visible.
   Every JS toggle in Revo uses the `hidden` attribute, so make it authoritative.
   ═══════════════════════════════════════════════════════════════════════════ */
[hidden] { display: none !important; }

/* 비밀번호 직접 설정 (접기) */
.pw-set { border: 1px solid var(--border); border-radius: var(--radius-xs); padding: var(--sp-3) var(--sp-4); }
.pw-set > summary {
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--brand-2);
  display: flex; align-items: center; gap: var(--sp-2); list-style: none;
}
.pw-set > summary::-webkit-details-marker { display: none; }
.pw-set > summary svg { width: 15px; height: 15px; }
.pw-set[open] > summary { margin-bottom: var(--sp-2); }
