/* Hausbuch – design system (docs/DESIGN.md).
   Mobile-first. Colours, shapes and fonts come from the semantic tokens of the active design
   (static/css/designs/pop.css · ruhig.css · papier.css, chosen by <html data-design>); this file
   only holds the fonts, non-colour tokens, the aliases of the old token names and the base
   styles of every component. Fonts are self-hosted (SIL OFL, licences in static/fonts/). */

/* ------------------------------------------------------------------ fonts */
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-latin-400-normal.f1f8a8210104.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-latin-ext-400-normal.fe905e20f857.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-latin-700-normal.13a58e05dfd2.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-latin-ext-700-normal.764b69c9ccc8.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: italic; font-weight: 400; font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-latin-400-italic.de4c0c22fd4e.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: italic; font-weight: 400; font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-latin-ext-400-italic.43bf22741c7e.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Plus Jakarta Sans – headings of "pop" */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin-600-normal.79e62f3332cd.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin-ext-600-normal.c6e652ec6642.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin-700-normal.5b629bd8abb4.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin-ext-700-normal.1c63ebfc9380.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal; font-weight: 800; font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin-800-normal.408ecc6630e8.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal; font-weight: 800; font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin-ext-800-normal.beb0ca75fbed.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Nunito – headings of "ruhig" */
@font-face {
  font-family: "Nunito";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/nunito-latin-700-normal.28a2cf182b19.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/nunito-latin-ext-700-normal.762995b2bad6.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Nunito";
  font-style: normal; font-weight: 800; font-display: swap;
  src: url("../fonts/nunito-latin-800-normal.a28521c77f4a.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito";
  font-style: normal; font-weight: 800; font-display: swap;
  src: url("../fonts/nunito-latin-ext-800-normal.211c43d44d95.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Caveat – handwritten headings of "papier" */
@font-face {
  font-family: "Caveat";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/caveat-latin-600-normal.018947f2ec96.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Caveat";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/caveat-latin-ext-600-normal.ffc350bd6873.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Caveat";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/caveat-latin-700-normal.9700119a3654.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Caveat";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/caveat-latin-ext-700-normal.6d52f323b0d9.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ----------------------------------------------------------------- tokens */
/* Colour, shape and font tokens: static/css/designs/<design>.css (docs/DESIGN.md §5).
   Here: sizes that are the same in every design. */
:root {
  --tap: 48px;                  /* touch targets ≥ 48 px */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px;
  --maxw: 760px;
  --bar-h: 64px;                /* bottom bar without the safe area */
}
/* The old token names stay as aliases (module CSS uses them). Defined on every element with
   data-design, so previews of another design resolve them with that design's values. */
:root, [data-design] {
  --paper: var(--bg);
  --green: var(--ok);
  --green-ink: var(--ok-ink);
  --green-soft: var(--ok-soft);
  --red: var(--danger);
  --red-ink: var(--danger-ink);
  --red-soft: var(--danger-soft);
}

/* -------------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.5;
  padding-bottom: calc(var(--bar-h) + 12px + env(safe-area-inset-bottom));
}
h1, h2, h3, .h1, .h2, .h3 {
  font-family: var(--font-head);
  font-weight: var(--head-weight, 800);
  letter-spacing: var(--head-tracking, -0.01em);
  line-height: 1.12;
  margin: 0 0 var(--space-3);
  text-wrap: balance;
}
h1, .h1 { font-size: calc(clamp(1.65rem, 6.4vw, 2.2rem) * var(--head-scale, 1)); }
h2, .h2 { font-size: calc(1.35rem * var(--head-scale, 1)); }
h3, .h3 { font-size: calc(1.12rem * var(--head-scale, 1)); }
p { margin: 0 0 var(--space-3); }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
img, svg { max-width: 100%; }
small, .small { font-size: .9rem; }
.muted { color: var(--ink-soft); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--space-5) 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--marker); color: var(--marker-ink); }

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: var(--radius);
  font-weight: 700;
}
.skip-link:focus { top: 8px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

.icon { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; flex: none; }
.icon--lg { width: 1.75em; height: 1.75em; }

/* ------------------------------------------------------------------ layout */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--space-2);
  min-height: 56px; padding: 4px var(--space-2) 4px var(--space-4);
  padding-top: calc(4px + env(safe-area-inset-top));
  background: var(--bg); color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap);
  font-family: var(--font-head); font-weight: var(--head-weight, 800); letter-spacing: var(--head-tracking, -0.02em);
  font-size: calc(1.3rem * var(--head-scale, 1)); line-height: 1; text-decoration: none; color: inherit;
}
.brand__mark {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  background: var(--accent-gradient); color: var(--accent-ink);
  font-family: var(--font-ui); font-weight: 800; font-size: 1.1rem; letter-spacing: 0; line-height: 1;
}
.topnav { display: none; }
.topbar__actions { margin-left: auto; display: flex; gap: 2px; align-items: center; }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-width: var(--tap); min-height: var(--tap); border-radius: 999px;
  background: transparent; border: 0; color: inherit; cursor: pointer; text-decoration: none; font: inherit;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .count {
  position: absolute; top: 5px; right: 3px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-family: var(--font-ui);
  font-size: .72rem; font-weight: 800; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--bg);
}

.page { max-width: var(--maxw); margin: 0 auto; padding: var(--space-4); }
.page--wide { max-width: 1200px; }
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); margin: var(--space-1) 0 var(--space-4); }
.page-header h1 { margin: 0; }
.page-header .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.eyebrow { font-family: var(--font-ui); font-size: .88rem; color: var(--ink-soft); margin: 0 0 var(--space-1); font-weight: 700; }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 2px 4px env(safe-area-inset-bottom);
}
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: var(--bar-h); text-decoration: none; color: var(--ink-soft);
  font-family: var(--font-ui); font-size: .74rem; font-weight: 700; letter-spacing: 0;
  -webkit-tap-highlight-color: transparent;
}
.bottomnav a .icon {
  width: 24px; height: 24px; padding: 4px 16px; box-sizing: content-box; border-radius: 999px;
  transition: background-color .15s ease;
}
.bottomnav a[aria-current="page"] { color: var(--ink); }
.bottomnav a[aria-current="page"] .icon { background: var(--accent-soft); stroke-width: 2.4; }

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .bottomnav { display: none; }
  .topbar { padding-left: var(--space-5); padding-right: var(--space-4); }
  .topnav { display: flex; flex-wrap: wrap; gap: 2px; margin-left: var(--space-4); }
  .topnav a {
    display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 999px;
    text-decoration: none; font-family: var(--font-ui); font-weight: 700; font-size: .95rem; color: var(--ink-soft);
  }
  .topnav a:hover { color: var(--ink); background: var(--surface-2); }
  .topnav a[aria-current="page"] { color: var(--ink); background: var(--accent-soft); }
  .page { padding: var(--space-5); }
}

