/* leet.it Office – Gestaltung nach Apples Design-Grundsätzen (heller Modus, Systemblau) */

/* ===================================================================
   1. Grundwerte
   =================================================================== */
:root {
  color-scheme: light;

  /* Akzent: Apple-Systemblau */
  --accent: #007aff;
  --accent-hover: #0068d9;
  --accent-pressed: #0058b8;
  --accent-tint: rgba(0, 122, 255, .1);
  --accent-tint-2: rgba(0, 122, 255, .16);
  --accent-tint-3: rgba(0, 122, 255, .22);
  --focus-ring: 0 0 0 4px rgba(0, 122, 255, .28);

  /* Text (Label-Hierarchie) */
  --label: #1d1d1f;
  --label-2: #424245;
  --label-3: #6e6e73;
  --label-4: #86868b;

  /* Flächen, Füllungen, Trennlinien */
  --bg: #f5f5f7;
  --card: #ffffff;
  --fill: rgba(120, 120, 128, .12);
  --fill-2: rgba(120, 120, 128, .18);
  --fill-3: rgba(120, 120, 128, .07);
  --separator: rgba(60, 60, 67, .14);
  --separator-strong: rgba(60, 60, 67, .26);
  --field-border: #d2d2d7;

  /* Systemfarben */
  --green: #34c759;
  --green-text: #1e7a35;
  --green-tint: rgba(52, 199, 89, .14);
  --orange: #ff9500;
  --orange-text: #a84f00;
  --orange-tint: rgba(255, 149, 0, .15);
  --red: #ff3b30;
  --red-text: #c4140b;
  --red-tint: rgba(255, 59, 48, .1);
  --yellow-mark: rgba(255, 204, 0, .38);

  /* Materialien (Milchglas) */
  --material-bar: rgba(255, 255, 255, .72);
  --material-thick: rgba(255, 255, 255, .86);
  --material-blur: saturate(180%) blur(20px);

  /* Form */
  --radius-s: 8px;
  --radius: 10px;
  --radius-card: 16px;
  --radius-sheet: 20px;
  --shadow-card: 0 0 0 1px rgba(0, 0, 0, .035), 0 1px 3px rgba(0, 0, 0, .05);
  --shadow-raised: 0 0 0 1px rgba(0, 0, 0, .04), 0 6px 20px rgba(0, 0, 0, .08);
  --shadow-float: 0 0 0 1px rgba(0, 0, 0, .05), 0 12px 36px rgba(0, 0, 0, .16);
  --shadow-sheet: 0 0 0 1px rgba(0, 0, 0, .05), 0 24px 70px rgba(0, 0, 0, .25);

  /* Schrift: Systemschrift (auf Apple-Geräten San Francisco mit optischer Größe) */
  --font: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  /* Bewegung: kritisch gedämpfte Feder (Dämpfung 1,0 · Antwort 0,35 s) */
  --spring: cubic-bezier(.22, .9, .3, 1);
  --spring-time: .52s;
  --press-time: .1s;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring: linear(0, .0441, .1429, .2619, .382, .4931, .5906, .6735, .7421, .798, .8429, .8786, .9066, .9285, .9454, .9585, .9686, .9762, .9821, .9865, .9899, .9924, .9943, .9958, .9968, .9977, .9983, .9987, 1);
  }
}

/* ===================================================================
   2. Typografie – Laufweite und Zeilenabstand je nach Größe
   =================================================================== */
* { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: .9375rem;            /* 15 px, wächst mit der Schriftgröße des Geräts */
  line-height: 1.47;
  letter-spacing: -.009em;
  color: var(--label);
  background: var(--bg);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; -webkit-tap-highlight-color: transparent; }
