/* Exposed admin. System font, grouped surfaces, translucent chrome. */
:root {
  --bg: #f2f2f7;
  --surface: #ffffff;
  --surface-2: #f7f7fa;
  --text: #1c1c1e;
  --text-2: #5c5c63;
  --text-3: #8a8a91;
  --line: rgba(60, 60, 67, 0.14);
  --accent: #0a66d6;
  --accent-press: #0855b3;
  --accent-soft: rgba(10, 102, 214, 0.1);
  --ok: #1f8a3e;
  --ok-soft: rgba(31, 138, 62, 0.12);
  --warn: #a35a00;
  --warn-soft: rgba(201, 118, 0, 0.14);
  --danger: #c4271c;
  --danger-soft: rgba(196, 39, 28, 0.1);
  --chrome: rgba(249, 249, 252, 0.72);
  --chrome-edge: rgba(0, 0, 0, 0.08);
  --discord-bg: #313338;
  --discord-text: #dbdee1;
  --discord-ts: #3f4248;
  --mention: rgba(88, 101, 242, 0.3);
  --mention-text: #c9cdfb;
  --toggle-off: #d6d6dc;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
  --radius: 12px;
  --radius-s: 8px;
  --spring: cubic-bezier(0.2, 0.9, 0.25, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f11;
    --surface: #1c1c1f;
    --surface-2: #232327;
    --text: #f2f2f5;
    --text-2: #a8a8b0;
    --text-3: #7c7c85;
    --line: rgba(235, 235, 245, 0.12);
    --accent: #4c9bff;
    --accent-press: #2f86f5;
    --accent-soft: rgba(76, 155, 255, 0.16);
    --ok: #4cc472;
    --ok-soft: rgba(76, 196, 114, 0.15);
    --warn: #f0a83a;
    --warn-soft: rgba(240, 168, 58, 0.15);
    --danger: #ff6b5f;
    --danger-soft: rgba(255, 107, 95, 0.14);
    --chrome: rgba(22, 22, 25, 0.7);
    --chrome-edge: rgba(255, 255, 255, 0.07);
    --toggle-off: #3a3a40;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 100%/1.5 -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.875em; }

/* --- Chrome -------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--chrome);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--chrome-edge);
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 1rem;
  display: flex; align-items: center; gap: 1rem; min-height: 3.25rem;
}
.brand { font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.01em; color: var(--text); display: flex; align-items: center; gap: 0.5rem; }
.brand:hover { text-decoration: none; }
.dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--text-3); flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.off { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.nav { display: flex; gap: 0.125rem; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--text-2); font-size: 0.875rem; font-weight: 500;
  padding: 0.375rem 0.625rem; border-radius: 999px; white-space: nowrap;
  transition: background-color 120ms ease-out, color 120ms ease-out;
}
.nav a:hover { text-decoration: none; color: var(--text); background: var(--accent-soft); }
.nav a.active { color: var(--accent); background: var(--accent-soft); }
.badge {
  display: inline-block; min-width: 1.25rem; padding: 0 0.375rem; margin-left: 0.25rem;
  border-radius: 999px; background: var(--warn); color: #fff; font-size: 0.6875rem; line-height: 1.25rem; text-align: center;
}

main { max-width: 1080px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

/* --- Type ------------------------------------------------------------------ */
h1 { font-size: clamp(1.625rem, 3vw, 2rem); line-height: 1.15; letter-spacing: -0.022em; font-weight: 700; margin: 0.25rem 0 0.25rem; }
h2 { font-size: 1.1875rem; line-height: 1.25; letter-spacing: -0.012em; font-weight: 650; margin: 2rem 0 0.625rem; }
h3 { font-size: 0.9375rem; font-weight: 600; margin: 0 0 0.5rem; }
.lede { color: var(--text-2); margin: 0 0 1.5rem; max-width: 46rem; }
.muted { color: var(--text-2); }
.small { font-size: 0.8125rem; }
.section-label {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-3); margin: 1.75rem 0 0.5rem 0.25rem;
}

/* --- Surfaces -------------------------------------------------------------- */
.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1rem 1.125rem; margin-bottom: 1rem;
}
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.stat { display: flex; flex-direction: column; gap: 0.125rem; }
.stat .value { font-size: 1.5rem; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .label { font-size: 0.8125rem; color: var(--text-2); }

/* Inset grouped list, like Settings */
.list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 1rem; }
.row {
  display: flex; align-items: center; gap: 0.875rem; padding: 0.75rem 1.125rem; min-height: 3rem;
  border-top: 1px solid var(--line);
}
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 550; }
.row .sub { color: var(--text-2); font-size: 0.8125rem; }
.row.disabled .title, .row.disabled .sub { opacity: 0.5; }
a.row { color: inherit; }
a.row:hover { text-decoration: none; background: var(--surface-2); }
.chev::after { content: "›"; color: var(--text-3); font-size: 1.25rem; line-height: 1; }

