/* ==========================================================================
   BehaViewer Design System v3 — Apple HIG × BehaViewer-Brand
   Safiro · Violett #742BFF · Mint #77FFB2 · Ink #2D3745 · Dunkel #1F242B
   ========================================================================== */

@font-face { font-family: 'Safiro'; src: url('/assets/fonts/safiro-regular.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Safiro'; src: url('/assets/fonts/safiro-medium.ttf') format('truetype');
  font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Safiro'; src: url('/assets/fonts/safiro-semibold.ttf') format('truetype');
  font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Safiro'; src: url('/assets/fonts/safiro-bold.ttf') format('truetype');
  font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --font: 'Safiro', -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  /* Brand */
  --brand-violet: #742BFF;
  --brand-mint: #77FFB2;
  --brand-ink: #2D3745;
  --brand-dark: #1F242B;
  --brand-peach: #FFBC7D;

  /* Systemfarben (Semantik) */
  --blue: #007AFF; --green: #1FB35F; --red: #FF3B30; --orange: #FF9500;
  --yellow: #FFCC00; --teal: #30B0C7; --indigo: #5856D6; --purple: #742BFF;
  --pink: #FF2D55; --gray: #8E8E93;

  --bg: #F4F4F6;
  --bg-secondary: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --fill: rgba(45,55,69,.20);
  --fill-secondary: rgba(45,55,69,.14);
  --fill-tertiary: rgba(45,55,69,.09);
  --fill-quaternary: rgba(45,55,69,.06);

  --label: var(--brand-ink);
  --label-secondary: rgba(45,55,69,.62);
  --label-tertiary: rgba(45,55,69,.32);
  --separator: rgba(45,55,69,.12);
  --separator-strong: rgba(45,55,69,.24);

  --tint: var(--brand-violet);
  --mint-text: #0B7A43;        /* lesbares Mint-Grün auf hellem Grund */
  --shadow-1: 0 1px 2px rgba(0,0,0,.04), 0 2px 12px rgba(0,0,0,.04);
  --shadow-2: 0 2px 8px rgba(0,0,0,.08), 0 8px 32px rgba(0,0,0,.10);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;

  /* Liquid Glass — Material-Tokens */
  --glass-bg: rgba(255,255,255,.52);
  --glass-bg-strong: rgba(255,255,255,.68);
  --glass-border: rgba(255,255,255,.68);
  --glass-edge: rgba(45,55,69,.10);              /* äussere Hairline */
  --glass-specular: inset 0 1px 0 rgba(255,255,255,.75);
  --glass-shadow: 0 4px 18px rgba(30,36,50,.10), 0 14px 44px rgba(30,36,50,.10);
  --glass-blur: saturate(170%) blur(22px);
  --card-bg: rgba(255,255,255,.72);

  /* Daten-Viz (validierte kategoriale Palette, feste Reihenfolge) */
  --viz-1: #2a78d6; --viz-2: #1baf7a; --viz-3: #eda100; --viz-4: #008300;
  --viz-5: #4a3aa7; --viz-6: #e34948; --viz-7: #e87ba4; --viz-8: #eb6834;
}

@media (prefers-color-scheme: dark) {
  :root {
    --blue: #0A84FF; --green: #35D97C; --red: #FF453A; --orange: #FF9F0A;
    --yellow: #FFD60A; --teal: #40C8E0; --indigo: #5E5CE6; --purple: #9D6BFF;
    --pink: #FF375F; --gray: #8E8E93;

    --bg: #14171B;               /* Brand-Dunkel, kein reines Schwarz */
    --bg-secondary: #1F242B;     /* behaviewer.ch Dunkelton */
    --bg-elevated: #2A303A;
    --fill: rgba(150,160,175,.30);
    --fill-secondary: rgba(150,160,175,.24);
    --fill-tertiary: rgba(150,160,175,.16);
    --fill-quaternary: rgba(150,160,175,.10);

    --label: #F2F4F7;
    --label-secondary: rgba(226,232,240,.62);
    --label-tertiary: rgba(226,232,240,.30);
    --separator: rgba(148,158,175,.16);
    --separator-strong: rgba(148,158,175,.32);

    --shadow-1: 0 1px 2px rgba(0,0,0,.3), 0 2px 12px rgba(0,0,0,.25);
    --shadow-2: 0 2px 8px rgba(0,0,0,.45), 0 8px 32px rgba(0,0,0,.5);

    --tint: #9D6BFF;             /* helleres Brand-Violett für dunkle Flächen */
    --mint-text: var(--brand-mint);

    --viz-1: #3987e5; --viz-2: #199e70; --viz-3: #c98500; --viz-4: #008300;
    --viz-5: #9085e9; --viz-6: #e66767; --viz-7: #d55181; --viz-8: #d95926;

    /* Liquid Glass dunkel */
    --glass-bg: rgba(34,40,49,.52);
    --glass-bg-strong: rgba(34,40,49,.70);
    --glass-border: rgba(255,255,255,.14);
    --glass-edge: rgba(0,0,0,.35);
    --glass-specular: inset 0 1px 0 rgba(255,255,255,.12);
    --glass-shadow: 0 4px 18px rgba(0,0,0,.35), 0 14px 44px rgba(0,0,0,.35);
    --card-bg: rgba(31,36,43,.72);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  /* dezenter Farbhauch oben — sonst flache Fläche */
  background:
    radial-gradient(1100px 460px at 50% -12%, color-mix(in srgb, var(--brand-violet) 5%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--label);
  font-size: 15px; line-height: 1.42;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--tint); text-decoration: none; }
::selection { background: color-mix(in srgb, var(--tint) 25%, transparent); }

/* ---------- Icons ---------- */
.icn { display: inline-flex; flex: none; vertical-align: -3px; }
.icn svg { width: 100%; height: 100%; }

/* ---------- Typografie (HIG-Skala) ---------- */
.large-title { font-size: 32px; font-weight: 700; letter-spacing: -.021em; line-height: 1.15; }
.title1 { font-size: 26px; font-weight: 700; letter-spacing: -.018em; }
.title2 { font-size: 21px; font-weight: 700; letter-spacing: -.012em; }
.title3 { font-size: 18px; font-weight: 600; letter-spacing: -.008em; }
.headline { font-size: 15px; font-weight: 600; }
.subhead { font-size: 14px; color: var(--label-secondary); }
.footnote { font-size: 12.5px; color: var(--label-secondary); }
.caption { font-size: 11px; color: var(--label-tertiary); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }

/* ---------- Layout ---------- */
#app { min-height: 100dvh; display: flex; flex-direction: column; }
.page { flex: 1; width: 100%; max-width: 1020px; margin: 0 auto; padding: 8px 20px 64px; }
.page-header { padding: 28px 0 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Navigation Bar — schlichte transluzente Leiste ---------- */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: .5px solid var(--separator);
}
.navbar-inner {
  max-width: 1020px; margin: 0 auto; padding: 0 12px 0 20px;
  display: flex; align-items: center; gap: 18px; height: 54px;
}
.navbar .brand { display: flex; align-items: center; }
.navbar .brand img { height: 30px; display: block; }
.brand-img { user-select: none; -webkit-user-drag: none; }
@media (prefers-color-scheme: dark) { .brand-img { filter: invert(1) hue-rotate(180deg); } }
.navbar nav { display: flex; gap: 2px; flex: 1; }
.navbar nav a {
  padding: 6px 13px; border-radius: 999px; color: var(--label-secondary);
  font-size: 14px; font-weight: 500; transition: background .15s, color .15s;
}
.navbar nav a.active { color: var(--label); background: var(--fill-tertiary); font-weight: 600; }
.navbar nav a:hover { color: var(--label); }
.navbar .user-chip { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500;
  color: var(--label); cursor: pointer; padding: 5px 10px 5px 5px; border-radius: 999px; transition: background .15s; }
.navbar .user-chip:hover { background: var(--fill-tertiary); }
.avatar {
  width: 27px; height: 27px; border-radius: 50%; color: #fff; font-size: 10.5px; font-weight: 700;
  background: linear-gradient(145deg, #9BA0A8, #6E7278);
  display: grid; place-items: center; letter-spacing: .02em;
}
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  background: none; color: var(--label-secondary);
  display: grid; place-items: center; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--fill-tertiary); color: var(--label); }

/* Breadcrumb / Back */
.back-link {
  display: inline-flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 500;
  color: var(--tint); margin-top: 16px;
}

/* ---------- Cards (flach, solide Fläche) ---------- */
.card {
  background: var(--bg-secondary); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  border: .5px solid var(--separator);
}
.card + .card { margin-top: 14px; }
.card-pad { padding: 20px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }
.card.tappable { transition: transform .18s cubic-bezier(.32,.72,.36,1), box-shadow .18s; }
.card.tappable:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.card.tappable:active { transform: scale(.985); }

.meta-row { display: flex; align-items: center; gap: 6px; color: var(--label-secondary); font-size: 13px; }
.meta-row .icn { color: var(--label-tertiary); }

/* ---------- Inset Grouped List ---------- */
.list { background: var(--bg-secondary); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-1);
  border: .5px solid var(--separator); }