a:hover { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
h1, h2, h3 { margin: 0 0 .6rem; font-weight: 600; }
h1 { font-size: 1.875rem; line-height: 1.12; letter-spacing: -.022em; font-weight: 700; }
h2 { font-size: 1.0625rem; line-height: 1.3; letter-spacing: -.017em; }
h2 small { font-weight: 400; letter-spacing: -.005em; }
.h3 { font-size: .9375rem; margin-top: 1.5rem; color: var(--label-2); letter-spacing: -.01em; }
p { margin: 0 0 .75rem; }
small, .small { letter-spacing: 0; }
code { font-family: var(--mono); font-size: .88em; background: var(--fill-3); padding: .08em .38em; border-radius: 5px; }
[hidden] { display: none !important; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
::selection { background: rgba(0, 122, 255, .2); }
:focus-visible { outline: 3px solid rgba(0, 122, 255, .5); outline-offset: 2px; border-radius: 6px; }
button, summary, label, select, input[type=checkbox], [role=button] { -webkit-tap-highlight-color: transparent; }

/* ===================================================================
   3. Kopfzeile – schwebendes Milchglas, Trennlinie erst beim Scrollen
   =================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--material-bar);
  -webkit-backdrop-filter: var(--material-blur);
  backdrop-filter: var(--material-blur);
  box-shadow: 0 1px 0 transparent;
  transition: box-shadow .25s ease;
  padding-top: env(safe-area-inset-top);
  view-transition-name: topbar;
}
body.is-scrolled .topbar { box-shadow: 0 1px 0 var(--separator); }
.topbar-inner { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 1.25rem; padding: .55rem 1.25rem; min-height: 56px; }
.brand { display: flex; align-items: center; gap: .5rem; color: var(--label); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand img { height: 32px; width: auto; }
.brand span { font-size: 1.0625rem; color: var(--label-3); font-weight: 500; letter-spacing: -.017em; }
.mainnav { display: flex; gap: .15rem; flex: 1; }
.mainnav a {
  color: var(--label-2); padding: .42rem .8rem; border-radius: 999px;
  font-weight: 500; font-size: .875rem; letter-spacing: -.01em;
  transition: background-color .15s ease, color .15s ease, transform var(--press-time) ease-out;
}
.mainnav a:hover { background: var(--fill-3); color: var(--label); text-decoration: none; }
.mainnav a:active { transform: scale(.96); background: var(--fill); }
.mainnav a.active { color: var(--accent); background: var(--accent-tint); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .4rem; }
.topbar-right form { margin: 0; }

/* Laufender Timer als „Live-Aktivität“-Kapsel */
.timerbar { padding: 0 1.25rem .55rem; }
.timerbar-inner {
  max-width: 1140px; margin: 0 auto;
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .4rem .45rem .4rem 1rem; border-radius: 999px;
  background: rgba(28, 28, 30, .92); color: #fff;
  -webkit-backdrop-filter: var(--material-blur); backdrop-filter: var(--material-blur);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  animation: materialize var(--spring-time) var(--spring) both;
}
.timer-clock { font-variant-numeric: tabular-nums; font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em; }
.timer-what { color: rgba(255, 255, 255, .78); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .875rem; }
.timerbar-actions { display: flex; gap: .3rem; }
.timerbar form { margin: 0; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: #30d158; box-shadow: 0 0 0 0 rgba(48, 209, 88, .6); animation: pulse 2s ease-out infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(48, 209, 88, .55); } 70% { box-shadow: 0 0 0 8px rgba(48, 209, 88, 0); } 100% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0); } }

/* ===================================================================
   4. Grundlayout
   =================================================================== */
.container { max-width: 1180px; margin: 0 auto; padding: 1.75rem 1.25rem 3.5rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.page-head h1 { margin-bottom: .2rem; }
.page-head .sub { color: var(--label-3); margin: 0; font-size: .9375rem; }
.crumbs { margin: 0 0 .35rem; font-size: .8125rem; color: var(--label-3); display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; letter-spacing: 0; font-weight: 500; }
.crumbs .icon { width: 13px; height: 13px; color: var(--label-4); }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }

.card {
  background: var(--card); border-radius: var(--radius-card);
  padding: 1.25rem 1.4rem; box-shadow: var(--shadow-card); margin-bottom: 1.1rem;
}
.card.narrow { max-width: 720px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .8rem; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 1.1rem; align-items: start; }
.grid > .card, .grid > .stack-lg > .card { margin-bottom: 0; }
.grid + .card, .grid + .grid { margin-top: 1.1rem; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.stack > * + * { margin-top: .9rem; }
.stack-lg { display: grid; gap: 1.1rem; grid-template-columns: minmax(0, 1fr); }
.grid > *, .billing-layout > * { min-width: 0; }
.top-line { border-top: 1px solid var(--separator); margin-top: 1rem; padding-top: .9rem; }
.row-end { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; align-items: center; }
.row-between { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; align-items: center; }
.row-between form, .row-end form { margin: 0; }
.danger-zone { margin-top: .5rem; }
.muted { color: var(--label-3); }
.small { font-size: .8125rem; line-height: 1.4; }
.block { display: block; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.empty { color: var(--label-3); padding: .5rem 0; margin: 0; }
.hint { color: var(--label-3); font-size: .8125rem; margin-top: .8rem; line-height: 1.4; }
.prose { white-space: normal; overflow-wrap: anywhere; }

/* ===================================================================
   5. Kennzahlen
   =================================================================== */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1.1rem; margin-bottom: 1.1rem; }
.stat {
  background: var(--card); border-radius: var(--radius-card); padding: 1rem 1.2rem;
  display: flex; flex-direction: column; gap: .1rem; color: var(--label); box-shadow: var(--shadow-card);
}
.stat-label { color: var(--label-3); font-size: .8125rem; font-weight: 500; letter-spacing: 0; }
.stat-value { font-size: 1.875rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.022em; line-height: 1.15; }
.stat-value small { font-size: .9375rem; font-weight: 500; color: var(--label-3); letter-spacing: -.01em; }
.stat-foot { font-size: .8125rem; color: var(--accent); display: flex; align-items: center; gap: .2rem; font-weight: 500; margin-top: .15rem; }
.stat-foot .icon { width: 13px; height: 13px; }
.stat-link { transition: box-shadow .2s ease, transform var(--press-time) ease-out; }
.stat-link:hover { box-shadow: var(--shadow-raised); text-decoration: none; }
.stat-link:active { transform: scale(.98); }

/* ===================================================================
   6. Knöpfe – Rückmeldung schon beim Drücken
   =================================================================== */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-size: .9375rem; font-weight: 600; letter-spacing: -.012em; line-height: 1.2;
  min-height: 2.5rem; padding: .55rem 1.05rem; border-radius: var(--radius); border: 0;
  background: var(--accent); color: #fff; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease, opacity .15s ease, transform var(--press-time) ease-out, box-shadow .15s ease;
  --spin: #fff;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn:active { background: var(--accent-pressed); transform: scale(.97); transition-duration: 0s, 0s, 0s, var(--press-time), 0s; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .38; cursor: not-allowed; transform: none; }
.btn:disabled:hover { background: var(--accent); }

.btn-secondary { background: var(--accent-tint); color: var(--accent); --spin: var(--accent); }
.btn-secondary:hover { background: var(--accent-tint-2); }
.btn-secondary:active { background: var(--accent-tint-3); }
.btn-secondary:disabled:hover { background: var(--accent-tint); }

.btn-ghost { background: transparent; color: var(--accent); --spin: var(--accent); }
.btn-ghost:hover { background: var(--fill-3); }
.btn-ghost:active { background: var(--fill); }

.btn-light { background: #fff; color: var(--label); --spin: var(--label); }
.btn-light:hover { background: #f2f2f7; }
.btn-light:active { background: #e5e5ea; }
.btn-on-dark { color: #fff; --spin: #fff; }
.btn-on-dark:hover { background: rgba(255, 255, 255, .14); }
.btn-on-dark:active { background: rgba(255, 255, 255, .22); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #e6342a; }
.btn-danger:active { background: #cc2e25; }
.btn-danger-ghost { background: transparent; color: var(--red-text); --spin: var(--red-text); }
.btn-danger-ghost:hover { background: var(--red-tint); }
.btn-danger-ghost:active { background: rgba(255, 59, 48, .18); }

.btn-sm { min-height: 2rem; padding: .34rem .72rem; font-size: .8125rem; border-radius: var(--radius-s); letter-spacing: -.005em; }
.btn-sm .icon { width: 15px; height: 15px; }
.btn-block { width: 100%; }

/* Ladezustand: sofort sichtbar, verhindert doppeltes Absenden */
.btn.is-busy { color: transparent !important; pointer-events: none; }
.btn.is-busy::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 1.05em; height: 1.05em; margin: -.525em 0 0 -.525em;
  border-radius: 50%; border: 2px solid var(--spin); border-right-color: transparent; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 999px; border: 0; background: transparent;
  color: var(--label-3); cursor: pointer; padding: 0;
  transition: background-color .15s ease, color .15s ease, transform var(--press-time) ease-out;
}
.icon-btn:hover { background: var(--fill-3); color: var(--label); text-decoration: none; }
.icon-btn:active { background: var(--fill); transform: scale(.9); }

.chip {
  font: inherit; font-size: .8125rem; font-weight: 500; padding: .28rem .7rem; border-radius: 999px; border: 0;
  background: var(--fill); color: var(--label-2); cursor: pointer;
  transition: background-color .15s ease, color .15s ease, transform var(--press-time) ease-out;
}
.chip:hover { background: var(--accent-tint); color: var(--accent); }
.chip:active { transform: scale(.94); background: var(--accent-tint-2); }

/* ===================================================================
   7. Formulare
   =================================================================== */
.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.field > span, .field > label, .field > .label { font-size: .8125rem; font-weight: 600; color: var(--label-2); letter-spacing: -.005em; }
.field small { font-weight: 400; color: var(--label-3); }
input, select, textarea {
  font: inherit; font-size: 1rem; letter-spacing: -.012em; color: var(--label);
  background: #fff; border: 1px solid var(--field-border); border-radius: var(--radius);
  padding: .58rem .8rem; width: 100%; min-width: 0; min-height: 2.5rem;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--label-4); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: #b9b9bf; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
select {
  -webkit-appearance: none; appearance: none; padding-right: 2.2rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='14' viewBox='0 0 12 14'%3E%3Cpath d='M3 5l3-3 3 3M3 9l3 3 3-3' fill='none' stroke='%236e6e73' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8rem center; background-size: 12px 14px;
}
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--accent); cursor: pointer; flex: none; }
input[type=file] { padding: .35rem; font-size: .875rem; color: var(--label-3); cursor: pointer; }
input[type=file]::file-selector-button {
  font: inherit; font-weight: 600; font-size: .8125rem; color: var(--accent); background: var(--accent-tint);
  border: 0; border-radius: var(--radius-s); padding: .38rem .75rem; margin-right: .7rem; cursor: pointer;
  transition: background-color .15s ease;
}
input[type=file]::file-selector-button:hover { background: var(--accent-tint-2); }
input[type=search]::-webkit-search-cancel-button { cursor: pointer; }
input[type=date] { min-height: 2.5rem; }
textarea { resize: vertical; line-height: 1.47; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset:disabled input, fieldset:disabled select, fieldset:disabled textarea { background: var(--fill-3); color: var(--label-2); border-color: transparent; }
fieldset > * + * { margin-top: .9rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1rem; }
.form-grid.compact { gap: .75rem .9rem; }
.span-2 { grid-column: span 2; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .9375rem; cursor: pointer; }
.check input[type=checkbox]:not(.switch) { margin-top: .15rem; }
.error { color: var(--red-text); font-size: .8125rem; font-style: normal; }
.inline-form { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.inline-form .grow, .extra-row .grow { flex: 1 1 220px; }
.w-sm { flex: 0 1 150px; }
.w-xs { flex: 0 1 90px; }
.quick-hours { display: flex; gap: .35rem; margin-top: .15rem; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .4rem; }
.chip-check { display: inline-flex; position: relative; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span {
  font-size: .875rem; font-weight: 500; padding: .34rem .8rem; border-radius: 999px; background: var(--fill); color: var(--label-2); cursor: pointer;
  transition: background-color .15s ease, color .15s ease, transform var(--press-time) ease-out;
}
.chip-check:active span { transform: scale(.95); }
.chip-check input:checked + span { background: var(--accent); color: #fff; }
.chip-check input:focus-visible + span { box-shadow: var(--focus-ring); }
.filter-bar { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.filter-bar .field { flex: 1 1 150px; }
.code-input { font-size: 1.6rem; letter-spacing: .32em; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }

/* Schalter wie in den iPhone-Einstellungen (für An/Aus-Werte) */
input.switch {
  -webkit-appearance: none; appearance: none;
  width: 51px; height: 31px; min-height: 0; padding: 0; margin: 0; border: 0; border-radius: 999px;
  background: rgba(120, 120, 128, .16); position: relative; flex: none; cursor: pointer;
  transition: background-color .25s ease;
}
input.switch::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 999px; background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 3px 1px rgba(0, 0, 0, .06);
  transition: transform var(--spring-time) var(--spring), width .2s ease;
}
input.switch:checked { background: var(--green); }
input.switch:checked::before { transform: translateX(20px); }
input.switch:active::before { width: 32px; }
input.switch:checked:active::before { transform: translateX(15px); }
input.switch:focus { box-shadow: var(--focus-ring); border: 0; }
.check:has(> input.switch) { align-items: center; justify-content: space-between; flex-direction: row-reverse; gap: 1rem; padding: .2rem 0; }

/* ===================================================================
   8. Meldungen und Badges
   =================================================================== */
.flash {
  padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1.1rem; font-size: .9375rem; font-weight: 500;
  animation: materialize var(--spring-time) var(--spring) both;
}
.flash-ok { background: var(--green-tint); color: var(--green-text); }
.flash-error { background: var(--red-tint); color: var(--red-text); }
.flash-info { background: var(--accent-tint); color: var(--accent-pressed); }
.badge {
  display: inline-block; font-size: .75rem; font-weight: 600; letter-spacing: 0; line-height: 1.35;
  padding: .12rem .55rem; border-radius: 999px; white-space: nowrap; vertical-align: 1px;
}
.badge-ok { background: var(--green-tint); color: var(--green-text); }
.badge-warn { background: var(--orange-tint); color: var(--orange-text); }
.badge-muted { background: var(--fill); color: var(--label-3); }
a.badge:hover { text-decoration: none; filter: brightness(.96); }

@keyframes materialize {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to { opacity: 1; transform: none; }
}

/* ===================================================================
   9. Tabellen
   =================================================================== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -.4rem; padding: 0 .4rem; }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; letter-spacing: -.006em; }
.table th {
  text-align: left; font-size: .75rem; font-weight: 600; letter-spacing: .01em; color: var(--label-3);
  padding: .45rem .6rem; border-bottom: 1px solid var(--separator); white-space: nowrap;
}
.table td { padding: .7rem .6rem; border-bottom: 1px solid var(--separator); vertical-align: top; }
.table tbody tr { transition: background-color .15s ease; }
.table tbody tr:hover { background: rgba(0, 0, 0, .018); }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .num .icon-btn { vertical-align: middle; }
.table td .icon-btn { margin-top: -.5rem; margin-bottom: -.5rem; vertical-align: middle; }
.table .inline-details { vertical-align: middle; }
.row-muted td { color: var(--label-3); }
.row-highlight td { background: var(--accent-tint); animation: highlight 2.4s ease-out both; }
@keyframes highlight { from { background: var(--accent-tint-3); } to { background: var(--accent-tint); } }
.mini-list { margin: 0; padding-left: 1.05rem; }
.mini-list li + li { margin-top: .15rem; }

/* ===================================================================
   10. Listen
   =================================================================== */
.link-list, .entry-list, .contact-list, .meeting-list, .todo-list, .todo-summary, .checks { list-style: none; margin: 0; padding: 0; }
.link-list li a, .entry-list a, .result {
  border-radius: var(--radius); transition: background-color .15s ease, transform var(--press-time) ease-out;
}
.link-list li + li, .entry-list li + li, .result-list li + li { border-top: 1px solid var(--separator); }
.link-list li a { display: flex; justify-content: space-between; gap: .75rem; padding: .7rem .6rem; margin: 0 -.6rem; color: var(--label); align-items: baseline; flex-wrap: wrap; }
.link-list li a:hover, .entry-list a:hover { background: var(--fill-3); text-decoration: none; }
.link-list li a:active, .entry-list a:active, .result:active { background: var(--fill); transform: scale(.995); }
.entry-list a { display: flex; justify-content: space-between; gap: .75rem; padding: .62rem .6rem; margin: 0 -.6rem; color: var(--label); }
.entry-main { display: flex; flex-direction: column; min-width: 0; }
.entry-title { font-weight: 600; font-size: .9375rem; letter-spacing: -.012em; }
.entry-sub { font-size: .8125rem; color: var(--label-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-hours { font-weight: 600; font-variant-numeric: tabular-nums; }
.contact-list li { border-bottom: 1px solid var(--separator); padding: .6rem 0; }
.contact-list li:last-child { border-bottom: 0; }
.contact { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.contact-list form { margin-top: .7rem; }

.todo-group + .todo-group { margin-top: 1.3rem; }
.todo-group-head { font-size: .875rem; margin-bottom: .2rem; display: flex; gap: .35rem; flex-wrap: wrap; align-items: baseline; }
.todo { display: flex; align-items: flex-start; gap: .65rem; padding: .5rem 0; border-bottom: 1px solid var(--separator); }
.todo:last-child { border-bottom: 0; }
.todo-check { display: flex; align-items: center; height: 36px; padding: 0 .1rem; cursor: pointer; }
.todo-check input { width: 20px; height: 20px; }
.todo-text { flex: 1; min-width: 0; padding-top: .42rem; overflow-wrap: anywhere; }
.todo-actions { display: flex; align-items: center; gap: .2rem; flex: none; }
.todo-actions form { margin: 0; }
.todo-list.done .todo-check { color: var(--green); width: 20px; }
.todo-list.done .todo-text { color: var(--label-3); }
.todo-add { display: flex; gap: .5rem; align-items: flex-start; margin-bottom: .9rem; }
.todo-add textarea { flex: 1; }
.inline-edit { margin: .4rem 0 .8rem; padding: .75rem; background: var(--fill-3); border-radius: var(--radius); }
.inline-edit .todo-add { margin: 0; }
.batch-bar { position: sticky; bottom: 1rem; display: flex; justify-content: flex-end; margin-top: .4rem; pointer-events: none; }
.batch-bar .btn { pointer-events: auto; box-shadow: 0 8px 24px rgba(0, 122, 255, .3); animation: materialize var(--spring-time) var(--spring) both; }
.todo-summary { margin-bottom: 1rem; }
.todo-summary li { display: flex; gap: .5rem; padding: .35rem 0; }
.todo-summary .icon { color: var(--green); margin-top: .1rem; }
.linked { margin-bottom: .5rem; }

.meeting-list li { border-bottom: 1px solid var(--separator); }
.meeting-list li:last-child { border-bottom: 0; }
.meeting-list summary { display: flex; gap: .9rem; align-items: baseline; padding: .7rem 0; cursor: pointer; list-style: none; font-weight: 400; color: var(--label); }
.meeting-list summary::-webkit-details-marker { display: none; }
.meeting-date { color: var(--label-3); font-size: .8125rem; font-variant-numeric: tabular-nums; flex: none; }
.meeting-title { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.meeting-hours { font-variant-numeric: tabular-nums; font-weight: 600; flex: none; }
.meeting-body { padding: 0 0 .9rem; }

/* Aufklappbare Bereiche mit Pfeil, der sich mitdreht */
details > summary { cursor: pointer; font-weight: 600; color: var(--label-2); }
details > summary::-webkit-details-marker { display: none; }
details.top-line > summary, .card > details > summary { list-style: none; color: var(--accent); display: inline-flex; align-items: center; gap: .4rem; }
.details-card > summary { list-style: none; display: flex; align-items: center; gap: .55rem; }
.details-card > summary h2 { margin: 0; }
.details-card > summary::after, details.top-line > summary::before, .card > details > summary::before {
  content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform var(--spring-time) var(--spring); flex: none; margin: 0 .15rem;
}
.details-card > summary::after { color: var(--label-4); }
.details-card[open]:not(.is-closing) > summary::after,
details.top-line[open]:not(.is-closing) > summary::before,
.card > details[open]:not(.is-closing) > summary::before { transform: rotate(45deg); }
.details-card[open] > summary { margin-bottom: 1.1rem; }

.akte dt { font-size: .75rem; font-weight: 600; color: var(--label-3); margin-top: 1rem; letter-spacing: .01em; }
.akte dt:first-child { margin-top: 0; }
.akte dd { margin: .2rem 0 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0 0 .8rem; font-size: .9375rem; }
.kv dt { color: var(--label-3); }
.kv dd { margin: 0; }

/* ===================================================================
   11. Abrechnung
   =================================================================== */
.billing-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.1rem; align-items: start; }
.billing-layout > .stack-lg > .card { margin-bottom: 0; }
.summary { position: sticky; top: 84px; }
.summary .sum-table { transition: opacity .2s ease; }
.summary.stale .sum-table { opacity: .4; }
.sum-table { width: 100%; border-collapse: collapse; margin: 1rem 0 .7rem; font-size: .875rem; }
.sum-table td { padding: .32rem 0; vertical-align: top; }
.sum-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: .5rem; }
.sum-table tr.sep td { border-top: 1px solid var(--separator); padding-top: .6rem; }
.sum-table tr.total td { border-top: 1.5px solid var(--label); font-weight: 700; padding-top: .55rem; font-size: 1.0625rem; letter-spacing: -.017em; }
.extras { display: grid; gap: .65rem; }
.extra-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; }
.inline-details { display: inline-block; position: relative; }
.inline-details > summary { list-style: none; }
.inline-details > summary::-webkit-details-marker { display: none; }
/* Popover wächst aus dem Knopf, der es öffnet (oben rechts) */
.popover {
  position: absolute; right: 0; top: 40px; z-index: 5; width: 250px; text-align: left; display: grid; gap: .75rem;
  background: var(--material-thick); -webkit-backdrop-filter: var(--material-blur); backdrop-filter: var(--material-blur);
  border-radius: 14px; box-shadow: var(--shadow-float); padding: 1rem;
  transform-origin: calc(100% - 18px) -8px;
}
.inline-details[open] > .popover { animation: popover-in var(--spring-time) var(--spring) both; }
@keyframes popover-in { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
.logo-preview { max-width: 160px; display: block; margin-bottom: .8rem; border-radius: var(--radius-s); box-shadow: 0 0 0 1px var(--separator); }

/* ===================================================================
   12. Anmeldung und Einrichtung
   =================================================================== */
body.auth { background: var(--bg); }
.auth-wrap { max-width: 440px; margin: 0 auto; padding: calc(3rem + env(safe-area-inset-top)) 1rem 3rem; }
.auth-wrap.auth-wide { max-width: 760px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: .65rem; margin-bottom: 1.6rem; }
.auth-brand img { height: 64px; }
.auth-brand span { font-size: 1.375rem; color: var(--label-3); font-weight: 500; letter-spacing: -.02em; }
.auth-card { padding: 1.6rem 1.6rem 1.4rem; border-radius: 20px; }
.auth-card h1 { font-size: 1.5rem; letter-spacing: -.02em; }
.auth-card .btn { min-height: 2.75rem; }
.qr-wrap { display: flex; justify-content: center; margin: .5rem 0; }
.qr-wrap img { width: 220px; height: 220px; image-rendering: pixelated; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px var(--separator); }
.secret { font-size: .9375rem; letter-spacing: .05em; }
.steps { padding-left: 1.2rem; }
.checks li { padding: .3rem 0; display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.checks li.ok { color: var(--green-text); }
.checks li.warn { color: var(--orange-text); }
.checks li.bad { color: var(--red-text); }
.checks li .small { color: var(--label-2); flex-basis: 100%; padding-left: 1.6rem; }

/* ===================================================================
   13. Teams-Modus
   =================================================================== */
.teams-pill {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .8125rem; font-weight: 700; letter-spacing: -.005em;
  color: #1d1d1f; background: var(--orange); padding: .3rem .75rem; border-radius: 999px;
  box-shadow: 0 2px 10px rgba(255, 149, 0, .35);
}
.teams-pill .icon { width: 15px; height: 15px; }
body.teams .topbar, body.teams.is-scrolled .topbar { box-shadow: 0 2px 0 var(--orange); }
body.teams .sensitive { filter: blur(7px); -webkit-filter: blur(7px); user-select: none; }
body.teams input.sensitive:focus, body.teams textarea.sensitive:focus { filter: none; -webkit-filter: none; user-select: auto; }
body.teams .timer-clock.sensitive { filter: blur(6px); }

/* Dialog: auf dem Desktop aus dem Knopf wachsend, auf dem iPhone als Sheet zum Wegwischen */
.sheet-dialog {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden; color: var(--label);
}
.sheet-dialog[open] { display: grid; place-items: center; }
.sheet-dialog::backdrop { background: transparent; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .28); }
.sheet {
  position: relative; width: min(460px, calc(100vw - 2rem)); max-height: calc(100dvh - 4rem); overflow: auto;
  background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: saturate(180%) blur(40px); backdrop-filter: saturate(180%) blur(40px);
  border-radius: var(--radius-sheet); box-shadow: var(--shadow-sheet); padding: 1.4rem 1.5rem 1.2rem;
  will-change: transform, opacity;
}
.sheet-head { touch-action: none; }
.sheet-grabber { display: none; width: 36px; height: 5px; border-radius: 999px; background: rgba(60, 60, 67, .3); margin: -.6rem auto .9rem; }
.sheet h2 { font-size: 1.25rem; letter-spacing: -.02em; margin-bottom: .35rem; }
.sheet input[type=text] { font-size: 1.0625rem; padding: .75rem .9rem; border-radius: 12px; }
.ac-list { list-style: none; margin: .6rem 0 .9rem; padding: 0; max-height: 320px; overflow-y: auto; }
.ac-list:empty { display: none; }
.ac-item {
  display: flex; align-items: center; width: 100%; text-align: left; font: inherit; padding: .65rem .8rem; border: 0;
  border-radius: var(--radius); background: transparent; color: var(--label); cursor: pointer;
  transition: background-color .12s ease, transform var(--press-time) ease-out;
}
.ac-item:hover, .ac-item.active { background: var(--accent-tint); color: var(--accent-pressed); }
.ac-item:active { transform: scale(.98); background: var(--accent-tint-2); }
.ac-item mark { background: transparent; color: inherit; font-weight: 700; }
.ac-empty { padding: .65rem .8rem; color: var(--label-3); }
.ac-static { display: grid; gap: .2rem; margin-top: .8rem; }

/* ===================================================================
   14. To-Dos, Notizen, Abrechnung (Details)
   =================================================================== */
.todo-age { display: inline-block; margin-left: .5rem; font-size: .75rem; color: var(--label-4); font-variant-numeric: tabular-nums; }
.filter-input { width: 220px; }
.card-warn { background: #fffaf0; box-shadow: 0 0 0 1px rgba(255, 149, 0, .3), 0 1px 3px rgba(0, 0, 0, .04); }
.fix-cell { min-width: 230px; }
.fix-form { display: flex; gap: .4rem; align-items: flex-end; }
.fix-form .field { flex: 1; }
.fix-form .field > span { font-weight: 500; }
.fix-form input, .fix-form select { padding: .42rem .6rem; min-height: 2.125rem; font-size: .9375rem; }
.fix-form select { padding-right: 2rem; }

a.todo-link { color: var(--label); text-decoration: none; transition: color .15s ease; }
a.todo-link:hover { color: var(--accent); }
a.todo-link:active { opacity: .6; }
.note-flag { display: inline-flex; margin-left: .4rem; color: var(--accent); vertical-align: -2px; }
.note-flag .icon { width: 15px; height: 15px; }
.todo-note { display: block; margin-top: .2rem; font-size: .8125rem; color: var(--label-3); }
.todo-note .icon { width: 14px; height: 14px; color: var(--accent); }
.note-area { background: #fffdf5; border-color: #ebe2c4; }
.note-area:focus { background: #fff; }
.field > span .icon { width: 15px; height: 15px; color: var(--accent); }
form.inline { display: inline; margin-left: .5rem; }

/* ===================================================================
   15. Tab-Leiste (iPhone)
   =================================================================== */
.tabbar { display: none; }
.hide-sm { }

/* ===================================================================
   16. Kundenlogos
   =================================================================== */
.clogo { display: inline-block; flex: none; width: auto; object-fit: contain; background: #fff; border-radius: 7px; padding: 2px; vertical-align: middle; box-shadow: 0 0 0 1px var(--separator); }
.clogo-xs { height: 20px; max-width: 60px; border-radius: 5px; padding: 1px; }
.clogo-sm { height: 26px; max-width: 80px; border-radius: 6px; }
.clogo-md { height: 40px; max-width: 120px; border-radius: 9px; }
.clogo-lg { height: 60px; max-width: 170px; padding: 5px; border-radius: 14px; box-shadow: var(--shadow-card); }
.clogo-bar { height: 32px; max-width: 150px; padding: 0; border-radius: 0; background: transparent; box-shadow: none; }
.clogo-empty { width: 60px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 600; color: var(--label-3); background: var(--fill); box-shadow: none; }
.with-logo { display: inline-flex; align-items: center; gap: .5rem; min-width: 0; }
.title-with-logo { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.title-with-logo h1 { overflow-wrap: anywhere; }
.brand-customer { display: flex; align-items: center; padding-left: 1rem; margin-left: -.35rem; box-shadow: -1px 0 0 var(--separator); min-height: 32px; }
.brand-customer:hover { text-decoration: none; }
.ac-item .clogo { margin-right: .6rem; }
.logo-edit { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.logo-edit .stack-sm { flex: 1 1 260px; display: grid; gap: .45rem; }
.logo-field > span { font-size: .8125rem; font-weight: 600; color: var(--label-2); }

/* ===================================================================
   17. Suche
   =================================================================== */
.search-card { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.search-card .grow { flex: 1 1 280px; }
.search-card .search-all { align-self: center; }
.search-card input[type=search], .search-inline input {
  padding-left: 2.3rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.5 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: .8rem center; background-size: 16px;
}
.search-inline { display: flex; gap: .5rem; align-items: center; margin: -.3rem 0 1.1rem; }
.search-inline input { flex: 1; min-width: 0; background-color: var(--fill); border-color: transparent; }
.search-inline input:focus { background-color: #fff; }
.search-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.1rem; }
.search-tabs a {
  background: var(--card); box-shadow: var(--shadow-card); border-radius: 999px; padding: .32rem .85rem;
  color: var(--label-2); font-size: .875rem; font-weight: 500;
  transition: background-color .15s ease, color .15s ease, transform var(--press-time) ease-out;
}
.search-tabs a:hover { color: var(--accent); text-decoration: none; }
.search-tabs a:active { transform: scale(.95); }
.search-tabs .count { color: var(--label-4); font-weight: 600; margin-left: .15rem; font-variant-numeric: tabular-nums; }
.result-list { list-style: none; margin: 0; padding: 0; }
.result { display: grid; gap: .22rem; padding: .75rem .6rem; margin: 0 -.6rem; color: var(--label); }
.result:hover { background: var(--fill-3); text-decoration: none; }
.result-title { font-weight: 600; overflow-wrap: anywhere; letter-spacing: -.012em; }
.result-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .45rem; font-size: .8125rem; color: var(--label-3); }
.result-meta .dot { color: var(--label-4); }
.result-snippet { font-size: .875rem; color: var(--label-2); overflow-wrap: anywhere; }
.result-label { color: var(--label-3); font-weight: 600; }
.result mark, .result-title mark { background: var(--yellow-mark); color: inherit; border-radius: 3px; padding: 0 .1em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ===================================================================
   18. Abrechnungszeitraum, To-Do-Formular
   =================================================================== */
.period-card { margin-bottom: 1.1rem; }
.period-card .inline-form .grow { flex: 1 1 280px; max-width: 520px; }
.period-card p { margin: .75rem 0 0; }
.period-card p + p { margin-top: .3rem; }
.warn-text { color: var(--orange-text); }
.todo-form .note-area { min-height: 4.5rem; }

/* ===================================================================
   19. Seitenwechsel: kurzer Überblendeffekt, Kopf- und Tab-Leiste bleiben stehen
   =================================================================== */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: .16s ease-out both vt-out; }
  ::view-transition-new(root) { animation: .22s ease-out both vt-in; }
  ::view-transition-group(topbar), ::view-transition-group(tabbar) { animation-duration: 0s; }
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

/* ===================================================================
   20. Breakpoints
   =================================================================== */
@media (max-width: 960px) {
  .grid-main, .grid-2, .billing-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
}

@media (max-width: 760px) {
  body { font-size: 1rem; letter-spacing: -.012em; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .mainnav { display: none; }
  .topbar-inner { padding: .45rem 1rem; min-height: 52px; gap: .75rem; }
  .brand img { height: 28px; }
  .hide-sm { display: none !important; }
  .container { padding: 1.1rem 1rem 2rem; }
  h1 { font-size: 1.75rem; letter-spacing: -.022em; }
  .card { padding: 1.05rem 1.1rem; border-radius: 14px; }
  .stat { border-radius: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .page-head { align-items: flex-start; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn, .page-head .actions form { flex: 1; }
  .page-head .actions form .btn { width: 100%; }
  /* Mindestens 44 pt Tippfläche */
  .btn { min-height: 2.75rem; }
  .btn-sm { min-height: 2.25rem; }
  .icon-btn { width: 40px; height: 40px; }
  input, select, textarea { min-height: 2.75rem; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--material-bar); -webkit-backdrop-filter: var(--material-blur); backdrop-filter: var(--material-blur);
    box-shadow: 0 -1px 0 var(--separator);
    padding: .3rem .25rem calc(.25rem + env(safe-area-inset-bottom));
    view-transition-name: tabbar;
  }
  .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: .12rem; color: #8a8a8e;
    font-size: .625rem; font-weight: 500; letter-spacing: .01em; padding: .3rem 0; border-radius: 10px;
    transition: color .15s ease, transform var(--press-time) ease-out;
  }
  .tabbar a .icon { width: 24px; height: 24px; stroke-width: 1.9; }
  .tabbar a.active { color: var(--accent); }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a:active { transform: scale(.92); }
  .timerbar { padding: 0 .75rem .5rem; }
  .timerbar-inner { border-radius: 22px; padding: .5rem .5rem .5rem .9rem; }
  .timerbar-inner { padding: .55rem .55rem .55rem .9rem; gap: .5rem .65rem; }
  .timer-what { flex: 1 1 0; }
  .timerbar-actions { flex-basis: 100%; display: grid; grid-template-columns: 1fr 1.6fr; gap: .4rem; }
  .timerbar-actions .btn { width: 100%; min-height: 2.5rem; border-radius: 999px; }
  .timerbar-actions .btn-on-dark { background: rgba(255, 255, 255, .12); }
  .todo { flex-wrap: wrap; row-gap: .2rem; }
  .todo-text { flex: 1 1 calc(100% - 3rem); }
  .todo-actions { margin-left: auto; }
  .todo-add { flex-direction: column; align-items: stretch; }
  .table { font-size: .875rem; }
  .table th, .table td { padding: .55rem .4rem; }
  .batch-bar { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .popover { right: -8px; }
  .filter-input { width: 100%; }
  .fix-form { flex-direction: column; align-items: stretch; }
  .clogo-lg { height: 48px; max-width: 120px; border-radius: 12px; }
  .clogo-empty { width: 48px; }
  .clogo-bar { height: 26px; max-width: 96px; }
  .brand-customer { padding-left: .7rem; margin-left: -.35rem; }
  body.teams .brand span { display: none; }
  .search-card .btn { flex: 1; }
  .stat-value { font-size: 1.75rem; }

  /* Dialog als Sheet von unten, über der Tastatur */
  .sheet-dialog[open] { place-items: end stretch; }
  .sheet {
    width: 100%; max-height: calc(var(--vvh, 100dvh) - 2.5rem - env(safe-area-inset-top));
    margin-bottom: var(--kb, 0px);
    border-radius: 14px 14px 0 0; padding: 1.3rem 1.2rem calc(1rem + env(safe-area-inset-bottom));
    background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none;   /* Sheets sind deckend, nie Glas auf Glas */
  }
  .sheet-grabber { display: block; }
  .sheet-head { padding-top: .2rem; cursor: grab; }
}

/* ===================================================================
   21. Barrierefreiheit: weniger Bewegung, weniger Transparenz, mehr Kontrast
   =================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .btn:active, .icon-btn:active, .chip:active, .mainnav a:active, .tabbar a:active, .stat-link:active,
  .link-list li a:active, .entry-list a:active, .result:active, .ac-item:active, .search-tabs a:active, .chip-check:active span { transform: none; }
  input.switch::before, .details-card > summary::after, details > summary::before { transition-duration: .01ms; }
  .flash, .timerbar-inner, .batch-bar .btn { animation: fade-in .2s ease both !important; animation-duration: .2s !important; }
  .inline-details[open] > .popover { animation: fade-in .15s ease both !important; animation-duration: .15s !important; }
  .pulse { animation: none; }
}
@keyframes fade-in { from { opacity: 0; } }

@media (prefers-reduced-transparency: reduce) {
  .topbar, .tabbar { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .sheet, .popover { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .timerbar-inner { background: #1c1c1e; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  :root {
    --label-2: #1d1d1f; --label-3: #3a3a3c; --label-4: #545458;
    --separator: rgba(60, 60, 67, .45); --field-border: #8e8e93;
    --accent-tint: rgba(0, 122, 255, .16);
  }
  .topbar, .tabbar { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 1px 0 #8e8e93; }
  .card, .stat { box-shadow: 0 0 0 1px #8e8e93; }
  .btn-secondary { box-shadow: inset 0 0 0 1px var(--accent); }
  .sheet, .popover { background: #fff; box-shadow: 0 0 0 1px #8e8e93, var(--shadow-float); }
}

/* ===================================================================
   22. Druck
   =================================================================== */
@media print {
  .topbar, .tabbar, .actions, .btn, .icon-btn { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; padding: 0; }
}

/* Kein Mitscrollen der Seite hinter einem offenen Dialog */
html:has(dialog[open]) { overflow: hidden; }

/* Kundennotizen (1.5) */
.note-add { display: flex; gap: .5rem; align-items: flex-start; margin-bottom: .6rem; }
.note-add textarea { flex: 1; min-height: 2.5rem; }
.note-list { list-style: none; margin: 0; padding: 0; }
.note-list li { padding: .65rem 0; border-top: 1px solid var(--separator); scroll-margin-top: 90px; }
.note-list li:target { animation: note-flash 2.4s ease-out both; border-radius: var(--radius-s); }
@keyframes note-flash { from { background: var(--accent-tint-2); } to { background: transparent; } }
.note-item { display: flex; gap: .5rem; align-items: flex-start; justify-content: space-between; }
.note-body { white-space: normal; overflow-wrap: anywhere; padding-top: .3rem; }
.note-meta { font-size: .75rem; color: var(--label-4); margin-top: .15rem; font-variant-numeric: tabular-nums; }
.note-edit { margin-top: .6rem; }
@media (max-width: 760px) { .note-add { flex-direction: column; align-items: stretch; } }

/* ===================================================================
   1.6: Projektnummer ändern, Budget-Fortschritt
   =================================================================== */
.pnum { display: inline-flex; align-items: center; gap: .1rem; vertical-align: baseline; }
.pnum-missing { color: var(--orange-text); font-weight: 500; }
.pnum-edit { vertical-align: middle; }
.pnum-btn { width: 26px; height: 26px; margin: -4px 0; color: var(--label-4); }
.pnum-btn .icon { width: 14px; height: 14px; }
.pnum-pop { left: -8px; right: auto; top: 30px; width: 230px; transform-origin: 18px -8px; font-weight: 400; color: var(--label); white-space: normal; }
.pnum-pop .field > span { color: var(--label-2); }
.page-head .sub .pnum-btn { color: var(--label-3); }
.proj-row { display: flex; justify-content: space-between; align-items: baseline; gap: .4rem .75rem; flex-wrap: wrap; padding: .62rem 0; }
.proj-main { display: inline-flex; align-items: baseline; gap: .3rem; flex-wrap: wrap; }
.proj-main a { color: var(--label); }
.badge-danger { background: var(--red-tint); color: var(--red-text); }

.pbar { position: relative; height: 12px; border-radius: 999px; background: var(--fill); overflow: hidden; margin: .2rem 0 .7rem; }
.pbar-fill { display: block; height: 100%; border-radius: inherit; background: var(--pbar-color, var(--green)); transform-origin: left center; animation: pbar-grow .9s var(--spring) both; }
@keyframes pbar-grow { from { transform: scaleX(0); } }
.pbar-legend { margin: 0 0 .2rem; font-size: 1.0625rem; letter-spacing: -.017em; }
.budget-form { margin-top: .8rem; }
.w-0 { width: 0%; }
.w-1 { width: 1%; }
.w-2 { width: 2%; }
.w-3 { width: 3%; }
.w-4 { width: 4%; }
.w-5 { width: 5%; }
.w-6 { width: 6%; }
.w-7 { width: 7%; }
.w-8 { width: 8%; }
.w-9 { width: 9%; }
.w-10 { width: 10%; }
.w-11 { width: 11%; }
.w-12 { width: 12%; }
.w-13 { width: 13%; }
.w-14 { width: 14%; }
.w-15 { width: 15%; }
.w-16 { width: 16%; }
.w-17 { width: 17%; }
.w-18 { width: 18%; }
.w-19 { width: 19%; }
.w-20 { width: 20%; }
.w-21 { width: 21%; }
.w-22 { width: 22%; }
.w-23 { width: 23%; }
.w-24 { width: 24%; }
.w-25 { width: 25%; }
.w-26 { width: 26%; }
.w-27 { width: 27%; }
.w-28 { width: 28%; }
.w-29 { width: 29%; }
.w-30 { width: 30%; }
.w-31 { width: 31%; }
.w-32 { width: 32%; }
.w-33 { width: 33%; }
.w-34 { width: 34%; }
.w-35 { width: 35%; }
.w-36 { width: 36%; }
.w-37 { width: 37%; }
.w-38 { width: 38%; }
.w-39 { width: 39%; }
.w-40 { width: 40%; }
.w-41 { width: 41%; }
.w-42 { width: 42%; }
.w-43 { width: 43%; }
.w-44 { width: 44%; }
.w-45 { width: 45%; }
.w-46 { width: 46%; }
.w-47 { width: 47%; }
.w-48 { width: 48%; }
.w-49 { width: 49%; }
.w-50 { width: 50%; }
.w-51 { width: 51%; }
.w-52 { width: 52%; }
.w-53 { width: 53%; }
.w-54 { width: 54%; }
.w-55 { width: 55%; }
.w-56 { width: 56%; }
.w-57 { width: 57%; }
.w-58 { width: 58%; }
.w-59 { width: 59%; }
.w-60 { width: 60%; }
.w-61 { width: 61%; }
.w-62 { width: 62%; }
.w-63 { width: 63%; }
.w-64 { width: 64%; }
.w-65 { width: 65%; }
.w-66 { width: 66%; }
.w-67 { width: 67%; }
.w-68 { width: 68%; }
.w-69 { width: 69%; }
.w-70 { width: 70%; }
.w-71 { width: 71%; }
.w-72 { width: 72%; }
.w-73 { width: 73%; }
.w-74 { width: 74%; }
.w-75 { width: 75%; }
.w-76 { width: 76%; }
.w-77 { width: 77%; }
.w-78 { width: 78%; }
.w-79 { width: 79%; }
.w-80 { width: 80%; }
.w-81 { width: 81%; }
.w-82 { width: 82%; }
.w-83 { width: 83%; }
.w-84 { width: 84%; }
.w-85 { width: 85%; }
.w-86 { width: 86%; }
.w-87 { width: 87%; }
.w-88 { width: 88%; }
.w-89 { width: 89%; }
.w-90 { width: 90%; }
.w-91 { width: 91%; }
.w-92 { width: 92%; }
.w-93 { width: 93%; }
.w-94 { width: 94%; }
.w-95 { width: 95%; }
.w-96 { width: 96%; }
.w-97 { width: 97%; }
.w-98 { width: 98%; }
.w-99 { width: 99%; }
.w-100 { width: 100%; }
.lvl-0 { --pbar-color: hsl(135 72% 46%); }
.lvl-1 { --pbar-color: hsl(130 72% 46%); }
.lvl-2 { --pbar-color: hsl(124 72% 46%); }
.lvl-3 { --pbar-color: hsl(116 72% 46%); }
.lvl-4 { --pbar-color: hsl(105 72% 46%); }
.lvl-5 { --pbar-color: hsl(90 72% 46%); }
.lvl-6 { --pbar-color: hsl(70 72% 46%); }
.lvl-7 { --pbar-color: hsl(50 72% 46%); }
.lvl-8 { --pbar-color: hsl(33 72% 46%); }
.lvl-9 { --pbar-color: hsl(17 72% 46%); }
.lvl-10 { --pbar-color: hsl(3 72% 46%); }
@media (prefers-reduced-motion: reduce) { .pbar-fill { animation: none; } }
