:root {
  --ground: #F4F5F7;
  --surface: #FFFFFF;
  --text: #16181D;
  --text-2: #2C3038;
  --muted: #4E5460;
  --border: #DADDE2;
  --border-soft: #EEF0F2;
  --input: #C4C8CF;
  --accent: #0E5A5F;
  --accent-dark: #09393C;
  --accent-soft: #E7F0F0;
  --accent-ink: #0B4549;
  --danger: #A12C2C;
  --radius: 10px;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
#app { flex: 1 0 auto; display: flex; flex-direction: column; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1, h2, h3, h4, h5, h6 { line-height: 1.25; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* tlačítka */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--input); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--muted); color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-size: 15px; font-weight: 600; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn.link { border-color: transparent; background: transparent; color: var(--accent); padding: 0 10px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, a:focus-visible, input:focus-visible, button:focus-visible { outline: 3px solid #7FB3B6; outline-offset: 2px; }

/* přihlášení */
.center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 16px; }
.card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 40px; display: flex; flex-direction: column; gap: 24px; }
.card h1 { margin: 0; font-size: 26px; font-weight: 600; }
.card p { margin: 0; }
.card .btn.primary { min-height: 48px; font-size: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand svg { flex-shrink: 0; }
.notes { display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: var(--muted); border-top: 1px solid #E6E8EC; padding-top: 18px; }
.notes div { display: flex; gap: 10px; align-items: flex-start; }
.notes svg { flex-shrink: 0; margin-top: 2px; }

/* hlavička */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-in { max-width: 1200px; margin: 0 auto; padding: 8px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.user { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 14px; color: var(--muted); }

.page { max-width: 1200px; width: 100%; margin: 0 auto; padding: 28px 24px 32px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 600; }

/* filtr */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--muted); }
.field input { min-height: 44px; padding: 0 12px; border: 1px solid var(--input); border-radius: 8px; font: inherit; font-size: 15px; color: var(--text); background: var(--surface); }
.field.grow { flex: 1 1 260px; }
.field.date { flex: 0 1 170px; }

/* tabulka */
.table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
.table-in { min-width: 720px; }
.trow { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, 1.2fr); gap: 16px; align-items: center; padding: 0 20px; }
.thead { padding-top: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
a.trow { min-height: 56px; border-bottom: 1px solid var(--border-soft); color: var(--text); text-decoration: none; }
a.trow:last-child { border-bottom: 0; }
a.trow:hover { background: #F8F9FA; color: var(--text); }
.trow .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .sub { color: var(--muted); }
.trow .mono { font-size: 13px; color: var(--muted); }
.empty { padding: 32px 20px; text-align: center; color: var(--muted); }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); }
.pager .btns { display: flex; gap: 8px; }

/* stavy */
.alert { border: 1px solid #E3B4B4; background: #FBEFEF; color: var(--danger); border-radius: 8px; padding: 12px 16px; font-size: 14px; }
.loading { padding: 32px 20px; text-align: center; color: var(--muted); }

/* detail */
.back { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; text-decoration: none; font-size: 14px; font-weight: 500; }
.detail-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; }
.detail-head h1 { margin: 0 0 8px; font-size: 28px; font-weight: 600; overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 14px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.player { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.player audio { flex: 1 1 320px; min-width: 0; width: 100%; }
.player .hint { flex-basis: 100%; font-size: 12px; color: var(--muted); margin: 0; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { min-height: 48px; padding: 0 16px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent; font: inherit; font-size: 15px; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.tabpanel { padding: 24px; }
.cols { display: flex; flex-wrap: wrap; gap: 32px; }
.cols .main { flex: 999 1 480px; min-width: 0; }
.cols .side { flex: 1 1 240px; min-width: 0; }
.tabpanel h2 { margin: 0 0 12px; font-size: 18px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 500; }
.todo { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 4px; }
.todo label { display: flex; align-items: flex-start; gap: 10px; min-height: 36px; padding-top: 6px; }
.todo input { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; }

/* markdown */
.md { color: var(--text-2); line-height: 1.6; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md h3, .md h4, .md h5, .md h6 { color: var(--text); margin: 20px 0 8px; }
.md h3 { font-size: 17px; } .md h4 { font-size: 16px; } .md h5, .md h6 { font-size: 15px; }
.md p { margin: 0 0 12px; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 22px; }
.md li { margin: 2px 0; }
.md code { font-family: var(--mono); font-size: 13px; background: #F0F2F4; padding: 1px 5px; border-radius: 4px; }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.md li.task { list-style: none; margin-left: -22px; }
.note-block + .note-block { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border-soft); }

/* přepis */
.tsearch { max-width: 420px; margin-bottom: 8px; }
.seg { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.seg:last-child { border-bottom: 0; }
.seg .ts { align-self: start; min-height: 32px; padding: 4px 6px; border: 0; border-radius: 6px; background: #F0F2F4; font-family: var(--mono); font-size: 13px; color: var(--accent-ink); cursor: pointer; }
.seg .ts:disabled { cursor: default; color: var(--muted); }
.seg .who { display: block; font-size: 13px; font-weight: 600; }
.seg .what { display: block; color: var(--text-2); line-height: 1.55; }
mark { background: #FFE7A3; color: inherit; padding: 0 1px; }

details.raw { margin-top: 24px; font-size: 13px; }
details.raw summary { cursor: pointer; color: var(--muted); min-height: 32px; }
details.raw pre { max-height: 420px; overflow: auto; background: #F4F5F7; border: 1px solid var(--border); border-radius: 8px; padding: 12px; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }

.footer { padding: 16px; text-align: center; font-family: var(--mono); font-size: 12px; color: #5A606B; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 10; }

@media (max-width: 640px) {
  .card { padding: 28px 20px; }
  .page { padding: 20px 16px 28px; }
  .topbar-in { padding: 8px 16px; }
  .tabpanel { padding: 18px 16px; }
  .seg { grid-template-columns: 68px minmax(0, 1fr); gap: 10px; }
}
