/* Design "papier" – Papier & Marker (docs/DESIGN.md §1).
   Bullet journal: paper white with a dot grid, ballpoint blue as the pen, highlighter strokes
   for the four fields and for what is urgent, notes with a strip of tape and a tiny tilt.
   Dark: "Tafel" – deep green board (= theme-color of core/design.py), chalk-white writing,
   pastel chalk highlights.
   Headings: Caveat 700 (handwritten, set large), body stays Atkinson Hyperlegible.
   Token contract: see the head of pop.css. Contrast: core/tests/test_design.py (WCAG AA).

   Besides the shared tokens this file uses a few private helpers (prefix --pp-, defined in the
   token blocks so light and dark stay in one place):
     --pp-pen       colour of handwritten headings (ballpoint blue / chalk)
     --pp-chalk     the soft edge of chalk writing (dark only, a text-shadow)
     --pp-note      lighter paper on a yellow sticky note (what sits on the highlighter)
     --pp-tape      the translucent tape strip on notes
     --pp-hl-*      highlighter strokes (yellow = --marker, pink, blue, green) and --pp-hl-ink,
                    the text colour on them
     --pp-smudge    chalk dust on the board (dark only, an image layer)
   Static motion only: the tilt of the notes is a fixed angle; straightening on hover/touch is a
   transition, which hausbuch.css switches off for prefers-reduced-motion.
   Everything below the token blocks is scoped to [data-design="papier"], so the live preview
   cards of the other designs (Konto, "Mehr") are never touched. */

