/* Magulačka — vzhled. Šedý Material jako původní aplikace, světlý i tmavý. */

:root {
  --bg: #f2f2f2;
  --surface: #ffffff;
  --surface-2: #e9e9e9;
  --surface-3: #dcdcdc;
  --ink: #1d1d1d;
  --muted: #646464;
  --line: #d4d4d4;
  --bar: #333333;
  --bar-ink: #ffffff;
  --btn: #3a3a3a;
  --btn-ink: #ffffff;
  --btn-press: #222222;
  --btn-2: #e2e2e2;
  --btn-2-ink: #1d1d1d;
  --nav: #ffffff;
  --nav-ink: #6b6b6b;
  --nav-active: #1d1d1d;
  --red: #d30b0b;
  --hp: #c62828;
  --hp-soft: #fbe3e3;
  --mg: #3d3d3d;
  --over: #c98a1e;
  --over-soft: #f7ead2;
  --sero: #4f6fbf;
  --sero-soft: #e2e8f6;
  --ok: #2e7d4f;
  --scrim: rgba(0, 0, 0, .45);
  --shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 2px 6px rgba(0, 0, 0, .06);
  --radius: 10px;
  --tap: 48px;
  --font: Roboto, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #121212;
  --surface: #1e1e1e;
  --surface-2: #2a2a2a;
  --surface-3: #363636;
  --ink: #ececec;
  --muted: #a3a3a3;
  --line: #3a3a3a;
  --bar: #262626;
  --btn: #3f3f3f;
  --btn-press: #555555;
  --btn-2: #2f2f2f;
  --btn-2-ink: #ececec;
  --nav: #1a1a1a;
  --nav-ink: #9a9a9a;
  --nav-active: #ffffff;
  --hp: #ef5350;
  --hp-soft: #3a1d1d;
  --mg: #d9d9d9;
  --over: #e0a33c;
  --over-soft: #3a2e17;
  --sero: #7f9be0;
  --sero-soft: #1f2840;
  --ok: #6fc08f;
  --scrim: rgba(0, 0, 0, .6);
  --shadow: 0 1px 2px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 24px; height: 24px; fill: currentColor; flex: none; }

