/* Benchplate Trainer. Farben und Schriften wie in der App (DESIGN.md, Theme.swift):
   Schwarz/Weiß, Gelb nur als Fläche, Zahlen in SF Pro Rounded. Das Motiv ist der
   Ring aus dem App-Icon — jeder Tag eines Klienten ist einer. */

:root {
  --paper: #F7F6F2;
  --surface: #FFFFFF;
  --raised: #EFEEE8;
  --track: #E4E2DA;
  --line: rgba(17, 17, 16, 0.1);
  --ink: #111110;
  --ink-2: #62615C;
  --ink-3: #6E6D66;
  --yellow: #FFDE00;
  --yellow-soft: #FFF5BF;
  --protein: #E15A5A;
  --carbs: #3E8EDE;
  --fat: #E0A020;
  --ok: #2F9E6F;
  --warn: #E8622C;
  --warn-ink: #A9431A;
  --warn-soft: rgba(232, 98, 44, 0.11);
  --focus: #3E8EDE;
  --field-edge: #8F8E86;
  --on-yellow: #111110;
  --shade: rgba(17, 17, 16, 0.08);
  --scrim: rgba(17, 17, 16, 0.45);
  --lift: rgba(17, 17, 16, 0.2);
  --print-paper: #FDFDFB;
  /* Helle Werte, die auch im dunklen Design gelten: der Bericht ist Papier. */
  --l-paper: #F7F6F2; --l-surface: #FFFFFF; --l-raised: #EFEEE8; --l-track: #E4E2DA; --l-line: rgba(17, 17, 16, 0.12);
  --l-ink: #111110; --l-ink-2: #555550; --l-ink-3: #6E6D66; --l-protein: #E15A5A; --l-carbs: #3E8EDE; --l-fat: #E0A020;
  --l-ok: #2F9E6F; --l-warn: #E8622C; --l-warn-ink: #A9431A; --l-yellow-soft: #FFF5BF;
  --print-ink: #111110;
  --print-line: #D8D7D0;
  --good: #2F9E6F;

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --radius-card: 20px;
  --radius-button: 14px;
  --radius-control: 12px;
  --gutter: 24px;
  --page: 1240px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111110;
    --surface: #1C1C1A;
    --raised: #2A2A27;
    --track: #34342F;
    --line: rgba(244, 243, 239, 0.1);
    --ink: #F4F3EF;
    --ink-2: #A9A8A1;
    --ink-3: #94978E;
    --yellow-soft: #3B3510;
    --protein: #F07A78;
    --carbs: #5BA4F0;
    --fat: #EFB246;
    --ok: #4CC495;
    --warn: #FF7A4D;
    --warn-ink: #FF9466;
    --warn-soft: rgba(255, 122, 77, 0.14);
    --focus: #5BA4F0;
    --field-edge: #6E6D66;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #111110;
  --surface: #1C1C1A;
  --raised: #2A2A27;
  --track: #34342F;
  --line: rgba(244, 243, 239, 0.1);
  --ink: #F4F3EF;
  --ink-2: #A9A8A1;
  --ink-3: #94978E;
  --yellow-soft: #3B3510;
  --protein: #F07A78;
  --carbs: #5BA4F0;
  --fat: #EFB246;
  --ok: #4CC495;
  --warn: #FF7A4D;
  --warn-ink: #FF9466;
  --warn-soft: rgba(255, 122, 77, 0.14);
  --focus: #5BA4F0;
  --field-edge: #6E6D66;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; overflow-x: clip; }

body {
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: 30px; line-height: 1.15; font-family: var(--round); letter-spacing: -0.02em; }
h2 { font-size: 17px; line-height: 1.3; }
h3 { font-size: 15px; }
h4 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip { position: absolute; left: 8px; top: 8px; transform: translateY(-200%); background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { transform: none; }

.boot { padding: 40px var(--gutter); color: var(--ink-2); }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.fine { font-size: 13px; color: var(--ink-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.lede { font-size: 17px; color: var(--ink-2); max-width: 62ch; }

/* ---------- Knöpfe ---------- */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--radius-button);
  font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background-color 120ms ease, transform 120ms ease;
}
.button:active { transform: scale(0.98); }
.button:disabled, .button:disabled:hover { background: var(--raised); color: var(--ink-3); border-color: transparent; cursor: not-allowed; transform: none; }
.button.primary { background: var(--ink); color: var(--paper); }
.button.primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--paper)); }
.button.accent { background: var(--yellow); color: var(--on-yellow); }
.button.accent:hover { background: color-mix(in srgb, var(--yellow) 88%, var(--on-yellow)); }
.button.secondary { background: var(--raised); }
.button.secondary:hover { background: var(--track); }
.button.ghost { background: transparent; border-color: var(--line); }
.button.ghost:hover { background: var(--raised); }
.button.danger { background: var(--warn-soft); color: var(--warn-ink); }
.button.ghost.danger { background: transparent; color: var(--warn-ink); }
.button.wide { width: 100%; }

