/* ============================================================================
   The Court of Gloriana — King Bot
   Deep velvet crimson, inscriptional gold, parchment ivory.
   No build step, no framework, no third-party requests.
   ========================================================================== */

/* ---------------------------------------------------------------- fonts */
@font-face {
  font-family: 'Cinzel';
  src: url('/static/fonts/cinzel-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Cinzel';
  src: url('/static/fonts/cinzel-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Cinzel';
  src: url('/static/fonts/cinzel-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/inter-300.woff2') format('woff2');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/inter-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/inter-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/inter-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}

/* ---------------------------------------------------------------- tokens */
:root {
  --ink: #120a0d;
  --ink-2: #1a0f13;
  --velvet: #2a1119;
  --velvet-2: #3a1620;
  --crimson: #8c1220;
  --crimson-bright: #b81f2c;
  --gold: #d9ad5c;
  --gold-bright: #f3d68d;
  --gold-deep: #a9833a;
  --ivory: #f6efe1;
  --parchment: #efe4d0;
  --olive: #7c8a6a;
  --slate: #6f7b86;
  --muted: #bbaa96;
  --muted-2: #94816f;
  --ok: #6fbf73;
  --warn: #e0a34a;
  --line: rgba(217, 173, 92, .22);
  --line-soft: rgba(246, 239, 225, .10);

  --font-display: 'Cinzel', 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-2: 0 10px 30px -12px rgba(0, 0, 0, .65);
  --shadow-3: 0 24px 70px -30px rgba(0, 0, 0, .85);
  --ease: cubic-bezier(.22, .61, .36, 1);

  --wrap: 1180px;
  --pad: 1.15rem;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ivory);
  background-color: var(--ink);
  background-image:
    radial-gradient(1100px 520px at 50% -10%, rgba(140, 18, 32, .38), transparent 70%),
    radial-gradient(700px 400px at 88% 8%, rgba(217, 173, 92, .12), transparent 65%),
    repeating-linear-gradient(135deg, rgba(217, 173, 92, .028) 0 2px, transparent 2px 22px);
  background-attachment: fixed;
  min-height: 100vh;
}

h1, h2, h3, .wordmark, .seat-name, .card-title { font-family: var(--font-display); }

h1, h2, h3 { line-height: 1.15; margin: 0 0 .55em; text-wrap: balance; font-weight: 600; }
p { margin: 0 0 1em; text-wrap: pretty; }
img, svg { max-width: 100%; }
a { color: var(--gold); text-decoration-color: rgba(217, 173, 92, .45); text-underline-offset: 3px; }
a:hover { color: var(--gold-bright); }

.num, time, .stat .v, .rung-goal, .progress-numbers { font-variant-numeric: tabular-nums; }

:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; border-radius: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 50;
  background: var(--gold); color: #241000; padding: .7rem 1rem; border-radius: 0 0 var(--r-sm) 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }

.hairline { border: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); margin: 1rem 0; }
.gold-text {
  background: linear-gradient(100deg, var(--gold-bright), var(--gold) 45%, #fff3d0 70%, var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.fine { font-size: .82rem; color: var(--muted); line-height: 1.55; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .68rem 1.1rem;
  font-family: var(--font-body); font-size: .92rem; font-weight: 600; letter-spacing: .01em;
  border: 1px solid transparent; border-radius: 999px; cursor: pointer;
  text-decoration: none; white-space: normal; text-align: center;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), background-color .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.btn:active { transform: translateY(1px) scale(.995); }
.btn:disabled, .btn.is-disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-gold {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold) 55%, var(--gold-deep));
  color: #2a1600; box-shadow: 0 6px 18px -10px rgba(217, 173, 92, .8), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.btn-gold:hover:not(:disabled) { box-shadow: 0 10px 26px -10px rgba(243, 214, 141, .85), inset 0 1px 0 rgba(255, 255, 255, .6); }

.btn-ghost {
  background: rgba(246, 239, 225, .04); color: var(--ivory); border-color: var(--line);
}
.btn-ghost:hover { background: rgba(217, 173, 92, .12); border-color: rgba(217, 173, 92, .45); color: var(--gold-bright); }

.btn-sm { min-height: 38px; padding: .45rem .85rem; font-size: .82rem; }
.btn-xs { min-height: 32px; padding: .25rem .6rem; font-size: .74rem; }
.btn-lg { min-height: 52px; padding: .85rem 1.6rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: linear-gradient(180deg, rgba(18, 10, 13, .96), rgba(18, 10, 13, .82));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header::after {
  content: ''; display: block; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(217, 173, 92, .55), transparent);
}
.bar { display: flex; align-items: center; gap: 1rem; min-height: 68px; }

