/*
Project: Thronestead©
Subsystem: UI Template Layout
File: thronestead.css
Version: 1.7.2026.04.03
Status: Canonical (Production Release)
*/

:root{
  --bg0:#0b0c0e;
  --bg1:#101113;
  --bg2:#15171b;

  --panel:#14161a;
  --panel2:#101215;

  --line:#23262e;
  --line2:#2e323c;

  --text-primary:#ece8de;
  --text-secondary:#d2cabb;
  --text-muted:#b9ad98;
  --text-soft:#c7bcaa;
  --text-disabled:#918778;
  --text-inverse:#121416;
  --text-link:#e4c17d;
  --text-link-hover:#f0d7a1;
  --text-danger:#ff9f9f;
  --text-success:#8ee7b6;
  --text-warning:#f3cc7f;
  --heading-color:#f6efe2;
  --body-color:#ddd1bb;
  --caption-color:#b7aa94;

  --text:var(--body-color);
  --muted:var(--text-muted);
  --faint:var(--text-disabled);

  --gold:#d9b46a;
  --gold2:#b99245;
  --amber:#f2c14e;

  --safe:#39d98a;
  --warn:#ffcc66;
  --danger:#ff5c5c;
  --accent:#6aa6ff;

  --shadow: var(--shadow-lg, 0 18px 44px rgba(0,0,0,.45));
  --shadow2: var(--shadow-md, 0 10px 24px rgba(0,0,0,.35));

  --r8:8px;
  --r10:10px;
  --r12:12px;
  --r14:14px;
  --r16:16px;
  --r18:18px;
  --r20:20px;

  /* Semantic radius aliases */
  --radius-sm: var(--r10);
  --radius: var(--r14);
  --radius-lg: var(--r18);
  --radius-pill: 999px;

  /* Unified shadow system */
  --shadow-sm: 0 6px 18px rgba(0,0,0,.30);
  --shadow-md: 0 10px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 18px 44px rgba(0,0,0,.45);
  --shadow-glow-gold: 0 14px 34px rgba(217,180,106,.14);

  /* Semantic surface tokens */
  --surface-low: rgba(255,255,255,.02);
  --surface-mid: rgba(255,255,255,.04);
  --surface-high: rgba(255,255,255,.06);
  --surface-hover: rgba(255,255,255,.06);
  --surface-inset: rgba(0,0,0,.18);
  --border-subtle: rgba(255,255,255,.08);
  --border-mid: rgba(255,255,255,.10);
  --border-strong: rgba(255,255,255,.16);

  /* Gold / accent surface helpers */
  --gold-border: rgba(217,180,106,.18);
  --gold-border-hover: rgba(217,180,106,.28);
  --gold-bg: rgba(217,180,106,.10);
  --gold-bg-strong: rgba(217,180,106,.16);
  --accent-border: rgba(106,166,255,.18);
  --accent-bg: rgba(106,166,255,.06);
  --safe-border: rgba(57,217,138,.28);
  --safe-bg: rgba(57,217,138,.08);

  --font-ui: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --font-display: Cinzel, ui-serif, Georgia, serif;
  --font-ornate: "IM Fell English SC", var(--font-display);

  --focus: 0 0 0 3px rgba(106,166,255,.35), 0 0 0 1px rgba(106,166,255,.65) inset;

  /* Shared shell spacing rhythm (14px anchor) */
  --space-micro: 6px;
  --space-control: 10px;
  --space-shell: 14px;
  --space-section: 20px;
  --space-major: 28px;

  /* Global spacing token ladder */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;

  /* Standardized surfaced-container padding (mobile first) */
  --container-pad-sm: var(--space-3);
  --container-pad-md: var(--space-4);
  --container-pad-lg: var(--space-4);
  --container-content-gap: var(--space-4);

  --gap-tight: var(--space-micro);
  --gap-control: var(--space-control);
  --pad-panel: var(--space-shell);
  --gutter-shell: var(--space-shell);
  --stack-section: var(--space-section);
  --stack-major: var(--space-major);
  --shell-footer-height: 56px;
  --shell-footer-safe-area: env(safe-area-inset-bottom, 0px);
  --shell-footer-reserve: calc(var(--shell-footer-height) + var(--shell-footer-safe-area));

  --leather:
    radial-gradient(1200px 560px at 22% -10%, rgba(217,180,106,.14), transparent 60%),
    radial-gradient(900px 520px at 90% 10%, rgba(106,166,255,.10), transparent 62%),
    radial-gradient(700px 520px at 50% 120%, rgba(57,217,138,.08), transparent 60%),
    linear-gradient(180deg, rgba(18,16,13,.92), rgba(12,12,14,.92));
  --grain:
    repeating-linear-gradient(45deg, rgba(255,255,255,.016) 0 2px, rgba(0,0,0,.016) 2px 4px);
}


@media (min-width: 768px){
  :root{
    --container-pad-md: var(--space-5);
    --container-pad-lg: var(--space-5);
  }
}

@media (min-width: 1100px){
  :root{
    --container-pad-md: var(--space-5);
    --container-pad-lg: var(--space-6);
  }
}

