@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/inter-latin-wght-normal.woff2) format('woff2-variations');
}

:root {
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --line: #E2E8F0;
  --text: #0F172A;
  --text-2: #64748B;
  --text-3: #475569;
  --blue: #2563EB;
  --blue-dark: #1E40AF;
  --amber: #F59E0B;
  --teal: #15803D;
  --plus: #22C55E;
  --minus: #F97316;
  --minus-text: #C2410C;
  --idle: #94A3B8;
  --radius: 14px;
  --nav-h: 64px;
  --stage: transparent;
  color-scheme: light;
  --s100: #F1F5F9;
  --s150: #E9EEF4;
  --s200: #E2E8F0;
  --s300: #CBD5E1;
  --s400: #94A3B8;
  --s700: #334155;
  --o50: #FFF7ED;
  --o100: #FFEDD5;
  --o200: #FED7AA;
  --o300: #FDBA74;
  --o400: #FB923C;
  --o800: #9A3412;
  --t50: #F0FDF4;
  --t100: #DCFCE7;
  --t200: #BBF7D0;
  --t300: #86EFAC;
  --t400: #4ADE80;
  --t800: #166534;
  --t900: #14532D;
  --b50: #EFF6FF;
  --b100: #DBEAFE;
  --b200: #BFDBFE;
  --b300: #93C5FD;
  --b900: #1E3A8A;
  --a100: #FEF3C7;
  --r700: #B91C1C;
  --green-bg: #DCFCE7;
  --green-text: #166534;
  --inv: #0F172A;
  --inv-text: #FFFFFF;
  --ink: #0F172A;
}

/* Dunkelmodus: System-Einstellung, ausser "Hell" gewaehlt; oder fest "Dunkel" */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0B1120;
    --card: #111A2B;
    --line: #26334A;
    --text: #E2E8F0;
    --text-2: #94A3B8;
    --text-3: #CBD5E1;
    --blue: #3B82F6;
    --blue-dark: #93C5FD;
    --teal: #4ADE80;
    --plus: #4ADE80;
    --minus: #FB923C;
    --minus-text: #FDBA74;
    --idle: #64748B;
    --s100: #1A2436;
    --s150: #1F2A3D;
    --s200: #26334A;
    --s300: #3A4760;
    --s400: #64748B;
    --s700: #CBD5E1;
    --o50: #2A1A0E;
    --o100: #3B2412;
    --o200: #7C2D12;
    --o300: #9A3412;
    --o400: #FB923C;
    --o800: #FDBA74;
    --t50: #0B2416;
    --t100: #14532D;
    --t200: #166534;
    --t300: #15803D;
    --t400: #22C55E;
    --t800: #BBF7D0;
    --t900: #DCFCE7;
    --b50: #172554;
    --b100: #1E3A8A;
    --b200: #1E40AF;
    --b300: #3B82F6;
    --b900: #BFDBFE;
    --a100: #713F12;
    --r700: #F87171;
    --green-bg: #14532D;
    --green-text: #BBF7D0;
    --inv: #26334A;
    --inv-text: #F8FAFC;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B1120;
  --card: #111A2B;
  --line: #26334A;
  --text: #E2E8F0;
  --text-2: #94A3B8;
  --text-3: #CBD5E1;
  --blue: #3B82F6;
  --blue-dark: #93C5FD;
  --teal: #4ADE80;
  --plus: #4ADE80;
  --minus: #FB923C;
  --minus-text: #FDBA74;
  --idle: #64748B;
  --s100: #1A2436;
  --s150: #1F2A3D;
  --s200: #26334A;
  --s300: #3A4760;
  --s400: #64748B;
  --s700: #CBD5E1;
  --o50: #2A1A0E;
  --o100: #3B2412;
  --o200: #7C2D12;
  --o300: #9A3412;
  --o400: #FB923C;
  --o800: #FDBA74;
  --t50: #0B2416;
  --t100: #14532D;
  --t200: #166534;
  --t300: #15803D;
  --t400: #22C55E;
  --t800: #BBF7D0;
  --t900: #DCFCE7;
  --b50: #172554;
  --b100: #1E3A8A;
  --b200: #1E40AF;
  --b300: #3B82F6;
  --b900: #BFDBFE;
  --a100: #713F12;
  --r700: #F87171;
  --green-bg: #14532D;
  --green-text: #BBF7D0;
  --inv: #26334A;
  --inv-text: #F8FAFC;
}