.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--ivory); margin-right: auto; min-width: 0; }
.crest { color: var(--gold-bright); display: inline-flex; width: 34px; height: 34px; flex: 0 0 34px; filter: drop-shadow(0 2px 6px rgba(217, 173, 92, .45)); }
.crest svg { width: 100%; height: 100%; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.wordmark { font-size: 1.06rem; font-weight: 600; letter-spacing: .02em; }
.sub { font-size: .68rem; color: var(--muted-2); letter-spacing: .12em; text-transform: uppercase; }

.site-nav { display: flex; align-items: center; gap: .3rem; }
.site-nav a {
  color: var(--ivory); text-decoration: none; font-size: .9rem; font-weight: 500;
  padding: .5rem .7rem; border-radius: 999px; transition: background-color .16s var(--ease), color .16s var(--ease);
}
.site-nav a:hover { background: rgba(217, 173, 92, .12); color: var(--gold-bright); }
.site-nav a[aria-current="page"] { color: var(--gold-bright); box-shadow: inset 0 -2px 0 var(--gold); border-radius: 0; }
.site-nav .nav-cta { margin-left: .35rem; }
.nav-toggle { display: none; }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; padding: 3rem 0 2.2rem; overflow: hidden; }
.hero-glow {
  position: absolute; inset: -40% -20% auto; height: 130%;
  background: radial-gradient(560px 300px at 22% 20%, rgba(184, 31, 44, .30), transparent 70%),
              radial-gradient(420px 260px at 78% 30%, rgba(217, 173, 92, .16), transparent 70%);
  pointer-events: none;
}
.hero-grid { position: relative; display: grid; gap: 2rem; }

.kicker {
  display: inline-flex; align-items: center; gap: .55rem;
  font-size: .74rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold); background: rgba(217, 173, 92, .08);
  border: 1px solid var(--line); border-radius: 999px; padding: .35rem .8rem; margin: 0 0 1.1rem;
}
.nowrap { white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(111, 191, 115, .7); animation: pulse 2.6s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(111, 191, 115, .55); }
  70% { box-shadow: 0 0 0 10px rgba(111, 191, 115, 0); }
  100% { box-shadow: 0 0 0 0 rgba(111, 191, 115, 0); }
}

