/* The panel's look. No outside fonts or pictures: the page loads nothing but
   its own files. Icons are drawn as CSS masks so they take the text colour. */

:root {
  color-scheme: light dark;
  --bg: #f3f1ec;
  --surface: #ffffff;
  --inset: #f7f6f2;
  --ink: #191a1f;
  --muted: #68665e;
  --line: #e3e0d7;
  --line-strong: #cdc9bd;
  --accent: #2f55e0;
  --accent-strong: #2143c2;
  --accent-ink: #ffffff;
  --accent-soft: #e8edff;
  --warn: #8f5400;
  --warn-soft: #fbf0d9;
  --ok: #1a7446;
  --ok-soft: #e0f3e8;
  --bad: #b3261e;
  --bad-soft: #fbe7e4;
  --field: #ffffff;
  --side: #15171d;
  --side-ink: #edece7;
  --side-muted: #9d9c95;
  --side-line: #272a33;
  --side-hover: rgba(255, 255, 255, 0.06);
  --side-active: rgba(255, 255, 255, 0.11);
  --glow: rgba(47, 85, 224, 0.1);
  --shadow: 0 1px 2px rgba(22, 24, 30, 0.04), 0 10px 28px -16px rgba(22, 24, 30, 0.18);
  --shadow-lift: 0 2px 4px rgba(22, 24, 30, 0.05), 0 18px 36px -18px rgba(22, 24, 30, 0.26);
  --telegram: #2aa3e0;
  --discord: #5865f2;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --round: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a20;
    --inset: #1d2129;
    --ink: #ecebe6;
    --muted: #a3a29a;
    --line: #2a2e38;
    --line-strong: #3a3f4c;
    --accent: #8eaaff;
    --accent-strong: #aabfff;
    --accent-ink: #0d1530;
    --accent-soft: #1b2444;
    --warn: #f0b95a;
    --warn-soft: #33290f;
    --ok: #7fd3a6;
    --ok-soft: #14301f;
    --bad: #ff9d94;
    --bad-soft: #3a1815;
    --field: #11141a;
    --side: #0b0c10;
    --side-line: #1c1f28;
    --glow: rgba(142, 170, 255, 0.09);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 28px -18px rgba(0, 0, 0, 0.7);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.35), 0 18px 36px -18px rgba(0, 0, 0, 0.8);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15.5px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

/* --- the frame: a dark rail on the left, the page on the right ------------------ */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 14px 18px;
  background: var(--side);
  color: var(--side-ink);
  border-right: 1px solid var(--side-line);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px; }