[hidden] { display: none !important; }

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 Inter, system-ui, sans-serif;
  font-feature-settings: 'tnum';
  border-top: 4px solid var(--stage);
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }
button { font: inherit; cursor: pointer; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ---------- Stage (dev/test sichtbar markieren) ---------- */
html[data-stage='dev'] { --stage: #DB2777; }
html[data-stage='test'] { --stage: #F59E0B; }
#stage-badge {
  position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 50;
  padding: 2px 10px; border-radius: 999px; background: var(--stage); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}

/* ---------- Layout ---------- */
main {
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 20px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.head { display: flex; flex-direction: column; gap: 4px; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.head h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.muted { color: var(--text-2); font-size: 13px; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--card);
  display: inline-flex; align-items: center; justify-content: center; color: var(--s700);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- Hinweise ---------- */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: 10px; padding: 10px 12px; font-size: 13px;
  background: var(--o50); border: 1px solid var(--o200); color: var(--o800);
}
.notice.info { background: var(--b50); border-color: var(--b200); color: var(--b900); }
.notice svg { flex: none; margin-top: 1px; }

/* ---------- Heute ---------- */
.status-line { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 5px; background: var(--idle); flex: none; }
.dot.working { background: var(--blue); }
.dot.paused { background: var(--amber); }
.dot.done { background: var(--teal); }

.big-row { display: flex; align-items: baseline; justify-content: space-between; }
.big { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; }

.progress { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress > div { height: 100%; border-radius: 4px; background: var(--blue); transition: width .4s; }
.progress.paused > div { background: var(--amber); }
.progress.done > div { background: var(--teal); }

.meta-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-3); }

.stamp-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 0 0; }
.stamp {
  width: 156px; height: 156px; border-radius: 78px; border: 0;
  font-size: 20px; font-weight: 700; line-height: 1.2; padding: 16px;
  background: var(--blue); color: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .15);
  transition: transform .1s;
}
.stamp:active { transform: scale(.96); }
.stamp.pause_start { background: var(--amber); color: var(--ink); }
.stamp.stop { background: var(--inv); color: var(--inv-text); }
.stamp.again { background: var(--line); color: var(--text); }
.stamp:disabled { opacity: .6; cursor: progress; }

.section-head { display: flex; justify-content: space-between; align-items: center; }
.section-head h2 { margin: 0; font-size: 14px; font-weight: 600; }
.section-head a { font-size: 13px; font-weight: 600; padding: 12px 0; }

.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px;
}
.row .time { font-size: 15px; font-weight: 600; width: 48px; }
.row .label { font-size: 14px; flex: 1; }
.row .src { font-size: 12px; color: var(--text-2); }
.row.queued { border-style: dashed; }
.empty { font-size: 13px; color: var(--text-2); padding: 4px 0; }

.minis { display: flex; gap: 8px; }
.mini { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.mini .k { font-size: 12px; color: var(--text-2); }
.mini .v { font-size: 15px; font-weight: 600; }
.plus { color: var(--teal); }
.minus { color: var(--minus-text); }

/* ---------- Login ---------- */
.login { min-height: 70dvh; justify-content: center; }
.login form { display: flex; flex-direction: column; gap: 12px; }
label { font-size: 13px; font-weight: 600; color: var(--text-3); }
input[type='password'], input[type='text'], input[type='email'] {
  font: inherit; width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text);
}
.btn {
  min-height: 44px; padding: 10px 16px; border-radius: 10px; border: 0;
  background: var(--inv); color: var(--inv-text); font-weight: 600;
}
.btn:disabled { opacity: .6; }
.error { color: var(--minus-text); font-size: 13px; min-height: 18px; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center;
  background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-inner { display: flex; width: 100%; max-width: 520px; }
.nav a {
  flex: 1; min-height: var(--nav-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 12px; font-weight: 500; color: var(--text-2);
}
.nav a[aria-current='page'] { color: var(--blue); font-weight: 600; }
@media (max-width: 430px) { .nav a { font-size: 10px; letter-spacing: -0.01em; min-width: 0; } }
@media (max-width: 360px) { .nav a { font-size: 9px; } }

/* ---------- Bestaetigung (URL-Aktionen) und Toast ---------- */
.confirm {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: var(--bg); padding: 24px; text-align: center;
  font-size: 28px; font-weight: 700; letter-spacing: -0.02em;
}
.confirm .sub { font-size: 15px; font-weight: 500; color: var(--text-2); }
.confirm svg { color: var(--teal); }
.confirm.warn svg { color: var(--minus); }

/* Meldungen mittig und auffaellig; antippen schliesst */
.toast {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%);
  z-index: 95; width: max-content; max-width: min(440px, calc(100% - 32px)); cursor: pointer;
  display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-radius: 14px;
  font-size: 16px; font-weight: 600; line-height: 1.35;
  box-shadow: 0 16px 48px rgba(15, 23, 42, .28), 0 0 0 100vmax rgba(15, 23, 42, .12);
  animation: toast-in .18s ease-out;
}
.toast svg { flex: none; }
.toast.warn { background: var(--o50); color: var(--o800); border: 2px solid var(--o400); }
.toast.ok { background: var(--inv); color: var(--inv-text); box-shadow: 0 16px 48px rgba(15, 23, 42, .28); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -50%) scale(.94); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

kbd { font: inherit; font-size: 12px; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--card); }

.placeholder { text-align: center; color: var(--text-2); padding: 48px 0; }

/* ---------- Kopfzeile mit Zurueck/Abbrechen ---------- */
.bar { min-height: 44px; }
.bar .back { display: inline-flex; align-items: center; gap: 2px; font-size: 15px; font-weight: 600; min-height: 44px; min-width: 88px; }
.bar-title { margin: 0; font-size: 17px; font-weight: 700; text-align: center; flex: 1; }
.bar-spacer { min-width: 88px; }

