/* Neutral office chrome. Local Inter 5.3.0 and Lucide 0.547.0; see adjacent asset licenses. */
@font-face {
  font-family: Inter;
  src: url('/static/vendor/inter/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: light;
  --workspace: #f6f6f7;
  --surface: #fff;
  --text: #171717;
  --secondary: #52525b;
  --muted: #52525b;
  --divider: #e7e7ea;
  --border: #6e6e76;
  --accent: #171717;
  --accent-hover: #000;
  --selection: #f3f3f4;
  --selection-border: #e4e4e7;
  --focus: #171717;
  --positive: #22674b;
  --positive-bg: #eaf4ee;
  --attention: #895915;
  --attention-bg: #fbf3e4;
  --error: #aa3542;
  --error-bg: #fff1f2;
  --neutral: #3f3f46;
  --neutral-bg: #f4f4f5;
  --shadow: 0 1px 2px #0000000a, 0 12px 32px #0000000a, 0 0 0 1px #0000000f;
  font-family: Inter, Arial, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--workspace); color: var(--text); font-size: 17px; line-height: 1.5; }
[hidden], [x-cloak] { display: none !important; }
h1, h2, h3 { font-weight: 580; text-wrap: balance; }
h1 { font-size: 32px; line-height: 1.15; letter-spacing: -.03em; margin: 0 0 12px; }
h2 { font-size: 22px; line-height: 1.3; letter-spacing: -.02em; margin: 0 0 16px; }
h3 { font-size: 20px; line-height: 1.35; letter-spacing: -.015em; margin: 0; }
p { text-wrap: pretty; margin: 12px 0; }
a { color: var(--text); text-underline-offset: 3px; overflow-wrap: anywhere; }
a[href^="tel:"] { white-space: nowrap; }
main { max-width: 1640px; margin: 0 auto; padding: 36px 40px 64px; min-width: 0; }
main:focus { outline: none; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: middle; }
button .icon, .button .icon { width: 16px; height: 16px; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 3000; background: var(--surface); padding: 12px 20px; }
.skip-link:focus { top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.topbar { display: flex; align-items: center; gap: 32px; padding: 0 max(32px, calc((100vw - 1560px) / 2)); background: var(--surface); border-bottom: 1px solid var(--divider); min-height: 72px; }
.brand { display: inline-flex; min-height: 44px; align-items: center; gap: 10px; color: var(--text); font-size: 18px; font-weight: 650; letter-spacing: -.025em; text-decoration: none; white-space: nowrap; }
.brand > .icon { color: var(--text); }
.brand-logo { height: 24px; width: auto; max-width: 160px; object-fit: contain; flex: none; }
.organization-name { margin: 0; color: var(--secondary); font-size: 15px; font-weight: 550; line-height: 1.3; max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
h1 > .organization-name { display: block; margin-top: 4px; font-size: 18px; font-weight: 550; }
.topbar nav { display: flex; flex: 1; align-self: stretch; gap: 4px; }
.topbar nav a { position: relative; display: inline-flex; gap: 8px; align-items: center; padding: 12px 14px; color: var(--secondary); font-size: 16px; font-weight: 550; text-decoration: none; white-space: nowrap; }
.topbar nav a[aria-current] { background: transparent; color: var(--text); }
.topbar nav a[aria-current]::after { position: absolute; content: ''; height: 2px; background: var(--text); bottom: 0; left: 14px; right: 14px; }
.topbar form { margin: 0; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0 0 24px; }
.page-heading h1 { margin-bottom: 8px; }
.page-heading p { margin: 0; }
.muted, .lede { color: var(--secondary); }
.muted { font-size: 15px; line-height: 1.55; }
code { font: 15px ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.card { min-width: 0; background: var(--surface); border: 0; border-radius: 12px; padding: 28px; margin: 24px 0; box-shadow: var(--shadow); }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.card-grid .card { margin: 0; }
.heading, .toolbar, .actions, .plan-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.heading { justify-content: space-between; margin-bottom: 24px; gap: 16px; }
.heading h1, .heading h2, .heading h3 { margin: 0; }
.actions form { margin: 0; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 16px; border: 1px solid transparent; border-radius: 8px; background: var(--accent); color: #fff; font: 550 16px/1.4 Inter, Arial, sans-serif; text-decoration: none; cursor: pointer; transition: background-color 100ms, border-color 100ms, color 100ms, transform 100ms; touch-action: manipulation; }
button:active:not(:disabled), .button:active { transform: scale(.96); }
.secondary { color: var(--text); background: var(--surface); border-color: var(--border); }
.quiet { background: transparent; color: var(--secondary); }
.danger { color: var(--error); }
button:disabled, input:disabled, select:disabled, .button[aria-disabled="true"] { color: #6c7980; background: #eef0f1; border-color: #dce1e3; cursor: not-allowed; }
.export-status { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.export-status:not(:empty) { padding: 8px 12px; border-radius: 6px; background: var(--attention-bg); color: var(--attention); font-size: 15px; font-weight: 550; line-height: 1.5; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
input, select, textarea { display: block; max-width: 100%; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: 400 16px/1.5 Inter, Arial, sans-serif; font-variant-numeric: tabular-nums; }
select { -webkit-appearance: none; appearance: none; height: 46px; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2352525b' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
input[type="hidden"] { display: none; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--focus); outline-offset: 2px; border-color: var(--focus); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--error); }
textarea { min-height: 96px; resize: vertical; }
label { display: block; margin: 12px 0; font-size: 15px; font-weight: 550; color: var(--secondary); }
label > input, label > select, label > textarea { margin-top: 6px; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--accent); flex: none; }
.inline { display: inline-flex; min-width: 42px; align-items: center; gap: 10px; min-height: 42px; margin: 0; color: var(--text); font-size: 16px; }
.inline input { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.form-field { min-width: 0; }
.field-error { margin: 0 0 12px; color: var(--error); font-size: 15px; font-weight: 400; }
.span-all { grid-column: 1 / -1; }
.section-label { display: block; font-size: 22px; font-weight: 580; margin: 28px 0 12px; color: var(--text); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; }
.section-heading > :first-child { margin: 0; }
.form-grid > .section-heading,
.form-grid + .section-heading,
.table-scroll + .section-heading { margin-top: 28px; }
.plan-toolbar { align-items: flex-end; gap: 12px; }
.plan-toolbar label { margin: 0; flex: 0 1 160px; min-width: 100px; }
.table-filter .search-field, .plan-toolbar .search-field { flex: 1 1 240px; min-width: 180px; }
/* The shared list filter is its own block above the table header, closed by a
   hairline divider. Scoped to .table-filter so other toolbars keep their
   existing spacing. */
.table-filter { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; margin: 0 0 24px; padding: 0 0 16px; border-bottom: 1px solid var(--divider); }
/* One boxed group per filter: a bordered fieldset with a legend title and a
   labelled control inside. Groups in one line share their height; the actions
   center against them instead of sinking to the bottom of the row. */
.table-filter .filter-group { display: flex; flex-wrap: wrap; align-items: flex-start; align-content: flex-start; gap: 4px 12px; flex: 1 1 auto; min-width: 0; max-width: 100%; margin: 0; padding: 8px 16px 16px; border: 1px solid var(--divider); border-radius: 8px; }
.table-filter .filter-group label { flex: 0 1 150px; min-width: 110px; margin: 0; }
/* A filter select is named by its group legend, so its label holds only the
   control and shrinks to it: the select widens to its longest option instead
   of clipping the text. */
.table-filter .filter-group label:has(> select) { flex: 0 0 auto; min-width: 0; }
.table-filter .filter-group label > select { width: auto; }
.table-filter .filter-group.search-field { flex: 2 1 280px; min-width: 180px; }
.table-filter .filter-group.search-field label { flex: 1 1 220px; }
/* A date group carries up to four controls; the wider basis keeps two per row
   instead of stacking them and stretching the whole toolbar. */
.table-filter .filter-group.date-filter { flex: 2 1 300px; }
.table-filter .date-filter input { font-variant-numeric: tabular-nums; }
.activity-sentence { margin: 0 0 4px; }
.plan-toolbar button { margin-left: auto; }
.plan-toolbar.table-filter > button, .plan-toolbar.table-filter > .button { align-self: center; margin-left: 0; }
/* Activity is the only bar with seven single-control groups plus Anzeigen.
   Wider than 1100px they share one row without widening the page. Kunden and
   Planung keep the shared wrapping rules; 761–1100px is left unchanged. */
@media (min-width: 1101px) {
  #activity-log .plan-toolbar.table-filter { flex-wrap: nowrap; gap: 4px; }
  #activity-log .table-filter .filter-group { padding: 6px 6px 8px; gap: 2px; min-width: 0; }
  #activity-log .table-filter .filter-group:has(select) { flex: 0 1 auto; min-width: 0; }
  #activity-log .table-filter .filter-group.search-field { flex: 1 1 64px; min-width: 64px; }
  #activity-log .table-filter .filter-group.date-filter { flex: 1 1 88px; min-width: 88px; }
  #activity-log .table-filter .filter-group label,
  #activity-log .table-filter .filter-group.search-field label,
  #activity-log .table-filter .filter-group label:has(> select) { flex: 1 1 auto; min-width: 0; max-width: 100%; }
  #activity-log .table-filter .filter-group input,
  #activity-log .table-filter .filter-group label > select { width: 100%; min-width: 0; max-width: 100%; }
  #activity-log .plan-toolbar.table-filter > button { flex: 0 0 auto; margin-left: 0; padding: 8px 10px; }
}
.toolbar { align-items: flex-end; }
.toolbar label { margin: 0; flex: 0 1 260px; }
.settings-summary { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 20px 0; font-size: 16px; }
.settings-summary dt { color: var(--secondary); font-weight: 550; }
.settings-summary dd { margin: 0; overflow-wrap: anywhere; }
.error, .notice { padding: 14px 16px; border-radius: 8px; font-size: 15px; }
.error { color: var(--error); background: var(--error-bg); }
.notice { background: var(--selection); color: var(--text); }
.table-scroll { position: relative; overflow-x: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 16px 12px; border-bottom: 1px solid var(--divider); vertical-align: top; }
th { color: var(--secondary); background: #fafafa; font-size: 15px; font-weight: 550; }
td { font-size: 16px; }
tbody tr:last-child > * { border-bottom: 0; }
table input:not([type="checkbox"]) { min-width: 100px; }
table input[type="time"] { min-width: 120px; }
.table-scroll:focus-visible { outline-offset: -3px; }
.badge { display: inline-flex; align-items: center; border: 0; border-radius: 6px; padding: 4px 8px; white-space: nowrap; font-size: 15px; line-height: 1.4; font-weight: 550; color: var(--neutral); background: var(--neutral-bg); }
.badge a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.badge-open { background: var(--attention-bg); color: var(--attention); }
.order-warning { padding: 12px 16px; border-radius: 8px; color: var(--attention); background: var(--attention-bg); }
.badge-confirmed, .badge-accomplished { background: var(--positive-bg); color: var(--positive); }
.badge-overdue { background: var(--error-bg); color: var(--error); }
summary { cursor: pointer; touch-action: manipulation; min-height: 42px; }
.due-list > summary { min-height: 42px; font-size: 17px; font-weight: 550; }
.due-list > summary .counts { color: var(--secondary); font-size: 15px; font-weight: 400; margin-left: 16px; }
.due-list[open] > summary { margin-bottom: 20px; }
.tour { border-top: 1px solid var(--divider); padding: 16px 0; scroll-margin-top: 24px; }
.tour-disclosure > .tour-summary { list-style: none; position: relative; padding: 8px 8px 8px 32px; border-radius: 8px; }
.tour-summary::-webkit-details-marker { display: none; }
.tour-summary::before { content: ''; position: absolute; top: 20px; left: 9px; width: 7px; height: 7px; border-right: 1.75px solid var(--secondary); border-bottom: 1.75px solid var(--secondary); transform: rotate(-45deg); }
.tour-disclosure[open] > .tour-summary::before { transform: rotate(45deg); }
.tour-summary > .heading { margin: 0; gap: 8px; }
/* Each summary is its own grid, so shared columns are definite tracks: a
   content-sized track would follow the vehicle label, the date, or the status
   text and the next row would not line up. 196px is the five chips, 96px the
   date, 148px the widest status, 188px the history column. The title track
   absorbs the leftover. Below 900px those tracks plus the page padding leave
   no usable title column, and below about 820px they overflow the viewport,
   so the summary stacks instead of scrolling the page. */
.tour-header-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 196px 96px 148px 188px;
  align-items: center;
  column-gap: 12px;
  row-gap: 8px;
  width: 100%;
  min-width: 0;
}
.tour-header-row > .tour-title {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  text-wrap: wrap;
  font-size: 18px;
  font-weight: 550;
}
.tour-header-row > .weekday-chips { grid-column: 2; grid-row: 1; }
.tour-header-row > .when-text { grid-column: 3; grid-row: 1; }
.tour-header-row > .badge { grid-column: 4; grid-row: 1; justify-self: start; }
.tour-header-row > .tour-counters { grid-column: 1 / 5; grid-row: 2; min-width: 0; }
/* History and dissolve share this track. A sixth track, or a content-sized
   one, would widen the summary and scroll the page. */
.tour-header-row > .tour-header-links {
  grid-column: 5;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  min-width: 0;
}
@media (max-width: 900px) {
  .tour-header-row { grid-template-columns: minmax(0, 1fr); }
  .tour-header-row > .when-text:empty { display: none; }
  .tour-header-row > .tour-title,
  .tour-header-row > .weekday-chips,
  .tour-header-row > .when-text,
  .tour-header-row > .badge,
  .tour-header-row > .tour-counters,
  .tour-header-row > .tour-header-links { grid-column: 1; grid-row: auto; }
}
.weekday-chips { display: inline-flex; gap: 4px; }
.weekday-chip { display: inline-flex; justify-content: center; align-items: center; min-width: 36px; height: 32px; border-radius: 6px; background: var(--neutral-bg); color: var(--neutral); font-size: 15px; font-weight: 550; }
.weekday-chip-active { background: var(--positive); color: white; }
.when-text { color: var(--secondary); font-weight: 400; font-size: 16px; }
.tour-counters { display: inline-flex; flex-wrap: wrap; gap: 6px 16px; color: var(--secondary); font-size: 15px; font-variant-numeric: tabular-nums; }
.counter-group { display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.counter { font-weight: 550; }
.counter-completed, .counter-confirmed { color: var(--positive); }
.counter-open { color: var(--attention); }
.counter-overdue { color: var(--error); }
.tour-body { padding: 20px 0 0; }
.date-form { padding: 16px; margin: 0 0 20px; background: var(--workspace); border-radius: 8px; }
/* The recommended days are a hint beside the visible day select, never a
   second action that re-dates the tour in one click. */
.date-hints { margin: 0 0 20px; padding-left: 20px; color: var(--secondary); font-size: 15px; }
.date-hints strong { color: var(--text); font-weight: 550; font-variant-numeric: tabular-nums; }
.tour-actions { padding: 20px 0 0; gap: 8px; align-items: flex-start; }
.tour-export-feedback { display: flex; flex-wrap: wrap; min-height: 48px; padding-top: 8px; }
.tour-dating { display: contents; }
.tour-release { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.tour-release:empty { display: none; }
.tour-command { margin: 0; }
/* The release/reopen decision reserves the width of its longer label, so the
   surrounding tour actions keep their arrangement when the label changes. */
.tour-release .tour-command { min-width: 180px; }
.tour-release .tour-command button { width: 100%; }
.reopen-tour { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.tour-history, .tour-dissolve { margin-left: auto; display: inline-flex; align-items: center; min-height: 44px; padding: 8px; font-size: 16px; font-weight: 550; text-decoration: underline; text-underline-offset: 3px; }
/* Dated-tour stops stay a table above 1100px. The old column floors (720px on
   the actions alone) were wider than the card from 1101px to about 1300px, so
   the table scrolled inside the card. Fixed columns keep each band inside the
   card: below 1280px the action labels wrap onto extra rows, and from 1280px
   the action column is wide enough for one row. The Standort column takes
   whatever width is left, so a wider window gives the name more room instead
   of stretching the buttons. At 1100px and below every stop is a card. */
@media (min-width: 1101px) {
  .coordination-table { width: 100%; min-width: 0; table-layout: fixed; }
  .coordination-table th, .coordination-table td { min-width: 0; overflow-wrap: anywhere; }
  .coordination-table .badge, .coordination-table a[href^="tel:"] { white-space: normal; }
}
@media (min-width: 1101px) and (max-width: 1279.98px) {
  .coordination-table th:nth-child(1) { width: 48px; }
  .coordination-table th:nth-child(3) { width: 184px; }
  .coordination-table th:nth-child(4) { width: 100px; }
  .coordination-table th:nth-child(5) { width: 148px; }
  .coordination-table th:nth-child(6) { width: 320px; }
}
.coordination-table td { padding: 18px 12px; }
/* A drive line is not a stop. It stays a short muted row, and below 1100px it
   must not pick up the stacked stop-card chrome or the "Stopp " prefix. */
.coordination-table tr.tour-leg td {
  padding: 4px 12px 8px;
  font-size: 15px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
/* 6px horizontal cell padding and 6px action padding leave a one-row action
   set and the promise line inside a 1280px card. Wider windows keep these
   tracks and give the spare width to Standort. */
@media (min-width: 1280px) {
  .coordination-table th, .coordination-table td { padding-left: 6px; padding-right: 6px; }
  .coordination-table .stop-actions button,
  .coordination-table .stop-actions .button { padding-left: 6px; padding-right: 6px; }
  .coordination-table th:nth-child(1) { width: 40px; }
  .coordination-table th:nth-child(3) { width: 164px; }
  .coordination-table th:nth-child(4) { width: 84px; }
  .coordination-table th:nth-child(5) { width: 108px; }
  .coordination-table th:nth-child(6) { width: 644px; }
}
.site-address { display: block; margin-top: 4px; color: var(--secondary); font-size: 15px; font-weight: 400; }
.nowrap { white-space: nowrap; }
.computed-field { margin: 12px 0; }
.computed-field span { display: block; color: var(--secondary); font-size: 15px; font-weight: 550; }
.computed-field strong { display: flex; align-items: center; min-height: 44px; margin-top: 6px; font-size: 16px; font-weight: 550; }
.stop-name { font-size: 17px; font-weight: 550; }
.stop-phone { display: block; font-size: 15px; margin: 4px 0; }
.stop-notes { max-width: 42ch; font-size: 15px; color: var(--secondary); white-space: pre-wrap; margin: 6px 0; }
.stop-details { margin-top: 8px; }
.stop-details > summary { color: var(--text); font-size: 15px; min-height: 42px; text-underline-offset: 3px; }
.detail-body { padding: 12px 0; }
.stop-details dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: 0; font-size: 15px; }
.stop-details dt { font-weight: 550; color: var(--secondary); }
.stop-details dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.stop-actions { gap: 6px; flex-wrap: wrap; }
.stop-actions button, .stop-actions .button { white-space: nowrap; font-size: 15px; }
/* The leading action slot fills the leftover cell width, so its label (Termin
   bestätigen / Wieder öffnen) never moves the actions after it when the stop
   state changes. Its weight comes from the shared secondary class, not from
   the slot: a confirmed stop's Wieder öffnen must not look primary. */
.stop-actions > form:first-child { flex: 1 1 auto; }
.stop-actions > form:first-child button { width: 100%; }
@media (pointer: coarse) {
  .stop-actions button, .stop-actions .button { min-height: 44px; }
}
/* Hard box: tiles and the attribution stay inside the card even when Leaflet's
   own overflow rule has not applied yet. Height is fixed on desktop and again
   in the narrow layout below. */
.tour-map {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  height: 300px;
  max-height: 300px;
  min-width: 0;
  margin-top: 24px;
  overflow: hidden;
  position: relative;
  z-index: 0;
  border: 1px solid var(--divider);
  border-radius: 8px;
  background: var(--workspace);
}
.tour-map.leaflet-container { width: 100%; height: 300px; max-height: 300px; overflow: hidden; }
/* Legal attribution, kept inside the map and smaller than body text. The
   control keeps Leaflet's own corner placement; forcing it absolute here
   collapses the bar to zero width and stacks the letters down the edge. */
.tour-map .leaflet-bottom { max-width: 100%; }
.tour-map .leaflet-control-attribution {
  max-width: 100%;
  margin: 0;
  padding: 0 4px;
  box-sizing: border-box;
  font-size: 12px;
  line-height: 1.3;
  color: var(--secondary);
  background: rgb(255 255 255 / 88%);
  white-space: normal;
  overflow-wrap: anywhere;
}
/* Leaflet's own zoom links are 26 px (30 px on touch), below the 42 px
   desktop target. Line height and indent keep the +/− mark centred in the
   larger box. */
.tour-map .leaflet-control-zoom a {
  width: 42px;
  height: 42px;
  line-height: 42px;
  text-indent: 0;
}
@media (max-width: 760px), (pointer: coarse) {
  .tour-map .leaflet-control-zoom a { width: 44px; height: 44px; line-height: 44px; }
}
.map-status {
  position: absolute;
  z-index: 800;
  left: 8px;
  right: 8px;
  bottom: 22px;
  margin: 0;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--error-bg);
  color: var(--error);
  font-size: 15px;
  line-height: 1.4;
}
.map-marker { background: var(--accent); border: 2px solid white; border-radius: 50%; color: white; display: flex; justify-content: center; align-items: center; font-size: 14px; font-weight: 550; box-shadow: 0 1px 4px #00000055; }
fieldset { min-width: 0; border: 1px solid var(--divider); border-radius: 8px; padding: 16px; margin: 20px 0; }
legend { font-weight: 550; padding: 0 8px; }
dialog { width: min(680px, calc(100% - 32px)); max-height: calc(100dvh - 48px); padding: 28px; border: 0; border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: 0 16px 48px #00000024; }
dialog[open]:not(:modal) { position: static; margin: 24px auto; }
dialog::backdrop { background: #17171766; }
.date-option-section { margin-top: 24px; border-top: 1px solid var(--divider, #E7E7EA); padding-top: 16px; }
.date-option-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 12px 0; }
.date-option-row p { margin: 4px 0; }
/* One recommended slot leads the dialog; the rest stays behind a closed
   disclosure so it remains the sole obvious next click. */
.date-option-row.recommended { margin-top: 12px; padding: 16px; border: 1px solid var(--selection-border); border-radius: 12px; background: var(--selection); }
.date-option-badge { margin: 0 0 4px; }
.date-option-badge .badge { background: var(--text); color: var(--surface); }
.date-option-line, .date-option-note { font-variant-numeric: tabular-nums; }
.date-option-note { color: var(--secondary); font-size: 15px; }
.date-option-more { margin-top: 20px; border-top: 1px solid var(--divider); padding-top: 8px; }
.date-option-more > summary { padding: 8px 0; min-height: 42px; font-weight: 550; cursor: pointer; }
.date-option-more > summary::marker { color: var(--secondary); }
.date-option-filters { margin: 4px 0 8px; }
.date-option-filters [aria-current="true"] { outline: 2px solid var(--text); outline-offset: 2px; }
.modal-dialog { width: min(760px, calc(100% - 32px)); }
dialog .actions { margin-top: 24px; }
.site-editor > summary { font-size: 20px; font-weight: 580; min-height: 42px; }
.site-editor[open] > summary { margin-bottom: 20px; }
.note-drafts { margin-top: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--divider); }
.note-add { margin: 12px 0 16px; }
.form-submit { margin-top: 28px; }
.note-row { display: grid; grid-template-columns: minmax(160px, 220px) minmax(0, 1fr) auto; gap: 8px 12px; align-items: end; padding: 12px 0; border-top: 1px solid var(--divider); }
.note-row label { margin: 0; }
.note-row textarea { min-height: 72px; }
.note-kind, .note-body { margin: 0; }
.note-kind { color: var(--secondary); font-size: 15px; font-weight: 550; }
.note-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.note-row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.note-row-actions form { margin: 0; }
.note-create { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--divider); }
#uebersicht, #bearbeiten, #notizen, #neue-notiz, #aktivierung, #fahrerblatt, #daten, [id^="note-"] { scroll-margin-top: 24px; }
.note-preview { white-space: pre-wrap; }
.address-suggest-list { display: flex; flex-direction: column; gap: 4px; margin: 4px 0; }
.address-suggest-item { background: var(--surface); color: var(--text); border-color: var(--border); text-align: left; justify-content: flex-start; font-weight: 400; }
.address-suggest-status { color: var(--error); }
.travel-breakdown { display: flex; gap: 12px; list-style: none; padding: 0; color: var(--secondary); font-size: 15px; }
.notifications { position: fixed; top: 92px; right: 20px; width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 112px); display: flex; flex-direction: column; gap: 8px; overflow-y: auto; z-index: 2000; pointer-events: none; }
.notification { display: flex; gap: 12px; align-items: flex-start; padding: 16px; background: var(--surface); border-radius: 12px; box-shadow: 0 8px 24px #00000014, 0 0 0 1px var(--divider); pointer-events: auto; }
.notification-error { color: var(--error); background: var(--error-bg); }
.notification-notice { color: var(--positive); background: var(--positive-bg); }
.notification-info { color: var(--neutral); background: var(--neutral-bg); }
.notification-warning { color: var(--attention); background: var(--attention-bg); }
.notification-progress { color: var(--attention); background: var(--attention-bg); font-weight: 550; font-variant-numeric: tabular-nums; }
/* The wait modal's scrim covers the fixed feedback region and the dialog
   carries the planning progress itself, so the background-status toasts stay
   hidden for as long as it is open, including ones a poll swaps in, and
   return when it closes. */
body:has(.planning-wait[open]) #notifications [data-notification="progress"] { display: none; }
.background-status { display: flex; flex-direction: column; gap: 8px; }
.notification-text { flex: 1; overflow-wrap: anywhere; font-size: 15px; }
.notification-dismiss { background: transparent; color: inherit; min-width: 42px; min-height: 42px; padding: 0; margin: -8px -8px -8px 0; font-size: 20px; }
/* The stale-month warning sits in the page flow above the planning card, so it
   never covers a control. Amber stays paired with the sentence itself. */
.planning-freshness .notification { margin: 0 0 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; border: 1px solid var(--attention); box-shadow: none; }
.planning-freshness .notification-text { margin: 0; font-weight: 550; }
.planning-freshness .notification form { margin: 0; flex: none; }
.planning-freshness .notification button { background: var(--surface); color: var(--text); border-color: var(--border); }
button.info-button { width: 42px; height: 42px; min-height: 42px; padding: 0; border: 0; border-radius: 999px; background: transparent; color: var(--secondary); flex: none; }
button.info-button .icon { width: 18px; height: 18px; }
.info-popover { margin: 8px 0 0; inset: auto; width: min(36ch, calc(100vw - 32px)); padding: 14px 16px; border: 0; border-radius: 12px; background: var(--surface); color: var(--text); font-size: 15px; line-height: 1.5; box-shadow: 0 12px 32px #0000001f, 0 0 0 1px #00000014; position-area: bottom span-left; }
.info-popover p { margin: 0; }
.form-grid > label { min-width: 0; }
.form-grid > label > select { min-height: 44px; }
.planning-wait { width: min(520px, calc(100% - 32px)); text-align: center; padding: 36px; animation: planning-reveal 120ms cubic-bezier(.22,1,.36,1) 1000ms both; }
.planning-wait::backdrop { background: #17171788; animation: planning-reveal 120ms cubic-bezier(.22,1,.36,1) 1000ms both; }
.planning-wait h2 { margin-bottom: 16px; }
.planning-wait h2:focus { outline: none; }
.planning-wait p { margin: 16px 0; }
.planning-progress { height: 8px; margin: 28px 0; border-radius: 8px; background: var(--divider); overflow: hidden; }
.planning-progress > span { display: block; width: 35%; height: 100%; border-radius: inherit; background: var(--accent); animation: planning-progress 1400ms cubic-bezier(.45,0,.55,1) infinite alternate; }
@keyframes planning-reveal { from { opacity: 0; } to { opacity: 1; } }
@keyframes planning-progress { from { transform: translateX(0); } to { transform: translateX(185%); } }
#touren, [id^="tour-"], [id^="stop-"] { scroll-margin-top: 24px; }
.tour-filters { display: flex; flex-wrap: wrap; gap: 4px; border: 0; border-bottom: 1px solid var(--divider); border-radius: 0; padding: 0 0 12px; margin: 0 0 12px; }
.tour-filter { position: relative; margin: 0; }
.tour-filter input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tour-filter span { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 16px; font-weight: 550; color: var(--secondary); }
.tour-filter b { font-weight: 400; font-variant-numeric: tabular-nums; }
.tour-filter input:checked + span { background: transparent; color: var(--text); box-shadow: inset 0 -2px var(--text); }
.tour-filter input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.empty-state { padding: 32px 0; text-align: center; color: var(--secondary); }
.hero { padding: 0 0 12px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 24px; align-items: stretch; }
.dashboard-grid .card { margin: 0; }
.work-item { display: flex; align-items: center; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--divider); text-decoration: none; color: var(--text); }
.work-item:last-child { border-bottom: 0; padding-bottom: 0; }
.work-item > .icon { width: 20px; height: 20px; color: var(--text); }
.work-item > div { flex: 1; }
.work-item strong { display: block; font-size: 17px; font-weight: 550; }
.work-item .muted { margin: 4px 0 0; }
.work-count { font-size: 26px; font-weight: 550; font-variant-numeric: tabular-nums; }
.attention-card { margin-top: 24px; }
.attention-group + .attention-group { margin-top: 20px; }
.attention-group h3 { margin: 0 0 8px; color: var(--secondary); font-size: 16px; font-weight: 550; }
.attention-list { display: grid; gap: 4px; list-style: none; margin: 0; padding: 0; }
.attention-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; padding: 10px 12px; border-radius: 8px; color: var(--text); text-decoration: none; }
.attention-item > .icon { flex: none; width: 18px; height: 18px; color: var(--secondary); }
.attention-item.attention-more { color: var(--secondary); font-weight: 550; }
ul.counts { display: grid; gap: 12px; list-style: none; margin: 16px 0 24px; padding: 0; font-size: 16px; }
ul.counts .badge { justify-content: center; min-width: 30px; margin-right: 8px; }
.export-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 28px; margin: 24px 0; }
.export-options .inline { align-items: flex-start; padding: 12px 0; }
.export-options .inline input { margin-top: 1px; }
.login-page main { display: grid; min-height: 100dvh; place-items: center; padding: 32px 16px; }
.login { width: min(100%, 430px); padding: 36px; margin: 0; }
.login .brand { margin-bottom: 28px; }
.login h1 { font-size: 32px; }
.login form { margin-top: 24px; }
.login label { margin: 18px 0 6px; }
.login button { margin-top: 24px; width: 100%; }
@media (hover: hover) and (pointer: fine) {
  button:hover:not(:disabled), .button:hover { background: var(--accent-hover); color: white; }
  .secondary:hover:not(:disabled), .quiet:hover:not(:disabled), .address-suggest-item:hover, button.info-button:hover { background: var(--selection); color: var(--text); }
  .topbar nav a:hover, .tour-summary:hover, .work-item:hover, .attention-item:hover, .tour-filter span:hover { background: var(--selection); }
  tbody tr:hover { background: #fafafa; }
}
@media (max-width: 1100px) {
  main { padding: 28px 24px 48px; }
  /* Narrow and medium screens: each stop is a card, so nothing scrolls sideways.
     The header row stays for assistive technology, the cells carry their own
     labels, and the actions wrap and fill the card width. */
  .coordination-table, .coordination-table tbody { display: block; }
  .coordination-table thead {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .coordination-table tr {
    display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px;
    margin: 0 0 12px; padding: 16px; border: 1px solid var(--divider); border-radius: 12px; background: var(--surface);
  }
  .coordination-table td { display: block; grid-column: 1 / -1; min-width: 0; padding: 6px 0; border-bottom: 0; }
  .coordination-table td:nth-child(1) { grid-column: 1; font-weight: 550; }
  .coordination-table td:nth-child(1)::before { content: "Stopp "; color: var(--secondary); }
  .coordination-table td:nth-child(2) { grid-column: 2; overflow-wrap: anywhere; }
  .coordination-table td[data-label]::before {
    content: attr(data-label); display: inline-block; min-width: 88px; margin-right: 8px;
    color: var(--secondary); font-size: 15px; font-weight: 550;
  }
  .coordination-table td:empty { display: none; }
  .coordination-table td:last-child { padding-top: 12px; }
  .coordination-table tr.tour-leg {
    display: block;
    margin: 0 0 8px;
    padding: 0 4px 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .coordination-table tr.tour-leg td { padding: 0; font-weight: 400; }
  .coordination-table tr.tour-leg td::before { content: none; }
  .stop-actions { flex-wrap: wrap; }
  .stop-actions > * { flex: 1 1 auto; }
  .stop-actions button, .stop-actions .button { white-space: normal; min-height: 44px; }
  .stop-actions > form button { width: 100%; }
  .topbar { padding: 0 24px; gap: 20px; flex-wrap: wrap; }
  .topbar nav { gap: 0; }
  .topbar nav a { padding: 12px 10px; }
  .topbar nav .icon { display: none; }
  /* 92px clears only the single-row bar. Once the bar wraps, one viewport top
     clears a phone stack of padding, brand, organization name, logout and nav
     and stays on screen when the page scrolls. */
  .notifications { top: 220px; max-height: calc(100dvh - 240px); }
}
@media (max-width: 760px) {
  main { padding: 24px 16px 48px; }
  .stop-actions > * { flex-basis: 100%; }
  .topbar { padding: 12px 16px 0; gap: 12px; }
  .topbar > form { margin-left: auto; }
  .topbar nav { order: 3; width: 100%; flex: 1 0 100%; overflow-x: auto; }
  .topbar nav a { flex: 1 0 auto; justify-content: center; min-height: 44px; }
  .card { padding: 20px; margin: 20px 0; }
  .dashboard-grid, .card-grid { grid-template-columns: 1fr; gap: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; flex-wrap: wrap; }
  .plan-toolbar label { flex: 1; min-width: 100px; }
  .plan-toolbar button { width: 100%; margin: 8px 0 0; }
  .table-filter .filter-group { flex: 1 1 100%; }
  .table-filter .filter-group label { flex: 1 1 140px; }
  .table-filter .filter-group input, .table-filter .filter-group select { font-size: 16px; }
  .plan-toolbar.table-filter > button,
  .plan-toolbar.table-filter > .button { width: auto; margin: 4px auto 0; }
  .settings-summary { grid-template-columns: 1fr; gap: 4px; }
  .settings-summary dd { margin-bottom: 8px; }
  .due-list > summary .counts { display: block; margin: 8px 0; }
  button, .button, .inline, summary, .stop-details > summary { min-height: 44px; }
  .inline { min-width: 44px; }
  input, select, textarea { min-height: 44px; font-size: 16px; }
  .tour-filter span { min-height: 44px; }
  .tour { padding: 12px 0; }
  .tour-map, .tour-map.leaflet-container { height: 220px; max-height: 220px; }
  .tour-header-row { gap: 8px; }
  .note-row, .note-create { grid-template-columns: 1fr; }
  .stop-details dl { grid-template-columns: 1fr; }
  .stop-details dd { margin-bottom: 8px; }
  dialog { padding: 20px; }
  .export-options { grid-template-columns: 1fr; }
  .notification-dismiss { min-width: 44px; min-height: 44px; }
  .login { padding: 28px; }
}
/* Above the 1640px measure the planning list grows with the viewport instead of
   centring a capped column: a wide display belongs to the tour rows, whose
   flexible title track absorbs the extra width. #planning-inputs is on every
   planning response, including the #main that the planning refresh swaps in,
   so :has() selects the page without a body class. Prose keeps the inner
   measure of the old 1640px column, so line length does not stretch with the
   window, and the topbar takes the column's 40px desktop inset instead of
   centring on 1560px. Other pages keep the cap; the narrow layouts above never
   reach this query. */
@media (min-width: 1641px) {
  main:has(#planning-inputs) { max-width: none; }
  main:has(#planning-inputs) p { max-width: 1560px; }
  body:has(#planning-inputs) .topbar { padding: 0 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; scroll-behavior: auto !important; }
  button:active:not(:disabled), .button:active { transform: none; }
  .planning-wait, .planning-wait::backdrop { animation-duration: 0ms; }
  .planning-progress > span { animation: none; width: 100%; opacity: .5; }
}
