/* ============================================================================
   NEXT REALM OS — NROS DESIGN SYSTEM
   Marble (PAPER) primary ground · Obsidian (VOID) cinematic ground
   Tokens, fonts, breakpoints extracted verbatim from nextrealm.link production.
   One accent: champagne gold #C79A4B / #E4C381 / #9A7330.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500;1,600&family=Inter:wght@400;500;600;700&family=Inter+Tight:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ----------------------------------------------------------------------------
   1 · TOKENS — THE TWO GROUNDS
   ---------------------------------------------------------------------------- */
:root {
  /* PAPER / MARBLE (default) */
  --color-bg: #FAFAF7;
  --color-bg-2: #F5F3EE;
  --color-surface: #FFFFFF;
  --color-surface-2: #F4F2EC;
  --color-surface-3: #ECEAE3;
  --color-elev: #FFFFFF;
  --color-text: #0F0F10;
  --color-text-2: #57575A;
  --color-text-3: #8E8E92;
  --color-text-4: #BABAB8;

  --color-gold: #C79A4B;
  --color-gold-2: #E4C381;
  --color-gold-3: #9A7330;
  --color-gold-bg: #FBF6EA;

  --color-live: #4FA56D;
  --color-mute: #8E8E92;
  --color-warn: #B86C42;
  --color-info: #5E7C8C;

  --color-border: #ECECE8;
  --color-border-2: #DAD8D2;
  --color-border-3: #BFBCB4;

  /* gold hairline used for metallic dividers on paper */
  --metal-hairline: linear-gradient(90deg, transparent, rgba(199,154,75,.0) 4%, rgba(199,154,75,.45) 50%, rgba(199,154,75,.0) 96%, transparent);

  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 14px;
  --radius-xl: 22px;
  --radius-pill: 999px;

  --font-display: 'Cormorant Garamond', ui-serif, Georgia, serif;
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-ui: 'Inter Tight', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease: cubic-bezier(.2,.8,.2,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --ease-cine: cubic-bezier(.28,.11,.32,1);
  --ease-smooth: cubic-bezier(.22,1,.36,1);

  --shadow-elev: 0 1px 2px rgba(15,15,16,.025), 0 8px 28px -16px rgba(15,15,16,.08);
  --shadow-float: 0 2px 6px rgba(15,15,16,.04), 0 22px 48px -22px rgba(15,15,16,.16);
  --shadow-gold: 0 0 0 1px rgba(199,154,75,.18), 0 18px 50px -24px rgba(199,154,75,.35);

  --sidebar-w: 264px;
  --rail-w: 372px;
  --topbar-h: 72px;
  --content-max: 1320px;

  color-scheme: light;
}

[data-ground="void"] {
  --color-bg: #0A0908;
  --color-bg-2: #0D0B09;
  --color-surface: #100E0C;
  --color-surface-2: #16130F;
  --color-surface-3: #1E1A14;
  --color-elev: #100E0C;
  --color-text: #F6F4EF;
  --color-text-2: #B8B3A8;
  --color-text-3: #938C7F;
  --color-text-4: #6E685D;

  --color-gold-bg: rgba(228,195,129,.06);

  --color-border: rgba(228,195,129,.10);
  --color-border-2: rgba(228,195,129,.20);
  --color-border-3: rgba(228,195,129,.30);

  --metal-hairline: linear-gradient(90deg, transparent, rgba(228,195,129,.0) 4%, rgba(228,195,129,.34) 50%, rgba(228,195,129,.0) 96%, transparent);

  --shadow-elev: 0 0 0 1px rgba(228,195,129,.10), 0 24px 60px -32px rgba(0,0,0,.85);
  --shadow-float: 0 0 0 1px rgba(228,195,129,.14), 0 30px 70px -30px rgba(0,0,0,.9);
  --shadow-gold: 0 0 0 1px rgba(228,195,129,.30), 0 0 60px -12px rgba(228,195,129,.30);

  color-scheme: dark;
}

/* ----------------------------------------------------------------------------
   2 · RESET / BASE
   ---------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow: hidden; /* OS shell owns scrolling */
  transition: background .9s var(--ease-cine), color .9s var(--ease-cine);
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }
ul { list-style: none; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--color-gold); color: #fff; }
[data-ground="void"] ::selection { color: #0A0908; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border-2); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--color-gold-3); background-clip: content-box; }

/* ----------------------------------------------------------------------------
   3 · MARBLE GROUND TEXTURE
   ---------------------------------------------------------------------------- */
.nros-ground {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  transition: opacity .9s var(--ease-cine);
}
/* soft stone light pools */
.nros-ground::before {
  content: ""; position: absolute; inset: -10%;
  background:
    radial-gradient(60% 50% at 18% 8%, rgba(255,255,255,.9), transparent 60%),
    radial-gradient(55% 45% at 88% 4%, rgba(243,238,228,.85), transparent 62%),
    radial-gradient(70% 60% at 70% 100%, rgba(248,244,236,.9), transparent 60%),
    radial-gradient(40% 40% at 30% 80%, rgba(251,246,234,.7), transparent 60%);
  opacity: 1;
}
/* marble veining (procedural turbulence, very faint) */
.nros-ground::after {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='v'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.018' numOctaves='4' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0.62  0 0 0 0 0.49  0 0 0 0 0.23  0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23v)'/%3E%3C/svg%3E");
  background-size: 720px 720px;
  opacity: .05;
  mix-blend-mode: multiply;
}
[data-ground="void"] .nros-ground::before {
  background:
    radial-gradient(60% 50% at 18% 6%, rgba(40,32,20,.55), transparent 60%),
    radial-gradient(55% 45% at 90% 6%, rgba(30,24,16,.55), transparent 62%),
    radial-gradient(80% 70% at 60% 110%, rgba(24,19,13,.8), transparent 60%);
}
[data-ground="void"] .nros-ground::after {
  opacity: .5; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='3'/%3E%3CfeColorMatrix values='0 0 0 0 0.89  0 0 0 0 0.76  0 0 0 0 0.51  0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 300px 300px;
}
/* cursor-following champagne bloom */
.nros-bloom {
  position: fixed; width: 640px; height: 640px; left: 0; top: 0; z-index: 1;
  margin: -320px 0 0 -320px; pointer-events: none; border-radius: 50%;
  background: radial-gradient(circle, rgba(199,154,75,.10), transparent 64%);
  opacity: 0; transition: opacity .6s var(--ease); will-change: transform;
}
[data-ground="void"] .nros-bloom { background: radial-gradient(circle, rgba(228,195,129,.09), transparent 64%); }

/* ----------------------------------------------------------------------------
   4 · TYPOGRAPHY PRIMITIVES
   ---------------------------------------------------------------------------- */
.display { font-family: var(--font-display); font-weight: 500; letter-spacing: -.02em; line-height: 1.05; }
.display-xl { font-family: var(--font-display); font-weight: 600; letter-spacing: -.03em; line-height: .96; }
.metric-display { font-family: var(--font-display); font-weight: 500; letter-spacing: -.02em; color: var(--color-text); font-variant-numeric: tabular-nums; }

.gold-italic { font-style: italic; color: var(--color-gold); letter-spacing: .005em; padding-inline: .02em; }
[data-ground="void"] .gold-italic { color: var(--color-gold-2); }

.kicker { font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .30em; text-transform: uppercase; color: var(--color-gold-3); }
[data-ground="void"] .kicker { color: var(--color-gold-2); }
.kicker-muted { font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; color: var(--color-text-3); }
.spec-caption { font-family: var(--font-mono); font-size: 9.5px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--color-text-3); }