.list-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 16px;
  min-height: 46px; position: relative;
  width: 100%; text-align: left; background: none; border: 0; cursor: default;
  font-size: 15px;
}
.list-row:not(:last-child)::after {
  content: ''; position: absolute; left: 16px; right: 0; bottom: 0;
  border-bottom: .5px solid var(--separator);
}
.list-row.tappable { cursor: pointer; transition: background .12s; }
.list-row.tappable:hover { background: var(--fill-quaternary); }
.list-row.tappable:active { background: var(--fill-tertiary); }
.list-row .grow { flex: 1; min-width: 0; }
.chevron { color: var(--label-tertiary); flex: none; display: inline-flex; width: 16px; height: 16px; }

/* ---------- Buttons (Liquid Glass) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 999px; cursor: pointer;
  font-size: 15px; font-weight: 600; padding: 10px 20px; min-height: 42px;
  background: color-mix(in srgb, var(--tint) 12%, transparent);   /* iOS "tinted" */
  border: 0; color: var(--tint);
  transition: transform .1s cubic-bezier(.32,.72,.36,1), opacity .15s, background .15s;
  white-space: nowrap;
}
.btn:hover { background: color-mix(in srgb, var(--tint) 18%, transparent); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .35; cursor: default; transform: none; }
.btn-gray { background: var(--fill-tertiary); color: var(--label); }
.btn-gray:hover { background: var(--fill-secondary); }
.btn-primary {
  background: var(--tint); color: #fff;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--tint) 35%, transparent);
}
.btn-primary:hover { background: color-mix(in srgb, var(--tint) 90%, #000); }
.btn-danger { color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--red) 16%, transparent); }
.btn-danger.btn-primary { background: var(--red); color: #fff;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--red) 35%, transparent); }
.btn-danger.btn-primary:hover { background: color-mix(in srgb, var(--red) 90%, #000); }
.btn-plain { background: none; min-height: 32px; padding: 5px 10px; }
.btn-plain:hover { background: var(--fill-quaternary); }
.btn-sm { font-size: 13.5px; min-height: 32px; padding: 5px 14px; }
.btn-block { width: 100%; }

/* ---------- Formulare ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--label-secondary);
  margin-bottom: 6px; }
.input, textarea.input, select.input {
  width: 100%; padding: 11px 14px; border-radius: 12px;
  border: .5px solid var(--separator);
  background: var(--fill-quaternary); font-size: 15px; outline: none; color: var(--label);
  transition: border-color .15s, box-shadow .15s, background .15s;
  appearance: none; -webkit-appearance: none;
}
.input::placeholder { color: var(--label-tertiary); }
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238E8E93' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 9.5 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}
.input:focus { border-color: var(--tint); background: var(--bg-secondary);
  box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--tint) 22%, transparent); }
textarea.input { resize: vertical; min-height: 84px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
input[type="checkbox"] { accent-color: var(--tint); }

/* ---------- Segmented Control (Tabs) ---------- */
.tabs {
  display: inline-flex; border-radius: 10px; padding: 2.5px;
  margin-bottom: 22px; overflow-x: auto; max-width: 100%; gap: 2px;
  background: var(--fill-tertiary);
}
.tabs button {
  border: 0; background: none; padding: 7px 16px; border-radius: 8px;
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  color: var(--label); white-space: nowrap;
  transition: background .18s, box-shadow .18s, transform .1s;
}
.tabs button:active { transform: scale(.97); }
.tabs button.active {
  background: var(--bg-elevated); font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 .5px var(--separator);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { background: color-mix(in srgb, var(--brand-mint) 26%, transparent); color: var(--mint-text); }
.badge-blue { background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--blue); }
.badge-orange { background: color-mix(in srgb, var(--orange) 15%, transparent); color: color-mix(in srgb, var(--orange) 82%, var(--label)); }
.badge-red { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.badge-gray { background: var(--fill-tertiary); color: var(--label-secondary); }
.badge-purple { background: color-mix(in srgb, var(--purple) 13%, transparent); color: var(--purple); }
.badge.no-dot::before { display: none; }

/* ---------- Stat-Kacheln ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.stat {
  background: var(--bg-secondary); border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow-1);
  border: .5px solid var(--separator);
}
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.stat .label { font-size: 12px; color: var(--label-secondary); margin-top: 1px; font-weight: 500; }
.stat .icn { color: var(--label-tertiary); float: right; margin-top: 2px; }

/* ---------- Sheet ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .22s ease;
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
@media (min-width: 640px) { .sheet-backdrop { align-items: center; } }
.sheet {
  background: var(--bg-elevated);
  border: .5px solid var(--separator);
  width: 100%; max-width: 560px; max-height: 92dvh;
  border-radius: 22px 22px 0 0; overflow: auto; padding: 22px;
  animation: sheetUp .32s cubic-bezier(.32,.72,.36,1);
  box-shadow: var(--shadow-2);
}
@media (min-width: 640px) { .sheet { border-radius: 22px; } }
.sheet-grabber { width: 38px; height: 5px; border-radius: 3px; background: var(--fill); margin: -10px auto 16px; }
@media (min-width: 640px) { .sheet-grabber { display: none; } }
.sheet-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
@keyframes sheetUp { from { transform: translateY(48px); opacity: .5; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Toast ---------- */
#toast-root { position: fixed; top: 14px; left: 0; right: 0; z-index: 500; display: flex;
  flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  color: var(--label); padding: 10px 22px; border-radius: 999px;
  box-shadow: var(--shadow-2); border: .5px solid var(--separator);
  font-size: 14px; font-weight: 500;
  animation: toastIn .35s cubic-bezier(.32,.72,.36,1);
  display: flex; align-items: center; gap: 8px;
}
.toast.error { color: var(--red); }
.toast.success { color: var(--green); }
@keyframes toastIn { from { transform: translateY(-18px) scale(.95); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Login ---------- */
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 700px at 50% -10%, color-mix(in srgb, var(--tint) 9%, transparent), transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 360px; }
.login-wordmark { display: flex; justify-content: center; margin-bottom: 6px; }
.login-wordmark img { height: 52px; }

/* ---------- Karte ---------- */
.map-box { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--fill-tertiary); }
.map-box .maplibregl-map { position: absolute; inset: 0; }
.card > .map-box { border-radius: 0; }

/* ---------- Erfassungsmodus ---------- */
.capture-root { position: fixed; inset: 0; z-index: 150; background: #000; }
.capture-map { position: absolute; inset: 0; }
.capture-close {
  position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; z-index: 20;
  width: 40px; height: 40px; border-radius: 50%; border: .5px solid rgba(255,255,255,.12);
  cursor: pointer;
  background: rgba(28,28,30,.72); color: #fff;
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  display: grid; place-items: center; transition: transform .1s;
}
.capture-close:active { transform: scale(.92); }
.capture-status {
  position: absolute; top: max(14px, env(safe-area-inset-top)); left: 14px; z-index: 20;
  background: rgba(28,28,30,.72); color: #fff; border-radius: 999px; padding: 9px 16px;
  font-size: 12.5px; font-weight: 500; font-variant-numeric: tabular-nums;
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: .5px solid rgba(255,255,255,.12);
  display: flex; gap: 14px; align-items: center;
}
.capture-status .rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red);
  animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.capture-toolbar {
  position: absolute; bottom: max(18px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  z-index: 20; display: flex; flex-direction: column; align-items: center; gap: 9px;
  max-width: calc(100vw - 24px);
}
.capture-modes {
  display: flex; background: rgba(28,28,30,.72); border-radius: 999px; padding: 4px; gap: 2px;
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: .5px solid rgba(255,255,255,.12);
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
}
.capture-modes button {
  border: 0; background: none; color: rgba(255,255,255,.75); padding: 9px 17px; border-radius: 999px;
  cursor: pointer; font-size: 13.5px; font-weight: 500;
  display: flex; align-items: center; gap: 7px; transition: background .18s, color .18s;
}
.capture-modes button .icn { vertical-align: 0; }
.capture-modes button.active { background: #fff; color: #000; font-weight: 600; }
.capture-hint {
  background: rgba(28,28,30,.6); color: rgba(255,255,255,.85); font-size: 12px; font-weight: 500;
  padding: 5px 14px; border-radius: 999px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}

/* Burano-Legende */
.burano-legend {
  position: absolute; top: max(64px, calc(env(safe-area-inset-top) + 52px)); left: 14px; z-index: 15;
  background: rgba(28,28,30,.72); color: rgba(255,255,255,.9);
  border-radius: 14px; padding: 10px 14px; font-size: 11.5px;
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: .5px solid rgba(255,255,255,.12);
  display: flex; flex-direction: column; gap: 8px; max-width: 210px;
}
.legend-group { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.legend-fig { display: inline-flex; width: 22px; height: 22px; flex: none; }
.legend-fig svg { width: 100%; height: 100%; }
.legend-cap { font-size: 10.5px; opacity: .72; width: 100%; }
.burano-legend.in-card { position: static; background: none; border: 0; color: var(--label-secondary);
  backdrop-filter: none; -webkit-backdrop-filter: none; padding: 12px 20px 16px; max-width: none;
  flex-direction: row; flex-wrap: wrap; gap: 6px 16px; }

/* Wizard-Panel (über der Karte) */
.wizard-panel {
  position: absolute; z-index: 30;
  background: var(--bg-elevated);
  border: .5px solid var(--separator);
  display: flex; flex-direction: column;
  inset: auto 0 0 0; max-height: 72dvh; border-radius: 22px 22px 0 0;
  animation: sheetUp .3s cubic-bezier(.32,.72,.36,1);
  box-shadow: 0 -8px 40px rgba(0,0,0,.28);
}
@media (min-width: 900px) {
  .wizard-panel {
    inset: auto auto 18px 18px; width: 400px; max-height: calc(100dvh - 36px);
    border-radius: 22px;
  }
}
.wizard-head { padding: 16px 22px 12px; }
.wizard-progress { height: 4px; border-radius: 2px; background: var(--fill-tertiary); margin-top: 12px; overflow: hidden; }
.wizard-progress > div { height: 100%; background: var(--tint); border-radius: 2px; transition: width .3s cubic-bezier(.32,.72,.36,1); }
.wizard-body { flex: 1; overflow: auto; padding: 14px 22px; }
.wizard-foot { display: flex; gap: 10px; padding: 12px 22px calc(14px + env(safe-area-inset-bottom));
  border-top: .5px solid var(--separator); }
.wizard-foot .btn { flex: 1; }

.option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 9px; }
.option-btn {
  border: .5px solid var(--separator-strong); background: var(--bg-secondary); border-radius: 12px;
  padding: 13px 10px; font-size: 14px; font-weight: 500; cursor: pointer; text-align: center;
  transition: transform .1s cubic-bezier(.32,.72,.36,1), border-color .15s, background .15s;
}
.option-btn:hover { border-color: var(--label-tertiary); }
.option-btn:active { transform: scale(.95); }
.option-btn.selected { border-color: var(--tint); background: color-mix(in srgb, var(--tint) 10%, transparent);
  color: var(--tint); font-weight: 600; box-shadow: 0 0 0 1px var(--tint) inset; }

/* Richtungs-Dial */
.dial-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 14px 0; }
.dial {
  width: 190px; height: 190px; border-radius: 50%;
  border: 2px solid var(--separator-strong);
  background: radial-gradient(circle at 50% 50%, var(--fill-quaternary), transparent 70%);
  position: relative; touch-action: none; cursor: pointer;
}
.dial .knob {
  width: 30px; height: 30px; border-radius: 50%; background: var(--tint); position: absolute;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--tint) 55%, transparent), inset 0 -2px 3px rgba(0,0,0,.2);
  border: 2.5px solid #fff;
}
.dial .arrow-line { position: absolute; left: 50%; top: 50%; width: 3px; border-radius: 2px;
  background: color-mix(in srgb, var(--tint) 45%, transparent); transform-origin: top center; }
.dial .compass { position: absolute; font-size: 11px; color: var(--label-tertiary); font-weight: 700; }

/* Zähler */
.count-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.count-tile {
  background: var(--bg-secondary); border: .5px solid var(--separator-strong); border-radius: 16px;
  box-shadow: var(--shadow-1);
  padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; align-items: center;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: transform .08s cubic-bezier(.32,.72,.36,1), background .1s;
}
.count-tile:active { transform: scale(.93); background: color-mix(in srgb, var(--tint) 10%, var(--bg-secondary)); }
.count-tile .num { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.count-tile .cat { font-size: 12.5px; color: var(--label-secondary); text-align: center; font-weight: 500; }

/* ---------- Charts ---------- */
.bar-row { display: grid; grid-template-columns: 130px 1fr 40px; gap: 10px; align-items: center;
  padding: 4px 0; font-size: 13px; }
.bar-row .bar-track { height: 18px; background: var(--fill-quaternary); border-radius: 5px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; border-radius: 0 4px 4px 0; background: var(--tint); min-width: 2px;
  transition: width .5s cubic-bezier(.32,.72,.36,1); }
.bar-row .bar-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; }

/* ---------- Empty State ---------- */
.empty { text-align: center; padding: 56px 20px; color: var(--label-secondary); }
.empty .icn {
  width: 68px; height: 68px; padding: 18px; margin-bottom: 14px;
  color: var(--tint); background: color-mix(in srgb, var(--tint) 10%, transparent);
  border-radius: 50%;
}

/* ---------- Utilities ---------- */
/* ---------- iOS-Settings-Stil: Listen-Icons ---------- */
.li-icon {
  width: 30px; height: 30px; border-radius: 8.5px; flex: none;
  display: grid; place-items: center; color: #fff;
  box-shadow: inset 0 -1px 2px rgba(0,0,0,.12);
}
.li-icon .icn { vertical-align: 0; }

/* ---------- Stat-Bubble (farbige Icon-Kachel in Stat-Tiles) ---------- */
.stat-bubble {
  width: 30px; height: 30px; border-radius: 9px; margin-bottom: 10px;
  display: grid; place-items: center; color: #fff;
  box-shadow: inset 0 -1px 2px rgba(0,0,0,.12);
}
.stat-bubble .icn { vertical-align: 0; }

/* ---------- Gruppierte Eingabefelder (iOS-Login-Stil) ---------- */
.input-group { border-radius: 14px; overflow: hidden; border: .5px solid var(--separator);
  background: var(--fill-quaternary); transition: box-shadow .15s, border-color .15s; }
.input-group .input { border: 0; border-radius: 0; background: none; padding: 13px 15px; }
.input-group .input:focus { box-shadow: none; background: none; }
.input-group .input + .input { border-top: .5px solid var(--separator); }
.input-group:focus-within { border-color: var(--tint);
  box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--tint) 20%, transparent); }

