/* The app shell and the app boards' shared components (ISC-233; the boards
   App-*.dc.html approved by Olivier 2026-10-11). Loads after kuma.css, which
   holds the tokens, the fonts, tk-button, the flags and the press; this file
   adds only what the app has and the website does not. How a page adopts
   the shell: html/_app.html, design/README.md "App shell".

   Class names are the boards' own (ap-*, ob-*, st-*), so board markup drops
   in unchanged. Page-only CSS goes in static/app-<page>.css, not here. */

/* ── Frame. Phone: one column, the tab bar fixed at the bottom on the four
   tab screens. Desktop (960 px+): the side menu left, the page right. */
body.app { min-height: 100vh; }
.ap-main { box-sizing: border-box; display: flex; flex-direction: column; gap: 14px;
  width: 100%; max-width: 640px; margin: 0 auto; padding: 8px 24px 34px; min-width: 0; }
.ap-main > * { min-width: 0; }
body.app:has(> .ap-tabs) .ap-main { padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
/* The app draws this bar itself (Talkuma N): the page keeps its room, the
   app's one bar stays put from screen to screen (Olivier, 2026-10-12). */
.ap-tabs.native-bar { visibility: hidden; pointer-events: none; }
.ap-side { display: none; }
.kuma .beta-banner { margin: 0 -24px; }

/* Top bar of a sub-screen: the way back, in words. */
.ob-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; }
.ob-back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; min-width: 44px; padding: 0 4px;
  font-size: 17px; font-weight: 700; color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px;
  text-underline-offset: 4px; background: none; border: 0; font-family: inherit; cursor: pointer; white-space: nowrap; }

/* ── Phone tab bar. */
.ap-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-between; gap: 4px;
  /* The bar spans the screen; its four tabs keep 20 px from the edges and
     at most 420 px together (Olivier, 2026-10-11: "a bit too wide" on his
     527 px phone). */
  padding: 8px max(20px, calc((100% - 420px) / 2)) max(10px, env(safe-area-inset-bottom, 0px)); background: var(--surface);
  border-top: var(--stroke-2) solid var(--outline); }
.ap-tab { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 64px; min-height: 56px; padding: 2px 4px;
  color: var(--ink); text-decoration: none; font-size: 16px; font-weight: 700; }
.kuma .ap-tab:hover { color: var(--ink); }
.ap-tab .ic { display: flex; align-items: center; justify-content: center; width: 52px; height: 30px; border-radius: var(--radius-pill); }
.ap-tab svg { width: 22px; height: 22px; }
.ap-tab.on { font-weight: 800; }
.ap-tab.on .ic { background: var(--ink); color: var(--on-ink); }

/* ── Desktop side menu. */
.ap-side { flex-direction: column; gap: 6px; padding: 18px 16px 20px; background: var(--surface);
  border-right: var(--stroke-2) solid var(--outline); box-sizing: border-box; }
.ap-logo { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 10px; margin-bottom: 10px;
  font-family: var(--font-display); font-weight: 800; font-size: 21px; color: var(--ink); text-decoration: none; }
.ap-logo img { width: 32px; height: auto; }
.ap-link { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; border-radius: var(--radius-pill);
  color: var(--ink); text-decoration: none; font-size: 18px; font-weight: 700; }
