/* study.sk – tmavý minimalizmus (SPEC 11.1), štýly z prototypov (docs/prototype/proto.css).
   Systémové písmo, žiadne externé zdroje, CSP bez inline štýlov (farby z dát nastavuje ui/dom.js cez CSSOM). */
:root {
  --bg: #0B0D12;
  --surface: #151924;
  --surface-2: #1D2230;
  --line: #2A3040;
  --text: #E8ECF2;
  --muted: #9AA3B2;
  --accent: #2F7BFF;
  --ok: #3DD68C;
  --bad: #FF6B6B;
  --warn: #FFC94D;
  --radius: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100dvh; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.mt { margin-top: 16px; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- kostra ---------- */
.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(16px, env(safe-area-inset-left));
}
.boot { margin: auto; }
.screen-head { padding: 16px 0 8px; display: flex; align-items: center; gap: 10px; }
.screen-head .grow { flex: 1; min-width: 0; }
.screen-head h1 { overflow-wrap: anywhere; }
.crumb { font-size: 0.85rem; color: var(--muted); }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 44px; height: 44px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 12px;
  background: var(--surface); text-decoration: none;
}
.icon-btn svg { width: 22px; height: 22px; }

.btn {
  min-height: 52px;
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 1.125rem;
  font-weight: 650;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 18px;
  text-decoration: none;
}
.btn.secondary { background: var(--surface); color: var(--text); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.small { min-height: 40px; font-size: 0.95rem; width: auto; border-radius: 12px; }
.btn:disabled { opacity: 0.45; cursor: default; }
.link { background: none; border: 0; color: var(--muted); font-size: 0.95rem; padding: 0.75rem; min-height: 44px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}
.chip.warn { color: var(--warn); }
.bottom { position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 28%); display: flex; flex-direction: column; gap: 8px; }
.empty { color: var(--muted); padding: 18px 0; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #262C3B; color: var(--text); padding: 10px 16px; border-radius: 12px; z-index: 80;
  max-width: calc(100vw - 32px); font-size: 0.95rem;
}

/* ---------- prihlásenie ---------- */
.login { width: 100%; max-width: 340px; margin: auto; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; text-align: center; padding: 24px 0; }
.error { color: var(--bad); min-height: 1.5em; margin: 0.25rem 0; }
.pin-dots { display: flex; gap: 14px; margin-top: 0.5rem; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); }
.pin-dots i.on { background: var(--accent); border-color: var(--accent); }
.pinpad { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px; justify-content: center; }
.pinpad button { width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--surface); color: var(--text); font-size: 1.6rem; }
.pinpad button:active { background: var(--accent); }