/* ---------- Mitteilungs-Center ---------- */
.notif-badge {
  position: absolute; top: -1px; right: -3px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 999px; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; place-items: center; line-height: 1;
  box-shadow: 0 0 0 2px var(--bg-secondary);
}
.notif-pop {
  position: fixed; top: 72px; right: 20px; z-index: 180;
  width: min(392px, calc(100vw - 24px));
  display: flex; flex-direction: column;
  border-radius: 18px; overflow: hidden;
  background: var(--bg-elevated);
  border: .5px solid var(--separator);
  box-shadow: var(--shadow-2);
  animation: notifIn .28s cubic-bezier(.32,.72,.36,1);
  transform-origin: top right;
}
@keyframes notifIn { from { opacity: 0; transform: scale(.94) translateY(-8px); } to { opacity: 1; transform: none; } }
.notif-head { display: flex; align-items: center; gap: 8px; padding: 13px 10px 11px 18px;
  border-bottom: .5px solid var(--separator); }
.notif-feed { overflow-y: auto; max-height: min(58dvh, 480px); padding: 10px 12px 14px;
  display: flex; flex-direction: column; gap: 10px; }
.notif-item { display: flex; gap: 9px; align-items: flex-start; }
.notif-icon {
  width: 27px; height: 27px; border-radius: 50%; flex: none; margin-top: 2px;
  display: grid; place-items: center; color: #fff;
  box-shadow: inset 0 -1px 2px rgba(0,0,0,.15);
}
.notif-icon .icn { vertical-align: 0; }
.notif-bubble {
  background: var(--fill-quaternary); border: .5px solid var(--separator);
  border-radius: 4px 16px 16px 16px; padding: 9px 13px; min-width: 0; flex: 1;
}
.notif-item.unread .notif-bubble {
  background: color-mix(in srgb, var(--tint) 8%, var(--fill-quaternary));
  border-color: color-mix(in srgb, var(--tint) 25%, transparent);
}
.notif-title { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; flex-wrap: wrap; }
.notif-item.unread .notif-title::after {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--tint); margin-left: 7px;
}
.notif-body { font-size: 13px; color: var(--label-secondary); margin-top: 2px; overflow-wrap: break-word; }
.notif-time { font-size: 11px; color: var(--label-tertiary); margin-top: 5px; }
.notif-empty { text-align: center; padding: 34px 16px; color: var(--label-secondary); }
.notif-empty .icn { color: var(--label-tertiary); }