/* Base */
*{ box-sizing:border-box; }
html,body{
  width:100%;
  min-height:100%;
  height:auto;
}
body{
  margin:0;
  font-family:var(--font-ui);
  color:var(--body-color);
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(217,180,106,.16), transparent 60%),
    radial-gradient(900px 500px at 85% 0%, rgba(106,166,255,.10), transparent 60%),
    radial-gradient(800px 600px at 50% 120%, rgba(57,217,138,.08), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 35%, var(--bg0));
  overflow-x:hidden;
}

a{ color:var(--text-link); text-decoration:none; }
a:hover{ color:var(--text-link-hover); text-decoration:underline; text-underline-offset: 3px; }
button{ font-family:inherit; }
h1, h2, h3, h4, h5, h6 { color: var(--heading-color); }
p, li, td, th, label, input, select, textarea, .body-copy { color: var(--body-color); }
small, .caption, .helper, .meta, ::placeholder { color: var(--caption-color); }

.sr-only{
  position:absolute !important;
  width:1px; height:1px;
  padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0);
  white-space:nowrap; border:0;
}

.skip-link{
  position:absolute;
  left:12px; top:12px;
  padding:10px 12px;
  border-radius:var(--r10);
  background:rgba(0,0,0,.85);
  border:1px solid var(--line);
  color:var(--text);
  transform:translateY(-140%);
  transition:transform .18s ease;
  z-index:9999;
}
.skip-link:focus,
.skip-link:focus-visible{ transform:translateY(0); outline:none; box-shadow:var(--focus); }

/* Scrollbars */
*::-webkit-scrollbar{ height:10px; width:10px; }
*::-webkit-scrollbar-thumb{
  background:linear-gradient(180deg, rgba(217,180,106,.38), rgba(217,180,106,.18));
  border:1px solid rgba(0,0,0,.35);
  border-radius:999px;
}
*::-webkit-scrollbar-track{ background:rgba(255,255,255,.04); border-radius:999px; }

/* Utility */
.muted{ color:var(--text-muted); }
.sep{ opacity:.45; margin:0 8px; }
.w-full{ width:100%; }
.t-right{ text-align:right; }
.stack-tight{ display:flex; flex-direction:column; gap:var(--gap-tight); }
.stack-section{ display:flex; flex-direction:column; gap:var(--stack-section); }
.action-row{ display:flex; align-items:center; gap:var(--gap-control); flex-wrap:wrap; }

.mt-8{ margin-top:8px; }
.mt-10{ margin-top:10px; }
.mb-10{ margin-bottom:10px; }
.mt-24{ margin-top:24px; }
.prewrap{ white-space:pre-wrap; }
.prewrap-block{ white-space:pre-wrap; margin-top:10px; }
.inline-row{ display:flex; gap:8px; }
.inline-row-wrap{ display:flex; gap:8px; flex-wrap:wrap; }
.inline-row-wrap.align-center{ align-items:center; }
.inline-row-end{ display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.inline-row-end.mt-10{ margin-top:10px; }
.gameplay-loop-nav{ display:flex; gap:6px; flex-wrap:wrap; align-items:center; margin-bottom:12px; font-size:13px; }
.arrow-faded{ opacity:.4; }
.token__barFill--zero{ width:0%; }
.onboarding-tips-list{ margin:0; padding-left:1.2em; }
.inset-stack{ display:flex; flex-direction:column; gap:8px; }
.queue-sync{ border-radius:var(--radius); border:1px solid var(--border-subtle); background:rgba(0,0,0,.12); padding:var(--space-control) var(--space-3); }
.queue-sync__summary{ cursor:pointer; color:var(--text-primary); font-weight:800; }
.queue-sync__body{ padding-top:10px; color:var(--text-secondary); font-size:13px; line-height:1.35; }
.narrow-input{ width:90px; }
.btn-back--inline{ margin-left:8px; }

/* Pills / badges */
.pill{
  display:inline-flex;
  align-items:center;
  gap:var(--space-2);
  padding:var(--space-micro) var(--space-control);
  border-radius:var(--radius-pill);
  border:1px solid var(--border-mid);
  background: var(--surface-mid);
  color:var(--text);
  font-size:12px;
  line-height:1;
  white-space:nowrap;
}
.pill--gold{ border-color: rgba(217,180,106,.30); background: rgba(217,180,106,.10); }
.pill--accent{ border-color: rgba(106,166,255,.35); background: rgba(106,166,255,.10); }
.pill--safe{ border-color: rgba(57,217,138,.35); background: rgba(57,217,138,.10); }
.pill--warn{ border-color: rgba(255,204,102,.35); background: rgba(255,204,102,.10); }

.dot{ width:8px; height:8px; border-radius:999px; display:inline-block; }
.dot--safe{ background:var(--safe); box-shadow: 0 0 0 2px rgba(57,217,138,.16); }

.badge{
  position:absolute;
  top:-6px; right:-6px;
  min-width:18px;
  height:18px;
  padding:0 6px;
  border-radius:999px;
  background: rgba(255,92,92,.95);
  border:1px solid rgba(0,0,0,.5);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  font-weight:900;
  color:#0b0c0e;
}
.badge--muted{ background: rgba(217,180,106,.95); }

/* Panels */
.panel{
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)),
    radial-gradient(900px 320px at 25% 0%, rgba(217,180,106,.10), transparent 60%),
    radial-gradient(700px 360px at 85% 10%, rgba(106,166,255,.07), transparent 64%),
    linear-gradient(180deg, var(--panel), var(--panel2));
  border:1px solid var(--border-subtle);
  border-radius: var(--r16);
  box-shadow: var(--shadow-md);
  overflow:hidden;
  position:relative;
}
.panel::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background: linear-gradient(90deg, transparent, rgba(217,180,106,.08), transparent);
  opacity:.35;
  mix-blend-mode:screen;
}
.panel__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:var(--container-pad-md) var(--container-pad-lg) var(--space-3);
  border-bottom:1px solid rgba(255,255,255,.06);
}
.panel__link{
  color:var(--muted);
  font-size:12px;
  text-decoration:none;
  padding:6px 8px;
  border-radius:10px;
  border:1px solid transparent;
}
.panel__link:hover{
  border-color: rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  text-decoration:none;
}
.panel__foot{
  padding:var(--container-pad-md) var(--container-pad-lg);
  border-top:1px solid rgba(255,255,255,.06);
}