/* ---------- formuláre ---------- */
.stack { width: 100%; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 0.9rem; }
/* 16 px v poliach, aby iOS pri zameraní nezoomoval (SPEC 4.5). */
.field { display: block; width: 100%; font-size: 16px; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
textarea.field { min-height: 84px; resize: vertical; line-height: 1.4; }
.hint-text { color: var(--muted); font-size: 0.85rem; margin: -2px 0 0; }
.segmented { display: flex; background: var(--surface); border-radius: 12px; padding: 3px; gap: 3px; }
.segmented button { flex: 1; border: 0; background: transparent; border-radius: 10px; min-height: 40px; font-size: 0.92rem; color: var(--muted); }
.segmented button.on { background: var(--surface-2); color: var(--text); }
.segmented a { flex: 1; display: flex; align-items: center; justify-content: center; border-radius: 10px; min-height: 40px; font-size: 0.92rem; color: var(--muted); text-decoration: none; }
.segmented a.on { background: var(--surface-2); color: var(--text); }
.option-row { display: flex; gap: 8px; align-items: center; }
.stack > .btn.small, .label > .btn.small { align-self: flex-start; }
.option-row .field { flex: 1; }

/* ---------- domov ---------- */
.today { margin: 4px 0 14px; }
.five {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  width: 100%; min-height: 96px; padding: 16px 20px; border: 0; border-radius: 20px;
  background: var(--accent); color: #fff; text-align: left; text-decoration: none;
}
.five strong { font-size: 1.45rem; }
.five span { opacity: 0.85; font-size: 0.95rem; }
.five:disabled { opacity: 0.5; }
.five-scope { margin-top: 8px; }
.subjects { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.subject {
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 60px; padding: 10px 16px; border: 0; border-radius: 14px; background: var(--surface); text-align: left; text-decoration: none;
}
.subject .bar { width: 6px; align-self: stretch; border-radius: 3px; background: var(--accent); }
.subject .name { flex: 1; font-size: 1.05rem; }
.subject .due { color: var(--muted); font-size: 0.9rem; text-align: right; }
.subject .due b { color: var(--text); font-weight: 600; }
.subject.active { outline: 2px solid var(--accent); }
.topics { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.topic { background: var(--surface); border-radius: 14px; padding: 14px 16px; }
.topic .row h3 { flex: 1; }
.topic h3 a { text-decoration: none; }
.progress { height: 6px; background: var(--surface-2); border-radius: 3px; margin: 10px 0 12px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--subject, var(--accent)); border-radius: 3px; }
.topic .actions { display: flex; gap: 8px; }
.topic .btn.secondary { background: var(--surface-2); }
.home-cols { display: block; }
.home-right { display: none; }

/* ---------- téma a zoznam kartičiek ---------- */
.cards { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.card-row { display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 12px 14px; border: 0; border-radius: 14px; background: var(--surface); text-align: left; text-decoration: none; }
.card-row .txt { flex: 1; min-width: 0; }
.card-row .q { display: block; overflow-wrap: anywhere; }
.card-row .a { display: block; color: var(--muted); font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }

/* ---------- opakovanie ---------- */
.study-top { display: flex; align-items: center; gap: 10px; padding: 14px 0 6px; }
.study-top .grow { flex: 1; min-width: 0; }
.count { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.9rem; }
.card-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 8px 0 16px; }
.flashcard {
  width: 100%; max-width: 640px; min-height: 340px;
  background: var(--surface); border-radius: 22px; padding: 26px 22px;
  display: flex; flex-direction: column; gap: 14px; position: relative;
  transition: transform 0.18s ease, opacity 0.18s ease;
  touch-action: pan-y;
}
.flashcard .type { align-self: flex-start; }
.flashcard .front { font-size: 1.35rem; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; white-space: pre-line; }
.flashcard .back { font-size: 1.15rem; border-top: 1px solid var(--line); padding-top: 14px; overflow-wrap: anywhere; white-space: pre-line; }
.flashcard .hint { color: var(--muted); font-size: 0.95rem; }
.flashcard .tap-hint { margin-top: auto; color: var(--muted); font-size: 0.85rem; text-align: center; }
.flashcard.swipe-left { box-shadow: inset 0 0 0 2px var(--bad); }
.flashcard.swipe-right { box-shadow: inset 0 0 0 2px var(--ok); }
.cloze-blank { display: inline-block; min-width: 80px; border-bottom: 2px solid var(--accent); }
.cloze-fill { color: var(--accent); }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice { min-height: 52px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); text-align: left; padding: 10px 16px; font-size: 1.05rem; }
.choice.correct { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 16%, var(--surface-2)); }
.choice.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 16%, var(--surface-2)); }
.feedback { font-weight: 600; }
.feedback.ok { color: var(--ok); }
.feedback.bad { color: var(--bad); }
.feedback.warn { color: var(--warn); }
.ratings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 0 0 calc(14px + env(safe-area-inset-bottom)); }
.ratings .span-all { grid-column: 1 / -1; }
.ratings .span-3 { grid-column: span 3; }
.rating { min-height: 64px; border: 0; border-radius: 14px; background: var(--surface); font-size: 0.92rem; font-weight: 600; padding: 6px 4px; line-height: 1.2; }
.rating small { display: block; color: var(--muted); font-weight: 400; font-size: 0.75rem; margin-top: 2px; }
.rating.r1 { box-shadow: inset 0 -3px 0 var(--bad); }
.rating.r2 { box-shadow: inset 0 -3px 0 var(--warn); }
.rating.r3 { box-shadow: inset 0 -3px 0 var(--ok); }
.rating.r4 { box-shadow: inset 0 -3px 0 var(--accent); }
.swipe-hint { text-align: center; color: var(--muted); font-size: 0.85rem; padding-bottom: 8px; }
.done { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 12px; max-width: 520px; margin: 0 auto; width: 100%; }
.done p { font-size: 1.3rem; margin: 0 0 12px; }

