/* Albiondle v2 — "Clean Arcade, rounder" (C3). See design-docs/05-visual-style.md */
:root {
  --bg: #f3f4f8; --surface: #ffffff; --surface-2: #eef0f6; --edge: #d9dbe6;
  --ink: #1b1d2a; --ink-2: #3d4058; --muted: #545873; --line: #c9cbe0;
  --accent: #3b4cca; --accent-edge: #26318a; --accent-soft: #e6e8fb; --accent-ink: #26318a;
  --warm-soft: #fdf0d2; --warm-ink: #6b4d0a;
  --good-soft: #e3f1e8; --good-ink: #1f5a37; --bad-soft: #f6dcd8; --bad-ink: #7a241a;
  --hit: #2f7d4f; --hit-edge: #1d5233; --partial: #e3b53a; --partial-edge: #a87f1a; --partial-ink: #241a05;
  --miss: #b23a2c; --miss-edge: #7a241a;
  --icon-bg: #2b2e45; --icon-edge: #1b1d2a;
  --overlay: rgba(27, 29, 42, 0.55);
  --pop: 0 4px 0 var(--edge), 0 10px 24px rgba(27, 29, 42, 0.12);
  --display: "Fredoka", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141420; --surface: #1f2030; --surface-2: #2a2b3d; --edge: #0c0c14;
    --ink: #f2f2f7; --ink-2: #c9cbe0; --muted: #a6a8c0; --line: #3a3c55;
    --accent: #6c7bff; --accent-edge: #3b4cca; --accent-soft: #2a2d4a; --accent-ink: #c4caff;
    --warm-soft: #3a3020; --warm-ink: #f3d692; --good-soft: #1e3427; --good-ink: #a9dcbc;
    --bad-soft: #3d2320; --bad-ink: #f0b8b0; --icon-bg: #10111b; --icon-edge: #05050a;
    --overlay: rgba(0, 0, 0, 0.6); --pop: 0 4px 0 var(--edge), 0 10px 24px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141420; --surface: #1f2030; --surface-2: #2a2b3d; --edge: #0c0c14;
  --ink: #f2f2f7; --ink-2: #c9cbe0; --muted: #a6a8c0; --line: #3a3c55;
  --accent: #6c7bff; --accent-edge: #3b4cca; --accent-soft: #2a2d4a; --accent-ink: #c4caff;
  --warm-soft: #3a3020; --warm-ink: #f3d692; --good-soft: #1e3427; --good-ink: #a9dcbc;
  --bad-soft: #3d2320; --bad-ink: #f0b8b0; --icon-bg: #10111b; --icon-edge: #05050a;
  --overlay: rgba(0, 0, 0, 0.6); --pop: 0 4px 0 var(--edge), 0 10px 24px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}
