/* ==========================================================================
   app-base.css – Grundlage aller App-Seiten („Das Kontor“)
   Setzt auf tokens.css + base.css + app-tokens.css auf.

   Seiten-Schalter (am <html>):
     class="a-app"            alle App-Seiten (ACP, Buchen, Zimmer, Konto)
     class="a-app a-acp"      ACP: Arbeitsschrift 14 px, kompakte Felder (forms-ext.css)
     data-theme="abend"       Abendmodus (app-tokens.css §10)
     data-density="kompakt"   dichter (nur feiner Zeiger)

   Inhalt
     1  Grund & Körnung          html.a-app · html.a-acp body
     2  Schrift                  .a-title · .a-h2 · .a-h3 · .a-h4 · .a-eyebrow · .a-lead · .a-text
                                 .a-meta · .a-muted · .a-num · .a-figure · .a-voice · .a-kbd · .a-mono
                                 .a-link · .a-dateline
     3  Raster                   .a-page · .a-grid · .a-grid--kpi · .a-split · .a-spacer · .a-rule
     4  Karte                    .a-card (+ __head __title __sub __actions __body __foot; --flush --linen
                                 --sunken --quiet --attn --due --ok --link)
     5  Werteliste               .a-dl (+ --rows --stacked) · .a-list (Zeilen mit Aktion)
     6  Monogramm                .a-avatar (+ --sm --lg --xl; data-tone 1–5) · .a-avatar-stack · .a-person
     7  Hilfen                   .a-hide-mobile · .a-only-mobile · .a-truncate · .a-nowrap · .a-right
     8  Stilblatt-Zustände       .is-hover · .is-focus · .is-active (nur zum Vorführen)
   ========================================================================== */

/* ---- 1 · Grund & Körnung --------------------------------------------------------- */
html.a-app {
  --grain-opacity: var(--a-grain);
  background-color: var(--a-canvas);
  scroll-padding-top: calc(var(--a-topbar-h) + var(--s-4));
}
html.a-app body {
  background-color: var(--a-canvas);
  color: var(--fg);
}
html.a-acp body {
  font-size: var(--a-fs-base);
  line-height: var(--a-lh-ui);
}
.a-app :where(table, time, data, .a-num, output) { font-variant-numeric: tabular-nums lining-nums; }
/* Roving-Tabindex sichtbar halten: base.css (Startseite) blendet bei [tabindex="-1"]:focus den Ring aus –
   gedacht für Überschriften, die der Router fokussiert. Bedienelemente, die per Pfeiltaste den Fokus
   bekommen (Segmente, Reiter, Menüpunkte, Kalendertage …), tragen tabindex="-1" und brauchen ihn aber.
   Nur die Kontur, die Abstände (outline-offset) der Bausteine bleiben. */
/* Spezifität bewusst niedrig (0,2,0 – wie die Regel in base.css, steht aber später): Bausteine mit eigenem Fokus-Ring
   (Kalendertage, Kartenpins: outline: none + box-shadow) behalten ihn, ohne doppelten Rahmen */
:where(.a-app) :where(a, button, input, select, textarea, summary, [role="radio"], [role="tab"], [role="menuitem"], [role="menuitemradio"], [role="menuitemcheckbox"], [role="option"], [role="gridcell"], [role="switch"], [role="checkbox"], [role="treeitem"], [role="slider"])[tabindex="-1"]:focus-visible { outline: 2px solid var(--focus); }
.a-app :where(h1, h2, h3, h4) { line-height: var(--a-lh-tight); }

/* ---- 2 · Schrift -------------------------------------------------------------------
   Fraunces nur für Seitentitel, Abschnittstitel (xl) und große Zahlen. */