.eyebrow { font-family: var(--font-ui); font-size: 11px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--color-text-3); }
.label { font-family: var(--font-ui); font-size: 10px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--color-text-3); }
.label-sm { font-family: var(--font-ui); font-size: 9px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--color-text-3); }
.overline { font-family: var(--font-ui); font-size: 10px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--color-gold-3); }
[data-ground="void"] .overline { color: var(--color-gold); }

.link-gold {
  position: relative; color: var(--color-gold); font-family: var(--font-ui);
  font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: .45rem; transition: color .2s, gap .2s;
}
.link-gold:hover { color: var(--color-gold-3); gap: .6rem; }
[data-ground="void"] .link-gold:hover { color: var(--color-gold-2); }
.link-gold svg { width: 13px; height: 13px; }

.t-2 { color: var(--color-text-2); }
.t-3 { color: var(--color-text-3); }
.t-gold { color: var(--color-gold); }
.serif { font-family: var(--font-display); }
.mono { font-family: var(--font-mono); }
.tnum { font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------------------------
   5 · SURFACES
   ---------------------------------------------------------------------------- */
.surface { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); }
.elev { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-elev); }
.elev-float { box-shadow: var(--shadow-float); }
.glass {
  background: rgba(255,255,255,.74); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  -webkit-backdrop-filter: blur(16px) saturate(150%); backdrop-filter: blur(16px) saturate(150%);
}
[data-ground="void"] .glass { background: rgba(10,9,8,.66); }

/* card hover — quiet lift to gold */
.nr-card-hover { transition: transform .45s var(--ease-smooth), border-color .45s var(--ease-smooth), box-shadow .45s var(--ease-smooth); }
.nr-card-hover:hover { transform: translateY(-3px); border-color: var(--color-gold); box-shadow: var(--shadow-float); }

/* engineering corner ticks */
.ornament-corner { position: relative; }
.ornament-corner::before, .ornament-corner::after,
.ornament-corner > .corner-bl, .ornament-corner > .corner-br {
  content: ""; position: absolute; width: 12px; height: 12px; border-color: var(--color-gold); opacity: .5; pointer-events: none;
}
.ornament-corner::before { top: 10px; left: 10px; border-top: 1px solid; border-left: 1px solid; }
.ornament-corner::after { top: 10px; right: 10px; border-top: 1px solid; border-right: 1px solid; }
.ornament-corner > .corner-bl { bottom: 10px; left: 10px; border-bottom: 1px solid; border-left: 1px solid; }
.ornament-corner > .corner-br { bottom: 10px; right: 10px; border-bottom: 1px solid; border-right: 1px solid; }

/* metallic divider */
.hairline { height: 1px; width: 100%; background: var(--metal-hairline); border: 0; }
.divider { height: 1px; background: var(--color-border); border: 0; }

/* ornament rule (centered glyph between fading hairlines) */
.ornament-rule { display: flex; align-items: center; gap: 14px; color: var(--color-gold); }
.ornament-rule::before, .ornament-rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(to right, transparent, var(--color-border-2), transparent); }
.ornament-rule .glyph { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-style: italic; font-size: 13px; color: var(--color-gold); }
.ornament-rule .glyph::before, .ornament-rule .glyph::after { content: ""; width: 5px; height: 5px; border-radius: 999px; background: var(--color-gold); }

