/* Grantový radar – styly. Tři návrhy vzhledu přes html[data-design]:
   a = Čistý (karty, vzdušné)   b = Kompaktní (datová tabulka)   c = Výrazný (aplikace, barevné akcenty) */

:root {
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #f1f3f6; --surface-3: #e9edf2;
  --ink: #0f172a; --ink-2: #475569; --ink-3: #8b95a7; --line: #e4e7ec; --line-2: #d5dae2;
  --brand: #4f46e5; --brand-2: #6366f1; --brand-ink: #ffffff; --brand-soft: #eef0ff;
  --red: #dc2626; --red-soft: #fdecec; --amber: #b45309; --amber-soft: #fdf3e2;
  --green: #047857; --green-soft: #e3f6ee; --teal: #0f766e; --violet: #6d28d9;
  --cat-eu: #2563eb; --cat-narodni: #7c3aed; --cat-vscht: #0d9488; --cat-ceny: #d97706; --cat-nadace: #db2777;
  --radius: 14px; --radius-sm: 10px; --gap: 16px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 8px rgba(15, 23, 42, .04);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .14);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d12; --surface: #12151c; --surface-2: #181c25; --surface-3: #212633;
    --ink: #e7eaf0; --ink-2: #a6afc0; --ink-3: #6f7a8e; --line: #222734; --line-2: #2d3343;
    --brand: #818cf8; --brand-2: #a5b4fc; --brand-ink: #0b0d12; --brand-soft: #1d1f3d;
    --red: #f87171; --red-soft: #3a1717; --amber: #fbbf24; --amber-soft: #352710;
    --green: #34d399; --green-soft: #0f2e24; --teal: #2dd4bf; --violet: #a78bfa;
    --cat-eu: #60a5fa; --cat-narodni: #a78bfa; --cat-vscht: #2dd4bf; --cat-ceny: #fbbf24; --cat-nadace: #f472b6;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 16px 48px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01"; font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- tlačítka a pole ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  background: var(--brand); color: var(--brand-ink); font-weight: 600; cursor: pointer;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--brand-2); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.icon { width: 40px; padding: 0; }
