/* mc.omnarch.com — /register, /admin, /admin/audit.
   Matches the omnarch.com sign-in page: papyrus desk, a framed manuscript
   page with Greek-key (meander) bands, Cinzel / Cormorant / Inter, outlined
   terracotta buttons, and the Discord · Roblox · Minecraft seal coins.
   Tokens are the same values as /css/style.css + themes/papyrus-manuscript.css. */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600&family=Cormorant+Garamond:ital,wght@0,500;0,600;1,500&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #e6d2ac;
  --page: #fbf4e5;
  --page-2: #f5ead3;
  --panel: #f8efdc;
  --panel-raised: #fffaf0;
  --line: #d3bb90;
  --line-soft: #e4d3b2;
  --text: #2b1b10;
  --muted: #6c5336;
  --faint: #8f7756;

  --terracotta: #a63f1a;
  --terracotta-bright: #b94b22;
  --ochre: #8c6330;
  --ochre-bright: #7a5224;
  --olive: #5f7a3a;
  --olive-text: #4f6a2c;
  --cinnabar: #9b2c2c;
  --stone: #4f6470;

  --font-inscription: 'Cinzel', 'Trajan Pro', serif;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --radius: 2px;

  --meander: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath d='M0 19H20M19 19V1H5V13H13V7H9' fill='none' stroke='%23a63f1a' stroke-width='1.6' stroke-linecap='square' opacity='.7'/%3E%3C/svg%3E");
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .32 0 0 0 0 .18 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  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%, #efdfbf, transparent 65%),
    radial-gradient(ellipse at 50% 120%, #c4a06a, 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(80, 50, 15, 0.18), 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(90, 50, 15, 0.28)) 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(80, 50, 15, 0.06);
}
.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); }

/* ---------- the seal-coin steps (Discord · Roblox · Minecraft) ---------- */