.a-title {
  --wght: 360;
  --soft: 30;
  --wonk: 0;
  font-family: var(--font-display);
  font-weight: var(--wght);
  font-variation-settings: "SOFT" var(--soft), "WONK" var(--wonk);
  font-size: var(--a-fs-3xl);
  line-height: 1.05;
  letter-spacing: -.02em;
  color: var(--fg);
  text-wrap: balance;
}
.a-title em, .a-h2 em {
  --wght: 330;
  --soft: 100;
  --wonk: 1;
  font-style: italic;
  font-weight: var(--wght);
  font-variation-settings: "SOFT" var(--soft), "WONK" var(--wonk);
  color: var(--accent);
}
.a-h2 {
  --wght: 400;
  --soft: 30;
  font-family: var(--font-display);
  font-weight: var(--wght);
  font-variation-settings: "SOFT" var(--soft), "WONK" 0;
  font-size: var(--a-fs-xl);
  line-height: 1.2;
  letter-spacing: -.01em;
}
.a-h3 {
  font-family: var(--font-sans);
  font-size: var(--a-fs-lg);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.003em;
}
.a-h4 {
  font-family: var(--font-sans);
  font-size: var(--a-fs-base);
  font-weight: 600;
  line-height: 1.35;
}
.a-eyebrow {
  font-family: var(--font-sans);
  font-size: var(--a-fs-xs);
  font-weight: 600;
  font-stretch: 85%;
  font-variation-settings: "wdth" 85;
  letter-spacing: var(--a-track-caps);
  text-transform: uppercase;
  line-height: 1.3;
  color: var(--fg-2);
}
.a-eyebrow--accent { color: var(--eyebrow); }
.a-lead {
  font-size: var(--a-fs-md);
  line-height: var(--a-lh-text);
  color: var(--fg-2);
  max-width: 64ch;
  text-wrap: pretty;
}
.a-text { font-size: var(--a-fs-md); line-height: var(--a-lh-text); max-width: 68ch; }
.a-meta {
  font-size: var(--a-fs-xs);
  line-height: 1.4;
  color: var(--a-fg-3);
  font-variant-numeric: tabular-nums lining-nums;
}
.a-muted { color: var(--fg-2); }
.a-num { font-variant-numeric: tabular-nums lining-nums; }
.a-strong { font-weight: 600; color: var(--fg); }

/* Große Zahl: Fraunces mit Mediävalziffern (proportional – nie tabellarisch) */
.a-figure {
  --wght: 380;
  --soft: 40;
  font-family: var(--font-display);
  font-weight: var(--wght);
  font-variation-settings: "SOFT" var(--soft), "WONK" 0;
  font-variant-numeric: oldstyle-nums proportional-nums;
  font-size: var(--a-fs-figure);
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--fg);
}
.a-figure--hero { font-size: var(--a-fs-hero); --wght: 340; letter-spacing: -.03em; }
.a-figure--md { font-size: var(--a-fs-2xl); letter-spacing: -.01em; }
.a-figure--sm { font-size: var(--a-fs-xl); letter-spacing: -.005em; }
/* Einheit IN der großen Zahl: <span class="a-figure">46<span class="a-figure__unit">%</span></span>
   Nebenzahl daneben: <span class="a-figure__of">von 8 Zimmern</span> */
.a-figure__unit {
  font-size: .52em;
  letter-spacing: 0;
  color: var(--fg-2);
  margin-left: .08em;
}
.a-figure__of {
  font-family: var(--font-sans);
  font-size: var(--a-fs-base);
  font-weight: 500;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0;
  color: var(--fg-2);
  margin-left: .35em;
}

/* Gastgeberstimme (kursiv) – Leerzustände, Unterschriften, freundliche Hinweise */
.a-voice {
  --wght: 360;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: var(--wght);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  letter-spacing: 0;
}

/* Taste: Strg · K · g b · / · Esc */
.a-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.45em;
  height: 1.45em;
  padding: 0 .35em;
  border: 1px solid var(--a-line-2);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--a-surface);
  color: var(--fg-2);
  font-family: var(--font-sans);
  font-size: var(--a-fs-2xs);
  font-weight: 600;
  line-height: 1;
  letter-spacing: .02em;
  white-space: nowrap;
  vertical-align: .08em;
}
.a-kbd + .a-kbd { margin-left: .2em; }
.a-mono { font-family: var(--a-font-mono); font-size: .92em; letter-spacing: 0; }

/* Textlink in der Arbeitsfläche: ruhig, Unterstreichung in Krapp beim Hover */
.a-link {
  color: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 30%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  transition: text-decoration-color var(--d-1) var(--ease-out), color var(--d-1) var(--ease-out);
}
.a-link:hover, .a-link.is-hover { text-decoration-color: var(--faden); text-decoration-thickness: 1.5px; }
.a-link--accent { color: var(--accent); }
.a-link--quiet { text-decoration: none; }
.a-link--quiet:hover { text-decoration: underline; }
/* Touch: Textlinks bekommen eine unsichtbar vergrößerte Zielfläche (≥ 44 px hoch),
   ohne den Zeilenfall im Satz zu verändern */
@media (pointer: coarse) {
  .a-link { position: relative; }
  .a-link::after { content: ""; position: absolute; inset: max(-12px, calc((44px - 100%) / -2)) -4px; }
}