/* ---------- Kostra ---------- */
#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg);
}
.bar {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 56px;
  padding: env(safe-area-inset-top, 0) 4px 0 12px;
  background: var(--bar);
  color: var(--bar-ink);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
  position: relative;
  z-index: 5;
}
.bar-who {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 8px 4px;
  text-align: left;
  color: inherit;
}
.bar-who b { font-size: 1.15rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-who small { display: block; opacity: .75; font-size: .75rem; }
.bar-btn {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  background: none; border: 0; border-radius: 50%;
  color: inherit;
}
.bar-btn:active { background: rgba(255, 255, 255, .15); }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; margin-right: 4px; }
.sync-dot[data-s="ok"] { background: #6fc08f; }
.sync-dot[data-s="wait"] { background: #e0a33c; }
.sync-dot[data-s="err"] { background: #ef5350; }

main#view {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 10px 16px;
}
.tabs {
  display: flex;
  background: var(--nav);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tabs button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 2px 6px;
  min-height: 58px;
  background: none;
  border: 0;
  color: var(--nav-ink);
  font-size: .75rem;
  letter-spacing: .02em;
}
.tabs button[aria-current="page"] { color: var(--nav-active); font-weight: 600; }
.tabs button[aria-current="page"] svg { transform: translateY(-1px); }

/* ---------- Karty, tlačítka ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  background: var(--btn);
  color: var(--btn-ink);
  font-size: .86rem;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
  line-height: 1.15;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  transition: background .12s, transform .06s;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
.btn:active { background: var(--btn-press); transform: scale(.98); }
.btn:disabled { opacity: .45; }
.btn.flat { background: var(--btn-2); color: var(--btn-2-ink); box-shadow: none; }
.btn.flat:active { background: var(--surface-3); }
.btn.text { background: none; color: var(--ink); box-shadow: none; }
.btn.danger { background: var(--hp); color: #fff; }
.btn.wide { width: 100%; }
.btn { flex-wrap: wrap; }
.btn small { display: block; flex-basis: 100%; text-transform: none; letter-spacing: 0; font-weight: 400; opacity: .8; font-size: .75rem; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
:focus-visible { outline: 3px solid var(--sero); outline-offset: 2px; }

/* ---------- Domů ---------- */
.home { display: flex; flex-direction: column; min-height: 100%; }
.stat { padding: 12px 14px 10px; }
.stat-top { display: flex; align-items: flex-start; gap: 10px; }
.who { flex: 1; min-width: 0; }
.who-name { font-size: 1.3rem; font-weight: 500; line-height: 1.2; overflow-wrap: anywhere; }
.who-sub { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.mg { text-align: right; line-height: 1; white-space: nowrap; }
.mg-num { font-size: 2.9rem; font-weight: 400; letter-spacing: -.02em; }
.mg-unit { font-size: 1.1rem; color: var(--muted); margin-left: 3px; }
.mg.over .mg-num { color: var(--over); }
.meter {
  position: relative;
  height: 10px;
  margin: 10px 0 8px;
  border-radius: 5px;
  background: var(--surface-2);
  overflow: hidden;
}
.meter i { position: absolute; inset: 0 auto 0 0; background: var(--mg); border-radius: 5px; transition: width .3s; }
.meter i.over { background: var(--over); }
.meter b { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--surface); }
.meter.sero i { background: var(--sero); }
.stat-line { display: flex; justify-content: space-between; gap: 8px; font-size: .95rem; flex-wrap: wrap; }
.stat-line .cd { font-weight: 600; }
.stat-line .over { color: var(--over); font-weight: 600; }
.pred { font-size: .82rem; color: var(--muted); margin-top: 2px; min-height: 1.1em; }
.pred.warn { color: var(--hp); font-weight: 500; }
.hladiny { display: flex; gap: 6px; margin-top: 10px; }
.hladiny button {
  flex: 1;
  min-height: 36px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 18px;
  font-size: .8rem;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.hladiny button[aria-pressed="true"] { background: var(--sero-soft); border-color: var(--sero); color: var(--ink); font-weight: 600; }
.hladiny button[data-l="0"][aria-pressed="true"] { background: var(--surface-2); border-color: var(--muted); }
.pasky { display: inline-flex; gap: 2px; }
.pasky i { width: 4px; height: 12px; border: 1px solid currentColor; border-radius: 1px; }

.hp {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 12px;
}
.hp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hp-val { display: flex; align-items: center; gap: 6px; font-size: 1.3rem; font-weight: 500; }
.hp-val .muted { font-size: .85rem; font-weight: 400; }
.hp-val svg { fill: var(--hp); }
.hp-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; font-size: .76rem; }
.hp-sub span { white-space: nowrap; }
.hp-sub span + span::before { content: '· '; }
.hp-val .hp-pips { margin-left: 4px; }
.hp .btn { min-height: 44px; padding: 6px 12px; flex: none; }
.hp-pips { display: flex; gap: 2px; }
.hp-pips i { width: 5px; height: 10px; border-radius: 1px; background: var(--hp); }
.hp-pips i.empty { background: var(--surface-3); }

.alarm {
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--hp);
  color: #fff;
}
.alarm h3 { margin: 0 0 4px; font-size: 1.05rem; letter-spacing: .04em; text-transform: uppercase; }
.alarm p { margin: 0 0 10px; font-size: .92rem; }
.alarm .cd { font-size: 1.6rem; font-weight: 600; }
.alarm .btn { background: rgba(0, 0, 0, .28); }
.alarm .muted { color: rgba(255, 255, 255, .82); }
.alarm .small { font-size: .85rem; }
.alarm.black { background: #1b1b1b; }

.fx-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 12px;
  border-radius: 17px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: .82rem;
  max-width: 100%;
}
.chip b { font-weight: 600; }
.chip.sero { border-color: var(--sero); }
.chip.udrzba { border-color: var(--over); }
.chip.leceni { border-color: var(--ok); }
.chip.promena { border-color: var(--over); border-width: 2px; }
.hp.promena { box-shadow: inset 4px 0 0 var(--over); }
.hp-promena { font-size: .72rem; font-weight: 600; color: var(--over); text-transform: uppercase; letter-spacing: .04em; }
.tag.promena { color: var(--over); }

.qs { margin-bottom: 10px; }
.qs .btn { min-height: 58px; font-size: .8rem; padding: 6px; overflow-wrap: anywhere; }
.qs .btn.empty { background: var(--btn-2); color: var(--muted); box-shadow: none; border: 1px dashed var(--line); }
.qs .btn.on { box-shadow: inset 0 0 0 2px var(--over); }

.mods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.mods.n3 { grid-template-columns: repeat(3, 1fr); }
.mods.n1, .mods.n2 { grid-template-columns: repeat(2, 1fr); }
.toggle {
  min-height: 44px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: .8rem;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 4px;
}
.toggle::before {
  content: "";
  width: 16px; height: 16px; flex: none;
  border: 2px solid var(--muted);
  border-radius: 3px;
}
.toggle[aria-pressed="true"] { background: var(--surface-2); border-color: var(--ink); font-weight: 600; }
.toggle[aria-pressed="true"]::before { background: var(--ink); border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--surface); }

.acts { flex: 1; grid-auto-rows: minmax(56px, 1fr); }
.acts .btn { min-height: 56px; }