.steps { display: flex; justify-content: center; align-items: center; margin: 26px 0 30px; }
.seal-link { width: 36px; height: 0; border-top: 2px dotted var(--line); }
.seal-link.is-linked { border-top-style: solid; border-color: var(--olive); }
.step {
  width: 92px; height: 92px; border-radius: 50%; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: #efe2c6; border: 2px dashed var(--line);
  box-shadow: inset 0 0 0 4px #efe2c6, inset 0 0 0 5px var(--line);
  font-size: 0.58rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 500;
}
.step .dot { font-family: var(--font-inscription); font-weight: 600; font-size: 1.05rem; letter-spacing: 0.06em; color: var(--muted); text-transform: none; }
.step.current { border-style: solid; border-color: var(--terracotta); box-shadow: inset 0 0 0 4px #efe2c6, inset 0 0 0 5px var(--terracotta); color: var(--text); }
.step.current .dot { color: var(--text); }
.step.done { border-style: solid; border-color: var(--olive); background: #e3e2bf; box-shadow: inset 0 0 0 4px #e3e2bf, inset 0 0 0 5px var(--olive); color: var(--olive-text); }
.step.done .dot { color: var(--olive-text); }

/* 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: #efe2c6; border: 2px solid var(--terracotta);
  box-shadow: inset 0 0 0 4px #efe2c6, 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=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: #fffdf7; 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(166, 63, 26, 0.12); outline: none; }
textarea { min-height: 80px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #b39c7a; }
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: #fffdf7;
  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: #f6e3d2; 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: #fffdf7;
  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: #f6e3d2; 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: #f6dfd6; 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: #f3e6c8; }
.notice.bad { border-color: var(--cinnabar); background: #f4e0d4; }

.invite-box {
  margin: 20px auto; max-width: 440px; padding: 16px 18px; border-radius: var(--radius);
  background: #fffdf7; 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; }

/* ---------- admin: review cards ---------- */

.review { padding: 22px 24px; }
.review-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.who { display: flex; gap: 12px; align-items: center; min-width: 220px; flex: 1; }
.who img { width: 52px; height: 52px; border-radius: 50%; background: var(--panel); flex: none; box-shadow: 0 0 0 2px var(--panel-raised), 0 0 0 3px var(--ochre); }
.who img.square { border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); }
.who .name { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; line-height: 1.2; }
.who .sub { color: var(--faint); font-size: 0.8rem; word-break: break-all; }
.answers { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 16px 0 12px; }
.answer { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 9px 12px; }
.answer .k { font-family: var(--font-inscription); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.answer .v { font-weight: 600; word-break: break-word; }

.warnings { list-style: none; margin: 4px 0 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.warnings li { min-width: 0; overflow-wrap: anywhere; padding: 7px 12px; border-radius: 0 var(--radius) var(--radius) 0; font-size: 0.9rem; border-left: 3px solid; color: var(--text); }
.warnings li.bad { border-color: var(--cinnabar); background: #f4e0d4; }
.warnings li.warn { border-color: var(--ochre); background: #f3e6c8; }
.warnings li.info { border-color: var(--stone); background: #e8e6dc; }
.warnings li.ok { border-color: var(--olive); background: #ecebd0; }

details.history { margin-top: 6px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
details.history > summary { cursor: pointer; color: var(--terracotta); font-weight: 600; font-size: 0.92rem; list-style: none; }
details.history > summary::-webkit-details-marker { display: none; }
details.history > summary::before { content: '▸ '; }
details.history[open] > summary::before { content: '▾ '; }
.hist-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 12px; margin-top: 12px; }
.hist { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 12px 14px; font-size: 0.88rem; }
.hist h4 { font-family: var(--font-inscription); font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ochre); margin-bottom: 6px; font-weight: 600; }
.hist dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px 12px; }
.hist dt { color: var(--muted); white-space: nowrap; }
.hist dd { text-align: right; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.hist ul { padding-left: 18px; }
.hist li::marker { color: var(--terracotta); }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; align-items: flex-start; }
.decline-box { width: 100%; display: grid; gap: 8px; }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-raised); }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th {
  font-family: var(--font-inscription); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--faint); font-weight: 600; background: var(--panel);
}
tr:last-child td { border-bottom: none; }
tr.flagged td { background: #f4e0d4; }
.empty { text-align: center; color: var(--muted); padding: 30px; font-family: var(--font-display); font-style: italic; font-size: 1.1rem; }

/* ---------- admin hub links ---------- */

.link-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.link-group h3 { margin-bottom: 0; }
.link-group .site { font-family: var(--font-inscription); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ochre); margin-bottom: 8px; }
.admin-link {
  display: block; padding: 11px 13px; border-radius: var(--radius); color: var(--text);
  background: var(--panel); border: 1px solid var(--line-soft); margin-top: 8px;
  transition: border-color 0.15s, background 0.15s;
}
.admin-link:hover { text-decoration: none; border-color: var(--terracotta); background: #fdf6ea; }
.admin-link .t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; color: var(--terracotta); }
.admin-link .d { color: var(--muted); font-size: 0.86rem; margin-top: 2px; }
.admin-link .w { color: var(--faint); font-size: 0.76rem; margin-top: 4px; }
.admin-link.locked { opacity: 0.65; }
.admin-link.locked .t { color: var(--muted); }

/* ---------- stat tiles ---------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 24px 0 18px; }
.tile { background: var(--panel-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; text-align: center; }
.tile .n { font-family: var(--font-display); font-size: 2.2rem; font-weight: 600; line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; }
.tile .l { font-family: var(--font-inscription); font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.tile.alert { border-color: #b5524b; }
.tile.alert .n { color: var(--cinnabar); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar > * { flex: 1; min-width: 160px; }
.toolbar .btn { flex: none; }

/* section tabs: inscription-style, like the omnarch.com nav */
.tabs { display: flex; gap: 6px 22px; flex-wrap: wrap; justify-content: center; margin: 22px 0 6px; }
.tabs .header-btn { font-family: var(--font-inscription); font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; }

.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(43, 27, 16, 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); } }

