  /* ============================================================
   N2B Platform  -  Global Stylesheet
   Theme engine: 7 contrast stops (data-theme) x 7 palettes (data-palette)
   Design: Neurodivergent-first. Calm by default.
   ============================================================ */

/* ------------------------------------------------------------ Theme stops ------------------------------------------------------------ */
:root,
[data-theme="2"] {
  --bg:           #F5F3EF;
  --surface:      #EDEBE7;
  --surface-up:   #E5E3DF;
  --border:       #D0CDC8;
  --text:         #2d2d2d;
  --text-2:       #555;
  --text-muted:   #888;
  --accent:       #b45309;
  --accent-hover: #92400e;
  --accent-muted: #fef3c7;
  --success:      #15803d;
  --warning:      #b45309;
  --error:        #b91c1c;
  --focus:        #b45309;
  --code-bg:      #E0DDD9;
  --scrollbar:    #C0BDB8;
}

[data-theme="1"] {
  --bg:           #FFFFFF;
  --surface:      #F3F3F3;
  --surface-up:   #E8E8E8;
  --border:       #D0D0D0;
  --text:         #1a1a1a;
  --text-2:       #444;
  --text-muted:   #777;
  --accent:       #d97706;
  --accent-hover: #b45309;
  --accent-muted: #fef9ee;
  --success:      #166534;
  --warning:      #92400e;
  --error:        #991b1b;
  --focus:        #d97706;
  --code-bg:      #EBEBEB;
  --scrollbar:    #CCC;
}
[data-theme="3"] {
  --bg:           #E8E4DD;
  --surface:      #DDD9D2;
  --surface-up:   #D4D0C9;
  --border:       #BDB9B2;
  --text:         #3d3d3d;
  --text-2:       #5a5a5a;
  --text-muted:   #888;
  --accent:       #92400e;
  --accent-hover: #78350f;
  --accent-muted: #fef3c7;
  --success:      #14532d;
  --warning:      #92400e;
  --error:        #7f1d1d;
  --focus:        #92400e;
  --code-bg:      #D0CCC5;
  --scrollbar:    #B5B1AA;
}
[data-theme="4"] {
  --bg:           #2A2A32;
  --surface:      #333340;
  --surface-up:   #3d3d4a;
  --border:       #4a4a5a;
  --text:         #C8C4BC;
  --text-2:       #A8A4A0;
  --text-muted:   #777;
  --accent:       #f59e0b;
  --accent-hover: #fbbf24;
  --accent-muted: #451a03;
  --success:      #4ade80;
  --warning:      #f59e0b;
  --error:        #f87171;
  --focus:        #f59e0b;
  --code-bg:      #22222a;
  --scrollbar:    #4a4a5a;
}
[data-theme="5"] {
  --bg:           #1A1A22;
  --surface:      #22222c;
  --surface-up:   #2c2c38;
  --border:       #3a3a48;
  --text:         #D4D0C8;
  --text-2:       #A8A4A0;
  --text-muted:   #666;
  --accent:       #fbbf24;
  --accent-hover: #fcd34d;
  --accent-muted: #3b1a00;
  --success:      #4ade80;
  --warning:      #fbbf24;
  --error:        #f87171;
  --focus:        #fbbf24;
  --code-bg:      #131318;
  --scrollbar:    #3a3a48;
}
[data-theme="6"] {
  --bg:           #111116;
  --surface:      #18181e;
  --surface-up:   #212128;
  --border:       #303038;
  --text:         #B0ACA4;
  --text-2:       #908C88;
  --text-muted:   #555;
  --accent:       #f59e0b;
  --accent-hover: #fbbf24;
  --accent-muted: #2d1500;
  --success:      #4ade80;
  --warning:      #f59e0b;
  --error:        #f87171;
  --focus:        #f59e0b;
  --code-bg:      #0c0c10;
  --scrollbar:    #303038;
}
[data-theme="7"] {
  --bg:           #0A0A0D;
  --surface:      #111114;
  --surface-up:   #18181c;
  --border:       #252528;
  --text:         #8A8680;
  --text-2:       #706c68;
  --text-muted:   #484440;
  --accent:       #d97706;
  --accent-hover: #f59e0b;
  --accent-muted: #1c0f00;
  --success:      #22c55e;
  --warning:      #d97706;
  --error:        #ef4444;
  --focus:        #d97706;
  --code-bg:      #060608;
  --scrollbar:    #252528;
}