.stack > * + * { margin-top: var(--space-4); }
.stack-sm > * + * { margin-top: var(--space-2); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.grid { display: grid; gap: var(--space-4); }
@media (min-width: 640px) { .grid--2 { grid-template-columns: repeat(2, 1fr); } .grid--3 { grid-template-columns: repeat(3, 1fr); } }
.split { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; }

/* ------------------------------------------------------------------- cards */
.card {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: var(--space-4); border: 1px solid var(--line);
}
.card > :last-child { margin-bottom: 0; }
.card__title {
  font-family: var(--font-head); font-weight: var(--head-weight, 800); letter-spacing: var(--head-tracking, 0);
  font-size: calc(1.15rem * var(--head-scale, 1)); margin: 0 0 var(--space-2); line-height: 1.2;
}
.card--urgent { background: var(--marker); color: var(--marker-ink); border-color: transparent; }
.card--ok { border-left: 6px solid var(--ok); }
.card--danger { border-left: 6px solid var(--danger); }
.card--flat { box-shadow: none; }
.section { margin-top: var(--space-6); }
.section:first-child { margin-top: 0; }
.section__title { display: flex; align-items: baseline; gap: var(--space-2); font-size: calc(1.2rem * var(--head-scale, 1)); margin-bottom: var(--space-3); }
.section__title .badge { font-family: var(--font-ui); }

/* -------------------------------------------------------------------- lists */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.list-item {
  display: flex; gap: var(--space-3); align-items: center; padding: var(--space-3) 0; min-height: var(--tap);
  text-decoration: none; color: inherit;
}
a.list-item:hover .list-item__title { text-decoration: underline; }
.list-item__body { flex: 1; min-width: 0; }
.list-item__title { font-weight: 700; display: block; }
.list-item__meta { color: var(--ink-soft); font-size: .92rem; display: block; }
.list-item--urgent { background: var(--marker); color: var(--marker-ink); margin: 0 calc(-1 * var(--space-2)); padding-left: var(--space-2); padding-right: var(--space-2); border-radius: var(--radius); }

/* ------------------------------------------------------------------ badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px;
  font-family: var(--font-ui); font-size: .82rem; font-weight: 700; line-height: 1.5; white-space: nowrap;
  background: var(--surface-2); color: var(--ink);
}
.badge--ok { background: var(--ok-soft); color: var(--ink); box-shadow: inset 3px 0 0 var(--ok); }
.badge--danger { background: var(--danger-soft); color: var(--ink); box-shadow: inset 3px 0 0 var(--danger); }
.badge--urgent { background: var(--marker); color: var(--marker-ink); }
.badge--solid { background: var(--ink); color: var(--bg); }
.badge--accent { background: var(--accent-soft); color: var(--ink); }

/* ----------------------------------------------------------------- buttons */
/* .btn--primary is the one main action of a screen: the accent gradient. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--tap); padding: 10px 20px; border-radius: var(--radius);
  border: 2px solid transparent; background: var(--surface-2); color: var(--ink);
  font-family: var(--font-ui); font-size: 1rem; font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: transform .08s ease, filter .15s ease, background-color .15s ease;
}
.btn:hover { filter: brightness(.97); }
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--accent-gradient); color: var(--accent-ink); box-shadow: var(--shadow); }
.btn--primary:hover { filter: brightness(1.06) saturate(1.05); }
.btn--danger { background: var(--danger); color: var(--danger-ink); }
.btn--ink { background: var(--ink); color: var(--bg); }
.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--surface-2); filter: none; }
.btn--outline { background: transparent; border-color: var(--field-border); }
.btn--small { min-height: 44px; padding: 6px 14px; font-size: .92rem; }
.btn--block { display: flex; width: 100%; }
/* Square icon-only button (with aria-label): as wide as it is high in every design. */
.btn.btn--icon { flex: none; width: var(--tap); min-width: var(--tap); padding-left: 0; padding-right: 0; }
.btn.btn--icon.btn--small { width: 44px; min-width: 44px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; min-height: 44px; }
form.inline { display: inline; }

/* ----------------------------------------------------------------- counter */
/* The Theke-Tablet counter (logbuch): huge buttons, stays full screen in every design. */
.counter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.counter-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 132px; padding: var(--space-3); border-radius: var(--radius-lg);
  border: 2px solid var(--line); background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
  font: inherit; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent; transition: transform .06s ease, background-color .2s ease;
}
.counter-btn:active { transform: scale(.97); }
.counter-btn__label { font-family: var(--font-head); font-weight: var(--head-weight, 800); font-size: calc(2rem * var(--head-scale, 1)); line-height: 1; letter-spacing: var(--head-tracking, 0); }
.counter-btn__sub { font-size: .9rem; color: var(--ink-soft); }
.counter-btn__count { font-family: var(--font-ui); font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 4px; }
.counter-btn.is-bumped { background: var(--ok-soft); border-color: var(--ok); }
.counter-toggle {
  display: flex; align-items: center; justify-content: center; gap: var(--space-2); width: 100%;
  min-height: 60px; margin-top: var(--space-3); border-radius: var(--radius-lg);
  border: 2px dashed var(--field-border); background: transparent; color: var(--ink); font: inherit; font-weight: 700; font-size: 1.1rem;
  cursor: pointer; touch-action: manipulation;
}
.counter-toggle[aria-pressed="true"] { background: var(--marker); color: var(--marker-ink); border-style: solid; border-color: var(--marker-ink); }
.counter-status { min-height: 1.5em; margin-top: var(--space-2); font-weight: 700; }

/* ------------------------------------------------------------------ forms */
.form { display: grid; gap: var(--space-4); }
.field { display: grid; gap: 6px; }
.field > label, .field__label { font-family: var(--font-ui); font-weight: 700; }
.field .req { color: var(--danger); }
.field .helptext, .field__help { color: var(--ink-soft); font-size: .92rem; }
/* Hints at a field are friendly, not red (docs/PILOT.md §0 rule 5): a thick ink border with a
   highlighter halo, the hint itself ink on the highlighter. */
.field--error input, .field--error select, .field--error textarea {
  border-color: var(--ink); border-width: 3px; box-shadow: 0 0 0 3px var(--marker);
}
.errorlist { list-style: none; margin: 4px 0 0; padding: 0; color: var(--ink); font-weight: 700; display: grid; gap: 4px; }
.errorlist > li {
  width: fit-content; max-width: 100%; padding: 2px 8px; border-radius: 6px;
  background: var(--marker); color: var(--marker-ink);
}
.errorlist.nonfield { padding: var(--space-3); border-radius: var(--radius); background: var(--marker); color: var(--marker-ink); }
.errorlist.nonfield > li { padding: 0; background: transparent; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"],
input[type="time"], input[type="datetime-local"], input[type="search"], input[type="tel"], input[type="url"],
input[type="month"], select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 14px;
  border: 2px solid var(--field-border); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font: inherit;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--focus); }
textarea { min-height: 110px; resize: vertical; }
input[type="file"] { font: inherit; min-height: var(--tap); }
input[type="checkbox"], input[type="radio"] { width: 26px; height: 26px; accent-color: var(--accent); margin: 0; }
.check { display: flex; align-items: center; gap: var(--space-3); min-height: var(--tap); font-weight: 700; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.check-list label { display: flex; align-items: center; gap: var(--space-3); min-height: var(--tap); font-weight: 400; }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-3) var(--space-4); margin: 0; }
legend { font-family: var(--font-ui); font-weight: 700; padding: 0 6px; }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
table.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; background: var(--surface); }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-family: var(--font-ui); font-size: .88rem; color: var(--ink-soft); font-weight: 700; background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; }
.table tr.is-urgent td { background: var(--marker); color: var(--marker-ink); }

