/* Debate: the section's own styles. Colours and type follow the site
   (public/assets/site.css): paper and ink, pine green, a bronze rule. */


:root {
  --bg: #f6f4ee;
  --page: #ffffff;
  --page-2: #ffffff;
  --panel: #faf9f5;
  --panel-raised: #ffffff;
  --line: #dedad0;
  --line-soft: #ebe8e0;
  --text: #1a1d1a;
  --muted: #4a514b;
  --faint: #737a74;

  --terracotta: #1f3a2c;
  --terracotta-bright: #2c5240;
  --ochre: #9a7438;
  --ochre-bright: #7d5e2d;
  --olive: #2f6b3f;
  --olive-text: #2f6b3f;
  --cinnabar: #a3321f;
  --stone: #4f6470;

  --font-inscription: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 4px;

  --meander: none;
  --grain: none;
  color-scheme: light;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { min-height: 100vh; }
body {
  font-family: var(--font-body);
  color: var(--text);
  line-height: 1.6;
  background: var(--grain), radial-gradient(ellipse at 50% 25%, #f6f4ee, transparent 65%),
    radial-gradient(ellipse at 50% 120%, #f6f4ee, transparent 60%), var(--bg);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a { color: var(--terracotta); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 2px; }
::selection { background: var(--terracotta); color: var(--page); }
code { font-family: var(--mono); font-size: 0.9em; background: var(--panel); border: 1px solid var(--line-soft); padding: 0 5px; border-radius: var(--radius); }
b, strong { font-weight: 600; }

/* ---------- top bar ---------- */

.header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
  width: 100%; max-width: 1120px; margin: 0 auto; padding: 18px 24px;
}
.header.narrow-bar { max-width: 760px; }
.logo-section {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-inscription); font-weight: 600; letter-spacing: 0.18em; font-size: 1rem;
  color: var(--text);
}
.logo-section:hover { text-decoration: none; color: var(--ochre-bright); }
.mini-logo { width: 28px; height: 28px; border-radius: 50%; }
.site-name { color: inherit; }
.site-name small {
  font-family: var(--font-inscription); font-size: 0.68rem; letter-spacing: 0.24em;
  color: var(--faint); margin-left: 6px;
}
.header-buttons { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 20px; }
.header-btn {
  color: var(--muted); font-size: 0.88rem; background: none; border: none; padding: 2px 0;
  font-family: inherit; cursor: pointer; white-space: nowrap;
}
.header-btn:hover { color: var(--text); text-decoration: none; }
.header-btn.active { color: var(--terracotta); border-bottom: 1px solid var(--terracotta); }
.user-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.88rem; }
.user-chip img { width: 24px; height: 24px; border-radius: 50%; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--ochre); }

/* ---------- the manuscript page ---------- */

main {
  position: relative;
  width: calc(100% - 24px); max-width: 740px; margin: 6px auto 0;
  background: var(--grain), linear-gradient(180deg, var(--page), var(--page-2));
  border: 1px solid var(--line); outline: 1px solid var(--line); outline-offset: 6px;
  padding: 0 44px 44px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.06), 0 2px 0 rgba(255, 255, 255, 0.4) inset;
}
main.wide { max-width: 1120px; }
main::before, main::after {
  content: ""; display: block; height: 20px; background: var(--meander) repeat-x center;
}
main::before { margin: 24px -16px 0; }
main::after { margin: 36px -16px -20px; transform: scaleY(-1); }

.footer { text-align: center; padding: 2.5rem 1rem; }
.footer p, .footer .copyright {
  font-family: var(--font-inscription); font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted);
}
.footer .policy-note { font-family: var(--font-body); letter-spacing: 0; text-transform: none; font-size: 0.8rem; margin-top: 0.5rem; opacity: 0.85; }
.footer a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- headings ---------- */

.hero { text-align: center; padding: 28px 0 8px; }
.seal-logo {
  width: 104px; height: 104px; display: block; margin: 0 auto 22px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.12)) sepia(0.12);
}
.eyebrow {
  font-family: var(--font-inscription); font-size: 0.72rem; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--ochre); margin: 0 0 12px;
}
h1.title {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(2.4rem, 6vw, 3.4rem);
  line-height: 1.05; margin: 0 0 14px; text-align: center; color: var(--text);
}
h1.title em { font-style: italic; color: var(--terracotta); }
.lede { color: var(--muted); font-size: 1.05rem; max-width: 500px; margin: 0 auto 8px; text-align: center; }

.section-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap;
  margin: 40px 0 14px; padding-top: 22px; border-top: 1px solid var(--line);
}
.section-title h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.7rem; line-height: 1.2; }
.section-title h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 0.85rem; }
.mono, td.mono { font-family: var(--mono); font-size: 0.92em; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }
.hidden { display: none !important; }

/* ---------- panels ---------- */

.card {
  position: relative;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 16px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 4px 14px rgba(0, 0, 0, 0.03);
}
.card::before {
  content: ""; position: absolute; left: 26px; right: 26px; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--terracotta), transparent); opacity: 0.45;
}
.card.center { text-align: center; }
.card h1 { font-family: var(--font-display); font-weight: 600; font-size: 2rem; line-height: 1.15; margin-bottom: 6px; }
.card h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; line-height: 1.2; margin-bottom: 6px; }
.card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; margin-bottom: 4px; }
.card p { color: var(--muted); }
.card p b { color: var(--text); }
/* tables and the setup box sit flush in their card */
.card.table-wrap::before { display: none; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.01em;
  padding: 12px 24px; border-radius: var(--radius); cursor: pointer; text-decoration: none;
  background: transparent; color: var(--terracotta); border: 1.5px solid var(--terracotta);
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--terracotta); color: var(--page); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:disabled:hover { background: transparent; color: var(--terracotta); }
.btn.green { color: var(--olive-text); border-color: var(--olive); }
.btn.green:hover { background: var(--olive); color: var(--page); }
.btn.red { color: var(--cinnabar); border-color: var(--cinnabar); }
.btn.red:hover { background: var(--cinnabar); color: var(--page); }
.btn.ghost { color: var(--muted); border-color: var(--line); border-width: 1px; }
.btn.ghost:hover { background: var(--panel); color: var(--text); border-color: var(--ochre); }
.btn.small { padding: 6px 12px; font-size: 0.82rem; }
.btn.big { padding: 14px 30px; font-size: 1rem; }
/* the Discord glyph is white; tint it to match the button text */
.btn img { width: 18px; height: 18px; filter: brightness(0) saturate(100%) invert(26%) sepia(76%) saturate(1620%) hue-rotate(352deg) brightness(91%); }
.btn:hover img { filter: brightness(0) invert(1); }
.btn.green img { filter: brightness(0) saturate(100%) invert(38%) sepia(28%) saturate(840%) hue-rotate(43deg) brightness(92%); }
.btn.green:hover img { filter: brightness(0) invert(1); }