/* @light */
[data-design="papier"] {
  color-scheme: light;
  --bg: #FBFAF4;
  --surface: #FFFFFF;
  --surface-2: #F1EFE6;
  --ink: #1D2550;
  --ink-soft: #545A72;
  --line: #DAD6C8;
  --field-border: #7B7E90;
  --accent: #2443B0;
  --accent-ink: #FFFFFF;
  --accent-soft: #E3E9FB;
  --accent-gradient: linear-gradient(135deg, #2A4BBE 0%, #1F3B9F 100%);
  --marker: #FFEA5C;
  --marker-ink: #1D2550;
  --ok: #2B7350;
  --ok-ink: #FFFFFF;
  --ok-soft: #DCEFE1;
  --danger: #B3261E;
  --danger-ink: #FFFFFF;
  --danger-soft: #F9DEDB;
  --q-sofort: #FFE1EB;
  --q-sofort-ink: #8A1542;
  --q-planen: #DDEDFF;
  --q-planen-ink: #16467E;
  --q-schnell: #FFF4B5;
  --q-schnell-ink: #5A4500;
  --q-spaeter: #E0F4D6;
  --q-spaeter-ink: #255A1E;
  --radius: 6px;
  --radius-lg: 8px;
  --shadow: 0 1px 1px rgba(29, 37, 80, .07), 1px 3px 0 rgba(29, 37, 80, .05), 0 8px 16px -10px rgba(29, 37, 80, .28);
  --shadow-lg: 0 16px 36px rgba(29, 37, 80, .22);
  --font-head: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --font-ui: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tile-gap: 14px;
  --focus: #2443B0;
  --head-scale: 1.45;
  --head-weight: 700;
  --head-tracking: 0;
  --backdrop: rgba(29, 37, 80, .42);
  --dots: rgba(29, 37, 80, .17);
  --pp-pen: #2443B0;
  --pp-chalk: none;
  --pp-note: #FFF7C4;
  --pp-tape: rgba(214, 196, 150, .55);
  --pp-hl-ink: #1D2550;
  --pp-hl-pink: #FFA6CA;
  --pp-hl-blue: #A6D4FF;
  --pp-hl-green: #ADEB95;
  --pp-smudge: linear-gradient(transparent, transparent);
}

/* @dark */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"])[data-design="papier"],
  :root:not([data-theme="light"]) [data-design="papier"] {
    color-scheme: dark;
    --bg: #1D3A2F;
    --surface: #234235;
    --surface-2: #2A4B3D;
    --ink: #EEF1EA;
    --ink-soft: #B7C6BC;
    --line: #3D6050;
    --field-border: #93AE9F;
    --accent: #A2CDF2;
    --accent-ink: #0D2132;
    --accent-soft: #284A5E;
    --accent-gradient: linear-gradient(135deg, #AED4F4 0%, #94C3EC 100%);
    --marker: #F4E28A;
    --marker-ink: #18221D;
    --ok: #A3DCB1;
    --ok-ink: #0F2618;
    --ok-soft: #2B5541;
    --danger: #FFB2A5;
    --danger-ink: #2E0C06;
    --danger-soft: #55322F;
    --q-sofort: #4A2E3E;
    --q-sofort-ink: #FFC6D8;
    --q-planen: #22405A;
    --q-planen-ink: #BEDDFA;
    --q-schnell: #4F4323;
    --q-schnell-ink: #F6E7A0;
    --q-spaeter: #3A5A2C;
    --q-spaeter-ink: #D3F0BF;
    --shadow: 0 1px 0 rgba(0, 0, 0, .18), 0 8px 18px -8px rgba(0, 0, 0, .5);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, .5);
    --focus: #F4E28A;
    --backdrop: rgba(8, 20, 15, .62);
    --dots: rgba(238, 241, 234, .1);
    --pp-pen: #EEF1EA;
    --pp-chalk: 0 0 1px rgba(238, 241, 234, .5), 0 0 12px rgba(238, 241, 234, .14);
    --pp-note: #FAF2C8;
    --pp-tape: rgba(238, 241, 234, .2);
    --pp-hl-ink: #18221D;
    --pp-hl-pink: #F2B1C8;
    --pp-hl-blue: #AED4F4;
    --pp-hl-green: #BCE5AE;
    --pp-smudge: radial-gradient(ellipse 70% 40% at 18% 12%, rgba(238, 241, 234, .045), transparent 70%), radial-gradient(ellipse 60% 45% at 88% 70%, rgba(238, 241, 234, .035), transparent 70%);
  }
}
:root[data-theme="dark"][data-design="papier"],
:root[data-theme="dark"] [data-design="papier"] {
  color-scheme: dark;
  --bg: #1D3A2F;
  --surface: #234235;
  --surface-2: #2A4B3D;
  --ink: #EEF1EA;
  --ink-soft: #B7C6BC;
  --line: #3D6050;
  --field-border: #93AE9F;
  --accent: #A2CDF2;
  --accent-ink: #0D2132;
  --accent-soft: #284A5E;
  --accent-gradient: linear-gradient(135deg, #AED4F4 0%, #94C3EC 100%);
  --marker: #F4E28A;
  --marker-ink: #18221D;
  --ok: #A3DCB1;
  --ok-ink: #0F2618;
  --ok-soft: #2B5541;
  --danger: #FFB2A5;
  --danger-ink: #2E0C06;
  --danger-soft: #55322F;
  --q-sofort: #4A2E3E;
  --q-sofort-ink: #FFC6D8;
  --q-planen: #22405A;
  --q-planen-ink: #BEDDFA;
  --q-schnell: #4F4323;
  --q-schnell-ink: #F6E7A0;
  --q-spaeter: #3A5A2C;
  --q-spaeter-ink: #D3F0BF;
  --shadow: 0 1px 0 rgba(0, 0, 0, .18), 0 8px 18px -8px rgba(0, 0, 0, .5);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, .5);
  --focus: #F4E28A;
  --backdrop: rgba(8, 20, 15, .62);
  --dots: rgba(238, 241, 234, .1);
  --pp-pen: #EEF1EA;
  --pp-chalk: 0 0 1px rgba(238, 241, 234, .5), 0 0 12px rgba(238, 241, 234, .14);
  --pp-note: #FAF2C8;
  --pp-tape: rgba(238, 241, 234, .2);
  --pp-hl-ink: #18221D;
  --pp-hl-pink: #F2B1C8;
  --pp-hl-blue: #AED4F4;
  --pp-hl-green: #BCE5AE;
  --pp-smudge: radial-gradient(ellipse 70% 40% at 18% 12%, rgba(238, 241, 234, .045), transparent 70%), radial-gradient(ellipse 60% 45% at 88% 70%, rgba(238, 241, 234, .035), transparent 70%);
}

/* ========================================================= papier specifics */

/* ------------------------------------------------------------------- paper */
/* The dot grid of a bullet journal (5 mm ≈ 20 px); on the board it is chalk dust. */
:root[data-design="papier"] body,
[data-design="papier"] .gallery-phone,
.design-preview[data-design="papier"],
.swatch__disc[data-design="papier"] {
  background-image: radial-gradient(circle, var(--dots) 1.15px, transparent 1.5px), var(--pp-smudge);
  background-size: 20px 20px, 100% 100%;
  background-position: 10px 10px, 0 0;
}
.design-preview[data-design="papier"],
.swatch__disc[data-design="papier"] { background-size: 10px 10px, 100% 100%; background-position: 5px 5px, 0 0; }

/* Surfaces that carry the highlighter or the pen colour: their handwriting follows the text
   (and loses the chalk edge, which only belongs on the board). */