/* ------------------------------------------------------------ Color Palettes ------------------------------------------------------------
   data-palette="brand"      Brand Blue #1E88B0 (default)
   data-palette="indigo"     Indigo #5B4FE0
   data-palette="green"      Matte Green #3E7A5E
   data-palette="obsidian"   Obsidian #1F2430
   data-palette="mustard"    Mustard #C89B2A
   data-palette="terracotta" Terracotta #B5563A
   data-palette="plum"       Plum #6B2E5B
   Legacy aliases remain mapped for older saved preferences.
   ------------------------------------------------------------ */

[data-palette="brand"],
[data-palette="default"] {
  --accent:       #1E88B0;
  --accent-hover: #176D8D;
  --accent-muted: #D9EEF5;
  --focus:        #1E88B0;
}
[data-palette="brand"][data-theme="3"],
[data-palette="default"][data-theme="3"] {
  --accent:       #1B7598;
  --accent-hover: #155C77;
  --accent-muted: #CAE8F1;
  --focus:        #1B7598;
}
[data-palette="brand"][data-theme="4"],
[data-palette="brand"][data-theme="5"],
[data-palette="brand"][data-theme="6"],
[data-palette="brand"][data-theme="7"],
[data-palette="default"][data-theme="4"],
[data-palette="default"][data-theme="5"],
[data-palette="default"][data-theme="6"],
[data-palette="default"][data-theme="7"] {
  --accent:       #68BCD6;
  --accent-hover: #84CAE0;
  --accent-muted: #0E2C38;
  --focus:        #68BCD6;
}

[data-palette="indigo"] {
  --accent:       #5B4FE0;
  --accent-hover: #463BBE;
  --accent-muted: #E5E2FB;
  --focus:        #5B4FE0;
}
[data-palette="indigo"][data-theme="3"] {
  --accent:       #4D43BE;
  --accent-hover: #3D3599;
  --accent-muted: #D8D4F8;
  --focus:        #4D43BE;
}
[data-palette="indigo"][data-theme="4"],
[data-palette="indigo"][data-theme="5"],
[data-palette="indigo"][data-theme="6"],
[data-palette="indigo"][data-theme="7"] {
  --accent:       #8A82F1;
  --accent-hover: #A49DF6;
  --accent-muted: #221C53;
  --focus:        #8A82F1;
}

[data-palette="green"] {
  --accent:       #3E7A5E;
  --accent-hover: #2F6049;
  --accent-muted: #DDEDE4;
  --focus:        #3E7A5E;
}
[data-palette="green"][data-theme="3"] {
  --accent:       #35674F;
  --accent-hover: #284E3D;
  --accent-muted: #D0E5D8;
  --focus:        #35674F;
}
[data-palette="green"][data-theme="4"],
[data-palette="green"][data-theme="5"],
[data-palette="green"][data-theme="6"],
[data-palette="green"][data-theme="7"] {
  --accent:       #78AE90;
  --accent-hover: #91BDA1;
  --accent-muted: #11271D;
  --focus:        #78AE90;
}

[data-palette="obsidian"],
[data-palette="slate"] {
  --accent:       #1F2430;
  --accent-hover: #141923;
  --accent-muted: #E1E4E9;
  --focus:        #1F2430;
}
[data-palette="obsidian"][data-theme="3"],
[data-palette="slate"][data-theme="3"] {
  --accent:       #2A3140;
  --accent-hover: #1D2230;
  --accent-muted: #D7DBE2;
  --focus:        #2A3140;
}
[data-palette="obsidian"][data-theme="4"],
[data-palette="obsidian"][data-theme="5"],
[data-palette="obsidian"][data-theme="6"],
[data-palette="obsidian"][data-theme="7"],
[data-palette="slate"][data-theme="4"],
[data-palette="slate"][data-theme="5"],
[data-palette="slate"][data-theme="6"],
[data-palette="slate"][data-theme="7"] {
  --accent:       #9AA4B5;
  --accent-hover: #B2BAC7;
  --accent-muted: #171B24;
  --focus:        #9AA4B5;
}

[data-palette="mustard"],
[data-palette="adobe"] {
  --accent:       #C89B2A;
  --accent-hover: #A87F1F;
  --accent-muted: #F4EBCF;
  --focus:        #C89B2A;
}
[data-palette="mustard"][data-theme="3"],
[data-palette="adobe"][data-theme="3"] {
  --accent:       #AF881F;
  --accent-hover: #8D6D18;
  --accent-muted: #EEE1BE;
  --focus:        #AF881F;
}
[data-palette="mustard"][data-theme="4"],
[data-palette="mustard"][data-theme="5"],
[data-palette="mustard"][data-theme="6"],
[data-palette="mustard"][data-theme="7"],
[data-palette="adobe"][data-theme="4"],
[data-palette="adobe"][data-theme="5"],
[data-palette="adobe"][data-theme="6"],
[data-palette="adobe"][data-theme="7"] {
  --accent:       #E0C15C;
  --accent-hover: #E8CF80;
  --accent-muted: #372B0C;
  --focus:        #E0C15C;
}

