/* Basis-Styles und Bausteine. Nur Tokens, keine Hex-Werte. Mobile first. */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100%;
  font-family: var(--la-font); font-size: var(--la-fs-15); line-height: 1.4;
  color: var(--la-ink); background: var(--la-surface-2);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--la-ink); }
#app { min-height: 100dvh; display: flex; flex-direction: column; }

/* Screens */
.la-screen {
  flex: 1; display: flex; flex-direction: column; width: 100%; max-width: 560px; margin: 0 auto;
  padding: var(--la-space-4);
  padding-top: calc(var(--la-space-4) + env(safe-area-inset-top));
  padding-bottom: calc(var(--la-space-4) + env(safe-area-inset-bottom));
}
.la-screen--center { justify-content: center; }
.la-screen__body { flex: 1; }

/* Kopfzeile */
.la-header {
  position: sticky; top: 0; z-index: var(--la-z-chrome);
  display: flex; align-items: center; justify-content: space-between; gap: var(--la-space-2);
  padding: var(--la-space-2) var(--la-space-4);
  padding-top: calc(var(--la-space-2) + env(safe-area-inset-top));
  background: var(--la-surface); border-bottom: 1px solid var(--la-line);
}
.la-header__actions { display: flex; gap: var(--la-space-1); }
.la-brand { font-weight: 600; font-size: var(--la-fs-15); letter-spacing: 0.01em; color: var(--la-ink); white-space: nowrap; }
.la-header__title { display: none; white-space: nowrap; }
@media (min-width: 420px) { .la-header__title { display: inline; } }
.la-header .la-row { min-width: 0; overflow: hidden; }
.la-brand em { font-style: normal; color: var(--la-signal); }
.la-brand--big { font-size: var(--la-fs-22); }

/* Text */
.la-title { font-size: var(--la-fs-28); line-height: 1.15; font-weight: 600; margin: 0 0 var(--la-space-2); }
.la-subtitle { font-size: var(--la-fs-18); font-weight: 600; margin: 0 0 var(--la-space-2); }
.la-lead { color: var(--la-ink-2); margin: 0 0 var(--la-space-5); }
.la-muted { color: var(--la-ink-3); font-size: var(--la-fs-13); }
.la-error { color: var(--la-alert); font-size: var(--la-fs-13); min-height: 1.3em; margin: 0; }
.la-big { font-family: var(--la-font-mono); font-size: var(--la-fs-38); font-weight: 600; letter-spacing: 0.04em; line-height: 1.1; }

/* Karten und Stapel */
.la-card { background: var(--la-surface); border: 1px solid var(--la-line); border-radius: var(--la-radius-12); padding: var(--la-space-4); }
.la-card + .la-card { margin-top: var(--la-space-3); }
.la-stack > * + * { margin-top: var(--la-space-3); }
.la-stack--tight > * + * { margin-top: var(--la-space-2); }
.la-row { display: flex; align-items: center; gap: var(--la-space-2); }
.la-row--between { justify-content: space-between; }

/* Formulare */
.la-field label { display: block; font-size: var(--la-fs-13); color: var(--la-ink-2); margin-bottom: var(--la-space-1); }
.la-input {
  width: 100%; min-height: var(--la-touch); padding: 0 var(--la-space-3);
  font-size: var(--la-fs-18); background: var(--la-surface);
  border: 1px solid var(--la-line); border-radius: var(--la-radius-8);
}
.la-input:focus { outline: 2px solid var(--la-signal); outline-offset: 0; border-color: var(--la-signal); }

/* Buttons, mindestens 48 px */
.la-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--la-space-2);
  width: 100%; min-height: var(--la-touch); padding: 0 var(--la-space-5);
  font-size: var(--la-fs-18); font-weight: 600; text-decoration: none; cursor: pointer; user-select: none;
  border: 1px solid transparent; border-radius: var(--la-radius-pill);
  -webkit-tap-highlight-color: transparent; white-space: nowrap;
}
.la-btn--primary { background: var(--la-signal); color: var(--la-on-signal); }
.la-btn--primary:active { filter: brightness(0.92); }
.la-btn--secondary { background: var(--la-surface); color: var(--la-ink); border-color: var(--la-ink); }
.la-btn--secondary:active { background: var(--la-surface-2); }
.la-btn--ghost { background: transparent; color: var(--la-ink-2); }
.la-btn--ghost:active { background: var(--la-surface-2); }
.la-btn--inline { width: auto; }
.la-btn--small { min-height: 40px; font-size: var(--la-fs-15); padding: 0 var(--la-space-4); }
.la-btn[disabled] { opacity: 0.5; cursor: default; }
.la-btn:focus-visible { outline: 2px solid var(--la-signal); outline-offset: 2px; }

/* Kopierfelder */
.la-copy { display: flex; align-items: center; gap: var(--la-space-2); }
.la-copy__value {
  flex: 1; min-width: 0; padding: var(--la-space-3);
  background: var(--la-surface-3); border: 1px dashed var(--la-line); border-radius: var(--la-radius-8);
  font-family: var(--la-font-mono); font-size: var(--la-fs-15); word-break: break-all; color: var(--la-ink);
}
.la-copy__value--big { font-size: var(--la-fs-22); font-weight: 600; letter-spacing: 0.06em; text-align: center; word-break: normal; white-space: nowrap; overflow-x: auto; }