/* ------------------------------------------------------------- stat tiles */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-3) var(--space-4); box-shadow: var(--shadow); }
.kpi__value { font-family: var(--font-head); font-weight: var(--head-weight, 800); font-size: calc(2.2rem * var(--head-scale, 1)); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: var(--head-tracking, 0); }
.kpi__label { font-family: var(--font-ui); font-weight: 700; }
.kpi__hint { color: var(--ink-soft); font-size: .9rem; }

/* -------------------------------------------------------------- messages */
.messages { list-style: none; margin: 0 0 var(--space-4); padding: 0; display: grid; gap: var(--space-2); }
.message { padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--surface); border-left: 6px solid var(--ink); font-weight: 700; box-shadow: var(--shadow); }
.message--success { border-left-color: var(--ok); }
.message--error { border-left-color: var(--danger); background: var(--danger-soft); }
.message--warning { background: var(--marker); color: var(--marker-ink); border-left-color: var(--marker-ink); }

.notice { padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--surface-2); }
.notice--urgent { background: var(--marker); color: var(--marker-ink); }
.notice--danger { background: var(--danger-soft); border-left: 6px solid var(--danger); }
.notice--ok { background: var(--ok-soft); border-left: 6px solid var(--ok); }

.empty { text-align: center; padding: var(--space-6) var(--space-4); color: var(--ink-soft); }
.empty .icon { width: 40px; height: 40px; margin-bottom: var(--space-2); }

/* --------------------------------------------------------------- tabs */
.tabs { display: flex; gap: var(--space-2); overflow-x: auto; margin-bottom: var(--space-4); padding-bottom: 2px; }
.tabs a { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
  text-decoration: none; font-family: var(--font-ui); font-weight: 700; background: var(--surface-2); color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--bg); }
/* .tabs--scroll: a row of tabs that may run wider than a phone (3–4 tabs) – a soft fade at the right
   edge says "there is more", and the last tab can scroll out of the fade. */
@media (max-width: 639px) {
  .tabs--scroll {
    -webkit-mask-image: linear-gradient(to right, var(--ink) calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, var(--ink) calc(100% - 28px), transparent);
  }
  .tabs--scroll > :last-child { margin-right: 24px; }
}

.pagination { display: flex; gap: var(--space-2); align-items: center; justify-content: center; margin-top: var(--space-4); }