/* colour-blind mode: blue / orange / grey */
:root[data-cb="on"] {
  --hit: #2b6cb0; --hit-edge: #1a4677; --partial: #e8892c; --partial-edge: #9c5512; --partial-ink: #241200;
  --miss: #6b6f80; --miss-edge: #45485a;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 600 16px/1.5 var(--body); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); font-weight: 700; }
a:hover { color: var(--accent-edge); }
:root[data-theme="dark"] a:hover { color: var(--accent-ink); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; line-height: 1.2; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 14px; padding: 14px 32px; background: var(--surface); box-shadow: 0 3px 0 var(--edge); position: relative; z-index: 5; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 7px; text-decoration: none; color: var(--ink); }
.logo:hover { color: var(--ink); }
.logo i { width: 14px; height: 14px; border-radius: 5px; display: block; }
.logo i:nth-child(1) { background: var(--hit); box-shadow: 0 3px 0 var(--hit-edge); }
.logo i:nth-child(2) { background: var(--partial); box-shadow: 0 3px 0 var(--partial-edge); }
.logo i:nth-child(3) { background: var(--miss); box-shadow: 0 3px 0 var(--miss-edge); }
.logo b { font-family: var(--display); font-weight: 700; font-size: 24px; margin-left: 4px; }
.crumb { font-family: var(--display); font-size: 20px; font-weight: 600; color: var(--muted); }
.topbar .spacer { margin-left: auto; }
.badge { font-size: 14px; font-weight: 800; padding: 6px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); white-space: nowrap; }
.badge.warm { background: var(--warm-soft); color: var(--warm-ink); }
.badge.good { background: var(--good-soft); color: var(--good-ink); }
.badge.bad { background: var(--bad-soft); color: var(--bad-ink); }
.badge.plain { background: var(--surface-2); color: var(--muted); }
.iconbtn { width: 42px; height: 42px; border-radius: 14px; border: none; background: var(--bg); box-shadow: 0 3px 0 var(--edge); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.iconbtn svg { width: 20px; height: 20px; stroke: var(--ink); fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.iconbtn:active { transform: translateY(3px); box-shadow: none; }

main { width: 100%; max-width: 1120px; margin: 0 auto; padding: 26px 32px 48px; display: flex; flex-direction: column; gap: 22px; flex: 1; }
footer.site { text-align: center; padding: 18px 16px 26px; font-size: 13px; color: var(--muted); font-weight: 700; }
footer.site a { color: var(--muted); }

/* ---------- buttons ---------- */
.btn { font-family: var(--display); font-size: 17px; font-weight: 600; padding: 12px 24px; border-radius: 16px; border: none; cursor: pointer; background: var(--surface); color: var(--ink); box-shadow: 0 4px 0 var(--edge), inset 0 0 0 2px var(--surface-2); transition: transform .06s; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 4px 0 var(--accent-edge); }
.btn.danger { background: var(--miss); color: #fff; box-shadow: 0 4px 0 var(--miss-edge); }
.btn.small { font-size: 15px; padding: 9px 16px; border-radius: 14px; }
.btn:hover { filter: brightness(1.04); }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.linkbtn { background: none; border: none; padding: 0; color: var(--accent); font-weight: 700; cursor: pointer; text-decoration: underline; font-size: 15px; }

/* ---------- labels, inputs ---------- */
.label { font-size: 12.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; }
.input, select.input, textarea.input { font-size: 17px; font-weight: 700; padding: 12px 16px; border-radius: 16px; border: 2.5px solid var(--line); background: var(--surface); outline: none; width: 100%; }
.input:focus { border-color: var(--accent); }
textarea.input { resize: vertical; min-height: 90px; font-weight: 600; }

/* ---------- menu ---------- */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hero h1 { font-size: 34px; font-weight: 700; }
.hero p { margin: 4px 0 0; color: var(--muted); font-weight: 700; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.card { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: 22px; background: var(--surface); box-shadow: 0 5px 0 var(--edge); transition: transform .08s; }
.card:hover { color: inherit; transform: translateY(-2px); }
.card:active { transform: translateY(5px); box-shadow: none; }
.card .top { display: flex; align-items: center; gap: 14px; }
.card .glyph { width: 52px; height: 52px; border-radius: 16px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.card .glyph svg { width: 28px; height: 28px; stroke: var(--accent-ink); fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.card h2 { font-size: 26px; }
.card p { margin: 0; font-size: 15px; color: var(--ink-2); font-weight: 600; }
.card .pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.card .pills span { font-size: 13px; font-weight: 800; padding: 5px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); }
.card .pills .good { background: var(--good-soft); color: var(--good-ink); }
.card .pills .bad { background: var(--bad-soft); color: var(--bad-ink); }
.card .pills .plain { background: var(--surface-2); color: var(--muted); }

/* ---------- game shell ---------- */
.panel { background: var(--surface); border-radius: 24px; box-shadow: 0 5px 0 var(--edge); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.notice { padding: 12px 16px; border-radius: 16px; background: var(--warm-soft); color: var(--warm-ink); font-weight: 700; }
.steps { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; padding: 7px 16px 7px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-weight: 800; font-size: 15px; }
.step span { width: 26px; height: 26px; border-radius: 999px; background: var(--surface); display: flex; align-items: center; justify-content: center; font-family: var(--display); }
.step.on { background: var(--accent); color: #fff; }
.step.on span { color: var(--accent); background: #fff; }
.step.done { background: var(--hit); color: #fff; }
.step.done span { color: var(--hit); background: #fff; }
.steps .bar { width: 36px; height: 3px; border-radius: 2px; background: var(--line); }
.steps .count { margin-left: auto; font-weight: 700; color: var(--muted); }

.guessbar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.guessbar .field { flex: 1 1 280px; position: relative; }
.ac { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; display: none; flex-direction: column; padding: 6px; border-radius: 16px; background: var(--surface); box-shadow: var(--pop); max-height: 320px; overflow-y: auto; }
.ac.open { display: flex; }
.ac div { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; font-weight: 700; cursor: pointer; }
.ac div small { font-size: 13px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.ac div img { width: 28px; height: 28px; border-radius: 8px; background: var(--icon-bg); }
.ac div .nm { display: flex; align-items: center; gap: 10px; }
.ac div.sel, .ac div:hover { background: var(--accent-soft); font-weight: 800; }

/* tiles */
.gridwrap { overflow-x: auto; padding-bottom: 6px; }
.grid { display: flex; flex-direction: column; gap: 10px; min-width: 860px; }
.grow { display: grid; grid-template-columns: 1.7fr repeat(6, minmax(0, 1fr)) .7fr 40px; gap: 8px; align-items: stretch; }
.grow.head { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.grow.head span { display: flex; align-items: center; gap: 4px; }
.tile { padding: 12px 6px; border-radius: 14px; background: var(--surface); box-shadow: 0 4px 0 var(--edge); text-align: center; font-family: var(--display); font-weight: 600; font-size: 15.5px; line-height: 1.25; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 2px 6px; min-height: 52px; }
.tile.name { text-align: left; flex-direction: column; justify-content: center; align-items: flex-start; padding-left: 14px; }
.tile.hit { background: var(--hit); box-shadow: 0 4px 0 var(--hit-edge); color: #fff; }
.tile.partial { background: var(--partial); box-shadow: 0 4px 0 var(--partial-edge); color: var(--partial-ink); }
.tile.miss { background: var(--miss); box-shadow: 0 4px 0 var(--miss-edge); color: #fff; }
.tile small { font-family: var(--body); font-size: 11px; font-weight: 800; opacity: .85; text-transform: uppercase; letter-spacing: .04em; }
.tile .arr { font-size: 20px; }
.flip { animation: flip .42s ease both; }
@keyframes flip { from { transform: rotateX(90deg); opacity: .2; } to { transform: rotateX(0); opacity: 1; } }
.flag { border: none; background: transparent; border-radius: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.flag svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linejoin: round; }
.flag:hover { background: var(--surface-2); }
.flag.done svg { stroke: var(--accent); fill: var(--accent-soft); }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; font-weight: 700; color: var(--muted); align-items: center; }
.legend i { width: 14px; height: 14px; border-radius: 5px; display: inline-block; vertical-align: -2px; margin-right: 6px; }
.legend .h { background: var(--hit); } .legend .p { background: var(--partial); } .legend .m { background: var(--miss); }
.help { font-size: 14px; color: var(--ink-2); font-weight: 600; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 22px; }
.help b { font-weight: 800; color: var(--ink); }
details.howto summary { cursor: pointer; font-weight: 800; color: var(--accent); }
details.howto[open] summary { margin-bottom: 10px; }

.solvedbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 16px; background: var(--hit); box-shadow: 0 4px 0 var(--hit-edge); color: #fff; font-family: var(--display); font-size: 19px; font-weight: 600; }
.solvedbar.gaveup { background: var(--miss); box-shadow: 0 4px 0 var(--miss-edge); }
.solvedbar svg { width: 22px; height: 22px; stroke: #fff; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* maps part 2 */
.route { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.compass { width: 132px; height: 132px; flex-shrink: 0; }
.compass .fillmap { fill: var(--surface-2); }
.compass .petal { fill: none; stroke: var(--line); stroke-width: 9; stroke-linecap: round; transition: stroke .2s; }
.compass .petal.lit { stroke: var(--accent); }
.compass text { font-family: var(--display); font-size: 13px; font-weight: 600; fill: var(--muted); text-anchor: middle; }
.gates { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gate { font-family: var(--display); font-weight: 600; font-size: 18px; padding: 10px 16px; border-radius: 14px; background: var(--surface-2); box-shadow: 0 4px 0 var(--edge); }
.gate.lit { background: var(--accent); color: #fff; box-shadow: 0 4px 0 var(--accent-edge); }
.gates .sep { color: var(--muted); font-weight: 800; }
.startmap { font-weight: 700; color: var(--muted); }
.startmap b { color: var(--ink); font-family: var(--display); font-weight: 600; font-size: 18px; }
.guesslist { display: flex; flex-direction: column; gap: 8px; }
.gitem { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 14px; background: var(--surface); box-shadow: 0 3px 0 var(--edge); font-weight: 700; }
.gitem img { width: 30px; height: 30px; border-radius: 8px; background: var(--icon-bg); }
.gitem .tag { margin-left: auto; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--bad-soft); color: var(--bad-ink); white-space: nowrap; }
.gitem.ok { background: var(--hit); color: #fff; box-shadow: 0 3px 0 var(--hit-edge); }
.gitem.ok .tag { background: rgba(255, 255, 255, .2); color: #fff; }
.hint { padding: 10px 14px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.panel.locked { opacity: .55; pointer-events: none; }

/* abilities */
.ablayout { display: flex; gap: 26px; align-items: flex-start; }
.abside { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; gap: 14px; }
.abicon { width: 100%; aspect-ratio: 1; border-radius: 24px; background: var(--icon-bg); box-shadow: 0 5px 0 var(--icon-edge); display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--muted); font-weight: 700; }
.abicon img { width: 86%; height: 86%; object-fit: contain; }
.abmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-family: var(--body); font-weight: 800; font-size: 14.5px; padding: 9px 15px; border-radius: 999px; border: none; cursor: pointer; background: var(--surface-2); color: var(--ink); box-shadow: 0 3px 0 var(--edge); }
.sub .chip { background: var(--surface); }
.chip.on { background: var(--accent); color: #fff; box-shadow: 0 3px 0 var(--accent-edge); }
.chip:active:not(:disabled) { transform: translateY(3px); box-shadow: none; }
.chip.ok { background: var(--hit); color: #fff; box-shadow: 0 3px 0 var(--hit-edge); }
.chip.no { background: var(--miss); color: #fff; box-shadow: 0 3px 0 var(--miss-edge); text-decoration: line-through; }
.chip:disabled { cursor: default; }
.chip:disabled:not(.ok):not(.no) { opacity: .55; }
.sub { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 18px; background: var(--bg); }
.sub .label + .chips { margin-bottom: 6px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.cdrow { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.cdrow .input { width: 130px; font-family: var(--display); }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.actions .push { margin-left: auto; }
.reveal { display: flex; flex-direction: column; gap: 8px; }
.rvrow { display: grid; grid-template-columns: 140px 1fr 28px; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--bg); font-weight: 700; }
.rvrow .k { font-size: 12.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.rvrow .mark { font-family: var(--display); font-size: 18px; text-align: center; }
.rvrow.ok .mark { color: var(--hit); } .rvrow.no .mark { color: var(--miss); }
.rvrow .was { text-decoration: line-through; color: var(--miss); margin-right: 6px; }
.rvrow .review { margin-left: 8px; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--warm-soft); color: var(--warm-ink); }
.label .mk { font-family: var(--display); font-size: 15px; letter-spacing: 0; }
.label .mk.ok { color: var(--hit); } .label .mk.no { color: var(--miss); }
.attemptnote { margin: 0; font-weight: 700; color: var(--miss); }
.desc { padding: 14px 16px; border-radius: 16px; background: var(--bg); font-weight: 600; color: var(--ink-2); }
.desc b { display: block; font-family: var(--display); font-weight: 600; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

/* result card */
.result { width: 100%; max-width: 620px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; padding: 28px; border-radius: 28px; background: var(--surface); box-shadow: 0 6px 0 var(--edge); }
.result .head { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.result .head h2 { font-size: 36px; font-weight: 700; }
.result .head p { margin: 0; color: var(--muted); font-weight: 700; }
.pattern { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.pattern div { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.pattern i { width: 20px; height: 20px; border-radius: 6px; display: block; }
.pattern .h { background: var(--hit); } .pattern .p { background: var(--partial); } .pattern .m { background: var(--miss); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; text-align: center; }
.stats div { padding: 12px 6px; border-radius: 16px; background: var(--bg); }
.stats b { display: block; font-family: var(--display); font-size: 28px; font-weight: 600; }
.stats span { font-size: 13px; font-weight: 700; color: var(--muted); }
.dist { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 800; }
.dist .r { display: flex; align-items: center; gap: 8px; }
.dist .r > span:first-child { width: 38px; }
.dist .bar { min-width: 28px; padding: 3px 8px; border-radius: 8px; background: var(--line); text-align: right; color: var(--ink); }
.dist .bar.me { background: var(--accent); color: #fff; }
.result .foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; font-weight: 700; color: var(--muted); }
.result .btns { display: flex; gap: 10px; flex-wrap: wrap; }
.result .btns .btn { flex: 1 1 180px; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 14px; font-weight: 800; z-index: 100; box-shadow: var(--pop); }

/* dialogs */
dialog.modal { border: none; padding: 0; background: transparent; color: var(--ink); max-width: calc(100vw - 32px); }
dialog.modal::backdrop { background: var(--overlay); }
.dlg { width: 560px; max-width: 100%; display: flex; flex-direction: column; gap: 16px; padding: 26px; border-radius: 28px; background: var(--surface); box-shadow: 0 6px 0 var(--edge); }
.dlg .hd { display: flex; align-items: center; gap: 10px; }
.dlg .hd h2 { font-size: 25px; }
.dlg .hd .iconbtn { margin-left: auto; }
.dlg .pillrow { display: flex; gap: 8px; flex-wrap: wrap; }
.dlg .pillrow span { font-size: 13px; font-weight: 800; padding: 5px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); }
.dlg .pillrow span.plain { background: var(--bg); color: var(--muted); }
.dlg .shown { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--bg); font-weight: 700; flex-wrap: wrap; }
.dlg .shown .tile { min-height: 0; padding: 6px 12px; border-radius: 10px; box-shadow: none; background: var(--partial); color: var(--partial-ink); }
.dlg .status { font-weight: 800; min-height: 1.5em; }
.dlg .status.err { color: var(--miss); } .dlg .status.ok { color: var(--hit); }
.dlg .btnrow { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.dlg p { margin: 0; color: var(--ink-2); }

/* admin */
.admin .topbar { background: #1b1d2a; box-shadow: 0 3px 0 #0c0c14; color: #f2f2f7; }
.admin .topbar .logo b, .admin .topbar .crumb { color: #f2f2f7; }
.admin .topbar a.tab { color: #c9cbe0; text-decoration: none; padding: 6px 12px; border-radius: 10px; }
.admin .topbar a.tab.on { background: #2a2b3d; color: #fff; }
.admin main { max-width: 1400px; }
.adminlayout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 22px; align-items: start; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters .chip { font-size: 14px; }
.filters select { width: auto; font-size: 15px; padding: 8px 12px; border-radius: 12px; }
.table { display: flex; flex-direction: column; gap: 6px; }
.trow { display: grid; grid-template-columns: 1.3fr .7fr .9fr 2fr 60px; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--surface); box-shadow: 0 3px 0 var(--edge); cursor: pointer; font-weight: 700; border: none; text-align: left; width: 100%; }
.trow.head { background: none; box-shadow: none; cursor: default; font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding-top: 0; padding-bottom: 0; }
.trow.sel { outline: 3px solid var(--accent); }
.trow .ent { font-family: var(--display); font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.trow .ent img { width: 26px; height: 26px; border-radius: 7px; background: var(--icon-bg); }
.trow .txt { color: var(--ink-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .n { font-family: var(--display); font-size: 18px; text-align: center; padding: 2px 0; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); }
.detail { position: sticky; top: 16px; }
.detail .cur { padding: 14px; border-radius: 16px; background: var(--bg); display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.detail .why { font-size: 13px; color: var(--muted); font-weight: 700; font-family: ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.rep { padding: 12px 14px; border-radius: 14px; border: 2px solid var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.rep .meta { font-size: 13px; color: var(--muted); font-weight: 700; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.empty { padding: 30px; text-align: center; color: var(--muted); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 860px) {
  .ablayout { flex-direction: column; align-items: stretch; }
  .abside { width: 100%; }
  .abicon { max-width: 220px; margin: 0 auto; }
  .adminlayout { grid-template-columns: 1fr; }
  .detail { position: static; }
}
@media (max-width: 640px) {
  .topbar { padding: 12px 16px; gap: 10px; }
  .logo b { font-size: 21px; }
  .crumb { font-size: 17px; }
  main { padding: 18px 16px 40px; }
  .cards { grid-template-columns: 1fr; }
  .panel { padding: 18px; border-radius: 20px; }
  .two { grid-template-columns: 1fr; }
  .stats b { font-size: 22px; }
  .result { padding: 20px; }
  .rvrow { grid-template-columns: 100px 1fr 22px; }
  /* the maps grid scrolls sideways with the name column pinned */
  .grow > :first-child { position: sticky; left: 0; z-index: 2; }
  .grow.head > :first-child { background: var(--bg); }
  .trow { grid-template-columns: 1fr 60px; }
  .trow > :nth-child(2), .trow > :nth-child(3), .trow > :nth-child(4) { display: none; }
}
