:root {
  --bg: #070708;
  --bg-2: #111114;
  --bg-3: #1d1d22;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --accent: #e30a17;
  --ink: #ffffff;
  --teal: #ff8a8f;
  --danger: #ff5c5c;
  --warn: #f0b45a;
  --ok: #57f287;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  --card: rgba(18, 18, 22, 0.86);
  --field: #0c0c0e;
  --chip: #141418;
  --top: rgba(10, 10, 12, 0.92);
  --glow-a: rgba(227, 10, 23, 0.2);
  --glow-b: rgba(227, 10, 23, 0.08);
  --switch-off: #26262c;
  --switch-on: rgba(227, 10, 23, 0.35);
  color-scheme: dark;
  font-family: Outfit, Manrope, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

[data-theme="yesil"] {
  --bg: #10140e;
  --bg-2: #191f15;
  --bg-3: #222a1c;
  --line: #313a28;
  --text: #e7f0dc;
  --muted: #9aaa90;
  --accent: #dff25a;
  --ink: #17200b;
  --teal: #8fd0b5;
  --ok: #c6e98a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  --card: rgba(25, 31, 21, 0.92);
  --field: #10150e;
  --chip: #141a11;
  --top: rgba(16, 20, 14, 0.8);
  --glow-a: rgba(223, 242, 90, 0.16);
  --glow-b: rgba(143, 208, 181, 0.12);
  --switch-off: #2a3324;
  --switch-on: #3d4a22;
}

[data-theme="karanlik"] {
  --bg: #090909;
  --bg-2: #141414;
  --bg-3: #1d1d1d;
  --line: #2c2c2c;
  --text: #f2f2f2;
  --muted: #a3a3a3;
  --accent: #d7d7d7;
  --ink: #111111;
  --card: rgba(18, 18, 18, 0.94);
  --field: #101010;
  --chip: #161616;
  --top: rgba(9, 9, 9, 0.88);
  --glow-a: rgba(255, 255, 255, 0.04);
  --glow-b: transparent;
  --switch-on: #3a3a3a;
}
[data-theme="beyaz"] {
  color-scheme: light;
  --bg: #f5f6f3;
  --bg-2: #ffffff;
  --bg-3: #e7eee0;
  --line: #d5ddd0;
  --text: #172014;
  --muted: #5d6b58;
  --accent: #5d7a1f;
  --ink: #ffffff;
  --teal: #2f6f5b;
  --ok: #2f6b32;
  --shadow: 0 18px 40px rgba(23, 32, 11, 0.08);
  --card: rgba(255, 255, 255, 0.94);
  --field: #f7f8f5;
  --chip: #f3f5f0;
  --top: rgba(245, 246, 243, 0.92);
}
[data-theme="kirmizi"] {
  --bg: #120808;
  --bg-2: #1c0d0d;
  --bg-3: #2a1212;
  --line: #4a2222;
  --text: #ffe8e6;
  --muted: #c9a3a0;
  --accent: #ff4d4d;
  --ink: #1a0707;
  --card: rgba(28, 12, 12, 0.94);
  --field: #140909;
  --chip: #1a0c0c;
  --top: rgba(18, 8, 8, 0.9);
}
[data-theme="mavi"] {
  color-scheme: light;
  --bg: #f3f7fb;
  --bg-2: #ffffff;
  --bg-3: #e3eef8;
  --line: #c9d8e8;
  --text: #102033;
  --muted: #4d647c;
  --accent: #1d4e89;
  --ink: #ffffff;
  --teal: #1d4e89;
  --ok: #1d6b45;
  --shadow: 0 18px 40px rgba(16, 32, 51, 0.08);
  --card: rgba(255, 255, 255, 0.96);
  --field: #f7fbff;
  --chip: #eef4fa;
  --top: rgba(243, 247, 251, 0.94);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }

body {
  background:
    radial-gradient(900px 420px at 8% -10%, var(--glow-a, transparent), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, var(--glow-b, transparent), transparent 50%),
    var(--bg);
  background-attachment: fixed;
}

.gate, .app { min-height: 100vh; }
.gate {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}
.story, .login-card { padding: 48px; }
.story { display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: -0.04em; font-size: 22px; text-decoration: none; }
.brand .logo { width: 38px; height: 38px; flex: none; filter: drop-shadow(0 6px 16px rgba(227, 10, 23, 0.35)); }
.story h1 { margin: 0; font-size: clamp(40px, 5vw, 68px); line-height: 0.95; letter-spacing: -0.06em; max-width: 10ch; }
.lede { max-width: 46ch; color: var(--muted); font-size: 18px; }
.steps { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.steps li { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }
.num { width: 28px; height: 28px; display: grid; place-items: center; background: var(--bg-3); border-radius: 99px; color: var(--accent); font-family: "IBM Plex Mono", monospace; font-size: 13px; }
.fine { color: var(--muted); font-size: 13px; max-width: 62ch; }

[data-theme="beyaz"] body,
[data-theme="mavi"] body { background: var(--bg); }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.login-card, .card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.login-card { margin: 24px; align-self: center; }
.login-card h2 { margin: 0 0 8px; font-size: 28px; letter-spacing: -0.04em; }
label { display: grid; gap: 8px; font-size: 14px; color: var(--muted); }
input, select, textarea {
  width: 100%;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}
textarea { min-height: 84px; resize: vertical; }
.span-2 { grid-column: 1 / -1; }
.js-chat { min-height: 180px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.code-input { font-family: "IBM Plex Mono", monospace; letter-spacing: 0.28em; text-transform: uppercase; font-size: 18px; }
.row { display: flex; gap: 12px; align-items: center; }
.grid-2, .split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

button, .button {
  border: 0;
  background: var(--accent);
  color: var(--ink);
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button.ghost, .button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.warn { background: transparent; color: var(--warn); border: 1px solid #6a5428; }
button.danger { background: transparent; color: var(--danger); border: 1px solid #6a3430; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); align-items: start; }
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 16px;
  background: var(--top);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(16px);
  overflow-y: auto;
  z-index: 2;
}
.side .brand { padding: 0 6px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--chip); border: 1px solid var(--line); }
.side-user > span:last-child { display: grid; min-width: 0; }
.side-user strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user small { font-size: 12px; }
.avatar, .bot-avatar { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--ink); font-weight: 800; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label { margin: 12px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); opacity: 0.75; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; color: var(--muted); text-decoration: none; font-weight: 600; }
.side-nav a:hover { color: var(--text); background: var(--bg-3); }
.side-nav a.active { color: var(--text); background: var(--bg-3); box-shadow: inset 3px 0 0 var(--accent); }
.side-nav a.active .ico { color: var(--accent); }
.ico { width: 18px; height: 18px; flex: none; }
.side-foot { margin-top: auto; display: grid; gap: 8px; }
.side-out { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; color: var(--muted); text-decoration: none; font-size: 14px; }
.side-out:hover { color: var(--text); background: var(--bg-3); }
.side-out img { width: 20px; height: 20px; border-radius: 50%; }
.side-foot .theme-pick { width: 100%; margin: 0; }
.theme-pick { width: auto; margin-left: auto; border-radius: 999px; padding: 8px 12px; background: var(--field); }
main { width: min(1100px, calc(100% - 48px)); margin: 28px auto 64px; display: grid; gap: 18px; min-width: 0; }
.hello { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hello h1 { margin: 0 0 4px; font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.04em; }
.hello p { margin: 0; }
.hello code, .panel code { font-family: "IBM Plex Mono", monospace; font-size: 0.92em; padding: 1px 6px; border-radius: 6px; background: var(--bg-3); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { display: grid; gap: 2px; padding: 16px 18px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.stat strong { font-size: 30px; line-height: 1; letter-spacing: -0.04em; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.online strong { color: var(--ok); }
.stat.wait strong { color: var(--warn); }
.stat.bad strong { color: var(--danger); }
.bot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 14px; }
.bot-card { display: grid; gap: 10px; align-content: start; padding: 16px; border-radius: 18px; background: var(--chip); border: 1px solid var(--line); text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.bot-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.bot-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bot-top .bot-info { min-width: 0; }
.bot-top .bot-info > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.bot-card .systems { margin-top: 0; }
.fold { padding: 0; }
.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary > span { display: grid; gap: 2px; }
.fold > summary strong { font-size: 17px; letter-spacing: -0.02em; }
.fold > summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--muted); }
.fold[open] > summary::after { content: "−"; }
.fold-body { padding: 0 22px 22px; }
.fold-body > .panel { padding: 0; border: 0; background: none; box-shadow: none; }
.fold-body > .panel > h3 { display: none; }
.panel { padding: 22px; }
.panel h2, .panel h3 { margin: 0 0 6px; letter-spacing: -0.04em; }
.muted { color: var(--muted); }
.list { display: grid; gap: 10px; }
.bot-link, .key-row, .log {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  background: var(--chip);
  border: 1px solid var(--line);
  text-decoration: none;
}
.bot-link strong, .key-row strong { display: block; }
.bot-info { display: grid; gap: 4px; min-width: 0; }
.runner { font-size: 13px; color: var(--text); opacity: 0.85; }
.systems { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.sys { font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.sys.off { opacity: 0.55; text-decoration: line-through; text-decoration-thickness: 1px; }
.sys.on { color: var(--ok); border-color: var(--ok); }
.sys em { font-style: normal; opacity: 0.8; }
.status { font-family: "IBM Plex Mono", monospace; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.status.online { color: var(--ok); }
.status.wait, .status.auth { color: var(--warn); }
.status.bad { color: var(--danger); }
.status.off { color: var(--muted); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { position: relative; display: block; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; z-index: 1; }
.choice span { display: grid; gap: 4px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--chip); pointer-events: none; }
.choice strong { color: var(--text); }
.choice small { color: var(--muted); }
.choice input:checked + span { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice input:disabled + span { opacity: 0.45; }
.toggles { display: flex; flex-wrap: wrap; gap: 12px 18px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; color: var(--text); cursor: pointer; font-weight: 600; }
button.switch { background: transparent; color: var(--text); border: 0; border-radius: 0; padding: 0; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; overflow: hidden; }
.switch-ui { width: 44px; height: 26px; border-radius: 99px; background: var(--switch-off, #2a3324); border: 1px solid var(--line); position: relative; flex: none; }
.switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); }
.switch input:checked + .switch-ui, .switch-ui.on { background: var(--switch-on, #3d4a22); border-color: var(--accent); }
.switch input:checked + .switch-ui::after, .switch-ui.on::after { transform: translateX(18px); background: var(--accent); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--accent); outline-offset: 2px; }
.inv { display: grid; gap: 12px; }
.inv-row { display: flex; flex-wrap: wrap; gap: 6px; }
.slot { width: 92px; min-height: 78px; padding: 6px; border-radius: 10px; background: var(--chip); border: 1px solid var(--line); font-size: 11px; display: grid; justify-items: center; align-content: space-between; text-align: center; gap: 2px; }
.item-icon { width: 32px; height: 32px; image-rendering: pixelated; }
.slot span, .slot em { color: var(--muted); font-style: normal; }
.slot strong { color: var(--text); font-size: 12px; }
.slot.empty { opacity: 0.55; }
.mc-gui {
  --slot: min(44px, calc((100vw - 110px) / var(--cols, 9)));
  width: max-content;
  max-width: 100%;
  margin-top: 12px;
  padding: 8px 10px 10px;
  background: #c6c6c6;
  color: #3f3f3f;
  border: 3px solid;
  border-color: #fff #555 #555 #fff;
  border-radius: 6px;
  box-shadow: 0 0 0 2px #000, 0 10px 30px rgba(0, 0, 0, 0.35);
}
.mc-title { font: 600 14px/1.2 "IBM Plex Mono", monospace; color: #3f3f3f; margin: 2px 2px 6px; overflow-wrap: anywhere; }
.mc-title + .mc-grid { margin-bottom: 6px; }
.mc-grid { display: grid; grid-template-columns: repeat(var(--cols, 9), var(--slot)); }
.mc-own { grid-template-columns: repeat(9, var(--slot)); }
.mc-hotbar { margin-top: 6px; }
.mc-slot {
  position: relative;
  width: var(--slot);
  height: var(--slot);
  min-height: 0;
  padding: 0;
  margin: 0;
  display: grid;
  place-items: center;
  background: #8b8b8b;
  border: 2px solid;
  border-color: #373737 #fff #fff #373737;
  border-radius: 0;
  box-shadow: none;
  color: #fff;
  font: inherit;
  cursor: default;
}
button.mc-slot { cursor: pointer; }
button.mc-slot:hover, button.mc-slot:focus-visible { background: #a8a8a8; outline: none; transform: none; }
button.mc-slot.picked { background: #b3b3b3; box-shadow: inset 0 0 0 2px #fff; }
.mc-slot .item-icon { width: 78%; height: 78%; image-rendering: pixelated; pointer-events: none; }
.mc-slot.filler { opacity: 0.9; }
.mc-fallback { position: absolute; font: 700 11px "IBM Plex Mono", monospace; color: #fff; text-shadow: 1px 1px 0 #3f3f3f; text-transform: uppercase; }
.mc-slot:has(.item-icon) .mc-fallback { display: none; }
.mc-count { position: absolute; right: 1px; bottom: -1px; font: 700 13px/1 "IBM Plex Mono", monospace; color: #fff; text-shadow: 2px 2px 0 #3f3f3f; pointer-events: none; }
.mc-tip {
  display: none;
  position: absolute;
  left: calc(100% + 6px);
  top: -6px;
  z-index: 20;
  min-width: 160px;
  max-width: 320px;
  width: max-content;
  padding: 6px 8px;
  background: rgba(16, 0, 16, 0.94);
  border: 2px solid #2d0a63;
  outline: 1px solid #100010;
  border-radius: 3px;
  text-align: left;
  font: 13px/1.35 "IBM Plex Mono", monospace;
  white-space: normal;
  pointer-events: none;
}
.mc-tip strong { display: block; color: #fff; margin-bottom: 2px; }
.mc-tip span { display: block; color: #aaa; overflow-wrap: anywhere; }
.mc-grid > .mc-slot:nth-child(9n) .mc-tip, .mc-grid > .mc-slot:nth-child(9n - 1) .mc-tip, .mc-grid > .mc-slot:nth-child(9n - 2) .mc-tip { left: auto; right: calc(100% + 6px); }
@media (hover: hover) and (pointer: fine) {
  .mc-slot:hover { z-index: 30; }
  .mc-slot:hover .mc-tip { display: block; }
}
.mc-pick { display: grid; gap: 8px; margin-top: 10px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--chip); }
.mc-help { margin-top: 8px; }
.bulk-list { display: grid; gap: 6px; margin-top: 12px; }
.bulk-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--chip); cursor: pointer; }
.bulk-row input { width: 18px; height: 18px; margin: 0; padding: 0; accent-color: var(--accent); }
.bulk-row > span:nth-child(2) { display: grid; gap: 2px; min-width: 0; }
.panel h4 { margin: 18px 0 0; font-size: 14px; }
.actions > select, .actions > input[name="bulkText"] { width: auto; min-width: 180px; flex: 1; }
label.inline select { width: auto; }
.rec-steps { display: grid; gap: 6px; margin: 10px 0; padding-left: 22px; }
.rec-steps li { overflow-wrap: anywhere; }
.macro { display: grid; gap: 6px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--chip); }
label.inline { display: inline-flex; align-items: center; gap: 8px; }
.choices.clicks { grid-template-columns: repeat(4, 1fr); }
label.inline input { width: 90px; }
.quick { margin-top: 18px; display: grid; gap: 8px; }
.quick .actions { margin-top: 0; }
.offline-field { display: none; }
.server-field { display: none; }
form:has(input[name="runner"][value="own"]:checked) .server-field { display: grid; }
form:has(input[value="offline"]:checked) .offline-field { display: grid; }
.msa { display: grid; gap: 8px; padding: 16px; border-radius: 16px; background: #2a2614; border: 1px solid #665b2e; }
.update-box { margin-top: 12px; }
.update-tag { display: inline-block; width: fit-content; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; color: #1b1405; background: var(--warn); }
.bot-switch { width: auto; max-width: 100%; margin: 0 0 6px; padding: 4px 34px 4px 10px; font-size: 24px; font-weight: 700; letter-spacing: -0.04em; border-radius: 12px; background-color: var(--field); cursor: pointer; }
.bot-checks { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.bot-check { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--chip); cursor: pointer; font-size: 14px; }
.bot-check input { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--accent); }
.bot-check:has(input:checked) { border-color: var(--accent); }
#rec-save, .macro form { display: grid; gap: 6px; }
.server-row { display: grid; gap: 8px; }
.update-form { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; border: 1px solid #665b2e; background: #2a2614; }
.update-more summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.update-more .update-form { margin-top: 8px; }
.stack { display: grid; gap: 10px; }
.key-row .muted { display: block; }
.counts { display: grid; gap: 6px; color: var(--muted); font-size: 14px; }
.counts .today { font-weight: 700; color: var(--ok); }
.counts .today.bad { color: var(--warn); }
.day-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.day-chip { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--chip); font-size: 12px; }
.day-chip.bad { border-color: var(--warn); color: var(--warn); }
.contact-box { display: grid; gap: 8px; }
.contact-box textarea { min-height: 110px; resize: vertical; }
.msg-list { display: grid; gap: 8px; }
.msg-item { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--chip); }
.msg-item.unread { border-color: var(--accent); }
.msg-item p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.msg-item .row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.offer-row { display: grid; grid-template-columns: minmax(140px, 2fr) minmax(120px, 1.5fr) minmax(110px, 1fr) auto; gap: 6px; align-items: center; }
.offer-row input, .offer-row select { margin: 0; }
.rent-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rent-table th, .rent-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rent-table th { color: var(--muted); font-weight: 600; }
.rent-left { font-weight: 700; color: var(--ok); }
.rent-left.done { color: var(--muted); font-weight: 500; }
.renter-list { display: flex; flex-wrap: wrap; gap: 6px; }
.discord-invite { display: inline-flex; align-items: center; gap: 8px; width: fit-content; padding: 10px 16px; border-radius: 12px; background: #5865f2; color: #fff; font-weight: 700; text-decoration: none; }
.discord-invite:hover { filter: brightness(1.08); }
@media (max-width: 720px) {
  .offer-row { grid-template-columns: 1fr 1fr; }
  .rent-table { display: block; overflow-x: auto; }
}
.key-row .row .item-icon { width: 24px; height: 24px; image-rendering: pixelated; }
.msa code { font-family: "IBM Plex Mono", monospace; font-size: 28px; letter-spacing: 0.18em; }
.logs { display: grid; gap: 6px; max-height: 320px; overflow: auto; }
.log { align-items: start; }
.log span { color: var(--muted); font-family: "IBM Plex Mono", monospace; font-size: 12px; white-space: nowrap; }
.token {
  font-family: "IBM Plex Mono", monospace;
  word-break: break-all;
  padding: 12px;
  border-radius: 12px;
  background: var(--field);
}
.toast {
  position: fixed;
  bottom: 18px;
  right: 18px;
  background: var(--accent);
  color: var(--ink);
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.toast.bad { background: var(--danger); color: white; }
.error-line { color: var(--danger); min-height: 1.2em; }
.dash { display: grid; gap: 14px; align-items: start; }
.dash-nav { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); position: sticky; top: 10px; z-index: 1; backdrop-filter: blur(12px); }
.dash-nav a { padding: 9px 14px; border-radius: 11px; color: var(--muted); text-decoration: none; font-weight: 600; }
.dash-nav a:hover { color: var(--text); background: var(--bg-3); }
.dash-nav a.active { color: var(--ink); background: var(--accent); font-weight: 700; }
.dash-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.guide { margin: 8px 0 0; padding-left: 20px; line-height: 1.7; }
.admin-user { display: grid; grid-template-columns: 1fr 120px 130px auto auto; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--chip); }
.admin-user .muted { overflow-wrap: anywhere; }
.admin-limits { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 12px; align-items: end; margin-top: 10px; }
.admin-limits .actions { margin-top: 0; }
@media (max-width: 860px) {
  .gate, .grid-2, .split, .choices { grid-template-columns: 1fr; }
  .choices.clicks { grid-template-columns: 1fr 1fr; }
  .story, .login-card { padding: 22px 16px; }
  .story h1 { font-size: 36px; }
  .lede { font-size: 16px; }
  .login-card { margin: 0 12px 20px; }
  .app { grid-template-columns: 1fr; }
  .side { position: sticky; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .side .brand { font-size: 18px; }
  .side .brand .logo { width: 30px; height: 30px; }
  .side-user { display: none; }
  .side-nav { order: 3; width: 100%; flex-direction: row; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .side-nav::-webkit-scrollbar { display: none; }
  .nav-label { display: none; }
  .side-nav a { flex: none; padding: 8px 10px; font-size: 14px; }
  .side-nav a.active { box-shadow: inset 0 -2px 0 var(--accent); }
  .side-foot { margin: 0 0 0 auto; display: flex; align-items: center; gap: 6px; }
  .side-out { display: none; }
  .side-foot .theme-pick { width: auto; max-width: 130px; }
  .side-foot button { padding: 8px 12px; width: auto; }
  .stats { grid-template-columns: 1fr 1fr; }
  .bot-grid { grid-template-columns: 1fr; }
  .fold > summary { padding: 16px; }
  .fold-body { padding: 0 16px 16px; }
  .theme-pick { margin-left: 0; max-width: 100%; }
  main { width: min(1100px, calc(100% - 20px)); margin: 16px auto 48px; }
  .panel { padding: 16px; }
  .bot-link, .key-row, .log { flex-direction: column; align-items: stretch; }
  .log span { white-space: normal; }
  .actions { align-items: stretch; }
  .actions > input, .actions > button, .actions > .button { width: 100%; }
  .code-input { letter-spacing: 0.08em; font-size: 16px; }
  .row { flex-wrap: wrap; }
  .msa code { font-size: 22px; letter-spacing: 0.08em; overflow-wrap: anywhere; }
  .slot { width: calc(33.33% - 6px); min-width: 86px; }
  .dash-nav { position: static; }
  .dash-nav a { flex: 1 1 30%; text-align: center; }
  .admin-user, .admin-limits { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
.scan-layers { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; }
.scan-layer { display: grid; gap: 6px; }
.scan-grid { display: grid; grid-template-columns: repeat(var(--scan-cols, 5), 64px); gap: 3px; }
.scan-cell {
  width: 64px;
  height: 46px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--chip);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.15;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  word-break: break-word;
}
.scan-cell.self { border-style: dashed; color: var(--teal); font-weight: 700; }
button.scan-cell.block { background: var(--bg-3); color: var(--text); cursor: pointer; min-height: 0; box-shadow: none; }
button.scan-cell.block:hover { border-color: var(--teal); }
button.scan-cell.chosen { background: var(--accent); color: var(--ink); border-color: var(--accent); font-weight: 700; }
@media (max-width: 640px) {
  .scan-grid { grid-template-columns: repeat(var(--scan-cols, 5), 44px); }
  .scan-cell { width: 44px; height: 40px; font-size: 8px; }
}