[data-design="papier"] :is(.card--urgent, .notice--urgent, .message--warning, .list-item--urgent, .tile--urgent,
  .tile--accent, .toast, .badge--urgent, .sticker--marker, .counter-toggle[aria-pressed="true"]) {
  --pp-pen: currentColor; --pp-chalk: none;
}
/* A yellow sticky note is light in both modes: whatever sits on it (the to-dos of "Zuteilen",
   chips, fields, buttons) is lighter paper in marker ink – never the dark board. */
[data-design="papier"] :is(.card--urgent, .notice--urgent, .message--warning, .tile--urgent) {
  --surface: var(--pp-note);
  --surface-2: color-mix(in srgb, var(--marker-ink) 10%, var(--marker));
  --bg: var(--marker);
  --field-border: color-mix(in srgb, var(--marker-ink) 65%, var(--marker));
}

/* -------------------------------------------------------------- headings */
/* Caveat is handwriting: written with the pen (ballpoint blue / chalk). Headings that modules
   set in the body font (to-do, topic and rule titles) stay in ink. Kept weak on purpose (only the
   :not() counts), so every component rule that sets a heading colour wins. */
:where([data-design="papier"]) :where(h1, h2, h3, .h1, .h2, .h3, .card__title):not(.todo__title, .team-topic__title,
  .rule__title, .hall-card__title, .quest__title, .zuteilen__title, .quad__title, .stories-head__title) {
  color: var(--pp-pen); text-shadow: var(--pp-chalk);
}
/* Big handwritten numbers and words get the same chalk edge on the board. */
[data-design="papier"] :is(.brand, .tile__value, .kpi__value, .kpi-strip__value, .quad__count, .slide__title,
  .counter-btn__label, .empty strong, .quest-finale__title, .notes-new__label, .visitors-hero__number,
  .visitors-card__number, .theke-total__number, .theke-total__label, .theke-head__clock) {
  text-shadow: var(--pp-chalk);
}
/* Module titles set in Caveat at a fixed size: handwriting needs a little more room. */
[data-design="papier"] :is(.notes__title, .notiz-dialog__title) { font-size: 1.85rem; line-height: 1.1; }
[data-design="papier"] .hall__week {
  font-family: var(--font-head); font-weight: 700; font-size: 1.75rem; letter-spacing: 0; color: var(--pp-pen);
}
/* The page title is underlined by hand (static/img/designs/papier/underline.svg as a mask, so
   the stroke takes the token colour in light and dark). */
[data-design="papier"] .page-header h1,
[data-design="papier"] .greeting__text h1,
[data-design="papier"] .sheet__title {
  position: relative; padding-bottom: .2em;
}
[data-design="papier"] .page-header h1::after,
[data-design="papier"] .greeting__text h1::after,
[data-design="papier"] .sheet__title::after {
  content: ""; position: absolute; left: -.04em; bottom: -.02em; width: min(100%, 3.3em); height: .3em;
  background: var(--pp-pen); opacity: .85; pointer-events: none;
  -webkit-mask: url("../../img/designs/papier/underline.0b548f46c285.svg") no-repeat 0 0 / 100% 100%;
  mask: url("../../img/designs/papier/underline.0b548f46c285.svg") no-repeat 0 0 / 100% 100%;
}
[data-design="papier"] .sheet__title { padding-bottom: .25em; }
[data-design="papier"] .eyebrow { letter-spacing: .01em; }
[data-design="papier"] .section__title { margin-bottom: var(--space-2); }

/* ------------------------------------------------------------------ chrome */
[data-design="papier"] .topbar { border-bottom: 1.5px solid var(--line); }
[data-design="papier"] .brand { font-size: calc(1.36rem * var(--head-scale, 1)); color: var(--pp-pen); }
/* The logo: an "h" circled with the pen. */
[data-design="papier"] .brand__mark {
  background: transparent; color: var(--pp-pen); border: 2.5px solid currentColor;
  border-radius: 54% 46% 51% 49% / 47% 55% 45% 53%; transform: rotate(-6deg);
  font-family: var(--font-head); font-weight: 700; font-size: 1.55rem; line-height: 1; padding-bottom: 3px;
}
[data-design="papier"] .brand--big { font-size: calc(2.2rem * var(--head-scale, 1)); }
[data-design="papier"] .brand--big .brand__mark { font-size: 2.4rem; border-width: 3px; }
[data-design="papier"] .bottomnav { border-top: 1.5px solid var(--line); }
/* The current place is marked with a stroke of the blue highlighter. */
[data-design="papier"] .bottomnav a[aria-current="page"] .icon {
  background: var(--pp-hl-blue); color: var(--pp-hl-ink);
  border-radius: 46% 54% 42% 58% / 58% 44% 56% 42%;
}
@media (min-width: 900px) {
  [data-design="papier"] .topnav a { border-radius: 8px 12px 9px 13px / 12px 8px 13px 9px; }
  [data-design="papier"] .topnav a[aria-current="page"] { background: var(--pp-hl-blue); color: var(--pp-hl-ink); }
}
/* Quick capture: a round sticker drawn in ink. */
[data-design="papier"] .quick-capture__btn {
  border-radius: 52% 48% 50% 50% / 47% 53% 47% 53%;
  box-shadow: 2px 3px 0 var(--accent), var(--shadow-lg);
}
/* Toasts: a dark note; the undo button is a piece of paper on it. */
[data-design="papier"] .toast { border-radius: 10px 14px 10px 16px / 14px 10px 16px 10px; }
[data-design="papier"] .toast__undo { background: var(--bg); color: var(--ink); }
[data-design="papier"] :is(.toast__undo, .toast__link) { border-radius: 12px 18px 13px 20px / 18px 12px 20px 13px; }