.hero h1 { font-size: clamp(2.3rem, 7vw, 4.05rem); font-weight: 700; letter-spacing: -.01em; margin-bottom: .5rem; }
.lede { font-size: clamp(1rem, 2.4vw, 1.1rem); color: #e9dfcd; max-width: 62ch; }
.lede-small { color: var(--muted); font-size: .95rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .65rem; margin: 1.4rem 0 1rem; }
.hero-note { font-size: .82rem; color: var(--muted); max-width: 58ch; }
.hero-note strong { color: var(--gold-bright); }

/* seats: the two characters */
.seats { display: grid; gap: 1rem; align-content: start; }
.seat {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 1rem;
  padding: 1.15rem 1.15rem 1.3rem; border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(58, 22, 32, .85), rgba(26, 15, 19, .92));
  border: 1px solid var(--line); box-shadow: var(--shadow-2); overflow: hidden;
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.seat:hover { transform: translateY(-2px); border-color: rgba(217, 173, 92, .45); }
.seat-corner {
  position: absolute; inset: 0 0 auto; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .8;
}
.seat-nigel { background: linear-gradient(180deg, rgba(38, 36, 44, .85), rgba(20, 18, 22, .92)); }
.seat-name { font-size: 1.12rem; margin: 0 0 .15rem; }
.seat-ordinal { color: var(--muted-2); font-size: .78rem; font-weight: 400; letter-spacing: .04em; }
.seat-role { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); margin: 0 0 .45rem; }
.seat-nigel .seat-role { color: #a9b39c; }
.seat-status { font-size: .88rem; color: var(--muted); margin: 0; font-style: italic; }
.seat-ask { grid-column: 1 / -1; justify-self: start; }

.seat-ticker {
  display: flex; flex-wrap: wrap; gap: .4rem .9rem; align-items: center;
  padding: .7rem .9rem; border: 1px dashed var(--line); border-radius: var(--r);
  font-size: .8rem; color: var(--muted); background: rgba(246, 239, 225, .02);
}
.ticker-label { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.ticker-item b { color: var(--ivory); font-weight: 600; }
.ticker-item + .ticker-item { border-left: 1px solid var(--line-soft); padding-left: .9rem; }

/* avatar medallions */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--avatar-size, 48px); height: var(--avatar-size, 48px);
  border-radius: 50%; flex: 0 0 auto;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .12), transparent 60%), var(--velvet);
  border: 1px solid var(--line); box-shadow: inset 0 0 18px rgba(0, 0, 0, .5);
}
.avatar svg { width: 68%; height: 68%; }
.avatar-president { color: var(--gold-bright); border-color: rgba(217, 173, 92, .55); }
.avatar-nigel { color: #b6c1ad; border-color: rgba(182, 193, 173, .35); }

/* ---------------------------------------------------------------- notices */
.notice {
  display: flex; gap: .7rem; align-items: flex-start;
  margin: 1rem 0 0; padding: .85rem 1rem; border-radius: var(--r);
  background: rgba(217, 173, 92, .09); border: 1px solid var(--line); font-size: .9rem;
}
.notice-rest { background: rgba(184, 31, 44, .14); border-color: rgba(184, 31, 44, .4); }
.thanks-banner {
  margin: 1.2rem 0 0; padding: 1rem 1.15rem; border-radius: var(--r-lg);
  border: 1px solid rgba(217, 173, 92, .55); background: rgba(217, 173, 92, .12);
  font-size: .92rem; color: var(--ivory);
}
.thanks-banner strong { color: var(--gold-bright); display: block; margin-bottom: .2rem; }

/* decree banner */
.decree {
  position: relative; margin-top: 1.4rem; padding: 1.4rem 1.4rem 1.5rem;
  border-radius: var(--r-lg); border: 1px solid rgba(217, 173, 92, .45);
  background:
    linear-gradient(180deg, rgba(217, 173, 92, .10), rgba(58, 22, 32, .5)),
    repeating-linear-gradient(90deg, rgba(217, 173, 92, .05) 0 1px, transparent 1px 14px);
  box-shadow: var(--shadow-2);
}
.decree-head { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: .7rem; }
.decree-when { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); }
.decree-speech { font-family: var(--font-display); font-size: clamp(1.05rem, 2.6vw, 1.35rem); color: var(--ivory); margin: 0 0 .8rem; }
.seal-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-bright);
  border: 1px solid var(--line); border-radius: 999px; padding: .25rem .7rem; background: rgba(18, 10, 13, .5);
}
.seal-chip svg { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- cards */
.card {
  background: linear-gradient(180deg, rgba(246, 239, 225, .045), rgba(18, 10, 13, .55));
  border: 1px solid var(--line-soft); border-radius: var(--r-lg);
  padding: 1.15rem; box-shadow: var(--shadow-1); min-width: 0;
}
.card-title { font-size: 1.05rem; margin: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.card-sub { font-size: .82rem; color: var(--muted); margin: .3rem 0 .9rem; }
.pill-count { font-size: .74rem; color: var(--muted-2); font-variant-numeric: tabular-nums; }

.grid { display: grid; gap: 1.15rem; margin: 1.6rem auto 2.4rem; }

/* ---------------------------------------------------------------- feed */
.feed-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.feed-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.15rem .85rem; border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(58, 22, 32, .5), transparent);
}
.live-badge {
  display: inline-flex; align-items: center; gap: .45rem; flex: 0 0 auto;
  font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ok);
  border: 1px solid rgba(111, 191, 115, .35); background: rgba(111, 191, 115, .08);
  border-radius: 999px; padding: .3rem .7rem;
}
.live-badge.is-resting { color: var(--muted); border-color: var(--line); background: rgba(246, 239, 225, .04); }
.live-badge.is-resting .dot { background: var(--muted); animation: none; }

.feed {
  display: flex; flex-direction: column; gap: .9rem;
  padding: 1.05rem 1.15rem 1.4rem;
  max-height: min(66vh, 720px); overflow-y: auto; scroll-behavior: smooth;
  overscroll-behavior: contain;
}
.feed.transcript { max-height: none; }