/* ---------- Observer-Landing ---------- */
.mywork-card.is-running {
  border-color: color-mix(in srgb, var(--red) 40%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--red) 25%, transparent), var(--shadow-1);
}
.mywork-instr { border-left: 3px solid var(--orange); padding-left: 12px; }

/* ---------- Eigener animierter BehaViewer-Vogel ---------- */
.bird-anim { display: block; color: var(--label); }
.bird-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.login-bird { width: 112px; height: 116px; margin: 0 auto 2px; color: var(--tint); }
.empty-bird { width: 96px; height: 100px; margin: 0 auto 6px; color: var(--tint); }

.bird-bob { animation: bird-bob 2.8s ease-in-out infinite; transform-origin: 63px 92px; }
@keyframes bird-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.bird-eye { animation: bird-blink 5s infinite; transform-origin: center; transform-box: fill-box; }
@keyframes bird-blink { 0%, 91%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.12); } }
.bird-wing { transform-origin: 72px 60px; transform-box: fill-box; }

.bird-anim:hover .bird-hop { animation: bird-hop .55s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes bird-hop {
  0% { transform: translateY(0) scaleY(1); }
  30% { transform: translateY(-11px) scaleY(1.06); }
  60% { transform: translateY(0) scaleY(.93); }
  100% { transform: translateY(0) scaleY(1); }
}
.bird-anim:hover .bird-wing { animation: bird-flap .34s ease-in-out 2; }
@keyframes bird-flap { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-24deg); } }
@media (prefers-reduced-motion: reduce) {
  .bird-bob, .bird-eye, .bird-anim:hover .bird-hop, .bird-anim:hover .bird-wing { animation: none; }
}