.link { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--track); }
.link:hover { text-decoration-color: currentColor; }
.link.danger { color: var(--warn-ink); }

.icon-button {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 20px; line-height: 1; cursor: pointer;
}
.icon-button:disabled { background: transparent; color: var(--track); border-color: var(--line); cursor: not-allowed; }

/* ---------- Formulare ---------- */

input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--field-edge); border-radius: var(--radius-control);
}
textarea { resize: vertical; min-height: 72px; line-height: 1.45; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
/* Zahlenfelder ohne Pfeile: in Safari lagen sie über der Einheit („kcal“, „g“). */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.field { display: grid; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; }
.field-hint { font-size: 13px; color: var(--ink-2); }
.field-compact .field-label { font-weight: 500; color: var(--ink-2); }
.with-unit { position: relative; display: block; }
.with-unit input { padding-right: 44px; font-family: var(--round); font-variant-numeric: tabular-nums; }
.with-unit .unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-2); font-size: 13px; pointer-events: none; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.form-error { color: var(--warn-ink); font-weight: 500; }

/* ---------- Kopfzeile ---------- */

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px max(var(--gutter), calc((100vw - var(--page)) / 2));
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; text-decoration: none; }
.brand-sub { color: var(--ink-2); font-weight: 500; }
.topnav { display: flex; align-items: center; gap: 22px; font-size: 15px; }
.topnav a, .topnav .link { text-decoration: none; color: var(--ink-2); font-weight: 500; }
.topnav a:hover, .topnav .link:hover { color: var(--ink); }
.topnav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -3px 0 var(--yellow); padding-bottom: 2px; }

.page { max-width: var(--page); margin: 0 auto; padding: 32px var(--gutter) 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head .lede { margin-top: 6px; }

/* ---------- Ringe ---------- */

.ring { display: block; flex: none; overflow: visible; }
.ring-track { fill: none; stroke: var(--track); stroke-width: 5; }
.ring-arc { fill: none; stroke-width: 5; stroke-linecap: round; }
.ring-goal .ring-arc { stroke: var(--ink); }
.ring-pixel { fill: var(--yellow); }
.ring-over .ring-arc { stroke: var(--warn); }
.ring-under .ring-arc { stroke: var(--ink-3); opacity: 0.55; }
.ring-today .ring-arc { stroke: var(--ink-2); stroke-dasharray: 3 4; stroke-linecap: butt; }
.ring-empty .ring-track { stroke-dasharray: 2 4; }
.ring-today-empty .ring-track { stroke: var(--ink-3); stroke-dasharray: 2 4; opacity: 0.6; }
.ring-strip { display: flex; gap: 4px; }

/* ---------- Übersicht ---------- */

.attention { margin-bottom: 32px; }
.attention h2 { margin-bottom: 12px; }
.attention ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.attention-row {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; text-decoration: none;
}
.attention-row:hover { border-color: var(--ink-3); }
.attention-row .avatar { grid-row: span 2; }
.attention-name { font-weight: 600; }
.attention-row .flag { justify-self: start; }
.attention-calm p { padding: 14px 16px; border-radius: 16px; background: var(--yellow-soft); max-width: 70ch; }

.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--raised); font-weight: 700; font-size: 13px; letter-spacing: 0.02em;
}
.avatar-large { width: 56px; height: 56px; font-size: 19px; background: var(--yellow); color: var(--on-yellow); }

.flag { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; }
.flag::before { content: ""; width: 7px; height: 7px; border-radius: 2px; flex: none; }
.flag-alert { color: var(--warn-ink); }
.flag-alert::before { background: var(--warn); }
.flag-watch { color: var(--ink-2); }
.flag-watch::before { background: var(--ink-3); border-radius: 50%; }
.flag-info { color: var(--ink); }
.flag-info::before { background: var(--yellow); outline: 1px solid var(--field-edge); }

.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input[type="search"] { max-width: 260px; }
.toolbar select { width: auto; }

.segmented { display: inline-flex; padding: 3px; background: var(--raised); border-radius: 12px; gap: 2px; flex-wrap: wrap; }
.segmented button {
  min-height: 36px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent;
  font-weight: 500; color: var(--ink-2); cursor: pointer;
}
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px var(--shade); }

