/* Гильдия Светлячков: ночная дорога приключений. Тёмная тема — сознательный единственный вид:
   вечер у костра, пергамент квестов и статблоков, янтарь фонаря.
   Раскладка: одна колонка чтения ~68ch, на телефоне — нижняя панель вкладок. */
:root {
  --bg: #12181A;
  --bg-deep: #0D1214;
  --surface: #1B2326;
  --surface-2: #161D1F;
  --surface-3: #1E2729;
  --line: #2B3836;
  --line-2: #33403F;
  --line-3: #4A5A55;
  --ink: #ECE5D3;
  --muted: #A8AD9B;
  --faint: #6E756A;
  --moss: #93C283;
  --moss-deep: #2E4A33;
  --moss-soft: #22332A;
  --ember: #F0A35E;
  --ember-ink: #1B1209;
  --ember-soft: #3A2A1D;
  --glow: #FFD36B;
  --plum: #CAA3DC;
  --plum-soft: #2E2436;
  --sky: #A9BFD9;
  --ok: #7FCF8E;
  --ok-soft: #1D3324;
  --ok-ink: #B9D8BE;
  --bad: #F19A8B;
  --bad-soft: #3D2420;
  --warn: #E8C35A;
  --warn-soft: #3A311A;
  --parch: #E8DCC0;
  --parch-2: #F1E6CC;
  --parch-ink: #2B2418;
  --parch-muted: #6B5A3E;
  --parch-line: #B5A584;
  --rubric: #7A1E14;
  --rubric-rule: #9C2B1E;
  --seal: #9E3B32;
  --code-bg: #0D1214;
  --code-ink: #DCD4C0;
  --shadow: 0 18px 40px -22px rgba(0, 0, 0, .9);

  --font-display: "Kurale", Georgia, "Times New Roman", serif;
  --font-body: "Alegreya Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-hand: "Marck Script", "Segoe Script", cursive;
  --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;

  --step--1: .875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: clamp(1.9rem, 4.4vw, 2.5rem);
  --radius: 16px;
  --radius-s: 10px;
  --read: 68ch;
  --nav-h: 0px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: var(--step-0); line-height: 1.6; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg-deep); }
img, svg { max-width: 100%; }
a { color: var(--moss); text-underline-offset: .18em; }
a:hover { color: var(--ember); }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.18; text-wrap: balance; margin: 0; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p { margin: 0; }
code, kbd, pre { font-family: var(--font-mono); font-size: .88em; }
:not(pre) > code { background: var(--code-bg); color: var(--code-ink); padding: .08em .38em; border-radius: 5px; border: 1px solid var(--line); }
kbd { border: 1px solid var(--line-2); border-bottom-width: 2px; padding: 0 .35em; border-radius: 5px; background: var(--surface); font-size: .75em; }
[hidden] { display: none !important; }
::selection { background: rgba(240, 163, 94, .35); }

