/* BUĎ TEĎ – barvy a písma podle logomanuálu 2023 */
:root {
  --black: #000000;
  --violet: #4C3C90;
  --green: #00663A;
  --mint: #8CCAAE;
  --yellow: #FFCC00;
  --red: #E63312;

  --violet-soft: #E4E2F5;
  --mint-soft: #D6EFE4;
  --red-soft: #FCE1D9;
  --red-ink: #8F2510;
  --yellow-soft: #FFF2C2;

  --text: #000000;
  --muted: #55524A;
  --line: #EDEAE0;
  --card: #FFFFFF;

  --font-head: 'Antonio', 'Arial Narrow', sans-serif;
  --font-body: 'Carlito', Calibri, 'Segoe UI', system-ui, sans-serif;

  --radius: 22px;
  --shadow: 0 3px 12px rgba(0, 0, 0, 0.07);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--yellow);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
#root { min-height: 100vh; min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--violet); }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }

.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; }

.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(20px + var(--safe-top)) 20px calc(28px + var(--safe-bottom));
  animation: fade 0.18s ease-out;
}
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .app { animation: none; } }

/* Nadpisy */
.h-display {
  font-family: var(--font-head);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--violet);
  line-height: 1.06;
  margin: 0;
}
.h-display small { display: block; font-size: 0.5em; line-height: 1.2; margin-bottom: 4px; }
.h1 { font-size: 40px; }
.h2 { font-size: 32px; }
.h3 { font-family: var(--font-head); font-weight: 700; font-size: 24px; line-height: 1.15; margin: 0; text-transform: uppercase; }
.accent-line { width: 64px; height: 5px; border-radius: 3px; background: var(--red); }
.muted { color: var(--muted); }
.small { font-size: 15px; }