/* Tables for dense data */
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { text-align: left; padding: 0.625rem 0.875rem; border-top: 1px solid var(--line); vertical-align: middle; }
thead th { border-top: 0; color: var(--text-3); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr.off td { color: var(--text-3); }
td.num { font-variant-numeric: tabular-nums; }

.pill { display: inline-block; padding: 0.0625rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 550; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.err { background: var(--danger-soft); color: var(--danger); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

/* --- Forms ----------------------------------------------------------------- */
label { display: block; font-size: 0.8125rem; font-weight: 550; color: var(--text-2); margin-bottom: 0.3rem; }
input[type=text], input[type=password], input[type=number], input[type=url], select, textarea {
  width: 100%; font: inherit; font-size: 0.9375rem; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 0.5rem 0.625rem; min-height: 2.5rem;
  transition: border-color 120ms ease-out, box-shadow 120ms ease-out;
}
textarea { min-height: 6.5rem; resize: vertical; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.8125rem; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field { margin-bottom: 0.875rem; }
.field .help { font-size: 0.75rem; color: var(--text-3); margin-top: 0.25rem; }
.fields { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.inline { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.inline > input, .inline > select { width: auto; flex: 1 1 10rem; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset[hidden] { display: none; }

.days { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.days label { margin: 0; }
.days input { position: absolute; opacity: 0; pointer-events: none; }
.days span {
  display: inline-block; padding: 0.375rem 0.75rem; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--text-2); font-weight: 550; cursor: pointer; user-select: none;
  transition: background-color 120ms ease-out, color 120ms ease-out, transform 100ms ease-out;
}
.days span:active { transform: scale(0.95); }
.days input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.days input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }

/* Switch: a checkbox that looks like a toggle */
.switch { position: relative; display: inline-flex; align-items: center; gap: 0.5rem; margin: 0; cursor: pointer; color: var(--text); font-weight: 500; font-size: 0.875rem; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  width: 2.75rem; height: 1.625rem; border-radius: 999px; background: var(--toggle-off); position: relative; flex: none;
  transition: background-color 200ms var(--spring);
}
.switch .track::after {
  content: ""; position: absolute; top: 0.125rem; left: 0.125rem; width: 1.375rem; height: 1.375rem; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 260ms var(--spring), width 160ms var(--spring);
}
.switch:active .track::after { width: 1.625rem; }
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { transform: translateX(1.125rem); }
.switch:active input:checked + .track::after { transform: translateX(0.875rem); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--accent-soft); }

/* --- Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem;
  font: inherit; font-size: 0.875rem; font-weight: 600; line-height: 1;
  padding: 0.625rem 1rem; min-height: 2.5rem; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--accent); color: #fff; text-decoration: none; white-space: nowrap;
  transition: transform 100ms ease-out, background-color 120ms ease-out;
  touch-action: manipulation;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.97); background: var(--accent-press); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.btn.secondary { background: var(--accent-soft); color: var(--accent); }
.btn.secondary:active { background: var(--accent-soft); }
.btn.plain { background: transparent; color: var(--accent); padding-inline: 0.5rem; }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.small { font-size: 0.8125rem; padding: 0.4375rem 0.75rem; min-height: 2rem; }
.btn.icon { width: 2rem; height: 2rem; min-height: 2rem; padding: 0; background: var(--surface-2); color: var(--text-2); }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
form.inline-form { display: inline; margin: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head .lede { margin-bottom: 0; }

/* Sticky save bar: floats over content, translucent */
.savebar {
  position: sticky; bottom: 1rem; z-index: 5; margin-top: 1.5rem;
  display: flex; gap: 0.75rem; align-items: center; justify-content: space-between;
  padding: 0.625rem 0.75rem 0.625rem 1.125rem; border-radius: 999px;
  background: var(--chrome); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--chrome-edge); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* --- Flash ------------------------------------------------------------------- */
.flash { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-weight: 500; animation: drop-in 320ms var(--spring); }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.err { background: var(--danger-soft); color: var(--danger); }
.banner { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: 0.875rem 1.125rem; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn); margin-bottom: 1rem; font-weight: 500; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* --- Discord preview --------------------------------------------------------- */
.discord {
  background: var(--discord-bg); color: var(--discord-text); border-radius: var(--radius);
  padding: 1rem 1.125rem; font-size: 0.9375rem; line-height: 1.375; white-space: pre-wrap; overflow-wrap: anywhere;
}
.discord time { background: var(--discord-ts); border-radius: 3px; padding: 0 2px; }
.discord .mention { background: var(--mention); color: var(--mention-text); border-radius: 3px; padding: 0 2px; font-weight: 500; }
.discord-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; white-space: normal; }
.discord-buttons span { background: #4e5058; color: #fff; border-radius: 4px; padding: 0.3125rem 0.875rem; font-size: 0.8125rem; font-weight: 500; }
.discord-buttons span.primary { background: #5865f2; }
.discord.card-preview { border-left: 4px solid var(--bar, #5865f2); }

/* --- Logs ------------------------------------------------------------------------ */
.log { font-size: 0.8125rem; }
.log td:first-child { white-space: nowrap; color: var(--text-3); font-variant-numeric: tabular-nums; }
.log .k { font-weight: 600; }

/* --- Login --------------------------------------------------------------------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login .card { width: min(100%, 22rem); padding: 2rem 1.5rem; text-align: center; }
.login h1 { margin-bottom: 0.25rem; }
.login form { text-align: left; margin-top: 1.5rem; }
.login .btn { width: 100%; }

@media (max-width: 640px) {
  .topbar-inner { flex-wrap: wrap; padding-block: 0.5rem; gap: 0.375rem; }
  .nav { order: 3; flex-basis: 100%; }
  .savebar { border-radius: var(--radius); }
  th, td { padding: 0.5rem 0.625rem; }
}

/* --- Accessibility preferences --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
  .btn:active, .days span:active { transform: none; }
  .flash { animation: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar, .savebar { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --line: rgba(0, 0, 0, 0.45); --text-2: #2c2c30; --text-3: #44444a; }
  .topbar, .savebar { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; border-color: var(--text); }
  .card, .list, .table-wrap { border: 1px solid var(--line); }
}

/* Utilities (no inline styles: the CSP forbids them) */
.spread { justify-content: space-between; }
.mt { margin-top: 0.75rem; }
.mt-l { margin-top: 2rem; }
.w-auto { width: auto; }
.row { flex-wrap: wrap; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details[open] { flex-basis: 100%; }
details[open] > summary { margin-left: auto; }
button[disabled] { opacity: 0.35; pointer-events: none; }
[hidden] { display: none !important; }
.topbar-inner > form { margin-left: auto; }
.discord .h2 { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1.25; margin: 0.25rem 0 0.25rem; color: #f2f3f5; }
.discord .h3 { display: block; font-size: 1.125rem; font-weight: 700; line-height: 1.3; margin: 0.75rem 0 0.125rem; color: #f2f3f5; }
.discord .subtext { display: block; font-size: 0.8125rem; color: #949ba4; margin-top: 0.5rem; }
/* Compact editable rows: numbers, emoji and selects stay narrow */
.inline > input[type=number] { flex: 0 0 6.5rem; width: 6.5rem; }
.inline > input[size="4"] { flex: 0 0 4.25rem; width: 4.25rem; text-align: center; }
.inline > select.w-auto { flex: 0 0 auto; width: auto; }
.inline > .switch { flex: none; }
.inline > .btn { flex: none; }
.list .inline > input[type=number] { flex-basis: 5rem; width: 5rem; }
.list .inline > input[type=text] { min-width: 6rem; }
td > input, td > select { min-width: 0; }
td > .emoji-input { width: 4.25rem; text-align: center; }
td > .order-input { width: 5rem; }
.discord-buttons span.danger { background: #da373c; }
.discord .h1 { display: block; font-size: 1.875rem; font-weight: 800; line-height: 1.2; margin: 0.25rem 0; color: #f2f3f5; }

/* Stats: bar widths and heat levels as classes (the CSP forbids inline styles) */
.w-0 { width: 0%; }
.w-1 { width: 1%; }
.w-2 { width: 2%; }
.w-3 { width: 3%; }
.w-4 { width: 4%; }
.w-5 { width: 5%; }
.w-6 { width: 6%; }
.w-7 { width: 7%; }
.w-8 { width: 8%; }
.w-9 { width: 9%; }
.w-10 { width: 10%; }
.w-11 { width: 11%; }
.w-12 { width: 12%; }
.w-13 { width: 13%; }
.w-14 { width: 14%; }
.w-15 { width: 15%; }
.w-16 { width: 16%; }
.w-17 { width: 17%; }
.w-18 { width: 18%; }
.w-19 { width: 19%; }
.w-20 { width: 20%; }
.w-21 { width: 21%; }
.w-22 { width: 22%; }
.w-23 { width: 23%; }
.w-24 { width: 24%; }
.w-25 { width: 25%; }
.w-26 { width: 26%; }
.w-27 { width: 27%; }
.w-28 { width: 28%; }
.w-29 { width: 29%; }
.w-30 { width: 30%; }
.w-31 { width: 31%; }
.w-32 { width: 32%; }
.w-33 { width: 33%; }
.w-34 { width: 34%; }
.w-35 { width: 35%; }
.w-36 { width: 36%; }
.w-37 { width: 37%; }
.w-38 { width: 38%; }
.w-39 { width: 39%; }
.w-40 { width: 40%; }
.w-41 { width: 41%; }
.w-42 { width: 42%; }
.w-43 { width: 43%; }
.w-44 { width: 44%; }
.w-45 { width: 45%; }
.w-46 { width: 46%; }
.w-47 { width: 47%; }
.w-48 { width: 48%; }
.w-49 { width: 49%; }
.w-50 { width: 50%; }
.w-51 { width: 51%; }
.w-52 { width: 52%; }
.w-53 { width: 53%; }
.w-54 { width: 54%; }
.w-55 { width: 55%; }
.w-56 { width: 56%; }
.w-57 { width: 57%; }
.w-58 { width: 58%; }
.w-59 { width: 59%; }
.w-60 { width: 60%; }
.w-61 { width: 61%; }
.w-62 { width: 62%; }
.w-63 { width: 63%; }
.w-64 { width: 64%; }
.w-65 { width: 65%; }
.w-66 { width: 66%; }
.w-67 { width: 67%; }
.w-68 { width: 68%; }
.w-69 { width: 69%; }
.w-70 { width: 70%; }
.w-71 { width: 71%; }
.w-72 { width: 72%; }
.w-73 { width: 73%; }
.w-74 { width: 74%; }
.w-75 { width: 75%; }
.w-76 { width: 76%; }
.w-77 { width: 77%; }
.w-78 { width: 78%; }
.w-79 { width: 79%; }
.w-80 { width: 80%; }
.w-81 { width: 81%; }
.w-82 { width: 82%; }
.w-83 { width: 83%; }
.w-84 { width: 84%; }
.w-85 { width: 85%; }
.w-86 { width: 86%; }
.w-87 { width: 87%; }
.w-88 { width: 88%; }
.w-89 { width: 89%; }
.w-90 { width: 90%; }
.w-91 { width: 91%; }
.w-92 { width: 92%; }
.w-93 { width: 93%; }
.w-94 { width: 94%; }
.w-95 { width: 95%; }
.w-96 { width: 96%; }
.w-97 { width: 97%; }
.w-98 { width: 98%; }
.w-99 { width: 99%; }
.w-100 { width: 100%; }
.chart { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr auto; gap: 0.375rem 0.75rem; align-items: center; }
.chart .lbl { font-size: 0.875rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart .track { height: 0.875rem; position: relative; }
.chart .fill { height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 0; }
.chart .fill.zero { background: transparent; }
.chart .val { font-size: 0.8125rem; font-variant-numeric: tabular-nums; color: var(--text-2); text-align: right; min-width: 2.5rem; }
.chart .val b { color: var(--text); font-weight: 600; }
.chart-empty { color: var(--text-3); font-size: 0.875rem; }
.card h3 { margin-bottom: 0.875rem; }
.card h3 .muted { font-weight: 400; font-size: 0.8125rem; }
.range { display: inline-flex; background: var(--surface); border-radius: 999px; padding: 0.25rem; box-shadow: var(--shadow); gap: 0.125rem; }
.range a { padding: 0.375rem 0.875rem; border-radius: 999px; font-size: 0.875rem; font-weight: 550; color: var(--text-2); }
.range a:hover { text-decoration: none; color: var(--text); }
.range a.on { background: var(--accent); color: #fff; }
.heat { border-collapse: separate; border-spacing: 2px; width: 100%; table-layout: fixed; font-size: 0.6875rem; }
.heat th, .heat td { border: 0; padding: 0; text-align: center; color: var(--text-3); font-weight: 500; text-transform: none; letter-spacing: 0; }
.heat th[scope=row] { width: 2.5rem; text-align: left; }
.heat td { height: 1.25rem; border-radius: 3px; }
.heat .l0 { background: var(--surface-2); }
.heat .l1 { background: color-mix(in oklab, var(--accent) 20%, var(--surface)); }
.heat .l2 { background: color-mix(in oklab, var(--accent) 38%, var(--surface)); }
.heat .l3 { background: color-mix(in oklab, var(--accent) 56%, var(--surface)); }
.heat .l4 { background: color-mix(in oklab, var(--accent) 76%, var(--surface)); }
.heat .l5 { background: var(--accent); }
.heat-key { display: flex; gap: 2px; align-items: center; font-size: 0.75rem; color: var(--text-3); }
.heat-key span { width: 1rem; height: 0.75rem; border-radius: 3px; display: inline-block; }
@media (forced-colors: active) { .chart .fill, .heat .l5 { background: CanvasText; } }
.heat-key .l1 { background: color-mix(in oklab, var(--accent) 20%, var(--surface)); }
.heat-key .l3 { background: color-mix(in oklab, var(--accent) 56%, var(--surface)); }
.heat-key .l5 { background: var(--accent); }
.grid.tiles { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.625rem 1rem; }
/* 12 tabs: tighter pills so the whole menu fits on a laptop screen */
.nav a { padding: 0.375rem 0.5rem; font-size: 0.8125rem; }
.topbar-inner { gap: 0.75rem; max-width: 1180px; }
.discord .command { background: rgba(88, 101, 242, 0.3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; }
.discord code.icode { background: #2b2d31; border-radius: 3px; padding: 0 3px; font-size: 0.85em; }
.discord-btn { width: 100%; background: #5865f2; margin-top: 1.25rem; }
.discord-btn:active { background: #4752c4; }
.login form { margin-top: 1rem; }
.who { white-space: nowrap; }
.owner-only { opacity: 0.6; }
.owner-note { font-size: 0.75rem; color: var(--warn); }
.who { max-width: 7.5rem; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle; }
.stat .value.small { font-size: 0.9375rem; font-weight: 600; letter-spacing: 0; overflow-wrap: anywhere; }
.nav a { padding: 0.375rem 0.4375rem; }
.topbar-inner { max-width: 1240px; gap: 0.5rem; }
.logo-tile { display: flex; justify-content: center; margin: 0 0 0.75rem; }
.logo-tile img { display: block; width: 9.5rem; height: auto; filter: drop-shadow(0 0 18px rgba(76, 141, 255, 0.35)); }

/* --- Grouped navigation ---------------------------------------------------- */
.nav { overflow: visible; flex-wrap: wrap; align-items: center; }
.nav a, .menu > summary { padding: 0.375rem 0.625rem; font-size: 0.875rem; }
.menu, .menu[open] { position: relative; flex-basis: auto; }
.menu[open] > summary { margin-left: 0; }
.menu > summary {
  list-style: none; cursor: pointer; user-select: none;
  color: var(--text-2); font-weight: 500; border-radius: 999px; white-space: nowrap;
  transition: background-color 120ms ease-out, color 120ms ease-out;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: "▾"; font-size: 0.75em; margin-left: 0.3rem; opacity: 0.7; }
.menu > summary:hover, .menu[open] > summary { color: var(--text); background: var(--accent-soft); }
.menu > summary.active { color: var(--accent); background: var(--accent-soft); }
.menu > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.menu-list {
  position: absolute; top: calc(100% + 0.375rem); left: 0; z-index: 20; min-width: 12rem;
  display: flex; flex-direction: column; gap: 0.125rem; padding: 0.375rem;
  background: var(--surface); border: 1px solid var(--chrome-edge); border-radius: var(--radius-s);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}
.menu-list a { border-radius: var(--radius-s); }
@media (max-width: 640px) {
  .menu-list { position: fixed; left: 1rem; right: 1rem; top: auto; }
}

/* --- Search box in the top bar ---------------------------------------------- */
.site-search { position: relative; margin-left: auto; flex: 0 1 15rem; min-width: 9rem; }
.site-search ~ form { margin-left: 0; }
.site-search input {
  width: 100%; padding: 0.375rem 0.75rem; font-size: 0.875rem; border-radius: 999px;
  background: var(--accent-soft); border: 1px solid transparent; color: var(--text);
}
.site-search input:focus { border-color: var(--accent); outline: none; background: var(--surface); }
.search-pop {
  position: absolute; top: calc(100% + 0.375rem); right: 0; z-index: 30; width: min(26rem, 92vw);
  margin: 0; padding: 0.375rem; list-style: none; max-height: 70vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--chrome-edge); border-radius: var(--radius-s);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}
.search-pop li { margin: 0; }
.search-pop a { display: block; padding: 0.4375rem 0.625rem; border-radius: var(--radius-s); color: var(--text); }
.search-pop a:hover, .search-pop li[aria-selected="true"] a { background: var(--accent-soft); text-decoration: none; }
.search-pop .s-label { font-weight: 600; font-size: 0.875rem; }
.search-pop .s-page { float: right; margin-left: 0.75rem; font-size: 0.75rem; color: var(--text-2); }
.search-pop .s-detail { display: block; font-size: 0.75rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-pop .s-empty, .search-pop .s-all a { font-size: 0.8125rem; color: var(--text-2); }
.search-pop .s-empty { padding: 0.5rem 0.625rem; }
@media (max-width: 640px) {
  .site-search { order: 4; flex-basis: 100%; margin-left: 0; }
  .search-pop { left: 0; right: 0; width: auto; }
}

/* --- Footer and legal pages ------------------------------------------------- */
.site-footer {
  max-width: 1080px; margin: 0 auto; padding: 1.5rem 1rem 2.5rem;
  border-top: 1px solid var(--chrome-edge); color: var(--text-2); font-size: 0.8125rem; text-align: center;
}
.site-footer p { margin: 0.375rem 0 0; }
.site-footer .footer-note { font-size: 0.75rem; opacity: 0.8; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 1.25rem; }
.footer-links a, .site-footer a { color: var(--text-2); }
.footer-links a:hover, .site-footer a:hover { color: var(--text); }
.login + .site-footer { border-top: 0; }
.signin { margin-left: auto; }
.legal { max-width: 46rem; }
.legal h2 { font-size: 1.0625rem; margin: 1.75rem 0 0.5rem; }
.legal p, .legal li { line-height: 1.6; }
.legal ul { padding-left: 1.25rem; }

/* --- Games ------------------------------------------------------------------ */
.group-head { font-size: 1.125rem; margin: 2rem 0 0.25rem; padding-top: 1rem; border-top: 1px solid var(--chrome-edge); }
.group-head:first-of-type { margin-top: 1rem; border-top: 0; padding-top: 0; }
.game-pick > summary { font-weight: 600; color: var(--text); background: var(--accent-soft); }
.game-pick .menu-list button { all: unset; display: block; box-sizing: border-box; width: 100%; cursor: pointer;
  padding: 0.375rem 0.625rem; border-radius: var(--radius-s); color: var(--text-2); font-size: 0.875rem; }
.game-pick .menu-list button:hover, .game-pick .menu-list button:focus-visible { background: var(--accent-soft); color: var(--text); }
.game-pick .menu-list button[aria-current="true"] { color: var(--accent); }
.game-pick .menu-list form { margin: 0; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.choice-grid .card { display: flex; flex-direction: column; gap: 0.5rem; }
.danger-zone { flex-basis: auto !important; }
.danger-zone > summary { list-style: none; margin-left: 0 !important; }
.danger-zone[open] { flex-basis: 100% !important; }
/* Keep the top bar on one row on a laptop screen. */
.game-pick > summary { max-width: 9.5rem; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.site-search { flex-basis: 11rem; }
.nav { gap: 0; }
.nav a, .menu > summary { padding: 0.375rem 0.5rem; }
@media (max-width: 1240px) { .who { display: none; } }
.server-pick > summary { background: transparent; border: 1px solid var(--chrome-edge); }

/* Setup guide */
.steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.step-head { display: flex; gap: 0.75rem; align-items: center; justify-content: space-between; }
.step ul { margin: 0.25rem 0 0.5rem 1.25rem; padding: 0; }
.invite-card { display: flex; flex-direction: column; gap: 0.75rem; }
.invite-card .copy-row { display: flex; gap: 0.5rem; }
.invite-card .copy-row input { flex: 1; min-width: 0; }

/* --- Force sign-ups (members) ------------------------------------------------ */
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }
.signup-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; color: inherit; border-left: 4px solid var(--ok); }
.signup-row:hover { text-decoration: none; background: var(--surface-2); }
.signup-row.state-closed { border-left-color: var(--text-3); }
.signup-row h2 { margin: 0; }
.signup-row p { margin: 0.125rem 0 0; }
.signup-row-meta { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.signup-hero {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--bar, var(--accent));
  border-radius: var(--radius); padding: 1.125rem 1.25rem; margin-bottom: 1rem;
}
.signup-hero h1 { margin: 0; }
.signup-when { margin: 0.25rem 0 0; font-weight: 550; }
.stat-tiles { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 1.5rem; }
.stat-tile { display: flex; flex-direction: column; gap: 0.125rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem 0.875rem; }
.stat-label { font-size: 0.8125rem; color: var(--text-2); }
.stat-value { font-size: 1.625rem; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; }
.force-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-bottom: 1.5rem; }
.force-card { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--ok); border-radius: var(--radius); padding: 0.875rem 1rem; }
.force-card.not-ready { border-top-color: var(--warn); }
.force-card.is-mine { box-shadow: 0 0 0 2px var(--accent-soft); }
.force-card header { display: flex; align-items: center; gap: 0.625rem; margin-bottom: 0.625rem; }
.force-card header > div { flex: 1; min-width: 0; }
.force-card h3 { margin: 0; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.force-card header p { margin: 0; }
.force-no { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--surface-2); font-weight: 650; font-size: 0.875rem; }
.force-counts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 1rem; margin: 0; }
.force-counts dt { font-size: 0.75rem; color: var(--text-2); }
.force-counts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.meter { display: block; width: 100%; height: 4px; border: 0; border-radius: 2px; margin: 0.25rem 0 0.125rem; overflow: hidden;
  appearance: none; -webkit-appearance: none; background: var(--surface-2); accent-color: var(--ok); }
.meter::-webkit-progress-bar { background: var(--surface-2); }
.meter::-webkit-progress-value { background: var(--ok); }
.meter::-moz-progress-bar { background: var(--ok); }
.not-ready .meter { accent-color: var(--warn); }
.not-ready .meter::-webkit-progress-value { background: var(--warn); }
.not-ready .meter::-moz-progress-bar { background: var(--warn); }
.tone-green { --bar: #57f287; } .tone-orange { --bar: #f0b232; } .tone-red { --bar: #ed4245; }
.tone-blurple { --bar: #5865f2; } .tone-grey { --bar: #80848e; } .tone-purple { --bar: #9b59b6; }

.check-list { display: flex; flex-direction: column; gap: 0.375rem; margin-top: 0.25rem; }

/* --- Characters (armory) -------------------------------------------------------- */
.armory-search { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; }
.armory-search .field { margin: 0; }
.armory-search .grow { flex: 1 1 220px; }
.armory-hits { display: grid; gap: 0.625rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.armory-hit { display: flex; gap: 0.75rem; align-items: center; color: inherit; padding: 0.75rem 0.875rem; }
.armory-hit:hover { text-decoration: none; background: var(--surface-2); }
.armory-hit img, .armory-avatar { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--surface-2); flex: none; }
.armory-hit div { display: flex; flex-direction: column; min-width: 0; }
.armory-hit strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.armory-head { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem;
  background: var(--surface); border: 1px solid var(--line); border-left: 6px solid #9b59b6; border-radius: var(--radius); padding: 1rem 1.25rem; }
.armory-portrait { width: 112px; height: 112px; border-radius: 12px; object-fit: cover; background: var(--surface-2); }
.armory-who h1 { margin: 0.125rem 0 0.25rem; }
.armory-who p { margin: 0.125rem 0; }
.armory-title { font-size: 0.9375rem; }
.stat-of { font-size: 1rem; font-weight: 500; }
.stat-text { font-size: 1.25rem; }
.armory-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; margin-bottom: 1rem; }
.armory-grid h2 { margin-top: 0; font-size: 1.0625rem; }
.armory-grid h3 { font-size: 0.9375rem; }
.radar { display: block; width: 100%; max-width: 320px; margin: 0 auto 0.75rem; overflow: visible; }
.radar-ring { fill: none; stroke: var(--line); stroke-width: 1; }
.radar-spoke { stroke: var(--line); stroke-width: 1; }
.radar-shape { fill: rgba(155, 89, 182, 0.35); stroke: #a970ff; stroke-width: 2; stroke-linejoin: round; }
.radar-dot { fill: #a970ff; }
.radar-label { fill: var(--text-2); font-size: 11px; }
table.compact { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
table.compact td { padding: 0.25rem 0.375rem; border: 0; }
table.compact .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter-cell { width: 40%; }
.gear-list { list-style: none; margin: 0 0 0.75rem; padding: 0; display: flex; flex-direction: column; gap: 0.375rem; }
.gear-list li { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.gear-list img { width: 32px; height: 32px; border-radius: 6px; background: var(--surface-2); flex: none; }
.gear-name { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gear-slot { margin-left: auto; white-space: nowrap; }
.stat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.5rem 1rem; margin: 0; }
.stat-list dt { font-size: 0.75rem; color: var(--text-2); }
.stat-list dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat-list span { display: block; line-height: 1.3; }
/* Item grades in AION's usual colours: green, blue, gold, orange, purple. */
.grade-common { color: var(--text); } .grade-rare { color: #3fb950; } .grade-legend { color: #3b9cff; }
.grade-unique { color: #d4a72c; } .grade-epic { color: #f0883e; } .grade-mythic { color: #b46cff; } .grade-special { color: #2fbf9f; }

/* --- Siege maps -------------------------------------------------------------------- */
.siege-bar { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.siege-bar h1 { margin: 0; }
.siege-zoom { margin-left: auto; display: flex; gap: 0.375rem; align-items: center; }
.siege-zoom .muted { min-width: 3.25rem; text-align: center; font-variant-numeric: tabular-nums; }
.siege-tools { margin-bottom: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.siege-tools p { margin: 0; }
.siege-toolrow { display: flex; flex-wrap: wrap; gap: 0.375rem; align-items: center; }
.siege-toolrow[hidden], .siege-inputs input[hidden] { display: none; }
.siege-chip input, .siege-swatch input { position: absolute; opacity: 0; pointer-events: none; }
.siege-chip span { display: inline-flex; align-items: center; min-height: 1.875rem; padding: 0.25rem 0.625rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); font-size: 0.8125rem; cursor: pointer; user-select: none; }
.siege-tool span { font-weight: 600; }
.siege-chip input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.siege-chip input:focus-visible + span, .siege-swatch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.siege-swatch span { display: block; width: 1.625rem; height: 1.625rem; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; }
.siege-swatch input:checked + span { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.swatch-red span { background: #ff4d4f; } .swatch-orange span { background: #ff9f1a; } .swatch-yellow span { background: #ffd60a; }
.swatch-green span { background: #3ddc84; } .swatch-cyan span { background: #2ec8ff; } .swatch-purple span { background: #b46cff; }
.swatch-white span { background: #ffffff; } .swatch-black span { background: #111111; }
.siege-dot { display: inline-block; border-radius: 50%; background: currentColor; }
.siege-dot.w-2 { width: 3px; height: 3px; } .siege-dot.w-4 { width: 5px; height: 5px; }
.siege-dot.w-7 { width: 8px; height: 8px; } .siege-dot.w-12 { width: 12px; height: 12px; }
.siege-inputs { gap: 0.5rem; flex-wrap: wrap; }
.siege-inputs input { flex: 1 1 180px; }
.siege-viewport { position: relative; overflow: auto; height: 76vh; border: 1px solid var(--line); border-radius: var(--radius);
  background: #0b0c10; touch-action: none; overscroll-behavior: contain; }
.siege-stage { position: relative; width: 100%; }
.siege-stage img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.siege-viewport { cursor: grab; }
.siege-viewport.is-panning { cursor: grabbing; }
[data-tool="marker"] .siege-viewport, [data-tool="gate"] .siege-viewport, [data-tool="pen"] .siege-viewport { cursor: crosshair; }
[data-tool="text"] .siege-viewport { cursor: text; }
[data-tool="eraser"] .siege-viewport { cursor: cell; }
.siege-ink { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.siege-line { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.8)); }
.siege-layer { position: absolute; inset: 0; pointer-events: none; }
.siege-marker { --c: #ffd60a; position: absolute; transform: translate(-50%, -100%); pointer-events: auto; border: 0; padding: 0;
  background: none; display: flex; flex-direction: column; align-items: center; cursor: inherit; touch-action: none; }
[data-tool="move"] .siege-marker { cursor: move; }
.siege-emoji { font-size: 1.75rem; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.9)); }
.siege-tag { margin-top: 2px; padding: 0 0.375rem; border-radius: 4px; background: rgba(0, 0, 0, 0.75); color: #fff;
  font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.siege-marker.kind-gate, .siege-marker.kind-text { transform: translate(-50%, -50%); }
.siege-ring { display: block; width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--c);
  background: color-mix(in srgb, var(--c) 18%, transparent); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(0, 0, 0, 0.5); }
.siege-marker.kind-gate .siege-tag { position: absolute; top: 100%; }
.siege-text { --c: #ffffff; color: var(--c); font-size: 1.0625rem; font-weight: 750; white-space: nowrap; letter-spacing: 0.01em;
  text-shadow: 0 0 3px #000, 0 0 3px #000, 0 1px 2px #000; }
.siege-marker.is-selected .siege-emoji, .siege-marker.is-selected .siege-text { filter: drop-shadow(0 0 4px #ffd166) drop-shadow(0 0 2px #ffd166); }
.siege-marker.is-selected .siege-ring { outline: 2px dashed #ffd166; outline-offset: 3px; }
.siege-textbox { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; width: 14rem; max-width: 70vw;
  padding: 0.25rem 0.5rem; font-size: 0.9375rem; border-radius: 6px; border: 2px solid var(--accent); background: var(--surface); color: var(--text); }
.siege-legend { list-style: none; padding: 0; margin: 0.75rem 0 0; display: flex; flex-wrap: wrap; gap: 0.375rem 1rem; color: var(--text-2); }
#siege-live.ok { background: var(--ok-soft); color: var(--ok); }
#siege-live.warn { background: var(--warn-soft); color: var(--warn); }

/* --- Member panel ----------------------------------------------------------------- */
.onboarding { border-left: 4px solid var(--accent); }
.onboarding h2 { margin-top: 0; }
.char-cards { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-bottom: 1.25rem; }
.char-card h2 { margin: 0; }
.char-card p { margin: 0.25rem 0; }
.char-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin: 0.75rem 0; }
.char-stats dt { font-size: 0.75rem; color: var(--text-2); }
.char-stats dd { margin: 0; font-size: 1.375rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.armory-hit .grow { flex: 1; min-width: 0; }
.roster { border-top: 1px solid var(--line); margin-top: 0.75rem; padding-top: 0.5rem; }
.roster p { margin: 0.375rem 0; }
.roster-list { list-style: none; margin: 0 0 0.5rem; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.roster-list li { display: flex; align-items: center; gap: 0.5rem; justify-content: space-between; flex-wrap: wrap; font-size: 0.875rem; }
.roster-list.pending li { background: var(--surface-2); border-radius: 6px; padding: 0.375rem 0.5rem; }
.apply-form { display: flex; flex-direction: column; gap: 0.375rem; margin-top: 0.375rem; }