/* ----------------------------------------------------------------------------
   6 · PILLS · DOTS · BADGES
   ---------------------------------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-family: var(--font-ui); font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  line-height: 1; border: 1px solid currentColor;
}
.pill .dot { width: 5px; height: 5px; border-radius: 999px; background: currentColor; }
.pill-soft {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-family: var(--font-ui); font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; line-height: 1;
  background: var(--color-gold-bg); color: var(--color-gold-3); border: 1px solid rgba(181,138,70,.25);
}
[data-ground="void"] .pill-soft { color: var(--color-gold-2); border-color: rgba(228,195,129,.25); }
.pill-live { color: var(--color-live); }
.pill-mute { color: var(--color-mute); }
.pill-gold { color: var(--color-gold); }
.pill-warn { color: var(--color-warn); }

.pulse-dot { width: 7px; height: 7px; border-radius: 999px; display: inline-block; background: var(--color-live); box-shadow: 0 0 0 3px rgba(79,165,109,.14); flex: 0 0 auto; }
.pulse-dot.gold { background: var(--color-gold); box-shadow: 0 0 0 3px rgba(181,138,70,.14); }
.pulse-dot.mute { background: var(--color-mute); box-shadow: 0 0 0 3px rgba(142,142,146,.14); }
.pulse-dot.live { animation: nrPulse 2.4s var(--ease) infinite; }
@keyframes nrPulse { 0%,100% { box-shadow: 0 0 0 3px rgba(79,165,109,.14); } 50% { box-shadow: 0 0 0 5px rgba(79,165,109,.05); } }

.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-family: var(--font-ui); font-size: 9.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  background: var(--color-surface-2); border: 1px solid var(--color-border); color: var(--color-text-3);
}
.tag.gold { background: var(--color-gold-bg); border-color: rgba(181,138,70,.25); color: var(--color-gold-3); }
[data-ground="void"] .tag.gold { color: var(--color-gold-2); }

.status-dot { width: 6px; height: 6px; border-radius: 999px; display: inline-block; flex: 0 0 auto; }
.status-line { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-ui); font-size: 10px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }

/* ----------------------------------------------------------------------------
   7 · BUTTONS
   ---------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-ui); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  padding: 11px 20px; border-radius: 999px; border: 1px solid transparent; line-height: 1; white-space: nowrap;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), box-shadow .35s var(--ease), transform .2s var(--ease);
}
.btn svg { width: 14px; height: 14px; }
.btn-primary { background: var(--color-gold); color: #0A0908; border-color: var(--color-gold); }
.btn-primary:hover { background: var(--color-gold-2); box-shadow: 0 0 40px -8px rgba(228,195,129,.5); transform: translateY(-1px); }
.btn-secondary { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border-2); box-shadow: var(--shadow-elev); }
.btn-secondary:hover { border-color: var(--color-gold); color: var(--color-gold-3); }
[data-ground="void"] .btn-secondary:hover { color: var(--color-gold); }
.btn-ghost { background: transparent; color: var(--color-text-2); border-color: transparent; }
.btn-ghost:hover { color: var(--color-text); background: var(--color-surface-2); }
.btn-sm { padding: 8px 14px; font-size: 10px; }
.btn-lg { padding: 14px 26px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 50%; border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text-2); box-shadow: var(--shadow-elev); }
.btn-icon:hover { color: var(--color-gold); border-color: var(--color-gold); }
.btn-icon svg { width: 16px; height: 16px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

/* ----------------------------------------------------------------------------
   8 · THE SHELL — sidebar / topbar / view / rail
   ---------------------------------------------------------------------------- */
#nros-app { position: relative; z-index: 2; display: grid; grid-template-columns: var(--sidebar-w) 1fr; height: 100vh; width: 100vw; }
#nros-app.rail-open { grid-template-columns: var(--sidebar-w) 1fr; }

/* SIDEBAR */
.nav-rail {
  grid-row: 1 / -1; height: 100vh; display: flex; flex-direction: column;
  background: var(--color-surface); border-right: 1px solid var(--color-border);
  position: relative; z-index: 5; transition: background .9s var(--ease-cine);
}
.nav-rail::after { content: ""; position: absolute; top: 0; right: 0; width: 1px; height: 100%; background: var(--metal-hairline); opacity: .6; }
.brand-lockup { display: flex; align-items: center; gap: 12px; padding: 22px 22px 18px; }
.brand-mark { width: 38px; height: 38px; flex: 0 0 auto; }
.brand-name { font-family: var(--font-ui); font-size: 13px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--color-text); line-height: 1.1; }
.brand-sub { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .26em; text-transform: uppercase; color: var(--color-text-3); margin-top: 3px; }

.nav-scroll { flex: 1; overflow-y: auto; padding: 6px 14px 14px; }
.nav-group { margin-top: 16px; }
.nav-group:first-child { margin-top: 6px; }
.nav-group-label { font-family: var(--font-ui); font-size: 9px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--color-text-4); padding: 0 12px 8px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 10px;
  font-family: var(--font-ui); font-size: 13px; font-weight: 500; letter-spacing: .01em; color: var(--color-text-2);
  position: relative; transition: background .2s var(--ease), color .2s var(--ease); text-align: left;
}
.nav-item svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: .8; transition: opacity .2s; }
.nav-item:hover { background: var(--color-surface-2); color: var(--color-text); }
.nav-item:hover svg { opacity: 1; }
.nav-item.active { background: var(--color-gold-bg); color: var(--color-gold-3); font-weight: 600; }
[data-ground="void"] .nav-item.active { color: var(--color-gold-2); }
.nav-item.active svg { opacity: 1; color: var(--color-gold); }
.nav-item.active::before { content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%); width: 3px; height: 22px; border-radius: 999px; background: var(--color-gold); }
.nav-item .nav-badge { margin-left: auto; font-family: var(--font-ui); font-size: 9px; font-weight: 700; letter-spacing: .08em; padding: 2px 7px; border-radius: 999px; background: var(--color-gold); color: #0A0908; }
.nav-item .nav-badge.soft { background: var(--color-surface-3); color: var(--color-text-3); }
.nav-item.locked { opacity: .45; }
.nav-item.locked svg.lock { width: 13px; margin-left: auto; opacity: .7; }

/* sidebar profile footer */
.nav-foot { padding: 14px; border-top: 1px solid var(--color-border); }
.op-chip { display: flex; align-items: center; gap: 11px; padding: 9px; border-radius: 12px; transition: background .2s; cursor: pointer; }
.op-chip:hover { background: var(--color-surface-2); }
.op-avatar { width: 40px; height: 40px; border-radius: 11px; object-fit: cover; flex: 0 0 auto; border: 1px solid var(--color-border-2); background: var(--color-surface-2); }
.op-avatar.ring { box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 3px var(--color-gold); }
.op-name { font-family: var(--font-ui); font-size: 12.5px; font-weight: 600; color: var(--color-text); letter-spacing: .01em; }
.op-role { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--color-text-3); margin-top: 2px; }
.xp-rail { margin-top: 12px; }
.xp-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.xp-level { font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--color-text); }
.xp-num { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em; color: var(--color-text-3); }