/* ------------------------------------------------------------------- sheet */
[data-design="papier"] .sheet { border-radius: 14px 14px 0 0; }
/* The handle is a strip of tape that holds the page. */
[data-design="papier"] .sheet__handle { height: 30px; }
[data-design="papier"] .sheet__handle::before {
  width: 76px; height: 20px; border-radius: 0; background: var(--pp-tape); transform: rotate(-1.5deg);
  clip-path: polygon(0 4%, 100% 0, 96% 25%, 100% 50%, 96% 75%, 100% 100%, 0 96%, 4% 72%, 0 48%, 4% 24%);
}
[data-design="papier"] .sheet__close { border-radius: 52% 48% 55% 45% / 47% 55% 45% 53%; }
@media (min-width: 900px) {
  [data-design="papier"] dialog.sheet { border-radius: var(--radius-lg); }
  [data-design="papier"] .sheet__handle { height: 18px; }
  [data-design="papier"] .sheet__handle::before { display: block; height: 16px; margin-top: -6px; }
}

/* ------------------------------------------------------- notes with tape */
/* Tiles, the four fields and small numbers are notes stuck on the page: a tiny tilt (±1°) that
   straightens when touched. Tiles and cards hold with a strip of tape, the four fields are
   sticky notes (no tape). Big cards with forms stay upright. */
[data-design="papier"] :is(.tile, .quad, .kpi, .hall-card, .counter-btn, .card) { --pp-tilt: 0deg; }
[data-design="papier"] .tile,
[data-design="papier"] .quad {
  position: relative; overflow: visible; border-radius: 3px 3px 5px 4px;
  transform: rotate(var(--pp-tilt)); transition: transform .15s ease, box-shadow .15s ease;
}
[data-design="papier"] .tiles > :nth-child(4n+1 of .tile) { --pp-tilt: -.9deg; }
[data-design="papier"] .tiles > :nth-child(4n+2 of .tile) { --pp-tilt: .8deg; }
[data-design="papier"] .tiles > :nth-child(4n+3 of .tile) { --pp-tilt: .6deg; }
[data-design="papier"] .tiles > :nth-child(4n of .tile) { --pp-tilt: -.7deg; }
[data-design="papier"] .tiles > .tile.tile--wide { --pp-tilt: -.35deg; }
[data-design="papier"] .matrix-mini > .quad:nth-child(4n+1) { --pp-tilt: -.8deg; }
[data-design="papier"] .matrix-mini > .quad:nth-child(4n+2) { --pp-tilt: .7deg; }
[data-design="papier"] .matrix-mini > .quad:nth-child(4n+3) { --pp-tilt: .5deg; }
[data-design="papier"] .matrix-mini > .quad:nth-child(4n) { --pp-tilt: -.6deg; }
/* Wide notes (laptop, beamer) tilt less – the same angle moves their corners further. */
@media (min-width: 640px) {
  [data-design="papier"] .matrix-mini > .quad,
  [data-design="papier"] .counter-grid > .counter-btn { transform: rotate(calc(var(--pp-tilt) * .5)); }
}
[data-design="papier"] a.tile:focus-visible,
[data-design="papier"] a.quad:focus-visible { transform: none; box-shadow: var(--shadow-lg); }
@media (hover: hover) {
  [data-design="papier"] a.tile:hover,
  [data-design="papier"] a.quad:hover { transform: none; box-shadow: var(--shadow-lg); }
}
[data-design="papier"] a.tile:active, [data-design="papier"] a.quad:active { transform: rotate(0deg) scale(.98); }
/* The tape strip (pure CSS, jagged ends). */
[data-design="papier"] :is(.tile, .hall-card)::before,
[data-design="papier"] .card:not(.card--flat, .empty, .sheet .card, .card .card, .gallery-phone .card, li.card, li > .card, .card + .card)::before {
  content: ""; position: absolute; z-index: 2; top: -9px; left: 50%; width: 58px; height: 18px; margin-left: -29px;
  background: var(--pp-tape); transform: rotate(-2.5deg); pointer-events: none;
  clip-path: polygon(0 4%, 100% 0, 96% 25%, 100% 50%, 96% 75%, 100% 100%, 0 96%, 4% 72%, 0 48%, 4% 24%);
}
[data-design="papier"] .tiles > :nth-child(even of .tile)::before { left: 62%; transform: rotate(3deg); }
[data-design="papier"] .tiles > :nth-child(3n of .tile)::before { left: 34%; transform: rotate(-4deg); }
[data-design="papier"] .tiles > .tile.tile--wide::before { left: 18%; transform: rotate(-2deg); }