/* Datumszeile wie eine Zeitung: „Dienstag, 6. Oktober · 12 °C, bedeckt · Sonnenaufgang 7:41“ */
.a-dateline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .9rem;
  padding-block: .55rem;
  border-block: 1px solid var(--a-line-2);
  box-shadow: inset 0 3px 0 -2px var(--a-line-2);   /* Doppellinie oben wie ein Zeitungskopf */
  font-size: var(--a-fs-sm);
  color: var(--fg-2);
}
.a-dateline > * { display: inline-flex; align-items: center; gap: .4em; }
.a-dateline > * + *::before {
  content: "";
  width: 3px;
  height: 3px;
  margin-right: .5rem;
  border-radius: 50%;
  background: var(--a-line-3);
}
.a-dateline__day { color: var(--fg); font-weight: 600; }
.a-dateline__end { margin-left: auto; }
.a-dateline__end::before { display: none; }

/* ---- 3 · Raster --------------------------------------------------------------------- */
.a-page {
  width: 100%;
  max-width: calc(var(--a-content-max) + 2 * var(--a-gutter));
  margin-inline: auto;
  padding: var(--a-pad-5) var(--a-gutter) var(--a-pad-6);
}
.a-section + .a-section { margin-top: var(--a-pad-6); }
.a-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem 1rem;
  margin-bottom: var(--a-pad-3);
}
.a-section__head > .a-section__actions { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
.a-grid {
  display: grid;
  gap: var(--a-gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--a-min, 17rem)), 1fr));
  align-items: start;
}
.a-grid--stretch { align-items: stretch; }
.a-grid--kpi {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
}
@media (max-width: 1199.98px) { .a-grid--kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 519.98px) { .a-grid--kpi { grid-template-columns: minmax(0, 1fr); } }
.a-split {
  display: grid;
  gap: var(--a-gap);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
@media (min-width: 1100px) {
  .a-split { grid-template-columns: minmax(0, 1fr) minmax(18rem, var(--a-aside, 22rem)); }
  .a-split--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .a-split--aside-left { grid-template-columns: minmax(16rem, var(--a-aside, 16rem)) minmax(0, 1fr); }
}
.a-spacer { flex: 1 1 auto; }
.a-rule { height: 0; border: 0; border-top: 1px solid var(--a-line-2); margin-block: var(--a-pad-3); }
.a-rule--double { border-top: 3px double var(--a-line-3); }   /* Hauptbuch: Summenlinie */

/* ---- 4 · Karte -----------------------------------------------------------------------
   Papier auf Molke mit Haarlinie – wie ein Blatt im Hauptbuch. */
.a-card {
  --a-card-pad: var(--a-pad-4);
  position: relative;
  min-width: 0;
  padding: var(--a-card-pad);
  border-radius: var(--a-r-card);
  background-color: var(--a-surface);
  box-shadow: var(--a-shadow-1);
}
.a-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .75rem;
  margin-bottom: var(--a-pad-3);
  min-height: 2rem;
}
.a-card__titles { display: grid; gap: .15rem; min-width: 0; flex: 1 1 12rem; }
.a-card__title {
  font-size: var(--a-fs-md);
  font-weight: 600;
  line-height: 1.3;
  color: var(--fg);
}
.a-card__title .a-badge { margin-left: .35rem; vertical-align: .1em; }
.a-card__sub { font-size: var(--a-fs-sm); color: var(--fg-2); line-height: 1.4; }
.a-card__actions { display: flex; align-items: center; gap: .35rem; margin-left: auto; }
.a-card__body > * + * { margin-top: var(--a-pad-2); }
.a-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
  margin: var(--a-pad-3) calc(-1 * var(--a-card-pad)) calc(-1 * var(--a-card-pad));
  padding: .7rem var(--a-card-pad);
  border-top: 1px solid var(--a-line);
  font-size: var(--a-fs-sm);
  color: var(--fg-2);
}
.a-card__foot > :last-child:not(:first-child) { margin-left: auto; }
/* Varianten */
.a-card--flush { --a-card-pad: 0; overflow: hidden; }
.a-card--flush > .a-card__head { padding: var(--a-pad-3) var(--a-pad-4) 0; }
.a-card--flush > .a-card__foot { margin: 0; padding-inline: var(--a-pad-4); }
.a-card--tight { --a-card-pad: var(--a-pad-3); }
.a-card--linen {
  background-color: var(--a-surface-2);
  background-image: var(--a-twill);
  box-shadow: inset 0 0 0 1px var(--a-line);
}
.a-card--sunken { background-color: transparent; box-shadow: inset 0 0 0 1px var(--a-line-2); }
.a-card--quiet { background-color: transparent; box-shadow: none; padding: 0; }
/* Statuskante: ein Faden links in der Statusfarbe (nie die einzige Information) */
.a-card--attn, .a-card--due, .a-card--ok, .a-card--info { box-shadow: var(--a-shadow-1), inset 3px 0 0 var(--a-card-edge); }
.a-card--attn { --a-card-edge: var(--a-attn); }
.a-card--due { --a-card-edge: var(--a-due-fill); }
.a-card--ok { --a-card-edge: var(--a-ok-fill); }
.a-card--info { --a-card-edge: var(--a-info-fill); }
/* Ganze Karte klickbar: <a class="a-card a-card--link"> */
.a-card--link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: box-shadow var(--d-2) var(--ease-out), transform var(--d-2) var(--ease-out);
}
@media (hover: hover) {
  .a-card--link:hover { box-shadow: var(--a-shadow-2); transform: translateY(-1px); }
}
.a-card--link.is-hover { box-shadow: var(--a-shadow-2); transform: translateY(-1px); }
.a-card--link:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* ---- 5 · Werteliste (Schubfach, Profil, Zusammenfassung) ----------------------------- */
.a-dl {
  display: grid;
  grid-template-columns: minmax(7rem, max-content) minmax(0, 1fr);
  gap: .55rem 1.25rem;
  font-size: var(--a-fs-base);
  line-height: 1.4;
}
.a-dl > dt { color: var(--fg-2); }
.a-dl > dd { margin: 0; color: var(--fg); min-width: 0; overflow-wrap: anywhere; }
.a-dl > dd.a-num, .a-dl__num { text-align: right; font-variant-numeric: tabular-nums lining-nums; }
/* Zeilen mit Haarlinie (Zahlungsbuch, Rechnung) */
.a-dl--rows { gap: 0; }
.a-dl--rows > dt, .a-dl--rows > dd { padding-block: .6rem; border-bottom: 1px solid var(--a-line); }
.a-dl--rows > dd { padding-left: 1.25rem; }
.a-dl--rows > dt:last-of-type, .a-dl--rows > dd:last-of-type { border-bottom: 0; }
/* Summe: Doppellinie wie im Hauptbuch; die Zeile davor verliert ihre Haarlinie */
.a-dl--rows > dd:has(+ dt.a-dl__total), .a-dl--rows > dt:has(+ dd + dt.a-dl__total) { border-bottom: 0; }
.a-dl__total { font-weight: 600; color: var(--fg) !important; border-top: 3px double var(--a-line-3); }
/* Untereinander (schmale Spalten, mobil) */
.a-dl--stacked { grid-template-columns: minmax(0, 1fr); gap: .15rem; }
.a-dl--stacked > dd + dt { margin-top: .6rem; }
@media (max-width: 479.98px) {
  .a-dl:not(.a-dl--rows) { grid-template-columns: minmax(0, 1fr); gap: .15rem; }
  .a-dl:not(.a-dl--rows) > dd + dt { margin-top: .6rem; }
}