/* Signet in der Navbar hüpft beim Hover */
.navbar .brand img { transition: transform .28s cubic-bezier(.34, 1.5, .5, 1); transform-origin: 12px 70%; }
.navbar .brand:hover img { transform: translateY(-3px) rotate(-5deg); }

/* ══════════ Einsatzplanung (Planboard) ══════════ */
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 14px; }
.plan-date { width: auto; padding: 7px 10px; font-size: 13.5px; }
.plan-daychips { display: flex; gap: 6px; flex-wrap: wrap; }
.plan-card { overflow: visible; }
#pl-board { padding: 6px 0 2px; }

.plan-row { display: grid; grid-template-columns: 190px 1fr; align-items: stretch; min-height: 52px; }
.plan-row + .plan-row { border-top: .5px solid var(--separator); }
.plan-axis { min-height: 30px; }
.plan-name { display: flex; align-items: center; gap: 9px; padding: 8px 12px; min-width: 0; }
.plan-name-txt { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.plan-load { margin-left: auto; font-size: 11px; font-weight: 700; padding: 2px 8px;
  border-radius: 999px; background: var(--fill-tertiary); color: var(--label-secondary); flex: none; }
.plan-load.warm { background: color-mix(in srgb, var(--orange) 18%, transparent); color: var(--orange); }
.plan-load.hot { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }

.plan-track { position: relative; border-left: .5px solid var(--separator); overflow: hidden;
  cursor: copy; }
.plan-axis .plan-track { cursor: default; border-left-color: transparent; }
.plan-grid { position: absolute; top: 0; bottom: 0; width: 0;
  border-left: 1px dashed color-mix(in srgb, var(--separator) 70%, transparent); }
.plan-hour { position: absolute; top: 6px; transform: translateX(-50%);
  font-size: 10.5px; color: var(--label-tertiary); font-variant-numeric: tabular-nums; }

.plan-block {
  position: absolute; top: 8px; bottom: 8px; border: 0; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 11px; font-weight: 600; padding: 0 6px; cursor: pointer;
  overflow: hidden; white-space: nowrap; min-height: 32px;
  transition: filter .12s, transform .1s;
}
.plan-block span { overflow: hidden; text-overflow: ellipsis; }
.plan-block:hover { filter: brightness(1.08); }
.plan-block.own { background: var(--tint); color: #fff; cursor: grab; touch-action: none;
  box-shadow: 0 1px 4px color-mix(in srgb, var(--tint) 40%, transparent); }
.plan-block.own:active { cursor: grabbing; }
/* Griffzonen an den Kanten zum Ziehen von Start/Ende */
.plan-block.own::before, .plan-block.own::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 10px; cursor: ew-resize;
}
.plan-block.own::before { left: 0; }
.plan-block.own::after { right: 0; }
.plan-block.foreign {
  background: repeating-linear-gradient(45deg, var(--fill-secondary) 0 6px, var(--fill-quaternary) 6px 12px);
  color: var(--label-secondary); font-weight: 500;
}
.plan-block.conflict { box-shadow: 0 0 0 2.5px var(--red); }
.plan-block.tight:not(.conflict) { box-shadow: 0 0 0 2.5px var(--orange); }
.plan-block .icn { color: currentColor; flex: none; }