.shell { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- Шапка и навигация ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  display: flex; align-items: center; gap: 10px 24px;
  padding-block: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: rgba(13, 18, 20, .9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand-mark { width: 30px; height: 34px; }
.brand-name { font-family: var(--font-display); font-size: 1.3rem; white-space: nowrap; }
.mainnav { display: flex; gap: 2px; flex: 1 1 auto; flex-wrap: wrap; }
.mainnav a {
  position: relative; text-decoration: none; color: var(--muted); padding: 7px 12px; border-radius: 999px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
}
.mainnav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.mainnav a:hover { color: var(--ink); background: var(--surface); }
.mainnav a[aria-current="page"] { color: var(--ink); background: var(--moss-soft); }
.badge { font-size: .72rem; font-weight: 700; line-height: 1; padding: 3px 7px; border-radius: 999px; background: var(--ember); color: var(--ember-ink); font-variant-numeric: tabular-nums; }
.topbar-meta { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: var(--step--1); flex: none; }
.fireflies { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fireflies::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 10px 2px rgba(255, 211, 107, .55); }
.account { display: inline-flex; align-items: center; gap: 8px; }
.account .who { color: var(--ink); max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account .logout svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

@media (min-width: 901px) and (max-width: 1180px) {
  .brand-name { display: none; }
  .mainnav a { padding: 7px 9px; gap: 5px; }
}
@media (max-width: 900px) {
  :root { --nav-h: calc(62px + env(safe-area-inset-bottom, 0px)); }
  /* backdrop-filter у шапки сделал бы её точкой отсчёта для fixed-панели вкладок */
  .topbar { position: static; backdrop-filter: none; background: var(--bg-deep); }
  .brand-name { font-size: 1.12rem; }
  .mainnav {
    position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; flex-wrap: nowrap; gap: 0;
    height: var(--nav-h); padding: 6px max(6px, env(safe-area-inset-left, 0px)) env(safe-area-inset-bottom, 0px) max(6px, env(safe-area-inset-right, 0px));
    background: rgba(13, 18, 20, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
    justify-content: space-around;
  }
  .mainnav a { flex: 1 1 0; flex-direction: column; gap: 2px; padding: 4px 2px; font-size: .7rem; border-radius: 12px; min-width: 0; }
  .mainnav a span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .mainnav svg { width: 22px; height: 22px; }
  .mainnav .badge { position: absolute; top: 0; right: calc(50% - 22px); padding: 2px 5px; }
  .topbar-meta { margin-left: auto; gap: 8px; min-width: 0; }
  .account .who, .account .admin-link, .fireflies .lbl { display: none; }
  .account .logout { min-height: 40px; min-width: 40px; padding: 0; }
  .account .logout .txt { display: none; }
  .topbar { gap: 8px; }
}

main {
  flex: 1; width: 100%; max-width: 1200px; margin: 0 auto;
  padding-block: 28px calc(56px + var(--nav-h));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  outline: none;
}
.foot {
  display: flex; gap: 6px 20px; flex-wrap: wrap; justify-content: space-between;
  padding-block: 16px calc(16px + var(--nav-h));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  color: var(--faint); font-size: var(--step--1); border-top: 1px solid var(--line);
}
.foot a { color: var(--muted); }

/* ---------- Базовые элементы ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-l { display: flex; flex-direction: column; gap: 30px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.eyebrow { font-size: var(--step--1); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }
.read { max-width: var(--read); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; min-width: 0; }
.panel-quiet { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.grid-2 { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
.page-head { display: flex; flex-direction: column; gap: 8px; max-width: 760px; }
.page-head p { color: var(--muted); }

.btn {
  font: inherit; font-weight: 500; cursor: pointer; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line-3);
  background: transparent; color: var(--ink); text-decoration: none; line-height: 1.2;
}
.btn:hover { border-color: var(--moss); color: var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--ember); border-color: var(--ember); color: var(--ember-ink); font-weight: 700; }
.btn-primary:hover { background: #F5B474; border-color: #F5B474; color: var(--ember-ink); }
.btn-moss { background: var(--moss-deep); border-color: var(--moss-deep); color: #F3E9D0; font-weight: 700; }
.btn-moss:hover { background: #3A5C40; color: #F3E9D0; border-color: #3A5C40; }
.btn-ghost { border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); background: var(--surface); border-color: transparent; }
.btn-s { min-height: 34px; padding: 0 12px; font-size: var(--step--1); }
.ico { width: 20px; height: 20px; flex: none; }
.ico-l { width: 30px; height: 30px; }
.ico-xl { width: 38px; height: 38px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="tel"], input:not([type]), select, textarea {
  font: inherit; color: var(--ink); background: var(--bg-deep); border: 1.5px solid var(--line-2);
  border-radius: var(--radius-s); padding: 9px 12px; width: 100%; min-width: 0; min-height: 44px;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
textarea.code, input.code { font-family: var(--font-mono); font-size: .9rem; color: var(--code-ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(147, 194, 131, .45); outline-offset: 0; border-color: var(--moss); }
label { display: flex; flex-direction: column; gap: 5px; font-size: var(--step--1); color: var(--muted); }
label > span { color: var(--ink); font-weight: 500; }
.check { flex-direction: row; align-items: flex-start; gap: 10px; font-size: var(--step-0); color: var(--ink); cursor: pointer; }
.check input { margin-top: .3em; accent-color: var(--moss); width: 18px; height: 18px; flex: none; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line-2); }
.pill-done { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill-known { background: var(--plum-soft); color: var(--plum); border-color: transparent; }
.pill-now { background: var(--ember-soft); color: var(--ember); border-color: transparent; }
.pill-must { background: var(--ember-soft); color: var(--ember); border-color: transparent; }
.pill-often { background: var(--moss-soft); color: var(--moss); border-color: transparent; }
.meter { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter > i { display: block; height: 100%; background: linear-gradient(90deg, var(--moss), var(--glow)); border-radius: inherit; }

/* ---------- Пергамент, печать, статблок ---------- */
.parchment {
  position: relative; background: var(--parch); color: var(--parch-ink); border-radius: 6px;
  padding: 24px 26px; box-shadow: var(--shadow);
  background-image: radial-gradient(ellipse at 20% 10%, rgba(255, 250, 235, .45), transparent 55%), radial-gradient(ellipse at 85% 90%, rgba(120, 90, 40, .16), transparent 60%);
}
.parchment::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 40px rgba(107, 90, 62, .28); }
.parchment a:not(.btn) { color: #2E5A33; }
.parchment .btn { color: var(--parch-ink); border-color: #8C7A5C; }
.parchment .btn-moss, .parchment .btn-moss:hover { color: #F3E9D0; border-color: var(--moss-deep); }
.parchment .btn-primary, .parchment .btn-primary:hover { color: var(--ember-ink); }
.parchment .eyebrow { color: var(--parch-muted); }
.parchment code { background: #D9CAA6; color: var(--parch-ink); border-color: #C2AE84; }
.seal { position: absolute; top: 16px; right: 18px; width: 44px; height: 44px; }
.rule { display: block; width: 100%; height: 6px; }
.statblock { box-shadow: 0 0 0 1px var(--parch-muted), 0 0 0 5px var(--surface), 0 0 0 6px var(--parch-muted), var(--shadow); border-radius: 4px; }
.statblock h2 { color: var(--rubric); }
.statblock .sub { font-style: italic; color: #4A3E2C; font-size: .95rem; }
.statblock b { color: var(--rubric); }
.abilities { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; text-align: center; }
.abilities .ab { display: flex; flex-direction: column; }
.abilities .ab b { font-size: .85rem; letter-spacing: .05em; }
.abilities .ab span { font-variant-numeric: tabular-nums; }
.abilities .ab small { font-size: .74rem; color: var(--parch-muted); line-height: 1.2; }
@media (max-width: 520px) { .abilities { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 10px; } }

/* ---------- Реплика Искры ---------- */
.iskra-ava {
  flex: none; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; display: block;
  background: radial-gradient(circle at 50% 70%, #5A2E22, #241614); border: 2px solid #8C6A3A;
  box-shadow: 0 0 0 3px var(--bg), 0 0 22px -6px rgba(255, 211, 107, .6);
}
.iskra-ava svg { width: 100%; height: 100%; display: block; }
.speech { display: flex; gap: 14px; align-items: center; max-width: 76ch; }
.speech .bubble { position: relative; background: var(--surface-3); border: 1px solid var(--line-2); border-radius: 18px; padding: 12px 16px; min-width: 0; }
.speech .bubble::before { content: ""; position: absolute; left: -7px; top: 50%; width: 12px; height: 12px; margin-top: -6px; background: inherit; border-left: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); transform: rotate(45deg); }
.speech .hand { font-family: var(--font-hand); font-size: 1.45rem; line-height: 1.3; color: #F3D9A8; }
.speech .who { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.speech.warn .bubble { background: #2A1F1A; border-color: #5E3E2E; }
.speech.warn .bubble::before { border-color: #5E3E2E; }
.speech .tag { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ember); }
@media (max-width: 520px) { .speech .hand { font-size: 1.25rem; } .iskra-ava { width: 52px; height: 52px; } }

/* ---------- Сцена у костра ---------- */
.scene { position: relative; overflow: hidden; container-type: size; background: #121A24; }
.scene-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene-overlay { position: absolute; inset: 0; pointer-events: none; --u: max(calc(100cqw / 720), calc(100cqh / 460)); }
.scene-pet { position: absolute; left: calc(50% + (189 - 360) * var(--u)); top: calc(50% + (232 - 230) * var(--u)); width: calc(150 * var(--u)); height: calc(137.5 * var(--u)); }
.scene-pet svg { width: 100%; height: 100%; overflow: visible; display: block; }

/* ---------- Очаг ---------- */
.hearth-top { display: grid; gap: 26px; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: stretch; }
@media (max-width: 900px) { .hearth-top { grid-template-columns: 1fr; } }
.hero-scene { border-radius: 18px; border: 1px solid var(--line); position: relative; align-self: start; width: 100%; max-width: 100%; aspect-ratio: 720 / 540; min-height: 320px; overflow: hidden; }
.hero-scene .scene { position: absolute; inset: 0; }
.hero-chips { position: absolute; left: 16px; right: 16px; bottom: 14px; display: flex; flex-wrap: wrap; gap: 8px; z-index: 1; }
.hero-chips span { background: rgba(18, 24, 26, .85); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 12px; font-size: .85rem; }
@media (max-width: 900px) { .hero-scene { aspect-ratio: 720 / 500; min-height: 0; } .hero-chips span:nth-child(3) { display: none; } }
.quest { display: flex; flex-direction: column; gap: 10px; padding-right: 64px; }
.quest h1, .quest h2 { font-size: clamp(1.6rem, 3.4vw, 2.1rem); }
.quest ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.quest li { display: flex; gap: 8px; }
.quest li .m { width: 1.1em; flex: none; color: #8A7A5C; }
.quest li.ok .m { color: #2E6B3B; }
.quest .foot-line { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 4px; }
.quest .reward { font-size: .92rem; color: var(--parch-muted); }
@media (max-width: 520px) { .quest { padding-right: 0; } .quest .eyebrow { padding-right: 40px; } .parchment .seal { width: 34px; height: 34px; top: 10px; right: 10px; } .parchment { padding: 22px 18px; } }

.tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.tile { display: flex; gap: 16px; align-items: center; text-decoration: none; color: var(--ink); background: linear-gradient(180deg, var(--surface-3), #182022); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile:hover { border-color: var(--line-3); color: var(--ink); }
.tile .art { flex: none; width: 74px; height: 74px; border-radius: 14px; background: #121A1C; border: 1px solid var(--line-2); display: grid; place-items: center; }
.tile .art svg { width: 58px; height: 58px; }
.tile strong { font-family: var(--font-display); font-weight: 400; font-size: 1.2rem; display: block; }
.tile .t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile .t span { color: var(--muted); font-size: .95rem; }
.tile .cta { color: var(--ember) !important; }

.candles { display: flex; gap: 6px; flex-wrap: wrap; }
.candle { width: 46px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .85rem; color: var(--muted); }
.candle svg { width: 34px; height: 50px; }
.candle.today { color: var(--ink); font-weight: 700; }

/* ---------- Карта ---------- */
.map-frame { border-radius: 18px; border: 1px solid var(--line); background: #0F1517; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.map-inner { position: relative; min-width: 760px; container-type: inline-size; }
.map-inner > svg { display: block; width: 100%; height: auto; }
.map-node { position: absolute; transform: translate(-50%, -62%); display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--ink); }
.map-node .halo { position: absolute; left: 50%; top: 34px; width: 150px; height: 150px; margin: -75px 0 0 -75px; border-radius: 50%; pointer-events: none; }
.map-node .crest { position: relative; width: 62px; height: 78px; display: block; transition: transform .2s; }
.map-node:hover .crest, .map-node:focus-visible .crest { transform: translateY(-3px) scale(1.05); }
.map-node .sign { position: relative; margin-top: 4px; padding: 3px 16px 4px 12px; background: linear-gradient(180deg, #4A3828, #33261A); border: 1px solid #6B5C47; clip-path: polygon(0 0, 92% 0, 100% 50%, 92% 100%, 0 100%); font-family: var(--font-display); font-size: .9rem; white-space: nowrap; }
.map-node .prog { position: relative; font-size: .75rem; color: var(--muted); white-space: nowrap; }
@container (max-width: 980px) {
  .map-node .crest { width: 48px; height: 60px; }
  .map-node .halo { top: 26px; width: 110px; height: 110px; margin: -55px 0 0 -55px; }
  .map-node .sign { font-size: .74rem; padding: 2px 11px 3px 8px; }
  .map-node .prog { font-size: .68rem; }
}
.map-node.next .sign { background: linear-gradient(180deg, #6A4A24, #4A3218); border-color: var(--ember); }
.map-hint { font-size: .85rem; color: var(--muted); }
@media (max-width: 900px) { .map-hint { display: block; } }
@media (min-width: 901px) { .map-hint { display: none; } }

.region-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.region-card { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 6px 14px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.region-card:hover { border-color: var(--line-3); color: var(--ink); }
.region-card .crest { width: 58px; height: 73px; grid-row: span 2; }
.region-card h3 { font-size: 1.12rem; }
.region-card .meta { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.region-card p { color: var(--muted); font-size: .92rem; line-height: 1.45; }

/* ---------- Регион ---------- */
.region-head { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 22px; align-items: start; }
.region-head .crest { width: 110px; height: 139px; }
@media (max-width: 520px) { .region-head { grid-template-columns: 72px minmax(0, 1fr); gap: 14px; } .region-head .crest { width: 72px; height: 91px; } }
.quest-list { display: flex; flex-direction: column; gap: 8px; list-style: none; padding: 0; margin: 0; }
.quest-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); }
.quest-row:hover { border-color: var(--line-3); color: var(--ink); }
.quest-row .n { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); background: var(--surface-2); border: 1px solid var(--line-2); color: var(--muted); }
.quest-row.done .n { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.quest-row.known .n { background: var(--plum-soft); color: var(--plum); border-color: transparent; }
.quest-row .t { display: flex; flex-direction: column; min-width: 0; }
.quest-row .t small { color: var(--muted); }
@media (max-width: 520px) { .quest-row { grid-template-columns: 36px minmax(0, 1fr); } .quest-row > .pill { grid-column: 2; justify-self: start; } }
.gate-card { display: flex; gap: 16px; align-items: center; }
.gate-card .d20 { width: 64px; height: 64px; flex: none; }

/* ---------- Урок ---------- */
.lesson { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 32px; align-items: start; }
@media (max-width: 980px) { .lesson { grid-template-columns: 1fr; } }
.lesson-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
/* Дети flex-колонки по умолчанию не уже своего содержимого: широкие таблицы раздвигали страницу */
.lesson-main > *, .practice > *, .stack > * { min-width: 0; max-width: 100%; }
.prose table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.lesson-aside { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (max-width: 980px) { .lesson-aside { position: static; order: 2; } }
.crumbs { font-size: var(--step--1); color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.lesson-head { display: flex; flex-direction: column; gap: 10px; }
.lesson-head h1 { color: var(--parch-ink); }
.goals { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 3px; }
.journal-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.journal-card h3 { font-size: 1.15rem; }
.journal-card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: .95rem; }
.journal-card li { display: flex; gap: 8px; }
.journal-card li .m { color: var(--faint); width: 1em; flex: none; }
.journal-card li.ok { color: var(--ink); }
.journal-card li.ok .m { color: var(--ok); }
.journal-card li:not(.ok) { color: var(--muted); }
.prose { max-width: var(--read); min-width: 0; }
.prose > * + * { margin-top: 12px; }
.prose ul, .prose ol { margin-bottom: 0; padding-left: 1.3em; }
.prose li + li { margin-top: 4px; }
.prose h3 { margin-top: 24px; }
.prose h4 { font-family: var(--font-body); font-weight: 700; font-size: var(--step-0); }
.prose b, .prose strong { color: #F6EEDC; }
.prose table, .tbl { border-collapse: collapse; width: 100%; font-size: .95rem; }
.prose th, .prose td, .tbl th, .tbl td { border: 1px solid var(--line-2); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th, .tbl th { background: var(--surface-2); font-weight: 600; }
.table-scroll { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.prose blockquote { margin: 0; padding: 8px 14px; border-left: 3px solid var(--plum); color: var(--muted); }
.prose pre { overflow-x: auto; background: var(--code-bg); color: var(--code-ink); padding: 12px 14px; border-radius: var(--radius-s); border: 1px solid var(--line); }
.parchment .prose b, .parchment .prose strong { color: var(--parch-ink); }

.note { border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; max-width: var(--read); border: 1px solid var(--line-2); }
.note .note-title { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.note-tip { background: var(--moss-soft); border-color: #2F4A3A; }
.note-tip .note-title { color: var(--moss); }
.note-warn { background: var(--warn-soft); border-color: #5A4A22; }
.note-warn .note-title { color: var(--warn); }
.note-market { background: var(--ember-soft); border-color: #5E422A; }
.note-market .note-title { color: var(--ember); }
.note ul, .note ol { margin: 0; padding-left: 1.2em; }

.example { border: 1px dashed var(--line-3); border-radius: 14px; padding: 14px 16px; max-width: var(--read); display: flex; flex-direction: column; gap: 8px; background: rgba(202, 163, 220, .04); }
.example > .eyebrow { color: var(--plum); }

.codeblock { position: relative; max-width: 100%; margin: 0; }
.codeblock pre { margin: 0; background: var(--code-bg); color: var(--code-ink); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 16px 18px; overflow-x: auto; line-height: 1.55; white-space: pre; tab-size: 2; }
.codeblock .cap { font-size: var(--step--1); color: var(--muted); margin-top: 6px; }
.codeblock .lang { position: absolute; top: 6px; right: 10px; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }

.sources { font-size: .95rem; }
.sources ul { margin: 6px 0 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; }
.lesson-nav { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 18px; }
.lesson-nav .btn { max-width: 100%; }
.lesson-nav .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Практика ---------- */
.practice { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.practice > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.practice > header .kind { display: inline-flex; align-items: center; gap: 8px; font-size: var(--step--1); letter-spacing: .08em; text-transform: uppercase; color: var(--plum); }
.practice.passed { border-color: #3E6A48; }
.practice .prompt { max-width: var(--read); }
@media (max-width: 520px) { .practice { padding: 14px; } }
.q { display: flex; flex-direction: column; gap: 10px; }
.q + .q { border-top: 1px dashed var(--line-2); padding-top: 14px; }
.q-text { font-weight: 600; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; padding: 11px 13px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--surface-2); cursor: pointer; text-align: left; font: inherit; color: var(--ink); }
.opt:hover { border-color: var(--line-3); }
.opt input { margin: .3em 0 0; accent-color: var(--moss); width: 16px; height: 16px; }
.opt.is-ok { border-color: var(--ok); background: var(--ok-soft); }
.opt.is-bad { border-color: var(--bad); background: var(--bad-soft); }
.opt .why { grid-column: 2; font-size: .92rem; color: var(--muted); }
.opt.is-ok .why { color: var(--ok-ink); }
.feedback { border-radius: 12px; padding: 10px 14px; font-size: .97rem; }
.feedback.ok { background: var(--ok-soft); color: var(--ok); }
.feedback.bad { background: var(--bad-soft); color: var(--bad); }
.feedback.info { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.feedback .fb-body { color: var(--ink); margin-top: 4px; }

.order-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.order-item { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1.5px solid var(--line-2); border-radius: 12px; background: var(--surface-2); }
.order-item .n { color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; font-family: var(--font-display); }
.order-item .mv { display: flex; gap: 2px; }
.order-item .mv .btn { min-height: 36px; min-width: 36px; padding: 0; }
.order-item.ok { border-color: var(--ok); }
.order-item.bad { border-color: var(--bad); }

.result-table-wrap { overflow: auto; max-height: 340px; border: 1px solid var(--line); border-radius: var(--radius-s); }
.result-table { border-collapse: collapse; font-family: var(--font-mono); font-size: .82rem; width: max-content; min-width: 100%; }
.result-table th, .result-table td { padding: 6px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.result-table th { position: sticky; top: 0; background: var(--surface-2); }
.result-table td.null { color: var(--faint); font-style: italic; }
.schema { display: flex; gap: 6px; flex-wrap: wrap; font-family: var(--font-mono); font-size: .78rem; }
.schema details { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 10px; }
.schema summary { cursor: pointer; font-weight: 600; }
.schema ul { margin: 6px 0 0; padding-left: 1.1em; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
.reqline { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 8px; }
@media (max-width: 560px) { .reqline { grid-template-columns: 96px minmax(0, 1fr); } .reqline .btn { grid-column: 1 / -1; } }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabs button { font: inherit; font-size: var(--step--1); background: none; border: 0; padding: 9px 12px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; min-height: 40px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ember); }
.status-chip { font-family: var(--font-mono); font-size: .85rem; padding: 2px 8px; border-radius: 6px; }
.status-2 { background: var(--ok-soft); color: var(--ok); }
.status-3 { background: var(--plum-soft); color: var(--plum); }
.status-4 { background: var(--warn-soft); color: var(--warn); }
.status-5 { background: var(--bad-soft); color: var(--bad); }
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; font-family: var(--font-mono); font-size: .78rem; }
.history li { display: flex; gap: 8px; align-items: center; }
.testres { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: .92rem; }
.testres li::before { content: "● "; }
.testres li.pass { color: var(--ok); }
.testres li.fail { color: var(--bad); }
.goal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: .95rem; }

/* Лавка зелий: светлая витрина-пергамент внутри тёмной страницы, чтобы песочница читалась как отдельное приложение */
.shop { border: 1px solid #6B5C47; border-radius: var(--radius); padding: 16px; background: var(--parch); color: var(--parch-ink); display: flex; flex-direction: column; gap: 14px; }
.shop h4 { font-family: var(--font-display); font-weight: 400; font-size: 1.25rem; margin: 0; }
.shop .goods { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.shop .good { background: var(--parch-2); border: 1px solid var(--parch-line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.shop .good .price { font-variant-numeric: tabular-nums; }
.shop .cart-line { display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; }
.shop .err { color: #9C2B1E; font-size: var(--step--1); }
.shop .okmsg { color: #2E6B3B; }
.shop .muted, .shop .small.muted { color: var(--parch-muted); }
.shop input, .shop select { background: #FBF6E8; color: var(--parch-ink); border-color: var(--parch-line); color-scheme: light; }
.shop label, .shop label > span { color: var(--parch-ink); }
.shop .btn { color: var(--parch-ink); border-color: #8C7A5C; }
.shop .btn-moss { color: #F3E9D0; border-color: var(--moss-deep); }
.shop .btn-ghost { color: var(--parch-muted); }
.shop .pill { background: #F1E6CC; color: var(--parch-muted); border-color: var(--parch-line); }
.spec { font-size: .95rem; }
.spec li { margin-bottom: 2px; }
.cov-table td.yes { color: var(--ok); }
.cov-table td.no { color: var(--faint); }

/* ---------- Сад памяти ---------- */
.plaque-wrap { max-width: 720px; width: 100%; margin: 0 auto; }
.plaque-posts { display: block; width: 100%; height: 26px; }
.flash { display: flex; flex-direction: column; gap: 18px; min-height: 260px; }
.flash .front { font-family: var(--font-display); font-size: clamp(1.35rem, 3vw, 1.85rem); line-height: 1.3; }
.flash .back { border-top: 1px dashed var(--parch-line); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.rate { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .rate { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rate .btn { flex-direction: column; border-radius: 12px; gap: 2px; min-height: 62px; background: var(--parch-2); color: var(--parch-ink); border-color: var(--parch-line); }
.rate .btn small { color: var(--parch-muted); font-weight: 400; }
.rate .again { border-color: #B8564A; }
.rate .good { background: var(--moss-deep); color: #F3E9D0; border-color: var(--moss-deep); font-weight: 700; }
.rate .good small { color: #C9DCC2; }
.rate .easy { border-color: #4F7A4A; }
.beds { display: flex; flex-wrap: wrap; gap: 14px 22px; }
.bed { display: flex; flex-direction: column; gap: 6px; min-width: 140px; }
.bed .soil { display: flex; gap: 3px; align-items: flex-end; background: #2A2219; border-radius: 8px; padding: 6px 8px 4px; flex-wrap: wrap; max-width: 320px; }
.bed .soil svg { width: 22px; height: 32px; }

/* ---------- Дневник, бестиарий, сундук, админка ---------- */
.entry { display: flex; flex-direction: column; gap: 8px; }
.entry dl { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: .95rem; }
.entry dt { color: var(--muted); }
.entry dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 560px) { .entry dl { grid-template-columns: 1fr; } .entry dt { margin-top: 6px; } }
.stars { color: var(--glow); letter-spacing: 2px; }
.beast { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 14px; align-items: start; }
.beast .mimic-mini { width: 64px; height: 54px; grid-row: span 3; }
.beast .mimic-mini svg { width: 100%; height: 100%; }
.beast.caught { border-color: #3E6A48; }
.mimic-hero { width: 180px; height: 150px; flex: none; }
.mimic-hero svg { width: 100%; height: 100%; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.admin-table th, .admin-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.admin-table th { color: var(--muted); font-weight: 500; font-size: .85rem; }
.admin-table td.num { font-variant-numeric: tabular-nums; }

/* ---------- Вход ---------- */
.login-page { min-height: calc(100vh - 140px); display: grid; place-items: center; }
.login-card { width: min(100%, 440px); display: flex; flex-direction: column; gap: 14px; }
.login-scene { height: 220px; border-radius: 18px 18px 0 0; overflow: hidden; position: relative; border: 1px solid var(--line); border-bottom: 0; }
.login-scene .scene { position: absolute; inset: 0; }
.login-card .parchment { border-radius: 0 0 8px 8px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card label, .login-card label > span { color: var(--parch-ink); }
.login-card input { background: #FBF6E8; color: var(--parch-ink); border-color: var(--parch-line); color-scheme: light; }
.login-card .pw-btn { color: var(--parch-muted); }
.login-card .pw-btn:hover { background: #E2D4B2; color: var(--parch-ink); }
.login-card .pw-wrap input { padding-right: 52px; }
.login-error { color: #9C2B1E; min-height: 1.4em; font-size: .95rem; }

/* ---------- Тосты и пустые состояния ---------- */
.toast-zone { position: fixed; z-index: 20; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + var(--nav-h) + env(safe-area-inset-bottom, 0px)); left: max(16px, env(safe-area-inset-left, 0px)); pointer-events: none; }
.toast { pointer-events: auto; max-width: 400px; background: var(--parch); color: var(--parch-ink); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); font-size: .95rem; animation: toast-in .25s ease-out; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); display: flex; flex-direction: column; gap: 12px; align-items: center; }
.empty .art { width: 150px; height: 130px; }
.empty .art svg { width: 100%; height: 100%; }

/* ---------- Анимации ---------- */
@keyframes fx-blink { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
@keyframes fx-drift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(7px, -9px); } }
@keyframes fx-flame { 0%, 100% { transform: scaleY(1) skewX(0); } 33% { transform: scaleY(1.1) skewX(2deg); } 66% { transform: scaleY(.95) skewX(-2deg); } }
@keyframes fx-fall { 0% { transform: translate(0, -40px) rotate(0); } 100% { transform: translate(40px, 500px) rotate(320deg); } }
@keyframes fx-snow { 0% { transform: translate(0, -30px); } 50% { transform: translate(-10px, 230px); } 100% { transform: translate(6px, 500px); } }
@keyframes fx-flag { 0%, 100% { transform: skewY(0); } 50% { transform: skewY(6deg); } }
@keyframes fx-ember { 0% { opacity: 0; transform: translate(0, 0); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(10px, -90px); } }
@keyframes fx-breath { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
.fx-fly { animation: fx-blink 3.4s ease-in-out infinite, fx-drift 8s ease-in-out infinite; }
.fx-fly:nth-of-type(2n) { animation-delay: 1.2s, 2.4s; }
.fx-fly:nth-of-type(3n) { animation-delay: 2.1s, .7s; }
.fx-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: fx-flame 1.4s ease-in-out infinite; }
.fx-fall { animation: fx-fall linear infinite; }
.fx-snow { animation: fx-snow linear infinite; }
.fx-flag { transform-box: fill-box; transform-origin: 0 50%; animation: fx-flag 3s ease-in-out infinite; }
.fx-ember { animation: fx-ember 2.6s ease-out infinite; }
.fx-ember:nth-of-type(2) { animation-delay: .9s; }
.fx-ember:nth-of-type(3) { animation-delay: 1.7s; }
.ik-body { animation: fx-breath 4.5s ease-in-out infinite; }

/* Момент «квест выполнен»: печать падает, светлячки разлетаются */
@keyframes fx-stamp { 0% { opacity: 0; transform: scale(2.2) rotate(-18deg); } 60% { opacity: 1; transform: scale(.92) rotate(4deg); } 100% { opacity: 1; transform: none; } }
@keyframes fx-burst { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1); } }
@keyframes fx-rise { 0% { opacity: 0; transform: translateY(10px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-30px); } }
.celebrate { position: fixed; inset: 0; z-index: 30; pointer-events: none; display: grid; place-items: center; }
.celebrate .seal-big .seal { position: static; width: 100%; height: 100%; }
.celebrate .seal-big { width: 120px; height: 120px; animation: fx-stamp .6s cubic-bezier(.2, .9, .3, 1.2) both; }
.celebrate .spark { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px; border-radius: 50%; background: radial-gradient(circle, #FFE7A3, rgba(255, 211, 107, 0) 70%); animation: fx-burst 1.2s ease-out both; }
.celebrate .plus { position: absolute; left: 50%; top: calc(50% - 90px); transform: translateX(-50%); font-family: var(--font-display); font-size: 2rem; color: var(--glow); animation: fx-rise 1.6s ease-out both; }
@keyframes fx-roll { 0% { transform: translate(-140px, -40px) rotate(0); } 70% { transform: translate(6px, 4px) rotate(700deg); } 85% { transform: translate(-3px, 0) rotate(735deg); } 100% { transform: translate(0, 0) rotate(720deg); } }
.d20-roll { width: 120px; height: 120px; animation: fx-roll 1.3s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes fx-grow { 0% { transform: scale(.6); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
.fx-grow { transform-box: fill-box; transform-origin: 50% 100%; animation: fx-grow .8s ease-out both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition: none !important; }
  .fx-fall, .fx-snow, .fx-fly, .fx-ember { display: none; }
}

/* ---------- Поле пароля и редактор аккаунта ---------- */
.pw-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pw-field label { font-size: var(--step--1); }
.pw-wrap { position: relative; display: flex; align-items: center; }
.pw-wrap input { padding-right: 132px; font-family: var(--font-mono); font-size: .95rem; letter-spacing: .02em; }
.pw-actions { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: flex; gap: 2px; }
.pw-btn { width: 40px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.pw-btn:hover { color: var(--ink); background: var(--surface-3); }
.pw-btn[aria-pressed="true"] { color: var(--ember); }
.pw-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pw-hint { display: flex; align-items: center; gap: 10px; font-size: .82rem; color: var(--muted); }
.pw-meter { flex: 0 0 72px; height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; }
.pw-meter i { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .2s; }
.pw-meter i.s1 { background: var(--bad); }
.pw-meter i.s2 { background: var(--warn); }
.pw-meter i.s3 { background: var(--ok); }

.user-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); border: 1px solid var(--line-2); border-radius: 18px; background: var(--surface); color: var(--ink); padding: 0; box-shadow: var(--shadow); }
.user-dialog::backdrop { background: rgba(5, 8, 9, .72); backdrop-filter: blur(2px); }
.user-dialog form { display: flex; flex-direction: column; gap: 14px; padding: 22px 24px; }
.user-dialog header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.user-dialog .switch { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; color: var(--ink); font-size: var(--step-0); cursor: pointer; }
.user-dialog .switch input { width: 20px; height: 20px; accent-color: var(--moss); }
.user-dialog .danger { border-top: 1px dashed var(--line-2); padding-top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn-danger { border-color: #8E3B32; color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.user-cell { display: flex; flex-direction: column; min-width: 0; }
.role-pill { display: inline-flex; font-size: .72rem; padding: 1px 8px; border-radius: 999px; background: var(--plum-soft); color: var(--plum); margin-left: 6px; vertical-align: middle; }
.role-pill.off { background: var(--bad-soft); color: var(--bad); }
.admin-table tr.is-off td:not(:last-child) { opacity: .55; }
@media (max-width: 640px) {
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tr { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
  .admin-table td { border: 0; padding: 3px 0; }
  .admin-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
}
