*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--color-paper); color: var(--color-ink); font: var(--text-base)/1.5 var(--font-body); }
h1, h2, p { margin: 0; }
h1 { font-size: var(--text-lg); font-weight: 500; }
:focus-visible { outline: var(--rule-thick) solid var(--color-focus); outline-offset: 2px; }
[hidden] { display: none !important; }

.page { max-width: var(--size-column); margin: 0 auto; padding: var(--space-lg) var(--space-sm); display: grid; gap: var(--space-md); }
.stack { display: grid; gap: var(--space-sm); }
.voice { font-family: var(--font-voice); font-size: var(--text-xl); font-weight: 400; line-height: 1.3; overflow-wrap: anywhere; hyphens: auto; }
.meta { font-size: var(--text-sm); color: var(--color-ink-2); }
.small { font-size: var(--text-xs); color: var(--color-ink-3); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.error { color: var(--color-error); font-size: var(--text-sm); }
.error:empty { display: none; }

label { display: grid; gap: var(--space-3xs); font-size: var(--text-sm); color: var(--color-ink-2); }
input { min-height: var(--size-touch); padding: 0 var(--space-xs); font: inherit; color: var(--color-ink); background: var(--color-paper); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-sm); }
.btn { min-height: var(--size-touch); padding: 0 var(--space-md); font: inherit; font-weight: 500; color: var(--color-on-accent); background: var(--color-accent); border: 0; border-radius: var(--radius-sm); cursor: pointer; }
.btn:hover { background: var(--color-accent-hover); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn.quiet { color: var(--color-ink); background: transparent; border: var(--rule-hair) solid var(--color-rule); }

/* Shell: header, one panel, dock at the bottom on phones, side nav from tablet width */
.shell { min-height: 100dvh; padding-bottom: calc(var(--size-dock) + var(--space-md)); }
.shell-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); padding: var(--space-sm); border-bottom: var(--rule-hair) solid var(--color-rule); }
/* align-content: start, so a short screen does not stretch its rows (and buttons) to fill the grid cell (review S14). */
.shell-panel { max-width: var(--size-column); margin: 0 auto; padding: var(--space-md) var(--space-sm); display: grid; gap: var(--space-sm); align-content: start; }
.dock { position: fixed; inset: auto 0 0 0; height: var(--size-dock); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--color-paper); border-top: var(--rule-hair) solid var(--color-rule); }
.dock button { min-height: var(--size-touch); font: inherit; font-size: var(--text-sm); color: var(--color-ink-2); background: none; border: 0; cursor: pointer; }
.dock button[aria-current="page"] { color: var(--color-ink); font-weight: 500; text-decoration: underline var(--rule-thick); text-underline-offset: 6px; }
@media (min-width: 768px) {
  .shell { display: grid; grid-template-columns: 200px 1fr; grid-template-rows: auto 1fr; padding-bottom: 0; }
  .shell-head { grid-column: 1 / -1; }
  .dock { position: static; height: auto; grid-auto-flow: row; grid-auto-rows: var(--size-touch); align-content: start; padding: var(--space-sm) 0; border-top: 0; border-right: var(--rule-hair) solid var(--color-rule); }
  .dock button { text-align: left; padding: 0 var(--space-sm); }
}

/* A browser-started print of any tab (Cmd/Ctrl+P, menu, iPad Drucken): the page itself on plain paper, near-black on
   white in light and dark mode, without the dock, header buttons or fixed bars. The Mengen sheets: mengen.css. */
@media print {
  :root {
    --color-paper: oklch(99.5% 0.002 260); --color-paper-2: oklch(99.5% 0.002 260); --color-card: oklch(99.5% 0.002 260);
    --color-ink: oklch(12% 0.004 260); --color-ink-2: oklch(20% 0.004 260); --color-ink-3: oklch(30% 0.004 260);
    --color-rule: oklch(55% 0.004 260); --color-link: oklch(12% 0.004 260); --color-accent: oklch(12% 0.004 260);
    --color-on-accent: oklch(99.5% 0.002 260); --shadow-card: none;
  }
  .dock, .shell-head button, button.btn, .nav-btn { display: none; }
  .shell { display: block; min-height: 0; padding: 0; }
  .shell-panel, .shell-panel.wide { max-width: none; padding: 0; }
  .mcard, .prow, .plan-slot { break-inside: avoid; }
}
