:root {
  --bg: #f6f7f9; --card: #fff; --text: #1d2330; --muted: #6b7280; --line: #e3e6eb;
  --accent: #1f7a6d; --ok: #1f8a4c; --bad: #c0392b; --soft: #e8f4f1;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14171c; --card: #1d2128; --text: #e6e8ec; --muted: #9aa3b2; --line: #2d333d;
          --accent: #5cc2b0; --ok: #4cc27f; --bad: #ef6b5f; --soft: #1f2e2b; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
header { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 600; text-decoration: none; color: var(--text); }
.who { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu { position: relative; } .menu summary { list-style: none; cursor: pointer; padding: 4px 8px; font-size: 18px; }
.menu[open] > :not(summary) { position: absolute; right: 0; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; display: block; white-space: nowrap; }
.menu button { background: none; border: 0; color: var(--accent); font: inherit; padding: 0; cursor: pointer; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 4px 0 8px; } h2 { font-size: 17px; margin: 22px 0 8px; }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; color: inherit; text-decoration: none; }
.card.link:hover { border-color: var(--accent); }
.card h2 { margin: 2px 0 6px; }
.narrow { max-width: 420px; margin: 8vh auto; display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
input, textarea { font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); }
.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; justify-content: center; }
.btn.small { padding: 3px 8px; font-size: 13px; } .btn.danger:hover { border-color: var(--bad); color: var(--bad); }
.muted { color: var(--muted); } .small { font-size: 13px; }
.error { color: var(--bad); margin: 0; } .ok { color: var(--ok); margin: 0; }
.login { font-family: Consolas, monospace; font-size: 18px; }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin: 6px 0 4px; }
.bar > div { height: 100%; background: var(--ok); }
.next { background: var(--soft); border-radius: 10px; padding: 12px 14px; margin: 12px 0; color: var(--accent); }
.next a { color: var(--accent); text-decoration: none; font-size: 17px; }
.topics { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.topics li + li { border-top: 1px solid var(--line); }
.topics .row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; color: inherit; text-decoration: none; min-height: 52px; }
.topics a.row:hover { background: var(--soft); }
.topics .n { width: 22px; color: var(--muted); font-size: 13px; text-align: right; }
.topics .name { flex: 1; }
.topics li.zamceno { color: var(--muted); }
.topics .ok { color: var(--ok); font-weight: 600; }
.topics.compact .row { padding: 6px 10px; min-height: 0; }
.pill { font-size: 12px; background: var(--soft); color: var(--accent); padding: 2px 10px; border-radius: 10px; white-space: nowrap; }
.item { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--card); color: inherit; text-decoration: none; }
.item:hover { border-color: var(--accent); } .item .name { flex: 1; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.gallery figure { margin: 0; position: relative; } .gallery img { width: 100%; height: 140px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.gallery button { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.55); color: #fff; border: 0; border-radius: 6px; padding: 2px 7px; cursor: pointer; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tablewrap { overflow-x: auto; } table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; } th { color: var(--muted); font-size: 12px; }
tr.off td { opacity: .55; } td.actions { white-space: nowrap; } form.inline { display: inline-flex; gap: 4px; margin: 0; }
form.inline input { padding: 3px 6px; font-size: 13px; }
details.card summary { cursor: pointer; }
code { font-size: 13px; background: var(--soft); padding: 1px 5px; border-radius: 4px; }
/* lístečky s kódy */
body.print { background: #fff; color: #000; padding: 16px; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.code-card { border: 1px dashed #888; border-radius: 8px; padding: 12px; break-inside: avoid; }
.code-card .name { font-size: 18px; font-weight: 600; margin: 4px 0; }
.code-card .code { font-family: Consolas, monospace; font-size: 20px; font-weight: 700; letter-spacing: 2px; }
@media print { .noprint { display: none; } }