/* ------------------------------------------------------------ misc parts */
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-family: var(--font-ui); font-size: .88rem; font-weight: 600; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px var(--space-4); margin: 0; }
.dl dt { font-weight: 700; color: var(--ink-soft); }
.dl dd { margin: 0; }
.menu-list a { display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: 0 var(--space-2); font-family: var(--font-ui); font-weight: 700; text-decoration: none; font-size: 1.05rem; }
.menu-list a .icon { width: 22px; height: 22px; color: var(--ink-soft); }
.qr svg { width: 220px; height: 220px; background: #fff; padding: 8px; border-radius: var(--radius); }
.codes { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1.15rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 24px; }
.matrix select { min-width: 64px; padding: 6px; }
.matrix td, .matrix th { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.lvl { display: inline-block; min-width: 32px; padding: 2px 8px; border-radius: 6px; font-weight: 700; text-align: center; }
.lvl--F { background: var(--ok); color: var(--ok-ink); }
.lvl--B { background: var(--ok-soft); color: var(--ink); }
.lvl--E, .lvl--M { background: var(--surface-2); color: var(--ink); }
.lvl--S { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.lvl--N { background: transparent; color: var(--ink-soft); }
.bar { height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent-gradient); }

.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

/* ------------------------------------------------------------------ print */
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; color: #000; padding: 0; font-size: 11pt; }
  .topbar, .bottomnav, .no-print, .messages, .skip-link, .quick-capture, .toast-region, dialog.sheet { display: none !important; }
  .print-only { display: block; }
  .page { max-width: none; padding: 0; }
  .card { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
  a { text-decoration: none; }
  .table th { background: #eee; }
}

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

/* ------------------------------------------------------------------ auth */
.auth .page { max-width: 440px; padding-top: var(--space-7); }
.brand--big { font-size: calc(2.4rem * var(--head-scale, 1)); min-height: 0; margin: 0; color: var(--ink); gap: 12px; }
.brand--big .brand__mark { width: 52px; height: 52px; border-radius: 16px; font-size: 1.8rem; }
.list-item--button { width: 100%; text-align: left; background: none; border: 0; font: inherit; color: inherit; cursor: pointer; }

/* ------------------------------------------------ review fixes (a11y/mobile) */
/* Anchors and keyboard focus are not hidden behind the sticky/fixed bars. */
html { scroll-padding-top: 72px; scroll-padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { html { scroll-padding-bottom: 0; } }
/* Visually hidden text inside scroll containers must not widen the page. */
.table-wrap, .tabs, .tabs a, .field, .card, .stories, .story, .chips, .segmented { position: relative; }
/* [hidden] wins over component display values (e.g. the error box is a .messages grid). */
[hidden] { display: none !important; }
/* Long option labels and file inputs must not push forms past a 375px screen. */
.form > *, .grid > *, .field > * { min-width: 0; }
select { max-width: 100%; }
input[type="file"] { width: 100%; }
/* Touch targets ≥ 44px for the remaining small controls. */
.topnav a { min-height: 44px; }
.eyebrow a { display: inline-flex; align-items: center; min-height: 44px; }
summary { min-height: 44px; padding: 10px 0; cursor: pointer; }
/* Highlighter surfaces ("Textmarker" = urgent): text and controls take the marker ink, in
   every design and both modes. */
.card--urgent, .notice--urgent, .message--warning, .list-item--urgent, .table tr.is-urgent td, .badge--urgent,
.tile--urgent {
  --ink: var(--marker-ink); --ink-soft: var(--marker-ink); --focus: var(--marker-ink);
  --line: color-mix(in srgb, var(--marker-ink) 22%, transparent);
  color: var(--ink);
}
/* Surfaces nested in a highlighter card or tile (items, chips, fields) are tinted from the marker
   itself, so marker ink stays readable whether the marker is light or dark (all designs × modes). */
.card--urgent, .notice--urgent, .message--warning, .tile--urgent {
  --surface: color-mix(in srgb, var(--marker-ink) 6%, var(--marker));
  --surface-2: color-mix(in srgb, var(--marker-ink) 12%, var(--marker));
  --bg: var(--marker);
  --field-border: color-mix(in srgb, var(--marker-ink) 65%, var(--marker));
}
/* Print palette: static/css/print.css (loaded after the three designs, so it wins in dark mode too). */
[data-error-box] { position: fixed; left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 30; margin: 0; }
@media (min-width: 900px) { [data-error-box] { bottom: 24px; max-width: 560px; left: auto; } }
.tabs { scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }

/* ======================================================= pilot foundation */

/* ----------------------------------------------------------------- toasts */
/* static/js/hausbuch.js: <div class="toast-region"> holds .toast (role=status) with
   .toast__text, optional .toast__link ("Ansehen"), .toast__undo ("Rückgängig") and .toast__close. Sits above the
   bottom bar; body.has-toast while one is visible (lifts the quick capture). */
.toast-region {
  position: fixed; left: 12px; right: 12px; z-index: 60;
  bottom: calc(var(--bar-h) + 14px + env(safe-area-inset-bottom));
  display: grid; gap: var(--space-2); justify-items: center; pointer-events: none;
}
.toast {
  --focus: var(--bg);
  pointer-events: auto; width: 100%; max-width: 560px;
  display: flex; align-items: center; gap: var(--space-2);
  min-height: 56px; padding: 6px 6px 6px var(--space-4); border-radius: var(--radius-lg);
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg);
  font-family: var(--font-ui); font-weight: 700; transition: opacity .2s ease, transform .2s ease;
}
.toast.is-leaving { opacity: 0; transform: translateY(8px); }
.toast__text { flex: 1 1 8em; min-width: 0; }
.toast:has(.toast__link) { flex-wrap: wrap; row-gap: 2px; }
.toast__undo, .toast__close, .toast__link {
  flex: none; min-height: var(--tap); min-width: var(--tap); padding: 0 16px; border-radius: 999px;
  border: 0; font: inherit; font-weight: 800; cursor: pointer; touch-action: manipulation;
}
.toast__undo { background: var(--accent-gradient); color: var(--accent-ink); }
.toast__close { background: transparent; color: inherit; font-size: 1.4rem; line-height: 1; }
.toast__link {
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  background: transparent; color: inherit; border: 2px solid currentColor;
}
@media (min-width: 900px) {
  .toast-region { bottom: 24px; left: auto; right: 24px; width: 420px; justify-items: end; }
}
/* While the sheet is open the toasts live inside it (hausbuch.js placeToasts): no bottom bar below. */
dialog.sheet > .toast-region,
:root[data-design] dialog.sheet > .toast-region { bottom: calc(14px + env(safe-area-inset-bottom)); }

/* --------------------------------------------------- chips and segments */
/* Up to six options as buttons: <div class="chips"> with .chip-btn – either a
   <button aria-pressed="true|false"> or a <label class="chip-btn"><input type="radio|checkbox"
   class="visually-hidden">Text</label>. .chips--segment (or .segmented) joins them into one control. */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 8px 16px; border-radius: 999px;
  border: 2px solid var(--line); background: var(--surface); color: var(--ink);
  font-family: var(--font-ui); font-size: .98rem; font-weight: 700; line-height: 1.2; cursor: pointer; text-decoration: none;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none;
}
.chip-btn:hover { border-color: var(--field-border); }
.chip-btn[aria-pressed="true"], .chip-btn:has(input:checked), .chip-btn[aria-current="page"] {
  background: var(--ink); border-color: var(--ink); color: var(--bg);
}
.chip-btn:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.chip-btn[data-color] .chip-btn__dot, .chip-btn__dot {
  width: 14px; height: 14px; border-radius: 50%; background: var(--person, var(--surface-2)); flex: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}
/* Segmented control: one pill track, the chosen option lifts out. */
.segmented, .chips--segment {
  display: inline-flex; flex-wrap: nowrap; gap: 2px; padding: 3px; border-radius: 999px;
  background: var(--surface-2); max-width: 100%;
}
.segmented > .chip-btn, .chips--segment > .chip-btn {
  border: 0; background: transparent; margin: 0; min-height: 42px; padding: 6px 14px; flex: 1 1 auto; white-space: nowrap;
  border-radius: 999px; color: var(--ink-soft);
}
.segmented > .chip-btn[aria-pressed="true"], .segmented > .chip-btn:has(input:checked),
.segmented > .chip-btn[aria-current="page"], .chips--segment > .chip-btn[aria-current="page"],
.chips--segment > .chip-btn[aria-pressed="true"], .chips--segment > .chip-btn:has(input:checked) {
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow);
}

/* ---------------------------------------------------------------- toggle */
/* <input type="checkbox" class="toggle" role="switch"> (bool settings). */
input[type="checkbox"].toggle {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; cursor: pointer;
  width: 56px; height: 32px; border-radius: 999px; margin: 0;
  background: var(--surface-2); border: 2px solid var(--field-border); transition: background-color .15s;
}
input[type="checkbox"].toggle::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink-soft); transition: transform .15s;
}
input[type="checkbox"].toggle:checked { background: var(--ok); border-color: var(--ok); }
input[type="checkbox"].toggle:checked::after { transform: translateX(24px); background: var(--ok-ink); }
.settings-group .check { justify-content: space-between; flex-direction: row-reverse; }
.settings-group .check > span { flex: 1; }

/* --------------------------------------------------------- quick capture */
/* base.html renders the templates registered with register_quick_capture() into
   <div class="quick-capture" data-quick-capture>, bottom right above the bottom bar (a fixed
   place). .quick-capture__btn is a round button (icon + short word) for those templates. */
.quick-capture {
  position: fixed; right: 14px; z-index: 25;
  bottom: calc(var(--bar-h) + 14px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2);
  transition: transform .2s ease;
}
body.has-toast .quick-capture { transform: translateY(-72px); }
.quick-capture__btn {
  --focus: var(--accent);
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg);
  font-family: var(--font-ui); font-size: .7rem; font-weight: 800; text-decoration: none;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: transform .1s ease;
}
.quick-capture__btn:active { transform: scale(.95); }
.quick-capture__btn .icon { width: 22px; height: 22px; }
body:has(.quick-capture) .page { padding-bottom: calc(var(--space-4) + 72px); }
@media (min-width: 900px) {
  .quick-capture { bottom: 24px; right: 24px; }
  body.has-toast .quick-capture { transform: translateY(-80px); }
}

/* -------------------------------------------- quests (detail in the sheet) */
.quest-progress { display: grid; gap: var(--space-1); margin-bottom: var(--space-3); }
.quest-progress__bar {
  appearance: none; -webkit-appearance: none; width: 100%; height: 10px; border: 0; border-radius: 5px;
  background: var(--surface-2); overflow: hidden;
}
.quest-progress__bar::-webkit-progress-bar { background: var(--surface-2); border-radius: 5px; }
.quest-progress__bar::-webkit-progress-value { background: var(--accent-gradient); border-radius: 5px; }
.quest-progress__bar::-moz-progress-bar { background: var(--accent); border-radius: 5px; }
.quest-progress__label { margin: 0; }
.quest-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.quest { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-2) 0; }
.quest__mark {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--line); color: var(--ink-soft); font-family: var(--font-ui); font-weight: 800;
}
.quest__body { flex: 1; min-width: 0; }
.quest__title { margin: 0; font-family: var(--font-ui); font-weight: 800; font-size: 1.1rem; min-height: 36px; display: flex; align-items: center; }
.quest__hint { margin: var(--space-1) 0 0; color: var(--ink-soft); }
.quest__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-top: var(--space-3); }
.quest__actions form { margin: 0; }
.quest__help { color: var(--ink-soft); font-size: .92rem; }
.quest--done .quest__title { color: var(--ink-soft); }
.quest--done .quest__mark { background: var(--ok); border-color: var(--ok); color: var(--ok-ink); }
.quest--next .quest__mark { border-color: transparent; background: var(--accent-gradient); color: var(--accent-ink); }
.quest-finale { text-align: center; padding: var(--space-3) 0; }
.quest-finale .icon { width: 48px; height: 48px; color: var(--accent); }
.quest-finale__title { font-family: var(--font-head); font-weight: var(--head-weight, 800); font-size: calc(1.8rem * var(--head-scale, 1)); margin: var(--space-2) 0; }