.msg { display: grid; grid-template-columns: auto 1fr; gap: .75rem; min-width: 0; animation: rise .34s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.msg-avatar { padding-top: .15rem; }
.msg-main { min-width: 0; }
.msg-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; margin-bottom: .28rem; }
.msg-name { font-family: var(--font-display); font-weight: 600; font-size: .96rem; color: var(--gold-bright); }
.msg-nigel .msg-name { color: #bcc9b2; }
.msg-role, .msg-when { font-size: .7rem; color: var(--muted-2); }
.msg-role { text-transform: uppercase; letter-spacing: .08em; }
.msg-link { font-size: .72rem; color: var(--muted-2); text-decoration: none; border-bottom: 1px dotted currentColor; }
.msg-link:hover { color: var(--gold); }
.tag {
  font-size: .66rem; letter-spacing: .1em; text-transform: uppercase;
  padding: .15rem .5rem; border-radius: 999px; border: 1px solid var(--line); color: var(--gold);
  background: rgba(217, 173, 92, .08);
}
.tag-answer { color: var(--gold-bright); }
.tag-upgrade { color: #f0d8a2; border-color: rgba(217, 173, 92, .6); background: rgba(217, 173, 92, .16); }

.bubble {
  position: relative; padding: .8rem 1rem; border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(246, 239, 225, .07), rgba(246, 239, 225, .035));
  border: 1px solid var(--line-soft);
  font-size: .95rem; line-height: 1.55; overflow-wrap: break-word; word-break: break-word;
}
.msg-president .bubble {
  background: linear-gradient(180deg, rgba(140, 18, 32, .30), rgba(140, 18, 32, .14));
  border-color: rgba(184, 31, 44, .4); box-shadow: inset 3px 0 0 rgba(217, 173, 92, .75);
  border-top-left-radius: var(--r-sm);
}
.msg-nigel .bubble {
  background: linear-gradient(180deg, rgba(111, 123, 134, .20), rgba(111, 123, 134, .10));
  border-color: rgba(180, 195, 175, .28); box-shadow: inset 3px 0 0 rgba(180, 195, 175, .55);
  border-top-left-radius: var(--r-sm);
}
.msg.is-upgrade .bubble { border-color: rgba(217, 173, 92, .65); }

.typing { display: flex; align-items: center; gap: .55rem; font-size: .8rem; color: var(--muted-2); padding-left: .35rem; }
.typing[hidden] { display: none; }
.typing-dots { display: inline-flex; gap: .22rem; }
.typing-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); animation: blink 1.3s infinite; }
.typing-dots i:nth-child(2) { animation-delay: .18s; }
.typing-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 60%, 100% { opacity: .28; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

.new-pill {
  position: sticky; bottom: .8rem; align-self: center;
  margin: 0 auto .9rem; padding: .5rem .95rem; border-radius: 999px;
  background: var(--gold); color: #2a1600; border: 0; font-weight: 600; font-size: .8rem; cursor: pointer;
  box-shadow: var(--shadow-2); opacity: 0; pointer-events: none; transform: translateY(6px);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.new-pill.show { opacity: 1; pointer-events: auto; transform: none; }

.empty-state { text-align: center; color: var(--muted); padding: 2rem 1rem; border: 1px dashed var(--line); border-radius: var(--r); }
.empty-state p { margin: 0; }

/* ---------------------------------------------------------------- sidebar */
.side { display: grid; gap: 1.15rem; align-content: start; min-width: 0; }

.ask-card .target-picker { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .8rem; }
.target {
  display: flex; flex-direction: column; gap: .1rem; align-items: flex-start; text-align: left;
  padding: .6rem .7rem; min-height: 60px; cursor: pointer;
  background: rgba(246, 239, 225, .03); border: 1px solid var(--line-soft); border-radius: var(--r);
  color: var(--ivory); font-family: var(--font-body);
  transition: border-color .16s var(--ease), background-color .16s var(--ease), transform .16s var(--ease);
}
.target:hover { transform: translateY(-1px); border-color: rgba(217, 173, 92, .4); }
.target-name { font-size: .84rem; font-weight: 600; }
.target-hint { font-size: .7rem; color: var(--muted-2); }
.target.is-selected { border-color: var(--gold); background: rgba(217, 173, 92, .13); box-shadow: inset 0 0 0 1px rgba(217, 173, 92, .35); }
.target.is-selected .target-name { color: var(--gold-bright); }

textarea, input[type="text"], input[type="number"], input[type="password"], select {
  width: 100%; font-family: var(--font-body); font-size: .94rem; color: var(--ivory);
  background: rgba(18, 10, 13, .6); border: 1px solid var(--line-soft); border-radius: var(--r);
  padding: .7rem .85rem; min-height: 44px; transition: border-color .16s var(--ease), background-color .16s var(--ease);
}
textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
textarea::placeholder, input::placeholder { color: var(--muted-2); }
textarea:focus, input:focus, select:focus { border-color: rgba(217, 173, 92, .6); background: rgba(18, 10, 13, .8); outline: none; box-shadow: 0 0 0 3px rgba(217, 173, 92, .14); }
label { font-size: .8rem; color: var(--muted); display: block; margin-bottom: .3rem; }
.stack { display: grid; gap: .55rem; }
.check { display: flex; align-items: center; gap: .5rem; margin: .2rem 0; }
.check input { width: auto; min-height: 0; }

.ask-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; margin-top: .7rem; }
.ask-hint { font-size: .74rem; color: var(--muted-2); }
.ask-state { margin-top: .7rem; font-size: .86rem; border-radius: var(--r); }
.ask-state.show { padding: .7rem .85rem; border: 1px solid var(--line-soft); background: rgba(246, 239, 225, .04); }
.ask-state.pending { border-color: rgba(217, 173, 92, .4); color: var(--gold-bright); }
.ask-state.done { border-color: rgba(111, 191, 115, .45); color: #cde8c9; }
.ask-state.error { border-color: rgba(184, 31, 44, .55); color: #f3c6c6; }
.ask-state a { color: inherit; text-decoration: underline; }
.type-meta { color: var(--muted-2); font-size: .8rem; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.stat { background: rgba(246, 239, 225, .03); border: 1px solid var(--line-soft); border-radius: var(--r); padding: .6rem .7rem; min-width: 0; }
.stat .k { display: block; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); }
.stat .v { display: block; font-size: 1.15rem; font-weight: 600; color: var(--ivory); }
.stat .v small { font-size: .7rem; color: var(--muted-2); font-weight: 400; }

.share-row { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------------------------------------------------------------- progress */
.progress { position: relative; height: 14px; border-radius: 999px; background: rgba(18, 10, 13, .8); border: 1px solid var(--line-soft); overflow: hidden; }
.progress-lg { height: 22px; }
.progress-fill {
  position: relative; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--crimson-bright), var(--gold) 60%, var(--gold-bright));
  box-shadow: 0 0 18px -4px rgba(243, 214, 141, .6);
  transition: width .7s var(--ease);
}
.progress-fill .shimmer {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .45) 50%, transparent 80%);
  animation: shimmer 3.4s linear infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.progress-numbers { font-size: .86rem; color: var(--muted); margin: .7rem 0 0; }
.progress-numbers strong { color: var(--ivory); }
.progress-numbers em { color: var(--gold-bright); font-style: normal; }
.fund-cta { margin-top: 1rem; display: grid; gap: .6rem; }
.fine-disclaimer { border-left: 2px solid rgba(217, 173, 92, .5); padding-left: .7rem; }
.fine-boxed { border: 1px solid var(--line); border-left-width: 3px; background: rgba(217, 173, 92, .07); padding: .8rem .9rem; border-radius: var(--r); }

/* ---------------------------------------------------------------- gift rail */
.gift-band { margin: 2rem auto 2.4rem; }
.gift-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.gift {
  display: flex; flex-direction: column; gap: .35rem; min-width: 0;
  padding: 1.15rem; border-radius: var(--r-lg); text-decoration: none; color: var(--ivory);
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(246, 239, 225, .045), rgba(18, 10, 13, .55));
  transition: transform .18s var(--ease), border-color .18s var(--ease), background-color .18s var(--ease);
}
.gift:hover { transform: translateY(-2px); border-color: rgba(217, 173, 92, .5); background: linear-gradient(180deg, rgba(217, 173, 92, .1), rgba(18, 10, 13, .55)); }
.gift-amount { font-family: var(--font-display); font-size: 1.65rem; font-weight: 700; color: var(--gold-bright); line-height: 1; }
.gift-name { font-family: var(--font-display); font-size: 1.02rem; font-weight: 600; }
.gift-note { font-size: .82rem; color: var(--muted); line-height: 1.5; }
.gift-go { margin-top: auto; padding-top: .7rem; font-size: .78rem; font-weight: 600; color: var(--gold); }
@media (min-width: 700px) { .gift-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .gift-grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------------------------------------------------------------- ladder */
.ladder-band { margin: 2.4rem auto 3rem; }
.band-head { display: flex; flex-wrap: wrap; gap: .8rem; align-items: baseline; justify-content: space-between; margin-bottom: 1.1rem; }
.band-head h2 { font-size: clamp(1.35rem, 3.4vw, 1.9rem); margin: 0; }
.band-note { color: var(--muted-2); font-family: var(--font-body); font-size: .82rem; font-weight: 400; letter-spacing: .02em; }

.ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; grid-template-columns: 1fr; }
.rung {
  position: relative; display: flex; flex-direction: column; gap: .35rem;
  padding: 1rem; border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(246, 239, 225, .04), rgba(18, 10, 13, .5));
  border: 1px solid var(--line-soft); min-width: 0;
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.rung:hover { transform: translateY(-2px); border-color: rgba(217, 173, 92, .4); }
.rung.is-current { border-color: rgba(217, 173, 92, .55); box-shadow: 0 0 0 1px rgba(217, 173, 92, .25) inset; }
.rung.is-reached { background: linear-gradient(180deg, rgba(217, 173, 92, .12), rgba(18, 10, 13, .5)); }
.rung-top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.rung-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; font-family: var(--font-display); font-size: .8rem;
  color: var(--gold-bright); border: 1px solid var(--line); background: rgba(18, 10, 13, .6);
}
.rung-goal { font-size: .9rem; font-weight: 600; color: var(--ivory); }
.rung-name { font-size: 1rem; margin: 0; }
.rung-blurb { font-size: .82rem; color: var(--muted); margin: 0; }
.rung-state { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); margin-top: auto; }
.rung.is-reached .rung-state { color: var(--gold); }
.rung-fund {
  display: inline-flex; align-items: center; gap: .35rem; align-self: flex-start;
  margin-top: .7rem; min-height: 34px; padding: .25rem .7rem;
  font-size: .78rem; font-weight: 600; color: var(--gold-bright); text-decoration: none;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(217, 173, 92, .08);
  transition: background-color .16s var(--ease), border-color .16s var(--ease), transform .16s var(--ease);
}
.rung-fund:hover { background: rgba(217, 173, 92, .18); border-color: rgba(217, 173, 92, .55); transform: translateY(-1px); color: var(--gold-bright); }