/* ------------------------------------------------------------------- cards */
[data-design="papier"] .card { position: relative; border-radius: 4px 6px 5px 4px; }
[data-design="papier"] .card--urgent { box-shadow: var(--shadow); }   /* a yellow sticky note */
[data-design="papier"] .kpi { border-radius: 3px 4px 4px 3px; transform: rotate(var(--pp-tilt)); }
[data-design="papier"] .kpis > .kpi:nth-child(odd) { --pp-tilt: -.6deg; }
[data-design="papier"] .kpis > .kpi:nth-child(even) { --pp-tilt: .5deg; }
[data-design="papier"] .kpi__value,
[data-design="papier"] .kpi-strip__value { color: var(--pp-pen); }
/* The number strip is one paper slip, the columns divided by dotted rules. */
[data-design="papier"] .kpi-strip { gap: 0; background: var(--surface); border-radius: 3px 5px 4px 3px; box-shadow: var(--shadow); }
[data-design="papier"] .kpi-strip__item + .kpi-strip__item { border-left: 2px dotted var(--line); }
[data-design="papier"] .empty strong {
  display: block; font-family: var(--font-head); font-weight: 700; font-size: 1.55rem; line-height: 1.15; color: var(--pp-pen);
}
/* Ruled lists: a row of dots instead of a hard line. */
[data-design="papier"] .list > li,
[data-design="papier"] .chatlist > li + li .chat { border-top: 2px dotted var(--line); }
[data-design="papier"] .list > li:first-child { border-top: 0; }