/* ---- 5b · Liste mit Zeilen (Zu erledigen, Anreisen, Aufgaben) ------------------------
   <ul class="a-list" role="list"><li class="a-list__item">
     <span class="a-list__lead">…Icon/Monogramm/Uhrzeit…</span>
     <span class="a-list__main"><span class="a-list__title">…</span><span class="a-list__sub">…</span></span>
     <span class="a-list__end">…Pille/Knopf…</span></li></ul>
   data-tone="attn|due|ok" am Eintrag setzt eine Statuskante links (nie die einzige Information). */
.a-list { display: grid; margin: 0; padding: 0; list-style: none; }
.a-list__item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: .85rem;
  min-height: 3.25rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--a-line);
}
.a-list__item:last-child { border-bottom: 0; }
.a-list__item[data-tone]::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--a-card-pad, 1.25rem));
  top: .6rem;
  bottom: .6rem;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--a-li-c, var(--a-line-3));
}
.a-list__item[data-tone="attn"] { --a-li-c: var(--a-attn-fill); }
.a-list__item[data-tone="due"] { --a-li-c: var(--a-due-fill); }
.a-list__item[data-tone="ok"] { --a-li-c: var(--a-ok-fill); }
.a-list__lead { display: inline-grid; place-items: center; min-width: 2rem; color: var(--fg-2); }
.a-list__lead .a-ico { width: 1.125rem; height: 1.125rem; }
.a-list__time { font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums lining-nums; font-size: var(--a-fs-base); }
.a-list__main { display: grid; gap: .1rem; min-width: 0; }
.a-list__title { font-weight: 600; color: var(--fg); line-height: 1.3; }
.a-list__sub { font-size: var(--a-fs-sm); color: var(--fg-2); line-height: 1.4; }
.a-list__end { display: flex; align-items: center; gap: .4rem; justify-content: flex-end; }
a.a-list__item { color: inherit; text-decoration: none; }
@media (hover: hover) { a.a-list__item:hover .a-list__title { text-decoration: underline; text-decoration-color: var(--faden); text-underline-offset: .2em; } }
@media (max-width: 479.98px) {
  .a-list__item { grid-template-columns: auto minmax(0, 1fr); row-gap: .4rem; }
  .a-list__end { grid-column: 2; justify-content: flex-start; }
}

