/* Auswärtstätigkeiten – Gestaltung
 *
 * Idee: Werkzeug fürs Filmset. Graphit wie eine Filmklappe, Gelb wie
 * Gaffer-Tape für alles, was „an“ ist. Das einzige auffällige Element ist die
 * Klappe auf dem Startbildschirm; alles andere bleibt ruhig.
 * Keine Webfonts: schmale Systemschrift (Bahnschrift unter Windows,
 * Roboto Condensed unter Android) für Datum und Uhrzeiten, sonst die
 * normale Systemschrift.
 */

:root {
  --paper: #eef1f3;
  --surface: #ffffff;
  --sunken: #e3e8ec;
  --ink: #1d232b;
  --ink-2: #4f5a66;
  --ink-3: #7d8792;
  --line: #cfd6dc;
  --line-strong: #9aa4ae;
  --input: #ffffff;

  --primary: #1d232b;
  --primary-ink: #ffffff;
  --tape: #f4c430;
  --tape-strong: #d9a810;
  --tape-ink: #1d232b;

  --slate: #1d232b;
  --slate-ink: #f3f5f7;
  --slate-line: rgba(255, 255, 255, 0.2);

  --warn: #b54708;
  --warn-bg: #fff4e5;
  --warn-line: #f5b25e;
  --danger: #c4262e;
  --danger-ink: #ffffff;
  --focus: #1769c7;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-cond: "Bahnschrift", "Roboto Condensed", "sans-serif-condensed", "Arial Narrow", system-ui, sans-serif;

  --r-s: 8px;
  --r: 12px;
  --r-l: 16px;
  --touch: 48px;
  --gutter: 16px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12161b;
    --surface: #1b2128;
    --sunken: #161b21;
    --ink: #e8ecef;
    --ink-2: #b2bbc4;
    --ink-3: #87919b;
    --line: #2f3841;
    --line-strong: #4a5560;
    --input: #12161b;

    --primary: #e8ecef;
    --primary-ink: #12161b;
    --tape-strong: #f4c430;

    --slate: #232b34;
    --slate-line: rgba(255, 255, 255, 0.16);

    --warn: #ffb169;
    --warn-bg: #2b2016;
    --warn-line: #8a5a22;
    --danger: #e5484d;
    --focus: #7cb7ff;
  }
}

/* ------------------------------------------------------------ Grundlagen */

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.45 var(--font);
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0 0 0.6em; }
p:last-child { margin-bottom: 0; }
a { color: inherit; text-underline-offset: 3px; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

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

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 50;
  background: var(--surface); padding: 12px 16px; border-radius: var(--r-s);
}
.skip-link:focus { top: 8px; }

.muted { color: var(--ink-2); }
.noscript { padding: 24px; }

.icon { width: 22px; height: 22px; flex: none; }
.icon-inline { width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; color: var(--ink-3); }

/* ---------------------------------------------------------------- Gerüst */

.main {
  padding: 12px var(--gutter) calc(var(--nav-h) + var(--safe-b) + 32px);
  max-width: 720px;
  margin: 0 auto;
  outline: none;
}