.empty-state { text-align: center; padding: 28px 14px; }
.empty-state h2 { margin: 0 0 6px; font-size: 1.3rem; font-weight: 500; }
.empty-state p { color: var(--muted); margin: 0 0 18px; }
.empty-state .btn { margin: 0 0 8px; width: 100%; }

/* ---------- Seznamy ---------- */
.toolbar { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.toolbar .btn { flex: 1 1 auto; min-height: 42px; font-size: .78rem; }
.search {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 0 12px;
  margin-bottom: 8px;
}
.search input { flex: 1; border: 0; background: none; min-height: 44px; outline: none; }
.filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 4px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button {
  flex: none;
  min-height: 34px;
  padding: 4px 12px;
  border-radius: 17px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: .82rem;
}
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }

.list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 10px; }
.list-h { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px 14px 4px; font-weight: 600; }
.item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 14px;
  border-top: 1px solid var(--line);
  min-height: 60px;
}
.list > .item:first-child, .list-h + .item { border-top: 0; }
.item-main { flex: 1; min-width: 0; }
.item-name { font-weight: 500; overflow-wrap: anywhere; }
.item-meta { font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; margin-top: 2px; }
.item-state { font-size: .82rem; margin-top: 3px; font-weight: 500; }
.item-state.on { color: var(--over); }
.item .btn { min-width: 92px; }
button.item { width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; }
button.item:active { background: var(--surface-2); }
/* Sesílání: celý řádek je tlačítko. */
span.item-main, span.item-name, .item.tap .item-state { display: block; }
.item.tap { cursor: pointer; touch-action: manipulation; }
.item.tap > .btn { pointer-events: none; }
.switch small { display: block; font-size: .76rem; color: var(--muted); margin-top: 1px; }
.cost s { opacity: .6; margin-right: 3px; }
.cost b { color: var(--ink); }
.el { display: inline-flex; align-items: center; gap: 4px; }
.el::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c, #888); }
.el-0 { --c: #8a8a8a; } .el-1 { --c: #e05a2b; } .el-2 { --c: #2f7fd1; } .el-3 { --c: #7d5a35; }
.el-4 { --c: #6fb7c9; } .el-5 { --c: #6a4a8c; } .el-6 { --c: #d5a021; }
.tag { font-size: .7rem; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; letter-spacing: .03em; }

.symbol { display: flex; align-items: center; gap: 10px; }
.symbol .txt { flex: 1; font-size: .92rem; }
.symbol .txt b { font-size: 1.05rem; }
.symbol .btn { min-height: 40px; }

/* ---------- Formuláře ---------- */
details.sec { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 10px; }
details.sec > summary {
  list-style: none;
  padding: 14px;
  font-weight: 500;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
  min-height: 52px;
}
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary::after { content: "▾"; color: var(--muted); transition: transform .15s; }
details.sec[open] > summary::after { transform: rotate(180deg); }
details.sec > .body { padding: 0 14px 14px; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.field > span em { font-style: normal; color: var(--hp); }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  outline: none;
}
.field textarea { min-height: 120px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); }
.field small { display: block; font-size: .76rem; color: var(--muted); margin-top: 3px; }
.field.err input { border-color: var(--hp); }
.field .errmsg { color: var(--hp); font-size: .78rem; margin-top: 3px; }
.fields2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.fields3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 8px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; margin-bottom: 6px; }
.switch input { width: 46px; height: 26px; appearance: none; -webkit-appearance: none; background: var(--surface-3); border-radius: 13px; position: relative; transition: background .15s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .15s; }
.switch input:checked { background: var(--ink); }
.switch input:checked::after { transform: translateX(20px); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.seg button {
  flex: 1 1 auto;
  min-height: 40px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-size: .82rem;
}
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); font-weight: 600; }
.savebar { position: sticky; bottom: -16px; margin: 0 -10px -16px; padding: 10px; background: linear-gradient(transparent, var(--bg) 30%); display: flex; gap: 8px; }
.savebar .btn { flex: 1; }
.chars .item { cursor: pointer; }
.chars .item[aria-current="true"] { box-shadow: inset 4px 0 0 var(--ink); }

