:root {
  --bg: #efe4cc; --panel: #fbf6ea; --panel2: #f4ecd9; --ink: #33261a; --muted: #6f5a43; --line: #d8c6a1;
  --accent: #8b5a2b; --accent2: #a8742f; --link: #7a3f12; --gold: #b07d12; --ok: #3f6d2a; --warn: #9c3d1c; --mark: #f5d77a;
  --shadow: 0 1px 2px rgba(60, 40, 20, .12), 0 4px 14px rgba(60, 40, 20, .08);
  --radius: 10px; --font: "Georgia", "Iowan Old Style", "Palatino Linotype", serif; --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #17120c; --panel: #221a12; --panel2: #2b2117; --ink: #efe3cc; --muted: #b7a283; --line: #4a3a28; --accent: #d39b55; --accent2: #e0b06a;
    --link: #f0bd78; --gold: #e2b44c; --ok: #9cc77f; --warn: #f0906a; --mark: #6b5317; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3); color-scheme: dark; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--ui); }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent2); }
h1, h2, h3, h4 { font-family: var(--font); line-height: 1.25; margin: 1.3em 0 .5em; }
h1 { font-size: 1.85rem; margin-top: .2em; }
h2 { font-size: 1.35rem; border-bottom: 1px solid var(--line); padding-bottom: .2em; }
h3 { font-size: 1.1rem; }
code { background: var(--panel2); padding: 0 .3em; border-radius: 4px; font-size: .92em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--panel); padding: 6px 10px; z-index: 50; }

.top { position: sticky; top: 0; z-index: 20; background: linear-gradient(180deg, #5b3a1c, #6e4724); color: #f6ead2; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.top-in { max-width: 1180px; margin: 0 auto; display: flex; gap: 12px; align-items: center; padding: 8px 16px; }
.brand { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; flex: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 50%; background: #e6c27a; color: #5b3a1c; display: grid; place-items: center; font: bold 20px var(--font); border: 2px solid #f6ead2; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; font-family: var(--font); }
.brand-text small { font-size: .78rem; opacity: .85; }
.search { position: relative; flex: 1; min-width: 0; }
.search input { width: 100%; font: 16px var(--ui); padding: 9px 12px; border-radius: 8px; border: 1px solid #3d2712; background: #fbf6ea; color: #33261a; }
.search input:focus { outline: 2px solid #e6c27a; }
.menu-btn { display: none; background: none; border: 1px solid rgba(255, 255, 255, .35); color: inherit; border-radius: 6px; font-size: 20px; padding: 2px 10px; }
.nav { max-width: 1180px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 2px 4px; padding: 0 12px 6px; }
.nav a { color: #f6ead2; text-decoration: none; padding: 4px 8px; border-radius: 6px; font-size: .93rem; }
.nav a:hover, .nav a.on { background: rgba(255, 255, 255, .14); }
.sugg { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); max-height: 70vh; overflow: auto; z-index: 30; }
.sugg .grp { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 12px 2px; }
.sugg .opt { display: block; padding: 7px 12px; color: inherit; text-decoration: none; border-left: 3px solid transparent; }
.sugg .opt.act, .sugg .opt:hover { background: var(--panel2); border-left-color: var(--accent); }
.sugg .opt small, .res small { display: block; color: var(--muted); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; }
.answer { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; margin: 8px; padding: 8px 10px; }

main { max-width: 1180px; margin: 0 auto; padding: 14px 16px 40px; outline: none; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; align-items: start; }
.side { position: sticky; top: 110px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; font-size: .92rem; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li { margin: 3px 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); margin: 0 0 16px; }
.card > h2:first-child, .card > h3:first-child { margin-top: .1em; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tile { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: inherit; box-shadow: var(--shadow); }
.tile:hover { border-color: var(--accent); }
.tile b { font-family: var(--font); font-size: 1.05rem; color: var(--link); }
.tile small { display: block; color: var(--muted); margin-top: 2px; }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: .86rem; }
.chip.g { border-color: var(--gold); }
.note { background: var(--panel2); border-left: 4px solid var(--accent); padding: 8px 12px; border-radius: 6px; margin: 12px 0; }
.note.warn { border-left-color: var(--warn); }
.note p { margin: .3em 0; }
.pruefen { color: var(--warn); font-size: .85em; font-style: italic; }
.src { list-style: none; padding: 0; margin: 0; }
.src li { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin: 0 0 6px; background: var(--panel2); }
.src li .tag { display: inline-block; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; background: var(--accent); color: #fff8ec; border-radius: 4px; padding: 0 6px; margin-right: 6px; }
section.hl { animation: hl 2.2s ease-out 1; border-radius: 10px; }
@keyframes hl { 0% { box-shadow: 0 0 0 4px var(--mark); } 100% { box-shadow: 0 0 0 0 transparent; } }
.tbl { overflow-x: auto; margin: 10px 0; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; background: var(--panel); }
th, td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; vertical-align: top; }
th { background: var(--panel2); font-weight: 600; white-space: nowrap; }
table.sortable th { cursor: pointer; user-select: none; }
table.sortable th::after { content: " ⇅"; opacity: .35; font-size: .8em; }
table.sortable th.asc::after { content: " ▲"; opacity: .8; }
table.sortable th.desc::after { content: " ▼"; opacity: .8; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.filters input, .filters select, .calc input, .calc select { font: 15px var(--ui); padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); }
.calc { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; align-items: end; }
.calc label { display: flex; flex-direction: column; font-size: .88rem; color: var(--muted); gap: 3px; }
.calc .out { grid-column: 1 / -1; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: var(--ink); }
.big { font-size: 1.3rem; font-weight: 700; font-family: var(--font); }
.res { display: block; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin: 0 0 6px; text-decoration: none; color: inherit; background: var(--panel); }
.res:hover { border-color: var(--accent); }
.res b { color: var(--link); }
mark { background: var(--mark); color: inherit; border-radius: 2px; }
details.faq { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); margin: 0 0 8px; }
details.faq summary { cursor: pointer; padding: 9px 12px; font-weight: 600; }
details.faq > div { padding: 0 14px 10px; }
.tree { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.node { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--panel2); }
.node.later { opacity: .7; border-style: dashed; }
.node.master { border-color: var(--gold); }
.node h4 { margin: 0 0 4px; }
.muted { color: var(--muted); }
.static ul { padding-left: 1.2em; }
.foot { max-width: 1180px; margin: 0 auto; padding: 14px 16px 28px; color: var(--muted); font-size: .88rem; border-top: 1px solid var(--line); }
.examples a { display: inline-block; margin: 3px 4px 3px 0; padding: 3px 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; font-size: .9rem; }
.stat-row { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.stat-row div b { display: block; font-size: 1.4rem; font-family: var(--font); color: var(--accent); }
.team-link { opacity: .8; }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; }
}
@media (max-width: 640px) {
  .brand-text { display: none; }
  .menu-btn { display: block; }
  .nav { display: none; padding-bottom: 10px; }
  .nav.open { display: flex; }
  h1 { font-size: 1.5rem; }
  .card { padding: 12px; }
  main { padding: 10px 12px 30px; }
}
@media print { .top, .foot, .side { display: none; } body { background: #fff; } .card { box-shadow: none; } }