/* ------------------------------------------------------------ highlighter */
/* A highlighter stroke: slightly uneven ends, a little lower than the cap height. */
[data-design="papier"] :is(.badge--urgent, .todo__due--urgent, .slide__timer.is-long, .todo__open) {
  background: linear-gradient(176deg, transparent 0 9%, var(--marker) 9% 88%, transparent 88%);
  border-radius: 3px 10px 4px 12px / 9px 4px 12px 3px; padding-left: 8px; padding-right: 9px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
[data-design="papier"] .list-item--urgent,
[data-design="papier"] .notice--urgent,
[data-design="papier"] .message--warning { border-radius: 4px 12px 5px 14px / 12px 5px 14px 4px; }

/* -------------------------------------------------------------- story bar */
/* Rings drawn by hand: a thin pen line, a little uneven; the next quest is highlighted. */
[data-design="papier"] .story__ring {
  padding: 2.5px; border-radius: 51% 49% 47% 53% / 48% 53% 47% 52%;
  background: conic-gradient(var(--accent) calc(var(--progress) * 360deg), var(--field-border) 0);
}
[data-design="papier"] .story__inner {
  border-radius: 49% 51% 52% 48% / 52% 47% 53% 48%; border-width: 3px;
  font-family: var(--font-head); font-weight: 700; font-size: 1.75rem; color: var(--ink-soft);
}
[data-design="papier"] .story--done .story__ring,
[data-design="papier"] .story--next .story__ring { background: var(--accent); }
[data-design="papier"] .story--done .story__inner { color: var(--pp-pen); }
[data-design="papier"] .story--next .story__inner { background: var(--pp-hl-blue); color: var(--pp-hl-ink); }
[data-design="papier"] .stories > li:nth-child(odd) .story__ring { transform: rotate(-4deg); }
[data-design="papier"] .stories > li:nth-child(even) .story__ring { transform: rotate(5deg); }

/* ------------------------------------------------------------------- tiles */
[data-design="papier"] .tile { border-color: color-mix(in srgb, var(--line) 70%, transparent); }
/* Phones: Heute's overview fits one screen and ends above the quick-capture button
   (docs/DESIGN.md §3) – the notes sit a little closer. */
@media (max-width: 639px) {
  [data-design="papier"] .tiles { --tile-gap: 11px; }
  [data-design="papier"] .tile { padding: 10px 14px 11px; gap: 2px; }
  [data-design="papier"] .stories-wrap { margin-bottom: var(--space-2); }
}
@media (max-width: 639px) and (max-height: 740px) {
  [data-design="papier"] .tile { padding: 10px 12px; gap: 2px; }
  [data-design="papier"] .tile__preview { -webkit-line-clamp: 1; line-clamp: 1; }
}
[data-design="papier"] .tile__value { color: var(--pp-pen); font-size: calc(2.15rem * var(--head-scale, 1)); line-height: .9; }
[data-design="papier"] .tile__value--text { font-size: calc(1.25rem * var(--head-scale, 1)); line-height: 1; }
[data-design="papier"] .tile--accent { background: var(--accent-gradient); }
[data-design="papier"] .tile--accent .tile__value,
[data-design="papier"] .tile--urgent .tile__value { color: inherit; }

/* ---------------------------------------------------------- compact matrix */
/* The four fields are sticky notes in highlighter colours; the title gets a marker stroke,
   the first to-dos are handwritten bullet points (•). */
[data-design="papier"] .quad { border: 0; padding: 14px 12px 12px; box-shadow: var(--shadow); }
[data-design="papier"] .quad--sofort { --pp-hl: var(--pp-hl-pink); }
[data-design="papier"] .quad--planen { --pp-hl: var(--pp-hl-blue); }
[data-design="papier"] .quad--schnell { --pp-hl: var(--marker); }
[data-design="papier"] .quad--spaeter { --pp-hl: var(--pp-hl-green); }
[data-design="papier"] .quad__head { align-items: flex-start; }
[data-design="papier"] .quad__title {
  align-self: flex-start; color: var(--pp-hl-ink); font-size: .92rem; padding: 1px 6px; margin-left: -4px;
  background: linear-gradient(177deg, transparent 0 8%, var(--pp-hl, var(--marker)) 8% 90%, transparent 90%);
  border-radius: 3px 9px 4px 11px / 9px 4px 11px 3px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
[data-design="papier"] .quad__count { color: var(--q-ink); font-size: calc(1.8rem * var(--head-scale, 1)); line-height: .8; }
[data-design="papier"] .quad__list { gap: 2px; }
[data-design="papier"] .quad__item {
  background: transparent; padding: 2px 0 2px 1.05em; border-radius: 0; position: relative; color: var(--ink);
}
[data-design="papier"] .quad__item::before {
  content: "•"; position: absolute; left: .15em; top: 1px; font-weight: 700; color: var(--q-ink);
}
/* A line that starts with an avatar: the avatar is the bullet. */
[data-design="papier"] .quad__item--avatar { padding-left: 2px; }
[data-design="papier"] .quad__item--avatar::before { content: none; }
[data-design="papier"] .quad__more { color: var(--q-ink); }

/* -------------------------------------------------------------- chat list */
[data-design="papier"] .chat__title { color: var(--ink); }
[data-design="papier"] .chat__dot { background: var(--accent); border-radius: 50% 45% 55% 48% / 52% 50% 48% 50%; }

/* ---------------------------------------------------------- three-up grid */
/* Ruhmeshalle: stamped index cards, each a little crooked. */
[data-design="papier"] .grid3 { gap: 6px; }
[data-design="papier"] .gridcell {
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--person, var(--field-border)) 45%, transparent), var(--shadow);
}
[data-design="papier"] .grid3 > :nth-child(3n+1) { transform: rotate(-.8deg); }
[data-design="papier"] .grid3 > :nth-child(3n+2) { transform: rotate(.6deg); }
[data-design="papier"] .grid3 > :nth-child(3n) { transform: rotate(-.4deg); }
[data-design="papier"] .gridcell__stamp { border-radius: 3px; border-style: double; border-width: 3px; }

/* ----------------------------------------------------------- meeting mode */
[data-design="papier"] .slide__title { color: var(--pp-pen); line-height: .98; }
[data-design="papier"] .slides__bar { height: 3px; background: var(--line); }
[data-design="papier"] .slides__bar > span { background: var(--accent); }
[data-design="papier"] .slide__actions,
[data-design="papier"] .slides__progress { background: var(--bg); }
[data-design="papier"] .slide__actions { border-top: 1.5px solid var(--line); }
[data-design="papier"] .slide__stamp { border-style: double; border-width: 5px; border-radius: 4px; }