/* progress bar */
.bar { height: 6px; border-radius: 999px; background: var(--color-surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--color-gold-3), var(--color-gold), var(--color-gold-2)); transition: width 1s var(--ease-out); }
.bar.thin { height: 4px; }
.bar.thick { height: 9px; }
.bar.green > i { background: linear-gradient(90deg, #3C8A57, var(--color-live)); }

/* MAIN COLUMN */
.main-col { grid-column: 2; height: 100vh; display: flex; flex-direction: column; min-width: 0; }

/* TOPBAR */
.topbar {
  height: var(--topbar-h); flex: 0 0 auto; display: flex; align-items: center; gap: 18px;
  padding: 0 28px; border-bottom: 1px solid var(--color-border); position: relative; z-index: 4;
  background: color-mix(in srgb, var(--color-bg) 78%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.topbar::after { content: ""; position: absolute; bottom: 0; left: 0; width: 100%; height: 1px; background: var(--metal-hairline); opacity: .5; }
.topbar-greeting { min-width: 0; }
.topbar-greeting h1 { font-family: var(--font-display); font-size: clamp(20px, 2.4vw, 30px); font-weight: 600; letter-spacing: -.02em; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-greeting p { font-size: 12.5px; color: var(--color-text-2); margin-top: 2px; }
.topbar-spacer { flex: 1; }
.search-box {
  display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 14px; min-width: 220px; max-width: 320px; flex: 1;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 999px; box-shadow: var(--shadow-elev);
  transition: border-color .2s, box-shadow .2s;
}
.search-box:focus-within { border-color: var(--color-gold); box-shadow: var(--shadow-gold); }
.search-box svg { width: 15px; height: 15px; color: var(--color-text-3); flex: 0 0 auto; }
.search-box input { flex: 1; border: none; outline: none; background: transparent; font-size: 13px; min-width: 0; }
.search-box input::placeholder { color: var(--color-text-3); }
.search-box kbd { font-family: var(--font-mono); font-size: 9px; letter-spacing: .05em; color: var(--color-text-3); border: 1px solid var(--color-border-2); border-radius: 5px; padding: 2px 5px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--color-text-2); border: 1px solid transparent; transition: background .2s, color .2s, border-color .2s; }
.icon-btn:hover { background: var(--color-surface-2); color: var(--color-text); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .badge-dot { position: absolute; top: 7px; right: 8px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 999px; background: var(--color-gold); color: #0A0908; font-family: var(--font-ui); font-size: 9px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--color-bg); }

/* level chip in topbar */
.level-chip { display: flex; align-items: center; gap: 12px; padding: 7px 8px 7px 14px; border-radius: 999px; background: var(--color-surface); border: 1px solid var(--color-border); box-shadow: var(--shadow-elev); }
.level-chip .lc-meta { line-height: 1.1; }
.level-chip .lc-level { font-family: var(--font-ui); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.level-chip .lc-rank { font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--color-gold-3); margin-top: 2px; }
[data-ground="void"] .level-chip .lc-rank { color: var(--color-gold-2); }
.level-chip .lc-ring { width: 34px; height: 34px; flex: 0 0 auto; }

/* VIEW SCROLL AREA */
.view-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; }
.view-wrap { max-width: var(--content-max); margin: 0 auto; padding: 30px 28px 96px; }
.view-enter { animation: viewIn .5s var(--ease-out) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* page head */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .ph-title { font-family: var(--font-display); font-size: clamp(28px, 3.4vw, 44px); font-weight: 500; letter-spacing: -.02em; line-height: 1.02; }
.page-head .ph-sub { font-size: 14px; color: var(--color-text-2); margin-top: 8px; max-width: 60ch; }
.page-head .ph-actions { display: flex; align-items: center; gap: 10px; }

/* ----------------------------------------------------------------------------
   9 · LAYOUT HELPERS / GRIDS
   ---------------------------------------------------------------------------- */
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-5 { grid-template-columns: repeat(5, 1fr); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.g-auto-lg { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; }
.stack > * + * { margin-top: 14px; }
.mt-s { margin-top: 8px; } .mt-m { margin-top: 16px; } .mt-l { margin-top: 28px; } .mt-xl { margin-top: 44px; }
.gap-s { gap: 8px; } .gap-l { gap: 24px; }
.center { display: flex; align-items: center; justify-content: center; }
.pad { padding: 22px; } .pad-l { padding: 28px; } .pad-s { padding: 16px; }
.fill { width: 100%; }
.hide { display: none !important; }

/* ----------------------------------------------------------------------------
   10 · COMPONENTS — STAT TILE / SECTION / CARDS
   ---------------------------------------------------------------------------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.section-head .sh-l { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.section-head h2 { font-family: var(--font-display); font-size: 22px; font-weight: 500; letter-spacing: -.01em; }
.section-head .sh-kick { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--color-text-3); }

/* stat tile */
.stat { padding: 20px; position: relative; overflow: hidden; }
.stat .stat-ico { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: var(--color-gold-bg); color: var(--color-gold-3); border: 1px solid rgba(181,138,70,.18); margin-bottom: 14px; }
[data-ground="void"] .stat .stat-ico { color: var(--color-gold-2); }
.stat .stat-ico svg { width: 19px; height: 19px; }
.stat .stat-label { font-family: var(--font-ui); font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--color-text-3); }
.stat .stat-value { font-family: var(--font-display); font-size: 32px; font-weight: 500; letter-spacing: -.02em; margin-top: 6px; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .stat-value small { font-size: 15px; color: var(--color-text-3); font-weight: 500; }
.stat .stat-foot { margin-top: 10px; font-size: 11.5px; display: inline-flex; align-items: center; gap: 6px; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-ui); font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.delta.up { color: var(--color-live); } .delta.down { color: var(--color-warn); } .delta.flat { color: var(--color-text-3); }
.delta svg { width: 12px; height: 12px; }

/* generic content card */
.card { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head .ch-ico { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--color-surface-2); color: var(--color-gold-3); border: 1px solid var(--color-border); flex: 0 0 auto; }
[data-ground="void"] .card-head .ch-ico { color: var(--color-gold-2); }
.card-head .ch-ico svg { width: 17px; height: 17px; }
.card-head h3 { font-family: var(--font-ui); font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.card-title { font-family: var(--font-display); font-size: 19px; font-weight: 500; letter-spacing: -.01em; line-height: 1.2; }

/* hero / destination tool card */
.tool-card { overflow: hidden; display: flex; flex-direction: column; cursor: pointer; }
.tool-hero { position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--color-surface-2); }
.tool-hero .th-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-smooth); }
.tool-card:hover .th-art { transform: scale(1.05); }
.tool-hero .th-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,9,8,0) 30%, rgba(10,9,8,.34) 100%); }
.tool-hero .th-ico { position: absolute; top: 14px; left: 14px; width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: rgba(10,9,8,.5); border: 1px solid rgba(228,195,129,.4); color: var(--color-gold-2); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.tool-hero .th-ico svg { width: 21px; height: 21px; }
.tool-hero .th-tier { position: absolute; top: 16px; right: 16px; }
.tool-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.tool-body h3 { font-family: var(--font-display); font-size: 21px; font-weight: 500; letter-spacing: -.01em; }
.tool-body .tb-desc { font-size: 13px; color: var(--color-text-2); margin-top: 7px; line-height: 1.5; }
.tool-body .tb-out { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--color-border); display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--color-text-3); }
.tool-body .tb-out b { color: var(--color-gold-3); font-weight: 600; }
[data-ground="void"] .tool-body .tb-out b { color: var(--color-gold-2); }
.tool-body .tb-foot { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* procedural hero backdrop (when no photo) */
.proc-hero { position: absolute; inset: 0; }
.proc-hero::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(120% 90% at 20% 0%, rgba(228,195,129,.22), transparent 55%),
  radial-gradient(120% 120% at 100% 100%, rgba(199,154,75,.16), transparent 55%),
  linear-gradient(135deg, #16130F, #0A0908); }
.proc-hero::after { content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 20h40M20 0v40' stroke='%23E4C381' stroke-width='.4' stroke-opacity='.12'/%3E%3C/svg%3E"); }

/* list row */
.lrow { display: flex; align-items: center; gap: 14px; padding: 13px 4px; border-bottom: 1px solid var(--color-border); transition: background .2s; }
.lrow:last-child { border-bottom: none; }
.lrow:hover { background: var(--color-surface-2); border-radius: 8px; }
.lrow .lr-ico { width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; background: var(--color-surface-2); border: 1px solid var(--color-border); color: var(--color-gold-3); }
.lrow .lr-main { flex: 1; min-width: 0; }
.lrow .lr-title { font-size: 13.5px; font-weight: 600; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .lr-sub { font-size: 11.5px; color: var(--color-text-3); margin-top: 2px; }
.lrow .lr-val { font-family: var(--font-display); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.lrow .lr-meta { font-size: 11px; color: var(--color-text-3); text-align: right; }

/* progress ring (svg sized via class) */
.ring { transform: rotate(-90deg); }
.ring circle { fill: none; }
.ring .ring-bg { stroke: var(--color-surface-3); }
.ring .ring-fg { stroke: url(#goldgrad); stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--ease-out); }

/* mission checklist */
.check-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--color-border); }
.check-item:last-child { border-bottom: none; }
.check-box { width: 20px; height: 20px; border-radius: 7px; border: 1.5px solid var(--color-border-2); flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; transition: all .2s; }
.check-item.done .check-box { background: var(--color-gold); border-color: var(--color-gold); color: #0A0908; }
.check-item.done .check-box svg { width: 12px; height: 12px; }
.check-item .ci-label { flex: 1; font-size: 13.5px; color: var(--color-text); }
.check-item.done .ci-label { color: var(--color-text-3); text-decoration: line-through; text-decoration-color: var(--color-border-2); }
.check-item .ci-count { font-family: var(--font-mono); font-size: 11px; color: var(--color-text-3); }

/* pipeline stages */
.stage-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.stage { padding: 16px 12px; text-align: center; border-radius: 12px; background: var(--color-surface-2); border: 1px solid var(--color-border); position: relative; transition: all .3s var(--ease); }
.stage:hover { border-color: var(--color-gold); transform: translateY(-2px); }
.stage.hot { background: linear-gradient(180deg, var(--color-gold-bg), var(--color-surface)); border-color: rgba(181,138,70,.4); }
.stage .st-ico { width: 30px; height: 30px; margin: 0 auto 9px; color: var(--color-gold-3); }
.stage .st-num { font-family: var(--font-display); font-size: 26px; font-weight: 600; line-height: 1; }
.stage .st-name { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--color-text-3); margin-top: 6px; }

/* table */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { font-family: var(--font-ui); font-size: 9.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--color-text-3); text-align: left; padding: 0 14px 12px; border-bottom: 1px solid var(--color-border); }
.tbl td { padding: 14px; border-bottom: 1px solid var(--color-border); font-size: 13px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: var(--color-surface-2); }
.tbl .td-strong { font-weight: 600; }
.tbl .td-num { font-variant-numeric: tabular-nums; font-family: var(--font-mono); }

/* avatar stack / leaderboard */
.rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; transition: background .2s; }
.rank-row:hover { background: var(--color-surface-2); }
.rank-row.me { background: var(--color-gold-bg); border: 1px solid rgba(181,138,70,.25); }
.rank-num { font-family: var(--font-display); font-size: 17px; font-weight: 600; width: 22px; text-align: center; color: var(--color-text-3); }
.rank-row.podium .rank-num { color: var(--color-gold); }
.rank-av { width: 32px; height: 32px; border-radius: 9px; object-fit: cover; background: var(--color-surface-2); border: 1px solid var(--color-border); flex: 0 0 auto; }
.rank-name { font-size: 13px; font-weight: 600; flex: 1; }
.rank-val { font-family: var(--font-display); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* tabs */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: 999px; }
.tab { padding: 8px 16px; border-radius: 999px; font-family: var(--font-ui); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--color-text-3); transition: all .2s; }
.tab.active { background: var(--color-surface); color: var(--color-gold-3); box-shadow: var(--shadow-elev); }
[data-ground="void"] .tab.active { color: var(--color-gold-2); }
.tab:hover:not(.active) { color: var(--color-text); }

/* segmented chips filter */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 7px 14px; border-radius: 999px; font-family: var(--font-ui); font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--color-text-3); border: 1px solid var(--color-border-2); transition: all .2s; }
.chip:hover { color: var(--color-text); border-color: var(--color-border-3); }
.chip.active { background: var(--color-gold-bg); color: var(--color-gold-3); border-color: rgba(199,154,75,.5); }
[data-ground="void"] .chip.active { color: var(--color-gold-2); }

/* forms */
.field { margin-bottom: 16px; }
.field label { display: block; font-family: var(--font-ui); font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--color-text-3); margin-bottom: 7px; }
.input, .textarea, .select {
  width: 100%; background: var(--color-surface-2); border: 1px solid var(--color-border-2); border-radius: var(--radius);
  padding: 11px 14px; font-size: 13.5px; color: var(--color-text); transition: border-color .2s, box-shadow .2s; outline: none;
}
.input::placeholder, .textarea::placeholder { color: var(--color-text-3); }
.input:focus, .textarea:focus, .select:focus { border-color: var(--color-gold); box-shadow: 0 0 0 3px rgba(199,154,75,.12); }
.textarea { resize: vertical; min-height: 96px; line-height: 1.55; }