.btn svg { width: 18px; height: 18px; flex: none; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: .02em; }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface); transition: border .15s, box-shadow .15s;
}
.select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b95a7' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* ---------- přihlášení ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero {
  position: relative; overflow: hidden; padding: 56px; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(1200px 600px at 10% 0%, #6366f1 0%, transparent 60%),
              radial-gradient(900px 600px at 100% 100%, #0ea5e9 0%, transparent 55%), #1e1b4b;
}
.auth-hero h1 { font-size: clamp(30px, 4vw, 46px); line-height: 1.1; letter-spacing: -.02em; margin: 0 0 14px; max-width: 12ch; }
.auth-hero p { color: rgba(255, 255, 255, .78); max-width: 42ch; margin: 0; font-size: 16px; }
.auth-hero .radar { position: absolute; right: -120px; bottom: -120px; width: 520px; opacity: .35; }
.auth-hero .brand { color: #fff; }
.auth-form { display: grid; place-items: center; padding: 32px 20px; background: var(--bg); }
.auth-card { width: min(380px, 100%); display: grid; gap: 16px; }
.auth-card h2 { margin: 0; font-size: 24px; letter-spacing: -.01em; }
.auth-card .muted { margin: -8px 0 4px; }
.auth-card .btn { height: 44px; margin-top: 4px; }
.error { color: var(--red); font-size: 13px; min-height: 18px; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 28px 24px 36px; min-height: 0; gap: 28px; }
  .auth-hero .radar { width: 300px; right: -90px; bottom: -110px; }
}

/* ---------- horní lišta ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px;
  height: 64px; padding: 0 max(20px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.brand .logo { width: 32px; height: 32px; flex: none; }
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--ink-3); letter-spacing: .02em; }
.search { position: relative; flex: 1; max-width: 560px; margin: 0 auto; }
.search svg { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search .input { padding-left: 40px; background: var(--surface); border-color: var(--line); }
.user { position: relative; margin-left: auto; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; font-weight: 700;
  background: linear-gradient(135deg, var(--brand), #0ea5e9); color: #fff;
}
.menu {
  position: absolute; right: 0; top: 46px; min-width: 240px; padding: 8px; display: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
}
.menu.open { display: block; }
.menu .who { padding: 8px 10px 10px; font-size: 13px; color: var(--ink-2); border-bottom: 1px solid var(--line); margin-bottom: 6px; overflow-wrap: anywhere; }
.menu .btn { width: 100%; justify-content: flex-start; }

/* ---------- obsah ---------- */
.page { max-width: 1480px; margin: 0 auto; padding: 20px max(20px, env(safe-area-inset-left)) 40px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat {
  text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius);
  padding: 14px 16px; cursor: pointer; box-shadow: var(--shadow); transition: border .15s, transform .1s;
}
.stat:hover { border-color: var(--line-2); }
.stat.active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.stat b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.stat span { font-size: 13px; color: var(--ink-2); }
.stat i { font-style: normal; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

.controls { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; cursor: pointer;
  font-weight: 600; font-size: 14px; color: var(--ink-2); white-space: nowrap; transition: background .15s, color .15s;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.tab .n { font-weight: 500; color: var(--ink-3); margin-left: 4px; }
.filters { display: flex; gap: 10px; align-items: end; margin-left: auto; flex-wrap: wrap; }
.filters .field { min-width: 150px; }
.filters .range-row { display: flex; align-items: center; gap: 10px; height: 40px; }
.filters input[type=range] { accent-color: var(--brand); width: 120px; }
.filters .range-row output { font-weight: 700; min-width: 2ch; }
.filter-btn, .sheet-head, .sheet-done { display: none; }
.result-count { font-size: 13px; color: var(--ink-3); margin: 0 0 10px; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 460px); gap: 20px; align-items: start; }

/* ---------- seznam (návrh A – karty) ---------- */
.list { display: grid; gap: 8px; }
.list-head { display: none; }
.item {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; box-shadow: var(--shadow); transition: border .15s, box-shadow .15s, transform .1s;
}
.item:hover { border-color: var(--line-2); box-shadow: 0 4px 16px rgba(15, 23, 42, .07); }
.item.active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.item-title { margin: 0 0 4px; font-size: 15px; font-weight: 600; line-height: 1.35; letter-spacing: -.005em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13px; color: var(--ink-2); }
.item-meta .sep { color: var(--ink-3); }
.item-provider { max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-deadline { text-align: right; display: grid; gap: 4px; justify-items: end; }
.item-deadline time { font-size: 12px; color: var(--ink-3); }

.ring {
  --v: 0; --c: var(--ink-3); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--v) * 1%), var(--surface-3) 0);
}
.ring span { width: 34px; height: 34px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.ring.high { --c: var(--green); } .ring.mid { --c: var(--amber); } .ring.low { --c: var(--ink-3); }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--cat, var(--ink-3)); }
.cat-eu { --cat: var(--cat-eu); } .cat-narodni { --cat: var(--cat-narodni); } .cat-vscht { --cat: var(--cat-vscht); }
.cat-ceny { --cat: var(--cat-ceny); } .cat-nadace { --cat: var(--cat-nadace); }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip.brand { background: var(--brand-soft); color: var(--brand); }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.pill.urgent { background: var(--red-soft); color: var(--red); }
.pill.soon { background: var(--amber-soft); color: var(--amber); }
.pill.ok { background: var(--green-soft); color: var(--green); }