/* Surface spacing normalization */
:is(
  .card,
  .module,
  .widget,
  .stat-box,
  .boxed-section,
  .form-group,
  .content-well,
  .side-panel,
  .dashboard-block,
  .queuecard,
  .split__card,
  .feeditem,
  .note,
  .status-block,
  .table-wrap,
  .tablewrap,
  .ts-modal__body,
  .ts-inset-block
){
  padding: var(--container-pad-md);
}

.panel > :not(.panel__head):not(.panel__foot){
  margin: 0;
}

.panel > :not(.panel__head):not(.panel__foot):not(style) + :not(.panel__head):not(.panel__foot):not(style){
  margin-top: var(--container-content-gap);
}

.panel > :not(.panel__head):not(.panel__foot):first-child{
  padding-top: var(--container-pad-lg);
}

.panel > :not(.panel__head):not(.panel__foot){
  padding-inline: var(--container-pad-lg);
}

.panel > :not(.panel__head):not(.panel__foot):last-child{
  padding-bottom: var(--container-pad-lg);
}

.panel > .panel__head + *{
  padding-top: var(--container-pad-lg);
}

.panel > .panel__foot{
  margin-top: var(--container-content-gap);
}

:is(.panel,.card,.module,.widget,.table-wrap,.tablewrap,.ts-modal__body,.content-well,.boxed-section) > h1 + p,
:is(.panel,.card,.module,.widget,.table-wrap,.tablewrap,.ts-modal__body,.content-well,.boxed-section) > h2 + p,
:is(.panel,.card,.module,.widget,.table-wrap,.tablewrap,.ts-modal__body,.content-well,.boxed-section) > h3 + p,
:is(.panel,.card,.module,.widget,.table-wrap,.tablewrap,.ts-modal__body,.content-well,.boxed-section) > h4 + p,
:is(.panel,.card,.module,.widget,.table-wrap,.tablewrap,.ts-modal__body,.content-well,.boxed-section) > p + ul,
:is(.panel,.card,.module,.widget,.table-wrap,.tablewrap,.ts-modal__body,.content-well,.boxed-section) > p + ol,
:is(.panel,.card,.module,.widget,.table-wrap,.tablewrap,.ts-modal__body,.content-well,.boxed-section) > label + input,
:is(.panel,.card,.module,.widget,.table-wrap,.tablewrap,.ts-modal__body,.content-well,.boxed-section) > label + select,
:is(.panel,.card,.module,.widget,.table-wrap,.tablewrap,.ts-modal__body,.content-well,.boxed-section) > label + textarea,
:is(.panel,.card,.module,.widget,.table-wrap,.tablewrap,.ts-modal__body,.content-well,.boxed-section) > input + small,
:is(.panel,.card,.module,.widget,.table-wrap,.tablewrap,.ts-modal__body,.content-well,.boxed-section) > select + small,
:is(.panel,.card,.module,.widget,.table-wrap,.tablewrap,.ts-modal__body,.content-well,.boxed-section) > textarea + small,
:is(.panel,.card,.module,.widget,.table-wrap,.tablewrap,.ts-modal__body,.content-well,.boxed-section) > .section-title + *{
  margin-top: var(--space-3);
}

:is(.panel,.card,.module,.widget,.table-wrap,.tablewrap,.ts-modal__body,.content-well,.boxed-section) > .action-row,
:is(.panel,.card,.module,.widget,.table-wrap,.tablewrap,.ts-modal__body,.content-well,.boxed-section) > .hero__cta,
:is(.panel,.card,.module,.widget,.table-wrap,.tablewrap,.ts-modal__body,.content-well,.boxed-section) > .military-cta-row{
  margin-top: var(--space-4);
}