.page { display: grid; gap: 20px; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.nav-brand, .nav-install { display: none; }
.nav-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.nav-link {
  min-height: var(--nav-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; font-size: 12.5px; font-weight: 500; color: var(--ink-2);
}
.nav-link .icon { width: 24px; height: 24px; }
.nav-link[aria-current="page"] { color: var(--ink); font-weight: 700; }
.nav-link[aria-current="page"] .icon {
  background: var(--tape); color: var(--tape-ink);
  border-radius: 999px; padding: 2px 14px; width: 52px; height: 28px;
}

/* Im Formular übernimmt die Speichern-Leiste den unteren Rand. */
body.form-mode .nav { display: none; }
body.form-mode .main { padding-bottom: 24px; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--touch); }
.page-title { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
.top-row { display: flex; justify-content: flex-end; }
.top-row:empty, .top-row:has(> [hidden]:only-child) { display: none; }
.lead { color: var(--ink-2); max-width: 60ch; }

.section-title { font-size: 19px; font-weight: 700; margin-bottom: 10px; }
.section-hint { margin-top: -4px; margin-bottom: 12px; font-size: 15px; }
.group-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.action-group { display: grid; gap: 8px; padding: 14px 0; border-top: 1px solid var(--line); }
.action-group .muted { font-size: 15px; }

/* -------------------------------------------------------------- Knöpfe */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--touch); padding: 0 18px;
  border: 1.5px solid var(--line-strong); border-radius: var(--r);
  background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  touch-action: manipulation;
}
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn .icon { width: 20px; height: 20px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { border-color: var(--primary); filter: brightness(1.15); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--danger-ink); }
.btn-quiet { border-color: transparent; background: transparent; }
.btn-block { width: 100%; }
.btn-large { min-height: 56px; font-size: 18px; }
.btn-compact { min-height: var(--touch); padding: 0 14px; font-size: 15px; }
.btn-install { background: var(--tape); border-color: var(--tape-strong); color: var(--tape-ink); }

.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.button-row > .btn { flex: 1 1 auto; }
.button-row-large > .btn { flex: 1 1 160px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: var(--touch); height: var(--touch);
  border: 0; border-radius: var(--r); background: transparent; color: var(--ink);
  cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--sunken); }
.icon-btn-danger { color: var(--danger); }
.icon-btn-spacer { width: var(--touch); }

/* ------------------------------------------------- Startbildschirm: Klappe */

.slate { border-radius: var(--r-l); overflow: hidden; background: var(--slate); color: var(--slate-ink); }
.slate-stripes {
  height: 26px;
  background: repeating-linear-gradient(-60deg, #f3f5f7 0 22px, #1d232b 22px 44px);
  border-bottom: 3px solid #1d232b;
}
.slate-board { padding: 16px 18px 18px; }
/* Projektzeile oben auf der Klappe – wie das Feld „Produktion“ einer echten Filmklappe */
.slate-project {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px;
  padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--slate-line);
}
.slate-project-label { grid-column: 1; font-size: 13px; opacity: 0.7; }
.slate-project-name {
  grid-column: 1; font-family: var(--font-cond); font-stretch: condensed;
  font-size: 22px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere;
}
.slate-project-name.is-empty { font-weight: 400; opacity: 0.75; font-size: 18px; }
.slate-project-btn {
  grid-column: 2; grid-row: 1 / span 2;
  min-height: var(--touch); padding: 0 16px; border-radius: var(--r);
  border: 1.5px solid rgba(255, 255, 255, 0.45); background: transparent; color: var(--slate-ink);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.slate-project-btn:hover { background: rgba(255, 255, 255, 0.08); }
.slate-date { display: grid; gap: 2px; font-weight: 400; }
.slate-weekday { font-size: 17px; opacity: 0.8; }
.slate-day {
  font-family: var(--font-cond); font-stretch: condensed;
  font-size: clamp(44px, 14vw, 68px); font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
}
.slate-empty { margin-top: 12px; font-size: 17px; opacity: 0.85; }
.slate-grid {
  display: grid; grid-template-columns: 1fr 1fr; margin: 16px 0 0;
  border-top: 1px solid var(--slate-line);
}
.slate-cell { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--slate-line); min-width: 0; }
.slate-cell:nth-child(odd):not(.slate-wide) { border-right: 1px solid var(--slate-line); }
.slate-cell:nth-child(even):not(.slate-wide), .slate-cell:nth-child(odd):not(.slate-wide) + .slate-cell:not(.slate-wide) { padding-left: 12px; }
.slate-wide { grid-column: 1 / -1; }
.slate-cell:last-child { border-bottom: 0; padding-bottom: 0; }
.slate-cell dt { font-size: 13px; opacity: 0.7; }
.slate-cell dd { margin: 2px 0 0; font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.slate-line { display: block; }
.slate-time { font-family: var(--font-cond); font-weight: 400; opacity: 0.85; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------- Schnellaktionen */

.actions { display: grid; gap: 10px; }
.actions .section-title { margin: 12px 0 0; font-size: 16px; color: var(--ink-2); }
.action {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px;
  width: 100%; min-height: 76px; padding: 12px 16px;
  border: 1.5px solid var(--line); border-radius: var(--r-l);
  background: var(--surface); color: var(--ink);
  font: inherit; text-align: left; cursor: pointer; touch-action: manipulation;
}
.action:hover { border-color: var(--line-strong); }
.action:active { transform: translateY(1px); }
.action:disabled { opacity: 0.5; }
.action-icon {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--sunken); color: var(--ink);
}
.action-text { display: grid; gap: 2px; min-width: 0; }
.action-title { font-size: 19px; font-weight: 700; }
.action-sub { font-size: 15px; color: var(--ink-2); overflow-wrap: anywhere; }
.action-primary { background: var(--tape); border-color: var(--tape-strong); color: var(--tape-ink); }
.action-primary .action-icon { background: rgba(29, 35, 43, 0.12); color: var(--tape-ink); }
.action-primary .action-sub { color: rgba(29, 35, 43, 0.8); }
.action-hero { min-height: 92px; }
.action-hero .action-title { font-size: 22px; }
.actions-compact { display: grid; gap: 8px; }
.action-compact { min-height: 60px; padding: 8px 14px; }
.action-compact .action-icon { width: 36px; height: 36px; }
.action-compact .action-title { font-size: 17px; }

/* ------------------------------------------------------------- Hinweise */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px; display: grid; gap: 12px; }
.card-title { font-size: 20px; }