/* toggle */
.toggle { width: 42px; height: 24px; border-radius: 999px; background: var(--color-surface-3); border: 1px solid var(--color-border-2); position: relative; transition: background .25s, border-color .25s; flex: 0 0 auto; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .25s var(--ease); }
.toggle.on { background: var(--color-gold); border-color: var(--color-gold); }
.toggle.on::after { transform: translateX(18px); }

/* ----------------------------------------------------------------------------
   11 · GENUBRA RAIL
   ---------------------------------------------------------------------------- */
.genubra-rail {
  position: fixed; top: 0; right: 0; height: 100vh; width: var(--rail-w); max-width: 92vw; z-index: 40;
  display: flex; flex-direction: column; background: var(--color-surface); border-left: 1px solid var(--color-border);
  box-shadow: -24px 0 60px -40px rgba(15,15,16,.3); transform: translateX(100%); transition: transform .42s var(--ease-smooth);
}
.genubra-rail.open { transform: none; }
.genubra-rail::before { content: ""; position: absolute; top: 0; left: 0; width: 1px; height: 100%; background: var(--metal-hairline); opacity: .6; }
.gr-head { padding: 18px 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--color-border); }
.gr-orb { width: 40px; height: 40px; border-radius: 12px; flex: 0 0 auto; position: relative; overflow: hidden; background: radial-gradient(circle at 30% 30%, #2A2118, #0A0908); border: 1px solid rgba(228,195,129,.35); display: inline-flex; align-items: center; justify-content: center; }
.gr-orb svg { width: 22px; height: 22px; color: var(--color-gold-2); position: relative; z-index: 1; }
.gr-orb::after { content: ""; position: absolute; inset: -40%; background: conic-gradient(from 0deg, transparent, rgba(228,195,129,.5), transparent 40%); animation: orbSpin 6s linear infinite; }
@keyframes orbSpin { to { transform: rotate(360deg); } }
.gr-title { font-family: var(--font-ui); font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.gr-status { font-size: 10px; letter-spacing: .1em; color: var(--color-text-3); margin-top: 2px; display: inline-flex; align-items: center; gap: 6px; }
.gr-body { flex: 1; overflow-y: auto; padding: 18px 18px 8px; }
.gr-foot { padding: 14px 16px 18px; border-top: 1px solid var(--color-border); }
.gr-input { display: flex; align-items: flex-end; gap: 8px; background: var(--color-surface-2); border: 1px solid var(--color-border-2); border-radius: 16px; padding: 8px 8px 8px 14px; transition: border-color .2s, box-shadow .2s; }
.gr-input:focus-within { border-color: var(--color-gold); box-shadow: 0 0 0 3px rgba(199,154,75,.1); }
.gr-input textarea { flex: 1; border: none; outline: none; background: transparent; resize: none; font-size: 13.5px; max-height: 120px; line-height: 1.5; padding: 4px 0; }
.gr-send { width: 36px; height: 36px; border-radius: 11px; flex: 0 0 auto; background: var(--color-gold); color: #0A0908; display: inline-flex; align-items: center; justify-content: center; transition: background .2s, transform .2s; }
.gr-send:hover { background: var(--color-gold-2); transform: translateY(-1px); }
.gr-send svg { width: 16px; height: 16px; }
.gr-disclaimer { font-size: 9.5px; letter-spacing: .04em; color: var(--color-text-3); text-align: center; margin-top: 10px; }

/* chat bubbles */
.msg { margin-bottom: 16px; max-width: 92%; }
.msg.user { margin-left: auto; }
.msg .bubble { padding: 12px 15px; border-radius: 16px; font-size: 13.5px; line-height: 1.55; }
.msg.bot .bubble { background: var(--color-surface-2); border: 1px solid var(--color-border); border-top-left-radius: 5px; }
.msg.user .bubble { background: var(--color-gold-bg); border: 1px solid rgba(181,138,70,.25); border-top-right-radius: 5px; }
.msg .bubble strong { color: var(--color-gold-3); font-weight: 600; }
[data-ground="void"] .msg .bubble strong { color: var(--color-gold-2); }
.msg .bubble p + p { margin-top: 9px; }
.msg .bubble ul { margin: 8px 0 0; padding-left: 4px; }
.msg .bubble li { display: flex; gap: 8px; margin-top: 6px; font-size: 13px; }
.msg .bubble li::before { content: "▸"; color: var(--color-gold); flex: 0 0 auto; }
.msg .who { font-family: var(--font-ui); font-size: 9px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--color-text-3); margin: 0 4px 6px; }

/* genubra suggestion cards */
.gr-suggest { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 12px; background: var(--color-surface); border: 1px solid var(--color-border); text-align: left; margin-bottom: 9px; transition: all .2s; }
.gr-suggest:hover { border-color: var(--color-gold); transform: translateX(2px); box-shadow: var(--shadow-elev); }
.gr-suggest .gs-ico { width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; background: var(--color-gold-bg); color: var(--color-gold-3); border: 1px solid rgba(181,138,70,.18); }
[data-ground="void"] .gr-suggest .gs-ico { color: var(--color-gold-2); }
.gr-suggest .gs-ico svg { width: 17px; height: 17px; }
.gr-suggest .gs-title { font-size: 13px; font-weight: 600; }
.gr-suggest .gs-sub { font-size: 11px; color: var(--color-text-3); margin-top: 1px; }

.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--color-text-3); animation: typeb 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typeb { 0%,60%,100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* ----------------------------------------------------------------------------
   12 · MODAL · TOAST · OVERLAY
   ---------------------------------------------------------------------------- */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(15,14,12,.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
.overlay.open { opacity: 1; pointer-events: auto; }
.modal { width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-xl); box-shadow: var(--shadow-float); transform: translateY(14px) scale(.985); transition: transform .35s var(--ease-smooth); }
.overlay.open .modal { transform: none; }
.modal-lg { max-width: 860px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 26px 0; }
.modal-body { padding: 18px 26px 26px; }
.modal-close { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--color-text-3); border: 1px solid var(--color-border); flex: 0 0 auto; transition: all .2s; }
.modal-close:hover { color: var(--color-text); border-color: var(--color-border-3); }

.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; padding: 13px 18px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 999px; box-shadow: var(--shadow-float); font-size: 13px; font-weight: 500; animation: toastIn .4s var(--ease-smooth) both; pointer-events: auto; }
.toast .toast-ico { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.toast.xp .toast-ico { background: var(--color-gold-bg); color: var(--color-gold-3); }
.toast.ok .toast-ico { background: rgba(79,165,109,.14); color: var(--color-live); }
.toast.xp { border-color: rgba(199,154,75,.4); }
.toast b { font-family: var(--font-display); font-weight: 600; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.toast.out { animation: toastOut .35s var(--ease) both; }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

/* confetti-free celebration shimmer */
.celebrate { animation: celebrate .9s var(--ease-out); }
@keyframes celebrate { 0% { box-shadow: 0 0 0 0 rgba(199,154,75,.4); } 100% { box-shadow: 0 0 0 30px rgba(199,154,75,0); } }

/* ----------------------------------------------------------------------------
   13 · ACADEMY / CODEX / CAREER SPECIFIerS
   ---------------------------------------------------------------------------- */
/* course card */
.course-hero { aspect-ratio: 5/3; }
.course-progress { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.course-progress .cp-num { font-family: var(--font-mono); font-size: 10.5px; color: var(--color-text-3); white-space: nowrap; }

/* codex reading layout */
.codex-shell { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: start; }
.codex-toc { position: sticky; top: 0; }
.codex-toc .toc-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; font-size: 12.5px; color: var(--color-text-2); transition: all .2s; }
.codex-toc .toc-item:hover { background: var(--color-surface-2); color: var(--color-text); }
.codex-toc .toc-item.active { background: var(--color-gold-bg); color: var(--color-gold-3); font-weight: 600; }
.codex-toc .toc-num { font-family: var(--font-mono); font-size: 10px; color: var(--color-text-4); }
.codex-read { max-width: 720px; }
.codex-read h1 { font-family: var(--font-display); font-size: clamp(32px, 4vw, 48px); font-weight: 500; letter-spacing: -.02em; line-height: 1.05; }
.codex-read .lede { font-size: 17px; color: var(--color-text-2); margin-top: 14px; line-height: 1.6; }
.codex-read h2 { font-family: var(--font-display); font-size: 26px; font-weight: 500; margin-top: 36px; letter-spacing: -.01em; }
.codex-read h3 { font-family: var(--font-ui); font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--color-gold-3); margin-top: 26px; }
.codex-read p { font-size: 15px; line-height: 1.7; color: var(--color-text); margin-top: 14px; }
.codex-read ul.read-list { margin-top: 14px; }
.codex-read ul.read-list li { font-size: 15px; line-height: 1.6; padding: 7px 0 7px 26px; position: relative; }
.codex-read ul.read-list li::before { content: "▸"; position: absolute; left: 4px; color: var(--color-gold); }
.callout { margin-top: 22px; padding: 18px 20px; border-radius: 12px; background: var(--color-gold-bg); border: 1px solid rgba(181,138,70,.22); border-left: 3px solid var(--color-gold); }
.callout .co-label { font-family: var(--font-ui); font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--color-gold-3); margin-bottom: 7px; }
.callout p { margin-top: 0; font-size: 14px; }

/* flow diagram (vertical chain) */
.flow { display: flex; flex-direction: column; align-items: center; gap: 0; }
.flow .flow-node { padding: 11px 22px; border-radius: 999px; background: var(--color-surface); border: 1px solid var(--color-border-2); font-family: var(--font-ui); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; box-shadow: var(--shadow-elev); }
.flow .flow-node.gold { background: var(--color-gold-bg); border-color: rgba(199,154,75,.5); color: var(--color-gold-3); }
.flow .flow-link { width: 1px; height: 22px; background: linear-gradient(var(--color-gold), transparent); }
.flow .flow-link::after { content: "▾"; display: block; color: var(--color-gold); font-size: 9px; text-align: center; margin-top: -6px; }

/* career journey */
.journey-card { position: relative; overflow: hidden; }
.level-node { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 14px; border: 1px solid var(--color-border); position: relative; transition: all .3s; }
.level-node.current { background: var(--color-gold-bg); border-color: rgba(199,154,75,.4); box-shadow: var(--shadow-gold); }
.level-node.locked { opacity: .5; }
.level-node .ln-badge { width: 50px; height: 50px; border-radius: 14px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 22px; font-weight: 600; background: var(--color-surface); border: 1px solid var(--color-border-2); }
.level-node.current .ln-badge { background: var(--color-gold); color: #0A0908; border-color: var(--color-gold); }
.level-node .ln-name { font-family: var(--font-ui); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.level-node .ln-sub { font-size: 11.5px; color: var(--color-text-3); margin-top: 3px; }

/* achievement medallion */
.medallion { text-align: center; }
.medallion .md-coin { width: 60px; height: 60px; margin: 0 auto 10px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: radial-gradient(circle at 35% 30%, #F0DCA8, #C79A4B 70%, #9A7330); box-shadow: 0 6px 16px -6px rgba(199,154,75,.5), inset 0 0 0 2px rgba(255,255,255,.3); color: #5A4216; }
.medallion.locked .md-coin { background: var(--color-surface-3); box-shadow: none; color: var(--color-text-4); }
.medallion .md-coin svg { width: 26px; height: 26px; }
.medallion .md-name { font-family: var(--font-ui); font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.medallion .md-sub { font-size: 10px; color: var(--color-text-3); margin-top: 2px; }

/* empty state */
.empty { text-align: center; padding: 60px 24px; color: var(--color-text-3); }
.empty svg { width: 40px; height: 40px; margin: 0 auto 14px; opacity: .5; }

/* number count-up helper visual */
.countup { font-variant-numeric: tabular-nums; }

/* skeleton */
.skel { background: linear-gradient(90deg, var(--color-surface-2), var(--color-surface-3), var(--color-surface-2)); background-size: 200% 100%; animation: skel 1.4s infinite; border-radius: 8px; }
@keyframes skel { to { background-position: -200% 0; } }

/* ----------------------------------------------------------------------------
   14 · RESPONSIVE
   ---------------------------------------------------------------------------- */
@media (max-width: 1240px) {
  .g-4 { grid-template-columns: repeat(2, 1fr); }
  .g-5 { grid-template-columns: repeat(3, 1fr); }
  .stage-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1080px) {
  :root { --sidebar-w: 76px; }
  .nav-item span.nav-text, .brand-name, .brand-sub, .nav-group-label, .op-name, .op-role, .xp-rail, .nav-item .nav-badge { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .nav-item.active::before { left: -14px; }
  .brand-lockup { justify-content: center; padding: 22px 0 18px; }
  .op-chip { justify-content: center; }
  .codex-shell { grid-template-columns: 1fr; }
  .codex-toc { position: static; }
}
@media (max-width: 900px) {
  .g-3, .g-2, .g-auto, .g-auto-lg { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: span 1; }
  .stage-grid { grid-template-columns: repeat(2, 1fr); }
  .search-box { display: none; }
  .view-wrap { padding: 22px 16px 90px; }
}

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

/* ----------------------------------------------------------------------------
   15 · AUTH GATE
   ---------------------------------------------------------------------------- */
body.auth-mode #nros-app, body.auth-mode .genubra-rail, body.auth-mode #nros-bloom { display: none !important; }
body.auth-mode { overflow: auto; }
#auth-screen { position: fixed; inset: 0; z-index: 100; }
.auth-stage { position: relative; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-card { position: relative; z-index: 2; width: 100%; max-width: 460px; padding: 34px 36px; }
.auth-card.elev { box-shadow: var(--shadow-float); }
.auth-brand { display: flex; align-items: center; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--color-border); }
.auth-divider { display: flex; align-items: center; gap: 14px; margin: 22px 0 16px; color: var(--color-text-3); }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }
.auth-divider span { font-family: var(--font-ui); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }
.auth-note { font-size: 13px; line-height: 1.5; padding: 12px 14px; border-radius: 10px; background: var(--color-surface-2); border: 1px solid var(--color-border); }
.auth-note.ok { background: rgba(79,165,109,.08); border-color: rgba(79,165,109,.3); color: var(--color-text); }
.auth-note.warn { background: rgba(184,108,66,.08); border-color: rgba(184,108,66,.3); }
.auth-note a { color: inherit; }
.auth-foot { margin-top: 22px; position: relative; z-index: 2; }

/* ----------------------------------------------------------------------------
   16 · CALENDAR
   ---------------------------------------------------------------------------- */
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 6px 0 8px; }
.cal-dow span { font-family: var(--font-ui); font-size: 9.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--color-text-3); text-align: center; padding: 4px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell { aspect-ratio: 1/1; border-radius: 10px; border: 1px solid var(--color-border); position: relative; padding: 8px; transition: all .2s; }
.cal-cell.empty { border: none; background: transparent; }
.cal-cell.has { cursor: pointer; }
.cal-cell.has:hover { border-color: var(--color-gold); transform: translateY(-2px); box-shadow: var(--shadow-elev); }
.cal-cell.today { background: var(--color-gold-bg); border-color: rgba(199,154,75,.45); }
.cal-num { font-family: var(--font-display); font-size: 15px; font-weight: 500; color: var(--color-text-2); }
.cal-cell.today .cal-num { color: var(--color-gold-3); font-weight: 600; }
.cal-dot { position: absolute; bottom: 8px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--color-gold); color: #0A0908; font-family: var(--font-ui); font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 700px) { .cal-cell { padding: 5px; } .cal-num { font-size: 12px; } .cal-dot { min-width: 14px; height: 14px; font-size: 8px; bottom: 4px; right: 4px; } }

/* utility */
.nowrap { white-space: nowrap; }
.tc { text-align: center; } .tr { text-align: right; }
.muted { color: var(--color-text-3); }
.fw6 { font-weight: 600; } .fw7 { font-weight: 700; }
.fs-sm { font-size: 12px; } .fs-xs { font-size: 11px; }
.rel { position: relative; }
.clip { overflow: hidden; }
.pointer { cursor: pointer; }
.scrim-text { color: #F6F4EF; }