.ap-link svg { width: 21px; height: 21px; flex: none; }
.ap-link.on, .kuma .ap-link.on:hover { background: var(--ink); color: var(--on-ink); font-weight: 800; }
.ap-side .sp { flex: 1; }
.ap-lang { display: grid; gap: 14px; padding: 0 6px; }
.ap-lang small { font-size: 16px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.ap-lang div { display: grid; grid-template-columns: 1fr 1fr; border: var(--stroke-2) solid var(--outline); border-radius: var(--radius-pill); }
.ap-lang a { position: relative; display: flex; align-items: center; justify-content: center; min-height: 44px;
  font-size: 16px; font-weight: 700; color: var(--ink); text-decoration: none; }
.ap-lang a:first-child { border-radius: var(--radius-pill) 0 0 var(--radius-pill); }
.ap-lang a:last-child { border-radius: 0 var(--radius-pill) var(--radius-pill) 0; }
.ap-lang a.on, .kuma .ap-lang a.on:hover { background: var(--ink); color: var(--on-ink); }
.ap-fb { display: flex; align-items: center; min-height: 44px; padding: 0 10px; font-size: 16px; font-weight: 700; color: var(--ink);
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.ap-me { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 10px; margin-top: 8px;
  border-top: var(--stroke-2) solid var(--surface-2); color: var(--ink); text-decoration: none; }
.ap-me .av { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--sun); border: var(--stroke-2) solid var(--outline); font-family: var(--font-display); font-weight: 800;
  font-size: 18px; color: var(--on-sun); }
.ap-me > span:last-child { min-width: 0; }
.ap-me b { display: block; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-me span span { font-size: 15px; font-weight: 600; }

@media (min-width: 960px) {
  /* The desktop app stays light (Olivier, 2026-10-11): the light tokens of
     kuma.css again, on body, so they win over a dark theme or system. */
  body.app {
    --paper: #f7f4ec; --surface: #ffffff; --surface-2: #f0e9dc;
    --ink: #1e1a16; --on-ink: #f7f4ec; --ink-muted: #5f665b; --outline: #1e1a16;
    --terra: #b4533a; --on-terra: #ffffff; --terra-soft: #f8ece7;
    --moss: #12705a; --on-moss: #ffffff;
    --sun: #f4c34a; --on-sun: #1e1a16; --mint: #d6ece5; --blush: #f2a58e;
    --focus: #1e1a16; --page-outline: var(--outline);
    --shadow-sticker: 3px 3px 0 #1e1a16; --shadow-button: 0 5px 0 #1e1a16; --shadow-card: 8px 10px 0 #1e1a16;
    color-scheme: light;
    display: grid; grid-template-columns: 256px minmax(0, 1fr); align-items: start;
  }
  html:has(body.app) { background: #f7f4ec; }
  /* The side menu is sticky (one screen high), so its white column and
     its outline are painted on body, down the whole page. */
  body.app { background: linear-gradient(to right, var(--surface) 254px, var(--outline) 254px 256px, var(--paper) 256px) var(--paper); }
  .ap-side { display: flex; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
  .ap-tabs { display: none; }
  body.app:has(> .ap-tabs) .ap-main { padding-bottom: 40px; }
  body.app .ap-main { max-width: none; margin: 0; padding: 12px 48px 40px; align-items: center; }
  body.app .ap-main > * { width: 100%; max-width: 560px; }
  body.app .ap-main > .ob-top { max-width: none; }
  body.app .ap-main > .st-wide, body.app .ap-main > .st-top { max-width: 960px; }
  .kuma .beta-banner { margin: 0; max-width: none; }
}

/* ── Page text. */
.st-h1 { margin: 0; font-family: var(--font-display); font-size: 30px; font-weight: 800; line-height: 1.08; }
.st-lead { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.45; }
.st-fine { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.45; }
.st-label { font-size: 17px; font-weight: 800; overflow-wrap: anywhere; }
.st-center { text-align: center; align-items: center; }

/* ── A section: an eyebrow, then a group of rows on one sticker card. */
.st-sec { display: grid; gap: 10px; }
.st-sec > h2 { margin: 6px 0 0; font-size: 16px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.st-group { display: flex; flex-direction: column; background: var(--surface); border: var(--stroke-2) solid var(--outline);
  border-radius: var(--radius-tile); box-shadow: var(--shadow-sticker); overflow: hidden; }
.st-group.flat { box-shadow: none; }
.st-row { box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%;
  min-height: 62px; margin: 0; padding: 12px 16px; border: 0; border-top: var(--stroke-2) solid var(--surface-2); background: none;
  color: var(--ink); font-family: var(--font-body); font-size: 18px; font-weight: 700; text-align: left; text-decoration: none; }
.st-group > .st-row:first-child { border-top: 0; }
.st-row.col { flex-direction: column; align-items: stretch; gap: 10px; }
.st-row .t { display: grid; gap: 3px; min-width: 0; }
.st-row .t b { font-size: 18px; font-weight: 800; }
.st-row .t span { font-size: 16px; font-weight: 600; line-height: 1.4; }
.st-row .go { flex: none; font-family: var(--font-display); font-size: 30px; font-weight: 800; }
.st-row .v { flex: none; font-size: 17px; font-weight: 700; }
a.st-row:hover { background: var(--paper); color: var(--ink); }

/* Read-only facts: labels in one fixed column, answers start left; stacked on a phone (#116). */
.st-dl { margin: 0; display: grid; }
.st-dl > div { display: grid; grid-template-columns: 12rem minmax(0, 1fr); align-items: baseline; gap: 14px; padding: 12px 16px;
  border-top: var(--stroke-2) solid var(--surface-2); }
.st-dl > div:first-child { border-top: 0; }
.st-dl dt { font-size: 17px; font-weight: 800; }
.st-dl dd { margin: 0; font-size: 16px; font-weight: 600; }
@media (max-width: 500px) { .st-dl > div { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

/* Notices: errors on terra-soft, everything else neutral. */
.st-msg { margin: 0; padding: 14px 16px; border: var(--stroke-2) solid var(--outline); border-radius: var(--radius-tile);
  background: var(--terra-soft); color: var(--ink); font-size: 17px; font-weight: 600; line-height: 1.4; }
.st-msg.ok { background: var(--surface-2); }
.st-msg b { display: block; font-weight: 800; }

/* Fields. */
.st-input { box-sizing: border-box; width: 100%; min-height: 52px; padding: 0 16px; border: var(--stroke-2) solid var(--outline);
  border-radius: var(--radius-tile); background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 18px; font-weight: 600; }
.st-input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.st-area { min-height: 150px; padding: 12px 16px; line-height: 1.45; }

/* The box with no undo (Konto löschen). */
.st-danger { display: grid; gap: 12px; padding: 20px; background: var(--surface); border: var(--stroke-2) solid var(--outline);
  border-radius: var(--radius-tile); box-shadow: var(--shadow-sticker); }
.st-danger h2 { margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 800; }
.st-danger .tk-button { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sticker); }

/* Small pills: a quiet second action, and the KI badge on every AI feature. */
.ob-pill { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 0 16px; border-radius: var(--radius-pill); border: var(--stroke-2) solid var(--outline); background: var(--surface);
  color: var(--ink); font-family: var(--font-body); font-size: 16px; font-weight: 700; box-shadow: var(--shadow-sticker);
  text-decoration: none; white-space: nowrap; cursor: pointer; }
.kuma a.ob-pill:hover { color: var(--ink); }
.ob-pill svg { width: 18px; height: 18px; }
.ob-ki { display: inline-flex; align-items: center; vertical-align: middle; margin-left: 6px; padding: 2px 8px;
  border-radius: var(--radius-pill); border: var(--stroke-2) solid var(--outline); background: var(--sun); color: var(--on-sun);
  font-family: var(--font-body); font-size: 16px; font-weight: 800; letter-spacing: .06em; line-height: 1.2; }
.ob-pill .ob-ki { margin-left: 0; }

/* Tags and key/value lines. */
.st-tag { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border-radius: var(--radius-pill);
  border: var(--stroke-2) solid transparent; background: var(--surface-2); font-size: 16px; font-weight: 800; white-space: nowrap; }
.st-tag.ink { background: var(--ink); color: var(--on-ink); border-color: var(--outline); }
.st-kv { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 17px; font-weight: 700; }
.st-kv span:last-child { font-weight: 800; white-space: nowrap; }

/* Two choices side by side, the current one filled in ink. */
.st-seg { display: grid; grid-template-columns: 1fr 1fr; border: var(--stroke-2) solid var(--outline); border-radius: var(--radius-pill);
  overflow: hidden; background: var(--surface); }
.st-seg button { min-height: 48px; padding: 0 10px; border: 0; background: none; color: var(--ink); font-family: var(--font-body);
  font-size: 17px; font-weight: 700; cursor: pointer; }
.st-seg button + button { border-left: var(--stroke-2) solid var(--outline); }
.st-seg button[aria-pressed=true] { background: var(--ink); color: var(--on-ink); }

/* Chips that choose: never cramped (24/22 px apart). */
.st-chips { display: flex; flex-wrap: wrap; gap: 24px 22px; }
.st-chip { min-height: 52px; padding: 0 20px; border: var(--stroke-2) solid var(--outline); border-radius: var(--radius-pill);
  background: var(--surface); box-shadow: var(--shadow-sticker); color: var(--ink); font-family: var(--font-body); font-size: 18px;
  font-weight: 700; cursor: pointer; }
.st-chip[aria-checked=true] { background: var(--ink); color: var(--on-ink); }

/* Questions that open (Hilfe). */
.st-qa { display: flex; flex-direction: column; background: var(--surface); border: var(--stroke-2) solid var(--outline);
  border-radius: var(--radius-tile); box-shadow: var(--shadow-sticker); overflow: hidden; }
.st-qa details { border-top: var(--stroke-2) solid var(--surface-2); }
.st-qa details:first-child { border-top: 0; }
.st-qa summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px;
  padding: 10px 16px; box-sizing: border-box; font-size: 18px; font-weight: 800; cursor: pointer; }
.st-qa summary::-webkit-details-marker { display: none; }
.st-qa summary::after { content: "+"; flex: none; font-family: var(--font-display); font-size: 26px; font-weight: 800; }
.st-qa details[open] summary::after { content: "–"; }
.st-qa details p { margin: 0; padding: 0 16px 16px; font-size: 17px; font-weight: 600; line-height: 1.45; }

/* Two columns on desktop (the wide sub-screens: Konto, Deine Daten). */
.st-cols { display: grid; gap: 18px; }
.st-cols > div { display: grid; gap: 18px; align-content: start; min-width: 0; }
@media (min-width: 960px) { .st-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; } }

/* Under the tab bar Chrome on Android paints its gesture bar in the page's
   ground colour (the root's background): cream under a white tab bar read
   as an extra border (Olivier, 2026-10-11). On a phone with the tab bar,
   the root is the tab bar's white; the page itself (body) stays cream. */
@media (max-width: 959px) {
  html:has(> body.app > nav.ap-tabs) { background: var(--surface); }
}