/* ---------- Spodní panel (sheet) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.scrim { position: absolute; inset: 0; background: var(--scrim); animation: fade .15s; }
.sheet {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 92dvh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0));
  animation: up .18s ease-out;
  overscroll-behavior: contain;
}
.sheet::before { content: ""; display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--surface-3); margin: 0 auto 8px; }
.sheet h2 { margin: 4px 0 4px; font-size: 1.2rem; font-weight: 500; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sheet h2 .bar-btn { color: var(--muted); width: 40px; height: 40px; }
.sheet .hint { color: var(--muted); margin: 0 0 12px; font-size: .9rem; }
.sheet .actions { display: flex; gap: 8px; margin-top: 12px; }
.sheet .actions .btn { flex: 1; }
.sheet pre { white-space: pre-wrap; font: .9rem/1.5 var(--font); margin: 0; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }

.np-display {
  display: flex; align-items: baseline; justify-content: center; gap: 6px;
  font-size: 2.6rem; font-weight: 400;
  padding: 4px 0;
  min-height: 64px;
}
.np-display small { font-size: 1rem; color: var(--muted); }
.np-after { text-align: center; color: var(--muted); font-size: .9rem; min-height: 1.4em; margin-bottom: 8px; }
.np-after b { color: var(--ink); }
.np-after.warn { color: var(--hp); }
.np-chips { display: flex; gap: 6px; margin-bottom: 8px; }
.np-chips button { flex: 1; min-height: 40px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); font-size: .9rem; }
.np-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.np-keys button {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 1.35rem;
  display: grid; place-items: center;
  touch-action: manipulation;
}
.np-keys button:active { background: var(--surface-3); }
/* Jedna mřížka čísel (zranění, životy) – bez druhé klávesnice. */
.np-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 4px 0 8px; }
.np-grid button {
  min-height: 52px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 1.35rem;
  touch-action: manipulation;
}
.np-grid button:active { background: var(--surface-3); }
.np-grid button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); font-weight: 600; }
.np-fields { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin-bottom: 6px; }
.np-fields button { min-height: 60px; border: 2px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 1.5rem; }
.np-fields button small { display: block; font-size: .72rem; color: var(--muted); }
.np-fields button[aria-pressed="true"] { border-color: var(--ink); }

.menu .item { min-height: 52px; }
.menu .item svg { color: var(--muted); }
.tiers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tiers .btn { min-height: 40px; flex: 1 1 30%; font-size: .82rem; text-transform: none; letter-spacing: 0; }
.tiers .btn.have { background: var(--btn-2); color: var(--btn-2-ink); box-shadow: inset 0 0 0 2px var(--ok); }
.kat-note { font-size: .82rem; color: var(--muted); margin-top: 4px; }

.log { list-style: none; margin: 0; padding: 0; font-size: .86rem; }
.log li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; }
.log time { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.qr { display: grid; place-items: center; padding: 10px; background: #fff; border-radius: 8px; margin: 8px auto; width: max-content; }
.qr svg { display: block; width: 220px; height: 220px; }
.keybox { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; word-break: break-all; background: var(--surface-2); padding: 8px 10px; border-radius: 6px; }

/* ---------- Hlášky ---------- */
#toasts { position: fixed; left: 0; right: 0; top: calc(62px + env(safe-area-inset-top, 0)); display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 40; pointer-events: none; padding: 0 12px; }
.toast {
  max-width: 560px;
  background: #323232;
  color: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: .92rem;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .3);
  pointer-events: auto;
  display: flex; align-items: center; gap: 12px;
  animation: dolu .18s ease-out;
}
@keyframes dolu { from { transform: translateY(-16px); opacity: .3; } }
.toast.warn { background: #8e1c1c; }
.toast button { background: none; border: 0; color: #ffcc80; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 6px 4px; min-height: 36px; }

@media (min-width: 560px) {
  .mg-num { font-size: 3.4rem; }
  main#view { padding: 14px; }
}
@media (max-height: 700px) {
  .qs .btn { min-height: 48px; }
  .acts .btn { min-height: 48px; }
  .mg-num { font-size: 2.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Pomocné třídy (kvůli CSP bez inline stylů) ---------- */
.plain { background: none; border: 0; padding: 0; color: inherit; text-align: left; }
button.mg.plain { text-align: right; }
.nowrap { white-space: nowrap; }
.small { font-size: .8rem; }
.lbl { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.red { color: var(--hp) !important; }
.strong { font-weight: 500; margin: 0 0 4px; }
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt10 { margin-top: 10px; } .mt12 { margin-top: 12px; } .mt14 { margin-top: 14px; }
.mb10 { margin: 0 0 10px; }
.pad4 { padding: 0 4px; }
.wrap { flex-wrap: wrap; }
.block { display: block !important; }
.steps { padding-left: 20px; line-height: 1.6; }
.bullets { margin: 0 0 12px; padding-left: 20px; font-size: .92rem; }
.seg button small { display: block; font-size: .7rem; opacity: .8; }
.el.sub { font-weight: 400; font-size: .8rem; color: var(--muted); }
svg.i.i-sm { width: 12px; height: 12px; vertical-align: -1px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
a.item { color: inherit; text-decoration: none; }
.list.chars .item[aria-current="true"] .item-name::after { content: " ✓"; color: var(--ok); }

.item-meta.pozn { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qs .btn small { font-size: .78rem; }
.pasky i { background: currentColor; opacity: .35; }
.bar-who b { font-size: 1.1rem; }
.bar-who small { font-size: .82rem; opacity: .85; }