[data-palette="terracotta"],
[data-palette="red"] {
  --accent:       #B5563A;
  --accent-hover: #93442D;
  --accent-muted: #F2DDD6;
  --focus:        #B5563A;
}
[data-palette="terracotta"][data-theme="3"],
[data-palette="red"][data-theme="3"] {
  --accent:       #9E4B33;
  --accent-hover: #803C29;
  --accent-muted: #EBD0C7;
  --focus:        #9E4B33;
}
[data-palette="terracotta"][data-theme="4"],
[data-palette="terracotta"][data-theme="5"],
[data-palette="terracotta"][data-theme="6"],
[data-palette="terracotta"][data-theme="7"],
[data-palette="red"][data-theme="4"],
[data-palette="red"][data-theme="5"],
[data-palette="red"][data-theme="6"],
[data-palette="red"][data-theme="7"] {
  --accent:       #D68971;
  --accent-hover: #E1A08D;
  --accent-muted: #34170E;
  --focus:        #D68971;
}

[data-palette="plum"] {
  --accent:       #6B2E5B;
  --accent-hover: #552549;
  --accent-muted: #E7D9E2;
  --focus:        #6B2E5B;
}
[data-palette="plum"][data-theme="3"] {
  --accent:       #5B274D;
  --accent-hover: #461E3B;
  --accent-muted: #DDCCD8;
  --focus:        #5B274D;
}
[data-palette="plum"][data-theme="4"],
[data-palette="plum"][data-theme="5"],
[data-palette="plum"][data-theme="6"],
[data-palette="plum"][data-theme="7"] {
  --accent:       #A17197;
  --accent-hover: #B58AAC;
  --accent-muted: #26101F;
  --focus:        #A17197;
}

/* ------------------------------------------------------------ Reset & base ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: 'League Spartan', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  background: var(--bg);
  color: var(--text);
  transition: background 150ms ease, color 150ms ease;
  -webkit-font-smoothing: antialiased;
}

.n2b-icon {
  display: inline-block;
  vertical-align: -0.18em;
  flex-shrink: 0;
}
.n2b-icon-file {
  background: currentColor;
  -webkit-mask: var(--n2b-icon-url) center / contain no-repeat;
  mask: var(--n2b-icon-url) center / contain no-repeat;
}

/* League Spartan for headings & logo */
.page-title, .auth-title, h1, h2, h3,
.sidebar-logo-text, .onboarding-card h2 {
  font-family: 'League Spartan', system-ui, sans-serif;
  letter-spacing: -0.02em;
}

.brand-logo-full {
  display: block;
  width: 140%;
  aspect-ratio: 857 / 329;
  background: currentColor;
  -webkit-mask: url('/logobw.webp') center / contain no-repeat;
  mask: url('/logobw.webp') center / contain no-repeat;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* ------------------------------------------------------------ Scrollbar ------------------------------------------------------------ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 3px; }

/* ------------------------------------------------------------ Cards ------------------------------------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 150ms;
}
.card:hover { border-color: var(--accent); }
.card-header {
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 13px;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-muted); cursor: pointer;
  user-select: none;
}
.card-header:hover { color: var(--text); }
.card-body { padding: 16px 18px; }
.card-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  font-size: 13px; color: var(--text-muted);
}

/* ------------------------------------------------------------ Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 6px;
  font-size: 14px; font-weight: 500;
  cursor: pointer; border: none;
  transition: background 120ms, opacity 120ms;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent); color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }
.btn-secondary {
  background: var(--surface-up);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); text-decoration: none; }
.btn-ghost {
  background: none; color: var(--accent); padding: 6px 10px;
}
.btn-ghost:hover { background: var(--accent-muted); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm,
.btn-small { padding: 5px 12px; font-size: 13px; }

/* ------------------------------------------------------------ Theme slider ------------------------------------------------------------ */
.theme-control {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; color: var(--text-muted);
}
.theme-slider {
  -webkit-appearance: none; appearance: none;
  width: 130px; height: 6px;
  background: linear-gradient(to right, var(--accent) 0%, var(--border) 100%);
  border-radius: 3px; cursor: pointer; outline: none;
}
.theme-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  cursor: pointer;
}
.theme-slider::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  cursor: pointer;
}
.theme-slider:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* ------------------------------------------------------------ Forms ------------------------------------------------------------ */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 13px; font-weight: 500;
  margin-bottom: 6px; color: var(--text-2);
}
.form-input {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  transition: border-color 150ms, box-shadow 150ms;
  outline: none;
}
.form-input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent);
}
.form-input::placeholder { color: var(--text-muted); }
.form-select {
  appearance: auto;
  -webkit-appearance: menulist;
  -moz-appearance: menulist;
  background-image: none;
  padding-right: 12px;
  line-height: 1.2;
}
.form-error { font-size: 13px; color: var(--error); margin-top: 5px; }