/* Typography */
.h1{
  margin:0;
  font-family:var(--font-ornate);
  font-size:24px;
  letter-spacing:.6px;
}
.h2{
  margin:0;
  font-family:var(--font-display);
  font-size:14px;
  letter-spacing:.6px;
  text-transform:uppercase;
  color: var(--text-primary);
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:var(--space-control);
  padding:var(--space-3) var(--space-shell);
  border-radius:var(--radius);
  border:1px solid var(--border-mid);
  background: var(--surface-mid);
  color: var(--text);
  font-weight:700;
  text-decoration:none;
  cursor:pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.btn:hover{
  text-decoration:none;
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.btn:active{ transform: translateY(0); }
.btn:focus-visible{ outline:none; box-shadow: var(--focus); }

.btn--primary{
  background:
    radial-gradient(220px 120px at 30% 20%, rgba(255,255,255,.18), transparent 55%),
    linear-gradient(180deg, rgba(242,193,78,.96), rgba(185,146,69,.96));
  border-color: rgba(0,0,0,.45);
  color: var(--text-inverse);
  box-shadow: var(--shadow-glow-gold);
}
.btn--primary:hover{ box-shadow: 0 18px 44px rgba(217,180,106,.18); }
.btn--ghost{ background: var(--surface-low); border-color: var(--border-mid); }
.btn--sm{ padding:9px var(--space-control); border-radius:var(--r12); font-size:12px; }

/* Icon buttons */
.iconbtn{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:38px;
  height:38px;
  border-radius:var(--r12);
  border:1px solid var(--border-mid);
  background: var(--surface-low);
  color: var(--text-primary);
  cursor:pointer;
  transition: background .12s ease, border-color .12s ease, transform .12s ease, box-shadow .12s ease;
}
.iconbtn:hover{
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.iconbtn:focus-visible{ outline:none; box-shadow: var(--focus); }

.iconbtn--metal{
  background:
    radial-gradient(160px 90px at 30% 20%, rgba(255,255,255,.12), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(0,0,0,.10));
  border-color: var(--gold-border);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.30), var(--shadow-md);
}

/* =========================
   Header (Simplified)
   ========================= */
.topbar{
  position:sticky;
  top:0;
  z-index:1000;
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border-subtle);
}
.topbar--v01{ background: var(--leather); }
.topbar--v01::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background: var(--grain);
  opacity:.55;
}
.topbar--v01::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:-1px;
  height:2px;
  background: linear-gradient(90deg, transparent, rgba(217,180,106,.55), transparent);
  opacity:.55;
}

.topbar__inner{
  max-width: none;
  margin:0;
  padding:calc(var(--gutter-shell) - 2px) var(--gutter-shell) var(--gap-control);
  position:relative;
  z-index:1;
}

.topbar__inner--simple{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}

.topbar__left{ display:flex; align-items:center; gap:12px; min-width:0; }
.brand{ display:flex; gap:12px; align-items:center; min-width:0; }
.brand__crest{
  width:42px;
  height:42px;
  border-radius:var(--r16);
  display:grid;
  place-items:center;
  color: var(--text-link);
  background:
    radial-gradient(120px 70px at 30% 20%, rgba(255,255,255,.14), transparent 60%),
    linear-gradient(180deg, var(--gold-bg-strong), rgba(0,0,0,.15));
  border:1px solid var(--gold-border-hover);
  box-shadow: var(--shadow-md), inset 0 0 0 1px rgba(0,0,0,.25);
}
.brand__text{ min-width:0; display:flex; flex-direction:column; }
.brand__name{
  font-family: var(--font-ornate);
  font-weight:700;
  letter-spacing:.7px;
  font-size:16px;
  line-height:1.05;
}
.brand__sub{
  font-size:12px;
  color: var(--muted);
  line-height:1.1;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width: 320px;
}

.realmbar{
  display:flex;
  gap:10px;
  align-items:center;
  margin-top:8px;
  flex-wrap:wrap;
}
.rchip{
  display:inline-flex;
  align-items:center;
  gap:var(--space-2);
  padding:var(--space-micro) var(--space-control);
  border-radius:var(--radius-pill);
  border:1px solid var(--border-mid);
  background: var(--surface-inset);
  color: var(--text-primary);
  font-size:12px;
}
.rchip--safe{
  border-color: var(--safe-border);
  background: var(--safe-bg);
}

.headactions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:var(--space-control);
  padding:var(--space-control);
  border-radius:var(--radius-lg);
  border:1px solid var(--gold-border);
  background:
    radial-gradient(520px 180px at 20% 0%, var(--gold-bg), transparent 60%),
    linear-gradient(180deg, var(--surface-mid), rgba(0,0,0,.10));
  box-shadow: var(--shadow-md), inset 0 0 0 1px rgba(0,0,0,.30);
}