.plan-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 14px;
  border-top: .5px solid var(--separator); font-size: 12px; color: var(--label-secondary); }
.plan-leg { display: inline-flex; align-items: center; gap: 6px; }
.plan-leg .swatch { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.plan-leg .swatch.own { background: var(--tint); }
.plan-leg .swatch.foreign {
  background: repeating-linear-gradient(45deg, var(--fill-secondary) 0 4px, var(--fill-quaternary) 4px 8px); }
.plan-leg .swatch.conflict { background: none; box-shadow: 0 0 0 2px var(--red) inset; }
.plan-leg .swatch.tight { background: none; box-shadow: 0 0 0 2px var(--orange) inset; }

.plan-addrow { min-height: 44px; }
.plan-addbtn {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: none;
  color: var(--tint); font-size: 13px; font-weight: 600; cursor: pointer;
  padding: 6px 10px; border-radius: 8px; transition: background .12s;
}
.plan-addbtn:hover { background: color-mix(in srgb, var(--tint) 10%, transparent); }

.plan-warncard { display: flex; flex-direction: column; gap: 9px; }
.plan-warn { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; }
.plan-warn.conflict .icn { color: var(--red); }
.plan-warn.tight .icn { color: var(--orange); }

@media (max-width: 640px) {
  .plan-row { grid-template-columns: 120px 1fr; }
  .plan-name-txt { font-size: 12px; }
}

/* ══════════ Auswertungs-Dashboard ══════════ */
/* Sticky-Filterleiste: klebt beim Scrollen unter der Navbar */
.an-filterbar {
  position: sticky; top: 68px; z-index: 80;
  margin: 0 -6px 16px; padding: 8px 10px;
  border-radius: 14px;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: .5px solid var(--glass-border);
  box-shadow: var(--glass-specular), 0 0 0 .5px var(--glass-edge), var(--shadow-1);
}
.an-fb-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.an-fb-chips { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }

/* Kompakte Filter-Dropdowns */
.an-dd-wrap { position: relative; display: inline-flex; }
.an-dd {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 999px; cursor: pointer;
  border: .5px solid var(--separator); background: var(--fill-quaternary);
  color: var(--label); font-size: 12.5px; font-weight: 500;
  transition: background .12s, border-color .12s;
}
.an-dd:hover { border-color: var(--label-tertiary); }
.an-dd.on { border-color: var(--tint); color: var(--tint); font-weight: 600;
  background: color-mix(in srgb, var(--tint) 9%, transparent); }
.an-dd-n {
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--tint); color: #fff; font-size: 10.5px; font-weight: 700;
  display: inline-grid; place-items: center;
}
.an-dd-chev { opacity: .55; transform: rotate(90deg); transition: transform .15s; }
.an-dd.open .an-dd-chev { transform: rotate(-90deg); }
.an-dd-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 120;
  min-width: 190px; max-height: 300px; overflow-y: auto; padding: 6px;
  border-radius: 12px; background: var(--bg-elevated);
  border: .5px solid var(--separator); box-shadow: var(--shadow-2);
  animation: notifIn .18s cubic-bezier(.32,.72,.36,1);
}
.an-dd-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 9px;
  border-radius: 8px; cursor: pointer; font-size: 13px;
}
.an-dd-item:hover { background: var(--fill-quaternary); }
.an-dd-item input { width: 16px; height: 16px; accent-color: var(--tint); flex: none; }