/* -------------------------------------------------------- tablet counter */
[data-design="papier"] .counter-btn { border-radius: 4px 5px 4px 6px; border-color: var(--line); transform: rotate(var(--pp-tilt)); }
[data-design="papier"] .counter-grid > .counter-btn:nth-child(4n+1) { --pp-tilt: -.5deg; }
[data-design="papier"] .counter-grid > .counter-btn:nth-child(4n+2) { --pp-tilt: .45deg; }
[data-design="papier"] .counter-grid > .counter-btn:nth-child(4n+3) { --pp-tilt: .35deg; }
[data-design="papier"] .counter-grid > .counter-btn:nth-child(4n) { --pp-tilt: -.4deg; }
[data-design="papier"] .counter-btn:active { transform: rotate(0deg) scale(.97); }
[data-design="papier"] .counter-btn__label { color: var(--pp-pen); font-size: calc(1.85rem * var(--head-scale, 1)); }
[data-design="papier"] .counter-btn.is-bumped .counter-btn__label { color: var(--ink); }
[data-design="papier"] .counter-toggle { border-radius: 6px 10px 7px 12px / 10px 7px 12px 6px; }
/* The age buttons are index cards held by tape – at the Theke as well (logbuch/theke.html). */
[data-design="papier"] .counter-btn::before {
  content: ""; position: absolute; z-index: 2; top: -9px; left: 50%; width: 58px; height: 18px; margin-left: -29px;
  background: var(--pp-tape); transform: rotate(-2.5deg); pointer-events: none;
  clip-path: polygon(0 4%, 100% 0, 96% 25%, 100% 50%, 96% 75%, 100% 100%, 0 96%, 4% 72%, 0 48%, 4% 24%);
}
[data-design="papier"] .counter-grid > .counter-btn:nth-child(even)::before { left: 60%; transform: rotate(3deg); }
[data-design="papier"] .theke-btn { border-width: 2px; }
[data-design="papier"] .theke-head__title { font-size: calc(clamp(1.5rem, 4.5vw, 2.4rem) * var(--head-scale, 1)); }
[data-design="papier"] .theke-head__clock { font-size: calc(clamp(1.6rem, 4.5vw, 2.4rem) * var(--head-scale, 1)); color: var(--pp-pen); }
[data-design="papier"] .theke-total__label { font-size: calc(clamp(1.6rem, 5vw, 3rem) * 1.25); color: var(--pp-pen); }

/* -------------------------------------------------- forms, chips, segments */
[data-design="papier"] :is(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) { border-radius: 4px; }
[data-design="papier"] .chip-btn { border-radius: 10px 14px 11px 15px / 14px 10px 15px 11px; }
[data-design="papier"] .segmented,
[data-design="papier"] .chips--segment { border-radius: 12px 16px 12px 17px / 16px 12px 17px 12px; }
[data-design="papier"] .segmented > .chip-btn,
[data-design="papier"] .chips--segment > .chip-btn { border-radius: 9px 12px 9px 13px / 12px 9px 13px 9px; }
[data-design="papier"] .tabs a { border-radius: 10px 14px 11px 15px / 14px 10px 15px 11px; }
[data-design="papier"] fieldset { border-style: dashed; }

/* ------------------------------------------------- buttons, badges, stickers */
/* Buttons are boxes drawn with the pen; the main action is filled with ballpoint ink. */
[data-design="papier"] .btn { border-radius: 6px 11px 7px 12px / 11px 7px 12px 6px; }
[data-design="papier"] .btn--primary { box-shadow: 2px 3px 0 var(--ink); }
[data-design="papier"] .btn--primary:active { box-shadow: 1px 1px 0 var(--ink); transform: translate(1px, 2px); }
[data-design="papier"] .btn--outline { border-color: var(--ink); }
[data-design="papier"] .badge { border-radius: 6px 10px 7px 11px / 10px 7px 11px 6px; }
/* Stickers are rubber stamps; "Neu"/"Eilt" in highlighter, "Erledigt" stamped in green. */
[data-design="papier"] .sticker {
  background: transparent; color: var(--accent); border: 2px solid currentColor; box-shadow: none;
  border-radius: 3px; transform: rotate(-6deg); text-transform: uppercase; letter-spacing: .08em; font-size: .72rem;
}
[data-design="papier"] .sticker--marker {
  background: var(--marker); color: var(--marker-ink); border-color: transparent;
  border-radius: 3px 9px 4px 10px / 9px 4px 10px 3px;
}
[data-design="papier"] .sticker--ok { color: var(--ok); border-style: double; border-width: 3px; }
[data-design="papier"] .sticker--soft { color: var(--ink-soft); border-style: dashed; }

/* ----------------------------------------------------------------- avatars */
/* Initials written by hand in the personal colour, a little uneven circle. */
[data-design="papier"] .avatar {
  font-family: var(--font-head); font-weight: 700; font-size: 1.4rem; text-transform: none;
  border-radius: 51% 49% 48% 52% / 49% 52% 48% 51%;
}
[data-design="papier"] .avatar--s { font-size: 1.12rem; }
[data-design="papier"] .avatar--l { font-size: 2.05rem; }
[data-design="papier"] .avatar--empty { border-style: dashed; }