.plaque{
  display:flex;
  align-items:center;
  gap:var(--space-control);
  padding:var(--space-2) var(--space-control);
  border-radius:var(--r16);
  border:1px solid var(--gold-border);
  background:
    radial-gradient(240px 120px at 30% 20%, rgba(255,255,255,.10), transparent 60%),
    linear-gradient(180deg, rgba(0,0,0,.10), rgba(0,0,0,.20));
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.30);
  min-width: 240px;
}
.plaque:hover{ text-decoration:none; border-color: var(--gold-border-hover); background: var(--surface-high); }
.plaque:focus-visible{ outline:none; box-shadow: var(--focus); }
.plaque__crown{
  width:34px; height:34px;
  border-radius:var(--radius);
  display:grid;
  place-items:center;
  background: var(--gold-bg);
  border:1px solid rgba(217,180,106,.22);
}
.plaque__txt{ display:flex; flex-direction:column; min-width:0; }
.plaque__name{ font-weight:900; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.plaque__meta{ font-size:11px; color: var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* Bottom ribbon (tick + resources) */
.topbar__ribbon{
  max-width: none;
  margin:0;
  padding:calc(var(--gap-control) - 2px) var(--gutter-shell) calc(var(--gutter-shell) - 2px);
  display:grid;
  grid-template-columns: auto 1fr;
  align-items:center;
  gap:12px;
  border-top:1px solid rgba(255,255,255,.06);
  position:relative;
  z-index:1;
}
.topbar__ribbon::before{
  content:"";
  position:absolute;
  left:var(--gutter-shell); right:var(--gutter-shell); top:-1px;
  height:1px;
  background: linear-gradient(90deg, transparent, rgba(217,180,106,.25), transparent);
  opacity:.8;
}

.ribbon__tick{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:var(--space-control);
  padding:calc(var(--gap-control) - 2px) var(--gap-control);
  border-radius:var(--radius);
  border:1px solid var(--border-subtle);
  background: rgba(0,0,0,.16);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
  white-space:nowrap;
}
.tickribbon__k{
  font-size:11px;
  color: var(--muted);
  text-transform:uppercase;
  letter-spacing:.5px;
}
.tickribbon__v{ font-size:12px; font-weight:900; color: var(--text-primary); }
.tickribbon__sep{ opacity:.45; }

/* Resources run along bottom bar; single row with horizontal scroll */
.ribbonresources{
  list-style:none;
  padding:0;
  margin:0;
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:nowrap;
  overflow-x:auto;
  overflow-y:hidden;
  min-width:0;
  scrollbar-width: thin;
}
.ribbonresources::-webkit-scrollbar{ height:8px; }
.ribbonresources::-webkit-scrollbar-thumb{ border-radius:999px; }

/* Tokens */
.token{
  display:grid;
  grid-template-columns: 18px auto auto;
  align-items:center;
  gap:var(--space-2);
  padding:7px var(--space-control);
  border-radius:var(--radius);
  border:1px solid var(--border-subtle);
  background: var(--surface-inset);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
  white-space:nowrap;
}
.token__i{ opacity:.92; }
.token__k{ font-size:11px; color: var(--muted); }
.token__v{ font-size:12px; font-weight:900; color: var(--text-primary); }

.token--compact{ padding:6px 9px; border-radius:var(--r12); }
.token--compact .token__k{ font-size:10.5px; }
.token--compact .token__v{ font-size:12px; }

.token--pop{ position:relative; }
.token__bar{
  grid-column: 1 / -1;
  height:6px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  overflow:hidden;
  margin-top:6px;
}
.token__barFill{
  display:block;
  height:100%;
  border-radius:999px;
  background: linear-gradient(90deg, rgba(57,217,138,.95), rgba(242,193,78,.55));
  box-shadow: 0 8px 18px rgba(57,217,138,.10);
}

/* Layout grid — strict two-column: sidenav | main */
.layout{
  max-width: 100%;
  margin: 0;
  padding: 0;
  display:grid;
  grid-template-columns: clamp(260px, 19vw, 304px) minmax(0, 1fr);
  min-height: 100vh;
  align-items:stretch;
}
.layout > .sidenav,
.layout > .layout__main{ min-width:0; }

/* Right column: topbar + content + footer stacked vertically */
.layout__main{
  display:flex;
  flex-direction:column;
  min-width:0;
  min-height:100vh;
}

/* Side nav — left column, sticky full-height */
.sidenav{ position:sticky; top:0; height:100vh; overflow-y:auto; padding-bottom:14px; align-self:start; border-right:1px solid var(--border-subtle); }
.sidenav__panel{ display:flex; flex-direction:column; min-height:100vh; }
.sidenav__head{ padding:var(--space-shell); border-bottom:1px solid rgba(255,255,255,.06); }
.sidenav__foot{ padding:var(--space-shell); margin-top:auto; border-top:1px solid rgba(255,255,255,.06); }

.idcard{ display:flex; gap:12px; align-items:center; }
.idcard__sigil{
  width:42px; height:42px;
  border-radius:16px;
  display:grid;
  place-items:center;
  background: rgba(106,166,255,.10);
  border:1px solid rgba(106,166,255,.22);
}
.idcard__name{ font-weight:900; font-size:13px; }
.idcard__meta{ color: var(--muted); font-size:12px; }

.idstats{ display:grid; grid-template-columns: 1fr 1fr 1fr; gap:10px; margin-top:12px; }
.kv{ display:flex; flex-direction:column; gap:6px; }
.kv__k{ color: var(--muted); font-size:11px; }
.kv__v{ font-weight:900; font-size:12px; }

.navlist{ display:flex; flex-direction:column; padding:10px; gap:6px; }
.navitem{
  display:flex;
  align-items:center;
  gap:var(--space-control);
  padding:var(--space-control);
  border-radius:var(--radius);
  border:1px solid transparent;
  color: var(--text-primary);
  text-decoration:none;
  font-weight:800;
  font-size:13px;
}
.navitem:hover{ background: var(--surface-mid); border-color: var(--border-subtle); text-decoration:none; }
.navitem.is-active{ background: var(--gold-bg); border-color: rgba(217,180,106,.25); }
.navitem__icon{ width:20px; text-align:center; opacity:.92; }

.navgroup{ border-radius:var(--radius); border:1px solid var(--border-subtle); background: var(--surface-low); overflow:hidden; }
.navgroup summary{
  cursor:pointer;
  list-style:none;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 10px;
  font-weight:900;
  user-select:none;
}
.navgroup summary::-webkit-details-marker{ display:none; }
.navgroup summary:hover{ background: var(--surface-mid); }
.navgroup__hint{ margin-left:auto; color: var(--muted); font-size:11px; font-weight:800; }
.navgroup__items{ display:flex; flex-direction:column; padding:6px 8px 10px; gap:4px; }
.navgroup .navitem{ font-weight:650; font-size:13px; padding:9px 10px; }

/* Content — fills right column below topbar */
.content{ min-width:0; width:100%; max-width:none; display:flex; flex-direction:column; gap:var(--stack-section); flex:1; padding:var(--gutter-shell); }
.banner{
  padding:var(--pad-panel);
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:0;
}
.banner__title{ font-family:var(--font-ornate); font-weight:700; letter-spacing:.6px; }
.banner__sub{ color: var(--muted); font-size:12px; margin-top:6px; max-width: 720px; }
.banner__right{ display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }

.hero{ padding:var(--pad-panel); margin-bottom:0; }
.hero__meta{ display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.chips{ display:flex; gap:10px; flex-wrap:wrap; margin-top:10px; }
.hero__stats{ display:grid; grid-template-columns: 1fr 1fr; gap:10px; min-width: 320px; }
.stat{ border-radius:var(--radius); border:1px solid var(--border-subtle); background: var(--surface-low); padding:var(--space-control); }
.stat__k{ color: var(--muted); font-size:11px; }
.stat__v{ font-weight:900; font-size:16px; margin-top:4px; }
.stat__s{ color: var(--faint); font-size:11px; margin-top:4px; }

.hero__progress{ margin-top:14px; padding-top:14px; border-top:1px solid rgba(255,255,255,.06); }
.progressrow{ display:flex; align-items:center; justify-content:space-between; gap:14px; }
.progressrow__label{ font-weight:900; font-size:13px; }
.progressrow__hint{ color: var(--muted); font-size:12px; margin-top:6px; }
.progressrow__right{ display:flex; align-items:center; gap:12px; min-width: 240px; }
.progressrow__pct{ font-weight:900; color: var(--text-primary); }

.hero__cta{ display:flex; gap:10px; flex-wrap:wrap; margin-top:12px; }

.progress{
  width:100%;
  height:14px;
  border-radius:var(--radius-pill);
  border:1px solid var(--border-mid);
  background: var(--surface-low);
  overflow:hidden;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.20);
}
.progress__bar{
  height:100%;
  border-radius:var(--radius-pill);
  background: linear-gradient(90deg, rgba(242,193,78,.98), rgba(106,166,255,.32));
  box-shadow: 0 12px 26px rgba(217,180,106,.12);
}
.progress--thin{ height:10px; }

/* Main cards grid */
.grid{ display:grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap:var(--gutter-shell); align-items:start; }
.panel--span2{ grid-column: span 2; }

.queuecards{ display:grid; grid-template-columns: 1fr; gap:10px; padding:14px; }
.queuecard{ border-radius:var(--r16); border:1px solid var(--border-subtle); background: var(--surface-low); padding:var(--space-3); }
.queuecard__top{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.queuecard__title{ display:flex; gap:10px; align-items:center; font-weight:900; }
.queuecard__icon{ opacity:.9; }
.queuecard__body{ margin-top:10px; }
.queuecard__main{ font-weight:900; }
.queuecard__sub{ color: var(--muted); font-size:12px; margin-top:6px; margin-bottom:10px; }
.queuecard__foot{ display:flex; gap:10px; margin-top:10px; }

/* Economy truth */
.truth{ padding:14px; display:flex; flex-direction:column; gap:10px; }
.truth__row{
  display:grid;
  grid-template-columns: 1fr auto;
  gap:var(--space-2);
  padding:var(--space-control);
  border-radius:var(--radius);
  border:1px solid var(--border-subtle);
  background: var(--surface-low);
}
.truth__k{ color: var(--muted); font-size:12px; }
.truth__v{ font-weight:900; }
.truth__s{ grid-column: 1 / -1; color: var(--faint); font-size:11px; }

.split{ display:grid; grid-template-columns: 1fr 1fr; gap:10px; padding:0 14px 14px; }
.split__card{ border-radius:var(--r16); border:1px solid var(--border-subtle); background: var(--surface-low); padding:var(--space-3); }
.split__title{ font-weight:900; margin-bottom:10px; }
.split__body{ display:flex; flex-direction:column; gap:10px; }

/* Tabs */
.tabs{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.tab{
  padding:var(--space-2) var(--space-control);
  border-radius:var(--radius-pill);
  border:1px solid var(--border-mid);
  background: var(--surface-low);
  color: var(--text-primary);
  font-weight:900;
  font-size:12px;
  cursor:pointer;
  transition: background .12s ease, border-color .12s ease;
}
.tab:hover{ background: var(--surface-hover); }
.tab:focus-visible{ outline:none; box-shadow: var(--focus); }
.tab.is-active{ background: rgba(217,180,106,.12); border-color: rgba(217,180,106,.30); color: var(--text-primary); }

/* Table */
.tablewrap{ padding: var(--container-pad-md); overflow-x:auto; overflow-y:visible; }
.table{ width:100%; border-collapse:separate; border-spacing:0; min-width: 860px; }
.table thead th{
  text-align:left;
  font-size:11px;
  color: var(--muted);
  font-weight:900;
  letter-spacing:.5px;
  text-transform:uppercase;
  padding:var(--space-control);
  border-bottom:1px solid var(--border-subtle);
}
.table tbody td{ padding:var(--space-3) var(--space-control); border-bottom:1px solid rgba(255,255,255,.06); vertical-align:top; }
.table tbody tr:hover td{ background: var(--surface-low); }
.celltitle{ display:flex; gap:10px; align-items:center; font-weight:900; }
.celltitle__icon{ opacity:.9; }
.cellsublabel{ color: var(--muted); font-size:12px; margin-top:6px; }

.note{
  display:flex;
  gap:var(--space-control);
  align-items:flex-start;
  padding:var(--space-3);
  border-radius:var(--r16);
  border:1px solid var(--accent-border);
  background: var(--accent-bg);
}
.note__icon{ opacity:.9; }
.note__text{ color: var(--text-primary); font-size:12px; line-height:1.35; }

/* Right sidebar — removed in strict two-column layout */
.rightbar{ display:none; }
.summary{ padding:14px; display:grid; grid-template-columns: 1fr 1fr; gap:10px; }
.mini{ padding:0 14px 14px; }
.mini__head{ font-weight:900; margin-bottom:8px; }
.checklist{ list-style:none; padding:0; margin:0 0 10px 0; display:flex; flex-direction:column; gap:8px; color: var(--text-primary); font-size:12px; }
.check{ width:18px; display:inline-block; color: var(--safe); font-weight:900; }
.check--off{ color: var(--text-disabled); }

.feed{ padding:14px; display:flex; flex-direction:column; gap:10px; }
.feeditem{ border-radius:var(--r16); border:1px solid var(--border-subtle); background: var(--surface-low); padding:var(--space-3); }
.feeditem__top{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:8px; }
.feeditem__time{ color: var(--muted); font-size:11px; }
.feeditem__body{ color: var(--text-primary); font-size:12px; line-height:1.35; }

.panel--patronage{ padding:var(--container-pad-lg); }
.panel--patronage p{ margin:8px 0 12px 0; }

/* Footer — inside right column */
body .footer{
  margin-top:auto;
  width:100%;
  max-width:none;
  padding:0 var(--gutter-shell) var(--shell-footer-safe-area);
  border-top:1px solid var(--border-subtle);
}
body .footer__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:var(--space-3);
  min-height:var(--shell-footer-height);
  max-width:none;
  margin:0;
  padding:var(--space-2) var(--space-shell);
}
body .footer__left{ display:flex; align-items:center; gap:8px; color: var(--muted); font-size:12px; }
body .footer__left a{ color: var(--text-primary); text-decoration:none; }
body .footer__left a:hover{ text-decoration:underline; }
body .footer__right{ display:flex; gap:10px; align-items:center; }

/* Mobile nav */
.mobilenav{
  position:fixed;
  left:var(--space-control); right:var(--space-control);
  bottom:var(--space-control);
  z-index:1200;
  display:none;
  gap:var(--space-control);
  padding:var(--space-control);
  border-radius:var(--radius-lg);
  border:1px solid var(--border-mid);
  background: rgba(10,11,13,.78);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-lg);
}
.mobilenav__item{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:var(--space-micro);
  padding:var(--space-control) var(--space-2);
  border-radius:var(--r16);
  border:1px solid transparent;
  background: var(--surface-low);
  text-decoration:none;
  font-weight:900;
  font-size:12px;
  transition: background .12s ease, border-color .12s ease;
}
.mobilenav__item:hover{ background: var(--surface-hover); border-color: var(--border-mid); text-decoration:none; }
.mobilenav__item.is-active{ background: rgba(217,180,106,.12); border-color: var(--gold-border-hover); }
.mobilenav__label{ font-size:11px; color: var(--body-color); }

/* Responsiveness — two-column collapses to single column on small screens */
@media (max-width: 1200px){
  .topbar__inner--simple{ flex-direction:column; align-items:stretch; }
  .topbar__right{ display:flex; justify-content:flex-end; }
  .headactions{ justify-content:flex-end; flex-wrap:wrap; }
  .topbar__ribbon{ grid-template-columns: 1fr; align-items:start; }
  .ribbon__tick{ width: fit-content; max-width: 100%; }
}
@media (max-width: 900px){
  .layout{ grid-template-columns: 1fr; }
  .sidenav{ display:none; }
  .layout__main{ min-height:auto; }
  .grid{ grid-template-columns: 1fr; }
  .panel--span2{ grid-column: auto; }
  .mobilenav{ display:flex; }
}
@media (max-width: 520px){
  .token__k{ display:none; }
  .plaque{ min-width: 0; }
  .hero__meta{ flex-direction:column; }
  .progressrow{ flex-direction:column; align-items:stretch; }
  .progressrow__right{ min-width: 0; }
}


/* Shared surface content patterns */
.page-shell{
  width:100%;
  max-width:none;
  margin-inline:0;
}
.page-shell--narrow{ width:100%; max-width:none; }
.page-shell--medium{ width:100%; max-width:none; }
.content-stack{ display:flex; flex-direction:column; gap:var(--stack-section); }
.breadcrumb{
  font-size:13px;
  color:rgba(233,230,223,.65);
  display:flex;
  gap:var(--gap-tight);
  flex-wrap:wrap;
}
.breadcrumb a{ color:rgba(233,230,223,.84); text-decoration:underline; text-underline-offset:3px; }
.page-title{
  margin:0;
  font-family:var(--font-display);
  font-size:30px;
  line-height:1.1;
  color:var(--text);
}
.page-sub{ margin:0; color:rgba(233,230,223,.72); font-size:14px; line-height:1.45; }
.section-title{ margin:0 0 var(--space-control); font:600 15px/1.3 var(--font-display); color:var(--gold); }
.body-text, .info-block{ color:rgba(233,230,223,.82); font-size:14px; line-height:1.6; }
.no-data{ font-size:13px; color: var(--caption-color); font-style:italic; }
.kv-row{ display:flex; justify-content:space-between; gap:var(--gap-control); padding:var(--space-micro) 0; border-bottom:1px solid rgba(255,255,255,.07); font-size:14px; }
.kv-row:last-child{ border-bottom:none; }
.kv-label{ color:rgba(233,230,223,.72); }
.kv-val{ color:var(--text); font-variant-numeric:tabular-nums; text-align:right; }
.form-grid{ display:grid; gap:var(--space-shell); grid-template-columns:repeat(2,minmax(0,1fr)); }
.form-grid > .full{ grid-column:1 / -1; }
.action-row{ margin-top:var(--space-shell); }
.table-wrap{ border:1px solid var(--border-subtle); border-radius:var(--r12); overflow:auto; }
.table-wrap table{ width:100%; border-collapse:collapse; font-size:14px; }
.table-wrap th,.table-wrap td{ padding:var(--space-3) var(--space-4); border-bottom:1px solid var(--border-subtle); text-align:left; vertical-align:top; }
.table-wrap th{ color:rgba(233,230,223,.88); }
.table-wrap td{ color:rgba(233,230,223,.78); }
.status-block{ padding:var(--container-pad-md); border-radius:var(--r12); border:1px solid var(--border-mid); background: var(--surface-inset); }

/* Public shell family */
body[data-page="public"], body[data-page="signup"], body[data-page="forgot_password"], body[data-page="reset_password"], body[data-page="verify_email"], body[data-page="faq"], body[data-page="patch_notes"], body[data-page="terms"], body[data-page="privacy"], body[data-page="code_of_conduct"]{
  padding:var(--space-major) var(--gutter-shell) calc((var(--space-major) * 2) + var(--shell-footer-reserve));
}
.public-shell{
  width:min(100%, 840px);
  margin:0 auto;
  display:flex;
  flex-direction:column;
  gap:var(--stack-section);
}
.public-shell .panel{ padding:var(--container-pad-lg); }
.public-shell__head{ display:flex; flex-direction:column; gap:var(--space-control); }
.public-shell__links{ display:flex; gap:var(--gap-control); flex-wrap:wrap; }

/* War Room — forecast + stake layout */
.war-forecast-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:10px; }
.war-stake-block{ border:1px solid #9a3b3b; box-shadow: inset 0 0 0 1px rgba(154,59,59,0.35); }

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

/* ── Accessibility: focus-visible for elements missing it ───────────────── */
.navitem:focus-visible{ outline:none; box-shadow: var(--focus); }
.navgroup summary:focus-visible{ outline:none; box-shadow: var(--focus); border-radius: var(--radius); }
.mobilenav__item:focus-visible{ outline:none; box-shadow: var(--focus); }
.panel__link:focus-visible{ outline:none; box-shadow: var(--focus); }
.tab:focus-visible{ outline:none; box-shadow: var(--focus); }
.rchip:focus-visible{ outline:none; box-shadow: var(--focus); }

/* ── Accessibility: minimum touch targets ───────────────────────────────── */
.iconbtn{ min-width: 44px; min-height: 44px; }

/* ── Table row hover for scannability ───────────────────────────────────── */
.table-wrap tbody tr:hover td{ background: var(--surface-low); }

/* ── Text overflow safety for constrained cells ─────────────────────────── */
.celltitle,
.bcard__name,
.navitem,
.feeditem__top strong,
.queuecard__title{
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