/* ---- 6 · Monogramm --------------------------------------------------------------------
   Kreis aus Stoff mit Stichnaht, Initialen in Fraunces kursiv. Gäste Ton 1 (Leinen),
   Team Töne 2–5. Nie Fotos von Fremden – Monogramm genügt. */
.a-avatar {
  --a-av-size: 2rem;
  --a-av-bg: var(--a-av-1);
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--a-av-size);
  height: var(--a-av-size);
  border-radius: 50%;
  background: var(--a-av-bg);
  color: var(--a-av-fg);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 450;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-size: calc(var(--a-av-size) * .42);
  line-height: 1;
  letter-spacing: -.02em;
  text-transform: none;
  user-select: none;
}
.a-avatar::after {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px dashed rgb(35 31 28 / .2);
  border-radius: 50%;
  pointer-events: none;
}
[data-theme="abend"] .a-avatar::after { border-color: rgb(245 239 228 / .22); }
.a-avatar[data-tone="2"] { --a-av-bg: var(--a-av-2); }
.a-avatar[data-tone="3"] { --a-av-bg: var(--a-av-3); }
.a-avatar[data-tone="4"] { --a-av-bg: var(--a-av-4); }
.a-avatar[data-tone="5"] { --a-av-bg: var(--a-av-5); }
.a-avatar--sm { --a-av-size: 1.5rem; }
.a-avatar--sm::after { inset: 1.5px; }
.a-avatar--lg { --a-av-size: 2.75rem; }
.a-avatar--xl { --a-av-size: 4rem; }
.a-avatar--xl::after { inset: 3px; }
/* Anwesenheit/Status am Monogramm */
.a-avatar__dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: .625rem;
  height: .625rem;
  border-radius: 50%;
  background: var(--a-ok-fill);
  box-shadow: 0 0 0 2px var(--a-surface);
}
.a-avatar-stack { display: inline-flex; align-items: center; }
.a-avatar-stack > .a-avatar { box-shadow: 0 0 0 2px var(--a-surface); }
.a-avatar-stack > .a-avatar + .a-avatar { margin-left: -.45rem; }
/* Person: Monogramm + Name + Nebenzeile */
.a-person { display: inline-flex; align-items: center; gap: .65rem; min-width: 0; }
.a-person__text { display: grid; min-width: 0; line-height: 1.3; }
.a-person__name { font-weight: 600; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-person__sub { font-size: var(--a-fs-sm); color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- 7 · Hilfen ----------------------------------------------------------------------- */
.a-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.a-nowrap { white-space: nowrap; }
.a-right { text-align: right; }
.a-center { text-align: center; }
.a-gap-s { --cluster-gap: .5rem; --stack-gap: .5rem; }
.a-gap-l { --cluster-gap: 1.5rem; --stack-gap: 1.5rem; }
@media (max-width: 767.98px) { .a-hide-mobile { display: none !important; } }
@media (min-width: 768px) { .a-only-mobile { display: none !important; } }
/* Zeit mit genauer Uhrzeit beim Darüberfahren: <time class="a-time" datetime="…" title="Di, 6. Okt. 2026, 9:41 Uhr">vor 4 Min.</time> */
.a-time { white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; text-decoration: underline dotted transparent; text-underline-offset: .2em; cursor: default; }
.a-time[title]:hover { text-decoration-color: currentColor; }

/* ---- 8 · Stilblatt-Zustände (nur zum statischen Vorführen von Hover/Fokus) ------------- */
.is-focus { outline: 2px solid var(--focus); outline-offset: 3px; }

@media (forced-colors: active) {
  .a-card { border: 1px solid CanvasText; }
  .a-avatar { border: 1px solid CanvasText; }
}