.an-fchip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 6px 4px 11px;
  border-radius: 999px; border: 0; cursor: pointer; font-size: 12.5px; font-weight: 600;
  background: color-mix(in srgb, var(--tint) 14%, transparent); color: var(--tint);
}
.an-fchip:hover { background: color-mix(in srgb, var(--tint) 22%, transparent); }
.an-fchip .x { display: inline-flex; opacity: .7; }

/* Kontext-Chips (Session / Wetter) */
.an-context-card { display: flex; gap: 22px; flex-wrap: wrap; }
.an-ctx-group { min-width: 0; }
.an-chipset { display: flex; gap: 6px; flex-wrap: wrap; }
.an-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 999px;
  border: .5px solid var(--separator); background: var(--fill-quaternary); color: var(--label);
  font-size: 12.5px; font-weight: 500; cursor: pointer; transition: background .12s, border-color .12s;
}
.an-chip:hover { border-color: var(--label-tertiary); }
.an-chip.on { background: var(--tint); color: #fff; border-color: var(--tint); }
.an-chip .icn { vertical-align: 0; }

/* Karten-Card */
.an-mapcard { overflow: hidden; }
.an-maptools { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; padding: 10px 14px; border-bottom: .5px solid var(--separator); }
.an-maptools-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.an-seg { display: inline-flex; background: var(--fill-tertiary); border-radius: 9px; padding: 2.5px; gap: 2px; }
.an-seg button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; cursor: pointer;
  font-size: 12.5px; font-weight: 500; color: var(--label); white-space: nowrap; transition: background .15s; }
.an-seg button.active { background: var(--bg-elevated); font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 .5px var(--separator); }
.an-ctl { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--label-secondary); }
.an-select { width: auto; min-height: 0; padding: 5px 28px 5px 10px; font-size: 12.5px; border-radius: 8px; }
.an-ctl input[type=range] { width: 96px; accent-color: var(--tint); }
.an-map { height: 440px; }
.an-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 14px; border-top: .5px solid var(--separator); }
.an-leg-item, .an-mini { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--label-secondary); }
.an-leg-item .dot, .an-mini .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* Chart-Grid */
.an-charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.an-chart { display: flex; flex-direction: column; }
.an-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.an-card-body { flex: 1; }