.notice { border-radius: var(--r); padding: 14px 16px; display: grid; gap: 8px; }
.notice-warn { background: var(--warn-bg); border: 1px solid var(--warn-line); }
.notice-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; color: var(--warn); }
.notice-title .icon { width: 20px; height: 20px; }
.notice-backup {
  background: var(--surface); border: 1.5px solid var(--tape-strong);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
}
.notice-backup p { margin: 0; font-weight: 600; flex: 1 1 200px; }
.notice-error { border-color: var(--danger); }

.link-list { list-style: none; margin: 0; padding: 0; display: grid; }
.link-list a {
  display: flex; gap: 10px; align-items: center; min-height: 44px;
  text-decoration: none; border-bottom: 1px solid var(--warn-line);
}
.link-list li:last-child a { border-bottom: 0; }
.link-list a:hover span:last-child { text-decoration: underline; }
.link-date { font-family: var(--font-cond); font-weight: 700; min-width: 64px; flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; }

.inline-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--warn); font-size: 15px; margin-top: 8px; }
.inline-note .icon { width: 18px; height: 18px; }

.update-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 8px 16px calc(8px);
  padding-top: max(8px, env(safe-area-inset-top, 0px));
  border: 0; background: var(--tape); color: var(--tape-ink);
  font: inherit; font-weight: 700; cursor: pointer;
}

#toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); z-index: 45;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: min(92vw, 480px); padding: 12px 18px; border-radius: var(--r);
  background: var(--ink); color: var(--paper); font-weight: 600; text-align: center;
  transition: opacity 0.18s, transform 0.18s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.toast-error { background: var(--danger); color: #fff; }
body.form-mode #toast { bottom: calc(96px + var(--safe-b)); }

/* ------------------------------------------------------------- Formular */

.field { display: grid; gap: 6px; min-width: 0; }
.field-label { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.field-hint { font-size: 14px; color: var(--ink-3); margin: 0; }
.field-error { font-size: 14px; color: var(--danger); font-weight: 600; margin: 0; }

input[type="text"], input[type="date"], input[type="time"], input[type="month"], select {
  width: 100%; min-height: 52px; padding: 0 12px;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-s);
  background: var(--input); color: var(--ink);
  font: inherit; font-size: 17px;
}
input[type="date"], input[type="time"], input[type="month"] { font-family: var(--font-cond); font-size: 19px; font-variant-numeric: tabular-nums; }
input:focus, select:focus { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: 0; }
input[aria-invalid] { border-color: var(--danger); }
input::placeholder { color: var(--ink-3); }

.form-section { display: grid; gap: 12px; }
.form-section > .section-title { margin-bottom: -2px; }
.day-form { display: grid; gap: 26px; }
.settings-form { display: grid; gap: 22px; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px;
  margin: -12px calc(-1 * var(--gutter)) 0; padding: 6px 8px;
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.topbar-title { font-size: 19px; font-weight: 700; text-align: center; }

.date-row { display: grid; grid-template-columns: minmax(0, 220px) auto; align-items: end; gap: 12px; }
.date-weekday { padding-bottom: 14px; font-weight: 600; color: var(--ink-2); }

.trips { display: grid; gap: 12px; }
.trips-empty { padding: 4px 0; }
.trip {
  position: relative; margin: 0; padding: 12px 14px 14px;
  border: 1.5px solid var(--line); border-radius: var(--r);
  background: var(--surface); display: grid; gap: 12px;
}
.trip-legend {
  float: left; /* hält die Legende im Rahmen */
  font-family: var(--font-cond); font-weight: 700; font-size: 17px; padding: 0; margin: 4px 0 0;
}
.trip-legend + * { clear: none; }
.trip-remove { position: absolute; top: 2px; right: 2px; color: var(--ink-2); }
.trip-route { display: grid; gap: 12px; clear: both; }
.time-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.time-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.btn-now { padding: 0 12px; min-width: 64px; font-size: 15px; }
.time-field.is-open .field-label::after { content: " – offen"; color: var(--warn); font-weight: 600; }
.time-field.is-open input { border-style: dashed; }

/* Schmale Handys: Abfahrt und Ankunft untereinander, Beschriftung links,
   damit die Uhrzeit genug Platz hat. */
@media (max-width: 519px) {
  .time-row { grid-template-columns: 1fr; gap: 10px; }
  .time-field { grid-template-columns: 76px minmax(0, 1fr); align-items: center; column-gap: 8px; row-gap: 2px; }
  .time-field .field-error { grid-column: 2; }
  .time-field.is-open .field-label::after { content: "offen"; display: block; font-size: 13px; }
}

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg {
  min-height: 56px; padding: 6px 8px;
  border: 1.5px solid var(--line-strong); border-radius: var(--r);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2; cursor: pointer;
}
.seg[aria-checked="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.segmented-4 { grid-template-columns: repeat(4, 1fr); }
.segmented-4 .seg { font-size: 14.5px; padding: 6px 4px; }
@media (max-width: 340px) { .segmented-4 { grid-template-columns: repeat(2, 1fr); } }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile {
  display: grid; justify-items: center; align-content: center; gap: 6px;
  min-height: 104px; padding: 10px 6px;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-l);
  background: var(--surface); color: var(--ink);
  font: inherit; cursor: pointer; touch-action: manipulation;
}
.tile-check {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--line-strong); color: transparent;
}
.tile-check .icon { width: 22px; height: 22px; stroke-width: 3; }
.tile-label { font-size: 15px; font-weight: 700; }
.tile-note { font-size: 12.5px; color: var(--ink-2); min-height: 1em; }
.tile[aria-pressed="true"] { background: var(--tape); border-color: var(--tape-strong); color: var(--tape-ink); }
.tile[aria-pressed="true"] .tile-check { background: var(--tape-ink); border-color: var(--tape-ink); color: var(--tape); }
.tile[aria-pressed="true"] .tile-note { color: rgba(29, 35, 43, 0.8); }

.details { border-top: 1px solid var(--line); padding-top: 4px; }
.details > summary {
  min-height: var(--touch); display: flex; align-items: center;
  font-weight: 600; cursor: pointer; list-style-position: inside;
}
.details[open] > summary { margin-bottom: 6px; }
.details > p { font-size: 15px; }
.euro-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.field-euro .field-label { font-size: 14px; }
.steps { padding-left: 1.3em; margin: 0 0 10px; display: grid; gap: 8px; }

.savebar {
  position: sticky; bottom: 0; z-index: 10;
  margin: 0 calc(-1 * var(--gutter)) -24px; padding: 12px var(--gutter) calc(12px + var(--safe-b));
  background: var(--paper); border-top: 1px solid var(--line);
}

.onboarding .btn { margin-top: 4px; }

/* ------------------------------------------------------------ Übersicht */

.month-switch { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.month-label { text-align: center; font-family: var(--font-cond); font-size: 24px; font-weight: 700; }

.stats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.stat { padding: 5px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.stat strong { font-family: var(--font-cond); font-size: 16px; }
.stat-warn { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn); }

.month-table { width: 100%; border-collapse: collapse; }
.month-table thead { display: none; }
.month-table tbody { display: grid; gap: 8px; }
.month-table tr {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-areas: "date route meals" "date stay meals";
  column-gap: 12px; row-gap: 4px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  cursor: pointer;
}
.month-table tr:hover { border-color: var(--line-strong); }
.month-table tr.is-incomplete { border-left: 4px solid var(--warn-line); }
.month-table td { padding: 0; min-width: 0; }
.col-date { grid-area: date; }
.col-route { grid-area: route; }
.col-stay { grid-area: stay; font-size: 15px; }
.month-table td.col-meals { grid-area: meals; align-self: center; }
.date-link { display: grid; text-decoration: none; font-family: var(--font-cond); line-height: 1.1; }
.date-link .wd { font-size: 14px; color: var(--ink-2); }
.date-link .dm { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.trip-line { display: flex; flex-wrap: wrap; column-gap: 8px; }
.trip-places { font-weight: 600; overflow-wrap: anywhere; }
.trip-times { font-family: var(--font-cond); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.trip-times.is-missing { color: var(--warn); }
.stay { display: inline-flex; align-items: baseline; }
.badge-warn { display: inline-block; margin-top: 4px; font-size: 13px; font-weight: 700; color: var(--warn); }
.meals { display: inline-flex; gap: 4px; }
.meal-badge {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  border: 1.5px dashed var(--line-strong); color: var(--ink-3);
  font-family: var(--font-cond); font-weight: 700; font-size: 15px;
}
.meal-badge.on { border: 1.5px solid var(--tape-strong); background: var(--tape); color: var(--tape-ink); }

/* Projekte: Filter, Kennzeichnung, Liste */
.field-filter { max-width: 420px; }
.project-info { color: var(--ink-2); font-size: 15px; margin-top: -8px; }
.proj-tag {
  display: inline-block; margin-bottom: 4px; padding: 1px 8px; border-radius: 6px;
  background: var(--sunken); color: var(--ink-2); font-size: 13px; font-weight: 600;
}
.project-range { display: grid; gap: 8px; justify-items: start; }
.project-range:empty { display: none; }
.range-note { margin: 0; }
.project-list { list-style: none; margin: 0; padding: 0; display: grid; }
.project-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.project-list li:last-child { border-bottom: 0; }
.project-list-text { display: grid; gap: 2px; min-width: 0; }
.project-list-text strong { overflow-wrap: anywhere; }
.project-list-text .muted { font-size: 14px; }

.empty { display: grid; gap: 12px; justify-items: start; padding: 24px 0; color: var(--ink-2); }

/* --------------------------------------------------------------- Export */

.range-inputs { display: grid; gap: 12px; max-width: 360px; }
.range-free { grid-template-columns: 1fr 1fr; max-width: 480px; }
.export-preview { display: grid; gap: 10px; }
.export-count { font-size: 18px; }
.export-file { font-family: var(--font-cond); color: var(--ink-2); overflow-wrap: anywhere; }

/* ---------------------------------------------------------- Einstellungen */

.status { color: var(--ink-2); }
.status-warn { color: var(--warn); font-weight: 600; }
.page-settings .form-section > p { max-width: 62ch; }

/* --------------------------------------------------------------- Dialoge */

.dialog {
  border: 0; border-radius: var(--r-l); padding: 0;
  width: min(92vw, 460px); background: var(--surface); color: var(--ink);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.dialog::backdrop { background: rgba(10, 14, 18, 0.55); }
.dialog-body { display: grid; gap: 14px; padding: 20px; }
.dialog-title { font-size: 20px; }
.dialog-text { color: var(--ink-2); display: grid; gap: 8px; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.dialog-actions .btn { flex: 1 1 140px; }
.import-summary { font-size: 19px; font-weight: 700; color: var(--ink); }
.compare { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare th, .compare td { text-align: left; padding: 6px 6px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare thead th { color: var(--ink-3); font-weight: 600; }
.compare tr.diff td { color: var(--ink); font-weight: 700; }

/* -------------------------------------------------------- Breite Bildschirme */

@media (min-width: 900px) {
  :root { --gutter: 32px; }
  .shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
  .nav {
    position: sticky; top: 0; bottom: auto; height: 100vh;
    border-top: 0; border-right: 1px solid var(--line);
    display: flex; flex-direction: column; gap: 8px; padding: 20px 12px;
  }
  .nav-brand {
    display: block; padding: 4px 12px 16px;
    font-family: var(--font-cond); font-size: 20px; font-weight: 700;
  }
  .nav-list { grid-template-columns: 1fr; gap: 2px; }
  .nav-link { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 48px; padding: 0 12px; border-radius: var(--r); font-size: 16px; }
  .nav-link:hover { background: var(--sunken); }
  .nav-link[aria-current="page"] { background: var(--sunken); }
  .nav-link[aria-current="page"] .icon { width: 24px; height: 24px; padding: 0; background: none; color: var(--ink); }
  .nav-link[aria-current="page"]::before { content: ""; width: 4px; align-self: stretch; margin: 10px 0 10px -12px; border-radius: 0 4px 4px 0; background: var(--tape); }
  .nav-install { display: block; margin-top: auto; }
  .nav-install .btn { width: 100%; }
  body.form-mode .nav { display: flex; }

  .main { max-width: 920px; width: 100%; padding: 28px var(--gutter) 48px; margin: 0; }
  body.form-mode .main { padding-bottom: 0; }
  .page-today .top-row { display: none; }
  .topbar { margin-top: -28px; padding: 10px 0; }
  .savebar { margin-bottom: 0; }
  #toast, body.form-mode #toast { bottom: 24px; }

  .actions { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .actions > .section-title, .actions > .btn-block, .actions-compact { grid-column: 1 / -1; }
  .actions-compact { grid-template-columns: repeat(3, 1fr); }
  .trip-route { grid-template-columns: 1fr 1fr; }

  /* Übersicht als echte Tabelle */
  .month-table { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); border-collapse: separate; border-spacing: 0; overflow: hidden; }
  .month-table thead { display: table-header-group; }
  .month-table tbody { display: table-row-group; }
  .month-table tr { display: table-row; border: 0; border-radius: 0; padding: 0; background: none; }
  .month-table tr.is-incomplete { border-left: 0; }
  .month-table tr.is-incomplete td:first-child { box-shadow: inset 4px 0 0 var(--warn-line); }
  .month-table tbody tr:hover { background: var(--sunken); }
  .month-table th, .month-table td { display: table-cell; padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
  .month-table tbody tr:last-child td { border-bottom: 0; }
  .month-table th { font-size: 14px; color: var(--ink-2); font-weight: 600; background: var(--sunken); }
  .month-table th.col-meals, .month-table td.col-meals { text-align: right; white-space: nowrap; }
  .month-table td.col-meals { align-self: auto; }
  .date-link { grid-template-columns: auto auto; justify-content: start; gap: 8px; align-items: baseline; }
  .date-link .dm { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
