:root {
  --bg: #ffffff;
  --surface: #f3f8f4;
  --text: #15261e;
  --muted: #4c5f55;
  --line: #d9e6dd;
  --accent: #0d6b43;
  --accent-strong: #0b4f3c;
  --accent-soft: #e3f2e7;
  --on-accent: #ffffff;
  --note-bg: #fff8e6;
  --note-line: #f0d48a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1713;
    --surface: #16221c;
    --text: #e4eee8;
    --muted: #a5b8ad;
    --line: #2b3b33;
    --accent: #6fcf8f;
    --accent-strong: #0b4f3c;
    --accent-soft: #1b3226;
    --on-accent: #ffffff;
    --note-bg: #2a2516;
    --note-line: #6b5a2a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--bg); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* Hlavička */
.top {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  border-top: 4px solid var(--accent-strong);
}
.top-in { display: flex; align-items: center; gap: 10px 20px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 21px; letter-spacing: .2px; }
.brand img { display: block; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
.nav a, .langs summary {
  color: var(--text); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 15px; line-height: 1.3;
}
.nav a:hover, .langs summary:hover { background: var(--accent-soft); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* Výběr jazyka */
.langs { position: relative; margin-left: auto; }
.langs summary {
  list-style: none; cursor: pointer; border: 1px solid var(--line); display: flex; align-items: center; gap: 6px;
  user-select: none;
}
.langs summary::-webkit-details-marker { display: none; }
.langs summary::after { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: 2px; }
.langs[open] summary { background: var(--accent-soft); }
.langs ul {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; margin: 0; padding: 6px; list-style: none;
  min-width: 180px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
}
.langs li { margin: 0; }
.langs ul a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 15px; }
.langs ul a:hover { background: var(--accent-soft); }
.langs ul a[aria-current="page"] { color: var(--accent); font-weight: 600; }

/* Obsah */
main { padding-top: 28px; padding-bottom: 40px; }
h1 { font-size: 32px; line-height: 1.2; margin: 8px 0 12px; letter-spacing: -.3px; }
h2 { font-size: 22px; line-height: 1.3; margin: 36px 0 10px; padding-top: 4px; }
h3 { font-size: 18px; margin: 22px 0 6px; }
p, ul, ol { margin: 0 0 14px; }
li { margin: 4px 0; }
.lead { font-size: 19px; color: var(--muted); max-width: 46em; }
.muted { color: var(--muted); }
.updated { color: var(--muted); font-size: 14px; margin-top: 40px; border-top: 1px solid var(--line); padding-top: 12px; }

.hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; margin-bottom: 8px; }
.hero img { width: 132px; height: 132px; }
@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; }
  .hero img { display: none; }
  .langs { margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; margin: 0 -10px; }
  h1 { font-size: 27px; }
}

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 16px 0 8px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.card h3 { margin: 0 0 4px; font-size: 17px; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; }

.links { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 18px 0; }
.link-card {
  display: block; text-decoration: none; color: var(--text); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; background: var(--bg);
}
.link-card:hover { border-color: var(--accent); }
.link-card strong { display: block; color: var(--accent); font-size: 18px; margin-bottom: 4px; }
.link-card span { color: var(--muted); font-size: 15.5px; }

.toc { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px; margin: 18px 0 8px; }
.toc ol { margin: 6px 0 4px; padding-left: 22px; columns: 2 260px; column-gap: 28px; }
.toc li { break-inside: avoid; margin: 0 0 6px; }

.note { background: var(--note-bg); border: 1px solid var(--note-line); border-radius: 12px; padding: 12px 16px; margin: 14px 0; }
.note p:last-child { margin-bottom: 0; }

address { font-style: normal; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 0 0 14px; }

.table-wrap { overflow-x: auto; margin: 0 0 16px; }
table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
th, td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { font-weight: 600; color: var(--muted); background: var(--surface); }
@media (max-width: 640px) {
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack thead { display: none; }
  table.stack tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.stack td { border: 0; padding: 2px 0; }
  table.stack td::before { content: attr(data-th); display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
}

/* Patička */
.foot { border-top: 1px solid var(--line); background: var(--surface); padding: 18px 0 24px; font-size: 15px; }
.foot p { margin: 4px 0; }

.notfound { text-align: center; padding-top: 80px; }
.notfound-links { list-style: none; padding: 0; margin: 18px 0 0; }
.notfound-links li { margin: 6px 0; }
