/* =========================================================================
   Wimzi design system
   Colours: mint #BCECDD, navy #142D3D, teal #007F82, cream #FFF8EE
   Type:    Fraunces (soft, swashy display serif) + Plus Jakarta Sans (UI)

   Game screens only use the semantic tokens (--primary, --accent, --stage, --a0..--a5,
   --font-*). A company brand kit overrides exactly those, so every screen re-skins itself.
   ========================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght,SOFT,WONK@9..144,400..900,0..100,0..1&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --mint: #BCECDD;
  --mint-50: #E8F8F2;
  --mint-600: #7FD3B8;
  --navy: #142D3D;
  --navy-700: #0C1E29;
  --navy-500: #24465A;
  --teal: #007F82;
  --teal-700: #00676A;
  --cream: #FFF8EE;
  --cream-200: #F6ECDC;
  --coral: #E0603F;
  --sun: #D99215;
  --indigo: #3D4F9F;
  --plum: #8A4FA3;
  --leaf: #3E8E57;
  --red: #C8443A;
  --white: #ffffff;

  /* semantic tokens: brand kits override these */
  --primary: var(--navy);
  --primary-ink: #ffffff;
  --accent: var(--teal);
  --accent-ink: #ffffff;
  --highlight: var(--mint);
  --highlight-ink: var(--navy);
  --stage: var(--navy);
  --stage-ink: #F2FBF7;
  --stage-soft: rgba(188, 236, 221, .12);
  --stage-image: none;

  --page: var(--cream);
  --surface: #ffffff;
  --ink: var(--navy);
  --muted: #587080;
  --line: #E6DCCB;

  --a0: var(--teal);   --a0-ink: #fff;
  --a1: var(--plum);   --a1-ink: #fff;
  --a2: var(--coral);  --a2-ink: #fff;
  --a3: var(--indigo); --a3-ink: #fff;
  --a4: var(--sun);    --a4-ink: #fff;
  --a5: var(--leaf);   --a5-ink: #fff;

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius: 12px;
  --radius-lg: 20px;
  --pill: 999px;
  --shadow: 0 1px 2px rgba(20, 45, 61, .06), 0 8px 24px rgba(20, 45, 61, .08);
  --shadow-lg: 0 18px 50px rgba(12, 30, 41, .22);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: 'SOFT' 100, 'WONK' 1;
  margin: 0 0 .5em;
  line-height: 1.1;
  letter-spacing: -.01em;
}
a { color: var(--accent); }
button, input, select, textarea { font-family: inherit; }
img { max-width: 100%; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Game stage (dark, brandable background) ---------- */
.stage-bg {
  background: var(--stage-image) center / cover no-repeat, var(--stage);
  color: var(--stage-ink);
  position: relative;
  overflow-x: hidden;
}
.stage-bg::before {
  /* soft mint glow + scattered sparks, like the brand art */
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60vmax 40vmax at 85% -10%, var(--stage-soft), transparent 70%),
    radial-gradient(50vmax 35vmax at -10% 110%, var(--stage-soft), transparent 70%);
}
.branded-image .stage-bg::before, .stage-bg.has-image::before { background: rgba(0, 0, 0, .35); }
.stage-bg > * { position: relative; z-index: 1; }

/* ---------- Logo ---------- */
.logo {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 800;
  font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 144;
  font-size: 2rem;
  letter-spacing: -.02em;
  color: var(--mint);
  text-decoration: none;
  display: inline-flex;
  align-items: flex-start;
  line-height: 1;
}
.logo .spark { width: .42em; height: .42em; color: var(--teal); margin-left: .04em; margin-top: -.12em; flex: none; }
.logo.dark { color: var(--navy); }
.logo.dark .spark { color: var(--teal); }
.on-stage .logo .spark { color: var(--accent); }
.logo-xl { font-size: clamp(3.6rem, 13vw, 7rem); }
.tagline { font-family: var(--font-display); font-variation-settings: 'SOFT' 100; font-weight: 500; }

/* Company logo shown in place of (or next to) Wimzi when a brand kit is active */
.brand-mark { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: inherit; text-decoration: none; }
.brand-mark img { height: 40px; width: auto; max-width: 180px; object-fit: contain; border-radius: 6px; }
.brand-mark.xl img { height: clamp(64px, 14vw, 110px); max-width: 320px; }
.brand-mark.xl { font-size: clamp(1.8rem, 6vw, 3rem); flex-direction: column; }
.powered { font-size: .72rem; font-weight: 700; opacity: .75; letter-spacing: .02em; display: inline-flex; align-items: center; gap: .35em; }
.powered b { font-family: 'Fraunces', Georgia, serif; font-weight: 800; font-size: 1.1em; font-variation-settings: 'SOFT' 100, 'WONK' 1; }