/* ---------- Formulare ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
legend { font-size: 13px; font-weight: 600; color: var(--text-3); padding: 0; margin-bottom: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input[type='date'], input[type='time'] {
  font: inherit; width: 100%; min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px;
  border: 1px solid var(--s300); border-radius: 999px; background: var(--card); font-size: 14px; font-weight: 600;
}
.chip input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.chips.tiny { gap: 4px; }
.chips.tiny .chip span { min-height: 36px; padding: 4px 10px; font-size: 12px; }

.btn.primary { background: var(--blue); }
.btn.block { width: 100%; min-height: 52px; font-size: 16px; border-radius: 12px; }
.btn.secondary { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: #B91C1C; }
.btn.danger-outline { background: var(--card); color: var(--r700); border: 1px solid var(--line); }

/* ---------- Vorschau ---------- */
.preview { gap: 4px; }
.preview .muted:first-child { font-weight: 600; }
.preview-title { display: flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 700; }
.preview.warn { background: var(--o50); border-color: var(--o300); }
.preview.warn .preview-title { color: var(--minus-text); }

/* ---------- Eintraege ---------- */
.row .label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row.absence .swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; background: var(--blue); }
.row.absence.special_leave .swatch { background: #7C3AED; }
.row.absence.flex_day .swatch { background: var(--teal); }
.row.absence.sick .swatch { background: var(--text-3); }
.row.absence.planned { border-style: dashed; }
.row.absence.planned .swatch { background: var(--b100); border: 1px dashed var(--blue); }
.row .src { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.icon-btn.small { width: 44px; height: 44px; border: 0; background: transparent; color: var(--text-2); flex: none; }
.icon-btn.small:hover { color: var(--r700); }

/* ---------- Tag korrigieren ---------- */
.label-head { margin: 0; font-size: 13px; font-weight: 600; color: var(--text-3); }
.stamp-row { flex-wrap: wrap; }
.stamp-row .label { flex: 1; }
.stamp-row .time-input { width: 124px; flex: none; padding: 8px 6px; text-align: center; font-weight: 700; font-size: 17px; }
.stamp-row.edited { background: var(--o50); border: 1px dashed var(--o400); }
.stamp-row.edited .time-input { border-color: var(--o400); }
.tag { font-size: 12px; color: var(--minus-text); font-weight: 500; }
.add-row {
  min-height: 52px; border: 1px dashed var(--s400); border-radius: 10px; background: transparent;
  font-weight: 600; color: var(--text-3);
}
.check { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.check strong { display: block; font-size: 14px; }
.check.ok { background: var(--t50); border: 1px solid var(--t200); color: var(--t900); }
.check.warn { background: var(--o50); border: 1px solid var(--o300); color: var(--o800); }
.check svg { flex: none; margin-top: 2px; }
.actions-bar { display: grid; grid-template-columns: auto 1fr; gap: 12px; }
.actions-bar .btn { min-height: 52px; border-radius: 12px; padding: 10px 18px; }

/* ---------- Dialog ---------- */
.dialog { border: 0; border-radius: 16px; padding: 20px; width: min(360px, calc(100% - 32px)); color: var(--text); }
.dialog::backdrop { background: rgba(15, 23, 42, .4); }
.dialog h2 { margin: 0 0 8px; font-size: 18px; }
.dialog p { margin: 0 0 16px; color: var(--text-3); font-size: 14px; }
.dialog .actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- Breite Seiten (Monat, Jahr) ---------- */
main.wide { max-width: 1240px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
.eyebrow { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); }
.title-nav { display: flex; align-items: center; gap: 12px; margin: 4px 0; }
.flip svg, .icon-btn.flip svg { transform: scaleX(-1); }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.head-actions .btn { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; }
a.btn { text-decoration: none; }
a.btn.secondary { color: var(--text); }

.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card-head.wrap { flex-wrap: wrap; }
.card-head h2, .card-title { margin: 0; font-size: 17px; font-weight: 700; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.place-counts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 15px; }
.seg.office { background: var(--s400); }
.seg.home { background: var(--blue); }
.kpis.year { grid-template-columns: 2fr 1fr 1fr 1fr; }
.place-row { display: flex; flex-direction: column; gap: 6px; }
.place-row .segmented span { min-height: 40px; font-size: 14px; }
.place-badge { margin-left: auto; font-size: 11px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.abs-sum { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 4px; }
.abs-sum td { padding: 3px 0; }
.abs-sum td:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.abs-sum tr.sub td { padding: 0 0 4px; font-size: 12px; font-weight: 400; color: var(--text-2); text-align: left; }
.kpi { gap: 4px; }
.kpi .k { font-size: 14px; font-weight: 600; color: var(--text-3); }
.kpi .v { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.kpi .v-sub { font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--text-3); }
.kpi .v.special { color: #7C3AED; }
.kpi.dark { background: var(--inv); border-color: var(--inv); color: var(--inv-text); }
.kpi.dark .k, .kpi.dark .muted { color: var(--inv-text); opacity: .75; }
.v.plus, strong.plus { color: var(--teal); }
.v.minus, strong.minus { color: var(--minus-text); }

.segbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line); margin: 8px 0 4px; }
.seg { height: 100%; }
.seg.taken { background: var(--blue); }
.seg.planned { background: var(--b300); }
.seg.fixed { background: var(--amber); }
.seg.free { background: var(--line); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid transparent; }
.lg.plus { background: var(--t50); border-color: var(--t400); }
.lg.minus { background: var(--o50); border-color: var(--o400); }
.lg.absence { background: var(--s200); }
.lg.holiday { background: var(--o200); }
.lg.open { border: 1px dashed var(--s400); }
.lg.vac { background: var(--blue); }
.lg.vac-planned { background: var(--b100); border: 1px dashed var(--blue); }
.lg.fixed { background: var(--amber); }
.lg.free { background: var(--line); }
.lg.half { background: linear-gradient(135deg, var(--blue) 50%, var(--a100) 50%); }
.lg.special { background: #7C3AED; }
.lg.flex { background: var(--teal); }
.lg.sick { background: var(--text-3); }
.lg.weekend { background: var(--s200); }

/* ---------- Monat ---------- */
.month-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cal { display: grid; grid-template-columns: 32px repeat(7, minmax(0, 1fr)) 74px; gap: 6px; }
.cal-h { font-size: 12px; font-weight: 600; color: var(--text-3); padding-left: 2px; }
.cal-h.wk { text-align: right; }
.cal-kw { font-size: 13px; font-weight: 600; color: var(--text-2); padding-top: 6px; }
.cal-week { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; font-size: 13px; text-align: right; }
.cal-empty { min-height: 84px; }
.cal-day {
  display: flex; flex-direction: column; gap: 1px; min-height: 84px; padding: 6px 7px;
  border: 1px solid var(--line); border-radius: 8px; color: var(--text); font-size: 11px; line-height: 1.3; overflow: hidden;
}
.cal-day:hover { color: var(--text); border-color: var(--blue); }
.cal-num { font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.cal-num svg { color: var(--minus-text); }
.cal-time { color: var(--text-2); }
.cal-day strong { font-size: 13px; }
.cal-abs { color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-dev { font-weight: 600; }
.cal-dev.plus { color: var(--teal); }
.cal-dev.minus { color: var(--minus-text); }
.cal-day.plus { background: var(--t50); border-color: var(--t300); }
.cal-day.minus { background: var(--o50); border-color: var(--o300); }
.cal-day.absence { background: var(--s200); border-color: var(--s300); }
.cal-day.off { background: var(--s100); border-color: var(--s100); }
.cal-day.holiday { background: var(--o100); border-color: var(--o200); }
.cal-day.open { border-style: dashed; border-color: var(--s400); background: var(--card); }
.cal-day.today { outline: 2px solid var(--text); outline-offset: -1px; }

.chart-wrap { overflow-x: auto; }
.chart { display: block; width: 100%; height: auto; }
.chart .zero { stroke: var(--s300); stroke-width: 1; }
.chart .grid { stroke: var(--s100); stroke-width: 1; }
.chart .grid.zero { stroke: var(--s300); }
.chart .bar-plus { fill: var(--plus); }
.chart .bar-minus { fill: var(--minus); }
.chart text { font-family: Inter, system-ui, sans-serif; text-anchor: middle; fill: var(--text-3); }
.chart .bar-val { font-size: 10px; font-weight: 600; fill: var(--text); }
.chart .muted-fill { fill: var(--text-2); }
/* Waben-Heatmap: plus gruen, minus orange, Staerke ueber Deckkraft; Wert steht in der Wabe */
.hex-wrap { max-width: 380px; margin: 0 auto; }
.hex-info { background: var(--s100); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.icon-btn[aria-expanded="true"], .icon-btn.small[aria-expanded="true"], .icon-btn.small[data-toggle]:hover { color: var(--blue); }
.hexmap .hex polygon { fill: var(--s100); stroke: var(--card); stroke-width: 1.5; }
.hexmap .hex.plus polygon { fill: var(--plus); }
.hexmap .hex.minus polygon { fill: var(--minus); }
.hexmap .hex.l1 polygon { fill-opacity: .3; }
.hexmap .hex.l2 polygon { fill-opacity: .6; }
.hexmap .hex.even polygon { fill: var(--green-bg); }
.hexmap .hex.absence polygon { fill: var(--b100); }
.hexmap .hex.open polygon { fill: var(--card); stroke: var(--s300); stroke-dasharray: 3 2; }
.hexmap text { text-anchor: middle; fill: var(--text); }
.hexmap .hex-day { font-size: 9px; fill: var(--text-2); }
.hexmap .hex-val { font-size: 11px; font-weight: 700; }
.hexmap .hex.l2 text, .hexmap .hex.l3 text { fill: #0F172A; } /* dunkel auf kraeftigem Gruen/Orange, auch im Dunkelmodus lesbar */
.hexmap .hex-head { font-size: 10px; fill: var(--text-2); }
.hexmap .hex-head.start { text-anchor: start; font-size: 9px; }
.lg.hexlg { clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); border-radius: 0; }
.lg.hexlg.plus { background: var(--plus); }
.lg.hexlg.minus { background: var(--minus); }
.lg.hexlg.even { background: var(--green-bg); }
.lg.hexlg.absence { background: var(--b100); }
.lg.hexlg.open { background: var(--s300); }
.chart text.start { text-anchor: start; }
.chart text.end { text-anchor: end; }
.chart-h { display: none; }
@media (max-width: 640px) { .chart-wrap.chart-v { display: none; } .chart-h { display: block; } }
.chart .bar-axis, .chart .axis-x { font-size: 11px; fill: var(--text-2); }
.chart .axis-y { font-size: 10px; text-anchor: end; fill: var(--text-2); }
.chart .line { fill: none; stroke: var(--teal); stroke-width: 2.5; stroke-linejoin: round; }
.chart .line.forecast { stroke: var(--blue); stroke-dasharray: 5 5; }
.chart .dot { fill: var(--teal); }
.chart .dot.forecast { fill: var(--card); stroke: var(--blue); stroke-width: 2.5; }
.chart .fc-label { font-size: 11px; font-weight: 700; fill: var(--blue); }

/* ---------- Jahr ---------- */
/* Monate als Spalten, Tage als Zeilen: passt ohne waagerechtes Scrollen auch aufs Handy */
/* Desktop: Monate als Zeilen; Handy: gedreht (Monate als Spalten, Wochentag in der Zelle), passt ohne waagerechtes Scrollen */
.planner { display: grid; gap: 4px; }
.planner.h { grid-template-columns: 40px repeat(31, minmax(0, 1fr)); }
.planner.v { display: none; grid-template-columns: 22px repeat(12, minmax(0, 1fr)); gap: 2px; }
.pl-h { font-size: 10px; color: var(--text-2); text-align: center; align-self: center; }
.pl-m { font-size: 12px; font-weight: 600; color: var(--text); align-self: center; }
.planner.v .pl-h { text-align: right; padding-right: 2px; }
.planner.v .pl-m { font-size: 9px; letter-spacing: -.02em; text-align: center; padding-bottom: 2px; }
.planner.v .pl { font-size: 9px; height: 22px; }
@media (max-width: 640px) { .planner.h { display: none; } .planner.v { display: grid; } }
.pl {
  height: 26px; min-width: 0; overflow: hidden; display: flex; align-items: center; justify-content: center;
  font-size: 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--card); color: var(--text-3);
}
.pl.weekend { background: var(--s200); border-color: var(--s200); }
.pl.holiday { background: var(--o200); border-color: var(--o300); color: var(--o800); font-weight: 700; }
.pl.vacation { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 700; }
.pl.vacation.planned { background: var(--b100); border: 1px dashed var(--blue); color: var(--blue-dark); }
.pl.half { background: linear-gradient(135deg, var(--blue) 50%, var(--a100) 50%); color: var(--ink); }
.pl.half.planned { background: linear-gradient(135deg, var(--b300) 50%, var(--a100) 50%); border-style: dashed; }
.pl.special_leave { background: #7C3AED; border-color: #7C3AED; color: #fff; font-weight: 700; }
.pl.flex_day { background: #15803D; border-color: #15803D; color: #fff; font-weight: 700; }
.pl.sick { background: #475569; border-color: #475569; color: #fff; font-weight: 700; }
.pl.planned:not(.vacation):not(.half) { opacity: .6; border-style: dashed; }
.pl.today { outline: 2px solid var(--text); outline-offset: 0; }

.year-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.balance { width: 100%; border-collapse: collapse; font-size: 14px; }
.card-title.spaced { margin-top: 20px; }
#flex-calc .inline-field { margin-top: 14px; }
.flex-result { margin-top: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* Heatmap Wochentag x Stunde: Prozentzahl in der Zelle (ab 20 %), nicht nur Farbe */
.heat-wrap { overflow-x: auto; }
.heat { display: flex; flex-direction: column; gap: 3px; }
.heat-row { display: grid; grid-template-columns: 26px repeat(auto-fit, minmax(0, 1fr)); gap: 3px; }
.heat-h { font-size: 10px; color: var(--text-2); text-align: center; }
.heat-wd { font-size: 12px; font-weight: 600; color: var(--text-3); align-self: center; }
.heat-c { height: 26px; border-radius: 4px; background: var(--s100); font-size: 9px; font-weight: 600; display: flex; align-items: center; justify-content: center; color: var(--text); }
.heat-c.l1 { background: var(--b50); }
.heat-c.l2 { background: var(--b100); }
.heat-c.l3 { background: var(--b300); }
.heat-c.l4 { background: var(--blue); color: #fff; }
@media (max-width: 640px) { .heat, .heat-row { gap: 2px; } .heat-row { grid-template-columns: 20px repeat(auto-fit, minmax(0, 1fr)); } .heat-c { font-size: 7px; height: 22px; border-radius: 3px; } .heat-h { font-size: 8px; } }
.legend .heat-c { display: inline-block; width: 12px; height: 12px; vertical-align: -2px; margin-right: 4px; }
.balance td { padding: 9px 0; border-bottom: 1px solid var(--s100); }
.balance td:last-child { text-align: right; font-weight: 600; white-space: nowrap; padding-left: 12px; }
.balance tr.sum td { font-weight: 700; border-bottom: 2px solid var(--text); }

/* ---------- Zweispaltig auf breiten Bildschirmen (Heute, Eintragen, Tag, Einstellungen) ---------- */
.split, .split > .col, .settings-grid, .group-block, .cards-2 { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.changelog-page .md { max-height: none; font-size: 14px; }
.md h2 { font-size: 17px; color: var(--text); margin: 16px 0 4px; }
@media (min-width: 960px) {
  main.medium { max-width: 1100px; }
  .split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .settings-grid { display: block; columns: 2; column-gap: 24px; }
  .settings-grid .group-block { break-inside: avoid; margin-bottom: 24px; }
  .cards-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  /* lange Eintragsliste scrollt fuer sich, die Seite bleibt stehen */
  #entries { max-height: calc(100dvh - 230px); overflow-y: auto; padding-right: 4px; }
}

/* ---------- Mobil ---------- */
@media (max-width: 900px) {
  .kpis, .kpis.year { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis .kpi.place { grid-column: 1 / -1; }
  .kpis.year .kpi.wide { grid-column: 1 / -1; }
  @media (max-width: 640px) { .kpis.year { grid-template-columns: minmax(0, 1fr); } }
  .month-grid, .year-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .page-head h1 { font-size: 24px; }
  .kpi .v { font-size: 24px; }
  .cal { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
  .cal-h.kw, .cal-h.wk, .cal-kw, .cal-week { display: none; }
  .cal-day, .cal-empty { min-height: 52px; padding: 4px; }
  .cal-time, .cal-abs, .cal-day strong { display: none; }
  .cal-day.absence .cal-abs { display: block; }
  .cal-day.absence .cal-dev { display: none; }
  .cal-dev { font-size: 10px; }
}

/* ---------- Einstellungen ---------- */
.group { margin: 8px 0 -8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.group-card { padding: 0; gap: 0; }
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; min-height: 56px; border-top: 1px solid var(--s100);
}
.set-row:first-child { border-top: 0; }
.set-row.col { flex-direction: column; align-items: stretch; }
.set-label { display: flex; flex-direction: column; gap: 2px; font-size: 15px; font-weight: 500; }
.set-label .muted { font-weight: 400; }
.stepper { display: inline-flex; align-items: center; gap: 10px; }
.stepper output { min-width: 76px; text-align: center; font-size: 17px; font-weight: 700; }
.step {
  width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  font-size: 20px; line-height: 1;
}
.day-chips { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.chip.square span { justify-content: center; width: 100%; padding: 8px 0; border-radius: 10px; }

.switch {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; margin: 0; cursor: pointer;
  width: 52px; height: 32px; border-radius: 16px; background: var(--s300); transition: background .15s;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 13px;
  background: var(--card); box-shadow: 0 1px 3px rgba(15, 23, 42, .3); transition: transform .15s;
}
.switch:checked { background: var(--blue); }
.switch:checked::after { transform: translateX(20px); }
.toggle-row { display: flex; align-items: center; gap: 12px; font-weight: 600; cursor: pointer; }
#half-which { margin-top: 10px; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--s200); border-radius: 12px; }
.segmented.three { grid-template-columns: repeat(3, 1fr); }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 9px; font-weight: 600; color: var(--text-3); }
.segmented input:checked + span { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(15, 23, 42, .1); }
.segmented input:focus-visible + span { outline: 3px solid var(--blue); }
.inline-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.inline-field input { width: 110px; }

select, .num-input, .date-input, input[type='number'] {
  font: inherit; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text);
}
.num-input { width: 110px; text-align: right; }
.date-input { width: 170px; }
.mini-row { display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.link-btn { border: 0; background: none; padding: 10px 0; min-height: 44px; color: var(--blue); font-weight: 600; text-align: left; }
.row-actions { display: inline-flex; align-items: center; gap: 8px; }
.add-form { display: flex; flex-direction: column; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; align-items: end; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text-3); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.form-actions.start { justify-content: flex-start; flex-wrap: wrap; }
#loc-list { display: flex; flex-direction: column; gap: 8px; }
.loc-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }
@media (max-width: 640px) { .loc-row { grid-template-columns: 1fr auto; } .loc-row .loc-coords { grid-column: 1; grid-row: 2; } }
.note { margin: -8px 0 0; }
.mono { font-family: ui-monospace, monospace; }
.token-box { display: flex; gap: 8px; align-items: center; }
.token-box code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 12px; background: var(--s100); padding: 8px; border-radius: 8px; }
.impact { display: block; }
.changelog summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.md { font-size: 13px; color: var(--text-3); max-height: 320px; overflow-y: auto; }
.md h3 { font-size: 15px; color: var(--text); margin: 12px 0 4px; }
.md h4 { font-size: 13px; color: var(--text); margin: 8px 0 4px; }
.md ul { margin: 0; padding-left: 18px; }
.md code { font-size: 12px; background: var(--s100); padding: 0 4px; border-radius: 4px; }
@media (max-width: 600px) { .grid3 { grid-template-columns: 1fr; } }
.row-actions .link-btn { white-space: nowrap; }
.row-actions .btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* ---------- Schnellzugriff ---------- */
.copy-row { display: flex; flex-direction: column; gap: 4px; }
code.secret { filter: blur(4px); transition: filter .2s; }
code.secret:hover, code.secret:focus { filter: none; }
.guide ol, .guide ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.guide h3 { margin: 8px 0 0; font-size: 15px; }
.guide code { font-size: 12px; background: var(--s100); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.guide .copy { min-height: 36px; padding: 4px 10px; font-size: 13px; margin-top: 4px; }
.set-row.bare { padding: 8px 0 0; border: 0; min-height: 0; }
a.link-row { color: var(--text); }
a.link-row:hover { background: var(--bg); color: var(--text); }

/* ---------- Reports ---------- */
.report-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.report { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; display: flex; flex-direction: column; gap: 20px; color: var(--text); }
.report-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid var(--text); padding-bottom: 10px; }
.report-head h1 { margin: 2px 0 0; font-size: 26px; }
.report h2 { margin: 0 0 8px; font-size: 15px; }
.report-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.report-table th { text-align: left; font-weight: 600; color: var(--text-3); border-bottom: 1px solid var(--text); padding: 4px 6px; }
.report-table td { padding: 3px 6px; border-bottom: 1px solid var(--s100); font-variant-numeric: tabular-nums; }
.report-table tr.off td { color: var(--text-2); background: var(--bg); }
.report-table tr.week td { font-weight: 700; border-bottom: 1px solid var(--line); background: var(--s100); }
.report-table td:nth-last-child(1), .report-table th:nth-last-child(1) { text-align: right; }
.report-sum ul { margin: 0; padding-left: 18px; font-size: 12px; }
.report-sum p { margin: 0; font-size: 12px; }
.report .balance { font-size: 12px; }
.report .balance td { padding: 4px 0; }
.report-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.file-btn { cursor: pointer; display: inline-flex; align-items: center; }

@media (max-width: 600px) {
  .report { padding: 14px; }
  .report-cols { grid-template-columns: 1fr; }
  .report-table { font-size: 11px; }
}

@media print {
  /* Druck immer hell */
  :root, :root[data-theme] {
    color-scheme: light;
    --bg: #F8FAFC;
    --card: #FFFFFF;
    --line: #E2E8F0;
    --text: #0F172A;
    --text-2: #64748B;
    --text-3: #475569;
    --blue: #2563EB;
    --blue-dark: #1E40AF;
    --teal: #15803D;
    --plus: #22C55E;
    --minus: #F97316;
    --minus-text: #C2410C;
    --idle: #94A3B8;
    --s100: #F1F5F9;
    --s150: #E9EEF4;
    --s200: #E2E8F0;
    --s300: #CBD5E1;
    --s400: #94A3B8;
    --s700: #334155;
    --o50: #FFF7ED;
    --o100: #FFEDD5;
    --o200: #FED7AA;
    --o300: #FDBA74;
    --o400: #FB923C;
    --o800: #9A3412;
    --t50: #F0FDF4;
    --t100: #DCFCE7;
    --t200: #BBF7D0;
    --t300: #86EFAC;
    --t400: #4ADE80;
    --t800: #166534;
    --t900: #14532D;
    --b50: #EFF6FF;
    --b100: #DBEAFE;
    --b200: #BFDBFE;
    --b300: #93C5FD;
    --b900: #1E3A8A;
    --a100: #FEF3C7;
    --r700: #B91C1C;
    --green-bg: #DCFCE7;
    --green-text: #166534;
    --inv: #0F172A;
    --inv-text: #FFFFFF;
    --ink: #0F172A;
  }
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff; border: 0; font-size: 10pt; }
  #nav, #stage-badge, #toast, .no-print { display: none !important; }
  main, main.wide { max-width: none; padding: 0; }
  .report { border: 0; padding: 0; border-radius: 0; gap: 12px; }
  .report-table { font-size: 8.5pt; }
  .report-table tr, .report-sum { break-inside: avoid; }
  .report-table thead { display: table-header-group; }
  .report .chart { max-height: 55mm; }
  a { color: inherit; }
  * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* Nicht zu arbeitende Wochentage leicht ausgegraut (Spalte und Zellen) */
.cal-h.nonwork { color: var(--s400); }
.cal-day.nonwork { background: repeating-linear-gradient(135deg, var(--s100) 0 6px, var(--s150) 6px 12px); border-color: var(--s200); color: var(--text-2); }
.cal-day.nonwork.plus { background: var(--t50); color: var(--text); }
.cal-day.nonwork.holiday { background: var(--o100); }
.lg.nonwork { background: repeating-linear-gradient(135deg, var(--s100) 0 3px, var(--s200) 3px 6px); }
.emoji { font-style: normal; }

/* Abweichung je Tag als Abzeichen (Symbol + Text) */
.cal-dev.badge {
  align-self: flex-start; margin-top: auto; padding: 1px 6px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.cal-dev.badge.plus { background: var(--green-bg); color: var(--green-text); }
.cal-dev.badge.minus { background: var(--o100); color: var(--o800); }
.cal-dev.badge.even { background: var(--green-bg); color: var(--green-text); }
.cal-dev.badge.uncounted { background: var(--s100); color: var(--text-2); font-weight: 600; }
.cal-day.uncounted { background: var(--card); border: 1px dashed var(--s300); color: var(--text-2); }
.calendar .notice { margin-bottom: 4px; }
@media (max-width: 600px) {
  .cal-dev.badge { padding: 0 4px; font-size: 10px; }
  .cal-dev .unit { display: none; }
  .cal-dev.badge.uncounted { display: none; }
}

/* ---------- Burger-Menue ---------- */
.menu-btn {
  position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 16px; z-index: 60;
  width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--card);
  display: inline-flex; align-items: center; justify-content: center; color: var(--text);
  box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
}
.menu-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(15, 23, 42, .3); }
.menu {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 80; width: min(320px, 86vw);
  background: var(--card); border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(15, 23, 42, .12);
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
}
.menu-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 8px; font-size: 17px; }
.menu-group { margin: 12px 8px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.menu-item {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 10px; border: 0; border-radius: 10px;
  background: none; color: var(--text); font-size: 15px; font-weight: 500; text-align: left; width: 100%;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--s100); color: var(--text); }
.menu-item svg { color: var(--text-3); flex: none; }
.menu-item span { display: flex; flex-direction: column; }
.menu-item small { font-size: 12px; color: var(--text-2); font-weight: 400; }
main.wide .page-head, .report-bar { padding-right: 56px; }
.title-nav.small { gap: 6px; margin: 0; }
.title-nav.small .icon-btn { width: 36px; height: 36px; }
textarea { font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); resize: vertical; }
.notes { margin: 0; padding-left: 18px; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
@media print { #menu-btn, #menu, #menu-backdrop { display: none !important; } }
.menu-head .icon-btn.small:hover { color: var(--text); }
.email .form-actions { justify-content: flex-start; flex-wrap: wrap; } .email textarea { font-size: 14px; line-height: 1.5; }
.report-sum.email { display: flex; flex-direction: column; gap: 12px; border-top: 1px dashed var(--line); padding-top: 16px; }

/* ---------- Navigation: Eintragen als abgesetzter Mittelknopf ---------- */
.nav a .nav-ic { display: inline-flex; }
.nav a.center { position: relative; }
.nav a.center .nav-ic {
  width: 56px; height: 56px; margin-top: -28px; border-radius: 28px; align-items: center; justify-content: center;
  background: var(--blue); color: #fff; border: 4px solid var(--bg); box-shadow: 0 6px 16px rgba(37, 99, 235, .35);
}
.nav a.center[aria-current='page'] .nav-ic { background: var(--blue-dark); }
.nav a.center:active .nav-ic { transform: scale(.95); }

/* Reiter auf der Eintragen-Seite */
.segmented.tabs { max-width: 520px; width: 100%; margin: 0 auto; }
.segmented.tabs a {
  display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 9px;
  font-weight: 600; color: var(--text-3); text-decoration: none;
}
.segmented.tabs a.active { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(15, 23, 42, .1); }
.capture { display: flex; flex-direction: column; gap: 16px; }
.capture .bar .back { visibility: hidden; } /* "Abbrechen" ist hier ueberfluessig, die Navigation fuehrt weg */
/* Reiter nicht unter den Menueknopf oben rechts schieben */
@media (max-width: 1240px) { .segmented.tabs { margin: 0; width: calc(100% - 56px); } }
.dialog .field { margin-bottom: 16px; }
.file-btn { font-size: 15px; }
.tag-now { font-size: 11px; font-weight: 700; color: var(--teal); background: var(--t100); padding: 1px 6px; border-radius: 999px; margin-left: 4px; }

/* Sync-Button mit drehendem Symbol waehrend des Abgleichs */
.sync-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; flex: none; }
.sync-btn.busy svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sync-btn.busy svg { animation: none; } }

/* ---------- Logo im Seitenkopf (abschaltbar, fuehrt zur Startseite) ---------- */
.page-head .brand { align-self: center; flex: none; width: 48px; height: 48px; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(15, 23, 42, .08); }
.page-head .brand img { width: 100%; height: 100%; display: block; }
.page-head:has(> .brand) { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; column-gap: 14px; }
.page-head:has(> .brand) > .brand { align-self: center; }
.title-nav .icon-btn { flex: none; }
@media (max-width: 640px) {
  .page-head:has(> .brand) { grid-template-columns: auto minmax(0, 1fr); row-gap: 12px; }
  .page-head:has(> .brand) > :nth-child(3) { grid-column: 1 / -1; }
  .page-head .brand { width: 40px; height: 40px; }
}
@media print { .page-head .brand { display: none !important; } }

/* Zeilen mit Buttons: am Handy umbrechen statt ueber den Rand */
@media (max-width: 560px) {
  .set-row:has(.row-actions .btn) { flex-wrap: wrap; }
  .set-row:has(.row-actions .btn) .row-actions { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
}

/* ---------- Datepicker (eigene Komponente, js/datepicker.js) ---------- */
.dp { position: relative; display: block; }
.dp-trigger {
  font: inherit; width: 100%; min-height: 44px; padding: 8px 12px; display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); text-align: left; cursor: pointer;
}
.dp-trigger svg { color: var(--text-2); flex: none; }
.icon-btn.ghost { visibility: hidden; }
.dp-trigger span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-trigger:hover { border-color: var(--s300); }
.dp-trigger:focus-visible { outline: 3px solid var(--b200); outline-offset: 1px; }
.dp-trigger[aria-expanded="true"] { border-color: var(--blue); }
.dp-placeholder { color: var(--text-2); }
.set-row .dp { width: auto; }
.set-row .dp-trigger { width: auto; white-space: nowrap; }
.dp-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 90; width: 300px; padding: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
}
.dp-pop.right { left: auto; right: 0; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-head strong { font-size: 15px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-wd { font-size: 11px; font-weight: 600; color: var(--text-2); text-align: center; padding: 4px 0; }
.dp-wd.we { color: var(--s400); }
.dp-day {
  font: inherit; font-size: 14px; height: 38px; border: 0; border-radius: 8px; background: none; color: var(--text); cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.dp-day:hover { background: var(--s100); }
.dp-day:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.dp-day.we { color: var(--text-2); }
.dp-day.out { color: var(--s400); }
.dp-day.today { box-shadow: inset 0 0 0 1px var(--s300); font-weight: 700; }
.dp-day.mid { background: var(--b50); border-radius: 0; color: var(--text); }
.dp-day.sel { background: var(--blue); color: #fff; font-weight: 700; }
.dp-day.from { border-radius: 8px 0 0 8px; }
.dp-day.to { border-radius: 0 8px 8px 0; }
.dp-day.hol { position: relative; background: var(--o100); color: var(--o800); }
.dp-day.hol::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 2px; background: currentColor; }
.dp-day.hol.mid { background: var(--b50); }
.dp-day.hol.sel { background: var(--blue); color: #fff; }
.dp-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 8px; font-size: 13px; }
.dp-foot .muted { margin-right: auto; }
@media (max-width: 400px) { .dp-pop { width: calc(100vw - 40px); } }