.logo {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(145deg, #5b7dff, #2f55e0);
  box-shadow: 0 6px 16px -6px rgba(47, 85, 224, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  display: grid;
  place-items: center;
}
.logo::before {
  content: "";
  width: 22px;
  height: 22px;
  background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='8' width='16' height='11' rx='3'/%3E%3Cpath d='M12 4.5V8M9 13v1.5M15 13v1.5M1.8 12.5v2.5M22.2 12.5v2.5'/%3E%3Ccircle cx='12' cy='3.3' r='1.1'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='8' width='16' height='11' rx='3'/%3E%3Cpath d='M12 4.5V8M9 13v1.5M15 13v1.5M1.8 12.5v2.5M22.2 12.5v2.5'/%3E%3Ccircle cx='12' cy='3.3' r='1.1'/%3E%3C/svg%3E") center / contain no-repeat;
}
.brand h1 { margin: 0; font: 700 1.02rem/1.15 var(--round); letter-spacing: 0.005em; white-space: nowrap; }
.brand p { margin: 2px 0 0; color: var(--side-muted); font-size: 0.8rem; line-height: 1.2; }

.tabs { display: grid; gap: 2px; }
.tabs a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--side-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background-color 0.15s, color 0.15s;
}
.tabs a::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.tabs a[data-tab="overview"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='9' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='5' rx='1.5'/%3E%3Crect x='14' y='12' width='7' height='9' rx='1.5'/%3E%3Crect x='3' y='16' width='7' height='5' rx='1.5'/%3E%3C/svg%3E"); }
.tabs a[data-tab="settings"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h8M16 6h4M4 12h2M10 12h10M4 18h10M18 18h2'/%3E%3Ccircle cx='14' cy='6' r='2'/%3E%3Ccircle cx='8' cy='12' r='2'/%3E%3Ccircle cx='16' cy='18' r='2'/%3E%3C/svg%3E"); }
.tabs a[data-tab="cases"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l8 3v6c0 4.5-3.2 8-8 9-4.8-1-8-4.5-8-9V6l8-3z'/%3E%3Cpath d='M9 12l2.2 2.2L15.5 10'/%3E%3C/svg%3E"); }
.tabs a[data-tab="knowledge"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 6.5C10.5 5 8.3 4.5 4 4.5v13c4.3 0 6.5.5 8 2 1.5-1.5 3.7-2 8-2v-13c-4.3 0-6.5.5-8 2z'/%3E%3Cpath d='M12 6.5v13'/%3E%3C/svg%3E"); }
.tabs a[data-tab="sandbox"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.5 3h5M10 3v6.2L4.6 18.4A1.8 1.8 0 0 0 6.2 21h11.6a1.8 1.8 0 0 0 1.6-2.6L14 9.2V3'/%3E%3Cpath d='M7.5 15h9'/%3E%3C/svg%3E"); }
.tabs a[data-tab="keys"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='15' r='4'/%3E%3Cpath d='M10.8 12.2L20 3M16 7l3 3'/%3E%3C/svg%3E"); }
.tabs a:hover { color: var(--side-ink); background: var(--side-hover); }
.tabs a[aria-current="page"] { color: #fff; background: var(--side-active); }
.tabs a[aria-current="page"]::before { background: #8eaaff; }
.side-note {
  margin: auto 8px 0;
  padding-top: 14px;
  border-top: 1px solid var(--side-line);
  color: var(--side-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

main {
  min-width: 0;
  padding: 34px 40px 80px;
  background: radial-gradient(900px 420px at 85% -120px, var(--glow), transparent 70%);
}
#view { max-width: 1060px; margin: 0 auto; }
#view > div { animation: rise 0.28s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* --- text --------------------------------------------------------------------- */
h2 { font: 700 1.65rem/1.2 var(--round); letter-spacing: -0.01em; margin: 0 0 10px; }
h3 { font: 700 1.06rem/1.3 var(--round); margin: 0; }
p { margin: 0 0 12px; }
a { color: var(--accent); text-underline-offset: 2px; }
.small { color: var(--muted); font-size: 0.86rem; margin-top: 20px; overflow-wrap: anywhere; }
.lead { max-width: 72ch; color: var(--muted); font-size: 1rem; margin-bottom: 18px; }
.role { color: var(--muted); font-size: 0.9rem; margin: 2px 0 12px; }

.summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  padding: 8px 15px 8px 13px;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 650;
  font-size: 0.94rem;
}
.summary::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.summary.done { background: var(--ok-soft); color: var(--ok); }
.summary.live { background: var(--warn-soft); color: var(--warn); }
.summary.live::before { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* --- cards -------------------------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.cards.wide { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 20px 18px;
  min-width: 0;
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px; }

.pill, .tag {
  flex: none;
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 650;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.pill.saved { color: var(--accent-strong); background: var(--accent-soft); border-color: transparent; }
.pill.busy { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.pill.ok, .tag.done { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.pill.bad { color: var(--bad); background: var(--bad-soft); border-color: transparent; }

.steps { margin: 0 0 8px; padding-left: 20px; font-size: 0.93rem; }
.steps li { margin-bottom: 3px; }
.source { display: inline-block; font-size: 0.93rem; margin-bottom: 14px; overflow-wrap: anywhere; }

/* --- forms -------------------------------------------------------------------- */
form { display: grid; gap: 8px; }
label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
input, textarea, select {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 9px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.75; }
input:hover, textarea:hover, select:hover { border-color: var(--muted); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
input[type="password"] { font-family: var(--mono); }
input[type="checkbox"], input[type="radio"] {
  width: 18px;
  height: 18px;
  flex: none;
  padding: 0;
  accent-color: var(--accent);
  box-shadow: none;
}
textarea { resize: vertical; line-height: 1.45; }
select {
  width: auto;
  max-width: 100%;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8a83' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}
input:disabled { opacity: 0.45; }
button:focus-visible, a:focus-visible, summary:focus-visible,
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button { font: inherit; cursor: pointer; transition: background-color 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s; }
button[disabled] { opacity: 0.6; cursor: progress; }
.primary {
  justify-self: start;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 650;
  box-shadow: 0 8px 18px -10px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.primary:hover:not([disabled]) { background: var(--accent-strong); transform: translateY(-1px); }
.primary:active:not([disabled]) { transform: none; }
.plain {
  background: none;
  border: none;
  padding: 0;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.plain:hover { color: var(--bad); }
.ghost {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 7px 13px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
}
.ghost:hover { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); }
.ghost.danger { color: var(--bad); }
.ghost.danger:hover { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }
.actions, .inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline { margin-top: 14px; }
.inline input { width: auto; flex: 1 1 200px; }

.status { margin: 8px 0 0; font-size: 0.93rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.status:empty { display: none; }
.status.bad { color: var(--bad); }
.status.ok { color: var(--ok); }

/* --- overview ----------------------------------------------------------------- */
.facts { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; margin: 12px 0 0; font-size: 0.94rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
/* A short value next to a long name: the name gives way, the value stays whole. */
.facts.tight { grid-template-columns: minmax(0, 1fr) auto; }
.facts.tight dd { text-align: right; white-space: nowrap; }
.platform { display: flex; align-items: center; gap: 9px; }
.platform::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.platform.telegram::before { background: var(--telegram); box-shadow: 0 0 0 4px color-mix(in srgb, var(--telegram) 18%, transparent); }
.platform.discord::before { background: var(--discord); box-shadow: 0 0 0 4px color-mix(in srgb, var(--discord) 18%, transparent); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.stat { background: var(--inset); border-radius: 12px; padding: 11px 12px 10px; min-width: 0; }
.stat strong { display: block; font: 700 1.7rem/1.1 var(--round); font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 3px; color: var(--muted); font-size: 0.8rem; line-height: 1.25; }
.stat.alert { background: var(--warn-soft); }
.stat.alert strong, .stat.alert span { color: var(--warn); }
.spend { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.spend-line { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; font-size: 0.94rem; }
.spend-line span { color: var(--muted); }
.spend-line strong { font-variant-numeric: tabular-nums; }
.spend .role { margin: 8px 0 0; }
progress {
  display: block;
  width: 100%;
  height: 8px;
  margin-top: 8px;
  border: none;
  border-radius: 999px;
  overflow: hidden;
  background: var(--inset);
  appearance: none;
  -webkit-appearance: none;
}
progress::-webkit-progress-bar { background: var(--inset); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.switches { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 2px; }
.switches li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.94rem; }
.switches li:last-child { border-bottom: none; padding-bottom: 0; }
.switches li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.switches li.on::before { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.switches span { color: var(--muted); }
.switches strong { margin-left: auto; font-weight: 600; text-align: right; }

/* --- settings ----------------------------------------------------------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s;
}
.panel:hover { border-color: var(--line-strong); }
.panel[open] { padding-bottom: 20px; }
.panel > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  font: 700 1.06rem/1.3 var(--round);
  padding: 15px 0;
}
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary::after {
  content: "";
  margin-left: auto;
  width: 18px;
  height: 18px;
  background: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.2s;
}
.panel[open] > summary::after { transform: rotate(180deg); }
.panel[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.panel h4 { margin: 20px 0 8px; font: 700 0.98rem/1.3 var(--round); }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 16px; align-items: start; }
.field { display: grid; gap: 5px; font-size: 0.95rem; font-weight: 400; color: var(--ink); }
.field .label { font-size: 0.84rem; font-weight: 600; color: var(--muted); }
.field.wide { grid-column: 1 / -1; }
.field.check, label.check { display: grid; grid-template-columns: 18px 1fr; gap: 4px 9px; align-items: start; font-size: 0.95rem; font-weight: 400; color: var(--ink); }
.field.check input, label.check input { margin-top: 3px; }
.field.check .hint { grid-column: 2; }
.hint { color: var(--muted); font-size: 0.82rem; font-weight: 400; line-height: 1.4; }
.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin-bottom: 18px; }
.option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.option:hover { border-color: var(--accent); }
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.option strong { display: block; color: var(--ink); font-size: 1rem; }
.option input { margin-top: 3px; }
.subcard { background: var(--inset); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 16px; margin-top: 14px; }
.subcard-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.subcard-head h4 { margin: 0; }

.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.grid.narrow { max-width: 620px; }
table.grid th { text-align: left; font-size: 0.8rem; color: var(--muted); font-weight: 600; padding: 4px 8px 8px 0; white-space: nowrap; }
table.grid td { padding: 5px 8px 5px 0; vertical-align: middle; }
table.grid:not(.narrow) tr:not(.extra) > td:first-child > input { min-width: 190px; }
table.grid .center { text-align: center; }
table.grid tr.extra td { padding: 6px 0 16px; border-bottom: 1px solid var(--line); }
input.short { width: 84px; }
textarea.tall { font-family: var(--mono); font-size: 0.9rem; }
.savebar {
  position: sticky;
  bottom: 14px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-top: 18px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lift);
}
.savebar .status { margin: 0; }

/* --- cases -------------------------------------------------------------------- */
.case-list { margin-top: 14px; }
.case {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s;
}
.case:hover { border-color: var(--line-strong); }
.case summary { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; padding: 11px 16px; cursor: pointer; font-size: 0.95rem; list-style: none; }
.case summary::-webkit-details-marker { display: none; }
.case .when { color: var(--muted); font-variant-numeric: tabular-nums; }
.case .who { font-weight: 650; overflow-wrap: anywhere; }
.case .sanction { color: var(--muted); }
.case-body { padding: 0 16px 14px; font-size: 0.93rem; }
.case-body p { margin: 0 0 6px; overflow-wrap: anywhere; }
.quote { margin: 8px 0 0; padding: 11px 13px; border-radius: 10px; background: var(--inset); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; font: 0.87rem/1.45 var(--mono); }

/* --- knowledge base and sandbox ----------------------------------------------- */
.entry { display: grid; gap: 8px; margin-bottom: 12px; }
.entry .role { margin: 0; }
.place { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 400; color: var(--muted); }
.place select { padding: 5px 30px 5px 9px; font-size: 0.9rem; }
.entry .primary { justify-self: start; }
.card textarea + .check, .card textarea + .primary { margin-top: 10px; }
.card .check + .primary { display: block; margin-top: 10px; }

.result { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 0.93rem; }
.result:empty { display: none; }
.result p { margin: 0 0 6px; font-weight: 650; }
.result p.ok { color: var(--ok); }
.result p.bad { color: var(--bad); }
.result .answer { font-weight: 400; white-space: pre-wrap; overflow-wrap: anywhere; padding: 11px 13px; border-radius: 12px 12px 12px 4px; background: var(--accent-soft); }
.result p.role { font-weight: 400; margin: 6px 0 0; }
.result .facts { margin: 4px 0 8px; }
.result ul { margin: 0 0 8px; padding-left: 20px; }
.result li { margin-bottom: 3px; overflow-wrap: anywhere; }
.result ul.warnings { list-style: none; padding: 9px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); }
.result ul.warnings li:last-child { margin-bottom: 0; }
.result a { font-weight: 650; }

/* --- login page and the access tab ---------------------------------------------- */
:root { --finger: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4M14 13.12c0 2.38 0 6.38-1 8.88M17.29 21.02c.12-.6.43-2.3.5-3.02M2 12a10 10 0 0 1 18-6M2 16h.01M21.8 16c.2-2 .131-5.354 0-6M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2M8.65 22c.21-.66.45-1.32.57-2M9 6.8a6 6 0 0 1 9 5.2v2'/%3E%3C/svg%3E"); }
.tabs a[data-tab="access"] { --icon: var(--finger); }
.gate main { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.gate-card { width: min(100%, 430px); padding: 30px 28px 26px; display: grid; gap: 16px; justify-items: start; }
.gate-card .logo { width: 46px; height: 46px; border-radius: 14px; }
.gate-card .logo::before { width: 26px; height: 26px; }
.gate-card h1 { margin: 0; font: 700 1.55rem/1.2 var(--round); letter-spacing: -0.01em; }
#gate { display: grid; gap: 14px; justify-items: start; width: 100%; }
#gate p, #gate form { margin: 0; }
#gate form { width: 100%; gap: 14px; }
#gate label { display: grid; gap: 6px; }
.touch { display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; font-size: 1rem; }
.touch::before {
  content: "";
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: var(--finger) center / contain no-repeat;
  mask: var(--finger) center / contain no-repeat;
}
.command { display: block; width: 100%; margin: 0; white-space: nowrap; overflow-x: auto; user-select: all; }

/* --- narrow screens: the rail becomes a bar on top ------------------------------ */
@media (max-width: 860px) {
  .shell { display: block; }
  .side { position: sticky; z-index: 3; height: auto; gap: 10px; padding: 12px 12px 8px; border-right: none; border-bottom: 1px solid var(--side-line); }
  .brand p, .side-note { display: none; }
  .logo { width: 30px; height: 30px; border-radius: 9px; }
  .logo::before { width: 18px; height: 18px; }
  .tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { flex: none; padding: 7px 10px; font-size: 0.9rem; gap: 7px; }
  main { padding: 22px 16px 64px; }
  h2 { font-size: 1.4rem; }
  .cards, .cards.wide { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