/* big medal at the top of a status card (replaces emoji) */
.medal {
  width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-inscription); font-weight: 600; font-size: 1.6rem; color: var(--terracotta);
  background: #eef1ec; border: 2px solid var(--terracotta);
  box-shadow: inset 0 0 0 4px #eef1ec, inset 0 0 0 5px var(--terracotta);
}
.medal.ok { color: var(--olive-text); border-color: var(--olive); background: #e3e2bf; box-shadow: inset 0 0 0 4px #e3e2bf, inset 0 0 0 5px var(--olive); }
.medal.small-text { font-size: 1.15rem; }
.big-emoji { font-size: 44px; line-height: 1; margin-bottom: 10px; }

/* ---------- forms ---------- */

label.field, .field { display: block; margin-bottom: 18px; }
label.field > span, .field > span { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.95rem; }
label.field > small { display: block; color: var(--faint); margin-top: 6px; font-size: 0.82rem; }
input[type=text], input[type=search], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; padding: 11px 13px; border-radius: var(--radius); font: inherit; font-size: 0.95rem; color: var(--text);
  background: #ffffff; border: 1px solid var(--line);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--terracotta); box-shadow: 0 0 0 3px rgba(31, 58, 44, 0.14); outline: none; }
textarea { min-height: 80px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #9aa09b; }
input[type=checkbox] { accent-color: var(--terracotta); }

.yesno { display: flex; gap: 10px; }
.yesno label {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; position: relative;
  padding: 11px; border-radius: var(--radius); border: 1px solid var(--line); background: #ffffff;
  cursor: pointer; font-weight: 600; transition: background 0.15s, border-color 0.15s;
}
.yesno input { position: absolute; opacity: 0; pointer-events: none; }
.yesno label:has(input:checked) { border-color: var(--terracotta); background: #e7eee9; box-shadow: inset 0 0 0 1px var(--terracotta); }
.yesno label:has(input:focus-visible) { outline: 2px solid var(--terracotta); outline-offset: 2px; }
.yesno .emoji { font-size: 18px; }

.choice-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 18px; }
.choice-tabs button {
  padding: 13px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: #ffffff;
  color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-align: left;
}
.choice-tabs button small { display: block; color: var(--faint); font-weight: 400; font-size: 0.82rem; margin-top: 2px; }
.choice-tabs button[aria-pressed=true] { border-color: var(--terracotta); background: #e7eee9; box-shadow: inset 0 0 0 1px var(--terracotta); }
.choice-tabs button[aria-pressed=true]::before { content: "◆ "; color: var(--terracotta); font-size: 0.7em; vertical-align: 2px; }

.form-error {
  border-left: 3px solid var(--cinnabar); background: #fbeeec; color: #7a2020;
  padding: 10px 14px; border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 14px; font-size: 0.92rem;
}

/* ---------- notices ---------- */

.notice {
  border-left: 3px solid var(--ochre); background: var(--panel);
  padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 18px; color: var(--muted);
}
.notice strong { display: block; color: var(--text); font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; margin-bottom: 2px; }
.notice.good { border-color: var(--olive); background: #ecebd0; }
.notice.warn { border-color: var(--ochre); background: #f1efe8; }
.notice.bad { border-color: var(--cinnabar); background: #f6ebe8; }

.invite-box {
  margin: 20px auto; max-width: 440px; padding: 16px 18px; border-radius: var(--radius);
  background: #ffffff; border: 1px solid var(--line); outline: 1px solid var(--line-soft); outline-offset: 3px;
}
.invite-url { font-family: var(--mono); color: var(--terracotta); font-size: 1.2rem; font-weight: 500; word-break: break-all; }
.countdown { font-variant-numeric: tabular-nums; }
.server-address { font-family: var(--mono); color: var(--terracotta); font-size: 1.5rem; font-weight: 500; }

/* ---------- badges (same as omnarch.com's) ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-inscription); font-size: 0.64rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; background: transparent;
}
.badge.green { color: var(--olive-text); border-color: #7d9450; }
.badge.amber { color: var(--ochre-bright); border-color: #a8783f; }
.badge.red { color: var(--cinnabar); border-color: #b5524b; }
.badge.blue { color: var(--terracotta); border-color: var(--terracotta); }
.badge.grey { color: var(--faint); border-color: var(--line); }
.tabs .badge, .header-btn .badge { margin-left: 4px; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 50;
  background: var(--text); color: var(--page); border-radius: var(--radius); padding: 11px 18px;
  box-shadow: 0 10px 30px rgba(20, 24, 21, 0.3); max-width: calc(100% - 32px); font-size: 0.92rem;
}
.toast.bad { background: var(--cinnabar); }

.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--terracotta); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =====================================================================
   debate-only
   ===================================================================== */

input[type=email], input[type=password] {
  width: 100%; padding: 11px 13px; border-radius: var(--radius); font: inherit; font-size: 0.95rem; color: var(--text);
  background: #ffffff; border: 1px solid var(--line);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn.block { width: 100%; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.link-btn { background: none; border: none; padding: 0; font: inherit; color: var(--terracotta); cursor: pointer; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* the sign-in panel */
.auth-card { max-width: 440px; margin: 28px auto 0; }
.omnarch-btn { width: 100%; padding: 13px 18px; }
.omnarch-btn .avatar { width: 22px; height: 22px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.omnarch-btn .seal { width: 22px; height: 22px; border-radius: 50%; }
.omnarch-hint { text-align: center; font-size: 0.82rem; color: var(--faint); margin-top: 8px; }

.divider {
  display: flex; align-items: center; gap: 14px; margin: 22px 0 18px;
  font-family: var(--font-inscription); font-size: 0.66rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--faint);
}
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* Sign in / Create account switch */
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; overflow: hidden; }
.auth-tabs button {
  padding: 10px 8px; border: none; background: #ffffff; color: var(--muted); cursor: pointer;
  font-family: var(--font-inscription); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
}
.auth-tabs button + button { border-left: 1px solid var(--line); }
.auth-tabs button[aria-selected=true] { background: #e7eee9; color: var(--terracotta); box-shadow: inset 0 -2px 0 var(--terracotta); }
.auth-tabs button:focus-visible { outline-offset: -3px; }
.field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.field-row a { font-size: 0.82rem; font-weight: 400; }
.fine { font-size: 0.8rem; color: var(--faint); text-align: center; margin-top: 14px; }

/* signed-in landing */
.welcome-card { text-align: center; padding: 34px 26px; margin-top: 26px; }
.welcome-card .medal { margin-bottom: 14px; }

/* account page */
.method { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.method .icon {
  width: 46px; height: 46px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-inscription); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.04em; color: var(--muted);
  background: #eef1ec; border: 1.5px solid var(--line); overflow: hidden;
}
.method .icon.on { border-color: var(--olive); color: var(--olive-text); background: #e3e2bf; }
.method .icon img { width: 100%; height: 100%; object-fit: cover; }
.method .body { flex: 1; min-width: 200px; }
.method .body h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.method .sub { color: var(--muted); font-size: 0.92rem; word-break: break-all; }
.method .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.inline-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.inline-form .row-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.confirm-link { border-color: var(--terracotta); }

/* avatars (photo or initials) */
.avatar-img { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; object-fit: cover; }
.avatar-img.initials {
  background: #eef1ec; color: var(--terracotta); font-family: var(--font-inscription); font-weight: 600; letter-spacing: 0.02em;
}
.user-chip .avatar-img { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--ochre); }
.photo-preview .avatar-img { border: 2px solid var(--line); }
.photo-source { margin-bottom: 4px; }
.photo-source label { padding: 8px; font-size: 0.9rem; }
.crop-view { margin-top: 16px; border: 1px solid var(--line); overflow: hidden; touch-action: none; cursor: grab; max-width: 100%; }
.crop-view canvas { display: block; border-radius: 50%; box-shadow: 0 0 0 999px rgba(43, 27, 16, 0.35); }
.crop-view:active { cursor: grabbing; }

/* home: topic + item lists */
.topic-hero .title { font-size: clamp(2rem, 5vw, 2.8rem); }
.topic-switch { display: inline-flex; align-items: center; gap: 10px; margin-top: 12px; }
.topic-switch select { width: auto; max-width: 100%; padding: 7px 10px; font-size: 0.88rem; }
.new-case .side-pick { max-width: 460px; margin-bottom: 12px; flex-wrap: wrap; }
.new-case .side-pick label { flex: 1 1 90px; }
.new-case .side-pick label { padding: 8px; }
.item-list { border: 1px solid var(--line); background: var(--panel-raised); border-radius: var(--radius); }
.item-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 13px 16px; color: var(--text);
}
.item-row + .item-row { border-top: 1px solid var(--line-soft); }
.item-row:hover { background: var(--panel); text-decoration: none; }
.item-title { flex: 1; min-width: 140px; font-weight: 600; }
.item-meta { color: var(--faint); font-size: 0.82rem; display: inline-flex; align-items: center; gap: 6px; }
.empty { padding: 6px 2px 4px; }
.side-tag {
  display: inline-block; min-width: 42px; text-align: center; padding: 2px 6px; border-radius: var(--radius);
  font-family: var(--font-inscription); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em; color: var(--text);
}
.side-tag.aff { background: #d9ead3; border: 1px solid #a9c79c; }
.side-tag.neg { background: #f5cbcc; border: 1px solid #d99a9c; }
.side-tag.big { font-size: 0.9rem; vertical-align: middle; padding: 4px 10px; }

/* item page */
.item-hero .eyebrow a { color: inherit; }
.share-form { margin-bottom: 8px; }
.share-form select, .share-row select { width: auto; padding: 7px 10px; font-size: 0.88rem; }
.share-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.share-who { flex: 1; min-width: 120px; word-break: break-all; }

/* account: partner invites waiting for an answer */
.card.partner-invites { border-color: var(--terracotta); background: #fbeee0; }

/* admin: site background library */
.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-top: 14px; }
.bg-tile { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.bg-tile.on { border-color: var(--olive); box-shadow: inset 0 0 0 1px var(--olive); }
.bg-thumb { aspect-ratio: 16 / 10; background-color: #1a1d1a; background-position: center; background-repeat: repeat; border-bottom: 1px solid var(--line); }
.bg-thumb.papyrus {
  background: var(--grain), radial-gradient(ellipse at 50% 25%, #f6f4ee, transparent 65%),
    radial-gradient(ellipse at 50% 120%, #f6f4ee, transparent 60%), var(--bg);
}
.bg-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.bg-body .actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: auto; }
.bg-body input.bg-name, .bg-body select { padding: 6px 8px; font-size: 0.88rem; width: 100%; }
.bg-body p { margin: 0; }
.bg-users { display: flex; flex-direction: column; gap: 4px; }
.bg-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.bg-chip { display: inline-flex; align-items: center; gap: 2px; padding: 1px 2px 1px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.82rem; background: var(--page); }
.bg-chip button { border: 0; background: none; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 5px; color: inherit; opacity: 0.6; }
.bg-chip button:hover { opacity: 1; }
.bg-assign { display: flex; gap: 6px; }
.bg-assign input { flex: 1; min-width: 0; padding: 6px 8px; font-size: 0.88rem; }

/* case editor (phase 2) */
.editor-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between;
  margin: 18px 0 10px;
}
.live-status { display: inline-flex; align-items: center; gap: 7px; font-size: 0.82rem; color: var(--muted); }
.live-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.live-status.live::before { background: var(--olive); }
.live-status.connecting::before { background: var(--ochre); animation: pulse 1.2s ease-in-out infinite; }
.live-status.offline { color: var(--cinnabar); }
.live-status.offline::before { background: var(--cinnabar); }
@keyframes pulse { 50% { opacity: 0.3; } }
.people { display: inline-flex; align-items: center; gap: 4px; }
.people .person { position: relative; display: inline-flex; border-radius: 50%; box-shadow: 0 0 0 2px var(--page), 0 0 0 4px var(--ring, var(--line)); }
.people .person + .person { margin-left: 2px; }

.case-editor { border: 1px solid var(--line); background: var(--panel-raised); border-radius: var(--radius); }
.tb {
  position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px;
  background: var(--page-2); border-bottom: 1px solid var(--line);
}
.tb[hidden] { display: none; }
.tb-group { display: inline-flex; gap: 2px; padding-right: 6px; border-right: 1px solid var(--line-soft); }
.tb-group:last-child { border-right: 0; }
.tb-btn {
  min-width: 32px; height: 30px; padding: 0 8px; border: 1px solid transparent; border-radius: var(--radius);
  background: transparent; color: var(--text); font: 500 0.82rem var(--font-body); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.tb-btn:hover { background: var(--panel); border-color: var(--line-soft); }
.tb-btn.on { background: var(--panel); border-color: var(--terracotta); color: var(--terracotta); }
.tb-swatch { width: 16px; height: 16px; border: 1px solid rgba(0, 0, 0, 0.25); border-radius: 2px; background: var(--swatch); }
.tb-swatch.none { background: linear-gradient(135deg, transparent 45%, var(--cinnabar) 45%, var(--cinnabar) 55%, transparent 55%), #fff; }

.ed-surface { padding: 22px 26px 40px; min-height: 420px; }
.ed-doc { outline: none; min-height: 380px; font-family: Calibri, Carlito, var(--font-body); font-size: 1rem; line-height: 1.5; color: #1b1209; }
.ed-doc > * + * { margin-top: 0.45em; }
.ed-doc h1 { font-size: 1.7rem; font-weight: 700; text-align: center; border-bottom: 2px solid var(--line); padding-bottom: 4px; margin-top: 1em; }
.ed-doc h2 { font-size: 1.4rem; font-weight: 700; text-align: center; margin-top: 0.9em; }
.ed-doc h3 { font-size: 1.2rem; font-weight: 700; text-decoration: underline; margin-top: 0.8em; }
.ed-doc h4 { font-size: 1.05rem; font-weight: 700; margin-top: 0.7em; }
.ed-doc h1:first-child, .ed-doc h2:first-child, .ed-doc h3:first-child, .ed-doc h4:first-child { margin-top: 0; }
.ed-doc ul, .ed-doc ol { padding-left: 1.6em; }
.ed-doc blockquote { border-left: 3px solid var(--line); padding-left: 12px; color: var(--muted); }
.ed-doc mark { color: inherit; padding: 0; border-radius: 0; }
.ed-doc a { text-decoration: underline; }
.ed-doc p.is-editor-empty:first-child::before { content: attr(data-placeholder); color: var(--faint); float: left; height: 0; pointer-events: none; }
.ed-doc[contenteditable="false"] { cursor: default; }
.ed-doc ::selection { background: rgba(166, 63, 26, 0.25); color: inherit; }

/* other people's carets (from @tiptap/extension-collaboration-caret) */
.collaboration-carets__caret {
  position: relative; margin-left: -1px; margin-right: -1px; border-left: 1px solid; border-right: 1px solid;
  word-break: normal; pointer-events: none;
}
.collaboration-carets__label {
  position: absolute; top: -1.35em; left: -1px; padding: 1px 5px; border-radius: 3px 3px 3px 0;
  font: 600 0.7rem/1.3 var(--font-body); color: #fff; white-space: nowrap; user-select: none; pointer-events: none;
}

@media (max-width: 720px) {
  .ed-surface { padding: 16px 14px 28px; }
  .tb { gap: 4px; padding: 6px; }
  .tb-group { padding-right: 4px; }
}

/* cards (phase 3) */
.side-tag.cards { background: var(--page-2); border: 1px solid var(--line); }

.dcard {
  position: relative; margin: 14px 0; padding: 10px 14px 12px; border: 1px solid var(--line-soft);
  border-left: 4px solid var(--line); border-radius: var(--radius); background: #fff;
}
.dcard[data-side="aff"] { border-left-color: #8fbf7c; }
.dcard[data-side="neg"] { border-left-color: #d9898c; }
.dcard-head { position: absolute; top: 8px; right: 10px; user-select: none; }
.dcard-side {
  width: auto; padding: 2px 6px; font: 600 0.7rem var(--font-body); letter-spacing: 0.04em;
  border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--panel-raised); color: var(--muted);
}
.dcard-side:disabled { opacity: 1; appearance: none; -webkit-appearance: none; cursor: default; }
.case-editor[data-kind="case"] .dcard-head { display: none; }
.ed-doc .dcard-tag { font-size: 1.05rem; font-weight: 700; margin: 0 92px 2px 0; }
.ed-doc .dcard-cite { font-size: 0.9rem; margin: 0 0 6px; overflow-wrap: anywhere; }
.ed-doc .dcard-body > p + p { margin-top: 0.45em; }
.ed-doc .dcard-tag.is-empty::before, .ed-doc .dcard-cite.is-empty::before {
  content: attr(data-placeholder); color: var(--faint); font-weight: 400; float: left; height: 0; pointer-events: none;
}
/* Filtered card file: only that side's cards show. */
.case-editor[data-filter] .ed-doc > :not(.dcard) { display: none; }
.case-editor[data-filter="aff"] .ed-doc > .dcard:not([data-side="aff"]),
.case-editor[data-filter="neg"] .ed-doc > .dcard:not([data-side="neg"]),
.case-editor[data-filter="unsorted"] .ed-doc > .dcard:not([data-side="unsorted"]) { display: none; }

.card-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.card-tabs { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card-tab {
  border: 0; border-right: 1px solid var(--line-soft); background: var(--panel-raised); color: var(--muted);
  font: 500 0.82rem var(--font-body); padding: 7px 12px; cursor: pointer;
}
.card-tab:last-child { border-right: 0; }
.card-tab .n { color: var(--faint); font-size: 0.75rem; margin-left: 2px; }
.card-tab.on { background: var(--page-2); color: var(--terracotta); box-shadow: inset 0 -2px 0 var(--terracotta); }
.card-index { margin-bottom: 12px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--panel-raised); }
.card-index summary { cursor: pointer; padding: 8px 12px; font-size: 0.85rem; color: var(--muted); }
.card-index ol { margin: 0; padding: 0 12px 10px 34px; max-height: 300px; overflow: auto; font-size: 0.88rem; }
.card-index li { padding: 2px 0; }
.card-index .link-btn { color: var(--text); text-align: left; }
.card-empty { margin: 0 0 10px; }
.side-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; background: var(--line); border: 1px solid rgba(0, 0, 0, 0.15); }
.side-dot.aff { background: #d9ead3; } .side-dot.neg { background: #f5cbcc; }

/* PDF import review */
.import-dlg {
  width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--page); color: var(--text);
}
.import-dlg[open] { display: flex; flex-direction: column; }
.import-dlg::backdrop { background: rgba(20, 24, 21, 0.45); }
.imp-head { padding: 16px 20px 6px; }
.imp-head h2 { margin: 0; }
.import-dlg > .notice, .imp-summary, .imp-opt, .imp-progress { margin: 6px 20px; }
.imp-opt { display: flex; gap: 8px; align-items: center; font-size: 0.88rem; color: var(--muted); }
.imp-opt input, .imp-card > input { width: auto; }
.imp-list { flex: 1; overflow: auto; margin: 8px 0 0; padding: 0 20px; border-top: 1px solid var(--line-soft); min-height: 120px; }
.imp-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.imp-card.off .imp-main { opacity: 0.45; }
.imp-card > input { margin-top: 8px; }
.imp-main { flex: 1; min-width: 0; }
.imp-top { display: flex; gap: 8px; align-items: center; }
.imp-top select { width: auto; padding: 5px 8px; font-size: 0.82rem; }
.imp-top input[type="text"] { flex: 1; min-width: 0; padding: 5px 8px; font-weight: 600; font-size: 0.88rem; }
.imp-swatch { flex: none; width: 14px; height: 14px; border: 1px solid rgba(0, 0, 0, 0.25); border-radius: 2px; }
.imp-cite { margin-top: 6px; font-size: 0.82rem; color: var(--muted); overflow-wrap: anywhere; }
.imp-body { margin-top: 4px; font-size: 0.85rem; overflow-wrap: anywhere; }
.imp-warn { margin-top: 4px; font-size: 0.8rem; color: var(--cinnabar); }
.imp-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line-soft); background: var(--page-2); }
@media (max-width: 720px) {
  .ed-doc .dcard-tag { margin-right: 0; }
  .dcard-head { position: static; display: flex; justify-content: flex-end; margin-bottom: 4px; }
  .imp-top { flex-wrap: wrap; }
}

/* flows (phase 4) */
.side-tag.flow { background: #e4ecf2; border: 1px solid #a9bccb; }
.side-tag.pro { background: #d9ead3; border: 1px solid #a9c79c; }
.side-tag.con { background: #f5cbcc; border: 1px solid #d99a9c; }
input[type=date] {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--text); background: var(--panel-raised);
  border: 1px solid var(--line); border-radius: var(--radius);
}

.flow { --pro: #d9ead3; --pro-line: #a9c79c; --con: #f5cbcc; --con-line: #d99a9c; }
.fl-timers {
  position: sticky; bottom: 0; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px;
  padding: 10px 12px; margin-top: 14px; background: var(--page-2); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 -2px 10px rgba(43, 27, 16, 0.06);
}
.flow.timing .fl-timers { box-shadow: 0 -4px 14px rgba(43, 27, 16, 0.14); }
.tm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tm select { width: auto; padding: 6px 8px; font-size: 0.85rem; }
.tm-clock {
  font-family: var(--mono); font-size: 1.7rem; font-weight: 500; font-variant-numeric: tabular-nums;
  min-width: 4.4ch; text-align: center; line-height: 1;
}
.tm-clock.small { font-size: 1.1rem; min-width: 4ch; }
.tm-clock.low { color: var(--ochre-bright); }
.tm-clock.over { color: var(--cinnabar); }
.tm-prep-side { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 8px; border-radius: var(--radius); }
.tm-prep-side.pro { background: var(--pro); } .tm-prep-side.con { background: var(--con); }
.tm-label { font-size: 0.78rem; font-weight: 600; color: var(--muted); }

.fl-head { display: grid; gap: 4px 0; margin-bottom: 14px; }
.fl-head-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.fl-field { flex: 1 1 150px; display: block; }
.fl-field > span, .fl-pick > span, .fl-box > span { display: block; font-size: 0.75rem; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
.fl-field input { padding: 6px 9px; font-size: 0.9rem; }
.fl-pick { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fl-pick > span { margin: 0 4px 0 0; }
.fl-pick label {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; font-size: 0.85rem; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-raised);
}
.fl-pick label.pro:has(input:checked) { background: var(--pro); border-color: var(--pro-line); }
.fl-pick label.con:has(input:checked) { background: var(--con); border-color: var(--con-line); }
.fl-pick input { width: auto; }
.fl-head-row + .fl-head-row { margin-top: 6px; }
.fl-head-row:nth-child(2) { gap: 8px 28px; }

.fl-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.fl-grid { border-collapse: collapse; width: 100%; min-width: calc(76px + 8 * 170px); table-layout: fixed; }
.fl-grid th, .fl-grid td { border: 1px solid var(--line-soft); vertical-align: top; }
.fl-grid thead th { position: sticky; top: 0; }
.fl-corner { width: 76px; background: var(--page-2); }
.fl-colh { padding: 6px 8px; font: 600 0.78rem var(--font-body); text-align: left; color: var(--text); }
.fl-colh span { font-weight: 500; color: var(--muted); }
.fl-colh.pro { background: var(--pro); } .fl-colh.con { background: var(--con); }
.fl-colh.mine { box-shadow: inset 0 -3px 0 var(--terracotta); }
.fl-grid td.now, .fl-colh.now { outline: 2px solid var(--terracotta); outline-offset: -2px; }
.fl-grid td.pro { background: #fbfdfa; } .fl-grid td.con { background: #fffafa; }
.fl-rowh { position: sticky; left: 0; z-index: 1; width: 76px; background: var(--page-2); padding: 4px; text-align: left; }
.fl-rowh input { padding: 4px 6px; font: 700 0.85rem var(--font-body); background: transparent; border-color: transparent; }
.fl-rowh input:hover:not([readonly]) { border-color: var(--line-soft); }
.fl-del {
  display: block; margin-top: 2px; border: 0; background: none; color: var(--faint); font-size: 1rem; line-height: 1;
  padding: 2px 6px; cursor: pointer; opacity: 0; 
}
.fl-rowh:hover .fl-del, .fl-del:focus-visible { opacity: 1; }
.fl-del:hover { color: var(--cinnabar); }
.fl-grid textarea, .fl-box textarea {
  display: block; width: 100%; min-height: 64px; resize: none; overflow: hidden; border: 0; border-radius: 0;
  background: transparent; padding: 6px 7px; font: 0.84rem/1.4 var(--font-body); color: #1b1209;
}
.fl-grid textarea:focus, .fl-box textarea:focus { box-shadow: inset 0 0 0 2px rgba(31, 58, 44, 0.35); }
.fl-empty { padding: 24px; text-align: center; color: var(--faint); }
/* how long each speech ran, at the foot of its column */
.fl-times th, .fl-times td { border-top: 2px solid var(--line); }
.fl-times th { font: 700 0.78rem var(--font-body); color: var(--muted); padding: 6px 10px; }
.fl-times td { padding: 5px 8px; font: 500 0.85rem var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); }
.fl-times .over, .fl-cx-time.over { color: var(--cinnabar); }
.fl-times td { white-space: nowrap; }
.fl-grid .fl-times input.fl-time-in {
  width: 5.6ch; min-width: 0; height: auto; box-shadow: none; padding: 2px 3px; border: 1px solid transparent; border-radius: 3px; background: transparent;
  font: inherit; color: var(--text); text-align: right;
}
.fl-grid .fl-times input.fl-time-in:not([readonly]):hover { border-color: var(--line-soft); }
.fl-grid .fl-times input.fl-time-in:not([readonly]):focus { border-color: var(--terracotta); background: #fff; outline: none; }
.fl-grid .fl-times input.fl-time-in[readonly] { cursor: default; }
.fl-grid .fl-times input.fl-time-in.bad { border-color: var(--cinnabar); background: #fdecec; }
.fl-time-of { margin-left: 3px; }
.fl-cx-time { float: right; font: 500 0.78rem var(--mono); font-variant-numeric: tabular-nums; }
.fl-under { margin: 8px 0 18px; min-height: 4px; }
.fl-h { font: 600 1.2rem var(--font-display); margin: 0 0 6px; color: var(--text); }
.fl-cx-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.fl-box { display: block; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 6px 4px 0; }
.fl-box > span { padding: 0 6px; }
.fl-notes .fl-box > span.fl-h { font-size: 1.2rem; color: var(--text); }
.fl-notes textarea { min-height: 110px; font-size: 0.92rem; }
/* someone else is in this box */
.peer-focus { position: relative; box-shadow: inset 0 0 0 2px var(--peer); }
.peer-focus::after {
  content: attr(data-peer); position: absolute; top: -1px; right: -1px; padding: 0 5px; z-index: 2;
  font: 600 0.65rem/1.5 var(--font-body); color: #fff; background: var(--peer); border-radius: 0 0 0 3px; pointer-events: none;
}

.ballot-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ballot-win { font: 600 1.4rem var(--font-display); }
.ballot-meta { margin-top: 4px; font-size: 0.88rem; }
.card p.ballot-reason { margin-top: 10px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.ballot-pick { max-width: 260px; }
.ballot-pick label { padding: 8px; }
.ballot-fields { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 0 12px; }
.record { margin: 0 2px 10px; color: var(--muted); }
.record b { color: var(--text); font-size: 1.1rem; }
.wl {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%;
  font: 600 0.8rem var(--font-inscription); border: 1px solid var(--line); color: var(--faint);
}
.wl.won { color: var(--olive-text); border-color: var(--olive); background: #e3e2bf; }
.wl.lost { color: var(--cinnabar); border-color: #b5524b; background: #f6ebe8; }

@media (max-width: 720px) {
  .fl-timers { padding: 8px; gap: 8px; }
  .tm-clock { font-size: 1.4rem; }
  .fl-cx-grid, .ballot-fields { grid-template-columns: 1fr; }
  .fl-grid { min-width: calc(64px + 8 * 150px); }
  .fl-corner, .fl-rowh { width: 64px; }
  .fl-del { opacity: 1; }
}

/* AI card suggestions on flows (phase 5) */
.fl-suggest { margin: 0 0 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-raised); }
.fl-suggest[hidden] { display: none; }
.sg-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.sg-head .fl-h { margin: 0; }
.sg-row { display: grid; grid-template-columns: minmax(160px, 1fr) 2.2fr; gap: 6px 16px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.sg-q { font-size: 0.85rem; color: var(--muted); overflow-wrap: anywhere; }
.sg-q b { color: var(--text); margin-right: 4px; }
.sg-note { margin: 2px 0; font-size: 0.85rem; color: var(--faint); }
.sg-note.bad { color: var(--cinnabar); }
.spinner.small { width: 12px; height: 12px; border-width: 2px; }
.sg-card { border: 1px solid var(--line-soft); border-radius: var(--radius); background: #fff; margin-bottom: 6px; }
.sg-card summary { cursor: pointer; padding: 7px 10px; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 0.88rem; }
.sg-card summary::-webkit-details-marker { display: none; }
.sg-card summary::before { content: '▸'; color: var(--faint); font-size: 0.75rem; }
.sg-card[open] summary::before { content: '▾'; }
.sg-tag { font-weight: 600; flex: 1 1 200px; }
.sg-type {
  font: 600 0.68rem var(--font-body); text-transform: uppercase; letter-spacing: 0.06em; color: var(--terracotta);
  border: 1px solid var(--terracotta); border-radius: var(--radius); padding: 0 5px;
}
.sg-why { flex-basis: 100%; color: var(--muted); font-size: 0.84rem; padding-left: 16px; }
.sg-cite { padding: 0 12px; font-size: 0.8rem; color: var(--muted); overflow-wrap: anywhere; }
.sg-body { padding: 6px 12px; font-size: 0.86rem; white-space: pre-wrap; overflow-wrap: anywhere; font-family: Calibri, Carlito, var(--font-body); }
.sg-open { display: inline-block; padding: 0 12px 8px; font-size: 0.82rem; }
.sg-fine { margin-top: 8px; }
.side-dot.unsorted { background: var(--page-2); }
@media (max-width: 720px) { .sg-row { grid-template-columns: 1fr; } }

/* admin */
.topic-card.live { border-color: var(--olive); }
.topic-card h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
label.check { display: flex; gap: 8px; align-items: center; font-size: 0.92rem; color: var(--muted); }

@media (max-width: 720px) {
  main { padding: 0 18px 32px; outline-offset: 4px; }
  main::before, main::after { margin-left: -6px; margin-right: -6px; }
  .header { padding: 14px 16px; }
  .card { padding: 20px 16px; }
  .card::before { left: 16px; right: 16px; }
  .eyebrow { font-size: 0.62rem; letter-spacing: 0.16em; }
  .inline-form .row-fields { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .site-name small { display: none; }
  .user-chip span { display: none; }
}

/* ---------- phase 6: tournaments, quick add, speech pop-ups ---------- */

.quick-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.quick-eyebrow { margin: 0; text-transform: uppercase; letter-spacing: 0.08em; }
.quick-next { margin: 2px 0; font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; }
.quick-top p { margin: 0; }
.quick-name { margin-top: 14px; max-width: 480px; }
.quick-people { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.quick-people p { margin: 0 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; font-size: 0.85rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
}
.chip button { border: 0; background: none; color: var(--faint); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 5px; }
.chip button:hover { color: var(--cinnabar); }

.flow-search { margin: 4px 0 10px; }
.flow-search input { width: 100%; }
.tourney { margin-bottom: 10px; }
.tourney > summary {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); list-style: none;
}
.tourney > summary::-webkit-details-marker { display: none; }
.tourney > summary::before { content: '▸'; color: var(--faint); transition: transform 0.15s; }
.tourney[open] > summary::before { transform: rotate(90deg); }
.tourney[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.tourney-label { font-weight: 700; flex: 1; min-width: 120px; }
.tourney > .item-list { border-top: 0; }

/* your side's speech cells: same look, opens a pop-up */
.fl-grid td.fl-speechcell { cursor: pointer; }
.fl-grid textarea.fl-speech { cursor: pointer; }
.fl-grid textarea.fl-speech::placeholder { color: var(--faint); font-style: italic; }
.fl-grid td.fl-speechcell:hover { box-shadow: inset 0 0 0 1px rgba(31, 58, 44, 0.35); }

.sp-dlg {
  width: min(1180px, calc(100vw - 32px)); height: min(820px, calc(100vh - 48px)); padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--page); color: var(--text);
}
.sp-dlg[open] { display: flex; flex-direction: column; }
.sp-dlg::backdrop { background: rgba(20, 24, 21, 0.45); }
.sp-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); }
.sp-head h2 { margin: 0; flex: 1; font-size: 1.25rem; }
.sp-head { flex-wrap: wrap; }
.sp-timer { gap: 6px; }
.sp-timer:empty { display: none; }
.sp-timer .tm-clock { font-size: 1.35rem; }
.sp-timer .tm-clock.small { font-size: 1rem; }
.sp-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr; }
.sp-dlg.with-index .sp-body { grid-template-columns: minmax(0, 1fr) 340px; }
.sp-main { display: flex; flex-direction: column; min-height: 0; overflow: auto; }
.sp-context { flex: none; margin: 12px 18px 0; padding: 6px 12px; background: var(--panel); border-left: 3px solid var(--line); }
.sp-context > summary { cursor: pointer; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
/* stays small however much the other side said: it scrolls instead */
.sp-context-list { margin: 6px 0 2px; max-height: min(150px, 22vh); overflow: auto; font-size: 0.86rem; }
.sp-context-list dt { font-weight: 700; margin-top: 6px; }
.sp-context-list dt:first-child { margin-top: 0; }
.sp-context-list dd { margin: 1px 0 0; white-space: pre-wrap; }
.sp-used { margin: 8px 0 0; }
.sp-main .tb { position: sticky; top: 0; z-index: 1; margin: 10px 18px 0; }
.sp-surface { flex: 1; padding: 14px 18px 28px; }
.sp-doc { min-height: 100%; outline: none; }
.sp-doc .dcard-head { display: none; }
.sp-doc .dcard-tag { margin-right: 0; }

.sp-index { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line-soft); background: var(--page-2); }
.sp-mode { display: flex; margin: 10px 12px 6px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sp-mode button { flex: 1; padding: 6px 8px; border: 0; background: var(--panel-raised); color: var(--muted); font: 600 0.82rem var(--font-body); cursor: pointer; }
.sp-mode button + button { border-left: 1px solid var(--line); }
.sp-mode button[aria-selected="true"] { background: var(--terracotta); color: var(--page); }
.sp-search { margin: 0 12px 6px; width: auto; padding: 7px 10px; font-size: 0.85rem; }
.sp-list { flex: 1; overflow: auto; padding: 0 12px 16px; }
.sp-group { margin: 12px 0 6px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.sp-card {
  display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; margin-bottom: 6px; padding: 8px 10px;
  background: var(--panel-raised); border: 1px solid var(--line-soft); border-radius: var(--radius); color: var(--text);
  font: 0.84rem/1.35 var(--font-body); cursor: pointer;
}
.sp-card:hover:not(:disabled) { border-color: var(--terracotta); }
.sp-card:disabled { cursor: default; }
.sp-card.busy { opacity: 0.6; cursor: progress; }
.sp-card-tag { font-weight: 700; }
.sp-card-cite, .sp-card-file { font-size: 0.76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-card-cite { color: var(--muted); }
.sp-card-why { font-size: 0.78rem; color: var(--olive-text); }
.sp-card-err { font-size: 0.76rem; color: var(--cinnabar); }
.sp-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--line); vertical-align: 1px; }
.sp-dot.aff { background: #8fbf7c; } .sp-dot.neg { background: #d9898c; }

@media (max-width: 760px) {
  .sp-dlg { width: 100vw; height: 100vh; max-width: none; max-height: none; }
  .sp-dlg.with-index .sp-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 40%); }
  .sp-index { border-left: 0; border-top: 1px solid var(--line-soft); }
}

/* ballot result on the flow list, exports */
.side-tag.won { background: #e3e2bf; border: 1px solid var(--olive); color: var(--olive-text); }
.side-tag.lost { background: #f6ebe8; border: 1px solid #b5524b; color: var(--cinnabar); }
.export-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.export-links .btn { text-decoration: none; }
.tourney-export { display: inline-flex; gap: 10px; }

/* prep: where it was taken (at the foot of the speech it came before) and the by-hand editor */
.fl-prep-at { display: block; font: 600 0.7rem var(--font-body); color: var(--ochre-bright); white-space: normal; }
.fl-prep-at:empty { display: none; }
.fl-cx-grid .fl-prep-at { display: inline; font-size: 0.72rem; }
.tm-prep-edit { padding-left: 8px; padding-right: 8px; }
.tm-prep-edit[aria-expanded="true"] { background: var(--panel-raised); border-color: var(--terracotta); }
.tm-prep-pop { flex-basis: 100%; padding: 8px 10px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel-raised); }
.tm-prep-pop.pro { border-left: 4px solid var(--pro-line); }
.tm-prep-pop.con { border-left: 4px solid var(--con-line); }
.tm-prep-pop-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.tm-prep-pop-top button { margin-left: auto; }
.tm-prep-used { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; }
.tm-prep-pop input.fl-time-in {
  width: 6ch; padding: 3px 5px; font: 500 0.9rem var(--mono); text-align: right;
  border: 1px solid var(--line); border-radius: 3px; background: #fff; color: var(--text);
}
.tm-prep-pop input.fl-time-in[readonly] { background: transparent; border-color: transparent; }
.tm-prep-pop input.fl-time-in.bad { border-color: var(--cinnabar); background: #fdecec; }
.tm-prep-log { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.85rem; }

/* importing a flow sheet (PDF) */
.flow-import { width: min(980px, calc(100vw - 32px)); }
.fi-body { padding-bottom: 12px; }
.fi-h { font: 600 1.05rem var(--font-display); margin: 14px 0 6px; }
.fi-teams { border-collapse: collapse; font-size: 0.88rem; }
.fi-teams th, .fi-teams td { padding: 4px 10px 4px 0; text-align: left; }
.fi-teams th { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.fi-teams select { width: auto; padding: 4px 6px; font-size: 0.85rem; }
.fi-teams input { width: auto; }
.fi-grid-wrap { overflow-x: auto; max-height: 340px; overflow-y: auto; border: 1px solid var(--line-soft); border-radius: var(--radius); }
.fi-grid { border-collapse: collapse; font-size: 0.76rem; min-width: 640px; width: 100%; table-layout: fixed; }
.fi-grid th, .fi-grid td { border: 1px solid var(--line-soft); padding: 3px 5px; vertical-align: top; white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; }
.fi-grid thead th { position: sticky; top: 0; font-size: 0.74rem; }
.fi-grid th:first-child { width: 52px; background: var(--page-2); }
.fi-grid .pro { background: #eef6ea; } .fi-grid .con { background: #fcefef; }
.fi-part { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.fi-part-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-under { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ballot-panel { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 10px; font-size: 0.9rem; }
.ballot-panel input { width: auto; }
.ballot-votes { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 14px; margin-bottom: 8px; }
.ballot-votes .field { width: 130px; }
.ballot-votes[hidden] { display: none; }
.ballot-decision { padding-bottom: 12px; font-weight: 600; }

/* ---- account: contact staff & your data ---- */
.choices { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.choices-head { font-weight: 600; font-size: 0.95rem; margin: 4px 0 6px; }
.choice { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.choice input { margin-top: 4px; accent-color: var(--terracotta); }
#requestForm textarea { width: 100%; }
.req-list { margin-top: 18px; border-top: 1px solid var(--line-soft); }
.req-item { padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.req-item:last-child { border-bottom: none; }
.req-item h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 1.05rem; }
.req-msg { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); margin-top: 6px; }
.req-reply { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 10px; padding: 10px 14px; border-left: 3px solid var(--terracotta); background: var(--panel); }


/* ================================================================== *
 * Site look (paper and ink). Flattens the old manuscript framing; the
 * site bar and footer come from /assets/site-bar.css.
 * ================================================================== */
body { background: var(--bg) !important; }
main {
  background: var(--page); border: 1px solid var(--line); outline: none; box-shadow: none;
  padding: 36px 44px 44px; margin-top: 28px; border-radius: var(--radius);
}
main::before, main::after { display: none; }
@media (max-width: 640px) { main { padding: 24px 18px 32px; width: 100%; border-left: 0; border-right: 0; margin-top: 0; } }
.card { box-shadow: none; }
.card::before { display: none; }
.seal-logo, .mini-logo { display: none; }
.logo-section { font-family: var(--font-display); letter-spacing: 0.02em; font-size: 1.15rem; text-transform: none; }
.site-name small { font-family: var(--font-body); letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.7rem; color: var(--ochre); }
.eyebrow { font-family: var(--font-body); letter-spacing: 0.14em; font-weight: 600; }
h1.title em { color: var(--text); }
.btn { border-width: 1px; }
.btn:hover img { filter: brightness(0) invert(1); }
.footer { display: none; }
::selection { background: #cfe0d5; color: var(--text); }

/* passkeys on the account page */
.pk-list { list-style: none; margin: 10px 0 4px; border-top: 1px solid var(--line-soft); }
.pk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.pk-name { font-weight: 600; }
.pk-row .btn { margin-left: auto; }

/* "I'm 13 or older" on sign-up forms */
.age-box { display: flex; gap: 8px; align-items: center; margin: 4px 0 14px; font-size: 0.92rem; cursor: pointer; }
.age-box input { width: auto; margin: 0; }