/* Tabs */
.la-tabs { display: flex; gap: var(--la-space-1); padding: var(--la-space-1); background: var(--la-surface-2); border-radius: var(--la-radius-pill); }
.la-tab { flex: 1; min-height: 40px; border: 0; border-radius: var(--la-radius-pill); background: transparent; font-weight: 600; color: var(--la-ink-2); cursor: pointer; }
.la-tab[aria-selected="true"] { background: var(--la-surface); color: var(--la-ink); box-shadow: var(--la-shadow-1); }

/* Listen */
.la-steps { margin: 0; padding-left: 1.3em; }
.la-steps li { margin: var(--la-space-2) 0; }
.la-steps li::marker { color: var(--la-signal); font-weight: 600; }
.la-kv { display: grid; grid-template-columns: 1fr auto; gap: var(--la-space-1) var(--la-space-3); margin: 0; }
.la-kv dt { color: var(--la-ink-2); }
.la-kv dd { margin: 0; font-weight: 600; text-align: right; }

/* Status */
.la-status { display: inline-flex; align-items: center; gap: var(--la-space-2); font-size: var(--la-fs-13); font-weight: 600; color: var(--la-ink-2); }
.la-status::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--la-ink-3); flex: none; }
.la-status--ok { color: var(--la-ok); } .la-status--ok::before { background: var(--la-ok); }
.la-status--warn { color: var(--la-warn); } .la-status--warn::before { background: var(--la-warn); }
.la-status--alert { color: var(--la-alert); } .la-status--alert::before { background: var(--la-alert); }

/* Toast */
.la-toast {
  position: fixed; left: 50%; bottom: calc(var(--la-space-6) + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: var(--la-z-toast); max-width: calc(100vw - 2 * var(--la-space-4));
  padding: var(--la-space-3) var(--la-space-4);
  background: var(--la-anthracite); color: var(--la-ink-inverse);
  border-radius: var(--la-radius-pill); box-shadow: var(--la-shadow-2); font-size: var(--la-fs-15);
}

/* Fußzeile mit Version */
.la-footer { text-align: center; color: var(--la-ink-3); font-size: var(--la-fs-12); padding: var(--la-space-4) 0 0; }

/* Sheets */
.la-sheet { position: fixed; inset: 0; z-index: var(--la-z-sheet); background: var(--la-scrim); display: flex; align-items: flex-end; }
.la-sheet__panel {
  width: 100%; max-width: 560px; margin: 0 auto; max-height: 85dvh; overflow: auto;
  background: var(--la-surface); border-radius: var(--la-radius-12) var(--la-radius-12) 0 0;
  padding: var(--la-space-3) var(--la-space-4) calc(var(--la-space-4) + env(safe-area-inset-bottom));
  box-shadow: var(--la-shadow-2);
}
.la-sheet__panel > * + * { margin-top: var(--la-space-3); }
.la-sheet__row { display: flex; align-items: center; justify-content: space-between; gap: var(--la-space-3); min-height: var(--la-touch); cursor: pointer; }

/* Schalter */
.la-switch { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; border-radius: var(--la-radius-pill); background: var(--la-line); position: relative; flex: none; cursor: pointer; margin: 0; transition: background 0.15s; }
.la-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--la-surface); box-shadow: var(--la-shadow-1); transition: transform 0.15s; }
.la-switch:checked { background: var(--la-signal); }
.la-switch:checked::after { transform: translateX(20px); }
.la-switch:focus-visible { outline: 2px solid var(--la-signal); outline-offset: 2px; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Icons */
.la-icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em; }
.la-btn .la-icon { width: 22px; height: 22px; }
.la-btn--icon { width: var(--la-touch); min-width: var(--la-touch); padding: 0; }
.la-btn--icon .la-icon { width: 24px; height: 24px; }

/* POI-Marker: Anthrazit mit Orange-Ring */
.la-marker {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--la-anthracite); color: var(--la-ink-inverse);
  box-shadow: 0 0 0 3px var(--la-signal), var(--la-shadow-1);
}
.la-marker .la-icon { width: 18px; height: 18px; }
.la-marker__qty {
  position: absolute; top: -6px; right: -8px; min-width: 20px; padding: 0 5px;
  border-radius: var(--la-radius-pill); background: var(--la-signal); color: var(--la-on-signal);
  font-size: var(--la-fs-12); font-weight: 700; line-height: 20px; text-align: center;
}

/* Hinweis "Zum Home-Bildschirm" */
.la-installhint {
  display: flex; align-items: center; gap: var(--la-space-2);
  padding: var(--la-space-2) var(--la-space-3);
  background: var(--la-signal-soft); color: var(--la-ink); border-top: 1px solid var(--la-line);
  font-size: var(--la-fs-13);
}
.la-installhint > .la-icon { color: var(--la-signal); flex: none; }
.la-installhint__text { flex: 1; }
