/* Digitální akvárium – prohlížeč. Barvy a tmavé „jamky" převzaté z rozboru „Tvorové bez plánu". */
:root {
  --bg: #f2f2f4;
  --surface: #e7e6ee;
  --ink: #191a24;
  --muted: #5a5b6c;
  --line: #cfcedb;
  --accent: #4b45b5;
  --accent-soft: #e3e1f6;
  /* jamky se simulací a grafy jsou tmavé v obou režimech */
  --well: #0b0d12;
  --well-2: #141720;
  --well-hover: #1d2130;
  --well-ink: #dfe2ee;
  --well-muted: #8b90a6;
  --well-line: #242838;
  --well-accent: #a9a4ff;
  --pos: #4fd8c8;
  --neg: #ff6b6b;
  --plant: #4f9f5a;
  --meat: #d9784f;
  /* barvy typů buněk */
  --c-tkan: #8a98a8; --c-usta: #ffb15c; --c-foto: #5fcf6a; --c-plout: #4fb8ff; --c-oko: #f4f1e8;
  --c-celist: #ff5a4f; --c-pancir: #b9c4cf; --c-osten: #e8dca0; --c-tuk: #f2c94b; --c-nerv: #d58cff;
  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "Literata", Georgia, "Times New Roman", serif;
  --f-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 40px);
  --wide: 80rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111218; --surface: #191b24; --ink: #e4e5ee; --muted: #9b9db0; --line: #2a2c3a;
    --accent: #aaa5ff; --accent-soft: #24223f; --well-line: #2a2f42;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111218; --surface: #191b24; --ink: #e4e5ee; --muted: #9b9db0; --line: #2a2c3a;
  --accent: #aaa5ff; --accent-soft: #24223f; --well-line: #2a2f42;
  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(--f-body); font-size: 1rem; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; line-height: 1.08; }
h1 { font-size: clamp(2.3rem, 6.5vw, 4.4rem); font-weight: 750; letter-spacing: -0.035em; line-height: .98; }
h2 { font-size: clamp(1.45rem, 3vw, 2rem); font-weight: 680; letter-spacing: -0.02em; }
h3 { font-size: 1.08rem; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: .18em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.well :focus-visible, .card :focus-visible { outline-color: var(--well-accent); }
code, .mono { font-family: var(--f-mono); font-size: .88em; }
.small { font-size: .88rem; color: var(--muted); }
.eyebrow { font-family: var(--f-mono); font-size: .74rem; font-weight: 500; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 8px; top: 8px; z-index: 10; background: var(--bg); padding: .4rem .7rem; }
[hidden] { display: none !important; }

/* ── horní lišta ── */
.topbar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; padding: .55rem var(--gutter); display: flex; align-items: center; gap: .6rem 1.4rem; flex-wrap: wrap; }
.brand { font-family: var(--f-display); font-weight: 720; font-size: 1.1rem; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: .55rem; }
.brand-mark { width: 1.05rem; height: 1.05rem; border-radius: 3px; background:
  linear-gradient(var(--c-foto) 0 0) 0 0 / 50% 50% no-repeat,
  linear-gradient(var(--c-plout) 0 0) 100% 0 / 50% 50% no-repeat,
  linear-gradient(var(--c-usta) 0 0) 0 100% / 50% 50% no-repeat,
  linear-gradient(var(--c-celist) 0 0) 100% 100% / 50% 50% no-repeat; }
.nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.nav a { font-family: var(--f-mono); font-size: .8rem; color: var(--muted); text-decoration: none; padding: .4rem .7rem; border-radius: 999px; border: 1px solid transparent; }
.nav a:hover { color: var(--ink); border-color: var(--line); }
.nav a[aria-current="page"] { color: var(--ink); border-color: var(--line); background: var(--surface); }
.admin-slot { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.admin-slot .who { font-family: var(--f-mono); font-size: .74rem; color: var(--accent); }

/* ── stránka ── */
.page { max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; padding: clamp(1.6rem, 4vw, 3rem) var(--gutter) 3rem; outline: none; min-height: 60vh; }
.loading { color: var(--muted); font-family: var(--f-mono); font-size: .85rem; }
.hero { display: grid; gap: .9rem; max-width: 52rem; margin-bottom: clamp(1.6rem, 4vw, 2.6rem); }
.lede { font-size: clamp(1.05rem, 1.8vw, 1.22rem); line-height: 1.55; max-width: 46rem; }
.hero .facts { font-family: var(--f-mono); font-size: .8rem; color: var(--muted); display: flex; gap: .3rem 1.2rem; flex-wrap: wrap; }
.hero .facts b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
section.block, .block { margin-top: clamp(2rem, 5vw, 3.2rem); display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.hero, .world-head, .panel, .card, .side > div, .stage-gal { grid-template-columns: minmax(0, 1fr); }
.sec-head { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: baseline; justify-content: space-between; }
.sec-head p { color: var(--muted); font-size: .92rem; max-width: 44rem; }
.foot { border-top: 1px solid var(--line); margin-top: 2rem; }
.foot-in { max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; padding: 1.2rem var(--gutter) 2rem; color: var(--muted); font-size: .88rem; display: grid; gap: .3rem; }
.err { color: var(--neg); font-size: .88rem; min-height: 1.2em; }
.notice { border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem; color: var(--muted); background: var(--surface); }

/* ── tlačítka a ovládání ── */
.btn { font: 500 .8rem/1 var(--f-mono); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .55rem .8rem; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: default; }
.well .btn, .card .btn, .panel .btn { color: var(--well-ink); background: var(--well-2); border-color: var(--well-line); }
.well .btn:hover, .card .btn:hover, .panel .btn:hover { background: var(--well-hover); border-color: var(--well-line); }
.well .btn.primary, .card .btn.primary, .panel .btn.primary { background: var(--well-accent); border-color: var(--well-accent); color: var(--well); }
.well .btn.danger, .panel .btn.danger { border-color: #5a2a30; color: #ffb3b3; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.seg button { font: 500 .78rem/1 var(--f-mono); padding: .55rem .7rem; background: transparent; color: var(--muted); border: 0; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.well .seg { border-color: var(--well-line); }
.well .seg button { color: var(--well-muted); }
.well .seg button + button { border-left-color: var(--well-line); }
.well .seg button[aria-pressed="true"] { background: var(--well-hover); color: var(--well-ink); box-shadow: inset 0 -2px 0 var(--well-accent); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; align-items: center; gap: .4rem; font: 500 .78rem/1 var(--f-mono); padding: .45rem .7rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.chip i { width: .65rem; height: .65rem; border-radius: 50%; flex: none; }
.chip[aria-pressed="true"] { color: var(--ink); border-color: var(--ink); background: var(--surface); }
.panel .chip { border-color: var(--well-line); color: var(--well-muted); }
.panel .chip[aria-pressed="true"] { color: var(--well-ink); border-color: var(--well-accent); background: var(--well-hover); }
.chip.sq i { border-radius: 2px; }
.field { display: grid; gap: .25rem; font-family: var(--f-mono); font-size: .76rem; color: var(--muted); }
.field input, .field select { font: 500 .9rem var(--f-mono); padding: .5rem .6rem; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); min-width: 0; width: 100%; }
.well .field, .panel .field { color: var(--well-muted); }
.well .field input, .well .field select, .panel .field input, .panel .field select { background: var(--well-2); border-color: var(--well-line); color: var(--well-ink); }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.toolbar .lbl { font-family: var(--f-mono); font-size: .74rem; color: var(--muted); }

/* ── stavové štítky ── */
.status { display: inline-flex; align-items: center; gap: .4rem; font: 500 .72rem/1 var(--f-mono); letter-spacing: .04em; text-transform: uppercase; padding: .32rem .55rem; border-radius: 999px; border: 1px solid currentColor; }
.status::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.status.run { color: var(--c-foto); }
.status.run::before { animation: pulse 1.6s ease-in-out infinite; }
.status.stop { color: var(--well-muted); }
.status.dead { color: var(--c-celist); }
.status.stale { color: var(--c-tuk); }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .status.run::before { animation: none; } }

/* ── karty světů (tmavé jamky) ── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 25rem), 1fr)); gap: 1.1rem; }
.card { background: var(--well); color: var(--well-ink); border: 1px solid var(--well-line); border-radius: 16px; overflow: hidden; display: grid; min-width: 0; }
.card-head { padding: 1rem 1.1rem .8rem; display: grid; gap: .45rem; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.card-title h2 { font-size: 1.55rem; }
.card-title a { color: var(--well-ink); text-decoration: none; }
.card-title a:hover { color: var(--well-accent); }
.card .sub { font-family: var(--f-mono); font-size: .72rem; color: var(--well-muted); display: flex; flex-wrap: wrap; gap: .2rem .9rem; }
.big { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--well-line); }
.big > div { padding: .7rem .8rem; display: grid; gap: .1rem; min-width: 0; }
.big > div + div { border-left: 1px solid var(--well-line); }
.big dt, .kpi dt { font-family: var(--f-mono); font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; color: var(--well-muted); }
.big dd { margin: 0; font-family: var(--f-display); font-weight: 650; font-size: 1.35rem; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) { .big { grid-template-columns: repeat(2, minmax(0, 1fr)); } .big > div:nth-child(3) { border-left: 0; } .big > div:nth-child(n+3) { border-top: 1px solid var(--well-line); } }
.sparks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--well-line); }
.sparks figure { margin: 0; padding: .6rem .8rem .5rem; display: grid; gap: .25rem; min-width: 0; }
.sparks figure + figure { border-left: 1px solid var(--well-line); }
.sparks figcaption { font-family: var(--f-mono); font-size: .68rem; color: var(--well-muted); display: flex; flex-wrap: wrap; gap: 0 .6rem; }
.sparks figcaption b { color: var(--well-ink); font-weight: 500; }
.sparks canvas { width: 100%; height: 54px; display: block; }
.kpis { border-top: 1px solid var(--well-line); padding: .7rem .8rem; display: grid; gap: .45rem; }
.kpi { display: grid; grid-template-columns: 6.6rem minmax(0, 1fr); gap: .6rem; align-items: baseline; }
.kpi dd { margin: 0; font-family: var(--f-mono); font-size: .78rem; color: var(--well-muted); display: flex; flex-wrap: wrap; gap: .1rem .8rem; }
.kpi dd b { color: var(--well-ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.organs { border-top: 1px solid var(--well-line); padding: .7rem .8rem; display: flex; flex-wrap: wrap; gap: .35rem .8rem; font-family: var(--f-mono); font-size: .74rem; color: var(--well-muted); }
.organs span { display: inline-flex; align-items: center; gap: .3rem; }
.organs i, .comp i, .sw { width: .62rem; height: .62rem; border-radius: 2px; display: inline-block; flex: none; }
.organs b { color: var(--well-ink); font-weight: 500; }
.bodies { border-top: 1px solid var(--well-line); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bodies figure { margin: 0; padding: .5rem .5rem .55rem; display: grid; gap: .2rem; min-width: 0; }
.bodies figure + figure { border-left: 1px solid var(--well-line); }
.bodies canvas { width: 100%; height: 58px; display: block; }
.bodies figcaption { font-family: var(--f-mono); font-size: .66rem; color: var(--well-muted); text-align: center; line-height: 1.3; }
.bodies figcaption b { color: var(--well-ink); font-weight: 500; }
.card-foot { border-top: 1px solid var(--well-line); padding: .7rem .8rem; display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; font-family: var(--f-mono); font-size: .7rem; color: var(--well-muted); }
.card-foot a { color: var(--well-accent); font-size: .8rem; text-decoration: none; }
.card-foot a:hover { text-decoration: underline; }

.legend-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: .8rem 2rem; max-width: 66rem; }
.legend-list div { display: grid; gap: .15rem; }
.legend-list strong { font-family: var(--f-display); font-weight: 650; }
.legend-list span { color: var(--muted); font-size: .92rem; }

/* ── grafy ── */
.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 34rem), 1fr)); gap: 1rem; }
.panel { background: var(--well); color: var(--well-ink); border: 1px solid var(--well-line); border-radius: 14px; padding: .9rem 1rem .8rem; display: grid; gap: .5rem; min-width: 0; align-content: start; }
.panel h3 { font-family: var(--f-mono); font-size: .72rem; font-weight: 500; letter-spacing: .09em; text-transform: uppercase; color: var(--well-muted); }
.panel .note { color: var(--well-muted); font-size: .82rem; line-height: 1.45; }
.panel .head { display: flex; justify-content: space-between; align-items: baseline; gap: .4rem 1rem; flex-wrap: wrap; }
.chart { width: 100%; min-height: 180px; position: relative; }
.chart.tall { min-height: 230px; }
.chart .empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--well-muted); font-family: var(--f-mono); font-size: .8rem; }
canvas.plain { display: block; width: 100%; }
.mark-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-family: var(--f-mono); font-size: .72rem; color: var(--muted); }
.mark-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.mark-legend i { width: .5rem; height: .75rem; display: inline-block; clip-path: polygon(50% 100%, 0 0, 100% 0); }
.world-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-family: var(--f-mono); font-size: .74rem; color: var(--muted); }
.world-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.world-legend i { width: 1.2rem; height: 3px; border-radius: 2px; display: inline-block; }
.world-legend i.dash { background-image: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px) !important; height: 2px; }