/* ---------------------------------------------------------- device home */
.device .page { padding-top: var(--space-7); }

/* ============================================ design vocabulary (DESIGN §5) */

/* ------------------------------------------------------------------ avatar */
/* {% avatar user "s|m|l" %}: round, initials, data-color sets --person/--person-ink. */
.avatar {
  display: inline-grid; place-items: center; flex: none; position: relative;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--person, var(--surface-2)); color: var(--person-ink, var(--ink));
  font-family: var(--font-ui); font-weight: 800; font-size: 1rem; line-height: 1; letter-spacing: 0;
  text-transform: uppercase; user-select: none; text-decoration: none; overflow: hidden;
}
.avatar--s { width: 30px; height: 30px; font-size: .8rem; }
.avatar--m { width: 40px; height: 40px; font-size: 1rem; }
.avatar--l { width: 60px; height: 60px; font-size: 1.45rem; }
.avatar--empty { background: transparent; color: var(--ink-soft); border: 2px dashed var(--field-border); }
.avatars { display: inline-flex; align-items: center; gap: 4px; }
.avatars__arrow { color: var(--ink-soft); }
a.avatar-link { display: inline-flex; border-radius: 50%; min-width: var(--tap); min-height: var(--tap); align-items: center; justify-content: center; text-decoration: none; }
a .avatar, .icon-btn .avatar { text-decoration: none; }