/* ---------- perm manager ---------- */

.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person img { width: 48px; height: 48px; border-radius: 50%; flex: none; background: var(--panel); box-shadow: 0 0 0 2px var(--panel-raised), 0 0 0 3px var(--ochre); }
.person-text { min-width: 0; }
.person-name { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; line-height: 1.2; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.person-sub { color: var(--faint); font-size: 0.82rem; overflow-wrap: anywhere; }
.link-btn { background: none; border: none; padding: 0; margin-left: 4px; font: inherit; font-size: 0.78rem; color: var(--terracotta); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.person-preview { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 12px 14px; margin: -6px 0 18px; }
.person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 18px; }
.card.person-grid::before { display: none; }

.perm-checks { border: none; margin: 0 0 18px; display: grid; gap: 8px; }
.perm-checks legend { font-weight: 600; font-size: 0.95rem; margin-bottom: 8px; }
#permBoxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.perm-check {
  display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius); background: #fffdf7;
}
.perm-check:has(input:checked) { border-color: var(--terracotta); background: #f6e3d2; }
.perm-check input { margin-top: 4px; width: 16px; height: 16px; flex: none; }
.perm-check b { display: block; }
.perm-check small { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 1px; }
.perm-all { background: var(--panel); }

.grant-row { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; padding: 18px 22px; }
.grant-row .person { flex: 1; min-width: 240px; align-items: flex-start; }
.grant-perms { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.grant-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.admin-link.owner-only { border-color: var(--terracotta); background: #f6e3d2; }

.perm-group-head { grid-column: 1 / -1; margin: 10px 0 0; font-family: var(--font-inscription); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ochre); font-weight: 600; }

/* ---------- master lookup ---------- */

.lookup-form { margin-bottom: 0; }
.lookup-form input { flex: 3; min-width: 220px; }
.lookup-form select { flex: 1; min-width: 150px; }
.match-list { display: grid; gap: 10px; }
.card.match { display: block; width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; padding: 14px 18px; margin: 0; }
.card.match:hover { border-color: var(--terracotta); }
.match-names { display: flex; gap: 6px 18px; flex-wrap: wrap; font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; }
.lookup-people { display: flex; gap: 16px; flex-wrap: wrap; }
.id-rows { display: grid; gap: 4px; margin-top: 14px; }
.id-row { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 0.9rem; }
.id-row > .faint { min-width: 110px; }
.id-row .mono { overflow-wrap: anywhere; }
.sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; margin-bottom: 8px; }
.src { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--panel); font-size: 0.9rem; color: var(--muted); }
.src .mark { font-weight: 700; width: 1em; flex: none; }
.src.hit { border-color: #7d9450; background: #ecebd0; color: var(--text); }
.src.hit .mark { color: var(--olive-text); }
.src.off { opacity: 0.6; }
.server-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.card.server-row { padding: 14px 16px; margin: 0; }
.server-icon { width: 32px; height: 32px; border-radius: 50%; flex: none; background: var(--panel); border: 1px solid var(--line-soft); display: inline-block; }
.role-pills { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.role-pill { font-size: 0.76rem; padding: 1px 8px; border: 1px solid var(--line); border-left: 4px solid var(--rc, var(--line)); border-radius: var(--radius); background: var(--panel-raised); }

/* ---------- DM panel ---------- */

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border: 1px solid var(--terracotta); border-radius: 999px; background: #f6e3d2; font-size: 0.84rem; }
.chip button { background: none; border: none; cursor: pointer; color: var(--terracotta); font-size: 1rem; line-height: 1; padding: 0 6px; }
.dm-targets { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.dm-targets .field { margin: 0; }
textarea.dm-people { min-height: 96px; font-family: var(--mono); font-size: 0.86rem; }
textarea.dm-text { min-height: 120px; }
.dm-preview { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 12px 14px; margin-top: 12px; }
.dm-recipients { display: flex; gap: 4px 12px; flex-wrap: wrap; max-height: 180px; overflow: auto; margin-top: 8px; font-size: 0.84rem; }
.dm-recipients span { white-space: nowrap; }
.dm-mock { background: #313338; color: #dbdee1; border-radius: 6px; padding: 12px 14px; font-family: system-ui, sans-serif; font-size: 0.92rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.dm-mock .embed { margin-top: 6px; border-left: 4px solid var(--ec, #5865f2); background: #2b2d31; border-radius: 4px; padding: 8px 12px; }
.dm-mock .embed .et { color: #fff; display: block; font-weight: 700; margin-bottom: 2px; }
.dm-mock .nm { color: #fff; font-weight: 600; }
.dm-mock .embed small { color: #949ba4; display: block; margin-top: 6px; }
.progress { height: 8px; background: var(--line-soft); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.progress > span { display: block; height: 100%; background: var(--terracotta); transition: width 0.4s; }
@media (max-width: 640px) { .dm-targets { grid-template-columns: 1fr; } }

@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; }
  .choice-tabs { grid-template-columns: 1fr; }
  .btn.big { width: 100%; }
  .step { width: 76px; height: 76px; font-size: 0.5rem; letter-spacing: 0.08em; }
  .seal-link { width: 16px; }
  .eyebrow { font-size: 0.62rem; letter-spacing: 0.16em; }
}
@media (max-width: 480px) {
  .site-name small { display: none; }
  .user-chip span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- DM inbox ---------- */

.switch-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.switch-row input { appearance: none; -webkit-appearance: none; flex: none; width: 42px; height: 24px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background 0.15s; margin-top: 2px; }
.switch-row input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--panel-raised); transition: left 0.15s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
.switch-row input:checked { background: var(--olive); }
.switch-row input:checked::after { left: 21px; }
.switch-row b { display: block; }
.switch-row small { display: block; color: var(--muted); font-size: 0.84rem; }

.inbox { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 14px; align-items: start; }
.inbox > * { min-width: 0; }
.card.inbox-list, .card.inbox-thread { margin: 0; padding: 14px; }
#inboxConvos { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; max-height: 560px; overflow-y: auto; }
.convo { min-width: 0; }
.convo { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; font: inherit; color: inherit; background: none; border: 1px solid transparent; border-radius: var(--radius); padding: 7px 8px; cursor: pointer; }
.convo:hover { background: var(--panel); }
.convo.active { border-color: var(--terracotta); background: #f6e3d2; }
.convo img { width: 34px; height: 34px; border-radius: 50%; flex: none; background: var(--panel); }
.convo .t { display: block; min-width: 0; flex: 1; overflow: hidden; }
.convo .n { font-weight: 600; display: flex; gap: 6px; align-items: center; }
.convo .p { display: block; color: var(--faint); font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo > .faint { flex: none; }
.convo.unread .p { color: var(--text); font-weight: 500; }
.thread-head { display: flex; gap: 10px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 10px; flex-wrap: wrap; }
.thread-head img { width: 40px; height: 40px; border-radius: 50%; }
.thread-msgs { display: flex; flex-direction: column; gap: 8px; max-height: 480px; overflow-y: auto; padding: 4px 2px; }
.bubble { max-width: 82%; padding: 8px 12px; border-radius: 10px; overflow-wrap: anywhere; font-size: 0.92rem; }
.bubble .txt { white-space: pre-wrap; }
.bubble.in { align-self: flex-start; background: var(--panel); border: 1px solid var(--line-soft); }
.bubble.out { align-self: flex-end; background: #f6e3d2; border: 1px solid #e3b79c; }
.bubble .meta { display: block; font-size: 0.72rem; color: var(--faint); margin-top: 3px; white-space: normal; }
.bubble a { overflow-wrap: anywhere; }
.thread-reply { display: grid; gap: 8px; margin-top: 12px; }
.thread-reply textarea { min-height: 70px; }
@media (max-width: 720px) { .inbox { grid-template-columns: 1fr; } #inboxConvos { max-height: 260px; } }

/* ---------- DM filters, placeholders, reminders ---------- */

.dm-filters { margin: 14px 0 12px; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--panel); }
.dm-filters h4 { font-size: 0.95rem; margin-bottom: 4px; }
#dmFilters { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 14px; }
.filter-group { display: grid; gap: 6px; align-content: start; }
.filter-group.off .perm-check { opacity: 0.5; }
.perm-check.filter { background: var(--panel-raised); padding: 8px 11px; }
.perm-check.filter.on { border-color: var(--terracotta); background: #f6e3d2; }
.filter-param { display: flex; gap: 6px; align-items: center; margin-top: 6px; font-size: 0.85rem; }
.filter-param input { width: 90px; padding: 4px 8px; }
.rank-picks { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 0.84rem; max-height: 160px; overflow-y: auto; }
.rank-picks label { display: inline-flex; gap: 5px; align-items: center; cursor: pointer; }
.dm-vars { margin-top: 4px; }
.chip.var-chip { cursor: pointer; font-family: var(--mono); font-size: 0.78rem; padding: 2px 9px; background: var(--panel-raised); border-color: var(--line); color: var(--text); }
.chip.var-chip:hover { border-color: var(--terracotta); color: var(--terracotta); }
.weekday-picks { gap: 6px; }
.day-pick { display: inline-flex; gap: 5px; align-items: center; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.85rem; cursor: pointer; background: var(--panel-raised); }
.day-pick:has(input:checked) { border-color: var(--terracotta); background: #f6e3d2; }
.card.reminder { padding: 14px 18px; }
.card.reminder.paused { opacity: 0.7; }
.rm-excerpt { margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#rmEditor input[type=time], #rmEditor input[type=date], #rmEditor input[type=number] { padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-raised); font: inherit; }

/* ---------- /admin/servers (Riskbot's servers) ---------- */

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 0; }
.stat { text-align: center; padding: 22px 20px; }
.stat-label {
  font-family: var(--font-inscription); font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ochre) !important; margin: 0 0 6px;
}
.stat-value {
  font-family: var(--font-display); font-weight: 600; font-size: 2.8rem; line-height: 1;
  color: var(--text) !important; font-variant-numeric: tabular-nums; margin: 0;
}
.stat--lead .stat-value { color: var(--terracotta) !important; font-size: 3.4rem; }
.stat-of { font-size: 1.4rem; color: var(--faint); }
.stat-note { font-size: 0.8rem; margin: 8px 0 0; }

.meter { height: 8px; margin-top: 12px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 999px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--terracotta); border-radius: 999px; }

.module-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.module-chips .chip, .chip--own { padding: 3px 10px; border-color: var(--line); background: var(--panel); color: var(--muted); }
.module-chips .chip b { color: var(--text); }
.chip--own { font-size: 0.7rem; padding: 1px 8px; border-color: var(--terracotta); color: var(--terracotta); vertical-align: 1px; }

.filter-input {
  width: min(280px, 100%); padding: 8px 12px; font: inherit; font-size: 0.88rem; color: var(--text);
  background: var(--panel-raised); border: 1px solid var(--line); border-radius: var(--radius);
}
.filter-input:focus { border-color: var(--terracotta); box-shadow: 0 0 0 3px rgba(166, 63, 26, 0.12); outline: none; }

.server-cell { display: flex; align-items: center; gap: 10px; }
.server-cell img, .server-fallback {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line);
}
.server-fallback {
  display: grid; place-items: center; background: var(--panel);
  font-family: var(--font-inscription); font-size: 0.7rem; color: var(--muted);
}