/* ---------- nastavenia ---------- */
.section { margin-top: 22px; }
.section h2 { margin-bottom: 10px; }
.settings-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.settings-list li { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 14px; padding: 8px 10px 8px 14px; min-height: 56px; }
.settings-list .name { flex: 1; }
.settings-list li.swatch-li { background: none; min-height: 0; padding: 0; }
.dot-btn { padding: 8px; min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0 4px 14px; }
.swatches button { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; padding: 0; }
.swatches button.on { border-color: #fff; }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; background: var(--accent); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; color: var(--muted); }
.kv b { color: var(--text); font-weight: 500; }

/* ---------- Import a kontrola (M3) ---------- */
.row .grow { flex: 1; }
.segmented.wrap { flex-wrap: wrap; }
.segmented.wrap button { flex: 1 1 30%; }
.add-photo { width: 100%; }
.sources { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.source-btn { position: relative; display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 12px 18px; border-radius: var(--radius); background: var(--surface); }
.source-btn svg { width: 26px; height: 26px; flex: none; color: var(--accent); }
.source-btn b { display: block; font-size: 1.05rem; }
.source-btn small { color: var(--muted); }
.source-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.tip { margin-top: 18px; padding: 12px 14px; border-radius: 14px; border: 1px dashed var(--line); color: var(--muted); font-size: 0.9rem; }
.tip b { color: var(--text); font-weight: 600; }
.pages { display: flex; gap: 10px; overflow-x: auto; padding: 8px 0 4px; }
.page-thumb { position: relative; width: 72px; height: 96px; border-radius: 10px; background: var(--surface); flex: none; overflow: hidden; border: 1px solid var(--line); object-fit: cover; }
.page-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.page-thumb.pdf { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px; text-align: center; }
.page-thumb.pdf span { font-weight: 700; color: var(--accent); }
.page-thumb.pdf small { font-size: 0.65rem; color: var(--muted); word-break: break-all; }
.thumb-x { position: absolute; top: 2px; right: 2px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(11, 13, 18, 0.8); padding: 5px; }
.thumb-x svg { width: 100%; height: 100%; }
.reading { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 28px 0 8px; }
.reading .bar { width: 240px; height: 6px; border-radius: 3px; background: var(--surface); overflow: hidden; }
.reading .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.5s linear; }
.page-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.page-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 14px; padding: 8px 12px 8px 8px; }
.page-row .page-thumb { width: 44px; height: 58px; }
.page-row .grow { flex: 1; min-width: 0; }
.proposals { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.proposal { background: var(--surface); border-radius: var(--radius); padding: 12px; display: grid; grid-template-columns: 1fr; gap: 10px; border: 1px solid transparent; }
.proposal.low { border-color: var(--warn); }
.proposal.selected { border-color: var(--accent); }
.proposal .crop { position: relative; display: block; width: 100%; min-height: 36px; max-height: 260px; border: 0; padding: 0; border-radius: 10px; background: #F4F1E8; overflow: hidden; }
.proposal .crop img { position: absolute; left: 0; top: 0; max-width: none; display: block; transform-origin: 0 0; }
.proposal .crop.none { display: flex; align-items: center; justify-content: center; background: var(--surface-2); max-height: 44px; }
.proposal .q { font-weight: 600; white-space: pre-line; }
.proposal .a { color: var(--muted); margin-top: 2px; white-space: pre-line; }
.proposal .gap { color: var(--accent); border-bottom: 2px solid var(--accent); }
.proposal .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.proposal .warn { color: var(--warn); font-size: 0.85rem; margin-top: 6px; }
.proposal .error { margin-top: 6px; }
.proposal .label { margin-top: 6px; }
.proposal .tools { display: flex; gap: 6px; flex-wrap: wrap; }
.proposal .tools button { border: 0; background: var(--surface-2); border-radius: 10px; min-height: 38px; padding: 0 12px; font-size: 0.85rem; }
.full-page { position: relative; background: #F4F1E8; border-radius: 12px; overflow: hidden; margin-top: 10px; }
.full-page img { width: 100%; display: block; }
.page-region { position: absolute; border: 2px solid var(--accent); border-radius: 6px; background: rgba(47, 123, 255, 0.08); pointer-events: none; }
.page-region.on { border-color: var(--warn); background: rgba(255, 201, 77, 0.15); }
.page-region.bad { border: 2px dashed var(--bad); background: rgba(255, 107, 107, 0.1); }
.page-preview { width: 100%; max-height: 50vh; object-fit: contain; border-radius: 12px; background: #F4F1E8; margin: 8px 0 12px; }

/* ---------- Slepá mapa (M4) ---------- */
.map-screen { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip-btn { flex: none; border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; min-height: 34px; padding: 0 12px; font-size: 0.85rem; }
.chip-btn.on { background: var(--surface-2); color: var(--text); border-color: var(--accent); }
.map-host { position: relative; border-radius: var(--radius); overflow: hidden; background: #10141C; }
.map-svg { display: block; width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.map-land path { fill: #1A1F2B; stroke: #2A3040; stroke-width: 0.8; vector-effect: non-scaling-stroke; }
.map-country { fill: #243046; }
.map-states path { fill: #243046; stroke: #3A4762; stroke-width: 0.7; vector-effect: non-scaling-stroke; }
.map-water path { fill: #10141C; stroke: #2A3040; stroke-width: 0.6; vector-effect: non-scaling-stroke; }
.map-areas path { fill: rgba(201, 150, 92, 0.22); stroke: none; }
.map-border { stroke: #C9D2E3; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.map-regions path { fill: none; stroke: #6B7894; stroke-width: 0.9; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.map-rivers path { fill: none; stroke: #4C9BFF; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.map-points circle { fill: #FFC94D; stroke: #0B0D12; stroke-width: 1; vector-effect: non-scaling-stroke; }
.map-points .pt-city, .map-points .pt-capital { fill: #FF6B8B; }
.map-points .pt-country { fill: #9DB0D3; }
.map-points .pt-lake { fill: #4CC9F0; }
.map-points .pt-unesco { fill: #B983FF; }
.map-points .pt-park { fill: #57D163; }
.map-hl .hl-area { fill: rgba(47, 123, 255, 0.35); stroke: #2F7BFF; stroke-width: 2; vector-effect: non-scaling-stroke; }
.map-hl .hl-line { fill: none; stroke: #FFFFFF; stroke-width: 4; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.map-hl .hl-dot { fill: none; stroke: #FFFFFF; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.map-info { min-height: 48px; padding: 12px 14px; border-radius: 14px; background: var(--surface); }
.map-info .chip { margin-left: 6px; }
.map-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.map-list button { width: 100%; text-align: left; border: 0; background: var(--surface); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.map-list small { color: var(--muted); }
.attribution { margin: 4px 0 0; }
.map-links .row { margin-top: 6px; }

/* ---------- Cvičenia na mape a vlastné body (M5) ---------- */
.map-points .pt-custom { fill: #4D8DFF; }
.map-hl .hl-area.other { fill: rgba(255, 107, 107, 0.28); stroke: var(--bad); }
.map-hl .hl-line.other { stroke: var(--bad); }
.map-hl .hl-dot.other { stroke: var(--bad); }
.map-hl .hl-tap { fill: var(--warn); stroke: #0B0D12; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.map-actions { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 8px; }
.map-actions .btn { padding-left: 8px; padding-right: 8px; }
.map-panel { background: var(--surface); border-radius: var(--radius); padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.map-panel p { margin: 0; }
.map-panel .row.wrap { flex-wrap: wrap; }
.map-info .link.inline { display: inline; min-height: 0; padding: 0 0 0 6px; color: var(--accent); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.pinex-host { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.pinex { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.pinex-q { font-size: 1.15rem; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.pinex-q b { color: var(--accent); }
.pinex-q small { color: var(--muted); font-weight: 400; font-size: 0.85rem; margin-left: 6px; }
.pinex-map { height: clamp(220px, calc(100dvh - 400px), 640px); }
.map-svg.fill { height: 100%; }
.pinex-panel { display: flex; flex-direction: column; gap: 10px; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
.pinex-panel .feedback { margin: 0; }
.pinex .choices.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pinex .choice { min-height: 52px; font-size: 1rem; padding: 8px 12px; overflow-wrap: anywhere; }
.pinex-panel .row .btn { padding-left: 12px; padding-right: 12px; }

/* ---------- iPad a širšie ---------- */
/* ---------- Denník pre rodiča (SPEC 10.5) ---------- */
.insight { width: 100%; max-width: 980px; margin: 0 auto; padding-bottom: 32px; }
.insight .screen-head { flex-wrap: wrap; }
.ins-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.ins-chips .chip { border: 0; font-size: 0.85rem; padding: 6px 12px; min-height: 34px; }
.ins-chips .chip[aria-pressed="true"] { background: var(--accent); color: #fff; }
.ins-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.ins-tile { background: var(--surface); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; }
.ins-tile b { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.ins-tile span { color: var(--muted); font-size: 0.85rem; }
.ins-card { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; margin: 10px 0; overflow-wrap: anywhere; }
.ins-card h3 { margin-bottom: 10px; }
.ins-card h4 { margin: 14px 0 6px; font-size: 0.95rem; }
.ins-card p { margin: 6px 0; }
.ins-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(40px, 0.8fr) minmax(0, 1.4fr); gap: 10px; align-items: center; padding: 4px 0; font-size: 0.92rem; }
.ins-name { min-width: 0; }
.ins-meta { color: var(--muted); font-size: 0.82rem; text-align: right; }
.ins-bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.ins-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; }
.ins-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--accent); }
.ins-cols { display: flex; gap: 2px; align-items: flex-end; height: 130px; }
.ins-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; height: 100%; font-size: 0.7rem; color: var(--muted); }
.ins-col b { font-weight: 500; min-height: 1.2em; }
.ins-colbar { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.ins-colbar i { display: block; width: 100%; height: 0; min-height: 1px; background: var(--accent); border-radius: 3px 3px 0 0; }
.ins-col small { min-height: 1.2em; }
.ins-tapmap { margin: 10px 0; }
.ins-tapmap svg { width: 100%; max-width: 420px; display: block; }
.ins-tapbg { fill: var(--surface-2); stroke: var(--line); stroke-width: 0.4; }
.ins-tap { fill: var(--warn); fill-opacity: 0.5; }
.ins-visit { border-top: 1px solid var(--line); padding: 8px 0; }
.ins-visit summary { cursor: pointer; }
.ins-path { line-height: 2; }
.ins-timeline { margin: 6px 0; padding-left: 20px; font-size: 0.88rem; }
.ins-scroll { overflow-x: auto; }
.ins-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.ins-table th, .ins-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ins-table th { color: var(--muted); font-weight: 500; }
.ins-warn td { color: var(--warn); }
.ins-bad { color: var(--bad); }
.ins-msg { margin: 8px 0; }
.insight pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); border-radius: 10px; padding: 10px; font-size: 0.8rem; max-height: 480px; overflow: auto; }

@media (min-width: 768px) {
  .narrow.wide-review { max-width: 960px; }
  .proposal { grid-template-columns: 360px 1fr; align-items: start; }
  .proposal .tools { grid-column: 1 / -1; }
  .app { padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
  .home-cols { display: grid; grid-template-columns: 360px 1fr; gap: 24px; flex: 1; padding-top: 8px; }
  .home-right { display: block; }
  .home-left .bottom { position: static; background: none; }
  .phone-only { display: none !important; }
  .narrow { max-width: 680px; width: 100%; margin: 0 auto; }
  .ratings { max-width: 640px; width: 100%; margin: 0 auto; }
  .flashcard { min-height: 380px; padding: 34px 32px; }
  .flashcard .front { font-size: 1.6rem; }
}
@media (max-width: 767px) {
  .pad-only { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Schémy so skrytými popiskami (M5 2/2): obrázok na papieri, zakrytia popiskov, body a ich názvy pri kontrole. */
.scheme-screen { display: flex; flex-direction: column; gap: 10px; flex: 1; max-width: 1100px; width: 100%; margin: 0 auto; }
.scheme-screen > p { margin: 0; }
.scheme-host { height: clamp(300px, calc(100dvh - 360px), 780px); }
.map-host:has(.map-svg.scheme), .map-svg.scheme { background: #E9E6DD; }
.scheme-paper { fill: #FFFFFF; }
.scheme-masks rect { fill: #2B3242; stroke: #0B0D12; stroke-width: 1; vector-effect: non-scaling-stroke; }
.scheme-masks.edit rect { fill: rgba(47, 123, 255, 0.35); stroke: #1F5BFF; stroke-width: 2; }
.scheme-masks.edit rect.on { fill: rgba(255, 201, 77, 0.5); stroke: #B07800; }
.scheme-masks.outline rect { fill: none; stroke: rgba(31, 91, 255, 0.55); stroke-width: 1.5; stroke-dasharray: 4 3; }
.map-points .pt-part { fill: #FF3D6A; stroke: #FFFFFF; stroke-width: 1.5; }
.map-svg.scheme .map-hl .hl-dot { stroke: #1F5BFF; stroke-width: 3; }
.map-svg.scheme .map-hl .hl-dot.other { stroke: #D9304F; }
.scheme-notes text { fill: #0B0D12; font-weight: 600; paint-order: stroke; stroke: rgba(255, 255, 255, 0.92); stroke-width: 0.28em; stroke-linejoin: round; pointer-events: none; }
.scheme-notes text.sel { fill: #1F5BFF; }
.scheme-notes text.empty { fill: #D9304F; }
.scheme-pins { flex-wrap: wrap; overflow: visible; }
.chip-btn.warn { border-color: var(--warn); color: var(--warn); }
.scheme-actions { display: grid; gap: 8px; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
.page-thumb.pick { padding: 0; cursor: pointer; }
.page-thumb.pick:focus-visible { outline: 2px solid var(--accent); }
@media (min-width: 768px) {
  .scheme-actions { grid-template-columns: 2fr 1fr 1fr; }
}
.row.three .btn { padding-left: 6px; padding-right: 6px; white-space: nowrap; min-width: 0; }
