/* Rozcestník: stejné barvy jako Nástěnka (noční modrá z loga Horsák, cyan #00becd). */
@font-face { font-family: 'Manrope Variable'; font-style: normal; font-display: swap; font-weight: 200 800; src: url(/fonts/manrope-latin-ext-wght-normal.woff2) format('woff2-variations'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Manrope Variable'; font-style: normal; font-display: swap; font-weight: 200 800; src: url(/fonts/manrope-latin-wght-normal.woff2) format('woff2-variations'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #0b1a24;
  --bg-deep: #08141c;
  --surface: #11263a;
  --surface-2: #17304a;
  --surface-3: #1f3b58;
  --line: #22405c;
  --line-soft: #1a334b;
  --text: #e9f2f7;
  --muted: #93abbd;
  --faint: #849db0;
  --accent: #00becd;
  --accent-hover: #2ad4e1;
  --accent-ink: #032a33;
  --accent-soft: rgba(0, 190, 205, 0.14);
  --rose: #ff6b81;
  --green: #3fd59a;
  --green-soft: rgba(63, 213, 154, 0.14);
  --amber: #ffbb3d;
  --amber-soft: rgba(255, 187, 61, 0.15);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; }
body {
  font-family: 'Manrope Variable', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
h1, h2 { line-height: 1.2; margin: 0 0 10px; letter-spacing: -0.015em; }
h1 { font-size: 22px; font-weight: 750; }
h2 { font-size: 17px; font-weight: 700; }
p { margin: 0; }
.ico { flex: none; display: inline-block; vertical-align: -0.2em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Rozvržení: horní okraj pro hodiny iPhonu, záložky, lišta ---------- */
.shell { position: fixed; inset: 0; display: flex; flex-direction: column; }
.statusbar { flex: none; height: var(--safe-top); background: var(--bg-deep); }
.frames { position: relative; flex: 1; min-height: 0; background: var(--bg); }
.frames iframe, .frames .page {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--bg);
}
.frames [hidden] { display: none; }
.page { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.page-inner { max-width: 640px; margin: 0 auto; padding: 20px 16px 28px; }

.safe-probe { position: fixed; left: 0; bottom: 0; width: 1px; height: env(safe-area-inset-bottom, 0px); pointer-events: none; visibility: hidden; }
.page-inner { padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }

/* Hlavička vlastní stránky rozcestníku (Nastavení) se stejným tlačítkem jako v aplikacích. */
.hub-head {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; padding: 10px 16px;
  background: rgba(8, 20, 28, 0.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line-soft);
}
.hub-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 8px 4px 0; border: 0; background: none;
  font-weight: 800; font-size: 17px; letter-spacing: -0.02em; cursor: pointer; border-radius: 12px;
}
.hub-btn img { width: 30px; height: 30px; border-radius: 8px; }
.hub-btn .ico { color: var(--muted); margin-left: -4px; }

/* Panel s přepínáním aplikací: vysune se pod tlačítkem vlevo nahoře. */
.switcher { position: fixed; inset: 0; z-index: 40; background: rgba(2, 10, 16, 0.5); }
.switcher-card {
  position: absolute; top: calc(var(--safe-top) + 58px); left: 12px; width: min(320px, calc(100vw - 24px));
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 6px;
  box-shadow: 0 14px 40px rgba(2, 10, 16, 0.55); animation: drop 0.14s ease-out;
}
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .switcher-card { animation: none; } }
.switcher-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 12px; border: 0; border-radius: 12px;
  background: none; text-align: left; font-weight: 650; font-size: 16px; cursor: pointer;
}
.switcher-row:hover, .switcher-row:focus-visible { background: var(--surface-3); }
.switcher-row .grow { flex: 1; }
.switcher-row .switcher-check { color: var(--accent); visibility: hidden; display: inline-flex; }
.switcher-row.current { color: var(--accent); }
.switcher-row.current .switcher-check { visibility: visible; }
.switcher-row[data-tab="nastaveni"] { border-top: 1px solid var(--line-soft); border-radius: 0 0 12px 12px; margin-top: 4px; }
.badge[hidden] { display: none; }
.badge {
  display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 6px; border-radius: 10px;
  background: var(--rose); color: #2b050d; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums;
}

/* ---------- Prvky ---------- */
.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 16px; padding: 16px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 16px; min-height: 44px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; text-decoration: none;
  font-weight: 650; font-size: 14px; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.block { width: 100%; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.warn-box { background: var(--amber-soft); color: #ffe2a8; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.error-box { background: rgba(255, 107, 129, 0.15); color: #ffc4cd; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-bottom) + 24px); z-index: 50;
  background: var(--surface-3); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; font-weight: 600;
  box-shadow: 0 14px 40px rgba(2, 10, 16, 0.55); max-width: calc(100vw - 32px);
}
.toast.err { border-color: var(--rose); }

/* ---------- Přihlášení a načítání ---------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.boot::after {
  content: ''; width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .boot::after { animation-duration: 2.4s; } }
.login {
  position: fixed; inset: 0; display: grid; place-items: center; padding: calc(var(--safe-top) + 24px) 16px calc(var(--safe-bottom) + 24px);
  background: radial-gradient(900px 500px at 50% -10%, rgba(0, 190, 205, 0.16), transparent 70%), var(--bg); overflow-y: auto;
}
.login .card { width: 100%; max-width: 380px; padding: 24px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.brand img { width: 40px; height: 40px; border-radius: 10px; }

/* ---------- Zkouška fotoaparátu ---------- */
.cam-video, .cam-photo { width: 100%; border-radius: 12px; background: #000; display: block; max-height: 50vh; object-fit: contain; }