/* Domovská obrazovka */
.home { position: relative; flex: 1; display: flex; flex-direction: column; gap: 24px; padding-top: 28px; overflow: hidden; }
.home-squiggle { position: absolute; right: -70px; top: 300px; width: 320px; pointer-events: none; z-index: 0; }
.home-head { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 18px; }
.home-logo { width: 250px; height: auto; display: block; margin-left: -4px; }
.tiles { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: auto; }
.tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  min-height: 164px; padding: 18px; border: 0; border-radius: 24px;
  text-align: left; text-decoration: none; transition: transform 0.12s ease;
}
.tile:active { transform: scale(0.98); }
.tile-icon { width: 48px; height: 48px; border-radius: 24px; display: flex; align-items: center; justify-content: center; }
.tile-label { display: flex; flex-direction: column; gap: 3px; margin-top: auto; }
.tile-title { font-family: var(--font-head); font-weight: 700; font-size: 28px; line-height: 1.05; text-transform: uppercase; }
.tile-sub { font-size: 15px; }
.tile.violet { background: var(--violet); color: #fff; }
.tile.violet .tile-icon, .tile.green .tile-icon { background: rgba(255,255,255,0.16); color: #fff; }
.tile.mint { background: var(--mint); color: var(--black); }
.tile.mint .tile-icon { background: rgba(255,255,255,0.5); color: var(--green); }
.tile.green { background: var(--green); color: #fff; }
.tile.white { background: #fff; color: var(--black); }
.tile.white .tile-icon { background: var(--yellow); color: var(--black); }

/* Hlavička podstránky */
.topbar { display: flex; align-items: center; gap: 12px; padding: 16px 0 12px; }
.icon-btn {
  width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 22px;
  background: #fff; color: var(--black); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.topbar-text { display: flex; flex-direction: column; min-width: 0; }
.topbar-sub { font-size: 15px; color: #3D3A30; }
.page { display: flex; flex-direction: column; gap: 14px; padding-top: 8px; }

/* Karty a seznamy */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card-col { display: flex; flex-direction: column; gap: 10px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.row {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 78px; padding: 14px;
  border: 0; border-radius: 20px; background: #fff; box-shadow: var(--shadow);
  text-align: left; text-decoration: none; color: var(--black);
}
.row-icon { width: 50px; height: 50px; flex-shrink: 0; border-radius: 15px; display: flex; align-items: center; justify-content: center; }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row-title { font-size: 17px; font-weight: 700; line-height: 1.25; }
.row-meta { font-size: 14px; color: var(--muted); }
.badge-new { flex-shrink: 0; padding: 4px 9px; border-radius: 10px; background: var(--red); color: #000; font-size: 12px; font-weight: 700; letter-spacing: 0.6px; }
.badge-offline { flex-shrink: 0; color: var(--green); }
.chev { flex-shrink: 0; color: #8A8577; }

.k-audio { background: var(--mint-soft); color: var(--green); }
.k-text { background: var(--violet-soft); color: var(--violet); }
.k-video { background: var(--red-soft); color: var(--red-ink); }
.k-folder { background: var(--yellow-soft); color: var(--black); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 44px; padding: 0 18px; border: 0; border-radius: 22px; background: #fff; color: #000; font-weight: 700; font-size: 16px; }
.chip[aria-pressed="true"] { background: #000; color: var(--yellow); }

.pill { align-self: flex-start; padding: 5px 12px; border-radius: 12px; font-size: 14px; font-weight: 700; }

/* Tlačítka */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px; border-radius: 26px; border: 0;
  background: #000; color: var(--yellow); font-weight: 700; font-size: 17px; text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.block { width: 100%; }
.btn.outline { background: transparent; color: #000; border: 2px solid #000; }
.btn.light { background: #fff; color: var(--green); }
.btn.danger { background: transparent; color: var(--red-ink); border: 2px solid var(--red-ink); }
.btn.small { min-height: 44px; font-size: 15px; padding: 0 16px; }
.link-btn { background: none; border: 0; padding: 8px 0; color: var(--violet); font-weight: 700; text-decoration: underline; }

/* Přehrávač */
.player { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 10px 0 4px; }
.player-ring { width: 168px; height: 168px; border-radius: 84px; background: var(--mint-soft); display: flex; align-items: center; justify-content: center; }
.player-btn { width: 88px; height: 88px; border: 0; border-radius: 44px; background: #000; color: var(--yellow); display: flex; align-items: center; justify-content: center; }
.seek { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.seek input[type=range] { width: 100%; accent-color: var(--green); height: 28px; }
.seek-times { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.video-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 16px; background: var(--violet); }
.text-body { font-size: 18px; line-height: 1.6; white-space: pre-line; margin: 0; }

/* Formuláře */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; font-size: 15px; }
.field .hint { font-size: 14px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border: 2px solid var(--line);
  border-radius: 14px; background: #fff; font-size: 17px;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--violet); outline: none; }
.textarea { min-height: 180px; resize: vertical; line-height: 1.5; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; }
.check input { width: 22px; height: 22px; accent-color: var(--violet); }
.msg { padding: 12px 14px; border-radius: 14px; font-size: 16px; }
.msg.error { background: var(--red-soft); color: var(--red-ink); }
.msg.ok { background: var(--mint-soft); color: var(--green); }
.msg.info { background: var(--yellow-soft); color: #3D3A30; }

/* Přihlášení */
.auth { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.auth-logo { width: 240px; height: auto; align-self: center; }

/* Instalace */
.install-banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; background: rgba(255,255,255,0.75); position: relative; z-index: 1; }
.install-banner p { margin: 0; flex: 1; font-size: 15px; line-height: 1.35; }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.sheet { width: 100%; max-width: 560px; background: #fff; border-radius: 26px 26px 0 0; padding: 24px 22px calc(28px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 14px; }
.sheet ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }

/* Administrace */
.admin-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #fff; border-radius: 16px; box-shadow: var(--shadow); }
.admin-row .row-text { gap: 1px; }
.admin-indent { margin-left: 22px; }
.tag-draft { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 8px; background: var(--line); color: var(--muted); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid rgba(0,0,0,0.15); border-top-color: #000; border-radius: 50%; animation: spin 0.8s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.offline-bar { background: #000; color: var(--yellow); text-align: center; font-size: 14px; padding: 6px 12px; padding-top: calc(6px + var(--safe-top)); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
