/* ==========================================================================
   Greater Oakridge County — design system
   Warm campfire palette · Poppins italic display (matches the poster) · Inter body
   ========================================================================== */
:root {
  --bg: #0d0a08;
  --bg-2: #14100c;
  --bg-3: #1c1611;
  --surface: rgba(255, 238, 220, 0.045);
  --surface-2: rgba(255, 238, 220, 0.075);
  --surface-solid: #18130e;
  --border: rgba(255, 228, 200, 0.11);
  --border-strong: rgba(255, 228, 200, 0.22);
  --text: #f7efe6;
  --text-2: #d8c9b9;
  --muted: #a8968a;
  --ember: #f08a3c;
  --ember-2: #ffb36b;
  --ember-deep: #c25e1b;
  --oak: #9b4f17;
  --danger: #ef5a4c;
  --success: #4cc38a;
  --warning: #f0b429;
  --info: #6aa5ff;

  --font-display: 'Poppins', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
  --glow: 0 0 0 1px rgba(240, 138, 60, 0.35), 0 10px 40px -10px rgba(240, 138, 60, 0.45);
  --container: 1200px;
  --nav-h: 72px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --z-nav: 40;
  --z-modal: 60;
  --z-toast: 70;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; outline: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(240, 138, 60, 0.4); color: #fff; }

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

.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: 16px; top: -60px; z-index: 100; background: var(--ember); color: #1a0d03; padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 600; transition: top .2s; }
.skip-link:focus { top: 16px; }

.container { width: min(var(--container), 100% - 32px); margin-inline: auto; }
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.i-sm { width: 16px; height: 16px; }
.i-lg { width: 26px; height: 26px; }

/* ---------- Typography ---------- */
.display {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.035em;
  line-height: 0.92;
}
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.15; letter-spacing: -0.02em; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 12px/1 var(--font-body); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ember-2);
}
.eyebrow::before { content: ''; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 36px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(30px, 4.4vw, 52px); margin-top: 12px; }
.section-head p { color: var(--muted); max-width: 520px; margin: 10px 0 0; }
.text-muted { color: var(--muted); }
.ember-text { background: linear-gradient(100deg, var(--ember-2), var(--ember) 45%, #e0592a); -webkit-background-clip: text; background-clip: text; color: transparent; padding-inline: .04em .14em; -webkit-box-decoration-break: clone; box-decoration-break: clone; /* room for slanted letters on every wrapped line */ }

/* ---------- Buttons ---------- */
.btn {
  --h: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h); padding: 0 22px; border-radius: var(--radius-pill);
  border: 1px solid transparent; font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s, box-shadow .2s, transform .2s var(--ease);
  cursor: pointer; user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-sm { --h: 40px; padding: 0 16px; font-size: 14px; }
.btn-lg { --h: 56px; padding: 0 28px; font-size: 16px; }
.btn-primary { background: linear-gradient(180deg, #ff9e52, var(--ember) 60%, #e3762a); color: #1f0f03; box-shadow: 0 8px 24px -8px rgba(240, 138, 60, .7), inset 0 1px 0 rgba(255,255,255,.35); }
.btn-primary:hover { box-shadow: 0 12px 34px -8px rgba(240, 138, 60, .9), inset 0 1px 0 rgba(255,255,255,.35); background: linear-gradient(180deg, #ffb06d, #f59547 60%, #ea7e33); }
.btn-ghost { background: rgba(255, 245, 235, .06); border-color: var(--border-strong); color: var(--text); backdrop-filter: blur(10px); }
.btn-ghost:hover { background: rgba(255, 245, 235, .12); border-color: rgba(255, 228, 200, .35); }
.btn-quiet { background: transparent; color: var(--text-2); }
.btn-quiet:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: rgba(239, 90, 76, .12); border-color: rgba(239, 90, 76, .4); color: #ff9d92; }
.btn-danger:hover { background: rgba(239, 90, 76, .22); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 44px; height: 44px; padding: 0 10px; border-radius: 12px;
  background: transparent; border: 1px solid transparent; color: var(--text-2);
  transition: background-color .2s, color .2s, border-color .2s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.kbd, kbd { font: 500 11px/1 var(--font-mono); padding: 4px 6px; border-radius: 6px; border: 1px solid var(--border-strong); color: var(--muted); background: rgba(0,0,0,.25); }

/* ---------- Announcement ---------- */
.announce {
  position: relative; z-index: calc(var(--z-nav) + 1);
  background: linear-gradient(90deg, #4a1f08, #7a3410 50%, #4a1f08);
  color: #ffe6cf; font-size: 14px; text-align: center; padding: 9px 48px;
  border-bottom: 1px solid rgba(255, 180, 110, .25);
}
.announce a { text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.announce .announce-close { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 36px; min-width: 36px; color: #ffe6cf; }

/* ---------- Navigation ---------- */
.nav-wrap { position: sticky; top: var(--maint-banner-h, 0px); z-index: var(--z-nav); padding: 14px 16px 0; pointer-events: none; }
.nav {
  pointer-events: auto;
  width: min(var(--container), 100%); margin-inline: auto; height: 64px;
  display: flex; align-items: center; gap: 12px; padding: 0 10px 0 14px;
  border-radius: 20px; border: 1px solid transparent;
  transition: background-color .3s, border-color .3s, box-shadow .3s, backdrop-filter .3s;
}
.nav-wrap.scrolled .nav, .nav-wrap.solid .nav {
  background: rgba(20, 15, 11, .72); border-color: var(--border);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 10px 40px -15px rgba(0,0,0,.8);
}
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; user-select: none; -webkit-user-select: none; }
.brand img { width: 36px; height: 36px; filter: drop-shadow(0 2px calc(10px + var(--charge, 0) * 22px) rgba(240,138,60,calc(.35 + var(--charge, 0) * .65))) brightness(calc(1 + var(--charge, 0) * .55)); }
.brand-blown img { opacity: 0; transform: scale(1.8); transition: opacity .2s, transform .2s; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font: italic 800 16px/1.05 var(--font-display); text-transform: uppercase; letter-spacing: -0.02em; white-space: nowrap; }
.status-pill, .nav-actions .btn { white-space: nowrap; }
.brand-text small { font-size: 11px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.nav-links { list-style: none; display: flex; gap: 4px; margin: 0 auto; padding: 0; }
.nav-links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 12px;
  color: var(--text-2); font-weight: 500; font-size: 15px; white-space: nowrap; position: relative;
  transition: color .2s, background-color .2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 7px; height: 2px; border-radius: 2px; background: var(--ember); box-shadow: 0 0 12px var(--ember); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; }
.search-trigger { border-color: var(--border); padding: 0 10px 0 12px; }
.search-trigger .kbd { display: none; } /* Ctrl+K still opens search; the bar has no room to show it */

.status-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 600; border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  max-width: 172px;
}
.status-pill-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.dot.live { background: var(--success); box-shadow: 0 0 0 0 rgba(76,195,138,.6); animation: pulse 2s infinite; }
.dot.soon { background: var(--ember); box-shadow: 0 0 10px var(--ember); }
.dot.off { background: var(--danger); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(76,195,138,.55);} 70% { box-shadow: 0 0 0 8px rgba(76,195,138,0);} 100% { box-shadow: 0 0 0 0 rgba(76,195,138,0);} }

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate;
  min-height: min(100svh, 940px); margin-top: calc(-1 * (var(--nav-h) + 6px));
  display: flex; align-items: center; padding: calc(var(--nav-h) + 60px) 0 120px;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: -3; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; transform: scale(1.06); animation: heroZoom 24s ease-out forwards; }
@keyframes heroZoom { to { transform: scale(1); } }
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -2;
  background:
    linear-gradient(90deg, rgba(13,10,8,.94) 0%, rgba(13,10,8,.78) 38%, rgba(13,10,8,.25) 70%, rgba(13,10,8,.55) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(13,10,8,0) 30%),
    radial-gradient(60% 50% at 45% 60%, rgba(240,138,60,.12), transparent 70%);
}
.embers { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.9fr); gap: 48px; align-items: center; }
.hero-tag { display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 10px; border: 1.5px solid rgba(255,240,225,.6); border-radius: var(--radius-pill); font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; background: rgba(0,0,0,.2); backdrop-filter: blur(6px); }
.hero-kicker { font: italic 600 clamp(20px, 2.6vw, 34px)/1.1 var(--font-display); text-transform: uppercase; letter-spacing: -0.02em; margin: 26px 0 10px; color: #fff; }
.hero h1 { font-size: clamp(54px, 9.4vw, 136px); text-shadow: 0 10px 50px rgba(0,0,0,.45); }
.hero-lead { margin: 26px 0 0; max-width: 620px; font-size: clamp(16px, 1.35vw, 19px); line-height: 1.6; color: var(--text-2); }
.hero-lead strong { color: #fff; font-style: italic; font-family: var(--font-display); text-transform: uppercase; font-weight: 700; letter-spacing: -0.01em; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-features { display: grid; gap: 14px; }
.feature-glass {
  display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: center;
  padding: 18px 20px; border-radius: 22px;
  background: linear-gradient(135deg, rgba(255,245,235,.16), rgba(255,245,235,.05));
  border: 1.5px solid rgba(255,240,225,.38);
  backdrop-filter: blur(16px) saturate(120%); -webkit-backdrop-filter: blur(16px) saturate(120%);
  box-shadow: 0 20px 40px -20px rgba(0,0,0,.6);
  transition: transform .3s var(--ease), border-color .3s, background-color .3s;
}
.feature-glass:hover { transform: translateX(-4px); border-color: rgba(255,200,150,.6); }
.feature-glass .fi { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: rgba(255,255,255,.12); color: #fff; }
.feature-glass .fi .i { width: 28px; height: 28px; }
.feature-glass h3 { font: italic 800 16px/1.15 var(--font-display); text-transform: uppercase; letter-spacing: -0.02em; }
.feature-glass p { margin: 4px 0 0; font-size: 14px; line-height: 1.4; color: var(--text-2); }
.scroll-cue { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 2px solid rgba(255,255,255,.6); color: #fff; animation: bob 2.4s ease-in-out infinite; }
.scroll-cue:hover { border-color: var(--ember-2); color: var(--ember-2); }
@keyframes bob { 50% { transform: translate(-50%, 6px); } }

/* ---------- Sections ---------- */
.section { padding: 110px 0; position: relative; }
.section-tight { padding: 70px 0; }

/* Status strip */
.status-strip { margin-top: -70px; position: relative; z-index: 2; }
.status-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 16px; }
.panel {
  background: linear-gradient(180deg, rgba(255,238,220,.06), rgba(255,238,220,.025));
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.panel-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.stat-big { font: italic 800 clamp(36px, 4vw, 48px)/1 var(--font-display); letter-spacing: -0.03em; margin-top: 14px; }
.stat-big small { font-size: .45em; color: var(--muted); font-style: normal; font-weight: 600; letter-spacing: 0; }
.status-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; color: var(--text-2); font-size: 14px; }
.status-meta span { display: inline-flex; align-items: center; gap: 6px; }
.meter { height: 6px; border-radius: 6px; background: rgba(255,255,255,.08); margin-top: 16px; overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--ember-deep), var(--ember-2)); transition: width .8s var(--ease); }
.code-chip { display: inline-flex; align-items: center; gap: 10px; margin-top: 14px; padding: 8px 8px 8px 14px; border-radius: 12px; border: 1px dashed var(--border-strong); font: 500 18px var(--font-mono); letter-spacing: .08em; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.countdown div { text-align: center; padding: 10px 4px; border-radius: 12px; background: rgba(0,0,0,.25); border: 1px solid var(--border); }
.countdown b { display: block; font: italic 800 26px/1 var(--font-display); }
.countdown span { font-size: 11px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }

/* Cinematic banner */
.cinema {
  position: relative; border-radius: 32px; overflow: hidden; min-height: 520px; isolation: isolate;
  display: flex; align-items: flex-end; border: 1px solid var(--border);
}
.cinema img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 1.2s var(--ease); }
.cinema:hover img { transform: scale(1.03); }
.cinema::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(13,10,8,.96) 0%, rgba(13,10,8,.55) 45%, rgba(13,10,8,.05) 80%); }
.cinema-body { padding: clamp(28px, 5vw, 56px); width: 100%; }
.cinema h2 { font-size: clamp(36px, 6vw, 84px); max-width: 900px; }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 34px; }
.pillar { padding: 20px; border-radius: var(--radius); background: rgba(13,10,8,.55); border: 1px solid var(--border); backdrop-filter: blur(10px); }
.pillar .i { color: var(--ember-2); }
.pillar h3 { font-size: 17px; margin: 12px 0 6px; }
.pillar p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.55; }

/* Department cards */
.dept-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.dept-card {
  --c: var(--ember);
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 14px;
  padding: 26px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border);
  transition: border-color .25s, background-color .25s, transform .25s var(--ease);
}
.dept-card::before { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--c) 20%, transparent), transparent 55%); opacity: .6; transition: opacity .3s; pointer-events: none; }
.dept-card:hover { border-color: color-mix(in srgb, var(--c) 55%, transparent); transform: translateY(-3px); }
.dept-card:hover::before { opacity: 1; }
.dept-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: relative; }
.dept-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.dept-icon .i { width: 26px; height: 26px; }
.dept-card h3 { font-size: 19px; position: relative; }
.dept-card p { margin: 0; color: var(--muted); font-size: 15px; position: relative; flex: 1; }
.dept-short { font: 500 12px var(--font-mono); letter-spacing: .1em; color: var(--c); }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; border: 1px solid var(--border); color: var(--text-2); background: var(--surface); white-space: nowrap; }
.badge-ember { color: var(--ember-2); border-color: rgba(240,138,60,.35); background: rgba(240,138,60,.1); }
.badge-success { color: #7ee0ae; border-color: rgba(76,195,138,.35); background: rgba(76,195,138,.1); }
.badge-muted { color: var(--muted); }
.dept-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.badge-soon { color: #9cc3ff; border-color: rgba(106,165,255,.35); background: rgba(106,165,255,.1); }
.dept-announce { position: relative; display: flex; gap: 10px; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5; color: var(--text); background: color-mix(in srgb, var(--c) 10%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); overflow-wrap: anywhere; }
.dept-announce .i { margin-top: 2px; color: var(--c); }
.dept-shout { background: rgba(0,0,0,.18); border-color: var(--border); }
.dept-shout span { min-width: 0; }
.dept-shout small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.dept-banner { position: relative; height: 112px; margin: -26px -26px 0; overflow: hidden; }
.dept-banner img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dept-top-overlap { margin-top: -46px; align-items: flex-end; }
.dept-logo { position: relative; flex-shrink: 0; width: 68px; height: 68px; }
.dept-logo > img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 18px; border: 3px solid var(--surface-solid); background: var(--surface-solid); }
.dept-logo-icon { position: absolute; right: -6px; bottom: -6px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: var(--c); background: var(--surface-solid); border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); }
.dept-closed { position: relative; color: var(--muted); background: rgba(255, 245, 235, .04); border-color: var(--border); cursor: not-allowed; }
.dept-closed:hover { color: #ff9d92; background: rgba(239, 90, 76, .12); border-color: rgba(239, 90, 76, .45); }
.dept-closed:active { transform: none; }
.dept-actions { position: relative; display: flex; flex-wrap: wrap; gap: 8px; }
.dept-detail { display: grid; gap: 18px; justify-items: stretch; padding: 30px 0 90px; }
.dept-detail > .btn-quiet { justify-self: start; }
.dept-detail-card { overflow: hidden; border-radius: var(--radius-lg); border: 1px solid color-mix(in srgb, var(--c) 35%, var(--border)); background: var(--surface); }
.dept-detail-card .dept-banner { margin: 0; border-radius: 0; height: 200px; }
.dept-detail-body { display: grid; gap: 14px; padding: 24px; }
.dept-detail-body h1 { margin: 2px 0 0; font-size: clamp(30px, 5vw, 44px); overflow-wrap: anywhere; }
.dept-detail-lead { margin: 0; max-width: 760px; color: var(--text-2); font-size: 17px; line-height: 1.6; }
.dept-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.dept-stats > div { display: grid; min-width: 110px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--border); background: rgba(0,0,0,.18); }
.dept-stats b { font: italic 800 26px/1.1 var(--font-display); color: var(--c); }
.dept-stats span { font-size: 13px; color: var(--muted); }
.dept-detail-section { display: grid; gap: 12px; padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); }
.dept-detail-section h2 { font-size: 22px; }
.dept-overview { margin: 0; color: var(--text-2); line-height: 1.7; white-space: pre-line; overflow-wrap: anywhere; }
.leader-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.leader { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: rgba(0,0,0,.18); }
a.leader { transition: border-color .2s; }
a.leader:hover { border-color: color-mix(in srgb, var(--c, var(--ember)) 55%, transparent); }
.leader-text { display: grid; min-width: 0; }
.leader-text b { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.leader-text small { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.dept-part-list { display: grid; gap: 12px; }
.dept-part { display: grid; gap: 10px; padding: 16px; border-radius: 14px; border: 1px solid var(--border); background: rgba(0,0,0,.14); }
.dept-part-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.dept-part-head h3 { font-size: 17px; overflow-wrap: anywhere; }
.dept-part-text { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.dept-subs { display: grid; gap: 8px; margin-top: 2px; }
.dept-subs h4 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dept-sub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 10px; }

/* Staff team */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.team-card { overflow: hidden; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.team-card .profile-banner { height: 84px; }
.team-card-main { display: grid; gap: 10px; padding: 0 20px 20px; }
.team-card-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: -32px; position: relative; }
.team-card-head .avatar { width: 64px; height: 64px; font-size: 21px; border: 3px solid var(--surface-solid); box-sizing: content-box; }
.team-card h2 { font-size: 18px; margin: 4px 0 0; overflow-wrap: anywhere; }
.team-card h2 a:hover { color: var(--ember-2); }

/* Profiles */
img.avatar { object-fit: cover; display: block; background: var(--surface-solid); } /* solid, so a banner never shows through a transparent picture */
.profile-banner { height: 180px; background: linear-gradient(135deg, #3a1d0b, #160f0a); overflow: hidden; }
.profile-banner img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-select: none; }
.profile-banner.adjusting { cursor: grab; touch-action: none; outline: 2px dashed var(--ember-2); outline-offset: -2px; }
.profile-banner.adjusting:active { cursor: grabbing; }
.banner-editor { display: grid; gap: 14px; padding: 14px; border-radius: 14px; border: 1px solid var(--border); background: rgba(0,0,0,.18); }
.banner-editor p { margin: 0; font-size: 14px; color: var(--text-2); }
.banner-sliders { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px 18px; }
.banner-slider { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.banner-slider input { width: 100%; height: 24px; margin: 0; accent-color: var(--ember); cursor: pointer; }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; }
.badge-row .i { width: 14px; height: 14px; }
.account-badges { grid-column: 1 / -1; min-width: 0; margin: 0; padding: 0; border: 0; }
.account-badges legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.account-badges[disabled] { opacity: .55; }
.badge-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.badge-toggle { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; transition: color .15s, background-color .15s, border-color .15s; }
.badge-toggle:hover { color: var(--text); border-color: color-mix(in srgb, var(--c) 45%, var(--border)); }
.badge-toggle:has(input:checked) { color: var(--c); border-color: color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 14%, transparent); }
.badge-toggle:has(input:focus-visible) { outline: 2px solid var(--ember-2); outline-offset: 2px; }
.account-badges[disabled] .badge-toggle { cursor: not-allowed; }
.profile-card { overflow: hidden; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.profile-body { display: grid; gap: 14px; padding: 0 26px 26px; }
.profile-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: -48px; position: relative; flex-wrap: wrap; }
.profile-head .avatar { width: 96px; height: 96px; font-size: 32px; border: 4px solid var(--surface-solid); box-sizing: content-box; }
.profile-body h1 { font-size: 32px; overflow-wrap: anywhere; }
.profile-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0; font-size: 14px; }
.profile-handle { color: var(--text-2); font-size: 14px; overflow-wrap: anywhere; }
.profile-bio { margin: 0; color: var(--text-2); line-height: 1.7; white-space: pre-line; overflow-wrap: anywhere; }
.level-badge { color: var(--c); border-color: color-mix(in srgb, var(--c) 40%, transparent); background: color-mix(in srgb, var(--c) 12%, transparent); }
.portfolio { display: grid; gap: 18px; justify-items: start; padding: 30px 0 90px; }
.portfolio .profile-card { width: 100%; }
.account { display: grid; gap: 18px; padding: 30px 0 90px; }
.account .dash-head { margin-bottom: 6px; }
.account .card-form + .card-form { margin-top: 0; }
.image-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.image-btn { cursor: pointer; }
.image-btn:focus-within { outline: 2px solid var(--ember-2); outline-offset: 3px; }
.input-static { display: flex; align-items: center; color: var(--text-2); font-family: var(--font-mono); background: rgba(0,0,0,.14); }
.auth-switch { margin: 0 !important; text-align: center; font-size: 14px; }
.auth-switch a { color: var(--ember-2); font-weight: 600; }

.welcome { display: grid; gap: 18px; width: min(860px, 100% - 40px); padding: 30px 0 90px; }
.welcome-head { display: grid; gap: 8px; justify-items: start; }
.welcome-head h1 { margin: 0; font-size: clamp(34px, 6vw, 56px); overflow-wrap: anywhere; }
.welcome-head p { margin: 0; color: var(--text-2); line-height: 1.6; }
.welcome .card-form + .card-form, .welcome form + .card-form { margin-top: 0; }
.welcome-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.conn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 10px; }
.conn { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 8px 8px 12px; border-radius: 12px; border: 1px solid var(--border); background: rgba(0,0,0,.18); }
.conn-icon { position: relative; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--ember-2); background: rgba(240,138,60,.1); flex-shrink: 0; }
.conn-icon:has(.conn-avatar) { width: 44px; height: 44px; border-radius: 50%; }
.conn-avatar { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; background: var(--surface-2, #221610); }
.conn-handle { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.conn-note { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.conn-text { flex: 1; min-width: 0; display: grid; }
.conn-text small { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.conn-text b { font-size: 14px; overflow-wrap: anywhere; }
.conn-id { font: 500 12px var(--font-mono); color: var(--muted); overflow-wrap: anywhere; }
.conn-empty .conn-icon { color: var(--muted); background: var(--surface); }
.conn-empty b { color: var(--muted); font-weight: 500; }
.conn-block { display: grid; gap: 8px; align-content: start; }

.account-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 300px) 44px; gap: 12px 14px; align-items: center; padding: 16px; border-bottom: 1px solid var(--border); }
.account-row:last-of-type { border-bottom: 0; }
.account-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.account-id b { display: block; overflow-wrap: anywhere; }
.account-id small { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.account-conns, .account-bio { grid-column: 1 / -1; }
.account-bio { margin: 0; color: var(--text-2); font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.account-more { margin: 0; padding: 14px 16px; font-size: 14px; }

.level-item { display: grid; gap: 14px; padding: 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); transition: border-color .2s; }
.level-item:focus-within { border-color: var(--border-strong); }
.level-top { display: flex; align-items: center; gap: 12px; }
.level-name { flex: 1; min-width: 0; }
.level-name .input { min-height: 44px; font-weight: 600; }
.level-top .badge { flex-shrink: 0; min-width: 92px; justify-content: center; }
.level-color { display: block; flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; padding: 4px; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 12%, transparent); cursor: pointer; transition: box-shadow .2s; }
.level-color:hover { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); }
.level-color:focus-within { outline: 2px solid var(--ember-2); outline-offset: 2px; }
.level-color input { display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; appearance: none; -webkit-appearance: none; }
.level-color input:focus { outline: none; }
.level-color input::-webkit-color-swatch-wrapper { padding: 0; }
.level-color input::-webkit-color-swatch { border: 0; border-radius: 50%; }
.level-color input::-moz-color-swatch { border: 0; border-radius: 50%; }
.level-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; flex-shrink: 0; min-width: 136px; }
.level-action-slot { width: 44px; }
.level-actions .icon-btn { background: transparent; border-color: transparent; }
.level-actions .icon-btn:hover:not(:disabled) { background: var(--surface-2); }
.level-actions .icon-btn:disabled { opacity: .3; cursor: default; }
.level-actions [data-remove]:hover { color: #ff9d92; background: rgba(239,90,76,.12); }

.level-switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border-radius: 12px; background: rgba(0,0,0,.18); border: 1px solid var(--border); cursor: pointer; }
.level-switch-text b, .perm-text b, .level-note b { display: block; font-size: 14px; font-weight: 600; color: var(--text); }
.level-switch-text small, .perm-text small, .level-note small { display: block; margin-top: 1px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.level-switch input, .app-switch input { flex-shrink: 0; position: relative; width: 42px; height: 24px; margin: 0; border-radius: var(--radius-pill); background: rgba(255,238,220,.14); cursor: pointer; appearance: none; -webkit-appearance: none; transition: background-color .2s; }
.level-switch input::after, .app-switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text); transition: transform .2s var(--ease); }
.level-switch input:checked, .app-switch input:checked { background: var(--ember); }
.level-switch input:checked::after, .app-switch input:checked::after { transform: translateX(18px); background: #1f0f03; }
.app-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; color: var(--muted); cursor: pointer; }
.app-switch-label { color: var(--text-2); margin-right: 4px; }
.app-switch-closed, .app-switch-open { transition: color .2s; }
.app-switch:not(:has(input:checked)) .app-switch-closed { color: var(--text); font-weight: 600; }
.app-switch:has(input:checked) .app-switch-open { color: var(--text); font-weight: 600; }

.level-perms { margin: 0; padding: 0; border: 0; min-width: 0; }
.level-perms legend { padding: 0; margin-bottom: 8px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 8px; }
.perm-option { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: rgba(0,0,0,.18); cursor: pointer; transition: border-color .15s, background-color .15s; }
.perm-option:hover { border-color: var(--border-strong); }
.perm-option:has(input:checked) { border-color: rgba(240,138,60,.5); background: rgba(240,138,60,.08); }
.perm-icon { flex-shrink: 0; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--muted); background: var(--surface); transition: color .15s, background-color .15s; }
.perm-option:has(input:checked) .perm-icon { color: var(--ember-2); background: rgba(240,138,60,.14); }
.perm-text { flex: 1; min-width: 0; }
.level-note { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: rgba(0,0,0,.18); border: 1px dashed var(--border-strong); }
.level-note .i { margin-top: 2px; color: var(--c); }