/* ---------------------------------------------------------------- fund page */
.page-head { padding: 2.4rem 0 1rem; }
.page-head h1 { font-size: clamp(1.8rem, 5vw, 2.9rem); }
.page-sub { color: var(--muted); max-width: 70ch; }
.back-link { display: inline-block; font-size: .82rem; color: var(--muted-2); text-decoration: none; margin-bottom: .8rem; }
.back-link:hover { color: var(--gold); }

.fund-hero { display: grid; gap: 1.4rem; margin: 1.6rem auto 2.6rem; align-items: start; }
.fund-hero-main { padding: 1.3rem; border-radius: var(--r-xl); border: 1px solid var(--line); background: linear-gradient(180deg, rgba(217, 173, 92, .08), rgba(26, 15, 19, .7)); box-shadow: var(--shadow-2); min-width: 0; }
.fund-hero-numbers { font-size: 1.15rem; margin: 1rem 0 .35rem; }
.fund-hero-numbers strong { color: var(--gold-bright); }
.fund-hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin-top: 1.2rem; }
.fund-hero-side { display: grid; gap: 1.15rem; align-content: start; }
.cost-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; font-size: .86rem; }
.cost-list li { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dotted var(--line-soft); padding-bottom: .45rem; }
.cost-list .num { color: var(--muted-2); }