/* ------------------------------------------------ design picker (own card) */
.design-preview[data-design="papier"] .design-preview__tile { border-radius: 2px; }
.design-preview[data-design="papier"] .design-preview__row > .design-preview__tile:first-child { transform: rotate(-2deg); }
.design-preview[data-design="papier"] .design-preview__row > .design-preview__tile:last-child { transform: rotate(1.5deg); }
.design-preview[data-design="papier"] .design-preview__ring { background: var(--accent); padding: 2px; }
.design-preview[data-design="papier"] .design-preview__title { color: var(--pp-pen); font-size: 1.45rem; }
.design-preview[data-design="papier"] .design-preview__btn { border-radius: 4px; box-shadow: 1px 2px 0 var(--ink); }

/* -------------------------------------------- module pages (existing markup) */
/* To-dos: index cards; the check is a hand-drawn circle; field titles get their highlighter. */
[data-design="papier"] .todo { background: var(--surface); border-radius: 4px 6px 5px 4px; box-shadow: var(--shadow); }
[data-design="papier"] .todo--done { background: var(--ok-soft); }
[data-design="papier"] .todo__check,
[data-design="papier"] .quest__mark { border-radius: 52% 48% 50% 50% / 47% 53% 47% 53%; }
[data-design="papier"] .todo__stamp,
[data-design="papier"] .hall-card__stamp { font-family: var(--font-ui); font-size: 1rem; border-style: double; border-width: 4px; }
[data-design="papier"] .quadrant { position: relative; border-radius: 4px 6px 5px 4px; border-top-width: 1px; border-top-color: var(--line); }
[data-design="papier"] .quadrant--sofort { --pp-hl: var(--pp-hl-pink); }
[data-design="papier"] .quadrant--planen { --pp-hl: var(--pp-hl-blue); }
[data-design="papier"] .quadrant--schnell { --pp-hl: var(--marker); }
[data-design="papier"] .quadrant--spaeter { --pp-hl: var(--pp-hl-green); }
[data-design="papier"] .quadrant__title {
  align-self: flex-start; width: fit-content; color: var(--pp-hl-ink); padding: 0 8px; margin-left: -6px;
  font-size: 1.7rem; text-shadow: none;
  background: linear-gradient(177deg, transparent 0 10%, var(--pp-hl, var(--marker)) 10% 88%, transparent 88%);
  border-radius: 4px 12px 5px 14px / 12px 5px 14px 4px;
}
[data-design="papier"] .quadrant__count { background: transparent; color: var(--pp-hl-ink); border: 2px solid currentColor; border-radius: 52% 48% 50% 50% / 47% 53% 47% 53%; }
[data-design="papier"] .hall-card { overflow: visible; border-radius: 3px 5px 4px 3px; transform: rotate(var(--pp-tilt)); }
[data-design="papier"] .hall-wall > li:nth-child(odd) .hall-card { --pp-tilt: -.6deg; }
[data-design="papier"] .hall-wall > li:nth-child(even) .hall-card { --pp-tilt: .5deg; }
/* Handwriting is never set in capitals; rubber stamps (effects too) use the plain capitals. */
[data-design="papier"] :is(.notes-new__label, .theke-total__label, .visitors-hero__label, .fx-hello__title,
  .fx-finale__title, .duty-table__group th) {
  text-transform: none; letter-spacing: 0;
}
[data-design="papier"] .fx-hello__title { font-size: 2rem; }
[data-design="papier"] .fx-finale__title { font-size: calc(clamp(2.2rem, 10vw, 3.6rem) * 1.12); }
[data-design="papier"] .fx-stamp { font-family: var(--font-ui); font-size: clamp(1.7rem, 8vw, 2.3rem); border-radius: 6px; }
[data-design="papier"] .notes-new__label { font-family: var(--font-head); font-weight: 700; font-size: 2.1rem; line-height: 1; color: var(--pp-pen); }
[data-design="papier"] .visitors-hero__number,
[data-design="papier"] .theke-total__number,
[data-design="papier"] .visitors-card__number { color: var(--pp-pen); }
[data-design="papier"] .team-topic__decision { box-shadow: none; border-left: 3px solid var(--ok); border-radius: 2px 8px 8px 2px; }

/* ------------------------------------------------------------------- print */
/* Paper stays paper: no dots, no tilt, no tape (motion: see the head of this file). */
@media print {
  :root[data-design="papier"] body { background-image: none; }
  [data-design="papier"] :is(.tile, .quad, .kpi, .gridcell, .hall-card, .counter-btn) { transform: none !important; }
  [data-design="papier"] :is(.tile, .hall-card, .card, .counter-btn)::before { display: none; }
}