.empty { padding: 48px 20px; text-align: center; color: var(--ink-2); background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.skeleton { height: 76px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border: 1px solid var(--line); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- detail ---------- */
.detail {
  position: sticky; top: 84px; max-height: calc(100dvh - 104px); overflow: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow);
}
.detail-empty { display: grid; place-items: center; text-align: center; gap: 8px; padding: 56px 28px; color: var(--ink-2); }
.detail-empty svg { width: 56px; height: 56px; color: var(--ink-3); }
.d-head { padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.d-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.d-close { display: none; margin: -6px 0 6px -10px; }
.d-title { margin: 0 0 6px; font-size: 20px; line-height: 1.3; letter-spacing: -.015em; }
.d-sub { font-size: 13px; color: var(--ink-2); }
.d-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.d-actions .btn { flex: 1 1 auto; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.fact { background: var(--surface); padding: 14px 16px; }
.fact span { display: block; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.fact b { font-size: 15px; display: block; line-height: 1.3; }
.fact small { color: var(--ink-2); font-size: 12px; }
.d-body { padding: 6px 22px 24px; }
.d-section { padding: 16px 0; border-bottom: 1px solid var(--line); }
.d-section:last-child { border-bottom: 0; }
.d-section h4 { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.d-section p { margin: 0; color: var(--ink); }
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 14px; font-size: 14px; margin: 0; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.checklist li { display: flex; gap: 8px; align-items: baseline; }
.checklist li::before { content: ""; width: 14px; height: 14px; border: 2px solid var(--line-2); border-radius: 4px; flex: none; transform: translateY(2px); }
.docs { display: grid; gap: 6px; }
.docs a { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); color: var(--ink); }
.docs a:hover { background: var(--surface-3); text-decoration: none; }
details.source summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: 14px; }
details.source p { margin-top: 10px; color: var(--ink-2); font-size: 14px; white-space: pre-line; }
.track-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.save-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.save-row .muted { font-size: 13px; }
.muted { color: var(--ink-2); }
.scrim { position: fixed; inset: 0; background: rgba(8, 10, 16, .45); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.scrim.on { opacity: 1; pointer-events: auto; }

/* ---------- návrh B – kompaktní datová tabulka ---------- */
html[data-design="b"] { --radius: 8px; }
html[data-design="b"] body { font-size: 14px; }
html[data-design="b"] .stats { grid-template-columns: repeat(4, max-content); gap: 8px; }
html[data-design="b"] .stat { padding: 8px 14px; box-shadow: none; display: flex; gap: 10px; align-items: baseline; }
html[data-design="b"] .stat b { font-size: 18px; }
html[data-design="b"] .list { gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: clip; }
html[data-design="b"] .list-head {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) 210px 150px; gap: 14px; padding: 9px 16px;
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3);
  background: var(--surface-2); border-bottom: 1px solid var(--line); position: sticky; top: 64px; z-index: 5;
}
html[data-design="b"] .item {
  grid-template-columns: 56px minmax(0, 1fr) 210px 150px; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; box-shadow: none; padding: 9px 16px;
}
html[data-design="b"] .item:hover { background: var(--surface-2); box-shadow: none; }
html[data-design="b"] .item.active { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
html[data-design="b"] .item-title { -webkit-line-clamp: 1; font-size: 14px; margin: 0 0 1px; }
html[data-design="b"] .item-meta { font-size: 12px; }
html[data-design="b"] .item-meta .item-provider, html[data-design="b"] .item-meta .sep.p { display: none; }
html[data-design="b"] .item-col-provider { display: block; font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[data-design="b"] .ring { width: auto; height: auto; background: none; justify-self: start; }
html[data-design="b"] .ring span { width: auto; height: 24px; padding: 0 9px; border-radius: 6px; background: var(--surface-2); font-size: 13px; }
html[data-design="b"] .ring.high span { background: var(--green-soft); color: var(--green); }
html[data-design="b"] .ring.mid span { background: var(--amber-soft); color: var(--amber); }
html[data-design="b"] .item-deadline { grid-template-columns: auto; justify-items: start; text-align: left; }
html[data-design="b"] .detail { border-radius: 10px; }
.item-col-provider { display: none; }

/* ---------- návrh C – výrazný, aplikační ---------- */
html[data-design="c"] { --radius: 20px; }
html[data-design="c"] .topbar { background: #1e1b4b; border-bottom: 0; color: #fff; }
html[data-design="c"] .topbar .brand { color: #fff; }
html[data-design="c"] .topbar .brand small { color: rgba(255, 255, 255, .6); }
html[data-design="c"] .topbar .search .input { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .14); color: #fff; }
html[data-design="c"] .topbar .search .input::placeholder { color: rgba(255, 255, 255, .55); }
html[data-design="c"] .topbar .search svg { color: rgba(255, 255, 255, .6); }
html[data-design="c"] .hero {
  display: block; margin: -20px calc(-1 * max(20px, env(safe-area-inset-left))) 20px; padding: 26px max(20px, env(safe-area-inset-left)) 70px;
  background: radial-gradient(900px 300px at 0% 0%, #4f46e5 0%, transparent 70%), radial-gradient(700px 300px at 100% 0%, #0ea5e9 0%, transparent 60%), #1e1b4b;
  color: #fff;
}
.hero { display: none; }
.hero h2 { margin: 0 0 4px; font-size: clamp(22px, 3vw, 30px); letter-spacing: -.02em; }
.hero p { margin: 0; color: rgba(255, 255, 255, .75); }
html[data-design="c"] .stats { margin-top: -62px; position: relative; }
html[data-design="c"] .stat { border: 0; box-shadow: var(--shadow-lg); padding: 16px 18px; }
html[data-design="c"] .stat b { font-size: 30px; }
html[data-design="c"] .tabs { background: transparent; padding: 0; gap: 8px; }
html[data-design="c"] .tab { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px; }
html[data-design="c"] .tab.active { background: var(--ink); color: var(--bg); border-color: var(--ink); box-shadow: none; }
html[data-design="c"] .tab.active .n { color: inherit; opacity: .7; }
html[data-design="c"] .list { gap: 12px; }
html[data-design="c"] .item { padding: 18px 20px 18px 22px; position: relative; overflow: hidden; border: 0; box-shadow: var(--shadow), 0 0 0 1px var(--line); }
html[data-design="c"] .item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--cat, var(--ink-3)); }
html[data-design="c"] .item:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(15, 23, 42, .10), 0 0 0 1px var(--line-2); }
html[data-design="c"] .item.active { box-shadow: 0 0 0 2px var(--brand), 0 10px 30px rgba(79, 70, 229, .18); }
html[data-design="c"] .item-title { font-size: 16px; }
html[data-design="c"] .ring { width: 50px; height: 50px; }
html[data-design="c"] .ring span { width: 40px; height: 40px; font-size: 15px; }
html[data-design="c"] .detail { border: 0; box-shadow: var(--shadow-lg); }
html[data-design="c"] .d-head { background: linear-gradient(180deg, var(--brand-soft), transparent); }
html[data-design="c"] .btn { border-radius: 999px; }

/* ---------- tablet: detail jako vysouvací panel ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .detail {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); max-height: none; z-index: 50;
    border-radius: 20px 0 0 20px; transform: translateX(105%); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
    box-shadow: var(--shadow-lg);
  }
  .detail.open { transform: none; }
  .d-close { display: inline-flex; }
  .detail-empty { display: none; }
  html[data-design="b"] .list-head, html[data-design="b"] .item { grid-template-columns: 56px minmax(0, 1fr) 140px; }
  html[data-design="b"] .item-col-provider, html[data-design="b"] .list-head .col-provider { display: none; }
  html[data-design="b"] .item-meta .item-provider, html[data-design="b"] .item-meta .sep.p { display: inline; }
}

/* ---------- mobil ---------- */
@media (max-width: 720px) {
  body { font-size: 15px; }
  .topbar { height: 58px; gap: 10px; padding: 0 14px; }
  .brand small { display: none; }
  .page { padding: 14px 14px calc(28px + env(safe-area-inset-bottom)); }
  .search { order: 3; }
  .topbar .search { display: none; }
  .mobile-search { display: block !important; margin-bottom: 12px; }
  .stats, html[data-design="b"] .stats { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; margin: 0 -14px 14px; padding: 2px 14px 4px; scrollbar-width: none; }
  .stats::-webkit-scrollbar { display: none; }
  .stat { flex: 0 0 auto; min-width: 150px; scroll-snap-align: start; }
  html[data-design="c"] .hero { margin: -14px -14px 16px; padding: 20px 14px 64px; }
  html[data-design="c"] .stats { margin-top: 0; }
  html[data-design="c"] .mobile-search { margin-top: -52px; position: relative; z-index: 1; }
  html[data-design="c"] .mobile-search .input { box-shadow: var(--shadow-lg); border: 0; }
  .controls { flex-wrap: nowrap; gap: 8px; }
  .tabs { flex: 1; min-width: 0; }
  .filter-btn { display: inline-flex; flex: none; }
  .filters {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; margin: 0; display: grid; gap: 14px;
    padding: 8px 18px calc(18px + env(safe-area-inset-bottom)); background: var(--surface);
    border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg); transform: translateY(105%); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
  }
  .filters.open { transform: none; }
  .filters .field { min-width: 0; }
  .filters input[type=range] { flex: 1; width: auto; }
  .sheet-head { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; }
  .sheet-head::before { content: ""; position: absolute; left: 50%; top: 8px; width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); transform: translateX(-50%); }
  .sheet-head h3 { margin: 6px 0 0; font-size: 17px; }
  .sheet-done { display: inline-flex; width: 100%; height: 46px; }
  .item, html[data-design="b"] .item, html[data-design="c"] .item {
    grid-template-columns: 44px minmax(0, 1fr); grid-template-areas: "ring main" "ring dl"; gap: 6px 12px; padding: 14px;
  }
  .item .ring { grid-area: ring; align-self: start; }
  .item-main { grid-area: main; min-width: 0; }
  .item-deadline, html[data-design="b"] .item-deadline { grid-area: dl; display: flex; gap: 8px; align-items: center; justify-content: flex-start; text-align: left; }
  html[data-design="b"] .list-head { display: none; }
  html[data-design="b"] .item-title { -webkit-line-clamp: 2; }
  html[data-design="c"] .item { padding-left: 18px; }
  .detail { width: 100%; border-radius: 0; top: 0; }
  .d-head { padding: 14px 18px; padding-top: calc(14px + env(safe-area-inset-top)); }
  .d-title { font-size: 19px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .fact:last-child { grid-column: span 2; }
  .d-body { padding: 4px 18px 120px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { font-size: 12px; margin-top: 8px; }
  .track-grid { grid-template-columns: 1fr; }
  .d-actions { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line); z-index: 2; }
  .d-actions .btn { height: 46px; }
}
.mobile-search { display: none; position: relative; }
.mobile-search svg { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--ink-3); }
.mobile-search .input { padding-left: 40px; height: 44px; }

/* přepínač návrhů – jen v lokálním náhledu */
.design-switch {
  position: fixed; left: 16px; bottom: 16px; z-index: 45; display: flex; gap: 4px; padding: 4px;
  background: var(--ink); border-radius: 999px; box-shadow: var(--shadow-lg);
}
.design-switch button { white-space: nowrap; border: 0; background: transparent; color: var(--bg); padding: 6px 12px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 13px; }
.design-switch button.active { background: var(--bg); color: var(--ink); }
@media (max-width: 720px) { .design-switch { left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 45; } .design-switch button { padding: 6px 10px; font-size: 12px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