/* Post cards */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.post-card {
  display: flex; flex-direction: column; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color .25s, transform .25s var(--ease), background-color .25s;
}
.post-card:hover { border-color: rgba(240,138,60,.45); transform: translateY(-4px); background: var(--surface-2); }
.post-cover { aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(135deg, #3a1d0b, #160f0a); position: relative; }
.post-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.post-card:hover .post-cover img { transform: scale(1.05); }
.post-cover .placeholder { position: absolute; inset: 0; display: grid; place-items: center; }
.post-cover .placeholder img { width: 64px; height: 64px; opacity: .5; object-fit: contain; }
.post-body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.post-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }
.post-card h3 { font-size: 20px; line-height: 1.25; }
.post-card p { margin: 0; color: var(--muted); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card .read-more { margin-top: auto; padding-top: 8px; display: inline-flex; align-items: center; gap: 6px; color: var(--ember-2); font-weight: 600; font-size: 14px; }
.post-card .read-more .i { transition: transform .2s; }
.post-card:hover .read-more .i { transform: translateX(4px); }
.post-card.featured { grid-column: span 3; flex-direction: row; }
.post-card.featured .post-cover { aspect-ratio: auto; flex: 1.3; min-height: 340px; }
.post-card.featured .post-body { flex: 1; padding: 36px; justify-content: center; }
.post-card.featured h3 { font-size: clamp(26px, 3vw, 36px); }

/* Docs quick links */
.doc-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.doc-link { display: flex; gap: 16px; align-items: flex-start; padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); transition: border-color .2s, background-color .2s; }
.doc-link:hover { border-color: rgba(240,138,60,.45); background: var(--surface-2); }
.doc-link .di { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(240,138,60,.12); color: var(--ember-2); flex-shrink: 0; }
.doc-link h3 { font-size: 16px; font-family: var(--font-body); font-weight: 600; letter-spacing: 0; }
.doc-link p { margin: 4px 0 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.doc-link small { color: var(--ember-2); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }

/* CTA */
.cta-block {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: 32px; padding: clamp(40px, 7vw, 90px) clamp(24px, 5vw, 60px); text-align: center;
  background: radial-gradient(80% 120% at 50% 120%, rgba(240,138,60,.45), transparent 60%), linear-gradient(180deg, #1d140d, #120d09);
  border: 1px solid rgba(240,138,60,.3);
}
.cta-block::after { content: ''; position: absolute; inset: 0; z-index: -1; background: url('/img/coming-soon.webp') center / cover; opacity: .08; filter: blur(2px); }
.cta-block img.logo { width: 96px; height: 96px; margin: 0 auto 22px; filter: drop-shadow(0 10px 30px rgba(240,138,60,.5)); }
.cta-block h2 { font-size: clamp(34px, 6vw, 76px); }
.cta-block p { color: var(--text-2); max-width: 560px; margin: 18px auto 30px; font-size: 18px; }
.cta-block .discord-chip { display: inline-flex; align-items: center; gap: 10px; padding: 10px 22px; border: 2px solid rgba(255,255,255,.75); border-radius: var(--radius-pill); font: 500 22px var(--font-body); margin-top: 18px; transition: border-color .2s, color .2s; }
.cta-block .discord-chip:hover { border-color: var(--ember-2); color: var(--ember-2); }

/* ---------- Page header ---------- */
.page-hero { position: relative; padding: 70px 0 50px; overflow: hidden; isolation: isolate; }
.page-hero::before { content: ''; position: absolute; inset: -40% -10% 0; z-index: -1; background: radial-gradient(50% 60% at 20% 30%, rgba(240,138,60,.16), transparent 70%), radial-gradient(40% 50% at 90% 0%, rgba(155,79,23,.25), transparent 70%); }
.page-hero h1 { font-size: clamp(44px, 7vw, 92px); margin-top: 14px; }
.page-hero p { color: var(--text-2); font-size: 18px; max-width: 620px; margin: 18px 0 0; }

.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 30px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 40px; padding: 0 16px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 14px; font-weight: 500; transition: all .2s; }
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip[aria-pressed="true"] { background: var(--ember); border-color: var(--ember); color: #1f0f03; font-weight: 600; }
.input-icon { position: relative; display: block; }
.input-icon .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon input { padding-left: 42px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span, .field-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field small { color: var(--muted); font-size: 12px; }
.input, .textarea, .select {
  width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 12px;
  background: rgba(0,0,0,.28); border: 1px solid var(--border-strong); color: var(--text);
  transition: border-color .2s, box-shadow .2s, background-color .2s; font-size: 15px;
}
.input::placeholder, .textarea::placeholder { color: #7d6d61; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--ember); box-shadow: 0 0 0 3px rgba(240,138,60,.22); background: rgba(0,0,0,.4); }
.textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23a8968a' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
.select { color-scheme: dark; }
.select option { background: var(--surface-solid); color: var(--text); }
.dd { position: relative; display: block; min-width: 0; }
.dd[hidden] { display: none; }
.dd > select.select { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.dd-trigger { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px 8px 14px; background-image: none; text-align: left; line-height: 1.4; cursor: pointer; }
.dd-trigger:hover:not(:disabled) { background-color: rgba(0,0,0,.4); border-color: color-mix(in srgb, var(--ember) 40%, var(--border-strong)); }
.dd-trigger:focus-visible, .dd.is-open .dd-trigger { outline: none; border-color: var(--ember); box-shadow: 0 0 0 3px rgba(240,138,60,.22); background-color: rgba(0,0,0,.4); }
.dd-trigger:disabled { opacity: .55; cursor: not-allowed; }
.dd-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-chevron { flex-shrink: 0; color: var(--muted); transition: transform .2s var(--ease), color .2s; }
.dd-trigger:hover:not(:disabled) .dd-chevron { color: var(--text-2); }
.dd.is-open .dd-chevron { color: var(--ember-2); transform: rotate(180deg); }
.dd-menu { position: fixed; z-index: calc(var(--z-modal) + 1); display: grid; align-content: start; gap: 2px; padding: 6px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow); animation: pop .14s var(--ease); }
.dd-menu:focus { outline: none; }
.dd-group { padding: 10px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.dd-group:first-child { padding-top: 4px; }
.dd-option { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 38px; padding: 7px 10px; border-radius: 9px; font-size: 14px; line-height: 1.35; color: var(--text-2); cursor: pointer; transition: background-color .12s, color .12s; }
.dd-option.is-active { background: var(--surface-2); color: var(--text); }
.dd-option[aria-selected="true"] { font-weight: 600; color: var(--ember-2); background: rgba(240,138,60,.1); }
.dd-option[aria-selected="true"].is-active { background: rgba(240,138,60,.18); }
.dd-option[aria-disabled="true"] { opacity: .45; cursor: not-allowed; background: none; }
.dd-text { min-width: 0; overflow-wrap: anywhere; }
.dd-check { flex-shrink: 0; visibility: hidden; color: var(--ember-2); }
.dd-option[aria-selected="true"] .dd-check { visibility: visible; }
@media (pointer: coarse) { .dd-option { min-height: 44px; } }
@media print { .dd-menu { display: none; } }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: 15px; color: var(--text-2); }
/* Site-wide checkbox, radio and toggle style. Every checkbox and radio on any page gets this look; :where()
   keeps it at zero weight, so a component that draws its own control (switch rows, chip pickers,
   hidden inputs behind cards) still wins. A checkbox with role="switch" is drawn as a toggle. */
:where(input[type="checkbox"], input[type="radio"]) {
  flex-shrink: 0; width: 20px; height: 20px; margin: 0; border-radius: 6px; border: 1.5px solid var(--border-strong);
  background: rgba(0,0,0,.28) center / 14px no-repeat; vertical-align: middle;
  cursor: pointer; appearance: none; -webkit-appearance: none; transition: background-color .15s, border-color .15s, box-shadow .15s;
}
:where(input[type="radio"]) { border-radius: 50%; }
:where(input[type="checkbox"], input[type="radio"]):hover:not(:disabled) { border-color: var(--ember-2); }
:where(input[type="checkbox"], input[type="radio"]):focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(240,138,60,.35); }
:where(input[type="checkbox"], input[type="radio"]):disabled { cursor: not-allowed; opacity: .5; }
:where(input[type="checkbox"]):checked {
  background-color: var(--ember); border-color: var(--ember);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%231f0f03' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
:where(input[type="checkbox"]):indeterminate {
  background-color: var(--ember); border-color: var(--ember);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%231f0f03' stroke-width='3' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E");
}
:where(input[type="radio"]):checked { border-color: var(--ember); background-color: var(--ember); background-image: radial-gradient(circle, #1f0f03 0 4px, transparent 5px); background-size: auto; }
:where(input[type="checkbox"][role="switch"]) {
  position: relative; width: 42px; height: 24px; border: 0; border-radius: var(--radius-pill); background: rgba(255,238,220,.14); transition: background-color .2s;
}
:where(input[type="checkbox"][role="switch"])::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text); transition: transform .2s var(--ease); }
:where(input[type="checkbox"][role="switch"]):checked { background: var(--ember); }
:where(input[type="checkbox"][role="switch"]):checked::after { transform: translateX(18px); background: #1f0f03; }
.tr-ed-correct input:checked { background-color: var(--success); border-color: var(--success); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-error { color: #ff9d92; font-size: 14px; display: flex; gap: 8px; align-items: center; }

/* ---------- Article / markdown ---------- */
.prose { color: var(--text-2); font-size: 17px; line-height: 1.8; max-width: 72ch; }
.prose > :first-child { margin-top: 0; }
.prose h2, .prose h3, .prose h4 { color: var(--text); scroll-margin-top: 100px; }
.prose h2 { font-size: 28px; margin: 2.2em 0 .6em; padding-bottom: .4em; border-bottom: 1px solid var(--border); }
.prose h3 { font-size: 21px; margin: 1.8em 0 .5em; }
.prose h4 { font-size: 17px; margin: 1.5em 0 .4em; }
.prose p { margin: 0 0 1.1em; }
.prose a { color: var(--ember-2); text-decoration: underline; text-decoration-color: rgba(255,179,107,.4); text-underline-offset: 3px; transition: text-decoration-color .2s; }
.prose a:hover { text-decoration-color: var(--ember-2); }
.prose strong { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--ember); }
.prose img { border-radius: var(--radius); border: 1px solid var(--border); margin: 1.6em 0; }
.prose hr { border: 0; height: 1px; background: var(--border); margin: 2.4em 0; }
.prose code { font: 500 .88em var(--font-mono); padding: .15em .45em; border-radius: 6px; background: rgba(255,238,220,.08); color: #ffd1a8; }
.prose pre { background: #0a0806; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; overflow-x: auto; margin: 1.4em 0; }
.prose pre code { background: none; padding: 0; color: var(--text-2); font-size: 14px; }
.prose blockquote { margin: 1.4em 0; padding: 14px 20px; border-left: 3px solid var(--ember); background: rgba(240,138,60,.07); border-radius: 0 12px 12px 0; color: var(--text-2); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose .callout { border-left-width: 3px; }
.prose .callout-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.prose .callout-note { border-color: var(--info); background: rgba(106,165,255,.08); } .prose .callout-note .callout-title { color: var(--info); }
.prose .callout-tip { border-color: var(--success); background: rgba(76,195,138,.08); } .prose .callout-tip .callout-title { color: var(--success); }
.prose .callout-warning { border-color: var(--warning); background: rgba(240,180,41,.08); } .prose .callout-warning .callout-title { color: var(--warning); }
.prose .callout-important { border-color: var(--danger); background: rgba(239,90,76,.08); } .prose .callout-important .callout-title { color: #ff8a7e; }
.prose .table-wrap { overflow-x: auto; margin: 1.4em 0; border: 1px solid var(--border); border-radius: var(--radius); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.prose th { background: var(--surface-2); color: var(--text); font-weight: 600; }
.prose tr:last-child td { border-bottom: 0; }
.prose .anchor { opacity: 0; margin-left: 8px; color: var(--muted); text-decoration: none; transition: opacity .2s; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; }

/* Article page */
.update-page { padding-bottom: 80px; }
.update-count { margin-left: 4px; font-size: 12px; opacity: .65; }
.update-feed { display: grid; gap: 12px; }
.update-card { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 24px; padding: 22px 24px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); transition: border-color .2s, background-color .2s; }
.update-card:hover { border-color: rgba(240,138,60,.45); background: var(--surface-2); }
.update-date { padding-top: 4px; color: var(--muted); font-size: 14px; font-weight: 500; }
.update-main { display: grid; justify-items: start; gap: 8px; min-width: 0; }
.update-main h2 { font-size: 22px; line-height: 1.25; overflow-wrap: anywhere; }
.update-main p { margin: 0; color: var(--text-2); line-height: 1.6; overflow-wrap: anywhere; }
.update-main .read-more { display: inline-flex; align-items: center; gap: 6px; color: var(--ember-2); font-weight: 600; font-size: 14px; }
.update-main .read-more .i { transition: transform .2s; }
.update-card:hover .read-more .i { transform: translateX(4px); }
.update-article .article-hero { padding-bottom: 30px; }
.update-body { padding-bottom: 80px; }
@media (max-width: 640px) {
  .update-card { grid-template-columns: minmax(0, 1fr); padding: 18px; }
}
.article-hero { padding: 50px 0 0; }
.article-hero .back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; font-weight: 500; min-height: 44px; transition: color .2s; }
.article-hero .back:hover { color: var(--text); }
.article-hero h1 { font-size: clamp(34px, 5.5vw, 64px); max-width: 960px; margin: 18px 0 20px; line-height: 1.04; }
.article-cover { margin: 40px 0 50px; border-radius: 28px; overflow: hidden; aspect-ratio: 21 / 9; border: 1px solid var(--border); }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 60px; align-items: start; padding-bottom: 80px; }
.author { display: flex; align-items: center; gap: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: linear-gradient(135deg, var(--ember), var(--oak)); color: #1f0f03; font-size: 15px; flex-shrink: 0; }
.aside-card { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 14px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.share-row { display: flex; gap: 8px; }

/* ---------- Docs ---------- */
.docs-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr) 220px; gap: 48px; padding: 40px 0 90px; align-items: start; }
.docs-nav { position: sticky; top: 96px; max-height: calc(100vh - 120px); overflow-y: auto; padding-right: 8px; scrollbar-width: thin; }
.docs-nav .input-icon { margin-bottom: 20px; }
.docs-group { margin-bottom: 22px; }
.docs-group h4 { font: 600 12px var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px 12px; }
.docs-group a { display: flex; align-items: center; min-height: 40px; padding: 8px 12px; border-radius: 10px; color: var(--text-2); font-size: 15px; border-left: 2px solid transparent; transition: background-color .2s, color .2s; }
.docs-group a:hover { background: var(--surface); color: var(--text); }
.docs-group a.active { background: rgba(240,138,60,.1); color: var(--ember-2); border-left-color: var(--ember); border-radius: 0 10px 10px 0; font-weight: 600; }
.docs-content h1 { font-size: clamp(34px, 4.5vw, 52px); margin: 10px 0 14px; }
.docs-crumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.docs-summary { font-size: 19px; color: var(--text-2); margin: 0 0 14px; max-width: 70ch; }
.docs-updated { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); padding-bottom: 28px; margin-bottom: 34px; border-bottom: 1px solid var(--border); }
.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 60px; }
.docs-pager a { padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); transition: border-color .2s; display: flex; flex-direction: column; gap: 4px; }
.docs-pager a:hover { border-color: rgba(240,138,60,.45); }
.docs-pager small { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 4px; }
.docs-pager b { font-weight: 600; color: var(--text); }
.docs-pager .next { text-align: right; align-items: flex-end; grid-column: 2; }
.toc { position: sticky; top: 100px; font-size: 14px; }
.toc h4 { font: 600 12px var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc a { display: block; padding: 6px 0 6px 14px; margin-left: -1px; color: var(--muted); border-left: 1px solid transparent; transition: color .2s, border-color .2s; line-height: 1.4; }
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--ember-2); border-left-color: var(--ember); }
.toc .lvl-3 a { padding-left: 26px; font-size: 13px; }
.docs-mobile-nav { display: none; }

/* ---------- Staff / dashboard ---------- */
.auth-wrap { min-height: calc(100vh - 200px); display: grid; place-items: center; padding: 40px 16px 80px; }
.auth-card { width: min(420px, 100%); padding: 36px; border-radius: 28px; background: linear-gradient(180deg, rgba(255,238,220,.07), rgba(255,238,220,.02)); border: 1px solid var(--border); box-shadow: var(--shadow); }
.auth-card img { width: 64px; height: 64px; margin-bottom: 18px; }
.auth-card h1 { font-size: 30px; }
.auth-card p { color: var(--muted); margin: 8px 0 26px; }
.auth-card form { display: grid; gap: 16px; }

.dash { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; padding: 30px 0 90px; align-items: start; }
.side-heading { margin: 10px 12px 2px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.dash-side { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 112px); overflow-y: auto; scrollbar-width: thin; padding: 14px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.dash-user { display: flex; align-items: center; gap: 12px; padding: 8px 8px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.dash-user b { display: block; font-size: 15px; }
.dash-user small { color: var(--muted); font-size: 12px; text-transform: capitalize; }
.dash-side a, .dash-side button.side-link { display: flex; flex-shrink: 0; align-items: center; gap: 12px; min-height: 36px; padding: 0 12px; border-radius: 12px; color: var(--text-2); font-weight: 500; font-size: 14px; background: none; border: 0; text-align: left; width: 100%; transition: background-color .2s, color .2s; }
.dash-side a:hover, .dash-side button.side-link:hover { background: var(--surface-2); color: var(--text); }
.dash-side a.active { background: rgba(240,138,60,.12); color: var(--ember-2); }
.dash-side .count { margin-left: auto; font-size: 12px; color: var(--muted); }
.side-divider { flex-shrink: 0; width: 100%; height: 0; margin: 8px 0; border: 0; border-top: 1px solid var(--border-strong); }
.dash-side button.side-signout { border: 1px solid rgba(239,90,76,.45); color: #ff9d92; transition: background-color .2s, border-color .2s, color .2s; }
.dash-side button.side-signout:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.dash-side button.side-signout:focus-visible { outline-color: var(--danger); }
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.dash-head h1 { font-size: 32px; }
.dash-head p { margin: 6px 0 0; color: var(--muted); }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.stat-card { padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.stat-card small { color: var(--muted); font-size: 13px; }
.stat-card b { display: block; font: italic 800 34px/1.1 var(--font-display); margin-top: 6px; }

.table-card { border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.table-card .table-tools { display: flex; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.table-card .table-tools .input-icon { flex: 1; min-width: 200px; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--border); background: rgba(0,0,0,.15); }
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 15px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background-color .15s; }
.data-table tbody tr:hover { background: rgba(255,238,220,.03); }
.data-table .title-cell a { font-weight: 600; color: var(--text); }
.data-table .title-cell a:hover { color: var(--ember-2); }
.data-table .title-cell small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty .i { width: 40px; height: 40px; color: var(--ember); opacity: .7; margin: 0 auto 14px; }
.empty h3 { color: var(--text); font-size: 20px; margin-bottom: 6px; }

.card-form { padding: 26px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); display: grid; gap: 18px; }
.card-form h2 { font-size: 20px; }
.card-form .form-grid[hidden], .card-form .field[hidden] { display: none; }
.card-form + .card-form, form + .card-form { margin-top: 18px; }
.backup-row { display: flex; align-items: center; justify-content: space-between; gap: 16px 28px; flex-wrap: wrap; }
.backup-text { flex: 1 1 340px; min-width: 0; display: grid; gap: 8px; }
.backup-last { margin: 0; font-size: 13px; font-weight: 600; color: var(--text-2); }
.backup-warning { display: flex; gap: 8px; margin: 2px 0 0; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(239,90,76,.45); background: rgba(239,90,76,.1); color: #ff9d92; font-size: 13px; font-weight: 500; line-height: 1.45; }
.backup-warning .i { flex-shrink: 0; margin-top: 1px; }
.dash-head + .backup-warning { margin: 0 0 18px; }
[data-product-list]:empty { display: none; }
.count-alert { color: #ff9d92; font-weight: 600; }
.backup-row .btn { flex-shrink: 0; }
@media (max-width: 700px) {
  .backup-row { justify-content: center; }
}
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

.color-input { height: 46px; width: 100%; padding: 4px; border-radius: 12px; border: 1px solid var(--border-strong); background: rgba(0,0,0,.28); cursor: pointer; }

.dept-image-row { display: flex; align-items: center; gap: 12px; }
.dept-image-preview { flex-shrink: 0; display: grid; place-items: center; overflow: hidden; color: var(--muted); background: rgba(0,0,0,.28); border: 1px solid var(--border-strong); }
.dept-image-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dept-image-banner { width: 150px; height: 56px; border-radius: 10px; }
.dept-image-logo { width: 56px; height: 56px; border-radius: 14px; }
.shouts-heading { margin: 26px 0 12px; font-size: 18px; overflow-wrap: anywhere; }
.shout-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.shout-row:last-child { border-bottom: 0; }
.shout-text { flex: 1; min-width: 0; }
.shout-text p { margin: 0 0 2px; overflow-wrap: anywhere; white-space: pre-line; }
.shout-text small { color: var(--muted); font-size: 13px; }

/* Department editor: quiet rows that open one at a time */
.dept-list { display: grid; gap: 8px; }
.dept-row { position: relative; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); transition: border-color .2s; }
.dept-row:hover { border-color: var(--border-strong); }
.dept-row:has(.dept-more[open]) { border-color: color-mix(in srgb, var(--c) 45%, var(--border)); }
.dept-more summary { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 150px 10px 14px; border-radius: var(--radius); cursor: pointer; list-style: none; }
.dept-more summary::-webkit-details-marker { display: none; }
.dept-more-chevron { flex-shrink: 0; color: var(--muted); transition: transform .2s var(--ease); }
.dept-more[open] .dept-more-chevron { transform: rotate(90deg); }
.dept-row-tile { flex-shrink: 0; display: grid; place-items: center; overflow: hidden; width: 38px; height: 38px; border-radius: 10px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.dept-row-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dept-row-text { min-width: 0; display: grid; gap: 1px; }
.dept-row-text b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dept-row-text small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dept-edit-actions { position: absolute; top: 10px; right: 8px; display: flex; gap: 0; opacity: .55; transition: opacity .15s; }
.dept-row:hover .dept-edit-actions, .dept-edit-actions:focus-within { opacity: 1; }
.dept-edit-actions .icon-btn { background: transparent; border-color: transparent; }
.dept-edit-actions .icon-btn:hover:not(:disabled) { background: var(--surface-2); }
.dept-edit-actions .icon-btn:disabled { opacity: .3; cursor: default; }
.dept-edit-actions [data-remove]:hover { color: #ff9d92; background: rgba(239,90,76,.12); }
.dept-more-body { padding: 0 20px 6px; animation: fade .16s var(--ease); }
.dept-section { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 24px; padding: 20px 0; border-top: 1px solid var(--border); }
.dept-section-head h3 { margin: 0 0 4px; font: 600 14px var(--font-body); color: var(--text); }
.dept-section-head p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.dept-section-body { display: grid; gap: 14px; min-width: 0; }
.team-block { display: grid; gap: 8px; min-width: 0; }
.team-label { font-size: 12px; font-weight: 500; color: var(--muted); }
.team-count { max-width: 420px; }
.leader-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 40px; gap: 8px; align-items: center; }
.person-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.person-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-height: 32px; padding: 0 4px 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: rgba(255,238,220,.05); font-size: 13px; overflow-wrap: anywhere; }
.person-chip button { display: grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.person-chip button:hover { background: var(--surface-2); color: var(--text); }
.team-part { border-radius: 12px; border: 1px solid var(--border); background: rgba(0,0,0,.14); }
.team-part summary { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 8px 12px; cursor: pointer; list-style: none; }
.team-part summary::-webkit-details-marker { display: none; }
.team-part[open] > summary .dept-more-chevron { transform: rotate(90deg); }
.team-part-text { display: grid; min-width: 0; }
.team-part-text b { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.team-part-text small { font-size: 12px; color: var(--muted); }
.team-part-body { display: grid; gap: 14px; padding: 4px 14px 14px; }
.team-part-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.team-part-remove { margin-left: auto; color: #ff9d92; }
@media (max-width: 560px) {
  .leader-row { grid-template-columns: minmax(0, 1fr) 40px; }
  .leader-row .field:nth-child(2) { grid-column: 1; grid-row: 2; }
  .leader-row .icon-btn { grid-column: 2; grid-row: 1; }
}
.dept-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dept-field-name, .dept-field-wide { grid-column: span 1; }
.dept-field-wide { grid-column: 1 / -1; }
.dept-more-body .field { gap: 6px; }
.dept-more-body .field > span { font-size: 12px; font-weight: 500; color: var(--muted); }
.dept-more-body .input, .dept-more-body .textarea, .dept-more-body .icon-picker-trigger { min-height: 42px; padding-block: 8px; font-size: 14px; border-radius: 10px; border-color: var(--border); background: rgba(0,0,0,.16); }
.dept-more-body .textarea { min-height: 0; line-height: 1.5; }
.dept-more-body .input:focus, .dept-more-body .textarea:focus { border-color: var(--ember); }
.dept-more-body .icon-picker-tile { width: 26px; height: 26px; }
.dept-more-body .check { font-size: 14px; min-height: 36px; }
.dept-toggles { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 24px; }
.dept-more-body .app-switch { font-size: 14px; min-height: 36px; }
.dept-more-body .dept-image-preview { border-color: var(--border); background: rgba(0,0,0,.16); }
.dept-more-body .dept-image-banner { width: 96px; height: 44px; }
.dept-more-body .dept-image-logo { width: 44px; height: 44px; border-radius: 10px; }

/* Maintenance */
.maint-mode .nav-wrap, .maint-mode .footer, .maint-mode .announce, .maint-mode .maint-banner { display: none !important; }
.maint { position: relative; isolation: isolate; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 54px 20px; overflow: hidden; background: radial-gradient(900px 520px at 50% 108%, rgba(240,138,60,.3), transparent 70%), radial-gradient(700px 380px at 50% -8%, rgba(194,94,27,.17), transparent 70%), var(--bg, #0d0a08); }
.maint-bg { position: absolute; inset: 0; z-index: -2; background: url('/img/campfire.webp') center bottom / cover no-repeat; opacity: .12; mask-image: linear-gradient(to top, #000, transparent 75%); -webkit-mask-image: linear-gradient(to top, #000, transparent 75%); }
.maint-embers { position: absolute; inset: 0; overflow: hidden; }
.maint-embers i { position: absolute; bottom: -12px; width: 4px; height: 4px; border-radius: 50%; background: #ffb36b; box-shadow: 0 0 10px 2px rgba(240,138,60,.85); animation: maintEmber linear infinite; }
@keyframes maintEmber {
  0% { transform: translate(0, 0) scale(1); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translate(46px, -102vh) scale(.2); opacity: 0; }
}
.maint-tape { position: absolute; z-index: 1; top: 0; left: -100px; right: -100px; height: 16px; background: repeating-linear-gradient(-45deg, #f0a23c 0 22px, #17100c 22px 44px); box-shadow: 0 4px 20px rgba(0,0,0,.5); animation: maintTape 3.5s linear infinite; }
.maint-tape-bottom { top: auto; bottom: 0; animation-direction: reverse; }
@keyframes maintTape { to { transform: translateX(calc(-44px * 1.41421356)); } } /* exactly one stripe repeat, so the loop has no jump */
.maint-gear { position: absolute; z-index: -1; color: rgba(240,138,60,.13); animation: maintSpin 26s linear infinite; }
.maint-gear.g1 { width: 340px; left: -90px; top: 8%; }
.maint-gear.g2 { width: 210px; left: 186px; top: -46px; color: rgba(255,179,107,.09); animation-duration: 18s; animation-direction: reverse; }
.maint-gear.g3 { width: 400px; right: -130px; bottom: -70px; animation-duration: 32s; animation-direction: reverse; }
@keyframes maintSpin { to { transform: rotate(360deg); } }
.maint-exit { position: absolute; z-index: 2; top: 34px; right: 26px; }
.maint-flip { transform: rotate(180deg); }
.maint-inner { width: min(880px, 100%); display: flex; flex-direction: column; align-items: center; text-align: center; }
.maint-logo { width: 84px; height: 84px; object-fit: contain; filter: drop-shadow(0 6px 20px rgba(240,138,60,.42)); }
.maint-pill { display: inline-flex; align-items: center; gap: 9px; margin-top: 14px; padding: 6px 14px; border-radius: var(--radius-pill); border: 1px solid rgba(240,162,60,.45); background: rgba(240,138,60,.11); color: var(--ember-2); font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.maint-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 10px var(--ember); animation: maintPulse 1.6s ease-in-out infinite; }
@keyframes maintPulse { 50% { opacity: .3; } }
.maint-title { margin: 14px 0 0; font: italic 800 clamp(34px, 6vw, 60px)/1.08 var(--font-display); letter-spacing: -.03em; text-transform: uppercase; overflow-wrap: anywhere; }
.maint-message { max-width: 620px; margin: 10px 0 0; font-size: clamp(15px, 2vw, 17px); line-height: 1.55; color: var(--text-2); overflow-wrap: anywhere; }
.maint-back { display: inline-flex; align-items: center; gap: 8px; margin: 12px 0 0; color: var(--muted); font-size: 15px; }
.maint-back[hidden], .maint-reopened[hidden] { display: none; }
.maint-back b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.maint-reopened { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; padding: 10px 14px; border-radius: 14px; border: 1px solid rgba(62,207,120,.45); background: rgba(62,207,120,.1); font-weight: 600; }
.maint-game { width: 100%; margin-top: 20px; padding: 6px; border-radius: 20px; background: repeating-linear-gradient(-45deg, rgba(240,162,60,.8) 0 14px, #17100c 14px 28px); box-shadow: 0 24px 70px -20px rgba(240,120,40,.5), 0 18px 50px rgba(0,0,0,.6); }
.maint-game canvas { display: block; width: 100%; aspect-ratio: 16 / 5.6; border-radius: 15px; background: #120a10; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.maint-game canvas:focus-visible { outline: 2px solid var(--ember-2); outline-offset: 2px; }
.maint-keys { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.maint-keys kbd { padding: 2px 8px; border-radius: 6px; border: 1px solid var(--border); border-bottom-width: 2px; background: rgba(255,238,220,.06); font: 500 12px 'JetBrains Mono', monospace; color: var(--text-2); }
.maint-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }
.maint-signed-in { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.maint-signed-in b { color: var(--text-2); font-weight: 600; }
.maint-banner { position: sticky; top: 0; z-index: calc(var(--z-nav) + 2); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; min-height: 36px; padding: 7px 16px; text-align: center; font-size: 13px; font-weight: 600; color: #f1f1f3; background: #303035; border-bottom: 2px solid #5a5a60; animation: maintBannerFlash 1.6s ease-in-out infinite; }
.maint-banner > i { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: #ff4d4d; box-shadow: 0 0 10px #ff4d4d; animation: maintPulse 1.6s ease-in-out infinite; }
.maint-banner a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
@keyframes maintBannerFlash {
  0%, 100% { background: #303035; border-bottom-color: #5a5a60; }
  50% { background: #7a1f1f; border-bottom-color: #ff4d4d; }
}
.maint-status { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; padding: 18px 20px; border-radius: var(--radius-lg); border: 1px solid rgba(62,207,120,.32); background: rgba(62,207,120,.07); transition: background-color .25s, border-color .25s; }
.maint-status.is-closed { border-color: rgba(240,162,60,.55); background: repeating-linear-gradient(-45deg, rgba(240,162,60,.075) 0 18px, transparent 18px 36px), rgba(240,138,60,.08); }
.maint-status-icon { flex-shrink: 0; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: rgba(62,207,120,.15); color: #6fe09b; }
.maint-status.is-closed .maint-status-icon { background: rgba(240,138,60,.18); color: var(--ember-2); }
.maint-status-text { flex: 1; min-width: 0; }
.maint-status-text h2 { font-size: 20px; }
.maint-status-text p { margin: 3px 0 0; font-size: 14px; color: var(--text-2); }
.maint-switch { flex-shrink: 0; }
.maint-rules ul { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.maint-rules li { display: flex; gap: 10px; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.maint-rules li .i { flex-shrink: 0; margin-top: 3px; color: var(--ember-2); }
.maint-rules b { color: var(--text); font-weight: 600; }
@media (max-width: 700px) {
  .maint { padding: 42px 14px; place-items: start center; }
  .maint-exit { position: static; grid-row: 1; margin-bottom: 14px; }
  .maint-banner { display: block; min-height: 0; padding: 6px 12px; font-size: 12px; line-height: 1.35; }
  .maint-banner > i { display: none; }
  .maint-banner a { margin-left: 6px; }
  .maint-logo { width: 62px; height: 62px; }
  .maint-game canvas { aspect-ratio: 16 / 8; }
  .maint-gear.g1 { width: 220px; left: -100px; }
  .maint-gear.g2 { display: none; }
  .maint-gear.g3 { width: 260px; right: -110px; }
  .maint-status { flex-wrap: wrap; }
  .maint-switch { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .maint-gear, .maint-tape, .maint-embers i, .maint-pill i, .maint-banner, .maint-banner > i { animation: none; }
  .maint-banner { border-bottom-color: #ff4d4d; }
  .maint-embers { display: none; }
}

/* Roadwork Run: the game page and the gates that lead to it */
.arcade-inner { width: min(1180px, 100%, calc((100dvh - 190px) * 16 / 5.6)); min-width: min(100%, 620px); }
.arcade-back { margin-top: 16px; }
.game-gate { position: fixed; inset: 0; z-index: calc(var(--z-modal) - 2); overflow: hidden; }
.game-gate-panel { position: absolute; left: 0; right: 0; height: 50%; background: linear-gradient(180deg, #1d120c, #120b08); transition: transform .3s cubic-bezier(.7, 0, 1, .55); }
.game-gate-panel.top { top: 0; transform: translateY(-105%); }
.game-gate-panel.bottom { top: 50%; transform: translateY(105%); }
/* One 44px strip cut in half: each gate shows its half of the same image, so the stripes line up where they meet. */
.game-gate-panel::after { content: ''; position: absolute; left: 0; right: 0; height: 22px; background: repeating-linear-gradient(-45deg, #f0a23c 0 26px, #17100c 26px 52px) no-repeat; background-size: 100% 44px; box-shadow: 0 0 30px rgba(240,138,60,.45); }
.game-gate-panel.top::after { bottom: -1px; height: 23px; background-position: 0 0; } /* the extra pixel hides any hairline at the seam */
.game-gate-panel.bottom::after { top: 0; background-position: 0 100%; clip-path: inset(0 0 -60px 0); } /* keeps its glow off the top half */
.game-gate.shut .game-gate-panel { transform: none; }
.game-gate.shut.open .game-gate-panel { transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.game-gate.shut.open .game-gate-panel.top { transform: translateY(-105%); }
.game-gate.shut.open .game-gate-panel.bottom { transform: translateY(105%); }
.game-gate-hub { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 132px; height: 132px; border-radius: 50%; background: radial-gradient(circle, #2a170c, #120b08); border: 5px solid var(--ember); box-shadow: 0 0 50px rgba(240,138,60,.65); transform: translate(-50%, -50%) scale(0) rotate(-140deg); }
.game-gate-hub img { width: 76px; height: 76px; object-fit: contain; }
.game-gate.shut .game-gate-hub { transform: translate(-50%, -50%) scale(1) rotate(0); transition: transform .34s cubic-bezier(.2, 1.5, .4, 1) .22s; }
.game-gate.shut.open .game-gate-hub { transform: translate(-50%, -50%) scale(0) rotate(140deg); transition: transform .24s ease-in; }
.game-gate-label { position: absolute; left: 0; right: 0; top: calc(50% + 86px); text-align: center; font: italic 800 clamp(26px, 4vw, 42px)/1.1 var(--font-display); letter-spacing: -.02em; text-transform: uppercase; color: #fff; opacity: 0; }
.game-gate.shut .game-gate-label { opacity: 1; transition: opacity .25s .3s; }
.game-gate.shut.open .game-gate-label { opacity: 0; transition: opacity .12s; }
.game-gate.thud { animation: gateThud .34s ease-out; }
@keyframes gateThud {
  20% { transform: translateY(-9px); }
  45% { transform: translateY(6px); }
  70% { transform: translateY(-3px); }
}

/* Marketplace */
#navShop[hidden] { display: none; }
.shop-page { display: grid; gap: 18px; padding-bottom: 80px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.shop-card { display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); }
.shop-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 34px; padding-bottom: 16px; }
.shop-top h1 { font-size: 32px; }
.shop-top p { margin: 4px 0 0; color: var(--text-2); }
.shop-filters { display: grid; gap: 10px; }
.shop-filter-row { display: flex; flex-wrap: wrap; gap: 10px; }
.shop-search { flex: 1 1 280px; min-width: 0; }
.shop-sort { flex: 0 1 220px; min-width: 180px; }
.shop-results { display: grid; gap: 18px; }
.shop-results .conn-note { margin: 0; }
.shop-popup .modal-panel { display: grid; justify-items: start; gap: 10px; }
.shop-popup .modal-panel h2 { padding-right: 30px; font-size: clamp(28px, 6vw, 38px); overflow-wrap: anywhere; }
.shop-popup .modal-panel p { margin: 0; color: var(--text-2); line-height: 1.55; overflow-wrap: anywhere; }
.shop-popup-close { position: absolute; top: 14px; right: 14px; z-index: 1; }
.shop-popup-img { justify-self: stretch; width: calc(100% + 56px); max-width: none; height: 150px; margin: -28px -28px 6px; object-fit: cover; }
.shop-banner { position: relative; display: grid; min-height: 340px; overflow: hidden; isolation: isolate; border-radius: var(--radius-lg); border: 1px solid color-mix(in srgb, var(--ember) 35%, var(--border)); background: var(--surface); }
.shop-banner-bg { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.shop-banner-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; animation: shopBannerZoom 24s ease-in-out infinite alternate; }
@keyframes shopBannerZoom { from { transform: scale(1); } to { transform: scale(1.09); } }
.shop-banner::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(13,10,8,.94) 0%, rgba(13,10,8,.78) 42%, rgba(13,10,8,.3) 75%, rgba(13,10,8,.55) 100%), radial-gradient(60% 60% at 45% 60%, rgba(240,138,60,.12), transparent 70%); }
.shop-banner .embers { z-index: 1; }
.shop-banner-preview { min-height: 190px; }
.shop-banner-preview .shop-slide { padding: 24px 28px; }
.shop-banner-preview h3 { font-size: 32px; }
.shop-image-pick button[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .shop-banner-bg img { animation: none; } }
.shop-slide { grid-area: 1 / 1; position: relative; display: flex; align-items: center; min-width: 0; padding: 40px 44px 68px; isolation: isolate; opacity: 0; visibility: hidden; transition: opacity .6s var(--ease), visibility .6s; }
.shop-slide.is-active { opacity: 1; visibility: visible; }
.shop-slide-img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.shop-slide.has-image::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(10,8,6,.92), rgba(10,8,6,.6) 55%, rgba(10,8,6,.2)); }
.shop-slide-body { display: grid; justify-items: start; gap: 12px; max-width: 620px; min-width: 0; }
.shop-slide.is-active .shop-slide-body { animation: shopSlideIn .55s var(--ease); }
@keyframes shopSlideIn { from { opacity: 0; transform: translateX(18px); } }
@media (prefers-reduced-motion: reduce) { .shop-slide { transition: none; } .shop-slide.is-active .shop-slide-body { animation: none; } }
.shop-slide-body h2 { font-size: clamp(34px, 5.5vw, 64px); overflow-wrap: anywhere; }
.shop-slide-body p { margin: 0; color: var(--text-2); font-size: 17px; line-height: 1.55; overflow-wrap: anywhere; }
.shop-banner-nav { position: absolute; z-index: 2; right: 18px; bottom: 14px; display: flex; align-items: center; gap: 6px; }
.shop-dot { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.28); cursor: pointer; transition: background-color .2s, transform .2s; }
.shop-dot:hover { background: rgba(255,255,255,.55); }
.shop-dot[aria-current] { background: var(--ember); transform: scale(1.25); }
.shop-price { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 16px; }
.shop-price s { color: var(--muted); }
.shop-notices { display: grid; gap: 8px; }
.shop-notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(240,138,60,.3); background: rgba(240,138,60,.08); line-height: 1.5; overflow-wrap: anywhere; }
.shop-notice > .i { flex-shrink: 0; margin-top: 3px; color: var(--ember-2); }
.shop-notice > div { min-width: 0; }
.shop-notice b { display: block; }
.shop-notice p { margin: 0; color: var(--text-2); font-size: 15px; }
.shop-section { display: grid; gap: 12px; }
.shop-section h2 { font-size: 22px; }
.shop-card.is-featured { border-color: color-mix(in srgb, var(--ember) 45%, var(--border)); }
.shop-card-tag { justify-self: start; align-self: flex-start; }
.shop-ann-row { display: grid; gap: 12px; padding: 14px; border-radius: 12px; border: 1px solid var(--border); }
[data-ann-list]:empty { display: none; }
.shop-image-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.shop-image-pick img { width: 120px; height: 56px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); }
.shop-image-pick img[hidden], .shop-image-pick button[hidden] { display: none; }
@media (max-width: 700px) {
  .shop-banner { min-height: 0; }
  .shop-slide { padding: 26px 20px 64px; }
  .shop-banner-nav { left: 0; right: 0; justify-content: center; }
}
.shop-card h3 { font-size: 20px; overflow-wrap: anywhere; }
.shop-card p { flex: 1; margin: 0; color: var(--text-2); line-height: 1.55; overflow-wrap: anywhere; }
.shop-includes { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--text-2); }
.shop-includes li { display: flex; align-items: center; gap: 6px; }
.shop-buy { display: flex; flex-wrap: wrap; gap: 8px; }
.shop-steps { display: grid; gap: 10px; padding: 20px; border-radius: var(--radius-lg); border: 1px solid color-mix(in srgb, var(--ember) 45%, var(--border)); background: var(--surface); }
.shop-steps h3 { font-size: 18px; }
.shop-step-body { color: var(--text-2); font-size: 15px; line-height: 1.6; }
.shop-step-body p { margin: 0 0 8px; }
.shop-step-body p:last-child { margin-bottom: 0; }
.shop-step-body ol { margin: 0 0 8px; padding-left: 22px; }
.shop-step-body b { color: var(--text); }
.shop-step-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.shop-inventory { display: grid; gap: 16px; padding: 30px 0 90px; }
.shop-open { display: grid; gap: 10px; }
.shop-open h2 { font-size: 18px; }
.shop-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 10px; }
.shop-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.shop-item b { display: block; overflow-wrap: anywhere; }
.shop-item small { color: var(--muted); }
.shop-include-pick { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.shop-admin-list { display: grid; gap: 8px; max-height: 380px; margin: 0; padding: 0 6px 0 0; overflow-y: auto; list-style: none; }
.shop-admin-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); font-size: 14px; overflow-wrap: anywhere; }
.shop-admin-list small { display: block; color: var(--muted); }

/* Marketplace posts */
.post-page { display: grid; gap: 16px; padding: 30px 0 90px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--muted); font-size: 14px; }
.back-link:hover { color: var(--text); }
.post-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.post-preview { position: sticky; top: 100px; display: grid; gap: 8px; min-width: 0; }
.post-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.shop-item-actions { display: flex; flex-shrink: 0; align-items: center; gap: 6px; }
.ping-picker { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; }
.ping-picker legend { margin-bottom: 8px; padding: 0; font-size: 14px; font-weight: 600; }
.ping-option { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); cursor: pointer; }
.ping-option:has(input:checked) { border-color: rgba(240,138,60,.5); background: rgba(240,138,60,.08); }
.ping-option.is-locked { opacity: .55; cursor: not-allowed; }
.ping-option b, .ping-option small { display: block; }
.ping-option small { color: var(--muted); }
.ping-option small a { color: var(--ember-2); text-decoration: underline; pointer-events: auto; }
.dc-message { display: flex; gap: 12px; padding: 14px; border-radius: 12px; background: #313338; color: #dbdee1; font-size: 15px; line-height: 1.4; }
.dc-avatar { flex-shrink: 0; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #1e1f22; }
.dc-avatar img { width: 26px; height: 26px; }
.dc-body { flex: 1; min-width: 0; display: grid; gap: 4px; justify-items: start; }
.dc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dc-head b { color: #f2f3f5; }
.dc-head small { color: #949ba4; font-size: 12px; }
.dc-app { padding: 0 4px; border-radius: 3px; background: #5865f2; color: #fff; font-size: 10px; font-weight: 600; line-height: 15px; }
.dc-mention { padding: 0 2px; border-radius: 3px; background: rgba(88,101,242,.3); color: #c9cdfb; font-weight: 500; }
.dc-embed { display: grid; gap: 8px; width: 100%; max-width: 440px; padding: 10px 14px 12px; border-left: 4px solid var(--ember); border-radius: 4px; background: #2b2d31; overflow-wrap: anywhere; }
.dc-author { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #f2f3f5; min-width: 0; }
.dc-author img { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.dc-title { font-weight: 700; color: #f2f3f5; }
.dc-desc { font-size: 14px; }
.dc-desc code { padding: 0 3px; border-radius: 3px; background: #1e1f22; font-size: 13px; }
.dc-empty { color: #949ba4; }
.dc-fields { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; }
.dc-fields b, .dc-fields span { display: block; }
.dc-fields b { color: #f2f3f5; }
.dc-field-wide { flex-basis: 100%; }
.conn-code { margin-top: 10px; }
.post-queue-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.person-message { display: grid; gap: 8px; }
.person-notes { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.person-notes li { padding: 8px 12px; border-left: 3px solid var(--line); }
.person-notes p { margin: 0 0 2px; white-space: pre-wrap; }
.inv-pref { margin-top: 24px; }
.shop-balance { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--ember-2); }
.shop-pack-amount { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -2px 0 6px; }
.shop-pack-amount b { font-size: 22px; font-family: var(--font-display, inherit); }
.shop-bonus-label { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.inv-credits { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.inv-credits-main b { display: block; font-size: 26px; }
.inv-credits-main small { display: block; color: var(--muted); }
.is-negative { color: #ff9d92; }
.is-positive { color: #7ee0ae; }
.inv-ledger { margin: 0 0 18px; }
.inv-history, .inv-referral { margin-top: 28px; }
.inv-history h2, .inv-referral h2 { font-size: 18px; margin-bottom: 8px; }
.inv-referral-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inv-referral-row small { flex-basis: 100%; color: var(--muted); }
.inv-referral-code { padding: 6px 14px; border: 1px dashed var(--line); border-radius: 8px; font-weight: 800; letter-spacing: .16em; font-variant-numeric: tabular-nums; }
.post-sources:empty { display: none; }
.shop-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: 14px 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; color: var(--text-2); }
.shop-status > span:first-child { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.shop-status a { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--ember-2); }
.post-autosave { align-self: center; color: var(--muted); font-size: 12px; }
.inv-ledger summary { cursor: pointer; font-weight: 600; }
.inv-ledger ul { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.inv-ledger li { display: grid; grid-template-columns: 80px 1fr auto; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); }
.inv-ledger li span:first-child { font-weight: 700; font-variant-numeric: tabular-nums; }
.inv-ledger li small { display: block; color: var(--muted); }
.conn-code-row { display: flex; gap: 8px; }
.conn-code-row .input { max-width: 140px; text-transform: uppercase; letter-spacing: .12em; }
.dc-image { width: 100%; max-height: 260px; border-radius: 4px; object-fit: cover; }
.dc-foot { color: #949ba4; font-size: 12px; }
.dc-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.dc-buttons:empty { display: none; }
.dc-button { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 4px; background: #4e5058; color: #fff; font-size: 13px; font-weight: 500; }
.post-timer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; padding: 22px 24px; border-radius: var(--radius-lg); border: 1px solid color-mix(in srgb, var(--ember) 40%, var(--border)); background: var(--surface); }
.post-timer-count { margin: 2px 0; font: italic 800 clamp(30px, 5vw, 46px)/1.1 var(--font-display); color: var(--text); }
.post-timer .conn-note { margin: 0; }
.card-form[hidden] { display: none; }
.slot-days { display: grid; gap: 14px; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 124px), 1fr)); gap: 6px; }
.slot { display: grid; align-content: start; gap: 2px; min-height: 62px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: rgba(255,238,220,.03); color: var(--text); text-align: left; font-size: 14px; }
button.slot { cursor: pointer; transition: border-color .15s, background-color .15s; }
button.slot:not(:disabled):hover { border-color: var(--ember); background: rgba(240,138,60,.1); }
.slot small { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
.slot .i { width: 12px; height: 12px; }
.slot-reserved { border-style: dashed; border-color: rgba(240,138,60,.4); }
.slot-reserved small { color: var(--ember-2); }
button.slot:disabled { cursor: not-allowed; opacity: .55; }
.slot-current { border: 1px solid var(--ember); background: rgba(240,138,60,.16); }
.slot-taken { background: rgba(0,0,0,.25); }
.slot-who { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 12px; color: var(--text-2); }
.slot-who img { flex-shrink: 0; width: 16px; height: 16px; border-radius: 50%; object-fit: cover; }
.slot-who span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.giveaway-page { padding: 40px 0 90px; }
.giveaway-card { max-width: 680px; margin: 0 auto; overflow: hidden; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); }
.giveaway-image { display: block; width: 100%; max-height: 300px; object-fit: cover; }
.giveaway-body { display: grid; justify-items: start; gap: 10px; padding: 26px; }
.giveaway-body h1 { font-size: clamp(26px, 5vw, 38px); overflow-wrap: anywhere; }
.giveaway-text { margin: 0; color: var(--text-2); line-height: 1.6; overflow-wrap: anywhere; }
.giveaway-facts { display: flex; flex-wrap: wrap; gap: 12px 30px; margin: 6px 0; }
.giveaway-facts dt { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.giveaway-facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.giveaway-action { display: grid; justify-items: start; gap: 6px; }
.giveaway-action .conn-note { margin: 0; }
.giveaway-entered { display: flex; align-items: center; gap: 6px; margin: 0; color: #7ee0ae; font-weight: 600; }
.giveaway-needs { margin: 4px 0 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; }
.giveaway-needs b { display: block; margin-bottom: 4px; font-size: 13px; }
.giveaway-needs ul { margin: 0; padding-left: 18px; color: var(--text-2); }
.giveaway-winners { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.giveaway-winners .badge { margin-left: 6px; }
.req-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .req-row { grid-template-columns: 1fr; } }
.inv-active { display: grid; gap: 10px; padding: 16px 18px; border-radius: var(--radius-lg); border: 1px solid color-mix(in srgb, var(--ember) 45%, var(--border)); background: linear-gradient(120deg, rgba(240,138,60,.14), rgba(240,138,60,.03) 60%), var(--surface); }
.inv-active h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; color: var(--ember-2); }
.inv-active-list { display: grid; gap: 8px; }
.inv-active-card { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 12px; border-radius: 12px; background: rgba(0,0,0,.25); }
.inv-active-main { display: flex; flex: 1 1 200px; align-items: center; gap: 10px; min-width: 0; }
.inv-active-main img { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.inv-active-main div { min-width: 0; overflow-wrap: anywhere; }
.inv-active-main b, .inv-active-main small { display: block; }
.inv-active-main small, .inv-active-time small { color: var(--muted); font-size: 12px; }
.inv-active-time { display: grid; min-width: 112px; }
.inv-active-time b { font-variant-numeric: tabular-nums; font-size: 16px; }
.shop-item.is-active { border-color: var(--ember); background: linear-gradient(120deg, rgba(240,138,60,.12), transparent 70%), var(--surface); box-shadow: 0 0 0 1px rgba(240,138,60,.25), 0 8px 26px -14px rgba(240,138,60,.7); }
.shop-item .shop-item-live { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; color: var(--ember-2); font-variant-numeric: tabular-nums; }
.shop-notice { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 10px 14px; border: 1px solid rgba(240,138,60,.35); border-radius: 12px; background: rgba(240,138,60,.07); font-size: 14px; }
.shop-notice > svg { flex-shrink: 0; color: var(--ember-2); }
.shop-notice > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.shop-notice > button { flex-shrink: 0; }
.post-color { width: 140px; }
.post-color input[type="color"] { min-height: 42px; padding: 4px; cursor: pointer; }
.dc-container { display: grid; gap: 8px; width: 100%; max-width: 440px; padding: 14px 16px; border-left: 4px solid var(--accent); border-radius: 8px; background: #2b2d31; overflow-wrap: anywhere; }
.dc-section { display: flex; align-items: flex-start; gap: 12px; }
.dc-section-text { display: grid; flex: 1; gap: 4px; min-width: 0; }
.dc-sub { color: #949ba4; font-size: 12px; }
.dc-heading { font-size: 20px; font-weight: 700; line-height: 1.25; color: #f2f3f5; }
.dc-thumb { flex-shrink: 0; width: 64px; height: 64px; border-radius: 6px; object-fit: cover; }
.dc-sep { width: 100%; height: 1px; margin: 0; border: 0; background: rgba(255,255,255,.12); }
.person-finder { margin: 18px 0; }
.person-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.person-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255,238,220,.02); color: var(--text); text-align: left; cursor: pointer; transition: border-color .15s, background-color .15s; }
.person-row:hover { border-color: rgba(240,138,60,.45); background: var(--surface-2); }
.person-avatar { flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.person-initial { display: grid; place-items: center; background: var(--surface-2); font-weight: 700; color: var(--ember-2); }
.person-name { flex: 1 1 140px; min-width: 0; overflow-wrap: anywhere; }
.person-name b, .person-name small { display: block; }
.person-row small { color: var(--muted); }
.person-counts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 12px; font-size: 13px; }
.modal.person-modal { align-items: flex-start; overflow-y: auto; padding: 24px 16px; }
.person-modal .modal-panel { display: grid; gap: 16px; width: min(780px, 100%); overflow: visible; }
.person-close { position: absolute; top: 14px; right: 14px; }
.person-head { display: flex; align-items: center; gap: 12px; padding-right: 40px; }
.person-head .person-avatar { width: 52px; height: 52px; font-size: 20px; }
.person-head small { color: var(--muted); }
.person-head h2 { overflow-wrap: anywhere; }
.person-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 110px), 1fr)); gap: 10px; margin: 0; padding: 12px 14px; border-radius: 12px; background: rgba(0,0,0,.22); }
.person-facts dt { color: var(--muted); font-size: 12px; }
.person-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.person-group { display: grid; gap: 8px; }
.person-group h3 { font-size: 15px; }
.person-group .conn-note { margin: 0; }
.person-items, .person-orders { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.person-item { display: grid; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); }
.person-item.is-active { border-color: var(--ember); background: rgba(240,138,60,.07); }
.person-item-main { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.person-item-main > div:first-child { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.person-item b, .person-item small { display: block; }
.person-item small { color: var(--muted); font-size: 12px; }
.person-item small span { display: inline; font-variant-numeric: tabular-nums; }
.person-item .person-deleted { color: #ff9d92; }
.person-delete { display: grid; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.person-delete[hidden] { display: none; }
.person-delete .conn-note { margin: 0; }
.person-orders li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); font-size: 14px; }
.person-orders b { flex: 1 1 160px; }
.person-orders small { color: var(--muted); }
.person-past summary { cursor: pointer; color: var(--text-2); font-size: 14px; }
.person-past .shop-admin-list { margin-top: 8px; }
.shop-my-links { display: flex; flex-wrap: wrap; gap: 8px; }
.giveaway-list, .giveaway-group { display: grid; gap: 12px; }
.giveaway-group h2 { font-size: 20px; }
.giveaway-row { display: grid; gap: 10px; padding: 18px 20px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); }
.giveaway-row .post-row-main > div { flex: 1; }
.giveaway-row .giveaway-facts { margin: 0; }
.giveaway-row .record-note, .giveaway-row .conn-note { margin: 0; }
.giveaway-stats { margin: 0; }
.giveaway-stat-note { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.giveaway-chart { margin: 0; }
.post-bot-status { display: flex; align-items: center; gap: 8px; margin: 0; }
.post-staff { display: grid; gap: 18px; margin-bottom: 18px; }
.post-staff:empty { display: none; }
.post-staff .backup-warning { margin: 0; }
.post-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.post-row, .post-review { display: grid; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.post-row:last-child, .post-review:last-child { padding-bottom: 0; border-bottom: 0; }
.post-row-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.post-row-main img { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.post-row-main div { min-width: 0; overflow-wrap: anywhere; }
.post-row-main b, .post-row-main small { display: block; }
.post-row-main small { color: var(--muted); }
.post-row .conn-note { margin: 0; }
.post-subhead { margin-top: 6px; font-size: 15px; }
.slot-selected { border-color: var(--ember) !important; border-style: solid !important; background: rgba(240,138,60,.16) !important; }
.slot-time { display: grid; justify-items: start; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.slot-time[hidden] { display: none; }
.slot-time .field { width: min(280px, 100%); }
.slot-time .conn-note { margin: 0; }
.slot-time input[type="time"] { color-scheme: dark; }
@media (max-width: 860px) {
  .post-editor { grid-template-columns: minmax(0, 1fr); }
  .post-preview { position: static; order: -1; }
}

/* Staff files */
.standing { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--radius-pill); border: 1px solid; font-size: 12px; font-weight: 600; white-space: nowrap; }
.standing-good { color: #7ee0ae; border-color: rgba(76,195,138,.4); background: rgba(76,195,138,.1); }
.standing-watch { color: #f3c969; border-color: rgba(243,201,105,.4); background: rgba(243,201,105,.1); }
.standing-risk, .standing-terminated { color: #ff9d92; border-color: rgba(239,90,76,.5); background: rgba(239,90,76,.12); }
.badge-danger { color: #ff9d92; border-color: rgba(239,90,76,.45); background: rgba(239,90,76,.1); }
.file-back { margin-bottom: 14px; }
.file-activity { display: grid; gap: 12px; padding: 18px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); }
.file-activity h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 18px; }
.file-activity h3 { margin: 2px 0 0; font-size: 14px; }
.file-stats { --c: var(--ember-2); }
.file-loas { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.file-loas li { display: grid; gap: 1px; padding: 8px 12px; border-radius: 10px; background: rgba(0,0,0,.18); font-size: 14px; overflow-wrap: anywhere; }
.file-loas small { color: var(--muted); }
.file-sheet { display: grid; gap: 16px; }
.file-person { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 20px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); }
.file-person .avatar { width: 72px; height: 72px; font-size: 24px; }
.file-person-text { flex: 1 1 240px; min-width: 0; display: grid; gap: 4px; }
.file-person-text h1 { font-size: 26px; overflow-wrap: anywhere; }
.file-person-text p { margin: 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.file-person-badges, .file-person-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.file-timeline { position: relative; display: grid; gap: 12px; padding-left: 18px; border-left: 2px solid var(--border); }
.record { --tone: #6aa5ff; position: relative; display: grid; gap: 10px; padding: 16px; border-radius: 14px; border: 1px solid var(--border); border-left: 3px solid var(--tone); background: var(--surface); }
.file-timeline .record::before { content: ''; position: absolute; left: -27px; top: 22px; width: 12px; height: 12px; border-radius: 50%; background: var(--tone); border: 2px solid var(--surface-solid); }
.record-good { --tone: #4cc38a; }
.record-info { --tone: #6aa5ff; }
.record-warn { --tone: #f3c969; }
.record-bad { --tone: #ef5a4c; }
.record-faded { opacity: .62; }
.record-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px; }
.record-title { flex: 1 1 240px; min-width: 0; }
.record-title h3 { font-size: 16px; color: var(--tone); }
.record-title h3 small { margin-left: 4px; font: 500 12px var(--font-body); color: var(--muted); }
.record-title p { margin: 3px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.record-details { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.record-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 8px 16px; margin: 0; }
.record-meta dt { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.record-meta dd { margin: 1px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.record-note { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(0,0,0,.2); font-size: 14px; line-height: 1.5; color: var(--text-2); overflow-wrap: anywhere; }
.record-note b { color: var(--text); }
.record-proof { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.record-proof img { display: block; width: 120px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.record-link { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; font-size: 14px; color: var(--ember-2); overflow-wrap: anywhere; }
.record-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.record-actions:empty { display: none; }
.record-reason { flex: 1 1 100%; }
.record-danger { color: #ff9d92; }
.record-compose { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.file-doc { display: grid; gap: 18px; padding: 26px; border-radius: var(--radius-lg); border: 1px solid var(--border-strong, var(--border)); background: var(--surface); }
.file-doc-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.file-doc-head img { width: 44px; height: 44px; object-fit: contain; }
.file-doc-head h2 { font-size: 20px; }
.file-doc-head p { margin: 0; font-size: 13px; color: var(--muted); }
.file-doc .field[hidden] { display: none; }
.file-mode { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; border: 1px solid var(--border); width: fit-content; }
.file-mode input { position: absolute; opacity: 0; pointer-events: none; }
.file-mode span { display: block; padding: 7px 16px; border-radius: 9px; font-size: 14px; color: var(--muted); cursor: pointer; }
.file-mode input:checked + span { background: rgba(240,138,60,.16); color: var(--ember-2); font-weight: 600; }
.file-mode input:focus-visible + span { outline: 2px solid var(--ember-2); }
.file-proof-edit { display: flex; flex-wrap: wrap; gap: 8px; }
.file-proof-edit:empty { display: none; }
.file-proof-item { position: relative; display: block; }
.file-proof-item img { display: block; width: 110px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.file-proof-item .icon-btn { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; min-width: 28px; background: rgba(0,0,0,.65); }
.file-proof-add { width: fit-content; }
.file-preview { display: grid; gap: 14px; padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); }
.file-preview h2 { font-size: 20px; }
.file-mine { display: grid; gap: 10px; margin-bottom: 18px; }
.file-mine h2 { font-size: 18px; }
.file-level-filter { width: 200px; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); transition: background-color .15s; }
.file-row:last-child { border-bottom: 0; }
.file-row:hover { background: var(--surface-2); }
.file-row-text { flex: 1; min-width: 0; display: grid; }
.file-row-text b { overflow-wrap: anywhere; }
.file-row-text small { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.file-review-list { display: grid; gap: 14px; margin-bottom: 18px; }
.file-review-item { display: grid; gap: 6px; }
.file-review-for { margin: 0; font-size: 14px; color: var(--muted); }
.file-review-for a { color: var(--ember-2); }
.file-unmatched { display: grid; gap: 6px; padding: 12px; border-radius: 10px; background: rgba(0,0,0,.18); font-size: 14px; }
.file-unmatched ul { display: grid; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; }
.file-unmatched li { overflow-wrap: anywhere; }
.file-unmatched small { display: block; color: var(--muted); }
.file-template-pick { padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.file-template-list { display: grid; gap: 8px; }
.file-template-actions { justify-content: space-between; }
.file-expiry { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 12px; }
.file-audit { display: grid; gap: 8px; max-height: 360px; margin: 0; padding: 0 6px 0 0; overflow-y: auto; list-style: none; }
.file-audit li { display: grid; gap: 1px; padding-bottom: 8px; border-bottom: 1px solid var(--border); font-size: 14px; overflow-wrap: anywhere; }
.file-audit time { font: 500 12px var(--font-mono); color: var(--muted); }
@media (max-width: 700px) {
  .file-row { flex-wrap: wrap; }
  .file-row-text { flex: 1 1 calc(100% - 60px); }
  .file-row .legal-chevron { display: none; }
  .file-level-filter { width: 100%; }
}
@media print {
  body:has(.file-sheet) .nav-wrap, body:has(.file-sheet) .footer, body:has(.file-sheet) .dash-side, body:has(.file-sheet) .announce, body:has(.file-sheet) .maint-banner,
  body:has(.file-sheet) .dash-head, body:has(.file-sheet) .file-back, body:has(.file-sheet) .file-person-actions, body:has(.file-sheet) .record-actions, body:has(.file-sheet) .toast-stack { display: none !important; }
  body:has(.file-sheet) { background: #fff !important; color: #111 !important; }
  body:has(.file-sheet) .dash { display: block !important; }
  body:has(.file-sheet) .file-sheet * { color: #111 !important; background: none !important; box-shadow: none !important; }
  body:has(.file-sheet) .record { break-inside: avoid; opacity: 1; border-color: #bbb !important; }
}

/* Jurisdiction key */
.jur-page { width: min(1640px, 100% - 40px); margin-inline: auto; padding: 28px 0 80px; }
.jur-head { display: flex; align-items: center; justify-content: center; gap: 20px; text-align: center; margin-bottom: 20px; }
.jur-head > img { width: 76px; height: 76px; object-fit: contain; flex-shrink: 0; }
.jur-title { margin: 0; font: italic 800 clamp(30px, 3.4vw, 52px)/1.05 var(--font-display); letter-spacing: -.03em; text-transform: uppercase; }
.jur-head p { margin: 6px 0 0; font-size: 17px; color: var(--text-2); }
.jur-board { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.jur-col { display: grid; grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 12px; }
.jur-card { display: grid; grid-template-columns: clamp(76px, 6vw, 108px) minmax(0, 1fr) clamp(96px, 8.4vw, 150px); gap: 12px; align-items: center; padding: 8px 10px 8px 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.jur-badge { width: 100%; aspect-ratio: 1; object-fit: contain; }
.jur-card-text { min-width: 0; }
.jur-card h2 { margin: 0; font: 700 clamp(21px, 1.7vw, 27px)/1.1 var(--font-display); color: var(--c); }
.jur-card small { display: block; margin: 2px 0 8px; font-size: 13px; line-height: 1.25; color: var(--muted); }
.jur-card p { margin: 0; font-size: 15px; font-weight: 500; line-height: 1.3; }
.jur-svg { display: block; width: 100%; height: auto; }
.jur-map { min-width: 0; align-self: center; }
.jur-map .jur-svg { filter: drop-shadow(0 10px 30px rgba(0,0,0,.6)); }

/* Legal Library */
.legal-library { padding-bottom: 90px; }
.legal-tools { display: grid; gap: 14px; }
.legal-tools .input-icon { max-width: 520px; }
.legal-count { margin: 18px 0 0; font-size: 14px; color: var(--muted); }
.legal-group { margin-top: 34px; }
.legal-group[hidden], .legal-row[hidden] { display: none; }
.legal-group-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.legal-group-icon { flex-shrink: 0; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--ember-2); background: rgba(240,138,60,.1); border: 1px solid rgba(240,138,60,.25); }
.legal-group-head h2 { margin: 0; font-size: 21px; }
.legal-group-head p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.legal-list { border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); overflow: hidden; }
.legal-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 18px; align-items: center; gap: 12px; min-height: 54px; padding: 8px 16px; border-bottom: 1px solid var(--border); transition: background-color .15s; }
.legal-row:last-child { border-bottom: 0; }
.legal-list .legal-row:has(~ .legal-row:not([hidden])) { border-bottom: 1px solid var(--border); }
.legal-row:hover { background: var(--surface-2); }
.legal-row-off { cursor: not-allowed; }
.legal-row-off:hover { background: none; }
.legal-row-off > * { opacity: .5; }
.legal-row-off .legal-num { color: var(--muted); }
.legal-num { font: 500 13px var(--font-mono); color: var(--ember-2); }
.legal-title { min-width: 0; font-weight: 500; font-size: 15px; overflow-wrap: anywhere; }
.legal-title .badge { height: 22px; margin-left: 6px; }
.legal-code { font: 500 12px var(--font-mono); letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
.legal-chevron { color: var(--muted); transition: transform .15s var(--ease); }
.legal-row:hover .legal-chevron { transform: translateX(3px); color: var(--ember-2); }
.legal-reader { padding: 40px 0 90px; }
.legal-reader-head { margin: 16px 0 22px; }
.legal-reader-head h1 { margin: 0; font-size: clamp(26px, 4vw, 40px); overflow-wrap: anywhere; }
.legal-reader-meta { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; }
.legal-paper { overflow: hidden; border: 1px solid var(--border-strong); border-radius: var(--radius); background: #fff; }
body.legal-protected .legal-reader { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
@media print { body.legal-protected { display: none !important; } }
.docs-legal-link { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; margin-bottom: 20px; border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--ember-2); background: rgba(240,138,60,.08); border: 1px solid rgba(240,138,60,.22); transition: background-color .2s; }
.docs-legal-link:hover { background: rgba(240,138,60,.15); }

.icon-picker { position: relative; }
.icon-picker-trigger {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 7px 12px 7px 8px; border-radius: 12px; text-align: left; cursor: pointer;
  background: rgba(0,0,0,.28); border: 1px solid var(--border-strong); font-size: 15px;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.icon-picker-trigger:hover { background: rgba(0,0,0,.4); }
.icon-picker-trigger:focus-visible, .icon-picker-trigger[aria-expanded="true"] { outline: none; border-color: var(--ember); box-shadow: 0 0 0 3px rgba(240,138,60,.22); background: rgba(0,0,0,.4); }
.icon-picker-tile {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
}
.icon-picker-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-picker-chevron { color: var(--muted); transition: transform .2s var(--ease); }
.icon-picker-trigger[aria-expanded="true"] .icon-picker-chevron { transform: rotate(180deg); }
.icon-picker-menu {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: min(340px, calc(100vw - 48px));
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 6px; border-radius: 14px;
  background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow); animation: pop .16s var(--ease);
}
.icon-picker-menu[hidden] { display: none; }
.icon-picker.opens-up .icon-picker-menu { top: auto; bottom: calc(100% + 6px); }
.icon-picker.aligns-end .icon-picker-menu { left: auto; right: 0; }
.icon-picker-option {
  display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 6px 9px 6px 6px; border-radius: 10px; text-align: left; font-size: 14px; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--text-2); transition: background-color .15s, border-color .15s, color .15s;
}
.icon-picker-option:hover { background: var(--surface-2); color: var(--text); }
.icon-picker-option:focus-visible { outline: none; color: var(--text); background: var(--surface-2); border-color: var(--ember-2); }
.icon-picker-option[aria-selected="true"] { color: var(--text); font-weight: 600; background: color-mix(in srgb, var(--c) 12%, transparent); border-color: color-mix(in srgb, var(--c) 40%, transparent); }
.icon-picker-check { display: none; color: var(--c); }
.icon-picker-option[aria-selected="true"] .icon-picker-check { display: block; }

/* ---------- Editor ---------- */
.editor-bar {
  position: sticky; top: 84px; z-index: 5; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; margin: 20px 0; border-radius: 18px;
  background: rgba(20,15,11,.85); border: 1px solid var(--border); backdrop-filter: blur(14px);
}
.editor-bar .spacer { flex: 1; }
.save-state { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.save-state.dirty { color: var(--warning); }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; padding-bottom: 80px; }
.editor-title { width: 100%; resize: none; overflow: hidden; display: block; background: transparent; border: 0; font: italic 800 clamp(28px, 4vw, 44px)/1.1 var(--font-display); letter-spacing: -0.03em; text-transform: uppercase; color: var(--text); padding: 6px 0 14px; }
.editor-title:focus { outline: none; }
.editor-title::placeholder { color: #5a4a3e; }
.md-input { display: block; width: 100%; min-height: 560px; resize: vertical; border: 0; background: transparent; padding: 22px; font: 400 15px/1.75 var(--font-mono); color: var(--text); tab-size: 2; }
.md-input:focus { outline: none; }
.prose .text-sm { font-size: .85em; }
.prose .text-lg { font-size: 1.25em; }
.prose .text-xl { font-size: 1.6em; line-height: 1.35; }
.rt-editor { position: relative; border-radius: var(--radius-lg); border: 1px solid var(--border-strong); background: rgba(0,0,0,.25); }
.rt-editor[hidden] { display: none; }
.rt-toolbar { position: sticky; top: 148px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; padding: 6px; border-bottom: 1px solid var(--border); border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: #1b1510; }
.rt-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; min-width: 0; }
.rt-tools.is-off { opacity: .35; pointer-events: none; }
.rt-tools-end { margin-left: auto; gap: 6px; }
.rt-toolbar .icon-btn { width: 36px; min-width: 36px; height: 36px; font-weight: 700; font-size: 14px; border-radius: 9px; }
.rt-toolbar .icon-btn[aria-pressed="true"] { background: rgba(240,138,60,.16); border-color: rgba(240,138,60,.4); color: var(--ember-2); }
.rt-glyph { font: 600 12px var(--font-mono); }
.rt-toolbar .divider { width: 1px; height: 22px; margin: 0 4px; background: var(--border); }
.rt-select { display: block; width: 132px; }
.rt-select .dd-trigger { min-height: 36px; padding: 4px 8px 4px 10px; border-color: var(--border); border-radius: 9px; font-size: 13px; }
.rt-toolbar .tabs { display: flex; gap: 2px; padding: 3px; border-radius: 11px; background: rgba(0,0,0,.3); }
.rt-toolbar .tabs button { height: 30px; padding: 0 12px; border-radius: 8px; border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 600; }
.rt-toolbar .tabs button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }
.rt-notice { margin: 0; padding: 10px 16px; border-bottom: 1px solid var(--border); background: rgba(106,165,255,.08); color: var(--text-2); font-size: 14px; }
.rt-notice[hidden] { display: none; }
.rt-surface { position: relative; }
.rt-surface[hidden] { display: none; }
.rt-body { max-width: none; min-height: 560px; padding: 28px 36px; font-size: 16px; caret-color: var(--ember-2); }
.rt-body:focus { outline: none; }
.rt-body.is-empty::before { content: attr(data-placeholder); position: absolute; color: #7d6d61; pointer-events: none; }
.rt-body table { margin: 1.4em 0; border: 1px solid var(--border); }
.rt-body th, .rt-body td { min-width: 70px; border: 1px solid var(--border); }
.rt-body th:focus-within, .rt-body td:focus-within { outline: none; }
.rt-body pre:empty::before { content: ' '; }
.rt-table-bar { position: absolute; z-index: 4; right: 12px; display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-solid); box-shadow: var(--shadow); }
.rt-table-bar[hidden] { display: none; }
.rt-table-bar .btn { min-height: 30px; padding: 0 10px; font-size: 12px; }
.rt-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 8px 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.rt-footer span[hidden] { display: none; }
.rt-source[hidden] { display: none; }
.rt-grid-picker { position: fixed; z-index: calc(var(--z-modal) + 1); display: grid; gap: 6px; width: 212px; padding: 8px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-solid); box-shadow: var(--shadow); animation: pop .14s var(--ease); }
.rt-grid-cells { display: grid; gap: 3px; }
.rt-grid-cells button { height: 20px; padding: 0; border-radius: 4px; border: 1px solid var(--border-strong); background: rgba(255,238,220,.04); cursor: pointer; }
.rt-grid-cells button.is-on { background: rgba(240,138,60,.45); border-color: var(--ember); }
.rt-grid-size { text-align: center; font-size: 12px; font-weight: 600; color: var(--text-2); }
.rt-popped { display: grid; justify-items: center; gap: 8px; padding: 80px 24px; border-radius: var(--radius-lg); border: 1px dashed var(--border-strong); text-align: center; }
.rt-popped[hidden] { display: none; }
.rt-popped p { margin: 0 0 8px; color: var(--muted); }
.rt-dialog .modal-panel { max-height: calc(100vh - 32px); overflow-y: auto; }
.rt-dialog form { display: grid; gap: 14px; }
.rt-dialog .form-actions { justify-content: flex-end; }
.rt-dialog:has(.rt-chart-form) .modal-panel { width: min(900px, 100%); }
.rt-chart-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.rt-chart-fields { display: grid; align-content: start; gap: 14px; min-width: 0; }
.rt-chart-rows { max-height: 240px; overflow-y: auto; margin-bottom: 8px; }
.rt-chart-rows table { width: 100%; border-collapse: separate; border-spacing: 0 4px; }
.rt-chart-rows th { padding: 0 4px; text-align: left; font-size: 12px; color: var(--muted); }
.rt-chart-rows td { padding: 0 2px; }
.rt-chart-rows td:nth-child(2) { width: 34%; }
.rt-chart-rows td:last-child { width: 40px; }
.rt-chart-rows .input { min-height: 38px; padding: 6px 10px; font-size: 14px; }
.rt-chart-preview { min-width: 0; }
.rt-chart-preview .field-label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.rt-chart-preview figure { margin: 0; }
figure.rt-chart { position: relative; margin: 1.6em 0; padding: 18px; border-radius: var(--radius); border: 1px solid var(--border); background: rgba(255,238,220,.025); max-width: 100%; }
.rt-chart-actions { position: absolute; top: 8px; right: 8px; z-index: 2; display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--surface-solid); border: 1px solid var(--border-strong); opacity: 0; transition: opacity .15s; }
figure.rt-chart:hover .rt-chart-actions, .rt-chart-actions:focus-within { opacity: 1; }
.rt-chart-actions .btn { min-height: 30px; padding: 0 10px; font-size: 12px; }
@media (hover: none) { .rt-chart-actions { opacity: 1; } }
.rc-title { margin-bottom: 14px; font-weight: 700; color: var(--text); font-size: 15px; line-height: 1.4; }
.rc-empty { margin: 0; color: var(--muted); font-size: 14px; }
.rc-chart { font-size: 13px; color: var(--text-2); line-height: 1.35; }
.rc-bars { display: grid; gap: 8px; }
.rc-bar-row { display: grid; grid-template-columns: minmax(70px, 30%) minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.rc-bar-label { min-width: 0; overflow-wrap: anywhere; }
.rc-bar-track { position: relative; display: block; height: 20px; }
.rc-bar-track i { position: absolute; top: 0; bottom: 0; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--ember); }
.rc-bar-track i.is-negative { border-radius: 4px 0 0 4px; }
.rc-bar-value { font-weight: 600; color: var(--text); white-space: nowrap; }
.rc-plot { padding-left: 46px; }
.rc-area { position: relative; height: 210px; }
.rc-grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--border); }
.rc-grid span { position: absolute; right: 100%; top: 0; margin-right: 6px; transform: translateY(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.rc-col-slot { position: absolute; top: 0; bottom: 0; }
.rc-col-slot i { position: absolute; left: 50%; width: min(24px, calc(100% - 4px)); transform: translateX(-50%); min-height: 2px; border-radius: 4px 4px 0 0; background: var(--ember); }
.rc-col-slot i.is-negative { border-radius: 0 0 4px 4px; }
.rc-col-slot:hover i, .rc-bar-row:hover .rc-bar-track i { background: var(--ember-2); }
.rc-xlabels { position: relative; height: 34px; margin-top: 6px; }
.rc-xlabels span { position: absolute; top: 0; max-width: 90px; transform: translateX(-50%); overflow: hidden; text-align: center; font-size: 11px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.rc-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rc-line polyline { fill: none; stroke: var(--ember); stroke-width: 2px; stroke-linejoin: round; stroke-linecap: round; }
.rc-line polygon { fill: rgba(240,138,60,.1); stroke: none; }
.rc-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0 2px var(--surface-solid); transform: translate(-50%, 50%); }
.rc-dot::after { content: ''; position: absolute; inset: -9px; }
.rc-end { position: absolute; right: 0; margin-bottom: 8px; font-weight: 600; font-size: 12px; color: var(--text); pointer-events: none; }
.rc-donut { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 18px 26px; }
.rc-donut-ring { position: relative; flex: 0 0 auto; width: min(190px, 60vw); }
.rc-donut-ring svg { display: block; width: 100%; transform: rotate(-90deg); }
.rc-donut-ring circle { fill: none; stroke-width: 6; transition: stroke-width .15s; }
.rc-donut-ring circle:hover { stroke-width: 7; }
.rc-donut-total { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.rc-donut-total b { font-size: 19px; color: var(--text); }
.rc-donut-total small { color: var(--muted); }
.rc-legend { flex: 1 1 170px; display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; min-width: 0; }
.rc-legend li { display: flex; align-items: center; gap: 8px; margin: 0; }
.rc-legend i { flex-shrink: 0; width: 10px; height: 10px; border-radius: 3px; }
.rc-legend-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rc-legend b { color: var(--text); font-weight: 600; }
.rc-legend small { width: 34px; text-align: right; color: var(--muted); }
.rc-tip { position: fixed; z-index: var(--z-toast); max-width: 260px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface-solid); box-shadow: var(--shadow); color: var(--text); font-size: 13px; pointer-events: none; }
.rc-tip[hidden] { display: none; }
body.rt-window .nav-wrap, body.rt-window .footer, body.rt-window .announce, body.rt-window .maint-banner { display: none !important; }
.rt-window-page { display: grid; gap: 10px; padding: 12px; }
.rt-window-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.rt-window-bar b { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-window-bar .save-state { flex: 1; color: var(--muted); font-size: 13px; }
body.rt-window .rt-toolbar { top: 0; }
@media (max-width: 760px) {
  .rt-toolbar { position: static; }
  .rt-popout { display: none; }
  .rt-body { padding: 20px 16px; }
  .rt-chart-grid { grid-template-columns: minmax(0, 1fr); }
  .rt-table-bar { position: sticky; top: 8px; right: auto; margin: 6px; }
  .rt-chart-actions { position: static; margin-top: 10px; opacity: 1; width: fit-content; }
}
.md-drop { outline: 2px dashed var(--ember); outline-offset: -8px; }
.cover-drop { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); border: 1.5px dashed var(--border-strong); display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 14px; overflow: hidden; cursor: pointer; transition: border-color .2s, background-color .2s; background: rgba(0,0,0,.2); }
.cover-drop:hover { border-color: var(--ember); background: rgba(240,138,60,.05); }
.cover-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-drop .cover-remove { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.6); }

/* ---------- Modal / search ---------- */
.search-modal, .modal { position: fixed; inset: 0; z-index: var(--z-modal); display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; }
.search-modal[hidden], .modal[hidden] { display: none; }
.search-backdrop, .modal-backdrop { position: absolute; inset: 0; background: rgba(5,3,2,.7); backdrop-filter: blur(6px); animation: fade .2s; }
.search-panel, .modal-panel { position: relative; width: min(640px, 100%); border-radius: 22px; background: #17120e; border: 1px solid var(--border-strong); box-shadow: 0 40px 100px -20px rgba(0,0,0,.9); overflow: hidden; animation: pop .22s var(--ease); }
.search-field { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--border); }
.search-field .i { color: var(--muted); }
.search-field input { flex: 1; height: 62px; border: 0; background: transparent; font-size: 17px; }
.search-field input:focus { outline: none; }
.search-results { max-height: 52vh; overflow-y: auto; padding: 8px; }
.search-results .hint { padding: 26px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.search-item { display: flex; gap: 14px; padding: 12px 14px; border-radius: 12px; align-items: flex-start; }
.search-item[aria-selected="true"], .search-item:hover { background: var(--surface-2); }
.search-item .si { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(240,138,60,.12); color: var(--ember-2); flex-shrink: 0; }
.search-item b { display: block; font-size: 15px; }
.search-item small { color: var(--muted); font-size: 13px; display: block; margin-top: 2px; }
.search-item mark { background: rgba(240,138,60,.3); color: var(--text); border-radius: 3px; padding: 0 2px; }
.modal { align-items: center; padding-top: 16px; }
.modal-panel { width: min(440px, 100%); padding: 28px; }
.modal-panel h2 { font-size: 22px; }
.modal-panel p { color: var(--muted); margin: 10px 0 24px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* ---------- Toasts ---------- */
/* ---------- Unsaved changes bar ---------- */
.unsaved-bar {
  position: fixed; left: 0; right: 0; bottom: 20px; z-index: calc(var(--z-modal) - 1); margin-inline: auto; width: fit-content; max-width: calc(100% - 32px);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 32px; padding: 10px 12px 10px 18px; border-radius: 16px;
  background: #201811; border: 1px solid var(--border-strong); box-shadow: 0 0 0 0 transparent, var(--shadow); animation: unsavedIn .25s var(--ease);
  transition: background-color .8s ease, border-color .8s ease, box-shadow .8s ease; /* easing back from red */
}
.unsaved-bar[hidden] { display: none; }
.unsaved-text { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; }
.unsaved-text .i { color: var(--warning); transition: color .8s ease; }
.unsaved-msg { display: grid; }
.unsaved-msg > span { grid-area: 1 / 1; transition: opacity .5s ease; }
.unsaved-msg-alert, .unsaved-msg-return { opacity: 0; }
.unsaved-actions { display: flex; align-items: center; gap: 8px; }
/* Listing unsavedIn here too stops the slide-in replaying when the alert ends. */
.unsaved-bar.alert { background: #4a1612; border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger), 0 12px 40px -8px rgba(239,90,76,.6); animation: unsavedIn .25s var(--ease); transition-duration: .12s; }
.unsaved-bar.alert .unsaved-text .i { color: #ff9d92; transition-duration: .12s; }
.unsaved-bar.alert .unsaved-msg > span { opacity: 0; transition-duration: .12s; }
.unsaved-bar.alert:not(.returned) .unsaved-msg > .unsaved-msg-alert { opacity: 1; }
.unsaved-bar.returned .unsaved-msg > .unsaved-msg-return { opacity: 1; }
.unsaved-bar.alert.returned { animation: unsavedIn .25s var(--ease), unsavedReturn .5s var(--ease); }
.unsaved-bar.exploded { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .12s ease, visibility 0s .12s; }
.unsaved-sparks { position: fixed; inset: 0; width: 100%; height: 100%; z-index: calc(var(--z-modal) - 1); pointer-events: none; }
.unsaved-bar .btn-quiet { transition: background-color .2s var(--ease), color .8s ease; }
.unsaved-bar.alert .btn-quiet { color: var(--text); transition-duration: .12s; }
@keyframes unsavedIn { from { opacity: 0; transform: translateY(16px); } }
@keyframes unsavedReturn {
  from { opacity: 0; transform: scale(.85); }
}
body.has-unsaved #main { padding-bottom: 90px; }
body.has-unsaved .toast-stack { bottom: 92px; }

.toast-stack { position: fixed; bottom: 20px; right: 20px; z-index: var(--z-toast); display: grid; gap: 10px; width: min(360px, calc(100% - 40px)); }
.toast { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: #201811; border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: 14px; animation: pop .25s var(--ease); }
.toast.success .i { color: var(--success); } .toast.error .i { color: var(--danger); }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .25s; }

/* ---------- Skeletons ---------- */
.skeleton { background: linear-gradient(90deg, rgba(255,238,220,.04), rgba(255,238,220,.09), rgba(255,238,220,.04)); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.page-loading { padding: 120px 0; display: grid; gap: 16px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 60px 0 30px; margin-top: 40px; background: linear-gradient(180deg, transparent, rgba(155,79,23,.07)); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.footer h4 { font: 600 12px var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.footer ul a { color: var(--text-2); font-size: 15px; display: inline-flex; min-height: 32px; align-items: center; transition: color .2s; }
.footer ul a:hover { color: var(--ember-2); }
.footer-about p { color: var(--muted); font-size: 15px; max-width: 340px; margin: 14px 0 0; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 50px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Whitelisting steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: step; }
.step { position: relative; padding: 26px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); display: grid; gap: 14px; align-content: start; }
.step-num { position: absolute; top: 18px; right: 22px; font: italic 800 42px/1 var(--font-display); color: rgba(255,238,220,.08); }
.step h3 { font-size: 19px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }
.mobile-only { display: none; }

/* ---------- Not found ---------- */
.not-found { text-align: center; padding: 120px 16px; }
.not-found h1 { font-size: clamp(80px, 16vw, 200px); }
.not-found p { color: var(--muted); margin: 10px 0 28px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1280px) {
  .jur-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jur-map { grid-column: 1 / -1; grid-row: 1; width: min(760px, 100%); margin-inline: auto; }
  .jur-card { grid-template-columns: 92px minmax(0, 1fr) 120px; min-height: 150px; }
}
@media (max-width: 760px) {
  .jur-board { grid-template-columns: minmax(0, 1fr); }
  .jur-card { grid-template-columns: 72px minmax(0, 1fr) 92px; gap: 10px; }
}
@media (max-width: 1100px) {
  .docs-shell { grid-template-columns: 230px minmax(0, 1fr); }
  .toc-col { display: none; }
  .article-layout { grid-template-columns: 1fr; }
  .aside-card { position: static; }
}
@media (max-width: 1240px) {
  .status-pill { display: none !important; }
}
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-features { grid-template-columns: repeat(3, 1fr); }
  .feature-glass { grid-template-columns: 1fr; text-align: left; }
  .status-grid { grid-template-columns: 1fr 1fr; }
  .status-grid > :first-child { grid-column: 1 / -1; }
  .dept-grid, .post-grid, .doc-links { grid-template-columns: 1fr 1fr; }
  .post-card.featured { grid-column: span 2; flex-direction: column; }
  .post-card.featured .post-cover { min-height: 0; aspect-ratio: 16 / 9; }
  .pillars { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .dash { grid-template-columns: 1fr; }
  .dash-side { position: static; flex-direction: row; flex-wrap: wrap; max-height: none; overflow: visible; }
  .side-heading { width: 100%; }
  .dash-user { width: 100%; }
  .dash-side a, .dash-side button.side-link { width: auto; min-height: 44px; font-size: 15px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .editor-layout { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .nav-actions { margin-left: auto; }
  .menu-btn { display: inline-flex; }
  .search-trigger .kbd { display: none; }
  .nav { position: relative; }
  .nav-links {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0; flex-direction: column; gap: 2px; padding: 10px;
    background: rgba(20,15,11,.97); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
    opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity .2s, transform .2s;
  }
  .nav-links.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { min-height: 48px; width: 100%; }
  .nav-links a.active::after { display: none; }
  .nav-links a.active { background: rgba(240,138,60,.12); color: var(--ember-2); }
  .status-pill { display: none !important; }
  .mobile-only { display: list-item; }
}
@media (max-width: 860px) {
  .docs-shell { grid-template-columns: 1fr; gap: 20px; padding-top: 20px; }
  .docs-nav { display: none; }
  .docs-mobile-nav { display: block; }
  .steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .section { padding: 72px 0; }
  .hero { min-height: auto; padding-bottom: 110px; }
  .hero-features { grid-template-columns: 1fr; }
  .feature-glass { grid-template-columns: 48px 1fr; }
  .hero-ctas .btn { flex: 1 1 100%; }
  .status-grid, .dept-grid, .post-grid, .doc-links { grid-template-columns: 1fr; }
  .account-row { grid-template-columns: minmax(0, 1fr) 44px; }
  .account-level { grid-column: 1 / 2; grid-row: 2; }
  .level-top { flex-wrap: wrap; }
  .level-name { flex-basis: calc(100% - 56px); }
  .level-actions { min-width: 0; margin-left: auto; }
  .profile-body { padding: 0 18px 20px; }
  .post-card.featured { grid-column: auto; }
  .cinema { min-height: 620px; border-radius: 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .brand-text small { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .jur-head { flex-direction: column; gap: 10px; }
  .jur-head > img { width: 60px; height: 60px; }
  .jur-head p { font-size: 15px; }
  .dept-section { grid-template-columns: 1fr; gap: 12px; }
  .dept-fields { grid-template-columns: 1fr; }
  .dept-more summary { padding-right: 14px; }
  .dept-row { display: grid; }
  .dept-edit-actions { position: static; justify-content: flex-end; padding: 0 8px 6px; }
  .legal-row { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .legal-code { display: none; }

  .data-table .hide-sm { display: none; }
  .docs-pager { grid-template-columns: 1fr; }
  .docs-pager .next { grid-column: 1; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .editor-bar { top: 78px; }
  .nav-actions #navStaff { display: none; }
  .steps { grid-template-columns: 1fr; }
  .announce { font-size: 13px; padding: 8px 44px 8px 16px; justify-content: flex-start !important; text-align: left; }
  .announce > .i { display: none; }
}

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

/* ==========================================================================
   Training and Courses: same colors and fonts, a quieter layout
   ========================================================================== */
body.training-mode .nav-wrap, body.training-mode .footer, body.training-mode .announce { display: none !important; }
/* Signed in, the profile picture's menu replaces the account button and the Training icon. */
#navStaff[hidden], #navTraining[hidden], #navTrainingMobile[hidden], #navSignInMobile[hidden], #navUser[hidden] { display: none !important; }
.user-menu { position: relative; display: flex; flex-shrink: 0; }
.user-menu-btn { display: block; border-radius: 50%; transition: box-shadow .15s, transform .15s var(--ease); }
.user-menu-btn .avatar { width: 40px; height: 40px; }
.user-menu-btn:focus-visible { outline-offset: 2px; border-radius: 50%; }
.user-menu-panel { position: absolute; top: 100%; right: 0; z-index: calc(var(--z-nav) + 1); width: 220px; padding-top: 8px; visibility: hidden; opacity: 0; transform: translateY(-4px); transition: opacity .12s, transform .12s var(--ease), visibility .12s; }
.user-menu.open .user-menu-panel, .user-menu:focus-within .user-menu-panel { visibility: visible; opacity: 1; transform: none; }
.user-menu.open .user-menu-btn { box-shadow: 0 0 0 2px var(--ember); }
@media (hover: hover) {
  .user-menu:hover .user-menu-btn { box-shadow: 0 0 0 2px var(--ember); transform: scale(1.05); }
  .user-menu:hover .user-menu-panel { visibility: visible; opacity: 1; transform: none; }
}
.user-menu.dismissed .user-menu-panel { visibility: hidden; opacity: 0; }
.user-menu-card { display: grid; gap: 2px; padding: 6px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface-solid); box-shadow: var(--shadow); }
.user-menu-who { display: grid; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.user-menu-who b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-who small { font-size: 12px; color: var(--muted); }
.user-menu-card a, .user-menu-card button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--text-2); font-size: 14px; font-weight: 500; text-align: left; }
.user-menu-card a:hover, .user-menu-card button:hover, .user-menu-card a:focus-visible, .user-menu-card button:focus-visible { background: var(--surface-2); color: var(--text); }
.user-menu-card button[data-user-signout] { margin-top: 4px; color: #ff9d92; }
@media (pointer: coarse) { .user-menu-card a, .user-menu-card button { min-height: 46px; } }
/* With the picture there too, phones need everything a little tighter. */
@media (max-width: 480px) {
  .nav:has(#navUser:not([hidden])) .brand-text b { font-size: clamp(11px, 3.4vw, 16px); }
  .nav:has(#navUser:not([hidden])) .brand-text small { font-size: clamp(8px, 2.5vw, 11px); }
  .nav:has(#navUser:not([hidden])) .nav-actions { gap: 4px; }
  .nav:has(#navUser:not([hidden])) .nav-actions .icon-btn { min-width: 38px; height: 38px; padding: 0 6px; }
  .user-menu-btn .avatar { width: 36px; height: 36px; font-size: 13px; }
}
@media (max-width: 350px) { .nav:has(#navUser:not([hidden])) .brand-text { display: none; } }
/* The top menu has no room to spare, so Training is an icon there, and a menu item on small screens. */
.nav-actions #navTraining { padding: 0; width: 40px; }
@media (max-width: 1100px) { .nav-actions #navTraining { display: none; } }
.tr { --tr-bar-h: 60px; --tr-line: var(--border); min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.tr .btn { border-radius: var(--radius-sm); box-shadow: none; }
.tr .btn-primary { background: var(--ember); }
.tr .btn-primary:hover { background: #f79a50; box-shadow: none; }
.tr .btn-ghost { backdrop-filter: none; }
.tr-bar-gap { flex: 1; }
.tr-bar { position: sticky; top: var(--maint-banner-h, 0px); z-index: var(--z-nav); display: flex; align-items: center; gap: 6px; min-height: var(--tr-bar-h); padding: 0 20px; background: var(--surface-solid); border-bottom: 1px solid var(--tr-line); }
.tr-brand { display: flex; align-items: center; gap: 10px; min-height: 44px; font: 600 16px/1 var(--font-display); letter-spacing: -.01em; white-space: nowrap; }
.tr-brand b { color: var(--ember-2); font-weight: 700; }
.tr-bar-link { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--text-2); }
.tr-bar-link:hover { background: var(--surface-2); color: var(--text); }
.tr-bar-me { display: inline-flex; min-height: 44px; align-items: center; margin-left: 4px; }
.tr-bar-me .avatar { width: 32px; height: 32px; font-size: 12px; }

/* ---- Pages ---- */
.tr-page { width: min(980px, 100% - 32px); margin-inline: auto; padding: 40px 0 90px; }
.tr-page-head { margin-bottom: 32px; }
.tr-page-head h1 { font-size: 32px; font-weight: 700; }
.tr-page-head p { margin: 6px 0 0; color: var(--muted); }
.tr-page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tr-crumb { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 14px; color: var(--muted); }
.tr-crumb:hover { color: var(--text); }
.tr-group { margin-bottom: 36px; }
.tr-group h2 { font: 600 15px/1.3 var(--font-body); letter-spacing: 0; color: var(--text-2); margin-bottom: 12px; }
.tr-rows { display: grid; gap: 10px; }
.tr-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; align-items: center; gap: 20px; padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--tr-line); background: var(--surface-solid); }
.tr-row-cover { display: grid; place-items: center; width: 112px; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; background: var(--bg-3); color: var(--ember); }
.tr-row-cover img { width: 100%; height: 100%; object-fit: cover; }
.tr-row-text h3 { font-size: 17px; font-weight: 600; }
.tr-row-text h3 a:hover { color: var(--ember-2); }
.tr-row-text p { margin: 4px 0; color: var(--text-2); font-size: 14px; line-height: 1.5; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.tr-row-text small { color: var(--muted); font-size: 13px; }
.tr-row-progress { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 13px; color: var(--text-2); max-width: 340px; }
.tr-row-progress .tr-progress { flex: 1; }
.tr-progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.tr-progress i { display: block; height: 100%; border-radius: 3px; background: var(--ember); transition: width .3s var(--ease); }

/* ---- Taking a course ---- */
.tr-course { flex: 1; display: grid; grid-template-columns: 320px minmax(0, 1fr); align-items: start; align-content: start; }
.tr-side { position: sticky; top: calc(var(--tr-bar-h) + var(--maint-banner-h, 0px)); height: calc(100vh - var(--tr-bar-h) - var(--maint-banner-h, 0px)); overflow-y: auto; scrollbar-width: thin; border-right: 1px solid var(--tr-line); background: var(--surface-solid); }
.tr-side-top { padding: 20px; border-bottom: 1px solid var(--tr-line); display: grid; gap: 10px; }
.tr-side-title { font: 600 17px/1.3 var(--font-display); }
.tr-side-title:hover { color: var(--ember-2); }
.tr-side-count { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.tr-side-count b { color: var(--text); font-weight: 600; }
.tr-side-toggle { display: none; }
.tr-module { padding: 16px 12px 8px; }
.tr-module h3 { padding: 0 8px; margin-bottom: 8px; font: 600 14px/1.35 var(--font-body); letter-spacing: 0; }
.tr-module h3 span { display: block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.tr-module ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tr-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 7px 8px; border-radius: 8px; color: var(--text-2); }
a.tr-item:hover { background: var(--surface-2); color: var(--text); }
.tr-item.is-current { background: rgba(240,138,60,.12); color: var(--text); box-shadow: inset 3px 0 0 var(--ember); }
.tr-item.is-locked { color: var(--muted); opacity: .7; cursor: not-allowed; }
.tr-item-text { min-width: 0; display: grid; }
.tr-item-text b { font-size: 14px; font-weight: 500; line-height: 1.35; }
.tr-item-text small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.tr-tick { display: grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--success); color: #06281a; }
.tr-tick.is-open, .tr-tick.is-locked { background: var(--surface-2); color: var(--text-2); }
.tr-pane { width: min(820px, 100% - 48px); margin-inline: auto; padding: 40px 0 72px; min-width: 0; }
.tr-head { margin-bottom: 24px; }
.tr-head h1 { font-size: clamp(26px, 3.4vw, 34px); font-weight: 700; margin-top: 8px; }
.tr-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--ember-2); }
.tr-intro { font-size: 17px; line-height: 1.6; color: var(--text-2); margin: 0 0 24px; }
.tr-prose { max-width: none; }
.tr-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--tr-line); }
.tr-actions-solo { justify-content: flex-start; border-top: 0; padding-top: 0; margin-top: 28px; }
.tr .btn-lg.tr-continue { --h: 58px; min-width: 240px; padding: 0 32px; font-size: 17px; }
.tr-cover { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 24px; }
.tr-note { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0; padding: 12px 14px; border-radius: 8px; font-size: 14px; color: var(--text-2); background: var(--surface); border: 1px solid var(--tr-line); }
.tr-note .i { margin-top: 3px; }
.tr-note-warn { color: #ffd98a; border-color: rgba(240,180,41,.35); background: rgba(240,180,41,.08); }
.tr-draft { align-items: center; flex-wrap: wrap; margin-top: 0; margin-bottom: 24px; }
.tr-draft span { flex: 1; min-width: 200px; }
.tr-done { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius-sm); border: 1px solid rgba(76,195,138,.35); background: rgba(76,195,138,.08); color: #7ee0ae; }
.tr-done b { display: block; color: var(--text); font-size: 16px; }
.tr-done small { color: var(--muted); }
.tr-scores { margin-top: 24px; }
.tr-scores h2, .tr-review h2 { font-size: 18px; font-weight: 600; margin-bottom: 12px; }
.tr-scores ul { list-style: none; margin: 0; padding: 0; border: 1px solid var(--tr-line); border-radius: var(--radius-sm); }
.tr-scores li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; flex-wrap: wrap; }
.tr-scores li + li { border-top: 1px solid var(--tr-line); }
.tr-scores li span:first-child { flex: 1; min-width: 140px; }
.tr-facts { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 0 0 20px; padding: 0; }
.tr-facts li { padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--tr-line); background: var(--surface-solid); display: grid; }
.tr-facts b { font: 700 24px/1.2 var(--font-display); }
.tr-facts span { font-size: 13px; color: var(--muted); }

/* ---- Slides ---- */
.tr-player { border-radius: var(--radius-sm); border: 1px solid var(--tr-line); overflow: hidden; background: var(--surface-solid); }
.tr-player:fullscreen { display: flex; flex-direction: column; border: 0; border-radius: 0; background: #000; }
.tr-player:fullscreen .tr-stage { flex: 1; min-height: 0; display: grid; align-items: center; overflow: auto; }
.tr-player-bar, .tr-card-bar { display: flex; align-items: center; gap: 4px; padding: 6px 8px; }
.tr-player-bar { border-top: 1px solid var(--tr-line); background: var(--surface-solid); }
.tr-player-bar .icon-btn[disabled], .tr-card-bar .icon-btn[disabled] { opacity: .35; cursor: default; }
.tr-player-count { min-width: 96px; text-align: center; font-size: 13px; color: var(--text-2); }
.tr-stage { container-type: inline-size; }
.tr-slide { --slide-bg: var(--bg-3); --slide-text: var(--text); position: relative; display: grid; aspect-ratio: 16 / 9; width: 100%; overflow: hidden; background: var(--slide-bg); color: var(--slide-text); }
.tr-slide-inner { position: relative; display: flex; flex-direction: column; justify-content: center; gap: .6em; min-width: 0; padding: 5cqw 6cqw; font-size: clamp(15px, 2.3cqw, 44px); }
.tr-slide-heading { font: 700 1.9em/1.15 var(--font-display); letter-spacing: -.02em; color: inherit; }
.tr-slide-body.prose { max-width: none; color: inherit; font-size: 1em; line-height: 1.5; }
.tr-slide-body.prose :is(h1, h2, h3, h4, strong, a) { color: inherit; }
.tr-slide-body.prose > :first-child { margin-top: 0; }
.tr-slide-body.prose > :last-child { margin-bottom: 0; }
.tr-slide-title .tr-slide-inner { align-items: center; text-align: center; }
.tr-slide-title .tr-slide-heading { font-size: 2.6em; }
.tr-slide-title.has-image { --slide-text: #fff; }
.tr-slide-title.has-image .tr-slide-inner { text-shadow: 0 2px 16px rgba(0,0,0,.65); background: rgba(10,6,3,.45); }
.tr-slide-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tr-slide-split { grid-template-columns: 1fr 1fr; }
.tr-slide-imageRight .tr-slide-figure { order: 2; }
.tr-slide-figure { position: relative; margin: 0; min-height: 0; min-width: 0; }
.tr-slide-figure img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tr-slide-noimage { position: absolute; inset: 0; background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 10px, transparent 10px, transparent 20px); }
.tr-slide-image { grid-template-rows: minmax(0, 1fr) auto; }
.tr-slide-image .tr-slide-figure img { object-fit: contain; }
.tr-slide-caption { padding: 1.6cqw 3cqw; font-size: clamp(14px, 1.8cqw, 34px); background: rgba(0,0,0,.35); }
.tr-slide-caption .tr-slide-heading { font-size: 1.3em; }
.tr-notes { margin-top: 14px; padding: 12px 14px; border-left: 3px solid var(--tr-line); color: var(--text-2); font-size: 15px; white-space: pre-wrap; }
.tr-notes[hidden] { display: none; }

/* ---- Flash cards ---- */
.tr-card { display: block; width: 100%; min-height: 320px; padding: 0; background: none; border: 0; perspective: 1600px; text-align: center; color: inherit; }
.tr-card-inner { position: relative; display: block; min-height: 320px; transition: transform .45s var(--ease); transform-style: preserve-3d; }
.tr-card.is-flipped .tr-card-inner { transform: rotateY(180deg); }
.tr-card-face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 28px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface-solid); backface-visibility: hidden; overflow: auto; }
.tr-card-back { transform: rotateY(180deg); background: var(--bg-3); border-color: rgba(240,138,60,.4); }
.tr-card-face img { max-height: 150px; width: auto; border-radius: 8px; }
.tr-card-text { font-size: clamp(18px, 2.6vw, 24px); font-weight: 500; line-height: 1.4; white-space: pre-wrap; }
.tr-card-face small { color: var(--muted); font-size: 13px; }
.tr-card-bar { margin-top: 8px; padding-inline: 0; }

/* ---- Quizzes ---- */
.tr-quiz { display: grid; gap: 16px; }
.tr-q { margin: 0; padding: 20px; min-width: 0; border-radius: var(--radius-sm); border: 1px solid var(--tr-line); background: var(--surface-solid); }
.tr-q legend { float: left; width: 100%; padding: 0; margin-bottom: 14px; font-size: 17px; font-weight: 500; line-height: 1.45; }
.tr-q legend + * { clear: both; }
.tr-q-num { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.tr-q-hint { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.tr-q-image { max-height: 280px; width: auto; border-radius: 8px; margin-bottom: 14px; }
.tr-options { display: grid; gap: 8px; }
.tr-option { display: flex; align-items: flex-start; gap: 12px; min-height: 48px; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--border-strong); cursor: pointer; line-height: 1.45; }
.tr-option:hover { background: var(--surface); }
.tr-option:has(input:checked) { border-color: var(--ember); background: rgba(240,138,60,.1); }
.tr-option input { flex-shrink: 0; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ember); }
.tr-score { display: flex; align-items: center; gap: 24px; padding: 22px 24px; border-radius: var(--radius-sm); border: 1px solid var(--tr-line); background: var(--surface-solid); flex-wrap: wrap; }
.tr-score-num { font: 700 56px/1 var(--font-display); }
.tr-score.is-pass .tr-score-num { color: var(--success); }
.tr-score.is-fail .tr-score-num { color: #ff9d92; }
.tr-score-text p { margin: 8px 0 2px; color: var(--text-2); }
.tr-score-text small { color: var(--muted); }
.tr-review { margin-top: 28px; }
.tr-review ol, .tr-attempt ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tr-review-q { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; padding: 14px; border-radius: 8px; border: 1px solid var(--tr-line); }
.tr-review-mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; }
.is-right .tr-review-mark { background: rgba(76,195,138,.18); color: #7ee0ae; }
.is-wrong .tr-review-mark { background: rgba(239,90,76,.16); color: #ff9d92; }
.tr-review-q b { font-weight: 500; }
.tr-review-q p { margin: 4px 0 0; font-size: 14px; color: var(--text-2); }
.tr-review-q p span { color: var(--muted); }
.tr-review-why { padding-top: 6px; }
.tr-review-q small { color: var(--muted); white-space: nowrap; }

/* ---- Editor ---- */
.tr-manage-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--tr-line); background: var(--surface-solid); }
.tr-manage-text { min-width: 0; flex: 1 1 280px; }
.tr-manage-text h3 { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tr-manage-text small { color: var(--muted); font-size: 13px; }
.tr-manage-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tr-ed-top { position: sticky; top: calc(var(--tr-bar-h) + var(--maint-banner-h, 0px)); z-index: calc(var(--z-nav) - 1); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 60px; padding: 8px 16px; background: var(--bg-2); border-bottom: 1px solid var(--tr-line); }
.tr-ed-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tr-ed-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tr-ed { flex: 1; display: grid; grid-template-columns: 340px minmax(0, 1fr); align-items: start; }
.tr-ed-outline { padding: 14px; border-right: 1px solid var(--tr-line); background: var(--surface-solid); align-self: stretch; display: grid; gap: 10px; align-content: start; }
.tr-ed-pick { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; min-height: 40px; padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--text-2); font-size: 14px; text-align: left; }
.tr-ed-pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-ed-pick:hover { background: var(--surface-2); color: var(--text); }
.tr-ed-pick.is-current { background: rgba(240,138,60,.14); color: var(--text); }
.tr-ed-module { padding: 10px; border-radius: var(--radius-sm); border: 1px solid var(--tr-line); }
.tr-ed-module-head { display: flex; align-items: center; gap: 2px; margin-bottom: 6px; }
.tr-ed-module-name { flex: 1; min-width: 0; }
.tr-ed-module-name .input { min-height: 38px; padding: 6px 10px; font-size: 14px; font-weight: 600; }
.tr-ed-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tr-ed-item { display: flex; align-items: center; flex-wrap: wrap; border-radius: 8px; }
.tr-ed-item-tools { display: flex; margin-left: auto; }
.tr .icon-btn.tr-mini { min-width: 30px; height: 30px; padding: 0; border-radius: 6px; }
.tr .icon-btn.tr-mini[disabled] { opacity: .3; cursor: default; }
@media (pointer: coarse) { .tr .icon-btn.tr-mini { min-width: 38px; height: 38px; } }
.tr-ed-add { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--tr-line); }
.tr-ed-add .btn { --h: 32px; padding: 0 8px; font-size: 12px; gap: 6px; }
.tr-ed-add-module { justify-self: start; }
.tr-ed-panel { min-width: 0; padding: 20px; }
.tr-ed-card { display: grid; gap: 16px; max-width: 920px; margin-inline: auto; padding: 22px; border-radius: var(--radius-sm); border: 1px solid var(--tr-line); background: var(--surface-solid); }
.tr-ed-card > * { min-width: 0; }
.tr-ed-card h2 { font-size: 20px; font-weight: 600; }
.tr-ed-subhead { font-size: 16px; font-weight: 600; margin-top: 6px; }
.tr-ed-back { display: none; justify-self: start; }
.tr-ed-hint { margin: -10px 0 0; font-size: 13px; color: var(--muted); }
.tr-ed-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.tr-ed-image-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tr-ed-image-box { display: grid; place-items: center; width: 84px; height: 52px; border-radius: 8px; overflow: hidden; border: 1px solid var(--tr-line); color: var(--muted); background: var(--bg-3); }
.tr-ed-image-box img { width: 100%; height: 100%; object-fit: cover; }
.tr-ed-list { display: grid; gap: 12px; }
.tr-ed-row { display: grid; gap: 12px; padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--tr-line); background: var(--bg-2); min-width: 0; }
.tr-ed-row-head { display: flex; align-items: center; gap: 2px; font-size: 14px; }
.tr-ed-add-one { justify-self: start; }
.tr-ed-options { display: grid; gap: 6px; }
.tr-ed-option { display: flex; align-items: center; gap: 8px; }
.tr-ed-option .input { min-height: 40px; padding: 8px 10px; font-size: 14px; flex: 1; min-width: 0; }
.tr-ed-option-fixed { font-size: 15px; min-height: 40px; display: flex; align-items: center; }
.tr-ed-correct { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; cursor: pointer; }
.tr-ed-correct input { width: 18px; height: 18px; margin: 0; accent-color: var(--success); }
.tr-ed-thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.tr-ed-thumb { flex: 0 0 132px; display: grid; gap: 4px; align-content: start; min-height: 76px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--tr-line); background: var(--bg-3); color: var(--text-2); font-size: 12px; text-align: left; }
.tr-ed-thumb b { font-size: 11px; color: var(--muted); }
.tr-ed-thumb span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; line-height: 1.35; }
.tr-ed-thumb:hover { border-color: var(--border-strong); }
.tr-ed-thumb.is-current { border-color: var(--ember); box-shadow: inset 0 0 0 1px var(--ember); color: var(--text); }
.tr-ed-thumb-add { place-content: center; justify-items: center; text-align: center; border-style: dashed; background: none; }
.tr-ed-slide { display: grid; gap: 14px; }
.tr-ed-slide > * { min-width: 0; }
.tr-ed-slide [hidden] { display: none; }
.tr-ed-slide-tools { display: flex; align-items: center; gap: 2px; }
.tr-ed-preview { border-radius: 8px; overflow: hidden; border: 1px solid var(--tr-line); }
.tr-ed-color { display: flex; align-items: center; gap: 10px; min-height: 46px; }
.tr-ed-color input { width: 56px; height: 38px; padding: 2px; border-radius: 8px; border: 1px solid var(--border-strong); background: none; cursor: pointer; }
.tr-ed-color small { color: var(--muted); }
.tr .rt-toolbar { top: calc(var(--tr-bar-h) + 60px + var(--maint-banner-h, 0px)); }
.tr-ed-card .rt-body { min-height: 300px; padding: 20px 22px; }

/* ---- Results ---- */
.tr-results-search { display: block; margin-bottom: 14px; }
.tr-people { display: grid; gap: 8px; }
.tr-person { border-radius: var(--radius-sm); border: 1px solid var(--tr-line); background: var(--surface-solid); }
.tr-person > summary { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(120px, 1fr) auto minmax(100px, auto); align-items: center; gap: 16px; padding: 12px 14px; cursor: pointer; list-style: none; }
.tr-person > summary::-webkit-details-marker { display: none; }
.tr-person-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tr-person-who b { display: block; font-weight: 500; }
.tr-person-who small, .tr-person-when, .tr-person-progress small { color: var(--muted); font-size: 12px; }
.tr-person-progress { display: grid; gap: 4px; }
.tr-person-body { display: grid; gap: 14px; padding: 14px; border-top: 1px solid var(--tr-line); }
.tr-person-quiz { display: grid; gap: 6px; }
.tr-person-quiz-head { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; font-size: 14px; color: var(--text-2); }
.tr-person-quiz-head b { color: var(--text); font-weight: 600; }
.tr-person-actions { display: flex; justify-content: flex-end; }
.tr-attempt { border-radius: 8px; border: 1px solid var(--tr-line); }
.tr-attempt > summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 12px; cursor: pointer; font-size: 14px; }
.tr-attempt > summary small { color: var(--muted); margin-left: auto; }
.tr-attempt ol { padding: 8px; }

@media (max-width: 900px) {
  .tr-course { grid-template-columns: minmax(0, 1fr); }
  .tr-side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--tr-line); }
  .tr-side-top { padding: 14px 16px; }
  .tr-side-toggle { display: inline-flex; }
  .tr-modules { display: none; }
  .tr-modules.is-open { display: block; padding-bottom: 8px; }
  .tr-pane { width: min(820px, 100% - 32px); padding: 24px 0 56px; }
  .tr-ed { grid-template-columns: minmax(0, 1fr); }
  .tr-ed-outline { border-right: 0; }
  .tr-ed.show-panel .tr-ed-outline { display: none; }
  .tr-ed:not(.show-panel) .tr-ed-panel { display: none; }
  .tr-ed-back { display: inline-flex; }
  .tr-ed-panel { padding: 12px; }
  .tr-ed-card { padding: 16px; }
  .tr-ed-top { position: static; }
  .tr .rt-toolbar { top: 0; position: static; }
}
@media (max-width: 640px) {
  .tr-bar { padding: 0 12px; }
  .tr-bar-link span { display: none; }
  .tr .hide-sm { display: none; }
  .tr-page { padding: 24px 0 64px; }
  .tr-page-head h1 { font-size: 26px; }
  .tr-row { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .tr-row-cover { width: 100%; aspect-ratio: 21 / 9; }
  .tr-row-cover:not(:has(img)) { display: none; }
  .tr-row-go { width: 100%; }
  .tr-actions { flex-direction: column-reverse; align-items: stretch; }
  .tr-actions > span:empty { display: none; }
  .tr .btn-lg.tr-continue { width: 100%; min-width: 0; }
  .tr-actions .btn { width: 100%; }
  .tr-slide { aspect-ratio: auto; min-height: 56vw; }
  .tr-slide-inner { padding: 22px 18px; }
  .tr-slide-split { grid-template-columns: minmax(0, 1fr); grid-template-rows: 46vw auto; }
  .tr-slide-imageRight .tr-slide-figure { order: 0; }
  .tr-slide-image { grid-template-rows: 56vw auto; }
  .tr-slide-caption { padding: 12px 14px; }
  .tr-card, .tr-card-inner { min-height: 280px; }
  .tr-q { padding: 16px; }
  .tr-person > summary { grid-template-columns: minmax(0, 1fr) auto; }
  .tr-person-progress { grid-column: 1 / -1; grid-row: 2; }
  .tr-person-when { grid-column: 1 / -1; }
  .tr-manage-actions .btn { flex: 1; }
  .tr-review-q { grid-template-columns: 26px minmax(0, 1fr); }
  .tr-review-q small { grid-column: 2; }
}
/* ---- Slides on the free canvas ---- */
.sc-stage { display: block; container-type: inline-size; }
.sc-slide { --u: calc(100cqw / 1600); position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; font-family: var(--font-body); line-height: 1.25; }
.sc-bg-img, .sc-bg-dim { position: absolute; inset: 0; width: 100%; height: 100%; }
.sc-bg-img { object-fit: cover; }
.sc-bg-dim { background: #000; }
.sc-el { position: absolute; box-sizing: border-box; overflow: hidden; }
.sc-el-shape { overflow: visible; }
.sc-el[data-link] { cursor: pointer; }
.sc-el > img { display: block; width: 100%; height: 100%; }
.sc-text { position: relative; display: flex; flex-direction: column; box-sizing: border-box; width: 100%; height: 100%; overflow: hidden; overflow-wrap: anywhere; }
.sc-text-inner { min-height: 1em; outline: none; }
.sc-text-inner ul, .sc-text-inner ol { margin: 0; padding-left: 1.3em; }
.sc-text-inner li + li { margin-top: .25em; }
.sc-text-inner p { margin: 0 0 .4em; }
.sc-text-inner a { color: inherit; text-decoration: underline; }
.sc-shape { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sc-table { width: 100%; height: 100%; border-collapse: collapse; table-layout: fixed; }
.sc-table td { padding: var(--pad); border: calc(2 * var(--u)) solid var(--tc); vertical-align: middle; overflow-wrap: anywhere; outline: none; }
.sc-table .is-head td { background: var(--th); color: #1b130c; font-weight: 700; }
.sc-chart { width: 100%; height: 100%; overflow: hidden; background: transparent; }
.sc-chart-inner { transform-origin: top left; }
.sc-chart .rt-chart, .sc-chart figure { margin: 0; }
.sc-wait { visibility: hidden; }
.sc-an-fade, .sc-an-left, .sc-an-right, .sc-an-up, .sc-an-down, .sc-an-zoom, .sc-an-pop { animation: var(--sc-name) var(--sc-dur, 500ms) var(--ease) var(--sc-delay, 0ms) both; }
.sc-an-fade { --sc-name: sc-fade; }
.sc-an-left { --sc-name: sc-left; }
.sc-an-right { --sc-name: sc-right; }
.sc-an-up { --sc-name: sc-up; }
.sc-an-down { --sc-name: sc-down; }
.sc-an-zoom { --sc-name: sc-zoom; }
.sc-an-pop { --sc-name: sc-pop; }
@keyframes sc-fade { from { opacity: 0; } }
@keyframes sc-left { from { opacity: 0; translate: -30cqw 0; } }
@keyframes sc-right { from { opacity: 0; translate: 30cqw 0; } }
@keyframes sc-up { from { opacity: 0; translate: 0 18cqw; } }
@keyframes sc-down { from { opacity: 0; translate: 0 -18cqw; } }
@keyframes sc-zoom { from { opacity: 0; scale: .4; } }
@keyframes sc-pop { 0% { opacity: 0; scale: .5; } 70% { opacity: 1; scale: 1.08; } 100% { scale: 1; } }
.sc-tr-fade, .sc-tr-fade-back { animation: sc-fade var(--sc-dur, 500ms) ease both; }
.sc-tr-zoom, .sc-tr-zoom-back { animation: sc-zoom var(--sc-dur, 500ms) var(--ease) both; }
.sc-tr-push { animation: sc-push var(--sc-dur, 500ms) var(--ease) both; }
.sc-tr-push-back { animation: sc-push-back var(--sc-dur, 500ms) var(--ease) both; }
.sc-tr-wipe, .sc-tr-wipe-back { animation: sc-wipe var(--sc-dur, 500ms) ease both; }
@keyframes sc-push { from { translate: 100% 0; } }
@keyframes sc-push-back { from { translate: -100% 0; } }
@keyframes sc-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.tr-player .sc-stage { overflow: hidden; }
.tr-player:fullscreen .sc-stage { flex: 1; display: grid; place-items: center; width: 100%; container-type: normal; }
.tr-player:fullscreen .sc-slide { --u: calc(min(100vw, (100vh - 60px) * 16 / 9) / 1600); width: min(100vw, calc((100vh - 60px) * 16 / 9)); }
.tr-slide-read { display: none; }
@media (max-width: 640px) {
  .tr-slide-read:not([hidden]) { display: grid; gap: 8px; margin-top: 14px; padding: 14px; border-radius: 8px; border: 1px solid var(--tr-line); background: var(--surface-solid); font-size: 16px; line-height: 1.5; color: var(--text-2); }
  .tr-slide-read p { margin: 0; }
}
.tr-ed-open-studio { justify-self: start; }
.tr-ed-film { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tr-ed-film-slide { display: grid; gap: 4px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 12px; text-align: left; }
.tr-ed-film-slide > span { border-radius: 6px; overflow: hidden; border: 1px solid var(--tr-line); pointer-events: none; }
.tr-ed-film-slide:hover > span { border-color: var(--ember); }
.tr-ed-film-slide .tr-slide { aspect-ratio: 16 / 9; min-height: 0; }

/* ---- The slide editor ---- */
body.pp-open { overflow: hidden; }
body.pp-open .unsaved-bar { display: none !important; }
.pp { position: fixed; inset: var(--maint-banner-h, 0px) 0 0; z-index: calc(var(--z-modal) - 2); display: flex; flex-direction: column; background: #100c09; color: var(--text); --pp-line: var(--border); font-size: 14px; }
.pp .btn { border-radius: 8px; box-shadow: none; }
.pp-top { display: flex; align-items: center; gap: 6px; min-height: 52px; padding: 6px 12px; background: var(--surface-solid); border-bottom: 1px solid var(--pp-line); }
.pp-name { flex: 0 1 300px; min-width: 80px; }
.pp-name .input { min-height: 36px; padding: 4px 10px; font-weight: 600; font-size: 14px; }
.pp-top .icon-btn { min-width: 36px; height: 36px; padding: 0; }
.pp-top .icon-btn[disabled] { opacity: .3; cursor: default; }
.pp-tabs { display: flex; gap: 2px; padding: 0 10px; overflow-x: auto; scrollbar-width: none; background: var(--surface-solid); }
.pp-tabs button { flex-shrink: 0; min-height: 36px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-2); font-size: 13px; font-weight: 500; }
.pp-tabs button:hover { color: var(--text); }
.pp-tabs button.is-current { color: var(--text); border-bottom-color: var(--ember); }
.pp-ribbon { display: flex; align-items: stretch; gap: 0; min-height: 88px; padding: 6px 8px 2px; overflow-x: auto; scrollbar-width: thin; background: #1b1510; border-bottom: 1px solid var(--pp-line); }
.pp-group { flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; padding: 0 10px; border-right: 1px solid var(--pp-line); }
.pp-group:last-child { border-right: 0; }
.pp-group-body { flex: 1; display: flex; flex-wrap: wrap; align-items: center; align-content: center; gap: 4px; max-width: 560px; }
.pp-group-name { font-size: 11px; text-align: center; color: var(--muted); }
.pp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 32px; min-height: 32px; padding: 0 6px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--text-2); font-size: 14px; }
.pp-btn:hover { background: var(--surface-2); color: var(--text); }
.pp-btn[aria-pressed="true"] { background: rgba(240,138,60,.18); border-color: rgba(240,138,60,.5); color: var(--text); }
.pp-btn[disabled] { opacity: .3; cursor: default; }
.pp-btn-wide { padding: 0 10px; font-size: 13px; white-space: nowrap; border-color: var(--pp-line); }
.pp-field { display: flex; flex-direction: column; gap: 2px; min-width: 130px; }
.pp-field > span:not(.sr-only) { font-size: 11px; color: var(--muted); }
.pp-field-font { min-width: 170px; }
.pp-field-size { min-width: 74px; }
.pp-field-num { min-width: 64px; }
.pp .pp-field .input, .pp .dd-trigger, .pp .pp-field .select { min-height: 32px; padding: 3px 8px; font-size: 13px; border-radius: 6px; }
.pp-color { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 6px; cursor: pointer; font-weight: 700; }
.pp-color:hover { background: var(--surface-2); }
.pp-color input { position: absolute; left: 4px; right: 4px; bottom: 3px; width: 24px; height: 7px; padding: 0; border: 0; background: none; cursor: pointer; }
.pp-color span { margin-top: -8px; }
.pp-color-field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); }
.pp-color-field input { width: 44px; height: 32px; padding: 2px; border: 1px solid var(--border-strong); border-radius: 6px; background: none; cursor: pointer; }
.pp-shapes { display: grid; grid-template-columns: repeat(10, 32px); gap: 2px; }
.pp-themes { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-theme { position: relative; display: grid; align-content: center; justify-items: start; width: 74px; height: 58px; padding: 4px 6px; border: 1px solid var(--pp-line); border-radius: 6px; text-align: left; line-height: 1.1; }
.pp-theme:hover { border-color: var(--ember); }
.pp-theme b { font: 700 15px/1 var(--font-display); }
.pp-theme i { width: 22px; height: 3px; margin: 4px 0; border-radius: 2px; }
.pp-theme span { font-size: 10px; }
.pp-hint { margin: 0; max-width: 260px; font-size: 12px; color: var(--muted); line-height: 1.45; }
.pp-anim-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 64px; overflow-y: auto; min-width: 210px; scrollbar-width: thin; }
.pp-anim-list li { display: flex; align-items: center; border-radius: 6px; }
.pp-anim-list li.is-current { background: rgba(240,138,60,.14); }
.pp-anim-list li > button:first-child { flex: 1; min-width: 0; padding: 2px 6px; overflow: hidden; border: 0; background: none; color: var(--text-2); font-size: 12px; text-align: left; white-space: nowrap; text-overflow: ellipsis; }
.pp-anim-list .pp-btn { min-width: 24px; min-height: 24px; padding: 0; }
.pp-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 188px minmax(0, 1fr) 260px; }
.pp-strip { display: flex; flex-direction: column; gap: 10px; padding: 10px; overflow-y: auto; scrollbar-width: thin; background: var(--surface-solid); border-right: 1px solid var(--pp-line); }
.pp-add-slide { flex-shrink: 0; }
.pp-thumb { flex-shrink: 0; display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 4px; cursor: pointer; border-radius: 6px; }
.pp-thumb b { font-size: 11px; font-weight: 500; color: var(--muted); text-align: right; }
.pp-thumb-stage { border-radius: 4px; overflow: hidden; border: 2px solid var(--pp-line); pointer-events: none; user-select: none; }
.pp-thumb:hover .pp-thumb-stage { border-color: var(--border-strong); }
.pp-thumb.is-current .pp-thumb-stage { border-color: var(--ember); }
.pp-thumb.is-drop .pp-thumb-stage { box-shadow: 0 -4px 0 var(--ember-2); }
.pp-work { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.pp-canvas { flex: 1; min-height: 0; display: grid; place-items: center; padding: 26px; overflow: hidden; background: #0b0806; }
.pp-stage-wrap { position: relative; box-shadow: 0 8px 40px rgba(0,0,0,.6); touch-action: none; user-select: none; }
.pp-stage-wrap .sc-el { cursor: move; }
.pp-stage-wrap .sc-el.is-editing { cursor: text; user-select: text; }
.pp-stage-wrap .is-editing .sc-text-inner, .pp-stage-wrap .is-editing td { user-select: text; cursor: text; }
.pp-empty { display: grid; place-items: center; aspect-ratio: 16 / 9; background: var(--bg-3); color: var(--muted); }
.sc-text-inner[data-ph]:empty::before { content: attr(data-ph); opacity: .45; }
.sc-img-empty { display: grid; place-items: center; width: 100%; height: 100%; padding: 8px; text-align: center; font-size: max(11px, calc(26 * var(--u))); color: var(--muted); background: var(--surface); border: 2px dashed var(--border-strong); }
.pp-overlay { position: absolute; inset: 0; pointer-events: none; }
.pp-sel { position: absolute; box-sizing: border-box; outline: 1.5px solid var(--ember); }
.pp-sel.is-editing { outline-style: dashed; }
.pp-sel.is-locked { outline-color: var(--muted); }
.pp-h, .pp-rot { position: absolute; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 2px; background: #fff; border: 1.5px solid var(--ember-deep); pointer-events: auto; touch-action: none; }
@media (pointer: coarse) { .pp-h, .pp-rot { width: 20px; height: 20px; margin: -10px 0 0 -10px; } }
.pp-h-nw { left: 0; top: 0; cursor: nwse-resize; }
.pp-h-n { left: 50%; top: 0; cursor: ns-resize; }
.pp-h-ne { left: 100%; top: 0; cursor: nesw-resize; }
.pp-h-e { left: 100%; top: 50%; cursor: ew-resize; }
.pp-h-se { left: 100%; top: 100%; cursor: nwse-resize; }
.pp-h-s { left: 50%; top: 100%; cursor: ns-resize; }
.pp-h-sw { left: 0; top: 100%; cursor: nesw-resize; }
.pp-h-w { left: 0; top: 50%; cursor: ew-resize; }
.pp-rot { left: 50%; top: -24px; border-radius: 50%; background: var(--ember); cursor: grab; }
.pp-guide { position: absolute; background: #ff4fa3; }
.pp-band { position: absolute; border: 1px solid var(--ember-2); background: rgba(240,138,60,.14); }
.pp-notes { flex-shrink: 0; padding: 8px 12px; background: var(--surface-solid); border-top: 1px solid var(--pp-line); }
.pp-notes .textarea { min-height: 44px; height: 44px; padding: 6px 10px; font-size: 13px; }
.pp-format { display: flex; flex-direction: column; gap: 12px; padding: 14px; overflow-y: auto; scrollbar-width: thin; background: var(--surface-solid); border-left: 1px solid var(--pp-line); }
.pp-format > * { flex-shrink: 0; }
.pp-format h3 { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-format .pp-hint { max-width: none; }
.pp-format-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pp-format .pp-field { min-width: 0; }
.pp-format .textarea { min-height: 90px; font-size: 13px; }
.pp-color-row { display: flex; align-items: flex-end; gap: 12px; }
.pp-check { min-height: 32px; font-size: 13px; }
.pp-row { display: flex; flex-wrap: wrap; gap: 4px; }
.pp-row .btn { --h: 32px; padding: 0 10px; font-size: 12px; }
.pp-keys { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0; font-size: 12px; }
.pp-keys dt { color: var(--text-2); white-space: nowrap; }
.pp-keys dd { margin: 0; color: var(--muted); }
.pp-show { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; background: #000; }
.pp-show-stage { flex: 1; min-height: 0; display: grid; place-items: center; width: min(100%, calc((100vh - 60px) * 16 / 9)); margin-inline: auto; cursor: pointer; }
.pp-show-bar { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 8px 14px; color: var(--text-2); font-size: 13px; }
@media (max-width: 1100px) {
  .pp-body { grid-template-columns: 130px minmax(0, 1fr) 220px; }
}
@media (max-width: 760px) {
  .pp-hide-sm { display: none; }
  .pp-top { flex-wrap: wrap; }
  .pp-name { order: 5; flex: 1 1 100%; }
  .pp-body { display: flex; flex-direction: column; overflow-y: auto; }
  .pp-strip { flex-direction: row; flex-shrink: 0; padding: 8px; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--pp-line); }
  .pp-add-slide { align-self: center; }
  .pp-thumb { width: 118px; grid-template-columns: 12px minmax(0, 1fr); }
  .pp-work { flex-shrink: 0; }
  .pp-canvas { flex: none; padding: 18px 10px 30px; }
  .pp-format { flex-shrink: 0; overflow: visible; border-left: 0; border-top: 1px solid var(--pp-line); }
  .pp-ribbon { min-height: 80px; }
  .pp-group-body { flex-wrap: nowrap; max-width: none; }
  .pp-shapes { grid-template-columns: repeat(19, 32px); }
  .pp-themes { flex-wrap: nowrap; }
}

/* ---- Course lists, access and roles ---- */
.tr [hidden] { display: none !important; }
.tr-tabs { display: flex; gap: 2px; padding: 0 20px; overflow-x: auto; background: var(--surface-solid); border-bottom: 1px solid var(--tr-line); scrollbar-width: none; }
.tr-tabs a { flex-shrink: 0; display: inline-flex; align-items: center; min-height: 46px; padding: 0 14px; font-size: 14px; font-weight: 500; color: var(--text-2); border-bottom: 2px solid transparent; }
.tr-tabs a:hover { color: var(--text); }
.tr-tabs a.is-current { color: var(--text); border-bottom-color: var(--ember); }
.tr-id { display: inline-block; font: 500 11px/1.6 var(--font-mono); letter-spacing: 0; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--tr-line); color: var(--muted); vertical-align: middle; white-space: nowrap; }
.tr-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.tr-search { flex: 1 1 260px; }
.tr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-chip { min-height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--tr-line); background: none; color: var(--text-2); font-size: 14px; font-weight: 500; }
.tr-chip:hover { border-color: var(--border-strong); color: var(--text); }
.tr-chip.is-current { border-color: var(--ember); background: rgba(240,138,60,.12); color: var(--text); }
.tr-sort { flex: 0 0 190px; }
.tr-row-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tr-row-badges .badge { height: auto; min-height: 26px; white-space: normal; }
.tr-row-actions { display: grid; gap: 6px; justify-items: stretch; }
.tr-row-scores { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 0; padding: 0; font-size: 13px; color: var(--text-2); }
.tr-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.tr-link { color: var(--ember-2); text-decoration: underline; text-underline-offset: 3px; }
.tr-prompt p { margin-bottom: 18px; }
.tr-prompt-actions { display: grid; gap: 10px; }
.tr-side-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.tr-side-back:hover { color: var(--text); }
.tr-side-top .tr-id { justify-self: start; }
.tr-side-hint { margin: 0; font-size: 13px; color: var(--muted); }
.tr-gate { display: grid; gap: 22px; margin-top: 24px; padding: 22px; border-radius: var(--radius-sm); border: 1px solid var(--tr-line); background: var(--surface-solid); }
.tr-gate h2 { font-size: 18px; font-weight: 600; }
.tr-gate p { margin: 6px 0 12px; color: var(--text-2); font-size: 15px; }
.tr-gate .tr-actions-solo { margin-top: 16px; }
.tr-gate-roles + .tr-gate-remove, .tr-gate-remove { justify-self: start; }
.tr-code-form { display: grid; gap: 10px; }
.tr-code-form h2 + p { margin-top: 0; }
.tr-code-input { font: 500 20px/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; max-width: 340px; }
.tr-code-form .tr-continue { justify-self: start; }
.tr-gate-roles { display: grid; justify-items: start; gap: 6px; }
.tr-gate-roles .badge { gap: 8px; }
.tr-gate-roles .tr-note { margin: 8px 0; }
.tr-gate-roles .btn { margin-top: 10px; }

/* ---- ER:LC rules ---- */
.rules-page { padding: 34px 0 90px; max-width: 920px; }
.rules-head { margin: 14px 0 18px; }
.rules-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 20px; }
.rules-tabs a { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 14px; font-weight: 600; text-align: center; transition: background-color .15s, border-color .15s, color .15s; }
.rules-tabs a:hover { border-color: var(--border-strong); color: var(--text); }
.rules-tabs a.is-current { border-color: rgba(240,138,60,.55); background: rgba(240,138,60,.12); color: var(--ember-2); }
.rules-intro { margin: 0 0 14px; color: var(--muted); }
.rules-soon { padding: 22px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.rules-soon h2 { font-size: 22px; margin-bottom: 8px; }
.rules-soon p { margin: 0 0 12px; color: var(--text-2); }
.rules-soon ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rules-soon a { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; color: var(--ember-2); font-weight: 500; }
.rules-tools { display: grid; gap: 12px; margin-bottom: 8px; }
.rules-search { display: block; }
.rules-jump { display: flex; flex-wrap: wrap; gap: 6px; }
.rules-jump[hidden] { display: none; }
.rules-jump a { padding: 6px 12px; border-radius: var(--radius-pill); border: 1px solid var(--border); font-size: 13px; color: var(--text-2); background: var(--surface); }
.rules-jump a:hover { color: var(--text); border-color: var(--border-strong); }
.rules-section { margin-top: 34px; scroll-margin-top: 100px; }
.rules-section[hidden], .rule[hidden] { display: none; }
.rules-section h2 { margin-bottom: 12px; font-size: 24px; }
.rules-list { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.rule { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; padding: 14px 16px 14px 14px; scroll-margin-top: 100px; }
.rule + .rule { border-top: 1px solid var(--border); }
.rule-num { font: 600 14px/1.65 var(--font-mono); color: var(--ember-2); }
.rule-body { display: grid; gap: 6px; min-width: 0; color: var(--text-2); font-size: 15px; line-height: 1.6; }
.rule-body p { margin: 0; }
.rule-body ul { margin: 0; padding-left: 20px; display: grid; gap: 3px; }
.rule-note { font-size: 14px; color: var(--muted); }
.rule-info { display: inline; padding: 0 2px; border: 0; border-bottom: 1px dotted var(--ember-2); border-radius: 2px; background: none; color: var(--ember-2); font: inherit; cursor: help; }
.rule-info .i { display: inline-block; width: 13px; height: 13px; margin-left: 4px; vertical-align: -2px; }
.rule-info:hover, .rule-info[aria-expanded="true"] { background: rgba(240,138,60,.14); color: var(--text); }
.rule-tip { position: fixed; z-index: var(--z-toast); width: min(320px, calc(100vw - 24px)); padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-solid); box-shadow: var(--shadow); font-size: 14px; line-height: 1.5; }
.rule-tip[hidden] { display: none; }
.rule-tip b { display: block; margin-bottom: 4px; font-weight: 600; color: var(--text); }
.rule-tip p { margin: 0; color: var(--text-2); }
.rule-tip a { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; margin-top: 6px; color: var(--ember-2); font-weight: 500; }
@media (max-width: 640px) {
  .rules-page { padding-top: 20px; }
  .rules-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rules-section h2 { font-size: 21px; }
  .rule { grid-template-columns: 40px minmax(0, 1fr); gap: 6px; padding: 12px; }
}

/* ---- Completed courses on profiles ---- */
.profile-courses-box { margin: 18px 0; }
.profile-courses-box h2 { margin-bottom: 10px; font-size: 16px; font-weight: 600; }
.profile-courses { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.profile-courses li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
.profile-course-mark { display: grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: rgba(76,195,138,.15); color: #7ee0ae; }
.profile-course-text { flex: 1 1 160px; min-width: 0; display: grid; }
.profile-course-text b { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.profile-course-text small { font-size: 12px; color: var(--muted); }
.profile-courses-link { color: var(--ember-2); text-decoration: underline; text-underline-offset: 3px; }

/* ---- Video, units, exams and certificates ---- */
.tr-video { aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; background: #000; border: 1px solid var(--tr-line); }
.tr-video iframe, .tr-video video { display: block; width: 100%; height: 100%; border: 0; }
.tr-video-notes { margin-top: 20px; }
.tr-units { margin-top: 28px; }
.tr-units h2 { font-size: 18px; font-weight: 600; margin-bottom: 12px; }
.tr-units ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tr-unit { display: grid; gap: 10px; padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--tr-line); background: var(--surface-solid); }
.tr-unit-head { display: flex; gap: 12px; }
.tr-unit-num { display: grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px; background: rgba(240,138,60,.14); color: var(--ember-2); font-weight: 600; }
.tr-unit-head b { font-weight: 600; }
.tr-unit-head p { margin: 2px 0; font-size: 14px; color: var(--text-2); }
.tr-unit-head small { font-size: 13px; color: var(--muted); }
.tr-rules { margin: 16px 0; padding: 14px 14px 14px 32px; display: grid; gap: 6px; border-radius: 8px; border: 1px solid var(--tr-line); background: var(--surface); font-size: 14px; color: var(--text-2); }
.tr-sitting-bar { position: sticky; top: calc(var(--tr-bar-h) + var(--maint-banner-h, 0px)); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 14px; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface-solid); }
.tr-sitting-time { font: 600 18px/1.2 var(--font-mono); }
.tr-sitting-time.is-low { color: #ff9d92; }
.tr-sitting-saved { font-size: 13px; color: var(--muted); }
.tr-sitting-flags { margin-left: auto; font-size: 13px; color: #ffd98a; }
.tr-quiz { position: relative; }
.tr-quiz-closed { user-select: none; -webkit-user-select: none; }
.tr-quiz-closed input.input { user-select: text; -webkit-user-select: text; }
.tr-watermark { position: absolute; inset: 0; z-index: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 90px 30px; overflow: hidden; pointer-events: none; opacity: .055; font-size: 14px; }
.tr-watermark span { transform: rotate(-24deg); white-space: nowrap; }
.tr-quiz-closed > :not(.tr-watermark) { position: relative; z-index: 1; }
.tr-quiz-closed .tr-q { background: color-mix(in srgb, var(--surface-solid) 88%, transparent); }
.tr-in-exam .tr-bar-link, .tr-in-exam .tr-bar-me, .tr-in-exam .tr-brand { pointer-events: none; }
.tr-in-exam .tr-bar-link, .tr-in-exam .tr-bar-me { display: none; }
.tr-in-exam .tr-side { display: none; }
.tr-in-exam .tr-course { grid-template-columns: minmax(0, 1fr); }
@media print { .tr-in-exam { display: none !important; } }
.tr-cert-link { display: flex; align-items: center; gap: 14px; margin: 16px 0; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid rgba(240,138,60,.5); background: rgba(240,138,60,.1); color: var(--ember-2); }
.tr-cert-link:hover { background: rgba(240,138,60,.16); }
.tr-cert-link b { display: block; color: var(--text); font-weight: 600; }
.tr-cert-link small { color: var(--text-2); font-size: 13px; }
.tr-cert-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.tr-cert-actions .tr-crumb { margin: 0; }
/* The certificate is laid out in --u units, so it keeps its proportions like a sheet of paper at any size. */
.tr-cert { container-type: inline-size; margin: 0 auto; max-width: 1040px; box-shadow: var(--shadow); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.tr-cert-sheet { --u: calc(100cqw / 1000); --cert-ink: #2a1c10; --cert-soft: #5c4634; --cert-gold: #a87625; --cert-brown: #7a3d12; display: flex; aspect-ratio: 11 / 8.5; padding: calc(16 * var(--u)); color: var(--cert-ink); background: repeating-linear-gradient(45deg, #b98a35 0 1px, #f3e6c6 1px 4px), #f3e6c6; }
.tr-cert-inner { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; overflow: hidden; padding: calc(34 * var(--u)) calc(70 * var(--u)) calc(16 * var(--u)); text-align: center; background: radial-gradient(ellipse at center, #fffdf6 0%, #fbf5e4 62%, #f2e6c8 100%); border: calc(2 * var(--u)) solid var(--cert-brown); outline: calc(1 * var(--u)) solid var(--cert-gold); outline-offset: calc(-9 * var(--u)); }
.tr-cert-corner { position: absolute; width: calc(74 * var(--u)); height: calc(74 * var(--u)); fill: none; stroke: var(--cert-gold); stroke-width: 1.6; }
.tr-cert-corner .is-filled { fill: var(--cert-brown); stroke: none; }
.tr-cert-corner-tl { top: calc(14 * var(--u)); left: calc(14 * var(--u)); }
.tr-cert-corner-tr { top: calc(14 * var(--u)); right: calc(14 * var(--u)); transform: scaleX(-1); }
.tr-cert-corner-bl { bottom: calc(14 * var(--u)); left: calc(14 * var(--u)); transform: scaleY(-1); }
.tr-cert-corner-br { bottom: calc(14 * var(--u)); right: calc(14 * var(--u)); transform: scale(-1); }
.tr-cert-mark { position: absolute; top: 50%; left: 50%; width: calc(470 * var(--u)); height: calc(470 * var(--u)); transform: translate(-50%, -50%); opacity: .07; mix-blend-mode: multiply; pointer-events: none; }
.tr-cert-body { position: relative; display: flex; flex-direction: column; align-items: center; width: 100%; margin: auto 0; }
.tr-cert-org { margin: 0; font: 600 calc(19 * var(--u))/1.3 'Cinzel', Georgia, serif; letter-spacing: .24em; text-transform: uppercase; color: var(--cert-brown); }
.tr-cert h1 { margin: calc(8 * var(--u)) 0 0; font: 700 calc(72 * var(--u))/1.02 'Cinzel', Georgia, serif; letter-spacing: .03em; color: var(--cert-ink); }
.tr-cert h1 span { display: block; margin-top: calc(6 * var(--u)); font-size: calc(26 * var(--u)); font-weight: 500; letter-spacing: .3em; text-transform: uppercase; color: var(--cert-gold); }
.tr-cert-rule { position: relative; width: calc(300 * var(--u)); height: 1px; margin: calc(16 * var(--u)) 0 calc(14 * var(--u)); background: linear-gradient(90deg, transparent, var(--cert-gold), transparent); }
.tr-cert-rule i { position: absolute; top: 50%; left: 50%; width: calc(9 * var(--u)); height: calc(9 * var(--u)); background: var(--cert-gold); transform: translate(-50%, -50%) rotate(45deg); }
.tr-cert-line { margin: 0; font: italic 500 calc(23 * var(--u))/1.3 'Cormorant Garamond', Georgia, serif; color: var(--cert-soft); }
.tr-cert-line b { font-style: normal; font-weight: 500; font-family: 'Cinzel', Georgia, serif; font-size: .92em; color: var(--cert-ink); }
.tr-cert-name { min-width: 55%; max-width: 100%; margin: calc(2 * var(--u)) 0 calc(8 * var(--u)); padding: 0 calc(24 * var(--u)) calc(2 * var(--u)); font: 400 calc(70 * var(--u))/1.2 'Great Vibes', 'Brush Script MT', cursive; color: var(--cert-brown); border-bottom: 1px solid var(--cert-gold); overflow-wrap: anywhere; }
.tr-cert-name.is-long { font-size: calc(46 * var(--u)); }
.tr-cert-course { margin: calc(6 * var(--u)) 0 calc(5 * var(--u)); font: 600 calc(34 * var(--u))/1.2 'Cinzel', Georgia, serif; letter-spacing: .03em; color: var(--cert-ink); overflow-wrap: anywhere; }
.tr-cert-foot { position: relative; display: grid; grid-template-columns: 1fr calc(146 * var(--u)) 1fr; align-items: end; gap: calc(30 * var(--u)); width: 86%; margin-top: auto; }
.tr-cert-seal { display: block; width: 100%; height: auto; filter: drop-shadow(0 calc(2 * var(--u)) calc(3 * var(--u)) rgba(60,35,10,.35)); }
.tr-cert-sign { min-width: 0; padding-bottom: calc(26 * var(--u)); }
.tr-cert-sign b { display: flex; align-items: flex-end; justify-content: center; min-height: calc(38 * var(--u)); padding-bottom: calc(4 * var(--u)); font: 600 calc(17 * var(--u))/1.2 'Cinzel', Georgia, serif; color: var(--cert-ink); border-bottom: 1px solid var(--cert-soft); overflow-wrap: anywhere; }
.tr-cert-sign b.tr-cert-signature { font: 400 calc(34 * var(--u))/1.1 'Great Vibes', 'Brush Script MT', cursive; color: var(--cert-brown); }
.tr-cert-sign span { display: block; margin-top: calc(5 * var(--u)); font: italic 500 calc(17 * var(--u))/1.2 'Cormorant Garamond', Georgia, serif; color: var(--cert-soft); }
.tr-cert-id { position: relative; margin: calc(4 * var(--u)) 0 0; font: 500 calc(11 * var(--u))/1.3 var(--font-body); letter-spacing: .08em; color: var(--cert-soft); }
/* On a phone the sheet gets taller so the words stay readable. */
@container (max-width: 620px) {
  .tr-cert-sheet { --u: calc(100cqw / 480); aspect-ratio: auto; padding: calc(9 * var(--u)); }
  .tr-cert-inner { padding: calc(30 * var(--u)) calc(26 * var(--u)) calc(14 * var(--u)); }
  .tr-cert-corner { width: calc(46 * var(--u)); height: calc(46 * var(--u)); }
  .tr-cert-org { font-size: calc(14 * var(--u)); letter-spacing: .16em; padding: 0 calc(26 * var(--u)); }
  .tr-cert h1 { font-size: calc(50 * var(--u)); }
  .tr-cert h1 span { font-size: calc(17 * var(--u)); letter-spacing: .24em; }
  .tr-cert-name { font-size: calc(56 * var(--u)); }
  .tr-cert-name.is-long { font-size: calc(38 * var(--u)); }
  .tr-cert-course { font-size: calc(25 * var(--u)); }
  .tr-cert-foot { width: 100%; gap: calc(10 * var(--u)); margin-top: calc(24 * var(--u)); grid-template-columns: 1fr calc(92 * var(--u)) 1fr; }
  .tr-cert-sign b { font-size: calc(13 * var(--u)); }
  .tr-cert-sign b.tr-cert-signature { font-size: calc(24 * var(--u)); }
  .tr-cert-sign span { font-size: calc(14 * var(--u)); }
  .tr-cert-id { margin-top: calc(10 * var(--u)); font-size: calc(10 * var(--u)); }
}
@page certificate { size: 11in 8.5in; margin: 0; }
@media print {
  body:has(.tr-cert) .tr-bar, body:has(.tr-cert) .tr-cert-actions, body:has(.tr-cert) .toast-stack, body:has(.tr-cert) .maint-banner { display: none !important; }
  body:has(.tr-cert), body:has(.tr-cert) .tr { background: #fff !important; }
  body:has(.tr-cert) .tr-page { width: 100%; max-width: none; margin: 0; padding: 0; }
  .tr-cert { page: certificate; max-width: none; width: 100%; box-shadow: none; break-inside: avoid; }
  .tr-cert-sheet { height: 100vh; aspect-ratio: auto; }
}

/* ---- Staff: one person's course in detail ---- */
.tr-ed-unit-desc { display: block; margin-bottom: 6px; }
.tr-ed-unit-desc .input { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.tr-results-more { margin-top: 12px; }
.tr-results-more > summary { display: block; font-weight: 500; }
.tr-results-more .tr-table-wrap { border-width: 1px 0 0; border-radius: 0; }
.tr-person-who h1 { font-size: 28px; font-weight: 700; }
.tr-person-who > span > small { color: var(--muted); }
.tr-an-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tr-an-table th { padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--muted); text-align: right; white-space: nowrap; }
.tr-an-table td { padding: 8px 10px; border-top: 1px solid var(--tr-line); text-align: right; font-variant-numeric: tabular-nums; }
.tr-an-table th:first-child, .tr-an-table td:first-child { text-align: left; }
.tr-an-table td:first-child { min-width: 180px; }
.tr-an-table .tr-an-kind { display: block; font-size: 12px; color: var(--muted); }
.tr-an-unit { margin-bottom: 14px; }
.tr-an-unit h3 { margin-bottom: 8px; font-size: 15px; font-weight: 600; }
.tr-an-attempt { display: grid; gap: 8px; padding: 12px; border-radius: 8px; border: 1px solid var(--tr-line); background: var(--surface-solid); }
.tr-an-attempt.is-void { opacity: .6; }
.tr-an-attempt-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 14px; }
.tr-an-attempt-head b { font-size: 18px; }
.tr-an-attempt-head small { color: var(--muted); }
.tr-an-attempt-head .tr-bar-gap { min-width: 4px; }
.tr-an-events { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: #ffd98a; }
.tr-an-list { display: grid; gap: 8px; margin-bottom: 10px; }
.tr-an-quiz { margin-bottom: 18px; }
.tr-an-quiz h3 { margin-bottom: 8px; font-size: 15px; font-weight: 600; }
.tr-flag-count { color: #ffd98a; }
.tr-bar-text { font-variant-numeric: tabular-nums; }

/* ---- Staff: keys and statistics ---- */
.tr-page-wide { width: min(1180px, 100% - 32px); }
.tr-section-title { margin: 30px 0 12px; font-size: 18px; font-weight: 600; }
.tr-key-form { max-width: none; margin-bottom: 8px; }
.tr-keys-list { margin-top: 28px; }
.tr-key-made { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 16px; border-radius: 8px; border: 1px solid rgba(76,195,138,.45); background: rgba(76,195,138,.08); }
.tr-key-made span { font-size: 13px; color: var(--text-2); }
.tr-key-made code { font: 600 22px/1.2 var(--font-mono); letter-spacing: .06em; overflow-wrap: anywhere; }
.tr-key-log { flex-basis: 100%; min-width: 0; font-size: 13px; }
.tr-key-log summary { cursor: pointer; color: var(--text-2); min-height: 28px; }
.tr-key-table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 13px; }
.tr-key-table td { padding: 6px 8px 6px 0; border-top: 1px solid var(--tr-line); vertical-align: middle; }
.tr-key-table td b { font-weight: 500; }
.tr-key-table small { color: var(--muted); }
.tr-key-table td:nth-child(n+2) { white-space: nowrap; }
.tr-table-wrap { overflow-x: auto; border: 1px solid var(--tr-line); border-radius: var(--radius-sm); }
.tr-stat-table { width: 100%; min-width: 860px; border-collapse: collapse; font-size: 14px; }
.tr-stat-table th { padding: 10px 12px; font-size: 12px; font-weight: 600; text-align: right; color: var(--muted); background: var(--surface-solid); white-space: nowrap; }
.tr-stat-table td { padding: 10px 12px; border-top: 1px solid var(--tr-line); text-align: right; font-variant-numeric: tabular-nums; }
.tr-stat-table th:first-child, .tr-stat-table td:first-child { text-align: left; }
.tr-stat-table td:first-child b { font-weight: 500; }
.tr-stat-table td:first-child a:hover b { color: var(--ember-2); }
.tr-stat-table .tr-row-progress { margin: 0; min-width: 120px; }
.tr-person > summary.tr-account-sum { grid-template-columns: minmax(220px, 1.1fr) minmax(0, 1.5fr) auto; }
.tr-account-counts { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 13px; color: var(--muted); }
.tr-account-counts b { font-weight: 600; color: var(--text); }
.tr-account-courses { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tr-account-course { display: grid; gap: 6px; padding: 12px; border-radius: 8px; border: 1px solid var(--tr-line); background: var(--bg-2); }
.tr-account-course-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.tr-account-course-head b { font-weight: 500; }
.tr-account-course .tr-row-progress { margin: 0; }
@media (max-width: 640px) {
  .tr-person > summary.tr-account-sum { grid-template-columns: minmax(0, 1fr); }
  .tr-key-table td:nth-child(n+2) { white-space: normal; }
}

/* ---- Staff: codes, roles, results filters ---- */
.tr-ed-section { display: grid; gap: 12px; padding-top: 16px; border-top: 1px solid var(--tr-line); }
.tr-ed-section > * { min-width: 0; }
.tr-ed-checks { display: grid; gap: 2px; }
.tr-ed-checks .check { min-height: 38px; font-size: 14px; }
.tr-code-list { display: grid; gap: 8px; }
.tr-code-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--tr-line); background: var(--bg-2); }
.tr-code-row code { font: 500 15px/1.3 var(--font-mono); letter-spacing: .04em; }
.tr-code-row small { color: var(--muted); font-size: 12px; }
.tr-code-row .tr-code-time { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 13px; }
.tr-code-row .tr-bar-gap { min-width: 8px; }
.tr-code-row.is-off { opacity: .6; }
.tr-code-used { flex-basis: 100%; font-size: 12px; color: var(--muted); }
.tr-roles { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.tr-role-list { display: grid; gap: 6px; }
.tr-role-pick { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--tr-line); background: var(--surface-solid); color: var(--text-2); font-size: 14px; text-align: left; }
.tr-role-pick:hover { border-color: var(--border-strong); color: var(--text); }
.tr-role-pick.is-current { border-color: var(--ember); color: var(--text); }
.tr-role-pick small { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.tr-role-pick span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-picker { max-height: 280px; overflow-y: auto; scrollbar-width: thin; border: 1px solid var(--tr-line); border-radius: 8px; }
.tr-picker h4 { position: sticky; top: 0; z-index: 1; padding: 8px 12px; font: 600 12px/1.3 var(--font-body); letter-spacing: 0; color: var(--muted); background: var(--bg-3); }
.tr-picker label { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 12px; font-size: 14px; cursor: pointer; }
.tr-picker label:hover { background: var(--surface); }
.tr-picker input { width: 16px; height: 16px; margin: 0; accent-color: var(--ember); flex-shrink: 0; }
.tr-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 2px 4px 2px 10px; border-radius: 8px; border: 1px solid var(--tr-line); font-size: 13px; background: var(--bg-2); }
.tr-pill small { color: var(--muted); }
.tr-pill button { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 6px; background: none; color: var(--muted); }
.tr-pill button:hover { background: var(--surface-2); color: var(--text); }
.tr-found { display: grid; gap: 2px; }
.tr-found button { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 10px; border: 0; border-radius: 8px; background: none; color: var(--text-2); font-size: 14px; text-align: left; }
.tr-found button:hover { background: var(--surface-2); color: var(--text); }
.tr-found small { color: var(--muted); }
.tr-role-color { width: 56px; height: 38px; padding: 2px; border-radius: 8px; border: 1px solid var(--border-strong); background: none; cursor: pointer; }
.tr-role-actions { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tr-person-times { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13px; color: var(--text-2); }
.tr-person-times span b { font-weight: 500; color: var(--muted); }
@media (max-width: 900px) { .tr-roles { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .tr-tabs { padding: 0 8px; }
  .tr-sort { flex: 1 1 100%; }
  .tr-row-actions { width: 100%; }
  .tr-code-form .tr-continue, .tr-code-input { width: 100%; max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .tr-card-inner, .tr-progress i { transition: none; } }

/* ==========================================================================
   Application portal (applications.js, applications-builder.js, form-render.js)
   ========================================================================== */
.link-btn { padding: 0; border: 0; background: none; color: var(--ember-2); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.show-sm { display: none; }
/* The panel's content column never grows past the screen; wide strips scroll inside it instead. */
.dash > [data-dash] { min-width: 0; }
.ap-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 24px; padding: 4px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); width: fit-content; max-width: 100%; }
.ap-tabs a, .ap-tabs button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: none; color: var(--text-2); font-size: 14px; font-weight: 600; }
.ap-tabs a:hover, .ap-tabs button:hover { color: var(--text); background: var(--surface-2); }
.ap-tabs .is-current { background: rgba(240,138,60,.14); color: var(--ember-2); }
.ap-search { width: min(320px, 100%); }
.ap-portal .chip { display: inline-flex; align-items: center; gap: 6px; }
.ap-portal .chip .update-count { margin-left: 0; }
.ap-group { margin-bottom: 40px; }
.ap-group-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.ap-group-head h2 { font-size: 22px; margin: 0; }
.ap-group-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.ap-group-icon { flex-shrink: 0; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--ember-2); background: rgba(240,138,60,.12); border: 1px solid rgba(240,138,60,.3); }
.ap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.ap-card { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); color: inherit; transition: border-color .2s, transform .2s var(--ease); }
.ap-card:hover { border-color: rgba(240,138,60,.5); transform: translateY(-2px); }
.ap-card-cover { aspect-ratio: 16 / 7; overflow: hidden; background: var(--bg-3); }
.ap-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.ap-card-body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 20px; }
.ap-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ap-card-count { font-size: 13px; }
.ap-card h3 { margin: 0; font-size: 19px; }
.ap-card p { margin: 0; color: var(--muted); font-size: 15px; flex: 1; }
.ap-needs { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--text-2); }
.ap-needs span { display: inline-flex; align-items: center; gap: 6px; }
.ap-card-cta { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--ember-2); font-weight: 600; font-size: 14px; }

.ap-apply, .ap-detail { padding-top: 30px; padding-bottom: 90px; }
.ap-apply { max-width: 860px; }
.ap-hero { position: relative; overflow: hidden; margin: 10px 0 28px; padding: 28px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: radial-gradient(120% 120% at 100% 0%, rgba(240,138,60,.16), transparent 60%), var(--surface); isolation: isolate; }
.ap-hero.has-cover { min-height: 260px; display: flex; align-items: flex-end; }
.ap-hero-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.ap-hero.has-cover::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(13,10,8,.95), rgba(13,10,8,.35)); }
.ap-hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ap-hero h1 { margin: 0; font-size: clamp(30px, 5vw, 46px); overflow-wrap: anywhere; }
.ap-hero p { margin: 10px 0 0; color: var(--text-2); font-size: 17px; max-width: 60ch; }
.ap-intro { display: grid; gap: 22px; }
.ap-facts { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 0; padding: 0; list-style: none; color: var(--text-2); font-size: 14px; }
.ap-facts li { display: inline-flex; align-items: center; gap: 8px; }
.ap-facts .i { color: var(--ember-2); }
.ap-start { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.ap-notice { display: flex; gap: 14px; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); }
.ap-notice > .i { flex-shrink: 0; margin-top: 2px; color: var(--muted); }
.ap-notice > div { min-width: 0; }
.ap-notice b { display: block; color: var(--text); }
.ap-notice p, .ap-notice ul { margin: 4px 0 0; color: var(--text-2); font-size: 15px; overflow-wrap: anywhere; }
.ap-notice ul { padding-left: 18px; }
.ap-notice a { color: var(--ember-2); text-decoration: underline; }
.ap-notice a.btn { text-decoration: none; }
.ap-notice-info { border-color: rgba(106,165,255,.35); background: rgba(106,165,255,.07); }
.ap-notice-info > .i { color: var(--info); }
.ap-notice-ember { border-color: rgba(240,138,60,.4); background: rgba(240,138,60,.08); }
.ap-notice-ember > .i { color: var(--ember-2); }
.ap-notice-good { border-color: rgba(76,195,138,.4); background: rgba(76,195,138,.08); }
.ap-notice-good > .i { color: var(--success); }
.ap-notice-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.ap-detail > .ap-notice, .dash-head + .ap-notice { margin-bottom: 18px; }

/* Filling in */
.ap-steps { display: flex; gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.ap-steps:empty { display: none; }
.ap-steps li { display: flex; align-items: center; gap: 8px; flex-shrink: 0; padding: 6px 12px 6px 6px; border-radius: var(--radius-pill); border: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.ap-steps li span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); font-weight: 700; font-size: 12px; }
.ap-steps li b { font-weight: 600; white-space: nowrap; }
.ap-steps .is-current { border-color: rgba(240,138,60,.5); color: var(--text); }
.ap-steps .is-current span { background: var(--ember); color: #1f0f03; }
.ap-steps .is-done span { background: rgba(76,195,138,.2); color: var(--success); }
.ap-form { padding: 26px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); }
.ap-page-head { margin-bottom: 22px; }
.ap-page-head h2 { margin: 0; font-size: 24px; }
.ap-page-head p { margin: 6px 0 0; color: var(--muted); }
.ap-questions { display: grid; gap: 24px; }
.ap-q { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ap-q[hidden], .ap-section[hidden], .ap-info[hidden] { display: none; }
.ap-q-label { font-weight: 600; color: var(--text); font-size: 15px; }
.ap-req { margin-left: 4px; color: var(--ember-2); }
.ap-q-help { margin: -4px 0 0; color: var(--muted); font-size: 14px; }
.ap-q-error { margin: 0; color: #ff9d92; font-size: 14px; }
.ap-q.has-error .input, .ap-q.has-error .textarea, .ap-q.has-error .dd-trigger { border-color: var(--danger); }
.ap-count { align-self: flex-end; color: var(--muted); font-size: 12px; margin-top: -4px; }
.ap-narrow { max-width: 260px; }
.ap-options { display: grid; gap: 2px; }
.ap-option { min-height: 40px; padding: 4px 10px; margin: 0 -10px; border-radius: 10px; }
.ap-option:hover { background: var(--surface-2); }
.ap-option span { color: var(--text); }
.ap-radio input { border-radius: 50%; }
.ap-radio input:checked { background-image: radial-gradient(circle, #1f0f03 0 4px, transparent 5px); }
.ap-prefixed { display: flex; align-items: stretch; }
.ap-prefixed > span { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--border-strong); border-right: 0; border-radius: 12px 0 0 12px; background: rgba(0,0,0,.18); color: var(--muted); font-size: 14px; white-space: nowrap; }
.ap-prefixed .input { border-radius: 0 12px 12px 0; min-width: 0; }
.ap-section { padding-top: 10px; border-top: 1px solid var(--border); }
.ap-section h3 { margin: 0; font-size: 19px; }
.ap-section p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.ap-info { padding: 16px 18px; border-radius: var(--radius); background: rgba(106,165,255,.06); border: 1px solid rgba(106,165,255,.25); }
.ap-info > b { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: var(--text); }
.ap-info .prose { font-size: 15px; line-height: 1.65; }
.ap-info .prose > :last-child { margin-bottom: 0; }
.ap-files { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ap-files:empty { display: none; }
.ap-file { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; border: 1px solid var(--border); background: rgba(0,0,0,.18); }
.ap-file img, .ap-file-icon { flex-shrink: 0; width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }
.ap-file-icon { display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.ap-file-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; color: var(--text); }
.ap-file-name small { color: var(--muted); margin-left: 4px; }
.ap-file-add { align-self: flex-start; cursor: pointer; }
.ap-file-add[hidden] { display: none; }
.ap-file-add.is-busy { opacity: .6; pointer-events: none; }
.ap-file-note { color: var(--muted); font-size: 12px; }
.ap-form-bar { position: sticky; bottom: 12px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 28px; padding: 10px; border-radius: 16px; border: 1px solid var(--border-strong); background: rgba(24,19,14,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.ap-form-bar [data-prev][hidden] { visibility: hidden; display: inline-flex; }
.ap-save-state { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; text-align: center; }
.ap-save-state .i { color: var(--success); }
.ap-done { display: grid; justify-items: center; gap: 10px; padding: 40px 24px; text-align: center; border-radius: var(--radius-lg); border: 1px solid rgba(76,195,138,.35); background: rgba(76,195,138,.06); }
.ap-done-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: rgba(76,195,138,.18); color: var(--success); }
.ap-done h2 { margin: 6px 0 0; }
.ap-done-number { margin: 0; color: var(--muted); font: 500 14px var(--font-mono); }
.ap-done .prose { max-width: 56ch; }

/* My applications */
.ap-mine { padding-bottom: 80px; }
.ap-subhead { font-size: 15px; margin: 26px 0 12px; color: var(--text-2); letter-spacing: .02em; }
.ap-rows { display: grid; gap: 8px; }
.ap-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: inherit; transition: border-color .2s; }
a.ap-row:hover { border-color: var(--border-strong); }
.ap-row.is-attention { border-color: rgba(240,138,60,.5); }
.ap-row-icon { flex-shrink: 0; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--surface-2); color: var(--ember-2); }
.ap-row-main { flex: 1; min-width: 0; }
.ap-row-main b { display: block; color: var(--text); overflow-wrap: anywhere; }
.ap-row-main small { display: block; color: var(--muted); font-size: 13px; }
.ap-row-end { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; color: var(--muted); }
.ap-empty-line { margin: 6px 0 14px; font-size: 14px; }
.ap-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 10px 0 22px; }
.ap-detail-head h1 { margin: 6px 0 4px; font-size: clamp(28px, 4vw, 40px); overflow-wrap: anywhere; }
.ap-detail-head p { margin: 0; }
.ap-detail-grid, .ap-review-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; margin-top: 18px; }
.ap-detail-main, .ap-detail-side, .ap-review-main, .ap-review-side { display: grid; gap: 18px; min-width: 0; }
.ap-panel { padding: 20px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); min-width: 0; }
.ap-panel h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 17px; }
.ap-panel-note { margin: -8px 0 14px; font-size: 13px; }
.ap-thread { display: grid; gap: 10px; margin: 0 0 14px; padding: 0; list-style: none; }
.ap-msg { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: rgba(0,0,0,.16); }
.ap-msg-staff { border-color: rgba(240,138,60,.28); background: rgba(240,138,60,.06); }
.ap-msg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13px; }
.ap-msg-head b { color: var(--text); }
.ap-msg-head time { margin-left: auto; color: var(--muted); font-size: 12px; }
.ap-msg-head .badge { height: 22px; font-size: 11px; }
.ap-msg p { margin: 6px 0 0; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.ap-reply { display: grid; gap: 10px; justify-items: start; }
.ap-reply .field { width: 100%; }
.ap-history { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.ap-history li { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; padding-left: 20px; font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }
.ap-history li b { color: var(--text); }
.ap-history time { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.ap-dot { position: absolute; left: 0; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.ap-dot-success { background: var(--success); }
.ap-dot-danger { background: var(--danger); }
.ap-dot-ember { background: var(--ember); }
.ap-dot-soon { background: var(--info); }
.ap-answers-page + .ap-answers-page { margin-top: 20px; }
.ap-answers-page h3 { margin: 0 0 10px; font-size: 15px; color: var(--ember-2); }
.ap-answers { display: grid; gap: 14px; margin: 0; }
.ap-answers dt { font-size: 13px; font-weight: 600; color: var(--muted); }
.ap-answers dd { margin: 4px 0 0; color: var(--text); overflow-wrap: anywhere; }
.ap-answer-text { white-space: pre-wrap; }
.ap-answer-list { margin: 0; padding-left: 18px; }
.ap-answers-head { padding-top: 6px; border-top: 1px solid var(--border); font-weight: 700; color: var(--text-2); }

/* Reviewing */
.ap-filter { margin-bottom: 16px; }
.ap-review-head { margin-top: 6px; align-items: flex-start; }
.ap-review-head h1 { overflow-wrap: anywhere; }
.ap-dm-note { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.ap-person-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ap-person-head b { display: block; color: var(--text); }
.ap-person-head small { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.ap-person-head .level-badge { height: 22px; font-size: 11px; }
.ap-person-facts { display: grid; gap: 8px; margin: 0 0 14px; }
.ap-person-facts div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.ap-person-facts dt { color: var(--muted); }
.ap-person-facts dd { margin: 0; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.ap-person-facts a { color: var(--ember-2); }
.ap-prev { margin-top: 14px; font-size: 14px; }
.ap-prev summary { cursor: pointer; color: var(--text-2); }
.ap-prev ul { display: grid; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.ap-prev li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ap-prev a { color: var(--ember-2); }
.ap-decide { display: grid; gap: 14px; }
.ap-decide [data-decide-more] { display: grid; gap: 14px; }
.ap-decide [hidden] { display: none !important; }
.ap-status-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ap-status-opt { position: relative; display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--border-strong); font-size: 14px; font-weight: 600; color: var(--text-2); text-align: center; cursor: pointer; }
.ap-status-opt input { position: absolute; opacity: 0; pointer-events: none; }
.ap-status-opt:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(240,138,60,.3); }
.ap-status-opt:has(input:disabled) { opacity: .4; cursor: default; }
.ap-status-opt:has(input:checked) { color: #1f0f03; background: var(--ember); border-color: var(--ember); }
.ap-tone-success:has(input:checked) { background: var(--success); border-color: var(--success); }
.ap-tone-danger:has(input:checked) { background: var(--danger); border-color: var(--danger); }
.ap-tone-soon:has(input:checked) { background: var(--info); border-color: var(--info); }
.ap-status-opt:last-child:nth-child(odd) { grid-column: 1 / -1; }
.ap-actions { display: grid; gap: 2px; margin: 0; padding: 12px; border-radius: 12px; border: 1px solid var(--border); }
.ap-actions legend { padding: 0 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.ap-actions .check { min-height: 38px; font-size: 14px; }
.ap-actions small { color: var(--muted); }
.ap-results { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.ap-results li { display: flex; align-items: center; gap: 8px; }
.ap-results .is-ok .i { color: var(--success); }
.ap-results .is-bad { color: #ff9d92; }
.ap-audit summary { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; cursor: pointer; list-style: none; }
.ap-audit summary::-webkit-details-marker { display: none; }
.ap-audit summary h2 { margin: 0; }
.ap-audit[open] summary { margin-bottom: 14px; }

/* Building */
.ap-b-new { display: grid; grid-template-columns: 2fr 1fr auto; gap: 12px; align-items: end; margin-bottom: 22px; padding: 16px; border-radius: var(--radius); border: 1px solid rgba(240,138,60,.4); background: rgba(240,138,60,.06); }
.ap-b-new[hidden] { display: none; }
.ap-b-new-actions { display: flex; gap: 8px; }
.ap-b-group { margin-bottom: 26px; }
.ap-b-group-head { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 17px; }
.ap-b-group-head .i { color: var(--ember-2); }
.ap-b-row .ap-row-main a { color: inherit; }
.ap-b-row .ap-row-main a:hover b { color: var(--ember-2); }
.ap-b-cats { display: grid; gap: 12px; margin-bottom: 16px; }
.ap-b-cat { display: grid; gap: 12px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.ap-b-cat-top { display: flex; align-items: flex-end; gap: 12px; }
.ap-b-grow { flex: 1; min-width: 0; }
.ap-b-levels { display: flex; flex-wrap: wrap; gap: 0 18px; margin: 0; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--border); }
.ap-b-levels legend { padding: 0 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.ap-b-levels legend small { font-weight: 400; color: var(--muted); }
.ap-b-levels .check { min-height: 38px; font-size: 14px; }
.ap-b-pages { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.ap-b-page { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; min-height: 42px; padding: 0 14px 0 8px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 14px; font-weight: 600; }
.ap-b-page > span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--surface-2); font-size: 12px; }
.ap-b-page small { color: var(--muted); font-weight: 500; }
.ap-b-page.is-current { border-color: var(--ember); color: var(--text); background: rgba(240,138,60,.1); }
.ap-b-page.is-current > span { background: var(--ember); color: #1f0f03; }
.ap-b-page-add { padding: 0 14px; border-style: dashed; }
.ap-b-page-panel { margin-bottom: 14px; }
.ap-b-page-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ap-b-fields { display: grid; gap: 10px; }
.ap-b-field { border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); min-width: 0; }
.ap-b-field.is-open { border-color: rgba(240,138,60,.45); }
.ap-b-field.is-static { background: rgba(106,165,255,.04); }
.ap-b-field-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 0; }
.ap-b-field-toggle { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 4px 0 4px 12px; border: 0; background: none; color: inherit; text-align: left; }
.ap-b-type { flex-shrink: 0; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2); color: var(--ember-2); }
.ap-b-field-title { flex: 1; min-width: 0; }
.ap-b-field-title b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 15px; }
.ap-b-field-title small { color: var(--muted); font-size: 12px; }
.ap-b-chev { flex-shrink: 0; color: var(--muted); transition: transform .2s var(--ease); }
.ap-b-field.is-open .ap-b-chev { transform: rotate(180deg); }
.ap-b-field-body { display: grid; gap: 14px; padding: 16px; border-top: 1px solid var(--border); }
.ap-b-switch { padding: 10px 12px; }
.ap-b-nums { display: flex; flex-wrap: wrap; gap: 12px; }
.ap-b-num { width: 180px; max-width: 100%; }
.ap-b-hint { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; }
.ap-b-cond-box { display: grid; gap: 10px; }
.ap-b-cond { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.ap-b-add { margin-top: 16px; padding: 16px; border-radius: var(--radius); border: 1px dashed var(--border-strong); }
.ap-b-add-label { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.ap-b-add-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: 6px; }
.ap-b-add-btn { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: rgba(0,0,0,.16); color: var(--text-2); font-size: 14px; text-align: left; }
.ap-b-add-btn:hover { border-color: rgba(240,138,60,.5); color: var(--text); }
.ap-b-add-btn .i { color: var(--ember-2); flex-shrink: 0; }
.ap-b-settings { display: grid; gap: 16px; }
.ap-b-settings .ap-panel { display: grid; gap: 14px; }
.ap-b-settings .ap-panel h2 { margin: 0; }
.ap-b-settings .ap-panel-note { margin: -6px 0 0; }
.ap-b-cover { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.ap-b-cover-box { display: grid; place-items: center; width: 160px; aspect-ratio: 16 / 7; overflow: hidden; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-3); color: var(--muted); }
.ap-b-cover-box img { width: 100%; height: 100%; object-fit: cover; }
.ap-b-cover label { cursor: pointer; }
.ap-b-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ap-b-pills .tr-pill { border-color: var(--border-strong); }

/* "Read these first" before starting an application */
.ap-read { display: grid; gap: 12px; padding: 18px; border-radius: var(--radius); border: 1px solid rgba(240,138,60,.4); background: rgba(240,138,60,.06); }
.ap-read.is-done { border-color: rgba(76,195,138,.4); background: rgba(76,195,138,.06); }
.ap-read h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; }
.ap-read h2 .i { color: var(--ember-2); }
.ap-read.is-done h2 .i { color: var(--success); }
.ap-read p { margin: 0; color: var(--text-2); font-size: 15px; }
.ap-read-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ap-read-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 12px 8px 8px; border-radius: 12px; border: 1px solid var(--border); background: rgba(0,0,0,.18); }
.ap-read-list a { display: inline-flex; align-items: center; gap: 10px; min-height: 36px; color: var(--text); font-weight: 600; }
.ap-read-list a:hover span:last-child { color: var(--ember-2); text-decoration: underline; text-underline-offset: 3px; }
.ap-read-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); color: var(--muted); }
.ap-read-list li.is-read .ap-read-mark { background: rgba(76,195,138,.18); color: var(--success); }
.ap-read-list small { color: var(--muted); font-size: 12px; }
.ap-read-list li.is-read small { color: #7ee0ae; }
.ap-read-agree { align-items: flex-start; min-height: 0; padding-top: 4px; font-size: 15px; color: var(--text); }
.ap-read-agree input { margin-top: 2px; }
.ap-read-agree.is-locked { opacity: .55; cursor: not-allowed; }
.ap-start .btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.ap-b-links { display: grid; gap: 10px; }
.ap-b-links:empty { display: none; }
.ap-b-link { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 10px; align-items: end; }
.ap-b-link .icon-btn { margin-bottom: 6px; }
@media (max-width: 700px) {
  .ap-b-link { grid-template-columns: 1fr auto; }
  .ap-b-link .field:nth-child(2) { grid-column: 1; grid-row: 2; }
  .ap-b-link .icon-btn { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}
/* With the Apply link the full top bar needs slightly tighter links to fit beside the buttons. */
@media (min-width: 1101px) {
  .nav-links { gap: 2px; }
  .nav-links a { padding: 0 10px; }
  .nav-links a.active::after { left: 10px; right: 10px; }
}
@media (max-width: 960px) {
  .ap-detail-grid, .ap-review-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .show-sm { display: block; }
  .ap-form { padding: 18px 16px; }
  .ap-hero { padding: 20px; }
  .ap-form-bar { padding: 8px; gap: 8px; }
  .ap-form-bar .btn { padding-left: 14px; padding-right: 14px; }
  .ap-save-state { font-size: 12px; flex: 1; justify-content: center; }
  .ap-row { flex-wrap: wrap; }
  .ap-row-end { width: 100%; justify-content: flex-start; padding-left: 52px; }
  .ap-b-row .ap-row-end { padding-left: 0; }
  .ap-detail-head { flex-direction: column; }
  .ap-b-new { grid-template-columns: 1fr; }
  .ap-b-cat-top { flex-wrap: wrap; }
  .ap-b-field-head { flex-wrap: wrap; padding: 8px; }
  .ap-b-field-toggle { flex: 1 1 100%; padding-left: 4px; }
  .ap-b-field-head .level-actions { margin-left: auto; }
  .ap-tabs { width: 100%; }
  .ap-tabs a, .ap-tabs button { flex: 1 1 auto; justify-content: center; padding: 0 10px; }
  .ap-narrow { max-width: none; }
}

/* ==========================================================================
   Message Studio (message-studio.js) and its Discord preview (discord-preview.js)
   ========================================================================== */
.ms-wrap { width: min(1440px, 100% - 32px); margin: 0 auto; padding: 30px 0 90px; }
.ms-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.ms-top h1 { margin: 6px 0 0; font-size: clamp(30px, 4vw, 44px); }
.ms-top .ap-tabs { margin: 0; }
.ms-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.ms-row .ap-row-main a { color: inherit; }
.ms-row .ap-row-main a:hover b { color: var(--ember-2); }

.ms-editor-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 16px; }
.ms-name { flex: 1 1 260px; }
.ms-name .input { font-size: 18px; font-weight: 600; }
.ms-top-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ms-top-controls .ms-f { width: 210px; }
.ms-mode { display: inline-flex; padding: 3px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.ms-mode-opt { position: relative; cursor: pointer; }
.ms-mode-opt input { position: absolute; opacity: 0; pointer-events: none; }
.ms-mode-opt span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.ms-mode-opt input:checked + span { background: rgba(240,138,60,.16); color: var(--ember-2); }
.ms-mode-opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(240,138,60,.3); }
.ms-editor-page > .ap-notice { margin-bottom: 14px; }

.ms-send { margin-bottom: 16px; padding: 16px; border-radius: var(--radius); border: 1px solid rgba(240,138,60,.4); background: rgba(240,138,60,.05); display: grid; gap: 10px; }
.ms-send[hidden] { display: none; }
.ms-send-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.ms-send-row .ms-f { flex: 1 1 260px; }
.ms-sends { display: grid; gap: 8px; }
.ms-sent { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: rgba(0,0,0,.16); }
.ms-sent b { display: block; color: var(--text); }
.ms-sent small { color: var(--muted); font-size: 12px; }
.ms-sent-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ms-h { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 16px; }
.ms-h small { color: var(--muted); font-weight: 500; font-size: 12px; }
.ms-h4 { margin: 6px 0 0; font-size: 14px; color: var(--text-2); }

.ms-switch { display: none; }
.ms-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: 20px; align-items: start; }
.ms-edit { display: grid; gap: 14px; min-width: 0; }
.ms-section { display: grid; gap: 10px; padding: 16px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); min-width: 0; }
.ms-preview { position: sticky; top: calc(var(--nav-h) + 24px); min-width: 0; }
.ms-preview-inner { max-height: calc(100vh - var(--nav-h) - 48px); overflow: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); background: #313338; scrollbar-width: thin; }
.ms-preview-label { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #b5bac1; background: #2b2d31; border-bottom: 1px solid #1f2023; }
.ms-hint { margin: 0; font-size: 13px; }

.ms-f { gap: 6px; min-width: 0; }
.ms-f > span { font-size: 12px; }
.ms-f .input, .ms-f .select, .ms-f .textarea { min-height: 40px; padding-top: 8px; padding-bottom: 8px; font-size: 14px; }
.ms-f .textarea { min-height: 64px; }
.ms-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 10px; }
.ms-check { min-height: 34px; font-size: 14px; }
.ms-group { display: grid; gap: 10px; margin: 0; padding: 10px 12px 12px; border-radius: 12px; border: 1px solid var(--border); }
.ms-group legend { padding: 0 6px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.ms-group legend small { color: var(--muted); font-weight: 500; }
.ms-img-row { display: flex; gap: 6px; }
.ms-img-row .input { flex: 1; min-width: 0; }
.ms-upload { flex-shrink: 0; cursor: pointer; padding: 0 12px; }
.ms-color-row { display: flex; gap: 6px; }
.ms-color-row input[type="color"] { flex-shrink: 0; width: 44px; height: 40px; padding: 2px; border-radius: 10px; border: 1px solid var(--border-strong); background: rgba(0,0,0,.28); cursor: pointer; }
.ms-color .ms-color-row .input { width: 110px; }
.ms-color-row { align-items: center; flex-wrap: wrap; }
.ms-color-row input:disabled { opacity: .4; cursor: not-allowed; }
.ms-color-row .ms-check { margin-left: 4px; }
.ms-kind { display: flex; padding: 3px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.ms-kind-opt { flex: 1; position: relative; cursor: pointer; }
.ms-kind-opt input { position: absolute; opacity: 0; pointer-events: none; }
.ms-kind-opt span { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 10px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.ms-kind-opt input:checked + span { background: rgba(240,138,60,.16); color: var(--ember-2); }
.ms-kind-opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(240,138,60,.3); }
.ms-dur { display: flex; gap: 6px; }
.ms-dur .input { width: 110px; }
.ms-dur .dd, .ms-dur .select { flex: 1; min-width: 120px; }
.ms-add { display: flex; flex-wrap: wrap; gap: 6px; }
.ms-add .btn { border-style: dashed; }

.ms-card { border-radius: 14px; border: 1px solid var(--border); background: rgba(0,0,0,.14); min-width: 0; }
.ms-card[open] { border-color: rgba(240,138,60,.35); }
.ms-card > summary { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; cursor: pointer; list-style: none; }
.ms-card > summary::-webkit-details-marker { display: none; }
.ms-card > summary::before { content: ''; flex-shrink: 0; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; margin-right: 4px; }
.ms-card[open] > summary::before { transform: rotate(45deg); }
.ms-card-title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ms-card-title b { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-size: 14px; }
.ms-card-title small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; color: var(--muted); font-size: 12px; }
.ms-tools { display: flex; flex-shrink: 0; }
.ms-tools .icon-btn { width: 32px; height: 32px; }
.ms-card-body { display: grid; gap: 10px; padding: 4px 12px 12px; min-width: 0; }
.ms-sub { background: rgba(255,238,220,.025); }
.ms-container > summary { background: rgba(240,138,60,.06); border-radius: 14px; }
.ms-children, .ms-options { display: grid; gap: 8px; padding-left: 10px; border-left: 2px solid var(--border); }
.ms-nested { display: grid; gap: 10px; padding: 10px; border-radius: 12px; border: 1px dashed var(--border-strong); }
.ms-section-text { display: flex; gap: 6px; align-items: flex-end; }
.ms-section-text .ms-f { flex: 1; }
.ms-actions { display: grid; gap: 8px; padding: 10px; border-radius: 12px; background: rgba(106,165,255,.05); border: 1px solid rgba(106,165,255,.22); }
.ms-actions-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.ms-actions-head .i { color: var(--info); }
.ms-action { display: grid; gap: 8px; padding: 10px; border-radius: 10px; border: 1px solid var(--border); background: rgba(0,0,0,.18); }
.ms-action-top { display: flex; gap: 6px; align-items: center; }
.ms-action-top .dd, .ms-action-top .select { flex: 1; min-width: 0; }
.ms-json textarea { font: 13px/1.5 var(--font-mono); min-height: 280px; }
.ms-json .form-actions { flex-wrap: wrap; }
.ms-list-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ms-json { width: min(720px, 100%); }
/* Taller than a phone screen, so the window scrolls instead of cutting off its buttons. */
.modal:has(.ms-json) { align-items: flex-start; overflow-y: auto; padding: 16px; }
@media (max-width: 700px) { .ms-json { padding: 20px 16px; } .ms-json textarea { min-height: 180px; } }
.ms-json-drop { position: relative; }
.ms-json-drop-note { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; border: 2px dashed var(--ember); background: rgba(13,10,8,.88); color: var(--ember-2); pointer-events: none; }
.ms-json-drop.is-over .ms-json-drop-note { display: flex; }
.ms-json-file { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.ms-json-file label { cursor: pointer; }
.ms-json-file .ms-hint { flex-basis: 100%; }

/* The Discord look */
.dx-message { display: flex; gap: 14px; padding: 16px; color: #dbdee1; font: 400 15px/1.375 'gg sans', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; }
.dx-avatar { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: #1e1f22; display: grid; place-items: center; }
.dx-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dx-body { flex: 1; min-width: 0; display: grid; gap: 4px; justify-items: start; }
.dx-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dx-head b { color: #f2f3f5; font-weight: 600; }
.dx-head small { color: #949ba4; font-size: 12px; }
.dx-app { padding: 0 4px; border-radius: 3px; background: #5865f2; color: #fff; font-size: 10px; font-weight: 700; line-height: 15px; }
.dx-content, .dx-text, .dx-embed-desc, .dx-field-value { overflow-wrap: anywhere; width: 100%; }
.dx-line { min-height: 1.375em; }
.dx-blank { min-height: .9em; }
.dx-h { color: #f2f3f5; font-weight: 700; line-height: 1.375; margin: 8px 0 4px; }
.dx-h:first-child { margin-top: 0; }
.dx-h1 { font-size: 24px; } .dx-h2 { font-size: 20px; } .dx-h3 { font-size: 16px; }
.dx-subtext { color: #949ba4; font-size: 12px; }
.dx-quote { position: relative; padding-left: 12px; }
.dx-quote::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 4px; background: #4e5058; }
.dx-list { margin: 2px 0; padding-left: 22px; }
.dx-list li.dx-nested { margin-left: 16px; }
.dx-code { padding: 0 .2em; border-radius: 4px; background: #2b2d31; font: 85% var(--font-mono); }
.dx-pre { margin: 4px 0; padding: 8px; border-radius: 4px; background: #2b2d31; border: 1px solid #1e1f22; font: 13px/1.4 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.dx-link { color: #00a8fc; }
.dx-link:hover { text-decoration: underline; }
.dx-mention { padding: 0 2px; border-radius: 3px; background: color-mix(in srgb, var(--mc, #5865f2) 30%, transparent); color: color-mix(in srgb, var(--mc, #c9cdfb) 70%, #fff); font-weight: 500; }
.dx-stamp { padding: 0 2px; border-radius: 3px; background: rgba(255,255,255,.06); }
.dx-spoiler { border-radius: 3px; background: #1e1f22; color: transparent; cursor: pointer; }
.dx-spoiler:hover, .dx-spoiler:focus { background: rgba(255,255,255,.1); color: inherit; }
.dx-emoji { display: inline-block; width: 1.375em; height: 1.375em; vertical-align: bottom; object-fit: contain; }
.dx-empty { color: #949ba4; font-style: italic; font-size: 14px; }
.dx-embed { display: grid; gap: 8px; width: 100%; max-width: 516px; padding: 8px 16px 16px 12px; border-left: 4px solid var(--bar); border-radius: 4px; background: #2b2d31; }
.dx-embed-grid { display: flex; gap: 16px; }
.dx-embed-main { flex: 1; min-width: 0; display: grid; gap: 6px; padding-top: 4px; }
.dx-embed-author { display: flex; align-items: center; gap: 8px; color: #f2f3f5; font-size: 14px; font-weight: 600; }
.dx-embed-author img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.dx-embed-author a, .dx-embed-title a { color: inherit; }
.dx-embed-title { color: #f2f3f5; font-weight: 600; }
.dx-embed-title a { color: #00a8fc; }
.dx-embed-desc { font-size: 14px; }
.dx-fields { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.dx-field { flex: 1 1 100%; min-width: 0; font-size: 14px; }
.dx-field.is-inline { flex: 1 1 calc(33% - 16px); min-width: 120px; }
.dx-field-name { color: #f2f3f5; font-weight: 600; margin-bottom: 2px; }
.dx-embed-thumb { flex-shrink: 0; width: 80px; height: 80px; border-radius: 4px; object-fit: cover; margin-top: 4px; }
.dx-embed-image { width: 100%; max-height: 300px; border-radius: 4px; object-fit: cover; }
.dx-embed-footer { display: flex; align-items: center; gap: 8px; color: #b5bac1; font-size: 12px; }
.dx-embed-footer img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.dx-row { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; margin-top: 4px; }
.dx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 2px 16px; border-radius: 8px; color: #fff; font-size: 14px; font-weight: 500; }
.dx-btn-primary { background: #5865f2; } .dx-btn-secondary { background: #4e5058; } .dx-btn-success { background: #248046; } .dx-btn-danger { background: #da373c; }
.dx-btn.is-disabled { opacity: .5; }
.dx-btn .dx-emoji-text { font-size: 16px; }
.dx-ext { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.dx-select { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; max-width: 400px; min-height: 40px; padding: 8px 12px; border-radius: 8px; border: 1px solid #1e1f22; background: #1e1f22; color: #949ba4; font-size: 14px; }
.dx-select.is-disabled { opacity: .5; }
.dx-chev { flex-shrink: 0; width: 18px; height: 18px; fill: none; stroke: #dbdee1; stroke-width: 2; }
.dx-v2 { display: grid; gap: 8px; width: 100%; max-width: 560px; }
.dx-container { display: grid; gap: 8px; padding: 16px; border-radius: 8px; background: #2b2d31; border: 1px solid #3f4147; }
.dx-container.has-accent { border-left: 4px solid var(--bar); }
.dx-container.is-spoiler { filter: blur(6px); }
.dx-container.is-spoiler:hover { filter: none; }
.dx-section { display: flex; gap: 12px; align-items: flex-start; }
.dx-section-texts { flex: 1; min-width: 0; display: grid; gap: 6px; }
.dx-section-thumb { display: block; width: 85px; height: 85px; border-radius: 8px; object-fit: cover; }
.dx-thumb-empty { background: #1e1f22; border: 1px dashed #4e5058; }
.dx-sep { width: 100%; }
.dx-sep-sm { height: 8px; } .dx-sep-lg { height: 16px; }
.dx-sep.has-line { display: grid; align-items: center; }
.dx-sep.has-line::after { content: ''; height: 1px; background: #3f4147; }
.dx-gallery { display: grid; gap: 4px; width: 100%; border-radius: 8px; overflow: hidden; }
.dx-gallery-1 { grid-template-columns: 1fr; } .dx-gallery-2 { grid-template-columns: 1fr 1fr; } .dx-gallery-3, .dx-gallery-5 { grid-template-columns: repeat(3, 1fr); } .dx-gallery-4 { grid-template-columns: 1fr 1fr; }
.dx-gallery-item img { width: 100%; height: 100%; max-height: 300px; aspect-ratio: 1; object-fit: cover; display: block; }
.dx-gallery-1 .dx-gallery-item img { aspect-ratio: auto; }
.dx-gallery-item.is-spoiler img { filter: blur(20px); }
.dx-gallery-empty { padding: 20px; border: 1px dashed #4e5058; color: #949ba4; font-size: 13px; text-align: center; }

@media (max-width: 1000px) {
  .ms-switch { display: flex; gap: 4px; margin-bottom: 12px; padding: 4px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
  .ms-switch button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; border: 0; border-radius: 9px; background: none; color: var(--text-2); font-weight: 600; font-size: 14px; }
  .ms-switch button[aria-selected="true"] { background: rgba(240,138,60,.14); color: var(--ember-2); }
  .ms-layout { grid-template-columns: 1fr; }
  .ms-layout[data-view-now="edit"] .ms-preview, .ms-layout[data-view-now="preview"] .ms-edit { display: none; }
  .ms-preview { position: static; }
  .ms-preview-inner { max-height: none; }
}
@media (max-width: 700px) {
  .ms-wrap { width: calc(100% - 32px); padding-top: 20px; }
  .ms-top-controls { width: 100%; }
  .ms-top-controls .ms-f { width: 100%; }
  .ms-mode { width: 100%; }
  .ms-mode-opt { flex: 1; }
  .ms-mode-opt span { justify-content: center; }
  .ms-top-controls .btn { flex: 1 1 auto; justify-content: center; }
  .ms-section { padding: 12px; }
  .ms-card-body { padding: 4px 8px 10px; }
  .ms-children, .ms-options { padding-left: 6px; }
  .ms-tools .icon-btn { width: 30px; height: 30px; }
  .dx-message { padding: 12px 10px; gap: 10px; }
  .dx-avatar { width: 32px; height: 32px; }
  .dx-section-thumb { width: 64px; height: 64px; }
}

/* Bot profile (Message Studio) */
.bp-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.bp-side { position: sticky; top: calc(var(--nav-h) + 24px); display: grid; gap: 10px; }
.bp-forms { display: grid; gap: 14px; min-width: 0; }
.bp-card { overflow: hidden; border-radius: 12px; background: #232428; color: #dbdee1; font-family: 'gg sans', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; box-shadow: var(--shadow); }
.bp-banner { height: 120px; background: linear-gradient(135deg, #c25e1b, #f08a3c); }
.bp-banner img { width: 100%; height: 100%; object-fit: cover; }
.bp-avatar { position: relative; width: 92px; height: 92px; margin: -46px 0 0 16px; border-radius: 50%; border: 6px solid #232428; background: #232428; }
.bp-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.bp-dot { position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%; border: 5px solid #232428; background: #80848e; }
.bp-online { background: #23a55a; } .bp-idle { background: #f0b232; } .bp-dnd { background: #f23f43; } .bp-invisible { background: #80848e; }
.bp-body { display: grid; gap: 12px; padding: 10px 16px 18px; }
.bp-name { display: flex; align-items: center; gap: 6px; }
.bp-name b { font-size: 20px; color: #f2f3f5; overflow-wrap: anywhere; }
.bp-activity { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #dbdee1; overflow-wrap: anywhere; }
.bp-activity .i { flex-shrink: 0; color: #b5bac1; }
.bp-about { padding: 10px 12px; border-radius: 8px; background: #111214; }
.bp-about small { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 700; color: #f2f3f5; }
.bp-about p { margin: 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bp-inline { display: flex; align-items: flex-end; gap: 8px; }
.bp-inline .ms-f { flex: 1; min-width: 0; }
.bp-images { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 14px; }
.bp-image { display: grid; gap: 8px; }
.bp-image-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bp-image-row label { cursor: pointer; }
.bp-thumb { flex-shrink: 0; object-fit: cover; background: #1e1f22; }
.bp-thumb-round { width: 56px; height: 56px; border-radius: 50%; }
.bp-thumb-wide { width: 120px; height: 42px; border-radius: 8px; }
.bp-thumb-empty { display: block; background: linear-gradient(135deg, #c25e1b, #f08a3c); }
.bp-forms [hidden] { display: none !important; }
@media (max-width: 900px) {
  .bp-layout { grid-template-columns: 1fr; }
  .bp-side { position: static; }
  .bp-card { max-width: 400px; }
}
@media (max-width: 500px) {
  .bp-inline { flex-wrap: wrap; }
  .bp-inline .btn { width: 100%; justify-content: center; }
}

/* ==========================================================================
   Factions: "The Network". Its own dark-code look: near-black, red and grey,
   terminal type. Everything here is scoped to body.factions-mode or .fx.
   ========================================================================== */
body.factions-mode {
  --bg: #050505; --bg-2: #0a0a0b; --bg-3: #111113;
  --surface: rgba(255,255,255,.03); --surface-2: rgba(255,255,255,.06); --surface-solid: #0c0c0e;
  --border: rgba(255,255,255,.08); --border-strong: rgba(255,255,255,.16);
  --text: #e6e6e8; --text-2: #b4b6bc; --muted: #7b7f87;
  --ember: #ff2b2b; --ember-2: #ff5d5d; --ember-deep: #a3101a; --oak: #5a0a10;
  --fx-red: #ff2b2b; --fx-red-dim: rgba(255,43,43,.14); --fx-line: #1d1d21; --fx-panel: #0b0b0d;
  background: #050505;
}
body.factions-mode .nav-wrap, body.factions-mode .footer, body.factions-mode .announce { display: none !important; }
body.factions-mode .btn-primary { background: var(--fx-red); color: #0a0000; box-shadow: 0 0 0 1px rgba(255,43,43,.6), 0 8px 24px -10px rgba(255,43,43,.8); border-radius: 4px; }
body.factions-mode .btn-primary:hover { background: #ff4545; box-shadow: 0 0 0 1px #ff6b6b, 0 10px 30px -8px rgba(255,43,43,.9); }
body.factions-mode .btn, body.factions-mode .input, body.factions-mode .select, body.factions-mode .textarea, body.factions-mode .dd-trigger { border-radius: 4px; }
body.factions-mode .btn-ghost { border-color: #2a2a2f; }
body.factions-mode .input, body.factions-mode .select, body.factions-mode .textarea, body.factions-mode .dd-trigger { background: #08080a; border-color: #26262b; font-family: var(--font-mono); font-size: 14px; }
body.factions-mode .avatar { background: #1a1a1d; color: var(--fx-red); border-radius: 4px; }
body.factions-mode .dd-menu { border-radius: 6px; background: #0c0c0e; }

.fx { position: relative; min-height: 100vh; display: flex; flex-direction: column; color: var(--text); background:
  radial-gradient(900px 500px at 85% -10%, rgba(255,43,43,.10), transparent 60%),
  radial-gradient(700px 400px at -10% 30%, rgba(255,255,255,.035), transparent 60%),
  linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px) 0 0 / 100% 32px, #050505; }
.fx-scan { position: fixed; inset: 0; z-index: 2; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 3px); mix-blend-mode: overlay; animation: fx-flicker 7s infinite; }
@keyframes fx-flicker { 0%, 96%, 100% { opacity: 1; } 97% { opacity: .6; } 98% { opacity: .9; } }
.fx-bar { position: sticky; top: var(--maint-banner-h, 0px); z-index: var(--z-nav); display: flex; align-items: center; gap: 18px; min-height: 58px; padding: 0 20px; background: rgba(5,5,5,.92); border-bottom: 1px solid var(--fx-line); box-shadow: 0 1px 0 rgba(255,43,43,.25); backdrop-filter: blur(8px); font-family: var(--font-mono); }
.fx-brand { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; letter-spacing: .14em; white-space: nowrap; }
.fx-brand b { color: var(--text); font-weight: 700; margin-left: 2px; }
.fx-brand-mark { color: var(--fx-red); animation: fx-blink 1.1s steps(1) infinite; }
.fx-nav { display: flex; align-items: center; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.fx-nav a, .fx-nav-soon { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; font-size: 12px; letter-spacing: .14em; color: var(--muted); white-space: nowrap; }
.fx-nav a:hover { color: var(--text); }
.fx-nav a.is-current { color: var(--text); }
.fx-nav a.is-current::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 2px; background: var(--fx-red); box-shadow: 0 0 10px var(--fx-red); }
.fx-nav-soon { opacity: .45; cursor: default; }
.fx-nav-soon small { font-size: 9px; padding: 1px 4px; border: 1px solid #333; color: var(--muted); }
.fx-exit { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 1px solid #26262b; border-radius: 4px; color: var(--muted); font-size: 11px; letter-spacing: .14em; white-space: nowrap; }
.fx-exit:hover { color: var(--fx-red); border-color: var(--fx-red); }
.fx-preview { position: relative; z-index: 1; padding: 8px 20px; font: 600 11px/1.5 var(--font-mono); letter-spacing: .08em; color: #ffd9d9; background: repeating-linear-gradient(-45deg, rgba(255,43,43,.18) 0 12px, rgba(255,43,43,.08) 12px 24px); border-bottom: 1px solid rgba(255,43,43,.4); }
.fx-page { position: relative; z-index: 1; flex: 1; width: min(1200px, 100% - 32px); margin: 0 auto; padding: 34px 0 70px; display: grid; gap: 22px; align-content: start; }
.fx-foot { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--fx-line); font: 11px var(--font-mono); letter-spacing: .14em; color: #4d5057; }

.fx-prompt { margin: 0; font: 500 13px/1.6 var(--font-mono); color: var(--muted); letter-spacing: .04em; overflow-wrap: anywhere; }
.fx-cursor { display: inline-block; width: 9px; height: 1.1em; margin-left: 2px; vertical-align: -3px; background: var(--fx-red); animation: fx-blink 1s steps(1) infinite; }
@keyframes fx-blink { 50% { opacity: 0; } }
.fx-hero { display: grid; gap: 12px; padding: 18px 0 6px; }
.fx-hero-sm { padding-top: 6px; }
.fx-glitch { position: relative; margin: 0; font: 800 clamp(34px, 7vw, 76px)/1 var(--font-mono); letter-spacing: -.02em; text-transform: uppercase; color: var(--text); text-shadow: 0 0 22px rgba(255,43,43,.25); overflow-wrap: anywhere; }
.fx-glitch::before, .fx-glitch::after { content: attr(data-text); position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.fx-glitch::before { color: var(--fx-red); transform: translate(2px, -1px); }
.fx-glitch::after { color: #9aa0a8; transform: translate(-2px, 1px); }
.fx-glitch:hover::before { opacity: .8; animation: fx-glitch-a .35s steps(2) 2; }
.fx-glitch:hover::after { opacity: .6; animation: fx-glitch-b .35s steps(2) 2; }
@keyframes fx-glitch-a { 0% { clip-path: inset(10% 0 60% 0); } 50% { clip-path: inset(55% 0 15% 0); } 100% { clip-path: inset(30% 0 40% 0); } }
@keyframes fx-glitch-b { 0% { clip-path: inset(60% 0 10% 0); } 50% { clip-path: inset(15% 0 55% 0); } 100% { clip-path: inset(40% 0 30% 0); } }
.fx-lead { margin: 0; max-width: 70ch; color: var(--text-2); font-size: 16px; }
.fx-lead a, .fx-warn a, .fx-page .prose a { color: var(--fx-red); }
.fx-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.fx-stats div { padding: 14px; border: 1px solid var(--fx-line); background: var(--fx-panel); }
.fx-stats b { display: block; font: 700 30px/1 var(--font-mono); color: var(--fx-red); }
.fx-stats small { font: 11px var(--font-mono); letter-spacing: .14em; color: var(--muted); }

.fx-wire { display: flex; align-items: stretch; overflow: hidden; border: 1px solid rgba(255,43,43,.35); background: rgba(255,43,43,.05); font: 12px var(--font-mono); }
.fx-wire-label { flex-shrink: 0; display: grid; place-items: center; padding: 0 12px; background: var(--fx-red); color: #0a0000; font-weight: 700; letter-spacing: .14em; }
.fx-wire-track { flex: 1; overflow: hidden; }
.fx-wire ul { display: flex; gap: 40px; width: max-content; margin: 0; padding: 9px 0 9px 100%; list-style: none; animation: fx-ticker 60s linear infinite; }
.fx-wire:hover ul { animation-play-state: paused; }
@keyframes fx-ticker { to { transform: translateX(-100%); } }
.fx-wire li, .fx-log li { display: flex; gap: 10px; white-space: nowrap; color: var(--text-2); }
.fx-wire time, .fx-log time { color: var(--fx-red); }
.fx-log { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font: 13px var(--font-mono); }
.fx-log li { white-space: normal; }

.fx-panel { position: relative; display: grid; gap: 12px; padding: 18px; border: 1px solid var(--fx-line); background: var(--fx-panel); }
.fx-panel::before, .fx-panel::after { content: ""; position: absolute; width: 12px; height: 12px; border-color: var(--fx-red); border-style: solid; pointer-events: none; }
.fx-panel::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.fx-panel::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
.fx-muted { margin: 0; color: var(--muted); font-size: 14px; }
.fx-warn { margin: 0; display: flex; align-items: center; gap: 8px; color: #ffb3b3; font-size: 14px; }
.fx-empty { grid-column: 1 / -1; margin: 0; padding: 30px; text-align: center; border: 1px dashed #26262b; font: 13px var(--font-mono); color: var(--muted); letter-spacing: .08em; }
.fx-status { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.fx-status li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px; border: 1px solid var(--fx-line); background: #08080a; }
.fx-status li.is-alert { border-color: rgba(255,43,43,.5); background: rgba(255,43,43,.06); }
.fx-status li > span:not(.fx-logo):not(.fx-row-actions) { flex: 1; min-width: 160px; }
.fx-status b { display: block; font: 600 14px var(--font-mono); }
.fx-status small { color: var(--muted); font-size: 12px; }
.fx-row-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.fx-section { display: grid; gap: 14px; }
.fx-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.fx-section h2, .fx-archive h2 { margin: 0; font: 700 16px var(--font-mono); letter-spacing: .14em; color: var(--text); }
.fx-section h2 small, .fx-archive h2 small { color: var(--muted); font-size: 11px; margin-left: 8px; }
.fx-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.fx-filters .dd, .fx-filters .select { min-width: 160px; }
.fx-search { position: relative; display: block; min-width: 220px; }
.fx-search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.fx-search .input { padding-left: 36px; }
.fx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.fx-card { --fc: var(--fx-red); position: relative; display: grid; gap: 12px; padding: 14px 14px 14px 18px; border: 1px solid var(--fx-line); background: linear-gradient(90deg, color-mix(in srgb, var(--fc) 10%, transparent), transparent 40%), var(--fx-panel); color: inherit; transition: border-color .15s, transform .15s, box-shadow .15s; }
.fx-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--fc); box-shadow: 0 0 12px var(--fc); }
.fx-card:hover { border-color: rgba(255,43,43,.5); transform: translateY(-2px); box-shadow: 0 10px 30px -18px rgba(255,43,43,.6); }
.fx-card-top, .fx-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font: 11px var(--font-mono); letter-spacing: .1em; color: var(--muted); }
.fx-card-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fx-card-main b { display: block; font: 700 17px var(--font-mono); color: var(--text); overflow-wrap: anywhere; }
.fx-card-main small { color: var(--muted); font-size: 12px; }
.fx-card-motto { color: var(--text-2); font-style: italic; font-size: 14px; }
.fx-tier { color: var(--fx-red); }
.fx-live { color: var(--fx-red); font: 600 11px var(--font-mono); letter-spacing: .1em; }
.fx-live::before { content: "\25CF  "; animation: fx-blink 1.4s steps(1) infinite; }
.fx-logo { --fc: var(--fx-red); flex-shrink: 0; display: grid; place-items: center; width: 52px; height: 52px; overflow: hidden; border: 1px solid var(--fc); background: color-mix(in srgb, var(--fc) 12%, #050505); box-shadow: 0 0 14px -4px var(--fc); }
.fx-logo img { width: 100%; height: 100%; object-fit: cover; }
.fx-logo b { font: 800 15px var(--font-mono); color: var(--fc); letter-spacing: .04em; }
.fx-logo-sm { width: 36px; height: 36px; } .fx-logo-sm b { font-size: 11px; }
.fx-logo-md { width: 64px; height: 64px; }
.fx-logo-lg { width: 96px; height: 96px; } .fx-logo-lg b { font-size: 26px; }
.fx-stamp { flex-shrink: 0; padding: 3px 8px; border: 2px solid currentColor; font: 800 11px var(--font-mono); letter-spacing: .16em; transform: rotate(-3deg); color: #cfd1d6; }
.fx-stamp-pending { color: #ffb347; border-style: dashed; }
.fx-stamp-frozen { color: #8fb4ff; }
.fx-stamp-dissolved, .fx-stamp-denied { color: var(--fx-red); }
.fx-archive summary { cursor: pointer; list-style: none; margin-bottom: 12px; }
.fx-archive summary::-webkit-details-marker { display: none; }
.fx-archive .fx-card { filter: grayscale(.8); opacity: .75; }

.fx-form { display: grid; gap: 16px; }
.fx-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fx-form-grid .full { grid-column: 1 / -1; }
.fx-form .field > span, .fx-page .field > span, .fx-page .field-label { font: 600 11px var(--font-mono); letter-spacing: .12em; color: var(--muted); }
.fx-form .field small, .fx-page .field small { font-family: var(--font-body); letter-spacing: 0; text-transform: none; }
.fx-color { padding: 4px; height: 44px; cursor: pointer; }
.fx-form-actions { display: flex; justify-content: flex-end; }
.fx-draft { display: inline-block; justify-self: start; padding: 6px 10px; border: 2px solid var(--fx-red); color: var(--fx-red); font: 800 12px var(--font-mono); letter-spacing: .14em; transform: rotate(-1deg); }

.fx-protocols { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start; }
.fx-toc { position: sticky; top: 80px; display: grid; gap: 2px; padding: 10px; border: 1px solid var(--fx-line); background: var(--fx-panel); font: 12px var(--font-mono); letter-spacing: .1em; }
.fx-toc a { display: flex; gap: 10px; padding: 8px; color: var(--text-2); }
.fx-toc a:hover { color: var(--text); background: var(--fx-red-dim); }
.fx-toc span { color: var(--fx-red); }
.fx-rules { display: grid; gap: 22px; min-width: 0; }
.fx-rule-section { scroll-margin-top: 80px; padding: 18px; border: 1px solid var(--fx-line); background: var(--fx-panel); }
.fx-rule-section h2 { display: flex; gap: 12px; margin: 0 0 12px; font: 700 18px var(--font-mono); letter-spacing: .12em; }
.fx-rule-section h2 span { color: var(--fx-red); }
.fx-rule-section ol { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.fx-rule-section li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; scroll-margin-top: 90px; padding-top: 10px; border-top: 1px dashed #1f1f23; color: var(--text-2); font-size: 15px; line-height: 1.55; }
.fx-rule-section li:first-child { border-top: 0; padding-top: 0; }
.fx-rule-section li b { font: 700 13px/1.9 var(--font-mono); color: var(--fx-red); }
.fx-table-wrap { overflow-x: auto; }
.fx-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fx-table th { padding: 8px 10px; text-align: left; font: 600 11px var(--font-mono); letter-spacing: .12em; color: var(--muted); border-bottom: 1px solid #26262b; white-space: nowrap; }
.fx-table td { padding: 10px; border-bottom: 1px dashed #1f1f23; color: var(--text-2); vertical-align: top; }
.fx-table td b { font-family: var(--font-mono); color: var(--text); white-space: nowrap; }

.fx-dossier { --fc: var(--fx-red); display: grid; gap: 16px; }
.fx-dossier-head { position: relative; display: grid; gap: 14px; padding: 0 0 18px; border: 1px solid var(--fx-line); background: var(--fx-panel); }
.fx-dossier-banner { height: 140px; overflow: hidden; background: linear-gradient(135deg, color-mix(in srgb, var(--fc) 35%, #050505), #050505 70%), repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0 2px, transparent 2px 10px); border-bottom: 1px solid var(--fc); }
.fx-dossier-banner img { width: 100%; height: 100%; object-fit: cover; opacity: .8; }
.fx-dossier-id { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-top: -60px; padding: 0 18px; }
.fx-dossier-title { flex: 1; min-width: 220px; display: grid; gap: 4px; }
.fx-dossier-title h1 { margin: 0; font: 800 clamp(26px, 4vw, 40px)/1.1 var(--font-mono); overflow-wrap: anywhere; }
.fx-tag { color: var(--fc); }
.fx-motto { margin: 0; color: var(--text-2); font-style: italic; }
.fx-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; margin: 0 18px; background: var(--fx-line); border: 1px solid var(--fx-line); }
.fx-facts div { padding: 10px 12px; background: #08080a; }
.fx-facts dt { font: 10px var(--font-mono); letter-spacing: .16em; color: var(--muted); }
.fx-facts dd { margin: 4px 0 0; font: 600 14px var(--font-mono); color: var(--text); overflow-wrap: anywhere; }
.fx-alert { display: flex; align-items: center; gap: 8px; margin: 0 18px; padding: 10px 12px; border: 1px solid rgba(255,43,43,.5); background: rgba(255,43,43,.08); color: #ffcaca; font: 12px/1.5 var(--font-mono); letter-spacing: .04em; }
.fx-alert-info { border-color: #2c2c33; background: #0e0e11; color: var(--text-2); }
.fx-tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--fx-line); scrollbar-width: none; }
.fx-tabs button { flex-shrink: 0; min-height: 42px; padding: 0 16px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: 600 12px var(--font-mono); letter-spacing: .14em; }
.fx-tabs button:hover { color: var(--text); }
.fx-tabs button.is-current { color: var(--text); border-bottom-color: var(--fx-red); }
.fx-dossier [data-tab-body] { display: grid; gap: 14px; }
.fx-prose { color: var(--text-2); font-size: 15px; max-width: none; }
.fx-prose h2, .fx-prose h3 { font-family: var(--font-mono); }
.fx-redacted-row { display: flex; flex-wrap: wrap; gap: 10px; }
.fx-redact { padding: 2px 6px; background: #1c1c20; color: #1c1c20; font: 14px var(--font-mono); cursor: help; user-select: none; }
.fx-redact:hover { color: var(--fx-red); background: #120808; }
.fx-rank { margin: 6px 0 0; font: 700 12px var(--font-mono); letter-spacing: .14em; color: var(--fx-red); }
.fx-rank small { color: var(--muted); }
.fx-roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.fx-roster li { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--fx-line); background: #08080a; min-width: 0; }
.fx-roster li > span { flex: 1; min-width: 0; }
.fx-roster b { display: block; font: 600 14px var(--font-mono); overflow-wrap: anywhere; }
.fx-roster small { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.fx-roster .avatar { width: 34px; height: 34px; font-size: 12px; }
.fx-roster .select, .fx-roster .dd { width: auto; min-width: 120px; }
.fx-request { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--fx-line); background: #08080a; }
.fx-request-head { display: flex; align-items: center; gap: 10px; }
.fx-request-head b { display: block; font-family: var(--font-mono); }
.fx-request-head small { color: var(--muted); font-size: 12px; }
.fx-request .ap-answers dt { font-family: var(--font-mono); letter-spacing: .06em; }
.fx-inline { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.fx-inline .field { flex: 1; min-width: 200px; }
.fx-images { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 14px; }
.fx-image-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.fx-image-row label { cursor: pointer; }
.fx-banner-thumb { display: block; width: 140px; height: 48px; overflow: hidden; border: 1px solid var(--fx-line); background: linear-gradient(135deg, #2a0a0d, #050505); }
.fx-banner-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fx-ranks, .fx-questions { display: grid; gap: 8px; }
.fx-rank-row { display: grid; grid-template-columns: 180px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--fx-line); background: #08080a; }
.fx-perms { display: flex; flex-wrap: wrap; gap: 0 14px; }
.fx-perms .check { min-height: 34px; font-size: 13px; }
.fx-q { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.fx-q textarea { grid-column: 2; min-height: 60px; }
.fx-q textarea[hidden] { display: none; }
.fx-switch { background: #08080a; border-color: var(--fx-line); }

.fx-boot { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; align-content: center; gap: 18px; padding: 24px; background: #030303; cursor: pointer; transition: opacity .35s; }
.fx-boot pre { width: min(560px, 100%); margin: 0; font: 500 clamp(12px, 2.6vw, 15px)/1.8 var(--font-mono); color: #cfd1d6; white-space: pre-wrap; text-shadow: 0 0 8px rgba(255,43,43,.4); }
.fx-boot small { font: 11px var(--font-mono); letter-spacing: .2em; color: #4d5057; }
.fx-boot.is-done { opacity: 0; }
.fx-offline { display: grid; place-items: center; padding: 24px; }
.fx-offline-box { position: relative; z-index: 1; display: grid; gap: 14px; justify-items: start; max-width: 640px; }
.fx-offline-box p:not(.fx-prompt) { margin: 0; color: var(--text-2); }

/* Faction Command, in the normal Staff Panel look */
.fc-open { margin-bottom: 16px; }
.fc-list { display: grid; gap: 10px; }
.fc-item { display: grid; gap: 12px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.fc-item-head { display: flex; align-items: center; gap: 12px; }
.fc-item-head > div { flex: 1; min-width: 0; }
.fc-item-head a { color: inherit; }
.fc-item-head a:hover b { color: var(--ember-2); }
.fc-item-head small { display: block; color: var(--muted); font-size: 13px; }
.fc-swatch { flex-shrink: 0; width: 14px; height: 40px; border-radius: 4px; }
.fc-actions { display: grid; gap: 10px; }
.fc-row { display: flex; gap: 10px; flex-wrap: wrap; }
.fc-row .field { width: 200px; }
.fc-row .fc-grow { flex: 1; min-width: 200px; }
.fc-note { margin: 0; font-size: 13px; }
.fc-audit { margin-top: 18px; }
.fc-audit summary { cursor: pointer; margin-bottom: 10px; }

/* Wide things, like the tier table, scroll inside their own box instead of widening the page. */
.fx-page > *, .fx-rules > *, .fx-dossier > * { min-width: 0; }
@media (max-width: 860px) {
  .fx-protocols { grid-template-columns: minmax(0, 1fr); }
  .fx-toc { position: static; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .fx-facts { grid-template-columns: 1fr 1fr; } .fx-facts div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .fx-stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .fx-bar { gap: 8px; padding: 0 12px; }
  .fx-brand { font-size: 11px; }
  .fx-brand b { display: none; }
  .fx-exit span { display: none; }
  .fx-page { padding-top: 22px; }
  .fx-form-grid { grid-template-columns: 1fr; }
  .fx-rank-row { grid-template-columns: 1fr auto; }
  .fx-rank-row .fx-perms { grid-column: 1 / -1; grid-row: 2; }
  .fx-q { grid-template-columns: 1fr auto; }
  .fx-q .input { grid-column: 1 / -1; grid-row: 2; }
  .fx-q textarea { grid-column: 1 / -1; }
  .fx-dossier-id { margin-top: -44px; }
  .fx-logo-lg { width: 76px; height: 76px; }
  .fx-filters, .fx-search { width: 100%; }
  .fx-filters .dd, .fx-filters .select { flex: 1; min-width: 0; }
  .fx-rule-section li { grid-template-columns: 44px minmax(0, 1fr); font-size: 14px; }
  .fx-foot { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .fx-scan, .fx-brand-mark, .fx-cursor, .fx-live::before { animation: none; }
  .fx-wire ul { animation: none; padding-left: 12px; }
  .fx-wire-track { overflow-x: auto; }
  .fx-glitch:hover::before, .fx-glitch:hover::after { animation: none; opacity: 0; }
}

/* Factions: the territory map */
.fx-territory { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.fx-map-wrap { display: grid; gap: 8px; min-width: 0; }
.fx-map-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fx-map-zoom { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border: 1px solid var(--fx-line); background: var(--fx-panel); }
.fx-map-zoom .icon-btn { width: 34px; height: 34px; border-radius: 3px; }
.fx-map-toggle { min-height: 34px; font: 600 11px var(--font-mono); letter-spacing: .12em; color: var(--muted); }
.fx-map-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.fx-map-view { position: relative; max-height: min(78vh, 900px); overflow: auto; border: 1px solid var(--fx-line); background: #030303; scrollbar-width: thin; touch-action: pan-x pan-y; }
.fx-map-inner { min-width: 100%; }
.fx-map { display: block; width: 100%; height: auto; }
.fx-map-img { filter: grayscale(1) brightness(.32) contrast(1.25); }
.fx-hexes polygon { stroke: rgba(255,255,255,.07); stroke-width: .8; cursor: pointer; transition: fill-opacity .15s; }
.fx-hexes polygon:hover { stroke: var(--fx-red); stroke-width: 1.6; }
.fx-hexes polygon.is-held { fill-opacity: .5; stroke: var(--hc); stroke-width: 1.2; }
.fx-hexes polygon.is-held:hover { fill-opacity: .7; }
.fx-hexes polygon.is-focus { fill-opacity: .75; stroke: #fff; stroke-width: 1.6; }
.fx-hexes polygon.is-draft { stroke: #fff; stroke-width: 1.6; stroke-dasharray: 3 2; }
.fx-hexes polygon.is-neutral { stroke: rgba(200,205,215,.35); }
.fx-districts path { fill: none; stroke: rgba(255,255,255,.4); stroke-width: 2.5; stroke-dasharray: 10 6; }
.fx-district-labels text { font: 700 19px var(--font-mono); letter-spacing: .12em; text-anchor: middle; fill: rgba(255,255,255,.5); paint-order: stroke; stroke: rgba(0,0,0,.85); stroke-width: 4px; pointer-events: none; }
.fx-map-status { min-height: 22px; font: 12px var(--font-mono); letter-spacing: .06em; color: var(--text-2); }
.fx-map-status b { color: var(--text); margin-right: 8px; }
.fx-status-bad { color: #ff8a8a; }
.fx-status-ok { color: #9fe0b8; }
.fx-map-side { display: grid; gap: 12px; position: sticky; top: 80px; }
.fx-info { display: grid; gap: 8px; margin: 0; }
.fx-info dt { font: 10px var(--font-mono); letter-spacing: .16em; color: var(--muted); }
.fx-info dd { margin: 2px 0 0; font: 600 14px var(--font-mono); color: var(--text); }
.fx-info a { color: var(--fx-red); }
.fx-meter { height: 6px; background: #1a1a1d; }
.fx-meter i { display: block; height: 100%; background: var(--fx-red); box-shadow: 0 0 10px var(--fx-red); }
.fx-legend { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.fx-legend a { display: grid; grid-template-columns: 14px minmax(0, 1fr); column-gap: 10px; padding: 6px; color: inherit; }
.fx-legend a:hover { background: var(--fx-red-dim); }
.fx-legend b { font: 600 13px var(--font-mono); overflow-wrap: anywhere; }
.fx-legend small { grid-column: 2; color: var(--muted); font: 11px var(--font-mono); }
.fx-swatch { grid-row: span 2; width: 14px; height: 14px; margin-top: 2px; }
@media (max-width: 960px) {
  .fx-territory { grid-template-columns: minmax(0, 1fr); }
  .fx-map-side { position: static; }
  .fx-map-view { max-height: 70vh; }
}
@media (max-width: 640px) {
  .fx-map-actions { margin-left: 0; width: 100%; }
  .fx-map-actions .btn { flex: 1; justify-content: center; }
}

/* ---------- Factions phase 3: activity and enforcement ---------- */
.fx-track { margin: 0; padding: 8px 10px; border: 1px dashed #3a3a40; color: var(--text-2); font: 12px/1.5 var(--font-mono); letter-spacing: .03em; }
.fx-track.is-ok { border-color: rgba(76,195,138,.45); color: #9fe3bf; }
.fx-activity { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.fx-activity li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(80px, 2fr) 72px; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid #1f1f24; background: #0b0b0d; }
.fx-activity li > span:first-child { min-width: 0; }
.fx-activity b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-activity small { color: var(--muted); font: 11px var(--font-mono); letter-spacing: .08em; }
.fx-activity li.is-active small { color: #9fe3bf; }
.fx-activity li:not(.is-active) .fx-meter i { background: #6b6b74; box-shadow: none; }
.fx-activity code { text-align: right; font: 12px var(--font-mono); color: var(--text-2); }
.fx-strike-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fx-strike-sum div { padding: 10px; border: 1px solid #26262c; background: #0b0b0d; }
.fx-strike-sum b { display: block; font: 700 18px var(--font-mono); color: var(--fx-red); }
.fx-strike-sum small { color: var(--muted); font: 10px var(--font-mono); letter-spacing: .1em; }
.fx-strikes { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.fx-strike { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid rgba(255,43,43,.45); background: rgba(255,43,43,.05); }
.fx-strike:not(.fx-strike-active) { border-color: #26262c; background: #0b0b0d; opacity: .8; }
.fx-strike p { margin: 0; }
.fx-strike-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.fx-strike-head b { font-family: var(--font-mono); letter-spacing: .08em; }
.fx-strike-head small { color: var(--muted); font: 11px var(--font-mono); }
.fx-appeal { padding: 8px 10px; border-left: 2px solid var(--fx-red); background: #0e0e11; font-size: 14px; }
.fx-appeal small { color: var(--muted); }
.fx-appeal-form { display: grid; gap: 8px; }
.fx-appeal-form summary { width: max-content; list-style: none; }
.fx-appeal-form summary::-webkit-details-marker { display: none; }
.fx-appeal-form[open] .btn-primary { width: max-content; }
.fx-violations summary { cursor: pointer; margin-bottom: 8px; font: 12px var(--font-mono); letter-spacing: .08em; color: var(--text-2); }
.fc-track { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 14px; padding: 10px 12px; border-radius: var(--radius); font-size: 14px; }
.fc-track-ok { border: 1px solid rgba(76,195,138,.4); background: rgba(76,195,138,.08); }
.fc-track-bad { border: 1px solid rgba(224,100,43,.45); background: rgba(224,100,43,.08); }
.fc-enforce { display: grid; gap: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.fc-enforce-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; font-size: 13px; color: var(--muted); }
.fc-enforce-stats b { color: var(--text); }
.fc-enforce-stats .fc-bad b { color: #ff8a8a; }
.fc-decision { display: grid; gap: 8px; padding: 10px 12px; border-radius: var(--radius); border: 1px solid rgba(224,160,48,.45); background: rgba(224,160,48,.06); }
.fc-decision p { margin: 0; }
.fc-violation { display: grid; gap: 10px; }
.fc-violation summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.fc-violation[open] summary { margin-bottom: 10px; }
.fc-violation > .btn { width: max-content; }
@media (max-width: 640px) {
  .fx-activity li { grid-template-columns: minmax(0, 1fr) 64px; }
  .fx-activity .fx-meter { grid-column: 1 / -1; grid-row: 2; }
  .fx-strike-sum b { font-size: 15px; }
}
.fx-facts dd.fx-status-bad { color: #ff8a8a; }

/* ---------- Factions phase 4: wars and pacts ---------- */
.fx-war-list { display: grid; gap: 8px; }
.fx-war-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid #26262c; background: #0b0b0d; color: inherit; font-family: var(--font-mono); text-decoration: none; }
.fx-war-line:hover { border-color: var(--fx-red); background: var(--fx-red-dim); }
.fx-war-active { border-color: rgba(255,43,43,.6); box-shadow: inset 3px 0 0 var(--fx-red); }
.fx-war-no { font-size: 12px; color: var(--fx-red); letter-spacing: .1em; }
.fx-war-sides { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.fx-war-sides b { overflow-wrap: anywhere; }
.fx-war-sides i { font-style: normal; font-size: 11px; color: var(--muted); }
.fx-war-score { font: 700 18px var(--font-mono); }
.fx-war-state { font-size: 11px; letter-spacing: .1em; color: var(--text-2); text-align: right; }
.fx-war-banner { display: inline-block; margin: 6px 0 0; padding: 4px 10px; border: 1px solid #3a3a40; font: 700 13px var(--font-mono); letter-spacing: .12em; }
.fx-war-banner.fx-war-active { border-color: var(--fx-red); color: var(--fx-red); box-shadow: 0 0 14px -4px var(--fx-red); }
.fx-sides { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 14px; }
.fx-side { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px; border: 1px solid color-mix(in srgb, var(--fc) 50%, #222); background: color-mix(in srgb, var(--fc) 6%, #08080a); }
.fx-side.is-winner { box-shadow: 0 0 22px -6px var(--fc); }
.fx-side > div { display: grid; gap: 2px; min-width: 0; }
.fx-side a { color: inherit; }
.fx-side b { font: 700 16px var(--font-mono); overflow-wrap: anywhere; }
.fx-side small { color: var(--muted); font: 11px var(--font-mono); letter-spacing: .08em; }
.fx-side-score { font: 800 34px var(--font-mono); color: var(--fc); }
.fx-vs { font: 800 14px var(--font-mono); color: var(--fx-red); letter-spacing: .2em; }
.fx-war-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.fx-war-grid > div { display: grid; gap: 16px; min-width: 0; }
.fx-quote { margin: 0; padding-left: 12px; border-left: 2px solid var(--fx-red); white-space: pre-wrap; }
.fx-rule { width: 100%; margin: 4px 0; border: 0; border-top: 1px dashed #2c2c33; }
.fx-report { display: grid; gap: 6px; padding: 10px; border: 1px solid #26262c; background: #0b0b0d; }
.fx-report p { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.fx-report a { display: inline-flex; align-items: center; gap: 6px; width: max-content; color: var(--fx-red); font: 12px var(--font-mono); }
.fx-report-used, .fx-report-dismissed { opacity: .65; }
.fx-report .btn { width: max-content; }
.fx-log li .icon-btn { margin-left: auto; }
.fx-row-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.fx-pacts li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: center; column-gap: 10px; padding: 6px; }
.fx-pacts li > span:nth-child(2) { display: grid; min-width: 0; }
.fx-pacts .fx-swatch { grid-row: auto; margin: 0; }
.fx-pacts a { color: inherit; }
.fx-break { display: grid; gap: 6px; justify-items: end; }
.fx-break summary, .fx-declare summary { list-style: none; width: max-content; }
.fx-break summary::-webkit-details-marker, .fx-declare summary::-webkit-details-marker { display: none; }
.fx-break[open] { grid-column: 1 / -1; justify-items: stretch; margin-top: 6px; }
.fx-declare[open] summary { margin-bottom: 12px; }
.fx-fieldset { margin: 0; padding: 10px 12px; border: 1px solid #26262c; display: grid; gap: 6px; }
.fx-fieldset legend { padding: 0 6px; font: 11px var(--font-mono); letter-spacing: .12em; color: var(--text-2); }
.fx-fieldset legend small { color: var(--muted); }
.fx-hex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.fx-hex-pick small { color: var(--muted); font-size: 11px; }
.fx-pact-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.fx-pact-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 10px 12px; border: 1px solid #26262c; background: #0b0b0d; font-family: var(--font-mono); }
.fx-pact-list a { font-weight: 700; }
.fx-pact-list span { color: var(--muted); font-size: 11px; letter-spacing: .12em; }
.fx-pact-list small { margin-left: auto; color: var(--muted); font-size: 11px; }
.fc-desk { margin-bottom: 14px; display: grid; gap: 10px; }
.fc-desk-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fc-wars { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.fc-wars li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 14px; }
.fc-wars a { color: inherit; }
.fc-channel { align-items: flex-end; }
@media (max-width: 900px) {
  .fx-war-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .fx-war-line { grid-template-columns: minmax(0, 1fr) auto; }
  .fx-war-no, .fx-war-state { grid-column: 1 / -1; text-align: left; }
  .fx-sides { grid-template-columns: minmax(0, 1fr); }
  .fx-vs { text-align: center; }
  .fx-side-score { font-size: 26px; }
}

/* ---------- Factions phase 5: Codex, contracts, rankings ---------- */
.fx-stamp-canon { color: #f0c24b; border-color: #f0c24b; }
.fx-stamp-open { color: #9fe0b8; }
.fx-entry { display: grid; gap: 10px; padding: 14px; border: 1px solid #26262c; background: #0b0b0d; }
.fx-entry + .fx-entry { margin-top: 10px; }
.fx-entry.is-canon { border-color: rgba(240,194,75,.55); box-shadow: inset 3px 0 0 #f0c24b; }
.fx-entry header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.fx-entry h3 { margin: 0; font: 700 17px var(--font-mono); }
.fx-entry header small { flex-basis: 100%; color: var(--muted); font: 11px var(--font-mono); letter-spacing: .06em; }
.fx-entry.is-redacted .fx-redacted-row { display: grid; gap: 6px; }
.fx-entry.is-redacted .fx-redact { display: block; overflow: hidden; white-space: nowrap; }
.fx-edit { display: grid; gap: 10px; }
.fx-edit summary { list-style: none; width: max-content; }
.fx-edit summary::-webkit-details-marker { display: none; }
.fx-edit[open] { flex-basis: 100%; }
.fx-profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.fx-profiles li { display: flex; gap: 10px; padding: 10px; border: 1px solid #1f1f24; background: #0b0b0d; }
.fx-profiles li > div { display: grid; gap: 2px; min-width: 0; }
.fx-profiles b { font-family: var(--font-mono); overflow-wrap: anywhere; }
.fx-profiles small { color: var(--muted); font: 11px var(--font-mono); }
.fx-profiles p { margin: 4px 0 0; font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }
.fx-contracts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.fx-contract { display: grid; gap: 8px; align-content: start; padding: 14px; border: 1px solid #26262c; border-top: 2px solid var(--fc); background: #0b0b0d; }
.fx-contract header, .fx-contract footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.fx-contract h3 { margin: 0; font: 700 16px var(--font-mono); overflow-wrap: anywhere; }
.fx-contract p { margin: 0; }
.fx-contract-from { font: 11px var(--font-mono); letter-spacing: .08em; color: var(--muted); }
.fx-contract-from a { color: var(--text); }
.fx-contract-body { font-size: 14px; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.fx-contract-reward { display: grid; gap: 2px; padding: 8px 10px; border: 1px dashed #3a3a40; }
.fx-contract-reward small { font: 10px var(--font-mono); letter-spacing: .12em; color: var(--muted); }
.fx-contract-reward b { font-family: var(--font-mono); color: #9fe0b8; overflow-wrap: anywhere; }
.fx-contract footer small { color: var(--muted); font: 11px var(--font-mono); }
.fx-contract-completed, .fx-contract-cancelled, .fx-contract-expired, .fx-contract-removed { opacity: .7; }
.fx-boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.fx-board .fx-prompt small { color: var(--muted); }
.fx-rank-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.fx-rank-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid transparent; }
.fx-rank-list li.is-first { border-color: rgba(255,43,43,.45); background: var(--fx-red-dim); }
.fx-rank-list a { display: flex; align-items: center; gap: 8px; min-width: 0; color: inherit; }
.fx-rank-list a b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 13px var(--font-mono); }
.fx-rank-list .fx-swatch { flex-shrink: 0; margin: 0; }
.fx-rank-no { font: 700 13px var(--font-mono); color: var(--fx-red); }
.fx-rank-val { font: 12px var(--font-mono); color: var(--text-2); white-space: nowrap; }
.fx-canon-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.fx-canon { display: grid; gap: 6px; align-content: start; padding: 14px; border: 1px solid rgba(240,194,75,.4); background: #0b0b0d; color: inherit; text-decoration: none; }
.fx-canon:hover { border-color: #f0c24b; }
.fx-canon .fx-stamp { justify-self: start; }
.fx-canon b { font: 700 15px var(--font-mono); }
.fx-canon small { color: var(--muted); font: 11px var(--font-mono); }
.fx-canon span:last-child { font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .fx-contracts, .fx-boards, .fx-canon-list, .fx-profiles { grid-template-columns: minmax(0, 1fr); }
}
.fx-boards { align-items: start; } .fx-board { align-content: start; }

/* Faction Rules tab: the tier table, and the Protocols editor on the Network */
.rules-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.rules-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rules-table th, .rules-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.rules-table th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.rules-table tr:last-child td { border-bottom: 0; }
.rules-table td:first-child { white-space: nowrap; }
.fx-pr-editor { display: grid; gap: 16px; }
.fx-pr-editor [data-pr-sections] { display: grid; gap: 16px; }
.fx-pr-section { display: grid; gap: 10px; }
.fx-pr-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fx-pr-head .input { flex: 1; min-width: 200px; font-family: var(--font-mono); font-weight: 700; }
.fx-pr-rules { display: grid; gap: 8px; }
.fx-pr-rule { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.fx-pr-rule [data-pr-n] { font-family: var(--font-mono); }
.fx-pr-tools { display: flex; gap: 2px; }
@media (max-width: 640px) {
  .fx-pr-rule { grid-template-columns: 64px minmax(0, 1fr); }
  .fx-pr-tools { grid-column: 1 / -1; justify-content: flex-end; }
}

/* ---------- Vehicles & Equipment (Rules page) ---------- */
.fleet-tools { flex-direction: column; align-items: stretch; gap: 10px; }
.fleet-tools .chips small { opacity: .65; margin-left: 4px; }
.fleet-staff { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.fleet-section h2 { display: flex; align-items: center; gap: 8px; }
.fleet-group { margin: 14px 0 20px; }
.fleet-group h3 { font-size: 15px; margin: 0 0 8px; color: var(--text-2); }
.fleet-group h3 small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.fleet-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.fleet-item { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid #7ee0ae; border-radius: 10px; background: var(--surface); min-width: 0; }
.fleet-item.is-restricted { border-left-color: #f0b429; }
.fleet-item.is-banned { border-left-color: #ef5a4c; }
.fleet-item.is-banned .fleet-item-main b { text-decoration: line-through; text-decoration-color: rgba(239,90,76,.6); }
.fleet-item-main { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.fleet-item-main b { overflow-wrap: anywhere; }
.fleet-class { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fleet-item-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fleet-note { margin: 0; font-size: 13px; color: var(--text-2); }
.fleet-tag { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--tag) 55%, transparent); background: color-mix(in srgb, var(--tag) 14%, transparent); color: var(--tag); font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1.5; }
button.fleet-tag { cursor: pointer; }
.fleet-tag.is-off { opacity: .4; background: none; }
.fleet-tag-chip[aria-pressed="true"] { border-color: var(--tag); color: var(--tag); }
.fleet-edit-bar { position: sticky; top: 72px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; padding: 10px 14px; border: 1px solid rgba(240,138,60,.45); border-radius: 10px; background: var(--surface); }
.fleet-edit-bar span { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.fleet-edit-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fleet-edit-row .input { flex: 1 1 160px; min-width: 0; }
.fleet-edit-row .select { flex: 0 1 130px; }
.fleet-section-head, .fleet-group-head { margin-bottom: 10px; }
.fleet-edit-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.fleet-edit-note { font-size: 13px; }
.fleet-list:has(.fleet-edit-item) { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.fleet-tags-editor { margin-bottom: 16px; }
.fleet-tag-list { margin: 0 0 10px; padding: 0; list-style: none; display: grid; gap: 8px; }
.fleet-tag-list li { display: flex; gap: 8px; align-items: center; }
.fleet-tag-list .input { flex: 1; }
.fleet-color { flex: 0 0 52px !important; padding: 2px; height: 38px; }
@media (max-width: 560px) { .fleet-list, .fleet-list:has(.fleet-edit-item) { grid-template-columns: 1fr; } }
.fleet-tag-chip::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--tag); }
/* The editor: sections down the side, one group at a time on the right. */
.fleet-editor-body { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; align-items: start; }
.fleet-nav { position: sticky; top: 136px; max-height: calc(100vh - 160px); overflow-y: auto; display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.fleet-nav-search .input { width: 100%; }
.fleet-nav-list, .fleet-nav-list ul { margin: 0; padding: 0; list-style: none; }
.fleet-nav-cat { margin-top: 6px; }
.fleet-nav-cat ul { margin-left: 12px; padding-left: 8px; border-left: 1px solid var(--line); }
.fleet-nav-link { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 7px; background: none; color: var(--text-2); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.fleet-nav-link span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fleet-nav-link small { color: var(--muted); font-variant-numeric: tabular-nums; }
.fleet-nav-link:hover { background: rgba(255,255,255,.04); color: var(--text); }
.fleet-nav-link.is-cat { font-weight: 700; color: var(--text); }
.fleet-nav-link.is-current { background: rgba(240,138,60,.14); color: var(--ember-2); }
.fleet-pane { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.fleet-pane-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.fleet-pane-head h2 { margin: 0; font-size: 18px; flex: 1; }
.fleet-pane-title { flex: 1; min-width: 200px; display: grid; gap: 2px; }
.fleet-pane-title small, .fleet-crumb { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.fleet-crumb { justify-self: start; padding: 0; border: 0; background: none; cursor: pointer; font-family: inherit; }
.fleet-crumb:hover { color: var(--ember-2); }
.fleet-title-input { font-size: 20px !important; font-weight: 700; }
.fleet-muted { color: var(--muted); font-size: 12px; }
/* Fields that read as plain text until pointed at or typed in. */
.fleet-quiet { width: 100%; min-width: 0; padding: 5px 7px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text); font: inherit; font-size: 14px; }
select.fleet-quiet { cursor: pointer; appearance: auto; }
.fleet-quiet:hover { border-color: var(--line); }
.fleet-quiet:focus { outline: none; border-color: rgba(240,138,60,.6); background: rgba(0,0,0,.25); }
.fleet-quiet::placeholder { color: var(--muted); }
.fleet-table { display: grid; gap: 2px; margin-bottom: 12px; }
.fleet-row { display: grid; grid-template-columns: 22px minmax(190px, 2.6fr) 96px 112px minmax(110px, 1.2fr) minmax(100px, 1.3fr) 30px; gap: 6px; align-items: center; padding: 3px 6px; border-radius: 8px; border-left: 3px solid #7ee0ae; }
.fleet-row.is-restricted { border-left-color: #f0b429; }
.fleet-row.is-banned { border-left-color: #ef5a4c; }
.fleet-row:not(.fleet-row-head):hover { background: rgba(255,255,255,.03); }
.fleet-row.is-picked { background: rgba(240,138,60,.08); }
.fleet-row-head { border-left-color: transparent; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.fleet-row .icon-btn { opacity: .5; }
.fleet-row:hover .icon-btn { opacity: 1; }
.fleet-cell-name small { display: block; padding: 0 8px; color: var(--muted); font-size: 11px; }
.fleet-row.is-authorized .fleet-status { color: #7ee0ae; }
.fleet-row.is-restricted .fleet-status { color: #f0b429; }
.fleet-row.is-banned .fleet-status { color: #ff9d92; }
.fleet-tagpick { position: relative; }
.fleet-tagpick summary { display: flex; flex-wrap: wrap; gap: 4px; min-height: 30px; align-items: center; padding: 3px 6px; border: 1px solid transparent; border-radius: 6px; cursor: pointer; list-style: none; }
.fleet-tagpick summary::-webkit-details-marker { display: none; }
.fleet-tagpick summary:hover, .fleet-tagpick[open] summary { border-color: var(--line); }
.fleet-tagpick-menu { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; display: flex; flex-wrap: wrap; gap: 6px; width: 260px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg, #141110); box-shadow: 0 12px 30px rgba(0,0,0,.45); }
.fleet-bulk { position: sticky; top: 132px; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; padding: 8px 12px; border: 1px solid rgba(240,138,60,.45); border-radius: 10px; background: var(--surface); }
.fleet-bulk .select { width: auto; min-width: 0; padding-top: 5px; padding-bottom: 5px; }
.fleet-tagrow, .fleet-grouprow { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; }
.fleet-tagrow:hover, .fleet-grouprow:hover { background: rgba(255,255,255,.03); }
.fleet-tagrow .fleet-quiet, .fleet-grouprow .fleet-quiet { flex: 1; }
.fleet-tagrow .fleet-color { flex: 0 0 36px !important; width: 36px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; }
@media (max-width: 960px) {
  .fleet-editor-body { grid-template-columns: 1fr; }
  .fleet-nav { position: static; max-height: 320px; }
}
/* When the editor panel is narrow, each row folds onto two lines: the name, then its settings. */
.fleet-pane { container-type: inline-size; }
@container (max-width: 820px) {
  .fleet-row-head { display: none; }
  .fleet-row { grid-template-columns: 22px 96px 112px minmax(0, 1fr) minmax(0, 1fr) 30px; grid-template-areas: "pick name name name name del" ". cls status tags note ."; row-gap: 2px; padding: 6px; }
  .fleet-row > .fleet-pick { grid-area: pick; }
  .fleet-row > .fleet-cell-name { grid-area: name; }
  .fleet-row > [data-field="cls"] { grid-area: cls; }
  .fleet-row > .fleet-status { grid-area: status; }
  .fleet-row > .fleet-tagpick { grid-area: tags; }
  .fleet-row > [data-field="note"] { grid-area: note; }
  .fleet-row > .icon-btn { grid-area: del; }
  .fleet-cell-name .fleet-quiet { font-weight: 600; }
}
@container (max-width: 480px) {
  .fleet-row { grid-template-columns: 22px 1fr 1fr 30px; grid-template-areas: "pick name name del" ". cls status ." ". tags tags ." ". note note ."; }
}
.fleet-bulk, .fleet-edit-bar { background: linear-gradient(var(--surface), var(--surface)), var(--bg, #12100f); box-shadow: 0 8px 20px rgba(0,0,0,.35); }
.fleet-bulk .select { font-size: 13px; }
/* Section tabs and folding group cards */
.fleet-search { display: block; max-width: 520px; margin: 0 0 12px; }
.fleet-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 12px; padding-bottom: 4px; scrollbar-width: thin; }
.fleet-tabbtn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.fleet-tabbtn small { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.fleet-tabbtn:hover { color: var(--text); border-color: rgba(240,138,60,.35); }
.fleet-tabbtn.is-current { color: var(--ember-2); border-color: rgba(240,138,60,.6); background: rgba(240,138,60,.12); }
.fleet-tabadd { border-style: dashed; color: var(--muted); }
.fleet-filters { display: grid; gap: 8px; margin: 0 0 14px; }
.fleet-filters .chips small { opacity: .65; margin-left: 4px; }
.fleet-foldall { display: flex; justify-content: flex-end; gap: 4px; margin: -6px 0 6px; }
.fleet-gcard { margin: 0 0 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.fleet-gcard > summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; cursor: pointer; list-style: none; }
.fleet-gcard > summary::-webkit-details-marker { display: none; }
.fleet-gcard > summary small { color: var(--muted); font-variant-numeric: tabular-nums; }
.fleet-gcard-chev { transition: transform .15s; color: var(--muted); }
.fleet-gcard[open] .fleet-gcard-chev { transform: rotate(90deg); }
.fleet-gcard-sum { margin-left: auto; display: inline-flex; gap: 6px; }
.fleet-gcard > .fleet-list { padding: 0 12px 12px; }
.fleet-gcard .fleet-item { background: rgba(255,255,255,.015); }
.fleet-nav-label { margin: 6px 0 0; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.fleet-nav-rule { width: 100%; margin: 4px 0; border: 0; border-top: 1px solid var(--line); }
.fleet-editor .fleet-tabs { margin-top: 2px; }
.fleet-tabs { flex-wrap: wrap; overflow: visible; padding-bottom: 0; }
@media (max-width: 560px) { .fleet-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; } }
.fleet-nav { overflow-x: hidden; }
/* Styled menus for class and status in the editor */
.fleet-menu { position: relative; }
.fleet-menu > summary { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 30px; padding: 3px 6px; border: 1px solid transparent; border-radius: 6px; cursor: pointer; list-style: none; color: var(--muted); }
.fleet-menu > summary::-webkit-details-marker { display: none; }
.fleet-menu > summary:hover, .fleet-menu[open] > summary { border-color: var(--line); }
.fleet-menu-list { position: absolute; z-index: 25; top: calc(100% + 4px); left: 0; min-width: 160px; display: grid; gap: 2px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2, #14100c); box-shadow: 0 14px 32px rgba(0,0,0,.5); }
.fleet-menu-list button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: 7px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.fleet-menu-list button:hover, .fleet-menu-list button:focus-visible { background: rgba(255,255,255,.06); outline: none; }
.fleet-menu-list button.is-current { background: rgba(240,138,60,.1); }
.fleet-menu-list .i-sm { color: var(--ember-2); }
.fleet-pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text-2); background: rgba(255,255,255,.05); border: 1px solid var(--line); white-space: nowrap; }
.fleet-pill.is-authorized { color: #7ee0ae; background: rgba(76,195,138,.12); border-color: rgba(76,195,138,.35); }
.fleet-pill.is-restricted { color: #f0b429; background: rgba(240,180,41,.12); border-color: rgba(240,180,41,.35); }
.fleet-pill.is-banned { color: #ff9d92; background: rgba(239,90,76,.12); border-color: rgba(239,90,76,.4); }
.fleet-pill.is-prestige { color: #c9a7ff; border-color: rgba(170,130,255,.35); }
.fleet-pill.is-classic { color: #e8c48a; border-color: rgba(232,196,138,.35); }
.fleet-pill.is-electric { color: #7cc7ff; border-color: rgba(124,199,255,.35); }
.fleet-menu-cls .fleet-menu-list { min-width: 140px; }
@container (max-width: 820px) {
  .fleet-row > .fleet-menu-cls { grid-area: cls; }
  .fleet-row > .fleet-menu-status { grid-area: status; }
}
/* The Network's sections fold into a menu on phones and tablets */
.fx-menu-btn { display: none; align-items: center; gap: 6px; min-height: 36px; margin-left: auto; padding: 0 12px; border: 1px solid #26262b; border-radius: 4px; background: none; color: var(--text); font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; cursor: pointer; }
.fx-bar.is-open .fx-menu-btn { border-color: var(--fx-red); color: var(--fx-red); }
@media (max-width: 860px) {
  .fx-bar { position: sticky; flex-wrap: nowrap; }
  .fx-menu-btn { display: inline-flex; }
  .fx-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 6px 0; overflow: visible; background: rgba(5,5,5,.97); border-bottom: 1px solid var(--fx-line); box-shadow: 0 16px 30px rgba(0,0,0,.6); }
  .fx-bar.is-open .fx-nav { display: flex; }
  .fx-nav a, .fx-nav-soon { min-height: 46px; padding: 0 20px; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,.04); }
  .fx-nav a.is-current { background: rgba(255,43,43,.08); }
  .fx-nav a.is-current::after { left: 0; right: auto; top: 10px; bottom: 10px; width: 3px; height: auto; }
}
@media (max-width: 860px) { .fx-nav { background: #060606; } }

/* Sign in with Discord, two-factor and account recovery */
.btn-discord { justify-content: center; border-color: rgba(88,101,242,.55); background: rgba(88,101,242,.14); }
.btn-discord:hover { background: rgba(88,101,242,.24); }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-help { font-size: 14px; line-height: 1.5; color: var(--muted); }
.auth-help b { color: var(--text, inherit); }
.twofa-on { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 2px 10px; border-radius: 999px; font-size: 13px; vertical-align: middle; color: #4ade80; background: rgba(74,222,128,.12); }
.twofa-setup { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; align-items: start; }
.twofa-qr { width: 180px; height: 180px; padding: 8px; border-radius: 12px; background: #fff; }
.twofa-steps { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 8px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.twofa-secret { display: inline-block; margin-top: 4px; padding: 4px 8px; border-radius: 6px; background: rgba(255,255,255,.06); font-size: 14px; letter-spacing: .05em; word-break: break-all; user-select: all; }
.twofa-form { display: grid; gap: 12px; max-width: 360px; }
.twofa-codes ol { display: grid; grid-template-columns: repeat(2, max-content); gap: 6px 28px; margin: 12px 0 16px; padding-left: 24px; }
.twofa-codes code { font-size: 15px; letter-spacing: .04em; }
.twofa-codes p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.account-security { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; }
.account-security > span { display: inline-flex; align-items: center; gap: 4px; }
.account-audit { margin-top: 20px; padding: 18px; }
.account-audit h2 { font-size: 18px; margin: 0 0 4px; }
.audit-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.audit-list time { color: var(--muted); font-size: 13px; margin-right: 6px; }
@media (max-width: 560px) {
  .twofa-setup { grid-template-columns: 1fr; }
  .twofa-codes ol { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Oakly: the economy's own website (oakly.greateroakridge.com). A cozy look in
   chocolate and honey, with Oakly the pixel lab. Scoped to body.oakly-mode / .ok.
   ========================================================================== */
body.oakly-mode {
  --bg: #17100b; --bg-2: #1e150e; --bg-3: #271b12;
  --surface: rgba(255, 236, 205, .05); --surface-2: rgba(255, 236, 205, .085); --surface-solid: #241910;
  --border: rgba(255, 226, 186, .12); --border-strong: rgba(255, 226, 186, .24);
  --text: #fbf1e2; --text-2: #e3d0b8; --muted: #b29c84;
  --ember: #f0a94b; --ember-2: #ffc977; --ember-deep: #c27a22;
  background: radial-gradient(1200px 500px at 80% -10%, rgba(240,169,75,.12), transparent 60%), #17100b;
}
body.oakly-mode .nav-wrap, body.oakly-mode .footer, body.oakly-mode .announce { display: none !important; }
body.oakly-mode .btn-primary { background: linear-gradient(180deg, #ffc777, var(--ember) 60%, #de9333); color: #2a1509; box-shadow: 0 8px 22px -10px rgba(240,169,75,.8), inset 0 1px 0 rgba(255,255,255,.4); }
.ok { min-height: 100vh; display: flex; flex-direction: column; }
.ok-bar { position: sticky; top: 0; z-index: var(--z-nav); display: flex; align-items: center; gap: 20px; padding: 10px max(16px, calc((100% - var(--container)) / 2)); background: rgba(23,16,11,.86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.ok-brand { display: inline-flex; align-items: center; gap: 10px; font: 700 22px var(--font-display); color: var(--text); letter-spacing: -.01em; }
.ok-brand:hover { color: var(--ember-2); }
.ok-nav { display: flex; align-items: center; gap: 4px; }
.ok-nav a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: var(--radius-pill); color: var(--text-2); font-weight: 600; font-size: 14px; transition: background-color .15s, color .15s; }
.ok-nav a:hover { background: var(--surface-2); color: var(--text); }
.ok-nav a.is-current { background: rgba(240,169,75,.16); color: var(--ember-2); }
.ok-bar-end { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.ok-switcher .dd-trigger, .ok-switcher .select { min-height: 40px; min-width: 180px; }
.ok-playing { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 14px; font-weight: 600; }
.ok-account .avatar { width: 38px; height: 38px; }
.ok-menu-btn { display: none; }
.ok-test-note { padding: 8px 16px; text-align: center; font-size: 13px; color: #2a1509; background: var(--ember-2); font-weight: 600; }
.ok-page { flex: 1; width: min(var(--container), 100% - 32px); margin: 0 auto; padding: 32px 0 56px; }
.ok-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px max(16px, calc((100% - var(--container)) / 2)); border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.ok-foot span { display: inline-flex; align-items: center; gap: 8px; }
.ok-foot a { color: var(--text-2); }
.ok-foot a:hover { color: var(--ember-2); }
.ok-sprite { image-rendering: pixelated; flex-shrink: 0; }
.ok-bounce { animation: okBounce 2.6s var(--ease) infinite; filter: drop-shadow(0 18px 24px rgba(0,0,0,.45)); }
@keyframes okBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .ok-bounce { animation: none; } }
.ok-hero { display: grid; grid-template-columns: 1.3fr 1fr; align-items: center; gap: 32px; padding: 24px 0 40px; }
.ok-hero h1 { margin: 6px 0 12px; font: 800 clamp(34px, 5vw, 56px)/1.05 var(--font-display); letter-spacing: -.02em; }
.ok-hero p { color: var(--text-2); font-size: 17px; line-height: 1.7; max-width: 52ch; margin: 0 0 20px; }
.ok-hero-dog { display: grid; place-items: center; }
.ok-kicker { margin: 0; color: var(--ember-2); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.ok-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; }
.ok-says { display: flex; align-items: flex-end; gap: 14px; margin: 0 0 20px; }
.ok-says p { position: relative; margin: 0; padding: 14px 18px; border-radius: 18px 18px 18px 4px; background: #fbf1e2; color: #2a1509; font-size: 15px; line-height: 1.55; max-width: 60ch; box-shadow: 0 10px 30px -14px rgba(0,0,0,.6); }
.ok-gate { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 24px; margin-bottom: 32px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); }
.ok-welcome { margin-bottom: 32px; }
.ok-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.ok-head h1 { margin: 0 0 6px; font: 700 32px var(--font-display); }
.ok-head p { margin: 0; color: var(--text-2); max-width: 64ch; line-height: 1.6; }
.ok-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 24px; }
.ok-char { display: flex; flex-direction: column; overflow: hidden; transition: border-color .15s; }
.ok-char:hover { border-color: rgba(240,169,75,.45); }
.ok-char-main { display: flex; align-items: center; gap: 14px; padding: 14px; color: inherit; }
.ok-char-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ok-char-text b { font-size: 16px; overflow-wrap: anywhere; }
.ok-char-text small { color: var(--muted); font-size: 13px; font-family: var(--font-mono); }
.ok-char-actions { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); }
.ok-char-actions .ok-danger { margin-left: auto; color: #ffb0a6; }
.ok-badge-on { color: var(--ember-2); border-color: rgba(240,169,75,.45); background: rgba(240,169,75,.12); }
.ok-photo { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; background: var(--bg-3); border: 1px solid var(--border); flex-shrink: 0; }
.ok-photo-lg { width: 112px; height: 112px; border-radius: 22px; }
.ok-photo-xl { width: 148px; height: 148px; border-radius: 26px; }
.ok-soon h2 { font: 700 22px var(--font-display); margin: 8px 0 14px; }
.ok-soon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.ok-soon-item { display: flex; flex-direction: column; gap: 6px; padding: 16px; }
.ok-soon-item .i { color: var(--ember-2); }
.ok-soon-item small { color: var(--muted); font-size: 13px; line-height: 1.5; }
.ok-form { display: grid; gap: 22px; padding: 24px; max-width: 760px; }
.ok-photo-pick { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ok-photo-empty { display: grid; place-items: center; width: 112px; height: 112px; border-radius: 22px; border: 1.5px dashed var(--border-strong); }
.ok-photo-pick [hidden] { display: none; }
.ok-photo-btns { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.ok-fields { display: grid; gap: 14px; margin: 0; padding: 0; border: 0; min-width: 0; }
.ok-fields legend { padding: 0; margin-bottom: 4px; font-weight: 700; font-size: 15px; }
.ok-fields legend small { display: block; margin-top: 2px; color: var(--muted); font-weight: 400; font-size: 13px; }
.ok-fields:disabled .input { opacity: .65; }
.ok-name-row { display: grid; grid-template-columns: 1fr 72px 1fr; gap: 12px; }
.ok-name-row.ok-two { grid-template-columns: 1fr 1fr; }
.ok-narrow { max-width: 240px; }
.ok-toggles { display: grid; gap: 10px; }
.ok-form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.ok-search { max-width: 480px; margin-bottom: 18px; }
.ok-count { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.ok-record { padding: 28px; margin-bottom: 24px; }
.ok-rec-id { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.ok-rec-id h1 { margin: 4px 0 4px; font: 800 34px var(--font-display); }
.ok-cid { margin: 0 0 12px; font-family: var(--font-mono); color: var(--ember-2); letter-spacing: .06em; }
.ok-rec-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 20px; margin: 22px 0 0; }
.ok-rec-wide { grid-template-columns: repeat(2, 1fr); padding-top: 22px; border-top: 1px solid var(--border); }
.ok-rec-row dt { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.ok-rec-row dd { margin: 4px 0 0; font-size: 15px; display: flex; flex-wrap: wrap; gap: 6px; }
.ok-none { color: var(--muted); font-style: italic; }
.ok-bio { margin: 20px 0 0; color: var(--text-2); line-height: 1.7; }
.ok-admin { padding: 16px; max-width: 640px; }
@media (max-width: 820px) {
  .ok-bar { flex-wrap: wrap; gap: 10px; }
  .ok-menu-btn { display: inline-flex; margin-left: auto; }
  .ok-nav { display: none; order: 3; flex-basis: 100%; flex-direction: column; align-items: stretch; }
  .ok-bar.is-open .ok-nav { display: flex; }
  .ok-bar-end { margin-left: 0; }
  .ok-hero { grid-template-columns: 1fr; }
  .ok-hero-dog { order: -1; }
  .ok-hero-dog .ok-sprite { width: 150px; height: auto; }
  .ok-rec-grid { grid-template-columns: repeat(2, 1fr); }
  .ok-rec-wide { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .ok-name-row { grid-template-columns: 1fr 64px; }
  .ok-name-row > :last-child { grid-column: 1 / -1; }
  .ok-name-row.ok-two { grid-template-columns: 1fr 1fr; }
  .ok-name-row.ok-two > :last-child { grid-column: auto; }
  .ok-switcher .dd-trigger, .ok-switcher .select { min-width: 140px; }
}

/* Oakly Update 3: bank, hub and the admin panel */
.ok-pad { padding: 20px; }
.ok-muted { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0 0 12px; }
.ok-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ok-mb { margin-bottom: 16px; }
.ok-danger { color: #ffb0a6; }
.ok-off { display: flex; align-items: center; gap: 12px; padding: 10px max(16px, calc((100% - var(--container)) / 2)); background: #3a1d12; border-bottom: 1px solid rgba(255,140,110,.3); color: #ffd9cc; font-size: 14px; }
.ok-off p { margin: 2px 0; }
.ok-banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; margin-bottom: 16px; font-size: 14px; }
.ok-banner-bad { background: rgba(239,90,76,.12); border: 1px solid rgba(239,90,76,.35); color: #ffc9c0; }
.ok-badge-bad { color: #ffb0a6; border-color: rgba(239,90,76,.45); background: rgba(239,90,76,.12); }
.ok-balances { display: grid; grid-template-columns: 1fr 1fr 1.6fr; gap: 14px; margin-bottom: 20px; }
.ok-bal { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; }
.ok-bal small { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
.ok-bal b { font: 700 28px var(--font-display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.ok-bal-nw { background: linear-gradient(135deg, rgba(240,169,75,.14), var(--surface) 60%); }
.ok-tier { margin-top: 4px; }
.ok-tier b { color: var(--ember-2); font-size: 14px; }
.ok-tier small { color: var(--muted); font-size: 12px; }
.ok-tier-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.ok-bar-track { height: 8px; border-radius: 99px; background: rgba(255,236,205,.1); overflow: hidden; }
.ok-bar-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--ember-deep), var(--ember-2)); }
.ok-hub { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.ok-side { display: grid; gap: 12px; }
.ok-sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.ok-sec-head a { color: var(--ember-2); font-size: 14px; font-weight: 600; }
.ok-hub h2, .ok-bank-grid h2, .ok-admin-body h2 { margin: 0 0 10px; font: 700 18px var(--font-display); }
.ok-entries { list-style: none; margin: 0; padding: 0; }
.ok-entry { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.ok-entry:first-child { border-top: 0; }
.ok-entry-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ok-entry-main b { font-size: 15px; }
.ok-entry-main b span { font-weight: 400; color: var(--text-2); }
.ok-entry-main small { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.ok-amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ok-amt.is-in { color: #8fdcb0; }
.ok-amt.is-out { color: #ffb8a8; }
.is-reversed .ok-amt, .is-reversed b { text-decoration: line-through; opacity: .6; }
.ok-quick { display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: inherit; transition: border-color .15s; }
.ok-quick:hover { border-color: rgba(240,169,75,.45); }
.ok-quick > .i { color: var(--ember-2); }
.ok-quick span { display: flex; flex-direction: column; gap: 2px; }
.ok-quick small { color: var(--muted); font-size: 13px; }
.ok-treasury { display: flex; flex-direction: column; gap: 4px; }
.ok-treasury small { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.ok-treasury b { font: 700 22px var(--font-display); }
.ok-treasury span { color: var(--muted); font-size: 13px; }
.ok-bank-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ok-form-sm { display: flex; flex-direction: column; gap: 14px; }
.ok-form-sm .btn { align-self: flex-start; }
.ok-seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; border: 1px solid var(--border); background: rgba(0,0,0,.2); align-self: flex-start; }
.ok-seg label { position: relative; cursor: pointer; }
.ok-seg input { position: absolute; opacity: 0; pointer-events: none; }
.ok-seg span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--text-2); transition: background-color .15s, color .15s; }
.ok-seg input:checked + span { background: rgba(240,169,75,.18); color: var(--ember-2); }
.ok-seg input:focus-visible + span { box-shadow: 0 0 0 3px rgba(240,169,75,.35); }
.ok-money-in { position: relative; display: block; }
.ok-money-in > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-style: normal; pointer-events: none; }
.ok-money-in .input { padding-left: 30px; font-variant-numeric: tabular-nums; }
.ok-filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; align-items: flex-end; }
.ok-filters .field { min-width: 200px; }
.ok-grow { flex: 1; }
.ok-table-wrap { overflow-x: auto; margin-bottom: 12px; }
.ok-table td small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.ok-table .ok-num { text-align: right; }
.ok-tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; margin-bottom: 20px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); }
.ok-tabs a { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 12px; color: var(--text-2); font-weight: 600; font-size: 14px; }
.ok-tabs a:hover { background: var(--surface-2); color: var(--text); }
.ok-tabs a.is-current { background: rgba(240,169,75,.16); color: var(--ember-2); }
.ok-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.ok-stat { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; }
.ok-stat small { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.ok-stat b { font: 700 24px var(--font-display); font-variant-numeric: tabular-nums; }
.ok-stat span { color: var(--muted); font-size: 13px; }
.ok-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ok-mini li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--text-2); }
.ok-mini small { color: var(--muted); white-space: nowrap; }
.ok-back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.ok-back:hover { color: var(--ember-2); }
.ok-head-sm h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font: 700 24px var(--font-display); }
.ok-settings { display: grid; gap: 16px; max-width: 860px; }
.ok-setting { display: grid; grid-template-columns: 1fr 200px 72px; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.ok-setting:first-of-type { border-top: 0; }
.ok-setting label { font-size: 15px; color: var(--text); }
.ok-setting label small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.ok-setting-in { position: relative; display: block; }
.ok-setting [hidden] { display: none; }
.ok-setting-in .input { font-variant-numeric: tabular-nums; }
.ok-suffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-style: normal; pointer-events: none; }
.ok-switch-list { display: grid; gap: 10px; margin-bottom: 16px; max-width: 760px; }
.level-switch.is-off { border-color: rgba(239,90,76,.4); background: rgba(239,90,76,.08); }
.ok-levels { display: grid; gap: 10px; max-width: 860px; }
.ok-level summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; cursor: pointer; list-style: none; }
.ok-level summary::-webkit-details-marker { display: none; }
.ok-level summary span { display: flex; flex-direction: column; gap: 2px; }
.ok-level summary small { color: var(--muted); font-size: 13px; }
.ok-level[open] summary .i { transform: rotate(180deg); }
.ok-level-form { display: grid; gap: 14px; padding: 0 18px 18px; }
.ok-perms { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.ok-perm { align-items: flex-start; min-height: 0; padding: 8px 0; }
.ok-perm input { margin-top: 2px; }
.ok-perm span { display: flex; flex-direction: column; gap: 2px; }
.ok-perm b { font-size: 14px; color: var(--text); font-weight: 600; }
.ok-perm small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.ok-later { display: inline; color: var(--ember-2) !important; font-weight: 600; margin-left: 4px; }
.ok-people { display: flex; flex-wrap: wrap; gap: 6px; }
.ok-x { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: -6px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.ok-x:hover { color: var(--text); background: var(--surface-2); }
.ok-dialog { display: grid; gap: 14px; width: min(480px, 100%); }
.ok-dialog h2, .ok-dialog p { margin: 0; }
.ok-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 900px) {
  .ok-balances { grid-template-columns: 1fr 1fr; }
  .ok-bal-nw { grid-column: 1 / -1; }
  .ok-hub, .ok-bank-grid { grid-template-columns: 1fr; }
  .ok-perms { grid-template-columns: 1fr; }
  .ok-setting { grid-template-columns: 1fr 140px; }
  .ok-setting .btn { grid-column: 2; justify-self: end; }
}
@media (max-width: 520px) {
  .ok-balances { grid-template-columns: 1fr; }
  .ok-setting { grid-template-columns: 1fr; }
  .ok-setting .btn { grid-column: 1; justify-self: start; }
  .ok-two-col { grid-template-columns: 1fr; }
  .ok-filters .field { min-width: 0; flex: 1 1 100%; }
}

/* Oakly Update 4: explainers, walkthroughs, the first-visit tour, the bell and the guide library */
.ok-term { border-bottom: 1.5px dotted currentColor; cursor: help; text-decoration: none; }
.ok-term:focus-visible { outline: 2px solid var(--ember-2); outline-offset: 2px; border-radius: 3px; }
.ok-tip { position: fixed; z-index: var(--z-toast); padding: 10px 12px; border-radius: 12px; background: #fbf1e2; color: #2a1509; font-size: 13px; line-height: 1.5; box-shadow: 0 12px 30px -10px rgba(0,0,0,.6); pointer-events: none; }
.ok-tour { position: fixed; inset: 0; z-index: var(--z-modal); }
.ok-tour-hole { position: fixed; border-radius: 18px; box-shadow: 0 0 0 9999px rgba(10,6,3,.72); outline: 2px solid var(--ember-2); transition: all .25s var(--ease); pointer-events: none; }
.ok-tour-card { position: fixed; padding: 16px; border-radius: 18px; background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow); transition: top .25s var(--ease), left .25s var(--ease); }
.ok-tour-head { display: flex; gap: 12px; align-items: flex-start; }
.ok-tour-head p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--text); }
.ok-tour-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 14px; }
.ok-tour-foot small { color: var(--muted); font-size: 12px; }
.ok-tour-foot span { display: flex; gap: 6px; }
@media (prefers-reduced-motion: reduce) { .ok-tour-hole, .ok-tour-card { transition: none; } }
.ok-offer { display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 16px; margin-bottom: 18px; border-radius: 18px; border: 1px dashed rgba(240,169,75,.45); background: rgba(240,169,75,.06); }
.ok-offer .ok-says { margin-bottom: 10px; }
.ok-firsttour { margin-bottom: 20px; border-color: rgba(240,169,75,.4); background: linear-gradient(135deg, rgba(240,169,75,.1), var(--surface) 70%); }
.ok-firsttour .ok-sec-head small { color: var(--ember-2); font-weight: 700; }
.ok-steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; counter-reset: step; }
.ok-steps li { display: flex; align-items: flex-start; gap: 12px; font-size: 15px; }
.ok-step-mark { display: inline-grid; place-items: center; flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--border-strong); color: var(--muted); counter-increment: step; }
.ok-step-mark:empty::before { content: counter(step); font-size: 12px; font-weight: 700; }
.ok-steps li.is-done .ok-step-mark { background: var(--ember); border-color: var(--ember); color: #2a1509; }
.ok-steps li.is-done .ok-step-text { color: var(--muted); text-decoration: line-through; }
.ok-steps li.is-later { opacity: .6; }
.ok-step-text { padding-top: 2px; }
.ok-step-text a { color: var(--ember-2); font-weight: 600; }
.ok-step-text small { display: block; color: var(--muted); font-size: 12px; }
.ok-next-row { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.ok-next { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 18px; }
.ok-next .ok-says { margin-bottom: 8px; }
.ok-help span { display: inline; }
.ok-bell-wrap { position: relative; }
.ok-bell { position: relative; width: 40px; padding: 0; justify-content: center; }
.ok-bell-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; background: var(--ember); color: #2a1509; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.ok-bell-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: var(--z-modal); width: min(360px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto; border-radius: 18px; background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow); }
.ok-bell-panel[hidden] { display: none; }
.ok-bell-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface-solid); }
.ok-notes { list-style: none; margin: 0; padding: 4px; }
.ok-notes a { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 12px; color: var(--text-2); font-size: 14px; line-height: 1.45; }
.ok-notes a:hover { background: var(--surface-2); }
.ok-notes small { color: var(--muted); font-size: 12px; }
.ok-notes li.is-new a { color: var(--text); background: rgba(240,169,75,.07); }
.ok-bell-empty { display: flex; align-items: center; gap: 12px; padding: 18px 16px; color: var(--muted); font-size: 14px; }
.ok-bell-empty p { margin: 0; }
.ok-prefs { display: grid; gap: 12px; padding: 14px 16px; }
.ok-prefs .field > span small { display: block; font-weight: 400; }
.ok-guides-sec { margin-bottom: 28px; }
.ok-guides-sec h2 { font: 700 20px var(--font-display); margin: 0 0 12px; }
.ok-guide-list { display: grid; gap: 10px; max-width: 760px; }
.ok-guide summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; cursor: pointer; list-style: none; }
.ok-guide summary::-webkit-details-marker { display: none; }
.ok-guide[open] summary .i { transform: rotate(180deg); }
.ok-guide p { margin: 0; padding: 0 18px 18px; color: var(--text-2); line-height: 1.7; }
.ok-glossary { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px 24px; margin: 0; max-width: 980px; }
.ok-glossary dt { font-weight: 700; color: var(--ember-2); }
.ok-glossary dd { margin: 2px 0 0; color: var(--text-2); font-size: 14px; line-height: 1.55; }
@media (max-width: 820px) {
  .ok-help span { display: none; }
  .ok-help { width: 40px; padding: 0; justify-content: center; }
}

/* The Oakly bar folds its sections into the Menu button before they get cramped. */
.ok-nav a { white-space: nowrap; }
@media (max-width: 1100px) {
  .ok-bar { flex-wrap: wrap; gap: 10px; }
  .ok-menu-btn { display: inline-flex; margin-left: auto; }
  .ok-nav { display: none; order: 3; flex-basis: 100%; flex-direction: column; align-items: stretch; }
  .ok-bar.is-open .ok-nav { display: flex; }
  .ok-bar-end { margin-left: 0; }
}

/* Oakly's tail wags and his eyes blink. Both stop for people who prefer less motion. */
.ok-sprite .ok-tail { transform-box: view-box; transform-origin: 27px 31px; animation: okWag .55s ease-in-out infinite alternate; }
.ok-sprite .ok-eyes { transform-box: view-box; transform-origin: 20px 11.5px; animation: okBlink 4.2s steps(1) infinite; }
@keyframes okWag { from { transform: rotate(-14deg); } to { transform: rotate(16deg); } }
@keyframes okBlink { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.15); } }
@media (prefers-reduced-motion: reduce) { .ok-sprite .ok-tail, .ok-sprite .ok-eyes { animation: none; } }