.turnstile-widget-slot {
  display: flex;
  justify-content: center;
  margin: 0 0 14px;
  min-height: 65px;
}

.turnstile-widget-slot.hidden,
.turnstile-widget-slot:empty {
  display: none;
  min-height: 0;
  margin: 0;
}
.form-hint  { font-size: 13px; color: var(--text-muted); margin-top: 5px; }

/* ------------------------------------------------------------ Tags / badges ------------------------------------------------------------ */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600;
  background: var(--surface-up); color: var(--text-2);
}
.badge-accent { background: var(--accent-muted); color: var(--accent); }
.badge-success { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.badge-error   { background: color-mix(in srgb, var(--error) 15%, transparent); color: var(--error); }
.badge-muted   { background: color-mix(in srgb, var(--border) 85%, transparent); color: var(--text-muted); }

/* ------------------------------------------------------------ Progress bar ------------------------------------------------------------ */
.progress { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 400ms ease; }
.progress.green .progress-fill  { background: var(--success); }
.progress.amber .progress-fill  { background: var(--warning); }
.progress.red .progress-fill    { background: var(--error); }

/* ------------------------------------------------------------ Auth page ------------------------------------------------------------ */
.auth-page {
  width: 100%; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 24px;
}
.auth-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 40px;
  width: 100%; max-width: 420px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.auth-logo {
  text-align: center; margin-bottom: 28px;
}
.auth-logo-link {
  display: inline-flex;
  justify-content: center;
  color: inherit;
  text-decoration: none;
}
.auth-logo-wordmark {
  display: flex; justify-content: center;
  margin-bottom: 16px;
  color: var(--accent);
}
.auth-logo-wordmark .brand-logo-full {
  width: 200px;
}
.auth-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.auth-sub   { font-size: 14px; color: var(--text-muted); }
.auth-oauth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  font-size: 12px;
  color: var(--text-muted);
}
.auth-oauth-divider::before,
.auth-oauth-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}
.auth-footer { margin-top: 18px; text-align: center; font-size: 13px; color: var(--text-muted); }
.auth-display-controls {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.auth-display-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.auth-display-row--zoom {
  margin-top: 16px;
}
.auth-display-icon {
  min-width: 22px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  color: var(--text-muted);
}
.auth-slider-wrap {
  position: relative;
  width: min(170px, 100%);
}
.auth-slider-wrap .theme-slider {
  width: 100%;
}
.auth-display-label {
  margin-top: 6px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}
.public-legal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 18px;
  margin-top: 24px;
  font-size: 12px;
}
.public-legal-footer--landing {
  justify-content: flex-end;
  margin-top: 0;
}
.public-legal-footer a,
.public-footer-cookie-btn {
  color: var(--text-muted);
  text-decoration: none;
}
.public-footer-cookie-btn {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.public-legal-footer a:hover,
.public-footer-cookie-btn:hover {
  color: var(--text);
  text-decoration: underline;
}

.legal-page {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  padding: 24px;
}
.legal-header {
  max-width: 980px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.legal-logo-link {
  width: 120px;
  border: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
}
.legal-nav-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.legal-nav-links a {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.legal-nav-links a[aria-current="page"],
.legal-nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}
.legal-shell {
  max-width: 980px;
  margin: 0 auto;
}
.legal-hero {
  margin-bottom: 16px;
}
.legal-eyebrow,
.legal-section-index,
.legal-updated {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.legal-title {
  font-size: clamp(30px, 5vw, 48px);
  font-weight: 800;
  line-height: 0.95;
  margin: 14px 0 12px;
}
.legal-subtitle {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-2);
  margin-bottom: 16px;
}
.legal-sections {
  display: grid;
  gap: 14px;
}
.legal-section-card .card-body {
  padding: 22px 24px;
}
.legal-section-index {
  margin-bottom: 10px;
}
.legal-section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}
.legal-section-body {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-2);
}
.legal-footer-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 20px;
}
.public-legal-footer--legal {
  max-width: 980px;
  margin: 24px auto 0;
}