/* ---------- Buttons (soft pills) ---------- */
.btn {
  --c: var(--primary);
  --ci: var(--primary-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  border: 0;
  border-radius: var(--pill);
  padding: .8em 1.5em;
  font-weight: 800;
  font-size: 1rem;
  color: var(--ci);
  background: var(--c);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18);
  cursor: pointer;
  text-decoration: none;
  transition: transform .08s, filter .15s, box-shadow .15s;
  min-height: 44px;
  user-select: none;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .18); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.accent { --c: var(--accent); --ci: var(--accent-ink); }
.btn.mint { --c: var(--mint); --ci: var(--navy); }
.btn.light { --c: var(--white); --ci: var(--navy); }
.btn.ghost { --c: rgba(255, 255, 255, .14); --ci: currentColor; box-shadow: none; }
.btn.outline { --c: transparent; --ci: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn.outline:hover { box-shadow: inset 0 0 0 2px var(--ink); filter: none; }
.btn.danger { --c: var(--red); --ci: #fff; }
.btn.whatsapp { --c: #1F7A45; --ci: #fff; text-decoration: none; }
.btn.share-slack { --c: #4A154B; --ci: #fff; }
.btn.share-teams { --c: #4B53BC; --ci: #fff; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.share-row:empty { display: none; }
.share-label { font-weight: 800; font-size: .85rem; color: var(--muted); }
.share-hint { font-size: .8rem; font-weight: 700; color: var(--muted); }
.btn.lg { font-size: 1.15rem; padding: .9em 1.9em; }
.btn.sm { font-size: .86rem; padding: .5em 1em; min-height: 36px; }
.btn.block { width: 100%; }
.icon-btn {
  background: rgba(255, 255, 255, .14); color: inherit; border: 0; border-radius: var(--pill);
  min-width: 44px; min-height: 44px; font-size: 1.1rem; cursor: pointer; font-weight: 800;
}
.icon-btn:hover { background: rgba(255, 255, 255, .26); }

/* ---------- Inputs ---------- */
.input {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: .75em 1em;
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  background: var(--white);
  outline: none;
  transition: border-color .15s;
}
.input:focus { border-color: var(--teal); }
.input.big { text-align: center; font-size: 1.35rem; padding: .7em; font-weight: 800; border-radius: var(--pill); }
label.field { display: block; font-weight: 700; font-size: .85rem; margin: 0 0 .35em; color: var(--navy-500); }
select.input { cursor: pointer; }
.check { display: flex; align-items: center; gap: .6em; font-weight: 700; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--teal); }

/* toggle switch */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; font-weight: 700; }
.switch small { display: block; font-weight: 500; opacity: .75; font-size: .8rem; }
.switch input { appearance: none; width: 46px; height: 26px; border-radius: 99px; background: rgba(127, 127, 127, .35); position: relative; cursor: pointer; flex: none; transition: background .15s; margin: 0; }
.switch input::after { content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(20px); }

/* ---------- Top navigation ---------- */
.topnav {
  background: var(--navy);
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .7rem clamp(16px, 4vw, 40px);
  position: sticky; top: 0; z-index: 20;
}
.topnav .logo { font-size: 1.8rem; }
.topnav .links { display: flex; gap: .25rem; margin-left: 1rem; flex-wrap: wrap; }
.topnav .links a {
  color: var(--white); text-decoration: none; font-weight: 700; font-size: .92rem;
  padding: .55em .95em; border-radius: var(--pill); opacity: .85;
}
.topnav .links a:hover { opacity: 1; background: rgba(188, 236, 221, .12); }
.topnav .links a.active, .topnav .links a[aria-current="page"] { opacity: 1; background: var(--mint); color: var(--navy); }
.topnav .spacer { flex: 1; }
.topnav .nav-actions { display: flex; align-items: center; gap: .5rem; }
.menu-toggle { display: none; background: rgba(255, 255, 255, .12); color: #fff; border: 0; border-radius: var(--pill); min-height: 44px; padding: 0 1em; font-weight: 800; cursor: pointer; font-family: inherit; }
/* Narrow screens: links fold into a menu instead of scrolling sideways. */
@media (max-width: 900px) {
  .topnav { flex-wrap: wrap; }
  .menu-toggle { display: inline-flex; align-items: center; gap: .4em; }
  .topnav .links, .topnav .nav-actions.collapsible { display: none; width: 100%; order: 5; flex-direction: column; align-items: stretch; margin: .3rem 0 0; gap: .15rem; }
  .topnav.open .links, .topnav.open .nav-actions.collapsible { display: flex; }
  .topnav .links a { padding: .8em 1em; border-radius: var(--radius); font-size: 1rem; }
  .topnav .nav-actions.collapsible .btn { width: 100%; }
  .topnav .nav-actions.keep .hide-narrow { display: none; }
}

/* ---------- Cards / layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  color: var(--navy);
}
.center-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  text-align: center;
}
.pin-card { width: min(380px, 100%); padding: 1.25rem; display: grid; gap: .75rem; }

/* ---------- Answer cards & letter badges ----------
   Wimzi answers are light "ticket" cards: a lettered badge in the answer colour, the text in navy,
   and a coloured rail on the left. They are deliberately not solid colour blocks with shapes. */
.a0 { --ac: var(--a0); --aci: var(--a0-ink); }
.a1 { --ac: var(--a1); --aci: var(--a1-ink); }
.a2 { --ac: var(--a2); --aci: var(--a2-ink); }
.a3 { --ac: var(--a3); --aci: var(--a3-ink); }
.a4 { --ac: var(--a4); --aci: var(--a4-ink); }
.a5 { --ac: var(--a5); --aci: var(--a5-ink); }
.a0, .a1, .a2, .a3, .a4, .a5 { background: var(--ac); color: var(--aci); }

/* Letter badge: a soft rounded "spark" chip */
.shape {
  width: 1.7em; height: 1.7em; flex: none;
  display: inline-grid; place-items: center;
  border-radius: 38% 62% 45% 55% / 55% 42% 58% 45%;
  background: var(--ac, var(--teal)); color: var(--aci, #fff);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .75);
  font-family: var(--font-display); font-variation-settings: 'SOFT' 100, 'WONK' 1;
  font-weight: 800; line-height: 1;
}
.shape b { font-size: .95em; font-weight: inherit; }

.answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.answers .answer {
  display: flex;
  align-items: center;
  gap: .9rem;
  border: 0;
  border-radius: 22px 22px 22px 6px;
  background: var(--surface);
  color: var(--navy);
  font-weight: 700;
  font-size: clamp(1rem, 2.2vw, 1.45rem);
  padding: .9rem 1.2rem .9rem 1.4rem;
  text-align: left;
  box-shadow: inset 7px 0 0 var(--ac), 0 6px 18px rgba(12, 30, 41, .18);
  min-height: 76px;
  position: relative;
  overflow-wrap: anywhere;
}
.answers .answer .shape { font-size: 1.15em; box-shadow: none; }
button.answer { cursor: pointer; transition: transform .1s, box-shadow .15s, background .15s; font-family: inherit; }
.answers button.answer:hover { transform: translateY(-2px); box-shadow: inset 7px 0 0 var(--ac), 0 10px 24px rgba(12, 30, 41, .24); }
button.answer:active { transform: scale(.98); }
.answers button.answer.picked { background: var(--ac); color: var(--aci); }
.answers button.answer.picked .shape { background: var(--aci); color: var(--ac); }
.answer .tick { margin-left: auto; font-size: 1.6em; color: var(--ac); }
.answer.dim { opacity: .35; }

/* ---------- Generic screens ---------- */
.screen { display: none; }
.screen.active { display: flex; }
.big-text { font-family: var(--font-display); font-variation-settings: 'SOFT' 100, 'WONK' 1; font-size: clamp(1.8rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.1; }
.mid-text { font-size: clamp(1.05rem, 2.5vw, 1.5rem); font-weight: 700; }
.muted { color: var(--muted); }
.on-stage .muted { color: inherit; opacity: .72; }
.pill {
  display: inline-flex; align-items: center; gap: .4em;
  background: rgba(0, 0, 0, .22); color: inherit;
  padding: .4em .95em; border-radius: var(--pill); font-weight: 800; font-size: .9rem;
}
.pill.light { background: var(--white); color: var(--navy); }
.pill.mint { background: var(--highlight); color: var(--highlight-ink); }
.badge {
  display: inline-flex; align-items: center; gap: .35em; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  background: var(--mint-50); color: var(--teal-700); padding: .3em .65em; border-radius: var(--pill);
}
.eyebrow { font-size: .78rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }

/* ---------- Spinner ---------- */
.spinner {
  width: 64px; height: 64px; border-radius: 50%;
  border: 7px solid rgba(255, 255, 255, .2); border-top-color: var(--accent);
  animation: spin 1s linear infinite; margin: 1rem auto;
}
.spinner.dark { border-color: var(--line); border-top-color: var(--teal); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.06); } 100% { transform: scale(1); opacity: 1; } }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulse { 50% { transform: scale(1.08); } }
@keyframes twinkle { 0%, 100% { transform: rotate(0) scale(1); } 50% { transform: rotate(45deg) scale(1.15); } }
.pop { animation: pop .45s cubic-bezier(.2, .9, .3, 1.3) both; }
.rise { animation: rise .5s ease both; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--navy); color: var(--white); padding: .85em 1.3em; border-radius: var(--pill);
  font-weight: 700; box-shadow: var(--shadow-lg); opacity: 0; transition: .25s; z-index: 100;
  max-width: calc(100% - 32px); text-align: center; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.error { background: var(--red); }

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(12, 30, 41, .6); display: flex; align-items: center;
  justify-content: center; z-index: 50; padding: 16px;
}
.modal { width: min(560px, 100%); max-height: 90vh; overflow: auto; }
.modal.wide { width: min(860px, 100%); }
.modal h2 { font-size: 1.7rem; }

/* ---------- Confetti canvas ---------- */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

/* ---------- Timer ring ---------- */
.timer {
  width: 96px; height: 96px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 2.2rem; font-weight: 800;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .2);
}
.timer.urgent { background: var(--a0); color: var(--a0-ink); animation: pulse .5s infinite; }

/* ---------- Reactions ---------- */
.react-bar { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 1.2rem; }
.react-bar button { font-size: 1.6rem; width: 54px; height: 54px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); cursor: pointer; transition: transform .1s; }
.react-bar button:active { transform: scale(.85); }
.react-bar button:disabled { opacity: .4; }
.reaction-float { position: fixed; bottom: 70px; font-size: 2.6rem; pointer-events: none; z-index: 40; animation: floatUp 3.2s ease-out forwards; text-align: center; }
.reaction-float small { display: block; font-size: .8rem; font-weight: 800; background: rgba(0, 0, 0, .35); color: #fff; border-radius: 99px; padding: .1em .6em; }
@keyframes floatUp { 0% { transform: translateY(0) scale(.6); opacity: 0; } 10% { opacity: 1; transform: translateY(-20px) scale(1); } 100% { transform: translateY(-60vh) scale(1.1); opacity: 0; } }

/* ---------- Word cloud ---------- */
.cloud { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .2em .7em; max-width: 1000px; margin: auto; padding: 1rem; line-height: 1.1; }
.cloud span { font-family: var(--font-display); font-weight: 800; font-variation-settings: 'SOFT' 100, 'WONK' 1; animation: pop .5s both; }

/* ---------- Pin answer image ---------- */
/* The wrapper's width comes from the image's aspect ratio (set inline), so images without
   an intrinsic size, like many SVGs, still show, and pins line up with the picture exactly. */
.pin-wrap { position: relative; display: block; margin: 0 auto; max-width: 100%; line-height: 0; border-radius: var(--radius); overflow: hidden; touch-action: manipulation; }
.pin-wrap img { display: block; width: 100%; height: auto; }
.pin-wrap .target { position: absolute; border-radius: 50%; border: 4px solid #fff; background: rgba(62, 142, 87, .45); box-shadow: 0 0 0 3px rgba(0, 0, 0, .35); transform: translate(-50%, -50%); pointer-events: none; }
.pin-wrap .dot { position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; transform: translate(-50%, -50%); background: var(--coral); pointer-events: none; }
.pin-wrap .dot.ok { background: var(--leaf); }
.pin-wrap .marker { position: absolute; width: 34px; height: 34px; transform: translate(-50%, -100%); pointer-events: none; font-size: 34px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); }

/* ---------- Accessibility helpers ---------- */
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 200; background: var(--navy); color: #fff; padding: .7em 1.1em; border-radius: var(--radius); font-weight: 800; text-decoration: none; }
.skip-link:focus { top: 8px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.on-stage :focus-visible { outline-color: var(--mint); }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 14px; }
.form-row { display: grid; gap: 6px; }
.form-row .hint { font-size: .82rem; color: var(--muted); margin: 0; font-weight: 600; }
.field-error { color: var(--red); font-size: .85rem; font-weight: 700; margin: 0; }
.input[aria-invalid="true"] { border-color: var(--red); }
.form-alert { border-radius: var(--radius); padding: .8em 1em; font-weight: 700; margin: 0; }
.form-alert.error { background: #FDECEA; color: #8B2117; }
.form-alert.ok { background: var(--mint-50); color: var(--teal-700); }
.form-alert.info { background: #FFF6E0; color: #6B4700; }
.form-alert:empty { display: none; }
textarea.input { resize: vertical; min-height: 6em; }

/* ---------- Status banners (connection, saving) ---------- */
.conn-banner { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 90; background: #FFF6E0; color: #5A3D00; border-radius: var(--pill); padding: .55em 1.2em; font-weight: 800; box-shadow: var(--shadow-lg); display: flex; gap: .5em; align-items: center; max-width: calc(100% - 24px); }
.conn-banner.bad { background: #FDECEA; color: #8B2117; }
.conn-banner .dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; animation: pulse 1s infinite; flex: none; }
.save-state { display: inline-flex; align-items: center; gap: .45em; font-weight: 800; font-size: .85rem; padding: .35em .8em; border-radius: var(--pill); background: rgba(255,255,255,.12); white-space: nowrap; }
.save-state[data-state="saved"]::before { content: '✓'; }
.save-state[data-state="saving"]::before { content: ''; width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .8s linear infinite; }
.save-state[data-state="dirty"]::before { content: '●'; color: var(--sun); }
.save-state[data-state="error"] { background: var(--red); color: #fff; }
.save-state[data-state="error"]::before { content: '!'; }

/* ---------- Empty / loading / error states ---------- */
.state-box { text-align: center; padding: 2.5rem 1.2rem; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.state-box h3 { font-size: 1.3rem; margin-bottom: .3em; }
.state-box p { color: var(--muted); max-width: 46ch; margin: 0 auto 1rem; line-height: 1.5; }
.state-box.error { background: #FDECEA; color: #8B2117; }
.state-box.upgrade { background: var(--mint); }
.state-box.upgrade p { color: var(--navy); }
.skeleton { background: linear-gradient(90deg, var(--cream-200), #fff, var(--cream-200)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); min-height: 60px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Tables ---------- */
.table-wrap { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data th, .data td { padding: .7em .9em; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); white-space: nowrap; }
.data tr:last-child td { border-bottom: 0; }

/* ---------- Site footer ---------- */
.site-footer { background: var(--navy); color: var(--cream); padding: 40px 0 28px; margin-top: 60px; }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; }
.site-footer h4 { font-family: var(--font-body); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--mint); margin: 0 0 .7em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45em; }
.site-footer a { color: var(--cream); text-decoration: none; font-weight: 600; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .fine { margin-top: 28px; font-size: .82rem; opacity: .7; }
@media (max-width: 760px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } }

/* ---------- Content pages (help, legal, security) ---------- */
.doc { max-width: 760px; margin: 0 auto; padding: 40px clamp(16px, 4vw, 40px) 20px; line-height: 1.65; }
.doc h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.doc h2 { font-size: 1.5rem; margin-top: 1.8em; }
.doc h3 { font-size: 1.15rem; margin-top: 1.4em; font-family: var(--font-body); font-variation-settings: normal; font-weight: 800; }
.doc .draft-note { background: #FFF6E0; color: #5A3D00; border-radius: var(--radius); padding: .9em 1.1em; font-weight: 600; }
.doc table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: .92rem; }
@media (max-width: 760px) { .doc table { display: block; overflow-x: auto; } } /* wide tables scroll inside themselves */
.doc th, .doc td { border-bottom: 1px solid var(--line); padding: .5em .6em; text-align: left; vertical-align: top; }

/* ---------- Workspace header ---------- */
.app-nav .ws-switch, .app-nav .ws-name { background: rgba(255,255,255,.1); color: #fff; border: 0; border-radius: var(--pill); padding: .5em .9em; font-weight: 700; font-family: inherit; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-nav .ws-switch option { color: var(--navy); }
.page { padding-top: 28px; padding-bottom: 60px; } /* side gutters come from .wrap */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin: 0; }
.page-head p { margin: .3em 0 0; color: var(--muted); }
