/* Gestaltung nach DEKRA Corporate Design (Stand 2026): Schrift Noto Sans, Farben aus Primär-,
   Akzent- und Digitalpalette, keine Transparenzen. Schrift lokal (SIL Open Font License, fonts/). */
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/noto-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/noto-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
:root {
  --logo-green: #008143;   /* DEKRA Logo Grün */
  --dark-green: #006B52;   /* Dunkelgrün: Überschriften, Flächen */
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #000000;         /* Fließtext Schwarz */
  --heading: #006B52;
  --muted: #3d3d3d;
  --line: #A5C4BA;         /* Dunkelgrün 40 % */
  --field-line: #478974;   /* Dunkelgrün 80 % (Kontrast ≥ 3:1 für Eingabefelder) */
  --brand: #006B52;
  --brand-ink: #ffffff;
  --go: #64B32C;           /* Hellgrün: Call to Action */
  --go-ink: #000000;
  --stop: #A65600;         /* Orange, für Text auf Weiß abgedunkelt (Kontrast) */
  --stop-fill: #EF7C00;    /* Akzent Orange */
  --stop-ink: #000000;
  --warn-bg: #FFEBAE;      /* Gelb 40 % */
  --warn-ink: #000000;
  --warn-line: #EF7C00;
  --ok-bg: #EFFFE4;        /* Brightgreen 50 */
  --ok-ink: #000000;
  --tab-active: #008143;
  --radius: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12190C;         /* Brightgreen 900 */
    --surface: #233318;    /* Brightgreen 800 */
    --text: #ffffff;
    --heading: #C8FEA1;    /* Brightgreen 100 */
    --muted: #C3E1B1;
    --line: #354C24;       /* Brightgreen 700 */
    --field-line: #9EE46C; /* Digitalgrün (Kontrast für Eingabefelder) */
    --brand: #9EE46C;      /* Digitalgrün */
    --brand-ink: #000000;
    --go: #9EE46C;
    --go-ink: #000000;
    --stop: #F3974A;
    --stop-fill: #F3974A;
    --stop-ink: #000000;
    --warn-bg: #FFE083;
    --warn-ink: #000000;
    --warn-line: #F3974A;
    --ok-bg: #354C24;
    --ok-ink: #ffffff;
    --tab-active: #9EE46C;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--brand); }
.top {
  background: #ffffff;   /* Logo immer auf Weiß (Originalfarben, Schutzraum) */
  color: #006B52;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 4px solid #008143;
}
.top .logo { height: 30px; width: auto; display: block; }
.top .app-name {
  font-weight: 400;
  font-size: 1.15rem;
  color: #006B52;
  padding-left: 14px;
  border-left: 1px solid #A5C4BA;
  line-height: 1.2;
}
.tabs {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 2;
}
.tabs a {
  flex: 1;
  text-align: center;
  padding: 12px 4px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 3px solid transparent;
}
.tabs a[aria-current="page"] { color: var(--tab-active); border-bottom-color: var(--tab-active); }
main { max-width: 640px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.6rem; font-weight: 400; color: var(--heading); margin: 8px 0 16px; }
h2 { font-size: 1.15rem; font-weight: 600; color: var(--heading); margin: 20px 0 10px; }
.card h2 { margin-top: 0; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 16px;
}
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.note {
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ok-bg);
  color: var(--ok-ink);
  margin: 0 0 14px;
}
.note.error { background: var(--warn-bg); color: var(--warn-ink); }
.stack { display: grid; gap: 12px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: grid; gap: 4px; font-weight: 600; font-size: .95rem; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input { margin-top: 4px; width: 20px; height: 20px; }
input, select {
  font: inherit;
  padding: 11px 12px;
  border: 1px solid var(--field-line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  width: 100%;
  min-height: 46px;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}
button, .button {
  font: inherit;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 0;
  background: var(--brand);
  color: var(--brand-ink);
  text-decoration: none;
  cursor: pointer;
}
button.secondary, .button.secondary {
  background: transparent;
  color: var(--brand);
  border: 1.5px solid var(--brand);
}
button.small { min-height: 34px; padding: 4px 10px; font-size: .85rem; }
button.link {
  background: none;
  color: var(--stop);
  padding: 6px 0;
  min-height: 0;
  font-weight: 600;
  text-decoration: underline;
}
button.wide { width: 100%; margin-bottom: 16px; }
button.stop { background: var(--stop-fill); color: var(--stop-ink); }
button:disabled { opacity: .6; cursor: progress; }
.status { text-align: center; padding: 8px 0 16px; }
.big { font-size: 1.25rem; font-weight: 700; margin: 0 0 16px; }
.huge {
  width: min(100%, 320px);
  min-height: 96px;
  font-size: 1.75rem;
  border-radius: 20px;
}
.huge.start { background: var(--go); color: var(--go-ink); }
.huge.stop { background: var(--stop-fill); color: var(--stop-ink); }
.stops { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.stop-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.stop-item.unknown { border-left-color: var(--warn-line); }
.stop-item.excluded { opacity: .55; border-left-color: var(--line); }
.stop-item.excluded .place { text-decoration: line-through; }
.stop-main { display: grid; gap: 2px; }
.time { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.place { font-weight: 700; font-size: 1.05rem; }
.addr { color: var(--muted); font-size: .9rem; }
.km { color: var(--muted); font-size: .85rem; }
.badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--line);
  color: var(--text);
  margin-left: 6px;
  width: fit-content;
}
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge.live { background: var(--ok-bg); color: var(--ok-ink); }
details > summary { cursor: pointer; padding: 8px 0; font-weight: 600; color: var(--brand); }
details.edit { margin-top: 8px; border-top: 1px solid var(--line); }
details.edit form { padding: 8px 0 4px; }
details.danger summary { color: var(--stop); }
details.danger form { margin: 8px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.monthnav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.monthnav a {
  font-size: 1.6rem;
  text-decoration: none;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.daylist, .places, .log { list-style: none; padding: 0; margin: 0; }
.daylist li a {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}
.places li { border-bottom: 1px solid var(--line); }
.places summary { display: grid; gap: 2px; color: var(--text); font-weight: 400; }
.places form { margin: 8px 0; }
.log li { padding: 4px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.steps { padding-left: 22px; }
.steps li { margin-bottom: 10px; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  overflow-wrap: anywhere;
}
code.secret { display: block; font-size: 1.1rem; padding: 10px; margin-top: 8px; letter-spacing: .05em; }
.codes { columns: 2; padding-left: 20px; font-size: 1.1rem; }
.cred { display: grid; gap: 4px; margin-bottom: 14px; }
.cred span { font-weight: 600; font-size: .9rem; }
.cred code { padding: 8px; }
.cred button { justify-self: start; }
.device { padding: 8px 0; border-bottom: 1px solid var(--line); }
.device.revoked { opacity: .5; }
.foot { text-align: center; padding: 24px 16px 32px; font-size: .875rem; color: var(--muted); }
.foot p { margin: 0 0 6px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.route { margin: 16px 0; }
.report-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.report { width: 100%; border-collapse: collapse; font-size: .95rem; }
.report th, .report td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.report th { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.report td:nth-child(-n+4) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.report .route-cell { min-width: 14em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88rem; }
.report .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.report tfoot td { font-weight: 700; border-bottom: 0; }
.report a { color: inherit; }
@media print {
  .tabs, .foot, .noprint { display: none !important; }
  .top { border-bottom: 2px solid #008143; padding: 0 0 8px; }
  body { background: #fff; color: #000; }
  main { max-width: none; padding: 0; }
  .report-wrap { border: 0; overflow: visible; }
  .report th, .report td { border-bottom: 1px solid #999; color: #000; }
  @page { size: A4 landscape; margin: 12mm; }
}
main:has(.report) { max-width: 1040px; }
.todo { background: var(--warn-bg); color: var(--warn-ink); padding: 1px 6px; border-radius: 6px; font-weight: 600; }
.note a { color: inherit; font-weight: 600; }
/* Ortsliste: schlicht, Problemorte oben */
.summary-line { margin: 0 0 12px; color: var(--muted); }
.inline-form { margin: 0 0 12px; }
.chip { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 10px; border-radius: 99px; width: fit-content; }
.chip.missing { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-line); }
.chip.unsure { background: var(--warn-bg); color: var(--warn-ink); }
.chip.ok { background: var(--ok-bg); color: var(--ok-ink); }
.place-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.place-row:last-child { border-bottom: 0; }
.place-row.state-0, .place-row.state-1 { border-left: 4px solid var(--warn-line); padding-left: 12px; }
.place-info { display: grid; gap: 4px; }
.place-edit > summary {
  display: inline-flex; align-items: center; min-height: 40px; margin-top: 8px; padding: 6px 14px;
  border: 1.5px solid var(--brand); border-radius: 8px; color: var(--brand); font-weight: 600; list-style: none; cursor: pointer;
}
.place-edit > summary::-webkit-details-marker { display: none; }
.place-edit[open] > summary { background: var(--brand); color: var(--brand-ink); }
.place-edit form { margin-top: 12px; }
.place-edit details.more summary { padding: 4px 0; font-size: .95rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.edit-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; }
.map-link { font-weight: 600; }
label .muted.small { font-weight: 400; }
.place-edit details.more > summary { color: var(--brand); font-weight: 600; }
.place-edit details.more > summary::before { content: "+ "; }
.place-edit details.more[open] > summary::before { content: "– "; }
.place-edit details.more > summary { display: block; }