/* Personal colours (core/colors.py; light and dark; kept in sync by core/tests/test_design.py). */
/* @colors light */
[data-color="koralle"] { --person: #C93F25; --person-ink: #FFFFFF; --person-soft: #FBE4DE; }
[data-color="mango"] { --person: #B35500; --person-ink: #FFFFFF; --person-soft: #FCE9D6; }
[data-color="sonne"] { --person: #8A6D00; --person-ink: #FFFFFF; --person-soft: #FAF0C8; }
[data-color="limette"] { --person: #4E7A00; --person-ink: #FFFFFF; --person-soft: #E8F4CF; }
[data-color="minze"] { --person: #0D7F63; --person-ink: #FFFFFF; --person-soft: #D7F3EA; }
[data-color="tuerkis"] { --person: #007C85; --person-ink: #FFFFFF; --person-soft: #D4F1F3; }
[data-color="himmel"] { --person: #2068C2; --person-ink: #FFFFFF; --person-soft: #DDEBFB; }
[data-color="ozean"] { --person: #1B3F8F; --person-ink: #FFFFFF; --person-soft: #DCE4F5; }
[data-color="lavendel"] { --person: #6A55C7; --person-ink: #FFFFFF; --person-soft: #E8E3FA; }
[data-color="flieder"] { --person: #943CB0; --person-ink: #FFFFFF; --person-soft: #F3E0F8; }
[data-color="pink"] { --person: #C2266E; --person-ink: #FFFFFF; --person-soft: #FBE0EC; }
[data-color="kakao"] { --person: #7A4A2E; --person-ink: #FFFFFF; --person-soft: #F1E5DC; }
/* @colors dark */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) [data-color="koralle"] { --person: #FF8A70; --person-ink: #3A0D04; --person-soft: #3B1F19; }
  :root:not([data-theme="light"]) [data-color="mango"] { --person: #FFAA4D; --person-ink: #361A00; --person-soft: #3A2715; }
  :root:not([data-theme="light"]) [data-color="sonne"] { --person: #F5D33F; --person-ink: #2E2500; --person-soft: #38321A; }
  :root:not([data-theme="light"]) [data-color="limette"] { --person: #A8DB4A; --person-ink: #1A2A00; --person-soft: #2A3518; }
  :root:not([data-theme="light"]) [data-color="minze"] { --person: #4FD6A8; --person-ink: #002B1E; --person-soft: #173A30; }
  :root:not([data-theme="light"]) [data-color="tuerkis"] { --person: #3CCFD6; --person-ink: #002A2D; --person-soft: #15383B; }
  :root:not([data-theme="light"]) [data-color="himmel"] { --person: #7BB8F5; --person-ink: #06233F; --person-soft: #1B2E42; }
  :root:not([data-theme="light"]) [data-color="ozean"] { --person: #7FA3F2; --person-ink: #0A1A40; --person-soft: #1D2843; }
  :root:not([data-theme="light"]) [data-color="lavendel"] { --person: #A99BF5; --person-ink: #1D1245; --person-soft: #2A2545; }
  :root:not([data-theme="light"]) [data-color="flieder"] { --person: #D48CEB; --person-ink: #2E0A3A; --person-soft: #36233D; }
  :root:not([data-theme="light"]) [data-color="pink"] { --person: #FF7EB6; --person-ink: #3D0520; --person-soft: #3D1F2C; }
  :root:not([data-theme="light"]) [data-color="kakao"] { --person: #C9A07E; --person-ink: #2B1709; --person-soft: #33271E; }
}
:root[data-theme="dark"] [data-color="koralle"] { --person: #FF8A70; --person-ink: #3A0D04; --person-soft: #3B1F19; }
:root[data-theme="dark"] [data-color="mango"] { --person: #FFAA4D; --person-ink: #361A00; --person-soft: #3A2715; }
:root[data-theme="dark"] [data-color="sonne"] { --person: #F5D33F; --person-ink: #2E2500; --person-soft: #38321A; }
:root[data-theme="dark"] [data-color="limette"] { --person: #A8DB4A; --person-ink: #1A2A00; --person-soft: #2A3518; }
:root[data-theme="dark"] [data-color="minze"] { --person: #4FD6A8; --person-ink: #002B1E; --person-soft: #173A30; }
:root[data-theme="dark"] [data-color="tuerkis"] { --person: #3CCFD6; --person-ink: #002A2D; --person-soft: #15383B; }
:root[data-theme="dark"] [data-color="himmel"] { --person: #7BB8F5; --person-ink: #06233F; --person-soft: #1B2E42; }
:root[data-theme="dark"] [data-color="ozean"] { --person: #7FA3F2; --person-ink: #0A1A40; --person-soft: #1D2843; }
:root[data-theme="dark"] [data-color="lavendel"] { --person: #A99BF5; --person-ink: #1D1245; --person-soft: #2A2545; }
:root[data-theme="dark"] [data-color="flieder"] { --person: #D48CEB; --person-ink: #2E0A3A; --person-soft: #36233D; }
:root[data-theme="dark"] [data-color="pink"] { --person: #FF7EB6; --person-ink: #3D0520; --person-soft: #3D1F2C; }
:root[data-theme="dark"] [data-color="kakao"] { --person: #C9A07E; --person-ink: #2B1709; --person-soft: #33271E; }
/* @colors end */

/* ------------------------------------------------------------ bottom sheet */
/* <dialog class="sheet" id="hb-sheet"> in base.html; hausbuch.js loads a[data-sheet] /
   button[data-sheet] into .sheet__body (header HX-Sheet: 1). The loaded markup comes from
   core/sheet_base.html: .sheet__header (.sheet__title, .sheet__close) + .sheet__content. */
.sheet {
  display: flex; flex-direction: column; width: 100%; max-width: 640px; margin: 0 auto; padding: 0; border: 0;
  background: var(--surface); color: var(--ink);
  border-radius: calc(var(--radius-lg) + 4px) calc(var(--radius-lg) + 4px) 0 0;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
dialog.sheet {
  position: fixed; inset: auto 0 0 0; max-height: min(88dvh, 88vh);
  display: none; padding-bottom: env(safe-area-inset-bottom);
  transition: transform .2s ease;
}
dialog.sheet[open] { display: flex; animation: sheet-in .24s cubic-bezier(.2, .8, .2, 1); }
dialog.sheet.is-closing { animation: sheet-out .18s ease-in forwards; }
dialog.sheet.is-dragging { animation: none; transition: none; }
/* ::backdrop does not inherit custom properties in every browser: a fixed, calm dim. */
dialog.sheet::backdrop { background: rgba(10, 10, 14, .5); }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes sheet-out { from { transform: translateY(var(--sheet-drag, 0)); } to { transform: translateY(100%); } }
.sheet__handle {
  flex: none; display: flex; justify-content: center; align-items: center; height: 26px; cursor: grab;
  touch-action: none;
}
.sheet__handle::before { content: ""; width: 44px; height: 5px; border-radius: 3px; background: var(--line); }
.sheet__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; }
.sheet__header {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: var(--space-2);
  padding: 0 var(--space-2) var(--space-2) var(--space-4); background: var(--surface); touch-action: none;
}
.sheet__title { flex: 1; min-width: 0; margin: 0; font-size: calc(1.3rem * var(--head-scale, 1)); }
.sheet__title:focus { outline: none; }  /* focused for screen readers only, not interactive */
.sheet__close {
  flex: none; display: inline-grid; place-items: center; width: var(--tap); height: var(--tap);
  border-radius: 50%; border: 0; background: var(--surface-2); color: var(--ink); cursor: pointer;
}
.sheet__content { padding: var(--space-2) var(--space-4) var(--space-5); }
.sheet__content > :last-child { margin-bottom: 0; }
/* A page shown in the sheet: the sheet head carries the title, the page's own head only its
   actions; cards wrapping the whole content flatten. */
.sheet__content .page-header { margin: 0 0 var(--space-3); }
.sheet__content .page-header > :not(.actions) { display: none; }
.sheet__content .page-header:not(:has(.actions)) { display: none; }
.sheet__content .card { box-shadow: none; }
.sheet__content > .card { border: 0; padding: 0; background: transparent; border-radius: 0; }
.sheet__loading { display: grid; place-items: center; gap: var(--space-2); padding: var(--space-6) var(--space-4); color: var(--ink-soft); }
.sheet__loading::before {
  content: ""; width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--surface-2); border-top-color: var(--accent); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
body.has-sheet { overflow: hidden; }
@media (min-width: 900px) {
  dialog.sheet {
    inset: 0; margin: auto; max-height: min(84vh, 760px); border-radius: var(--radius-lg);
  }
  dialog.sheet[open] { animation: sheet-pop .18s ease-out; }
  @keyframes sheet-pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
  dialog.sheet.is-closing { animation: none; }
  .sheet__handle { height: 12px; }
  .sheet__handle::before { display: none; }
}
/* A sheet drawn in place (component gallery). */
.sheet.sheet--static { position: relative; max-height: none; }

/* ------------------------------------------------------------- story bar */
/* .stories: horizontal row of .story (a ring around a disc + label). --progress 0…1 fills
   the ring; .story--done = full ring, .story--next = highlighted. */
.stories-wrap { margin: 0 calc(-1 * var(--space-4)) var(--space-3); }
.stories-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); padding: 0 var(--space-4); margin-bottom: var(--space-1); }
.stories-head__title { margin: 0; font-family: var(--font-ui); font-size: .92rem; font-weight: 800; letter-spacing: 0; }
.stories-head__count { font-family: var(--font-ui); font-size: .88rem; font-weight: 700; color: var(--ink-soft); }
.stories {
  display: flex; gap: 6px; overflow-x: auto; list-style: none; margin: 0; padding: 4px var(--space-4) 6px;
  scroll-snap-type: x proximity; scroll-padding-inline: var(--space-4); scrollbar-width: none;
}
.stories::-webkit-scrollbar { display: none; }
.stories > li { flex: none; scroll-snap-align: start; }
.story {
  --progress: 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px; width: 76px;
  text-decoration: none; color: var(--ink); -webkit-tap-highlight-color: transparent;
  border-radius: var(--radius);
}
.story__ring {
  display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; padding: 3px;
  background:
    conic-gradient(var(--accent) calc(var(--progress) * 360deg), var(--line) 0);
}
.story__inner {
  display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--bg);
  font-family: var(--font-ui); font-weight: 800; font-size: 1.2rem; color: var(--ink-soft);
}
.story__inner .icon { width: 26px; height: 26px; }
.story__label {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  width: 100%; text-align: center; font-family: var(--font-ui); font-size: .74rem; font-weight: 700; line-height: 1.2;
}
.story--done { --progress: 1; }
.story--done .story__ring { background: var(--accent-gradient); }
.story--done .story__inner { color: var(--accent); }
.story--done .story__label { color: var(--ink-soft); font-weight: 600; }
.story--next .story__ring { background: var(--accent-gradient); }
.story--next .story__inner { background: var(--accent-soft); color: var(--ink); }
.story:hover .story__inner { filter: brightness(.98); }

/* ----------------------------------------------------------------- tiles */
/* Heute: .tiles grid of .tile (a[data-sheet] → its sheet). __label (icon + word), __value (big),
   __preview (one line); --accent (gradient, the highlighted one), --urgent (marker), --wide. */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--tile-gap, 10px); margin: 0 0 var(--space-4); }
/* Three columns from tablets on: the wide tile spans two, and "dense" fills the gap it would leave
   (five tiles = two full rows). */
@media (min-width: 640px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: row dense; }
  .tiles .tile--wide { grid-column: span 2; }
}
.tile {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
  min-height: 112px; padding: 14px; border-radius: var(--radius-lg);
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow);
  text-decoration: none; overflow: hidden; -webkit-tap-highlight-color: transparent;
  transition: transform .1s ease, box-shadow .15s ease;
}
a.tile:hover { box-shadow: var(--shadow-lg); }
a.tile:active { transform: scale(.98); }
.tile__label {
  display: flex; align-items: center; gap: 6px; font-family: var(--font-ui); font-size: .86rem; font-weight: 800;
  color: var(--ink-soft); line-height: 1.2;
}
.tile__label .icon { width: 18px; height: 18px; }
.tile__value {
  font-family: var(--font-head); font-weight: var(--head-weight, 800); letter-spacing: var(--head-tracking, -0.02em);
  font-size: calc(2.1rem * var(--head-scale, 1)); line-height: 1; font-variant-numeric: tabular-nums;
}
.tile__value--text { font-size: calc(1.15rem * var(--head-scale, 1)); line-height: 1.15; }
.tile__preview {
  font-size: .88rem; color: var(--ink-soft); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tile[data-color] .tile__label::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--person); flex: none;
}
.tile--accent { background: var(--accent-gradient); color: var(--accent-ink); border-color: transparent; }
.tile--accent .tile__label, .tile--accent .tile__preview { color: var(--accent-ink); }
.tile--urgent { background: var(--marker); color: var(--marker-ink); border-color: transparent; }
.tile__main { display: contents; }
.tile__label { order: 0; }
.tile__value { order: 1; }
.tile__preview { order: 2; }
.tile--wide { grid-column: 1 / -1; min-height: 88px; flex-direction: row; align-items: center; gap: var(--space-3); }
.tile--wide .tile__main { display: grid; gap: 4px; flex: 1; min-width: 0; order: 0; }
.tile--wide .tile__value { order: 1; flex: none; }

/* --------------------------------------------------------- compact matrix */
/* To-Dos overview: four .quad fields at once (count + the first titles). */
.matrix-mini { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--tile-gap, 10px); }
.quad {
  --q: var(--q-spaeter); --q-ink: var(--q-spaeter-ink);
  display: flex; flex-direction: column; gap: 6px; min-height: 132px; padding: 12px;
  border-radius: var(--radius-lg); background: var(--q); color: var(--ink); border: 1px solid var(--line);
  text-decoration: none; overflow: hidden; -webkit-tap-highlight-color: transparent;
}
.quad--sofort { --q: var(--q-sofort); --q-ink: var(--q-sofort-ink); }
.quad--planen { --q: var(--q-planen); --q-ink: var(--q-planen-ink); }
.quad--schnell { --q: var(--q-schnell); --q-ink: var(--q-schnell-ink); }
.quad--spaeter { --q: var(--q-spaeter); --q-ink: var(--q-spaeter-ink); }
.quad__head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; color: var(--q-ink); }
.quad__title { margin: 0; font-family: var(--font-ui); font-size: .9rem; font-weight: 800; line-height: 1.2; }
.quad__count { font-family: var(--font-head); font-weight: var(--head-weight, 800); font-size: calc(1.7rem * var(--head-scale, 1)); line-height: 1; font-variant-numeric: tabular-nums; }
.quad__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.quad__item {
  font-size: .88rem; line-height: 1.25; padding: 4px 8px; border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.quad__more { font-family: var(--font-ui); font-size: .8rem; font-weight: 700; color: var(--q-ink); margin-top: auto; }
/* .quad__item--avatar: the line starts with {% avatar person "s" decorative=True %} (or the dashed
   "?" of avatar--empty for "noch offen") – the avatar is the bullet, the text in .quad__text. */
.quad .quad__item--avatar {
  display: flex; align-items: center; gap: 5px; min-width: 0; padding-left: 3px; padding-right: 4px;
}
.quad .quad__item--avatar::before { content: none; display: none; }
.quad__item--avatar > .avatar { width: 20px; height: 20px; font-size: .56rem; flex: none; border-width: 1.5px; }
.quad__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------- chat list */
/* Team: rows like a messenger – avatar, title, one line preview, time right, "Eilt" dot. */
.chatlist { list-style: none; margin: 0; padding: 0; }
.chatlist > li + li .chat { border-top: 1px solid var(--line); }
.chat {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 2px var(--space-3);
  padding: 10px 2px; min-height: 64px; text-decoration: none; color: var(--ink);
}
.chat__avatar { grid-row: 1 / span 2; }
.chat__title { font-family: var(--font-ui); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat__preview { grid-column: 2; color: var(--ink-soft); font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat__time { grid-column: 3; grid-row: 1; font-family: var(--font-ui); font-size: .78rem; font-weight: 700; color: var(--ink-soft); white-space: nowrap; justify-self: end; }
.chat__dot {
  grid-column: 3; grid-row: 2; justify-self: end; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
  background: var(--accent-gradient); color: var(--accent-ink); font-family: var(--font-ui); font-size: .72rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.chat__dot:empty { min-width: 12px; width: 12px; height: 12px; padding: 0; }
a.chat:hover .chat__title { text-decoration: underline; }

/* -------------------------------------------------------- three-up grid */
/* Ruhmeshalle: three columns like a photo grid; each cell a stamp and a title. */
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.gridcell {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
  aspect-ratio: 1 / 1; padding: 8px; border-radius: 8px; overflow: hidden;
  background: var(--person-soft, var(--surface-2)); color: var(--ink); text-decoration: none;
}
.gridcell__stamp {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%) rotate(-12deg);
  padding: 2px 8px; border: 2px solid var(--person, var(--ok)); border-radius: 6px; color: var(--person, var(--ok));
  font-family: var(--font-ui); font-size: .62rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
}
.gridcell__title {
  font-family: var(--font-ui); font-size: .8rem; font-weight: 800; line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.gridcell__meta { font-size: .7rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------- meeting mode */
/* Teambesprechung (DESIGN §3a): one .slide per screen, vertical snap scrolling. */
.slides {
  height: calc(100dvh - 56px - env(safe-area-inset-top)); overflow-y: auto; scroll-snap-type: y mandatory;
  overscroll-behavior: contain; scrollbar-width: none;
}
.slides::-webkit-scrollbar { display: none; }
.slides__progress {
  position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-4); background: var(--bg);
  font-family: var(--font-ui); font-weight: 800; font-size: .9rem; color: var(--ink-soft); font-variant-numeric: tabular-nums;
}
.slides__bar { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.slides__bar > span { display: block; height: 100%; background: var(--accent-gradient); border-radius: 2px; }
.slide {
  position: relative; min-height: 100%; scroll-snap-align: start; scroll-snap-stop: always;
  display: flex; flex-direction: column; justify-content: center; gap: var(--space-3);
  padding: var(--space-5) var(--space-4) calc(var(--space-7) + var(--tap));
  max-width: 820px; margin: 0 auto;
}
.slide__meta { display: flex; align-items: center; gap: var(--space-2); color: var(--ink-soft); font-family: var(--font-ui); font-weight: 700; font-size: .95rem; }
.slide__title { margin: 0; font-size: calc(clamp(2rem, 9vw, 3.6rem) * var(--head-scale, 1)); line-height: 1.04; }
.slide__text { font-size: 1.15rem; max-width: 46ch; white-space: pre-line; }
.slide__timer { font-family: var(--font-ui); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.slide__timer.is-long { background: var(--marker); color: var(--marker-ink); padding: 0 6px; border-radius: 4px; }
.slide__actions {
  position: sticky; bottom: 0; z-index: 3; display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center;
  padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom));
  background: var(--bg); border-top: 1px solid var(--line);
}
.slide__stamp {
  position: absolute; top: var(--space-6); right: 6%; transform: rotate(-10deg);
  padding: 6px 14px; border: 4px solid var(--ok); border-radius: 10px; color: var(--ok);
  font-family: var(--font-ui); font-weight: 800; font-size: 1.4rem; letter-spacing: .12em; text-transform: uppercase;
}
@media (min-width: 900px) { .slide__text { font-size: 1.35rem; } }

/* ------------------------------------------------------------- add bar */
/* "+ Was ist zu tun?" – looks like an input, opens the form in a sheet. */
.addbar {
  display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 56px; padding: 0 var(--space-4);
  border-radius: var(--radius-lg); border: 2px dashed var(--field-border); background: var(--surface);
  color: var(--ink-soft); font-family: var(--font-ui); font-size: 1.02rem; font-weight: 700; text-align: left;
  text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.addbar__plus {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--accent-gradient); color: var(--accent-ink);
}
.addbar:hover { border-color: var(--accent); color: var(--ink); }

/* ------------------------------------------------------------ kpi strip */
/* A slim row of numbers ("Diese Woche · Diesen Monat · Insgesamt"). */
.kpi-strip { display: flex; gap: 2px; border-radius: var(--radius); overflow: hidden; background: var(--line); border: 1px solid var(--line); }
.kpi-strip__item { flex: 1; min-width: 0; padding: 8px 10px; background: var(--surface); text-align: center; }
.kpi-strip__value { display: block; font-family: var(--font-head); font-weight: var(--head-weight, 800); font-size: calc(1.35rem * var(--head-scale, 1)); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-strip__label { display: block; font-family: var(--font-ui); font-size: .74rem; font-weight: 700; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --------------------------------------------------------------- sticker */
/* Slanted badge, e.g. "Eilt", "Neu". --marker = highlighter, --ok = done. */
.sticker {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 8px;
  background: var(--accent-gradient); color: var(--accent-ink);
  font-family: var(--font-ui); font-size: .76rem; font-weight: 800; line-height: 1.5; letter-spacing: .02em;
  white-space: nowrap; transform: rotate(-4deg); box-shadow: var(--shadow);
}
.sticker--marker { background: var(--marker); color: var(--marker-ink); }
.sticker--ok { background: var(--ok); color: var(--ok-ink); }
.sticker--soft { background: var(--surface-2); color: var(--ink); box-shadow: none; }

/* ------------------------------------------------------------- Heute head */
.greeting { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-1) 0 var(--space-3); }
.greeting__text { flex: 1; min-width: 0; }
.greeting__text h1 { margin: 0; font-size: calc(clamp(1.45rem, 5.8vw, 1.95rem) * var(--head-scale, 1)); }
.greeting__text .eyebrow { margin: 0; }
/* Short phones (375 × 700, docs/DESIGN.md §3): Heute still fits one screen – a little less air,
   smaller story rings and flatter tiles. */
@media (max-width: 639px) and (max-height: 740px) {
  .greeting { margin: 0 0 var(--space-2); }
  .greeting .avatar--l { width: 48px; height: 48px; font-size: 1.15rem; }
  .stories-wrap { margin-bottom: var(--space-2); }
  .stories { padding-top: 2px; padding-bottom: 2px; }
  .story { width: 64px; gap: 2px; }
  .story__ring { width: 54px; height: 54px; }
  .story__inner { font-size: 1.05rem; }
  .tiles .tile { min-height: 92px; padding: 10px 12px; gap: 2px; }
  .tiles .tile--wide { min-height: 64px; }
  .tiles .tile__value { font-size: calc(1.85rem * var(--head-scale, 1)); }
}
.today-more { margin-top: var(--space-2); }
.today-more > * + * { margin-top: var(--space-3); }

/* -------------------------------------------- design picker (Konto, Mehr) */
.design-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.design-card {
  display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: calc(var(--radius) + 4px);
  border: 2px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
  font: inherit; text-align: left; min-width: 0;
}
.design-card[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.design-card__name { display: flex; align-items: center; gap: 4px; font-family: var(--font-ui); font-size: .84rem; font-weight: 800; padding: 0 4px 2px; }
.design-card__name .icon { width: 16px; height: 16px; }
.design-preview {
  display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: var(--radius);
  background: var(--bg); color: var(--ink); min-height: 112px; overflow: hidden; pointer-events: none;
}
.design-preview__title { font-family: var(--font-head); font-weight: var(--head-weight, 800); font-size: calc(1rem * var(--head-scale, 1)); letter-spacing: var(--head-tracking, 0); line-height: 1.05; }
.design-preview__row { display: flex; gap: 4px; }
.design-preview__tile {
  flex: 1; padding: 5px 6px; border-radius: calc(var(--radius) * .6); background: var(--surface); box-shadow: var(--shadow);
  font-family: var(--font-head); font-weight: var(--head-weight, 800); font-size: calc(1rem * var(--head-scale, 1)); line-height: 1;
}
.design-preview__tile small { display: block; font-family: var(--font-ui); font-size: .55rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 2px; }
.design-preview__tile--q { background: var(--q-sofort); color: var(--q-sofort-ink); }
.design-preview__btn { height: 16px; border-radius: 999px; background: var(--accent-gradient); }
.design-preview__ring { display: block; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-gradient); padding: 3px; flex: none; }
.design-preview__ring::after { content: ""; display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--surface); }
.swatches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.swatch {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 76px;
  padding: 8px 4px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; font-family: var(--font-ui); font-weight: 700; font-size: .85rem; line-height: 1.15; text-align: center;
}
.swatch[aria-pressed="true"] { border-color: var(--ink); }
.swatch__disc {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--bg); box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--font-head); font-weight: var(--head-weight, 800); font-size: calc(1rem * var(--head-scale, 1)); color: var(--ink);
}
.swatch__disc::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--accent-gradient); margin: -14px -14px 0 0; position: absolute; }
.swatch__disc { position: relative; }
/* Colour chips (Verwaltung → Person). */
.color-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: var(--space-2); }
.color-chips .chip-btn { justify-content: flex-start; padding-left: 10px; }

/* --------------------------------------------------------- component gallery */
.gallery-section { margin-top: var(--space-6); }
.gallery-section > h2 { font-size: calc(1.1rem * var(--head-scale, 1)); color: var(--ink-soft); }
.gallery-phone { border: 1px solid var(--line); border-radius: 28px; overflow: hidden; background: var(--bg); max-width: 400px; }
.gallery-phone .topbar, .gallery-phone .bottomnav { position: static; }
.gallery-phone .bottomnav { display: grid; }
.gallery-phone .page { padding-bottom: var(--space-4); }
/* The phone frame stays a phone at desktop width (the tile grid's media query sees the viewport). */
.gallery-phone .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.swatch-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.token-swatch { border-radius: var(--radius); padding: 8px; min-height: 56px; font-family: var(--font-ui); font-size: .72rem; font-weight: 700; border: 1px solid var(--line); }