/* ------------------------------------------------------------ Tables ------------------------------------------------------------ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; padding: 10px 14px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
td { padding: 12px 14px; border-bottom: 1px solid var(--surface-up); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-up); }

/* ------------------------------------------------------------ Empty state ------------------------------------------------------------ */
.empty-state {
  text-align: center;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 36px; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; color: var(--text); margin-bottom: 6px; }

/* ------------------------------------------------------------ Loading spinner ------------------------------------------------------------ */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.n2b-boot-loader,
.n2b-loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  color: var(--text-muted);
}

.n2b-boot-loader {
  min-height: 100vh;
  padding: 24px;
  opacity: 0.5;
}

.n2b-loading-state {
  min-height: 180px;
  padding: 40px 16px;
}

.n2b-boot-loader-label,
.n2b-loading-state-label {
  font-size: 14px;
  letter-spacing: 0.05em;
}

.n2b-boot-loader .spinner,
.n2b-loading-state .spinner {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

.n2b-inline-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.n2b-inline-spinner.is-compact {
  padding: 16px;
}

/* ------------------------------------------------------------ Page header ------------------------------------------------------------ */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
}
.page-title { font-size: 24px; font-weight: 700; line-height: 110% }
.page-sub   { font-size: 14px; color: var(--text-muted); margin-top: 2px; }

/* ------------------------------------------------------------ Onboarding card ------------------------------------------------------------ */
.onboarding-card {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin: 0 auto;
  max-width: 500px;
}
.onboarding-card h2 { font-size: 22px; margin-bottom: 8px; }
.onboarding-card p  { color: var(--text-muted); margin-bottom: 24px; }

/* ------------------------------------------------------------ Status dots ------------------------------------------------------------ */
.status-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; vertical-align: middle; margin-right: 6px;
}
.dot-green  { background: var(--success); }
.dot-amber  { background: var(--warning); }
.dot-red    { background: var(--error); }
.dot-grey   { background: var(--text-muted); }
.dot-blue   { background: #3b82f6; }

/* ------------------------------------------------------------ Rank badges ------------------------------------------------------------ */
.rank { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; }

/* ------------------------------------------------------------ Toast notifications ------------------------------------------------------------ */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 1000; pointer-events: none;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  pointer-events: all;
  animation: slide-in 200ms ease;
  max-width: 320px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--error); }
@keyframes slide-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }


/* Public/auth responsive rules that stay with the base stylesheet. */
@media (max-width: 768px) {
  .auth-box { padding: 24px 20px; }
}

/* ------------------------------------------------------------ Utility ------------------------------------------------------------ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.font-bold { font-weight: 700; }
.hidden { display: none !important; }
.w-full { width: 100%; }


/* ------------------------------------------------------------ Markdown rendered body ------------------------------------------------------------ */
.md-body { line-height: 1.7; color: var(--text); }
.md-body h1, .md-body h2, .md-body h3, .md-body h4 { margin: 1.2em 0 0.4em; font-weight: 600; line-height: 1.3; }
.md-body h1 { font-size: 1.6em; }
.md-body h2 { font-size: 1.3em; }
.md-body h3 { font-size: 1.1em; }
.md-body p  { margin: 0 0 0.9em; }
.md-body ul, .md-body ol { margin: 0 0 0.9em 1.4em; }
.md-body li { margin-bottom: 0.3em; }
.md-body a  { color: var(--accent); text-decoration: underline; }
.md-body code { background: var(--surface-2, rgba(0,0,0,.06)); padding: 0.15em 0.4em; border-radius: 3px; font-size: 0.88em; font-family: monospace; }
.md-body pre { background: var(--surface-2, rgba(0,0,0,.06)); padding: 14px 16px; border-radius: 6px; overflow-x: auto; margin: 0 0 0.9em; }
.md-body pre code { background: none; padding: 0; font-size: 0.85em; }
.md-body blockquote { border-left: 3px solid var(--accent); margin: 0 0 0.9em; padding: 6px 14px; color: var(--text-muted); }
.md-body hr { border: none; border-top: 1px solid var(--border); margin: 1.2em 0; }
.md-body img { max-width: 100%; border-radius: 4px; }
.md-body table { border-collapse: collapse; width: 100%; margin-bottom: 0.9em; }
.md-body th, .md-body td { border: 1px solid var(--border); padding: 6px 12px; text-align: left; }
.md-body th { background: var(--surface); font-weight: 600; }