/* Klickbare Verteilungs-Balken */
.an-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 9px; align-items: center;
  width: 100%; padding: 4px 2px; background: none; border: 0; cursor: pointer; text-align: left;
  border-radius: 6px; transition: background .12s, opacity .12s; }
.an-row.static { cursor: default; }
.an-row:not(.static):hover { background: var(--fill-quaternary); }
.an-row.dim { opacity: .4; }
.an-row.sel { background: color-mix(in srgb, var(--tint) 9%, transparent); }
.an-row-label { font-size: 12.5px; color: var(--label-secondary); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; text-align: right; }
.an-row.sel .an-row-label { color: var(--tint); font-weight: 600; }
.an-row-track { height: 16px; background: var(--fill-quaternary); border-radius: 5px; overflow: hidden; }
.an-row-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; transition: width .4s cubic-bezier(.32,.72,.36,1); }
.an-row-val { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12.5px; min-width: 34px; text-align: right; }
.an-row-val small { color: var(--label-tertiary); font-weight: 500; margin-left: 4px; }

/* Gender-Split */
.an-split { display: flex; height: 26px; gap: 2px; border-radius: 7px; overflow: hidden; margin-bottom: 10px; }
.an-split-seg { border: 0; cursor: pointer; color: #fff; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; transition: opacity .15s; }
.an-split-seg.dim { opacity: .35; }
.an-split-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.an-mini { border: 0; background: none; cursor: pointer; }
.an-mini.sel { color: var(--tint); font-weight: 600; }

/* Kreuztabelle */
.an-matrix-dims { display: inline-flex; align-items: center; gap: 4px; }
.an-matrix-dims .mx { color: var(--label-tertiary); }
table.an-matrix { border-collapse: collapse; width: 100%; font-size: 12px; }
table.an-matrix th { font-weight: 600; color: var(--label-secondary); padding: 4px 5px; text-align: center; }
table.an-matrix thead th { font-size: 10.5px; }
table.an-matrix tbody th { text-align: right; white-space: nowrap; }
table.an-matrix td { text-align: center; padding: 6px 4px; border-radius: 5px; cursor: pointer;
  font-variant-numeric: tabular-nums; font-weight: 600; transition: outline .1s; }
table.an-matrix td.has:hover { outline: 2px solid var(--tint); outline-offset: -2px; }
table.an-matrix td.sel { outline: 2px solid var(--tint); outline-offset: -2px; }

/* Kompass */
.an-compass { width: 100%; max-width: 220px; display: block; margin: 0 auto; overflow: visible; }

/* Tageszeit */
.an-hour { display: flex; align-items: flex-end; gap: 4px; height: 116px; padding-top: 6px; }
.an-hour-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: flex-end; gap: 3px; height: 100%; border: 0; background: none; cursor: pointer; }
.an-hour-bar { width: 70%; max-width: 26px; background: var(--tint); border-radius: 4px 4px 0 0;
  transition: height .4s cubic-bezier(.32,.72,.36,1); }
.an-hour-col.dim .an-hour-bar { opacity: .4; }
.an-hour-col.sel .an-hour-bar { background: var(--tint); box-shadow: 0 0 0 2px color-mix(in srgb, var(--tint) 35%, transparent); }
.an-hour-n { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.an-hour-x { font-size: 10px; color: var(--label-tertiary); }

/* ══════════ Datenplausibilität (Beobachtung) ══════════ */
.q-card.flagged { border-color: color-mix(in srgb, var(--orange) 45%, transparent); }
.q-strip {
  position: relative; height: 30px; border-radius: 8px;
  background: var(--fill-quaternary); border: .5px solid var(--separator);
  overflow: hidden;
}
.q-tick {
  position: absolute; top: 5px; bottom: 5px; width: 3px; border-radius: 2px;
  transform: translateX(-50%);
}
.q-gap {
  position: absolute; top: 0; bottom: 0;
  background: repeating-linear-gradient(45deg,
    color-mix(in srgb, var(--red) 16%, transparent) 0 5px,
    color-mix(in srgb, var(--red) 7%, transparent) 5px 10px);
}
.q-type { display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
  color: var(--label-secondary); }
.q-type .dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.q-warnings { display: flex; flex-direction: column; gap: 7px; }

/* Vergleichstabelle (Projekt) */
table.an-cmp th, table.an-cmp td { text-align: right; padding: 6px 10px; }
table.an-cmp tbody th { text-align: left; font-weight: 500; }
table.an-cmp thead th { cursor: pointer; max-width: 140px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
table.an-cmp thead th.sel { color: var(--tint); box-shadow: inset 0 -2px 0 var(--tint); }
table.an-cmp td { cursor: pointer; font-weight: 500; }
table.an-cmp tbody tr:first-child td { font-weight: 700; }

/* ---------- Seiten-Übergang & Fokus ---------- */
.page { animation: pageIn .38s cubic-bezier(.32,.72,.36,1) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
:focus-visible { outline: 3px solid color-mix(in srgb, var(--tint) 45%, transparent); outline-offset: 2px; }
.input:focus-visible, .input-group :focus-visible { outline: none; }

.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--label-secondary); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace; }
.hide-sm { display: none; }
@media (min-width: 640px) { .hide-sm { display: inline; } }