.client-table { width: 100%; border-collapse: collapse; }
.client-table th {
  text-align: left; font-size: 13px; font-weight: 500; color: var(--ink-2);
  padding: 8px 12px; border-bottom: 1px solid var(--line);
}
.client-table th.num { text-align: right; }
.client-table td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.client-table tbody tr { cursor: pointer; }
.client-table tbody tr:hover { background: var(--surface); }
.cell-client { min-width: 200px; }
.cell-client-inner { display: flex; align-items: center; gap: 12px; }
.client-name-block { display: grid; gap: 1px; }
.client-name { font-weight: 600; text-decoration: none; }
.cell-week { min-width: 200px; }
.cell-week .small { display: block; margin-top: 5px; }
.client-table td.num .value { display: block; font-family: var(--round); font-weight: 600; font-size: 16px; }
.share { display: block; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.share.off { color: var(--warn-ink); font-weight: 600; }
.cell-flag { min-width: 170px; }
.empty-line { padding: 24px 0; color: var(--ink-2); }

.empty {
  max-width: 560px; margin: 40px auto; text-align: center;
  display: grid; justify-items: center; gap: 14px;
}
.empty p { color: var(--ink-2); }
.empty-code {
  font-family: var(--round); font-size: 34px; font-weight: 700; letter-spacing: 0.04em;
  padding: 10px 22px; border-radius: 16px; background: var(--yellow); color: var(--on-yellow) !important;
}

/* ---------- Klient ---------- */

.back { display: inline-block; margin-bottom: 18px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.back::before { content: "‹ "; }
.back:hover { color: var(--ink); }
.client-head { margin-bottom: 24px; }
.client-head-main { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.client-head-main > div:nth-child(2) { flex: 1; min-width: 240px; display: grid; gap: 4px; }
.client-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.client-head-actions .button { min-height: 38px; padding: 0 14px; font-size: 14px; }
.goal-line { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.goal-line span { padding: 5px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-variant-numeric: tabular-nums; }
.goal-line span:first-child { background: var(--ink); color: var(--paper); border-color: var(--ink); font-weight: 600; }
.person-line { margin-top: 10px; font-size: 14px; }
.notice { margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: var(--raised); font-size: 14px; }
.rename { display: flex; gap: 8px; max-width: 420px; }

.client-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
.period-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.range-nav { display: flex; align-items: center; gap: 10px; }
.range-title { min-width: 150px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 12px; border: 0; background: none; cursor: pointer;
  font-weight: 500; color: var(--ink-2); white-space: nowrap;
}
.tab[aria-current="page"] { color: var(--ink); }
.tab[aria-current="page"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--yellow); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }

.tab-body { display: grid; gap: 20px; }
.loading { color: var(--ink-2); padding: 24px 0; }

.panel { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 22px 24px; box-shadow: 0 1px 2px var(--shade); }
.panel > h2 { margin-bottom: 14px; }
.panel-head { margin-bottom: 16px; }
.panel-head h2 { margin: 0; }
.panel-explain { margin-top: 3px; font-size: 13px; color: var(--ink-2); max-width: 70ch; }

.panel-hero { display: grid; grid-template-columns: minmax(200px, 0.8fr) minmax(0, 1.4fr); gap: 20px 28px; align-items: center; }
.hero-summary { display: grid; gap: 6px; }
.hero-number { font-family: var(--round); font-size: 56px; line-height: 1; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.hero-number span { display: block; font-size: 17px; font-weight: 600; letter-spacing: 0; margin-top: 8px; }
.legend { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ink); }

.ring-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px 4px; justify-items: center; }
.ring-calendar-head { font-size: 12px; color: var(--ink-2); }
.ring-cell { position: relative; display: grid; justify-items: center; gap: 2px; padding-bottom: 6px; }
.ring-cell-date { font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ring-cell-training::after { content: ""; position: absolute; bottom: 0; width: 4px; height: 4px; border-radius: 50%; background: var(--ink); }
.ring-calendar-big .ring-cell-training::after { bottom: -2px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; box-shadow: 0 1px 2px var(--shade); }
.stat { display: grid; gap: 2px; align-content: start; padding: 16px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat:nth-child(4n) { border-right: 0; }
.stat:nth-last-child(-n+4):nth-child(4n+1), .stat:nth-last-child(-n+4):nth-child(4n+1) ~ .stat { border-bottom: 0; }
.stat-label { font-size: 13px; color: var(--ink-2); }
.stat-value { font-family: var(--round); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.stat-detail { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.stat-off .stat-detail { color: var(--warn-ink); font-weight: 600; }
.stats-inline { margin-bottom: 16px; box-shadow: none; }

.observations { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.observations li { position: relative; padding-left: 20px; max-width: 72ch; }
.observations li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 8px; height: 8px; border-radius: 2px; background: var(--ink-3); }
.observations .obs-warn::before { background: var(--warn); }

.chart { width: 100%; }
.chart svg.bars { width: 100%; height: var(--chart-h); display: block; }
.bar rect { fill: var(--ink-3); opacity: 0.45; }
.bar-goal rect { fill: var(--ink); opacity: 1; }
.bar-over rect { fill: var(--warn); opacity: 1; }
.bar-under rect { fill: var(--ink-3); opacity: 0.45; }
.bar-protein rect { fill: var(--protein); opacity: 1; }
.bar-protein-low rect { fill: var(--protein); opacity: 0.4; }
.bar .bar-placeholder { fill: var(--track); opacity: 1; }
.goal-tick { stroke: var(--ink); stroke-width: 2; }
.bar-goal .goal-tick { stroke: var(--yellow); stroke-width: 3; }
.axis-row { display: grid; margin-top: 6px; font-size: 11px; color: var(--ink-2); text-align: center; white-space: nowrap; }
.axis-row span { position: relative; padding-top: 7px; min-width: 0; overflow: visible; }
.axis-row .axis-today { color: var(--ink); font-weight: 700; }
.axis-marker { position: absolute; top: 0; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--ink); }
.axis { font-size: 10px; fill: var(--ink-2); text-anchor: middle; font-family: var(--sans); }
.axis-today { fill: var(--ink); font-weight: 700; }
.chart-note { font-size: 13px; margin-top: 8px; }

.chart-weight svg { width: 100%; height: auto; display: block; }
.grid { stroke: var(--line); }
.axis-y { text-anchor: end; }
.axis-start { text-anchor: start; }
.axis-end { text-anchor: end; }
.trend-line { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.plan-line { fill: none; stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 5 5; }
.weight-dot { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }

/* Tage */
.day-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; }
.day-table th { font-size: 13px; font-weight: 500; color: var(--ink-2); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.day-table th.num { text-align: right; }
.day-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.day-row { cursor: pointer; }
.day-row:hover { background: var(--raised); }
.day-row[aria-expanded="true"] { background: var(--raised); }
.day-row-empty td { color: var(--ink-2); }
.day-detail td { background: var(--paper); padding: 16px 18px 20px; }
.tag { margin-left: 8px; padding: 1px 7px; border-radius: 6px; background: var(--yellow); color: var(--on-yellow); font-size: 12px; font-weight: 600; }

.entries { display: grid; gap: 16px; }
.entry-group h4 { margin-bottom: 6px; }
.entry-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.entry-table td { padding: 5px 8px 5px 0; border-bottom: 1px solid var(--line); }
.entry-time { width: 52px; font-variant-numeric: tabular-nums; }
/* Makrofarben nur als Fläche: Fett-Gelb und Carbs-Blau sind als Schrift zu schwach. */
.macro-p::before, .macro-c::before, .macro-f::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 6px; vertical-align: 1px;
}
.macro-p::before { background: var(--protein); }
.macro-c::before { background: var(--carbs); }
.macro-f::before { background: var(--fat); }
.entry-table .macro-p, .entry-table .macro-c, .entry-table .macro-f { color: var(--ink-2); }
.entry-table .num { white-space: nowrap; }
.entry-table .macro-p, .entry-table .macro-c, .entry-table .macro-f { font-size: 13px; width: 64px; }
.day-extras { margin-top: 14px; display: grid; gap: 8px; font-size: 14px; }
.essentials { display: flex; flex-wrap: wrap; gap: 6px; }
.essential { padding: 3px 9px; border-radius: 999px; background: var(--raised); color: var(--ink-2); }
.essential.done { background: var(--ink); color: var(--paper); }

/* Nährstoffe */
.split-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; }
.split-p { background: var(--protein); }
.split-c { background: var(--carbs); }
.split-f { background: var(--fat); }
.split-legend { display: flex; gap: 18px; margin: 10px 0; font-weight: 600; font-size: 14px; }
.nutrient-table, .food-table, .measure-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.nutrient-table { table-layout: fixed; }
.nutrient-table th { width: 34%; }
.nutrient-table td:nth-child(2), .nutrient-table td:nth-child(3) { width: 15%; }
.nutrient-table td:last-child { width: 9%; }
.nutrient-table th, .nutrient-table td, .food-table td, .food-table th, .measure-table td, .measure-table th { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); text-align: left; }
.nutrient-table th { font-weight: 500; }
.nutrient-table td.num, .food-table .num, .measure-table .num { text-align: right; }
.food-table thead th, .measure-table thead th { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.meter-cell { width: 27%; padding-left: 12px !important; }
.meter { display: block; height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.meter-fill { display: block; height: 100%; border-radius: 4px; background: var(--ink); }
.meter-near .meter-fill { background: var(--ink-3); }
.meter-low .meter-fill { background: var(--warn); }
.meter-over .meter-fill { background: var(--warn); }
.meter-ok .meter-fill { background: var(--ok); }
.meter-none { background: transparent; }

/* Check-ins */
.checkin { display: grid; gap: 14px; }
.checkin-new { border-color: var(--ink); box-shadow: inset 4px 0 0 var(--yellow); }
.checkin-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.checkin-summary { display: flex; flex-wrap: wrap; gap: 6px; }
.checkin-summary span { padding: 4px 10px; border-radius: 999px; background: var(--raised); font-size: 13px; font-variant-numeric: tabular-nums; }
.scales { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 24px; margin: 0; }
.scale-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.scale-row dt { font-size: 14px; }
.scale-row dd { margin: 0; }
.scale { display: inline-flex; gap: 4px; }
.scale span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--track); }
.scale span.on { background: var(--ink); border-color: var(--ink); }
.scale-low .scale span.on { background: var(--warn); border-color: var(--warn); }
.quote h3 { font-size: 13px; color: var(--ink-2); font-weight: 600; margin-bottom: 3px; }
.quote p { white-space: pre-wrap; max-width: 70ch; }
.quote-question { padding: 12px 14px; border-radius: 14px; background: var(--yellow-soft); }
.quote-question h3 { color: inherit; }
.feedback-form { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }

/* Rechte Spalte */
.client-aside { display: grid; gap: 28px; align-content: start; }
.aside-panel { display: grid; gap: 12px; padding-top: 16px; border-top: 2px solid var(--ink); }
.note-form, .proposal-form { display: grid; gap: 10px; }
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.notes li { padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.notes li.note-shared { border-color: var(--ink); }
.note-body { white-space: pre-wrap; font-size: 14px; }
.note-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 6px; font-size: 12px; color: var(--ink-2); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.macro-check { color: var(--ink-2); }
.macro-check.off { color: var(--warn-ink); }
.proposals { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.proposals li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.status { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--raised); }
.status-pending { background: var(--yellow); color: var(--on-yellow); }
.status-accepted { background: var(--ink); color: var(--paper); }
.status-declined { color: var(--warn-ink); }

/* ---------- Anmeldung ---------- */

.auth {
  min-height: 100vh; max-width: 1080px; margin: 0 auto; padding: 48px var(--gutter);
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 64px; align-items: center;
}
.auth-pitch { display: grid; gap: 18px; }
.auth-pitch h1 { font-size: 44px; line-height: 1.05; max-width: 14ch; letter-spacing: -0.01em; }
.auth-points { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 14px; max-width: 54ch; }
.auth-points li { position: relative; padding-left: 26px; color: var(--ink-2); }
.auth-points li::before { content: ""; position: absolute; left: 0; top: 0.32em; width: 13px; height: 13px; border-radius: 50%; border: 3px solid var(--ink); border-left-color: transparent; transform: rotate(-45deg); }
.auth-points strong { color: var(--ink); display: block; }
.auth-form { display: grid; gap: 16px; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; }
.auth-form h2 { font-size: 22px; font-family: var(--round); }
.auth-switch { color: var(--ink-2); }

/* ---------- Konto ---------- */

.settings { display: grid; gap: 20px; max-width: 560px; }
.settings-form { display: grid; gap: 14px; }

/* ---------- Dialoge, Meldungen ---------- */

.dialog {
  width: calc(100% - 32px); max-width: 480px; max-height: calc(100% - 48px);
  padding: 0; border: 1px solid var(--line); border-radius: 24px;
  background: var(--surface); color: var(--ink);
}
.dialog-wide { max-width: 640px; }
.dialog::backdrop { background: var(--scrim); }
.dialog-body { display: grid; gap: 18px; padding: 24px; }
.dialog-body section { display: grid; gap: 10px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.dialog-head h2 { font-size: 22px; font-family: var(--round); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.invite-code { display: grid; gap: 12px; padding: 16px; border-radius: 18px; background: var(--paper); }
.invite-code-value { font-family: var(--round); font-size: 32px; font-weight: 700; letter-spacing: 0.05em; }
.invite-code-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.invite-create { display: flex; gap: 8px; }
.invite-create input { flex: 1; }
.invite-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.invite-list li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.invite-list-name { font-weight: 600; }
.invite-list-code { font-family: var(--round); font-weight: 600; letter-spacing: 0.04em; }

#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: max-content; max-width: calc(100vw - 32px); }
.toast { padding: 12px 18px; border-radius: 14px; background: var(--ink); color: var(--paper); font-weight: 500; box-shadow: 0 8px 24px var(--lift); animation: toast-in 180ms ease-out; }
.toast-warn { background: var(--warn-ink); color: var(--paper); }
.toast.leaving { opacity: 0; transition: opacity 300ms ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Einladungsseite (/c/CODE) ---------- */

.invite-page { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.invite { max-width: 520px; display: grid; gap: 18px; }
.invite .brand { margin-bottom: 12px; }
.invite h1 { font-size: 34px; }
.eyebrow { font-weight: 600; color: var(--ink-2); }
.steps { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 16px; }
.steps li { display: grid; grid-template-columns: 32px 1fr; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.steps li > span { width: 32px; height: 32px; border-radius: 50%; background: var(--yellow); display: grid; place-items: center; font-weight: 700; font-family: var(--round); color: var(--on-yellow); }
.steps li div { display: grid; gap: 6px; justify-items: start; }
.steps p { color: var(--ink-2); }
.steps .code { font-family: var(--round); font-size: 26px; font-weight: 700; letter-spacing: 0.05em; color: var(--ink); }

/* ---------- Ergänzungen 29.10.2026 (Optimierungsrunde) ---------- */

.theme-toggle {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  display: inline-grid; place-items: center; cursor: pointer; padding: 0;
}
.theme-toggle::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink);
  background: linear-gradient(90deg, var(--ink) 50%, transparent 50%);
}
.theme-toggle:hover { background: var(--raised); }

.menu-wrap { position: relative; display: inline-block; }
.menu-trigger::after { content: ""; width: 7px; height: 7px; margin-left: 2px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.menu {
  position: absolute; top: calc(100% + 6px); z-index: 30; width: 320px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 32px var(--lift);
}
.menu-end { right: 0; }
.menu-start { left: 0; }
.menu-item { display: grid; gap: 2px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none; text-align: left; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--raised); outline: none; }
.menu-item-label { font-weight: 600; }
.menu-item-description { font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.menu-item.danger .menu-item-label { color: var(--warn-ink); }

.group-chip { display: inline-block; margin-left: 10px; padding: 3px 10px; border-radius: 999px; background: var(--raised); color: var(--ink-2); font: 600 13px/1.3 var(--sans); letter-spacing: 0; vertical-align: middle; }
.group-chip-small { margin-left: 6px; padding: 1px 7px; font-size: 11px; }
.muted-chip { background: transparent; border: 1px solid var(--line); }
.client-head-title { flex: 1; min-width: 240px; display: grid; gap: 4px; }

.summary {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 28px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: 0 1px 2px var(--shade); overflow: hidden;
}
.summary-item { display: grid; gap: 2px; padding: 18px 22px; border-right: 1px solid var(--line); }
.summary-item:last-child { border-right: 0; }
.summary-value { font: 700 26px/1.1 var(--round); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.summary-label { font-size: 13px; color: var(--ink-2); }
.summary-highlight { box-shadow: inset 0 -4px 0 var(--yellow); }

.toolbar-spacer { flex: 1; }
.checkin-state { font-size: 13px; font-weight: 600; white-space: nowrap; }
.checkin-none { color: var(--ink-3); font-weight: 400; }
.checkin-new { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--yellow); color: var(--on-yellow); }
.checkin-open { color: var(--warn-ink); }
.checkin-done { color: var(--ink-2); font-weight: 500; }
.cell-checkin { white-space: nowrap; }

.grid-wrap { overflow-x: auto; }
.client-grid .grid-week { text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums; }
.client-grid td.grid-week { padding-right: 18px; }
.ring-strip-tight { gap: 2px; }
.ring-placeholder { width: 16px; height: 16px; flex: none; }

.stat-delta { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat-delta.good { color: var(--good); font-weight: 600; }
.stat-delta.bad { color: var(--warn-ink); font-weight: 600; }

.panel-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

.stack-p { fill: var(--protein); }
.stack-c { fill: var(--carbs); }
.stack-f { fill: var(--fat); }

.slot-list { display: grid; gap: 10px; }
.slot-row { display: grid; grid-template-columns: 110px 1fr 48px; align-items: center; gap: 10px; font-size: 14px; }
.slot-bar { height: 10px; border-radius: 5px; background: var(--track); overflow: hidden; }
.slot-bar span { display: block; height: 100%; border-radius: 5px; background: var(--ink); }

.hours { display: grid; grid-template-columns: repeat(20, 1fr); align-items: end; gap: 3px; height: 130px; }
.hour { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: 4px; }
.hour-bar { align-self: end; display: block; min-height: 2px; border-radius: 3px 3px 0 0; background: var(--ink); }
.hour-label { font-size: 10px; color: var(--ink-2); text-align: center; height: 12px; }

.habit-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.habit-table th { text-align: left; font-weight: 500; padding: 7px 12px 7px 0; white-space: nowrap; }
.habit-table td { padding: 7px 0 7px 10px; border-bottom: 1px solid var(--line); }
.habit-table th { border-bottom: 1px solid var(--line); }
/* Flex nur im Inneren der Zelle: eine Tabellenzelle mit display:flex fällt aus der Zeile (Fehler vom 29.10.). */
.habit-cells { display: inline-flex; gap: 3px; flex-wrap: nowrap; vertical-align: middle; }
.habit-table td, .habit-table th { vertical-align: middle; }
.habit-table td.num { white-space: nowrap; text-align: right; padding-left: 14px; }
.sheet .habit { width: 8px; height: 8px; border-radius: 2px; }
.sheet .habit-cells { gap: 2px; }
.habit { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.habit-done { background: var(--ink); }
.habit-open { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.habit-none { background: var(--track); opacity: 0.5; }

.trend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 28px; }
.trend-row { display: grid; grid-template-columns: 120px 1fr 36px; align-items: center; gap: 10px; }
.trend-label { font-size: 14px; }
.trend { width: 100%; height: 36px; }
.trend-path { fill: none; stroke: var(--ink-3); stroke-width: 1.5; }
.trend-dot { fill: var(--ink); }
.trend-dot.bad { fill: var(--warn); }
.trend-value { font: 600 13px var(--round); text-align: right; font-variant-numeric: tabular-nums; }

.aside-attention { border-top-color: var(--yellow); }
.aside-quote { padding: 10px 12px; border-radius: 12px; background: var(--yellow-soft); font-size: 14px; white-space: pre-wrap; }

/* PDF-Bericht */
.page-report { max-width: none; }
.report-toolbar { max-width: 210mm; margin: 0 auto 20px; display: grid; gap: 12px; }
.report-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.report-hint { max-width: 70ch; }
.sheets { display: grid; gap: 24px; justify-content: center; }
.sheet {
  --paper: var(--l-paper); --surface: var(--l-surface); --raised: var(--l-raised); --track: var(--l-track); --line: var(--l-line);
  --ink: var(--l-ink); --ink-2: var(--l-ink-2); --ink-3: var(--l-ink-3); --protein: var(--l-protein); --carbs: var(--l-carbs); --fat: var(--l-fat);
  --ok: var(--l-ok); --warn: var(--l-warn); --warn-ink: var(--l-warn-ink); --yellow-soft: var(--l-yellow-soft); --shade: transparent;
  color-scheme: light;
  width: 210mm; min-height: 297mm; padding: 14mm 14mm 10mm; background: var(--surface); color: var(--ink);
  box-shadow: 0 4px 24px var(--lift); border-radius: 4px; display: flex; flex-direction: column; font-size: 12.5px;
}
.sheet-body { flex: 1; display: block; }
.sheet-body > * + * { margin-top: 14px; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 2px solid var(--ink); }
.sheet-brand { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14px; }
.sheet-title { text-align: right; }
.sheet-kicker { font-size: 11px; color: var(--ink-2); font-weight: 600; }
.sheet-name { font: 700 20px/1.2 var(--round); }
.sheet-range { font-size: 12px; color: var(--ink-2); }
.sheet-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 10px; color: var(--ink-2); }
.sheet-block { break-inside: avoid; }
.sheet-block h2 { font-size: 13px; margin-bottom: 8px; }
.sheet-hero { display: grid; grid-template-columns: 170px 1fr; gap: 16px; align-items: center; }
.sheet .hero-number { font-size: 40px; font-variant-numeric: tabular-nums; }
.sheet .hero-number span { font-size: 14px; }
.sheet .goal-line { margin-top: 0; }
.sheet .goal-line span { font-size: 12px; padding: 3px 9px; }
.sheet .stats { box-shadow: none; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.sheet .stat { border-right: 1px solid var(--line) !important; }
.sheet .stat:nth-child(4n) { border-right: 0 !important; }
.sheet .ring-calendar { gap: 3px 2px; }
.sheet .ring-cell { padding-bottom: 3px; }
.sheet .stat { padding: 9px 12px; }
.sheet .stat-value { font-size: 16px; }
.sheet .stat-label, .sheet .stat-detail { font-size: 11px; }
.sheet .stat-delta { font-size: 10.5px; }
.sheet .panel { padding: 0; border: 0; box-shadow: none; background: none; }
.sheet .panel-head { margin-bottom: 6px; }
.sheet .panel-head h2 { font-size: 13px; }
.sheet .nutrient-table { font-size: 11.5px; }
.sheet .nutrient-table th, .sheet .nutrient-table td { padding: 4px 8px 4px 0; }
.sheet-nutrients > * + * { margin-top: 12px; }
.sheet-nutrients .panel { break-inside: avoid; }
.sheet .habit-table { font-size: 12px; }
.sheet .observations { gap: 6px; }
.sheet .legend { font-size: 11px; }
.sheet .chart-note { font-size: 11px; margin-top: 4px; }
.sheet .scales { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sheet .scale span { width: 11px; height: 11px; }
.sheet .quote { margin-top: 8px; }
.sheet-table { width: 100%; border-collapse: collapse; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.sheet-table th { text-align: left; font-weight: 600; color: var(--ink-2); padding: 5px 6px; border-bottom: 1.5px solid var(--ink); }
.sheet-table th.num, .sheet-table td.num { text-align: right; }
.sheet-table td { padding: 5px 6px; border-bottom: 1px solid var(--line); }
.sheet-table tr { break-inside: avoid; }
.sheet-table .row-goal .status-cell { font-weight: 600; }
.sheet-table .row-goal td:first-child { box-shadow: inset 3px 0 0 var(--yellow); }
.sheet-table .row-missed .status-cell { color: var(--warn-ink); }
.sheet-table .row-empty td { color: var(--ink-3); }

/* ---------- Breiten ---------- */

@media (max-width: 1100px) {
  .client-layout { grid-template-columns: minmax(0, 1fr); }
  .client-aside { position: static; }
}

@media (max-width: 860px) {
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-grid { min-width: 760px; }
  .client-grid .client-name-block .muted { display: none; }
  .summary-item:nth-child(2) { border-right: 0; }
  .summary-item:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .panel-pair { grid-template-columns: 1fr; }
  .stat:nth-child(2n) { border-right: 0; }
  .toolbar-spacer { display: none; }
  .menu { width: 280px; }
  .auth { grid-template-columns: 1fr; gap: 32px; padding-top: 32px; }
  .auth-pitch h1 { font-size: 34px; }
  .panel-hero { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .client-table:not(.client-grid) thead { display: none; }
  .client-table:not(.client-grid), .client-table:not(.client-grid) tbody { display: block; }
  .client-table:not(.client-grid) tr {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px;
    padding: 14px 0; border-bottom: 1px solid var(--line);
  }
  .client-table:not(.client-grid) td { padding: 0; border: 0; }
  .client-table:not(.client-grid) .cell-client, .client-table:not(.client-grid) .cell-week, .client-table:not(.client-grid) .cell-flag { grid-column: 1 / -1; min-width: 0; }
  .client-table:not(.client-grid) td.num { text-align: left; }
  .client-table:not(.client-grid) td.num::before { content: attr(data-label); display: block; font-size: 12px; color: var(--ink-2); }
  .client-table:not(.client-grid) td.cell-checkin::before { content: "Check-in: "; font-size: 13px; color: var(--ink-2); }
  .client-table:not(.client-grid) td[data-label="Schritte Ø"] { display: none; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  h1 { font-size: 26px; }
  .page { padding-top: 20px; }
  .topnav { gap: 14px; font-size: 14px; }
  .brand-sub { display: none; }
  .toolbar input[type="search"] { max-width: none; }
  .day-table th:nth-child(n+6), .day-table td:nth-child(n+6) { display: none; }
  .day-detail td { display: table-cell !important; }
  .entry-table .macro-c, .entry-table .macro-f { display: none; }
  .hero-number { font-size: 46px; }
  .field-grid { grid-template-columns: 1fr 1fr; }
  .invite-create { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@page { size: A4; margin: 0; }

@media print {
  html, body { overflow: visible !important; background: var(--print-paper) !important; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; color: var(--print-ink); }
  .topbar, .report-toolbar, #toasts, .skip, .client-aside, .client-head-actions, .tabs, .period-bar, .back, .toolbar, .feedback-form, .theme-toggle { display: none !important; }
  .page { padding: 0 !important; max-width: none !important; }

  /* Bericht: jede Seite für sich, nichts wird mitten in einer Karte geteilt. */
  .sheets { display: block; }
  .sheet { width: auto; min-height: 0; margin: 0; border-radius: 0; box-shadow: none; break-after: page; }
  .sheet:last-child { break-after: auto; }
  .sheet-block, .sheet .panel, .sheet .stats, .sheet-hero { break-inside: avoid; }

  /* Normale Seite gedruckt (Cmd+P): Blockfluss statt Raster, damit der
     Browser zwischen den Karten umbrechen kann. */
  .page:not(.page-report) { padding: 12mm !important; }
  .client-layout, .tab-body, .panel-pair { display: block; }
  .tab-body > *, .panel-pair > * { margin-bottom: 14px; break-inside: avoid; }
  .panel, .stats { break-inside: avoid; box-shadow: none; }
}