.spark { display: flex; align-items: flex-end; gap: .4rem; height: 116px; padding: .4rem 0 0; border-bottom: 1px solid var(--line-soft); }
.spark-col { flex: 0 1 3.2rem; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.spark-bar { display: block; width: 100%; max-width: 2.6rem; min-height: 4px; border-radius: 3px; background: linear-gradient(180deg, var(--gold-bright), var(--crimson-bright)); transition: height .5s var(--ease); }
.spark-label { font-size: .62rem; color: var(--muted-2); margin-top: .3rem; font-variant-numeric: tabular-nums; }

.ledger-band { display: grid; gap: 1rem; margin-bottom: 3rem; }
.ledger { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.ledger li { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: baseline; padding-bottom: .5rem; border-bottom: 1px dotted var(--line-soft); font-size: .88rem; }
.ledger time { font-size: .72rem; color: var(--muted-2); flex: 0 0 8.5rem; }
.ledger-entry { flex: 1 1 16rem; min-width: 0; }
.ledger-amount { color: var(--gold-bright); font-weight: 600; }

/* ---------------------------------------------------------------- prose (about) */
.prose-grid { display: grid; gap: 1.4rem; margin-bottom: 3rem; }
.prose h2 { font-size: 1.25rem; margin-top: 1.6rem; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: #e6dccb; }
.prose-list { margin: 0 0 1.2rem; padding-left: 1.2rem; display: grid; gap: .45rem; }
.prose-list-numbered { padding-left: 1.4rem; }
.prose-list li { line-height: 1.55; }
.cast { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.cast li { display: grid; gap: .1rem; font-size: .88rem; }
.cast span { color: var(--muted); font-size: .8rem; }
.disclaimer { font-size: .88rem; color: #e8dcc6; }
.disclaimer-fund { color: var(--muted); font-size: .84rem; }

.question-card { border-radius: var(--r-lg); border: 1px solid var(--line); background: rgba(217, 173, 92, .07); padding: 1.1rem; margin-bottom: 1.2rem; }
.question-tag { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.question-text { font-family: var(--font-display); font-size: 1.1rem; margin: .4rem 0 0; }
.transcript-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.2rem; }
.not-found { padding: 4rem 0 5rem; }

/* ---------------------------------------------------------------- footer */
.site-footer { margin-top: 3rem; border-top: 1px solid var(--line); background: linear-gradient(180deg, rgba(26, 15, 19, .6), rgba(18, 10, 13, .95)); padding: 2.2rem 0 2rem; }
.footer-band { display: grid; gap: 1rem; }
.seal { width: 54px; height: 54px; color: var(--gold); opacity: .8; }
.seal svg { width: 100%; height: 100%; }
.footer-links { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; font-size: .85rem; margin: 1.2rem 0 .9rem; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--gold-bright); }
.footer-fine { font-size: .76rem; color: var(--muted-2); margin: 0; }

/* ---------------------------------------------------------------- toast */
.toast-host { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); display: grid; gap: .5rem; z-index: 60; width: min(92vw, 420px); }
.toast {
  padding: .7rem .95rem; border-radius: var(--r); font-size: .85rem;
  background: rgba(26, 15, 19, .96); border: 1px solid var(--line); box-shadow: var(--shadow-3);
  animation: rise .25s var(--ease) both;
}
.toast strong { color: var(--gold-bright); }

/* ---------------------------------------------------------------- admin */
.admin-body .site-nav a[href="/crown-fund"], .admin-body .site-nav a[href="/about"] { opacity: .8; }
.admin-grid { display: grid; gap: 1.15rem; margin-bottom: 1.6rem; }
.admin-body .wrap + .wrap { margin-top: 1.15rem; }
.kv { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .4rem; font-size: .88rem; }
.kv li { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dotted var(--line-soft); padding-bottom: .35rem; }
.kv span { color: var(--muted); }
.admin-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.admin-actions form { margin: 0; }
.login-card { display: grid; gap: .7rem; max-width: 420px; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.admin-table th { text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted-2); padding: .4rem .5rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table td { padding: .45rem .5rem; border-bottom: 1px dotted var(--line-soft); vertical-align: top; }
.admin-table td.wide { max-width: 40ch; overflow-wrap: break-word; }
.admin-table tr.is-hidden td { opacity: .45; }
.event-log { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; font-size: .78rem; max-height: 320px; overflow-y: auto; }
.event-log li { display: flex; gap: .5rem; flex-wrap: wrap; border-bottom: 1px dotted var(--line-soft); padding-bottom: .3rem; }
.event-log time { color: var(--muted-2); }
.event-log strong { color: var(--gold); font-weight: 600; }
.event-log span { color: var(--muted); overflow-wrap: break-word; }

/* ---------------------------------------------------------------- responsive */
@media (min-width: 760px) {
  :root { --pad: 1.6rem; }
  .ladder { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .admin-grid { grid-template-columns: 1fr 1fr; }
  .footer-band { grid-template-columns: auto 1fr; align-items: start; }
}

@media (min-width: 1000px) {
  .hero { padding: 4.2rem 0 2.6rem; }
  .hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); align-items: start; gap: 3rem; }
  .grid { grid-template-columns: minmax(0, 1.55fr) minmax(320px, .9fr); }
  .ladder { grid-template-columns: repeat(3, 1fr); }
  .fund-hero { grid-template-columns: minmax(0, 1.4fr) minmax(300px, .85fr); }
  .prose-grid { grid-template-columns: minmax(0, 1fr) minmax(280px, .55fr); align-items: start; }
  .ledger-band { grid-template-columns: minmax(0, 1fr); }
  .site-nav { gap: .2rem; }
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex; align-items: center; min-height: 40px; padding: .4rem .8rem;
    background: rgba(246, 239, 225, .05); color: var(--ivory); border: 1px solid var(--line);
    border-radius: 999px; font-size: .82rem; font-weight: 600; cursor: pointer;
  }
  .site-nav {
    position: absolute; left: var(--pad); right: var(--pad); top: calc(100% + .5rem);
    flex-direction: column; align-items: stretch; gap: .2rem;
    background: rgba(20, 11, 15, .98); border: 1px solid var(--line); border-radius: var(--r-lg);
    padding: .6rem; box-shadow: var(--shadow-3);
    opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s;
  }
  .site-nav.open { opacity: 1; visibility: visible; transform: none; }
  .site-nav a { padding: .7rem .8rem; border-radius: var(--r); }
  .site-nav a[aria-current="page"] { border-radius: var(--r); box-shadow: inset 3px 0 0 var(--gold); }
}

@media (max-width: 560px) {
  .seat { grid-template-columns: auto 1fr; }
  .hero-cta .btn { flex: 1 1 100%; }
  .ask-card .target-picker { grid-template-columns: 1fr; }
  .msg { grid-template-columns: 1fr; }
  .msg-avatar { display: none; }
  .ledger time { flex: 0 0 auto; }
  .feed { max-height: 62vh; padding: 1rem .9rem 1.2rem; }
  .card { padding: 1rem; }
}

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

@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .ask-card, .new-pill, .share-card { display: none; }
  .bubble { border: 1px solid #ccc; background: #fff; color: #000; }
}

/* twohanders-footer — scoped with th- prefixes: .footer-links already exists in the site footers */
.th-family {
  text-align: center;
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: .78rem;
  line-height: 1.7;
  color: var(--muted, #a89cc4);
}
.th-family p { margin: .2rem 0; }
.th-family a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(240, 192, 90, .35); }
.th-family a:hover { color: var(--gold, #f0c05a); border-bottom-color: currentColor; }
.th-family .th-legal { letter-spacing: .04em; }
.th-family .th-nav { font-size: .8rem; }
.th-family .th-showline a, .th-family .th-nav a { display: inline; }
.th-family .th-showline { opacity: .85; }

/* legal pages */
.legal h2 { font-family: var(--serif, Georgia, serif); font-size: 1.05rem; letter-spacing: .04em;
            margin: 1.8rem 0 .5rem; color: var(--gold-3, #ffe9b0); }
.legal p { margin: 0 0 .9rem; }
.legal .legal-updated { margin-top: 2rem; font-size: .78rem; color: var(--muted, #a89cc4); }

/* one centred footer: nav row, fine print and the family block share an axis.
   The disclosure panel keeps its paragraph text flush left, where prose belongs. */
.site-footer { text-align: center; }
.site-footer .footer-links { justify-content: center; }
.site-footer .footer-fine { text-align: center; }
.site-footer .disclosure { text-align: left; }

/* the ask box, promoted above the feed: the only interaction on the page */
.ask-top-wrap { margin: 0 auto 1.4rem; }
.ask-card.ask-top { border-color: rgba(201,162,39,.32); }
.ask-card.ask-top .card-title { font-size: 1.15rem; }
@media (min-width: 860px) {
  .ask-card.ask-top { display: grid; grid-template-columns: 1fr 1.15fr; gap: .45rem 1.6rem;
                      align-items: start; }
  .ask-card.ask-top .card-head { grid-column: 1; grid-row: 1; }
  .ask-card.ask-top .card-sub  { grid-column: 1; grid-row: 2; }
  .ask-card.ask-top .target-picker { grid-column: 1; grid-row: 3; }
  /* the box fills the height of the left column, so the button sits directly under it */
  .ask-card.ask-top #question { grid-column: 2; grid-row: 1 / span 3; height: 100%;
                                min-height: 104px; resize: vertical; }
  .ask-card.ask-top .ask-row { grid-column: 2; grid-row: 4; margin-top: .1rem; }
  .ask-card.ask-top .ask-state { grid-column: 2; grid-row: 5; }
  .ask-card.ask-top .target-picker { align-self: start; }
}
.older-row { display: flex; align-items: center; gap: .8rem; padding: .7rem .2rem .2rem; flex-wrap: wrap; }
.older-note { font-size: .72rem; color: var(--muted, #9b8f7d); }
.q-line { margin: .9rem .2rem .2rem; padding: .55rem .8rem; border-left: 2px solid var(--gold, #c9a227);
          color: var(--ink-dim, #cfc2ac); font-style: italic; font-size: .88rem;
          background: rgba(201,162,39,.05); border-radius: 0 6px 6px 0; }

/* the rival court: a bulletin from the other show */
.rival-card { border: 1px solid rgba(201,162,39,.22); border-radius: 14px; padding: 1.1rem 1.25rem;
  background: linear-gradient(180deg, rgba(201,162,39,.05), rgba(255,255,255,.012)); margin: 0 auto 1.4rem; }
.rival-kicker { font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: #d9b657; }
.rival-line { font-family: var(--serif, Georgia, serif); font-size: 1.12rem; color: #f6ecdd;
  margin: .45rem 0 .35rem; }
.rival-note { font-size: .82rem; color: #b8a893; margin: 0; }
.rival-note a { color: #e0bd63; }

/* the herald: a proclamation between scenes, full width, not a character */
.herald { display: flex; align-items: baseline; gap: .7rem; margin: .9rem 0; padding: .8rem 1rem;
  border-top: 1px solid rgba(201,162,39,.35); border-bottom: 1px solid rgba(201,162,39,.35);
  background: linear-gradient(90deg, rgba(201,162,39,.07), transparent 70%);
  font-family: Georgia, 'Times New Roman', serif; font-size: .96rem; color: #e8dcc4; }
.herald-bell { color: #c9a227; font-size: .8rem; }
.herald-text { flex: 1; font-style: italic; letter-spacing: .01em; }
.herald-when { font-family: ui-monospace, monospace; font-size: .66rem; color: #9b8f7d; }

/* exchange of the day: one pinned, shareable thing at the top of the feed */
.eotd { border: 1px solid rgba(201,162,39,.28); border-radius: 14px; padding: 1rem 1.1rem;
  background: linear-gradient(180deg, rgba(201,162,39,.06), rgba(255,255,255,.012)); }
.eotd-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .7rem; }
.eotd-open { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: #d9b657;
  text-decoration: none; }
.eotd-card { display: block; border-radius: 10px; overflow: hidden; border: 1px solid rgba(255,255,255,.08); }
.eotd-card img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; background: #efe6d2; }
.eotd-note { margin: .6rem 0 0; font-size: .78rem; color: #9b8f7d; }
.eotd-note a { color: #d9b657; }