/* uPlot na tmavé ploše */
.uplot { font-family: var(--f-mono); color: var(--well-muted); }
.uplot .u-legend { font-size: .72rem; text-align: left; margin-top: .2rem; }
.uplot .u-legend .u-marker { width: .9em; height: .9em; border-radius: 2px; }
.uplot .u-legend th { font-weight: 500; color: var(--well-muted); }
.uplot .u-legend td { color: var(--well-ink); font-variant-numeric: tabular-nums; }
.uplot .u-legend .u-series > * { padding: 1px 4px; }
.uplot .u-select { background: rgba(169, 164, 255, 0.12); }
.u-cursor-pt { border-radius: 50%; }

/* ── stránka světa ── */
.world-head { display: grid; gap: .7rem; margin-bottom: 1.4rem; }
.world-head .title { display: flex; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; }
.world-head .facts { font-family: var(--f-mono); font-size: .76rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; }
.world-head .facts b { color: var(--ink); font-weight: 500; }
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: .7rem; margin-bottom: 1.3rem; }
@media (max-width: 560px) { .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; } .kpi-box { padding: .6rem .65rem; } .kpi-box .v { font-size: 1.15rem; } .kpi-box p { font-size: .68rem; } }
.kpi-box { border: 1px solid var(--line); border-radius: 12px; padding: .7rem .85rem; display: grid; gap: .3rem; min-width: 0; background: var(--surface); }
.kpi-box h3 { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.kpi-box .v { font-family: var(--f-display); font-weight: 650; font-size: 1.4rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi-box .v small { font-size: .8rem; font-weight: 500; color: var(--muted); font-family: var(--f-mono); }
.kpi-box p { font-family: var(--f-mono); font-size: .74rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0 .8rem; }
.kpi-box p b { color: var(--ink); font-weight: 500; }

.well { background: var(--well); color: var(--well-ink); border: 1px solid var(--well-line); border-radius: 16px; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 22rem; font-size: .9rem; line-height: 1.5; }
.stage { min-width: 0; display: grid; align-content: start; }
.stage-wrap { position: relative; }
.stage canvas.world { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; background: var(--well); cursor: crosshair; touch-action: manipulation; }
.stage .overlay { position: absolute; left: .7rem; top: .6rem; right: .7rem; display: flex; justify-content: space-between; gap: .5rem; pointer-events: none; font-family: var(--f-mono); font-size: .72rem; color: var(--well-ink); text-shadow: 0 1px 2px #000; }
.stage .overlay .ev { color: var(--c-tuk); }
.stage .offline { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 1rem; color: var(--well-muted); font-family: var(--f-mono); font-size: .85rem; background: rgba(11, 13, 18, .72); }
.side { border-left: 1px solid var(--well-line); padding: 1rem; display: grid; gap: 1.1rem; align-content: start; min-width: 0; }
.well h3 { font-family: var(--f-mono); font-size: .72rem; font-weight: 500; letter-spacing: .09em; text-transform: uppercase; color: var(--well-muted); margin-bottom: .45rem; }
.well .note { color: var(--well-muted); font-size: .82rem; }
.readout { display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; padding: .75rem 1rem; border-top: 1px solid var(--well-line); font-family: var(--f-mono); font-size: .76rem; color: var(--well-muted); }
.readout b { color: var(--well-ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.stage .toolbar { padding: .7rem 1rem; border-top: 1px solid var(--well-line); }
.stage .toolbar .lbl { color: var(--well-muted); }
.who { font-size: .88rem; }
.who b { font-weight: 600; }
.stats { margin: .3rem 0 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .1rem .8rem; font-family: var(--f-mono); font-size: .74rem; }
.stats dt { color: var(--well-muted); }
.stats dd { margin: 0; color: var(--well-ink); font-variant-numeric: tabular-nums; }
.comp { display: flex; flex-wrap: wrap; gap: .25rem .7rem; margin-top: .4rem; font-family: var(--f-mono); font-size: .72rem; color: var(--well-muted); }
.comp span { display: inline-flex; align-items: center; gap: .3rem; }
.comp b { color: var(--well-ink); font-weight: 500; }
.brainkey { font-family: var(--f-mono); font-size: .7rem; color: var(--well-muted); margin-top: .35rem; display: flex; gap: .2rem 1rem; flex-wrap: wrap; }
.brainkey i { display: inline-block; width: .9rem; height: 2px; vertical-align: middle; margin-right: .3rem; }
.feat { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .4rem; }
.feat button { font: 500 .7rem/1 var(--f-mono); padding: .38rem .5rem; border-radius: 6px; border: 1px solid var(--well-line); background: var(--well-2); color: var(--well-muted); cursor: pointer; display: inline-flex; gap: .3rem; align-items: center; }
.feat button i { width: .55rem; height: .55rem; border-radius: 50%; }
.feat button[aria-pressed="true"] { color: var(--well-ink); border-color: var(--well-accent); }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.gallery figure { margin: 0; background: var(--well-2); border-radius: 10px; padding: .4rem .5rem .5rem; display: grid; gap: .2rem; min-width: 0; }
.gallery canvas { display: block; width: 100%; height: 64px; }
.gallery figcaption { font-size: .7rem; line-height: 1.35; color: var(--well-muted); font-family: var(--f-mono); }
.gallery figcaption b { color: var(--well-ink); font-weight: 500; }
.well-panels { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; border-top: 1px solid var(--well-line); }
.well-panels > div { padding: 1rem; min-width: 0; }
.well-panels > div + div { border-left: 1px solid var(--well-line); }
@media (max-width: 1060px) { .well { grid-template-columns: minmax(0, 1fr); } .side { border-left: 0; border-top: 1px solid var(--well-line); grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); } }
@media (max-width: 700px) { .well-panels { grid-template-columns: minmax(0, 1fr); } .well-panels > div + div { border-left: 0; border-top: 1px solid var(--well-line); } }

.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
@media (max-width: 900px) { .two { grid-template-columns: minmax(0, 1fr); } }
.log { list-style: none; margin: 0; padding: 0 .3rem 0 0; display: grid; gap: .45rem; font-size: .86rem; max-height: 34rem; overflow-y: auto; overscroll-behavior: contain; }
.log li { display: grid; grid-template-columns: 7.2rem minmax(0, 1fr); gap: .6rem; }
.log .t { font-family: var(--f-mono); font-size: .72rem; color: var(--well-muted); padding-top: .12rem; font-variant-numeric: tabular-nums; line-height: 1.35; }
.log .t small { display: block; font-size: .66rem; }
.log .k-ice { color: #9fd3ff; } .log .k-drought { color: var(--c-tuk); } .log .k-plague { color: var(--c-nerv); } .log .k-meteor { color: var(--c-celist); } .log .k-bloom { color: var(--c-foto); }
.log .k-runner { color: var(--well-accent); } .log .k-api { color: var(--c-usta); } .log .k-muted { color: var(--well-muted); }
.log .d { color: var(--well-muted); font-size: .78rem; display: block; }
.tbl-wrap { overflow: auto; max-height: 36rem; overscroll-behavior: contain; }
.stage-gal { border-top: 1px solid var(--well-line); padding: 1rem; display: grid; gap: .1rem; }
.stage-gal .gallery { grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr)); }
.well h3.gap { margin-top: 1rem; }
table.sp { border-collapse: collapse; width: 100%; font-size: .82rem; }
table.sp th { font-family: var(--f-mono); font-size: .66rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--well-muted); text-align: left; padding: .3rem .6rem .4rem 0; border-bottom: 1px solid var(--well-line); white-space: nowrap; }
table.sp td { padding: .35rem .6rem .35rem 0; border-bottom: 1px solid var(--well-line); vertical-align: middle; font-variant-numeric: tabular-nums; font-family: var(--f-mono); font-size: .76rem; white-space: nowrap; }
table.sp td canvas { display: block; width: 64px; height: 30px; }
table.sp tr.sel td { background: var(--well-hover); }
table.sp .hue { width: .7rem; height: .7rem; border-radius: 50%; display: inline-block; vertical-align: -1px; margin-right: .35rem; }
.more { margin-top: .6rem; }

/* správa */
.admin { border: 1px dashed var(--well-accent); }
.admin .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 1rem 1.4rem; }
.admin .grid > div { display: grid; gap: .5rem; align-content: start; }
.admin .cells { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem .8rem; }
.admin .row { flex-wrap: nowrap; align-items: flex-end; }
.admin .row .field { flex: 1; min-width: 0; }
.admin .grid > div > .row:has(> .btn:only-child), .admin .grid .row:not(:has(.field)) { flex-wrap: wrap; }
.tg { display: flex; align-items: center; gap: .45rem; font-size: .82rem; cursor: pointer; }
.tg input { accent-color: var(--well-accent); width: .95rem; height: .95rem; margin: 0; flex: none; }
.admin .out { font-family: var(--f-mono); font-size: .74rem; color: var(--well-muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.settings-list { font-family: var(--f-mono); font-size: .76rem; color: var(--well-muted); display: flex; flex-wrap: wrap; gap: .2rem 1rem; }
.settings-list b { color: var(--well-ink); font-weight: 500; }
.settings-list .off { color: var(--c-celist); }

/* dialog a hláška */
.dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--bg); color: var(--ink); padding: 1.3rem 1.4rem; width: min(26rem, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(5, 6, 10, .6); }
.dialog form { display: grid; gap: .8rem; }
.toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); background: var(--ink); color: var(--bg); font-family: var(--f-mono); font-size: .8rem; padding: .6rem .9rem; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100vw - 32px); z-index: 20; }
.toast.on { opacity: 1; }
