:root {
  color-scheme: light;
  --bg: #eaf2f4;
  --surface: #fffdf9;
  --surface-soft: #edf4f2;
  --ink: #263d47;
  --muted: #688087;
  --line: #dce8e7;
  --primary: #2b6478;
  --primary-soft: #dceff3;
  --brand: #af7657;
  --danger: #b44740;
  --shadow: 0 8px 32px rgba(31, 46, 50, .035);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; margin: 0; }
body { background: linear-gradient(125deg,#e8f3f8 0%,#f4f2e8 47%,#f1e5da 100%); color: var(--ink); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #8eafb4; outline-offset: 2px; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 224px; flex: 0 0 224px; background: #eaf3f4; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 30px 16px 23px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 11px 33px; }
.brand-symbol { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: #e9eeeb; color: #4f7463; }
.brand-symbol .icon { width: 22px; height: 22px; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 15px; font-weight: 700; }
.brand span { margin-top: 3px; color: var(--muted); font-size: 11px; letter-spacing: .02em; }
.side-nav { display: grid; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 13px; width: 100%; padding: 13px 14px; background: transparent; border: 0; color: #65767d; text-align: left; border-radius: 11px; font-size: 14px; font-weight: 600; }
.nav-item:hover { background: #f5f8f6; color: var(--ink); }
.nav-item.active { background: #edf4f2; color: #2f6055; }
.sidebar-footer { margin-top: auto; padding: 15px 10px 0; display: flex; gap: 10px; align-items: center; border-top: 1px solid var(--line); }
.sidebar-footer strong, .sidebar-footer span { display: block; }
.sidebar-footer strong { font-size: 12px; }
.sidebar-footer span { font-size: 10px; color: var(--muted); margin-top: 3px; }
.demo-dot { width: 8px; height: 8px; background: #d6ab68; border-radius: 50%; }
.content-wrap { flex: 1; min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { min-height: 82px; padding: 16px clamp(22px, 3.7vw, 60px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e8eae6; background: rgba(242,248,247,.9); }
.topbar-title { font-size: 13px; color: #78868a; font-weight: 550; }
.topbar-actions { display: flex; align-items: center; gap: 22px; }
.clock { font-size: 20px; font-variant-numeric: tabular-nums; font-weight: 650; letter-spacing: -.03em; }
.primary-button { border: 0; border-radius: 12px; background: var(--primary); color: white; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 16px; min-height: 43px; transition: background .15s; }
.primary-button:hover { background: #254551; }
.secondary-button { border: 1px solid #dbe3e3; color: var(--primary); background: #fff; padding: 10px 14px; border-radius: 10px; font-weight: 600; min-height: 40px; display: inline-flex; align-items: center; gap: 7px; }
.secondary-button:hover { background: #f7f9f8; }
.text-button { border: 0; background: transparent; color: var(--primary); padding: 7px 0; font-weight: 650; font-size: 13px; }
.text-button:hover { text-decoration: underline; }
.icon-button { border: 1px solid #e4e9e8; width: 35px; height: 35px; display: inline-grid; place-items: center; background: white; border-radius: 9px; color: #64777b; }
.icon-button:hover { background: #f0f6f5; }
.icon-button .icon { width: 17px; height: 17px; }
.view { flex: 1; padding: 31px clamp(22px,3.7vw,60px) 38px; width: 100%; margin: 0 auto; max-width: 1650px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.eyebrow { text-transform: uppercase; color: var(--brand); letter-spacing: .12em; font-size: 11px; font-weight: 800; margin-bottom: 7px; }
h1 { font-size: clamp(26px,2.5vw,36px); letter-spacing: -.045em; font-weight: 750; margin: 0; line-height: 1.18; }
.page-subtitle { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 9px 0 0; }
.header-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip { background: #fff; color: #68777c; border: 1px solid #e3e8e7; border-radius: 999px; font-size: 12px; padding: 8px 13px; white-space: nowrap; font-weight: 600; }
.chip.active { color: #fff; background: var(--primary); border-color: var(--primary); }
.card { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 18px; padding: 22px; min-width: 0; }
.right-stack > .card:nth-child(1) { background: #fdf7ef; }
.left-stack > .card { background: #fffefa; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.card-head h2, .card h2 { font-size: 16px; margin: 0; font-weight: 720; letter-spacing: -.015em; }
.card-meta { color: var(--muted); font-size: 12px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(285px,1fr); gap: 17px; align-items: start; }
.left-stack, .right-stack { display: grid; gap: 17px; align-content: start; }
.day-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 17px; }
.day-cell { border: 1px solid transparent; background: transparent; border-radius: 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 4px; min-width: 0; }
.day-cell:hover { background: #f4f8f7; }
.day-cell.active { background: #d5e9f0; border-color: #dde9e6; }
.day-cell .weekday { color: var(--muted); text-transform: uppercase; font-size: 10px; font-weight: 700; }
.day-cell .day-number { font-size: 19px; font-weight: 700; }
.day-cell.today .day-number { color: #b26947; }
.event-dots { min-height: 12px; display: flex; align-items: center; gap: 3px; }
.event-dot { display:inline-block; width: 19px; height: 9px; border: 1px solid var(--person-color); border-radius: 5px; background: var(--person-color); opacity: .97; }
.section-divider { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.agenda-row { display: flex; align-items: flex-start; gap: 13px; border-top: 1px solid #f0f2f0; padding: 13px 0; }
.agenda-row:first-child { border-top: 0; }
.event-time { min-width: 57px; color: #63767c; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; padding-top: 3px; }
.event-vertical { width: 8px; min-height: 44px; align-self: stretch; border-radius: 9px; flex: 0 0 8px; }
.person-agenda { border-radius: 10px; border: 0; background: var(--event-soft); margin: 6px 0; padding: 10px 9px; }
.person-agenda .event-title { color: var(--event-color); font-size: 14px; }
.person-agenda .event-sub { color: #51646b; }
.event-body { min-width: 0; flex: 1; }
.event-title { font-size: 13px; font-weight: 670; word-break: break-word; }
.event-sub { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.row-actions { display: flex; gap: 4px; flex-shrink: 0; }
.row-actions .icon-button { width: 29px; height: 29px; border: 0; opacity: .65; }
.row-actions .icon-button:hover { opacity: 1; }
.person-legend { display: flex; gap: 13px; flex-wrap: wrap; align-items: center; }
.legend-item { display: flex; align-items: center; gap: 5px; color: #718086; font-size: 11px; }
.legend-dot { width: 24px; height: 12px; border-radius: 5px; display: inline-block; }
.task-row { display: flex; gap: 11px; align-items: flex-start; padding: 10px 0; border-top: 1px solid #f0f2f0; }
.task-row:first-child { border-top: 0; }
.checkbox-round { width: 19px; height: 19px; border-radius: 6px; border: 1.5px solid #a5b7b5; background: white; flex: 0 0 19px; display: grid; place-items: center; padding: 0; margin-top: 1px; }
.checkbox-round.done { background: #47756c; border-color: #47756c; color: white; }
.checkbox-round .icon { width: 14px; height: 14px; }
.task-content { flex: 1; min-width: 0; }
.task-title { font-size: 13px; font-weight: 650; }
.task-title.done { color: #8f999d; text-decoration: line-through; }
.task-sub { color: #899297; margin-top: 4px; font-size: 11px; }
.task-sub.overdue { color: var(--danger); font-weight: 650; }
.inline-status { border-radius: 999px; background: #f5ede3; color: #a26343; padding: 4px 7px; font-size: 10px; font-weight: 700; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.info-card { min-height: 180px; background: #e2f0f6; padding: 17px; }
.info-card:nth-child(2) { background: #f4e6da; }
.weather-main { display:flex; align-items:center; gap:8px; margin:12px 0 4px; }
.weather-symbol { font-size: 27px; }
.weather-temp { font-size:27px; font-weight:760; letter-spacing:-.04em; line-height:1; }
.weather-condition { font-size:11px; font-weight:600; margin-top:4px; }
.weather-detail { display:flex; gap:6px; justify-content:space-between; font-size:11px; padding-top:5px; }
.weather-credit { color:#647980; font-size:9px; margin:8px 0 0; }
.weather-credit a { color:inherit; }
.tile-link { display:inline-block; color:#245971; font-size:12px; font-weight:700; margin-top:8px; line-height:1.5; }

.icon-heading { display: flex; gap: 9px; align-items: center; }
.icon-heading .icon { width: 18px; height: 18px; color: #738789; }
.muted-note { color: #77868b; font-size: 12px; line-height: 1.55; }
.placeholder-head { font-size: 14px; font-weight: 700; margin: 9px 0 3px; }
.small-label { color: #93a0a3; text-transform: uppercase; font-size: 10px; letter-spacing: .05em; font-weight: 700; }
.grocery-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid #f0f2f0; }
.grocery-line:first-child { border-top: 0; }
.grocery-line .label { flex: 1; font-size: 13px; }
.grocery-line .label.done { text-decoration: line-through; color: #9aa4a7; }
.empty { text-align: center; border: 1px dashed #dfe7e4; background: #fafcfb; color: var(--muted); padding: 24px 14px; border-radius: 12px; font-size: 13px; }
.row-footer { border-top: 1px solid #f0f2f0; margin-top: 6px; padding-top: 10px; }
.month-top { display: flex; align-items: center; gap: 14px; justify-content: space-between; margin-bottom: 14px; }
.month-top strong { font-size: 18px; }
.month-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 4px; }
.week-label { text-align: center; color: var(--muted); padding: 8px 2px; font-size: 11px; font-weight: 700; }
.month-day { border: 1px solid transparent; min-height: 72px; border-radius: 9px; padding: 9px; text-align: left; background: #fafbf9; display: flex; flex-direction: column; gap: 9px; }
.month-day:hover { background: #f0f5f3; }
.month-day.outside { opacity: .35; }
.month-day.selected { border-color: #8aafaa; background: #d9edf4; }
.month-day.today .date-number { color: #b26947; font-weight: 800; }
.month-day .date-number { font-size: 12px; font-weight: 650; }
.month-day .event-dots { flex-wrap: wrap; }
.calendar-layout { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(280px,1fr); gap: 17px; align-items: start; }
.list-layout { max-width: 830px; }
.list-row { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line); padding: 13px 0; }
.list-row:first-child { border: 0; }
.list-row .task-content { flex: 1; }
.small-form { display: flex; gap: 9px; margin-bottom: 15px; }
.small-form input { flex: 1; min-width: 0; }
input, select, textarea { width: 100%; border: 1px solid #dce4e2; background: #fff; color: var(--ink); border-radius: 10px; min-height: 42px; padding: 10px 12px; font-size: 14px; }
textarea { min-height: 86px; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: #5d6e75; font-weight: 670; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 12px; line-height: 1.6; color: #7d8a8f; }
.settings-grid { display: grid; gap: 16px; max-width: 760px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.settings-row:first-of-type { border-top: 0; }
.settings-row input[type="checkbox"] { width: 20px; height: 20px; min-height: 20px; accent-color: #4c746b; }
.settings-row .label-main { font-size: 14px; font-weight: 630; }
.settings-row .label-desc { font-size: 12px; color: var(--muted); line-height: 1.4; margin-top: 3px; }
.notice { background: #f3f6f4; border: 1px solid #e2ebe5; padding: 14px 16px; border-radius: 12px; font-size: 12px; color: #567168; line-height: 1.55; }
.notice .icon { vertical-align: middle; margin-right: 6px; height: 16px; width: 16px; }
.warning { color: #8b6145; background: #fdf7f0; border-color: #f1e3d3; }
.modal-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(15,33,38,.36); display: flex; align-items: center; justify-content: center; padding: 18px; backdrop-filter: blur(3px); }
.modal { width: min(100%,530px); max-height: min(92vh,800px); overflow-y: auto; border-radius: 20px; background: #fff; box-shadow: 0 25px 80px rgba(18,35,36,.2); padding: 24px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal h2 { margin: 0; font-size: 21px; }
.modal form { display: grid; gap: 15px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 8px; }
.danger-button { border: 1px solid #f0d0cd; background: #fff; color: var(--danger); border-radius: 10px; font-weight: 650; padding: 9px 13px; }
.modal-open { overflow: hidden; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 12px); background: #2c4449; color: #fff; border-radius: 999px; padding: 11px 18px; font-size: 13px; box-shadow: 0 8px 22px rgba(20,35,38,.25); opacity: 0; pointer-events: none; transition: all .2s; z-index: 40; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.mobile-nav, .mobile-brand { display: none; }
@media (max-width: 1050px) {
  .sidebar { width: 190px; flex-basis: 190px; padding-left: 12px; padding-right: 12px; }
  .brand { padding-left: 5px; }
  .view { padding: 22px 20px 30px; }
  .topbar { padding: 14px 20px; min-height: 67px; }
  .dash-grid { grid-template-columns: minmax(0,1.28fr) minmax(260px,1fr); gap: 12px; }
  .left-stack,.right-stack,.info-grid { gap: 12px; }
  .card { padding: 16px; border-radius: 15px; }
  .day-cell { padding: 9px 0; }
  .day-cell .day-number { font-size: 16px; }
}
@media (max-width: 760px) {
  .sidebar { display: none; }
  .content-wrap { min-height: 100dvh; }
  .topbar { min-height: 66px; padding: 12px 16px; }
  .topbar-title { display: grid; gap: 3px; }
  .mobile-brand { display: block; color: var(--ink); font-size: 15px; font-weight: 750; }
  #header-date { font-size: 11px; }
  .clock { font-size: 17px; }
  .topbar-actions { gap: 10px; }
  .top-add { min-width: 43px; padding: 10px; }
  .top-add span { display: none; }
  .view { padding: 23px 14px 108px; }
  .page-head { margin-bottom: 17px; }
  h1 { font-size: 28px; }
  .dash-grid,.calendar-layout { grid-template-columns: 1fr; }
  .right-stack { display: contents; }
  .left-stack { display: contents; }
  .dash-grid { gap: 13px; }
  .card { padding: 17px; }
  .mobile-nav { display: grid; grid-template-columns: repeat(5,1fr); position: fixed; z-index: 12; bottom: 0; left: 0; right: 0; padding: 8px 5px calc(8px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #e6eae8; box-shadow: 0 -4px 18px rgba(30,50,50,.03); }
  .mobile-nav button { background: transparent; border: 0; color: #819094; padding: 5px 0; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10px; font-weight: 650; }
  .mobile-nav button.active { color: #2b655e; }
  .mobile-nav .icon { width: 21px; height: 21px; }
  .month-day { min-height: 58px; padding: 6px; }
  .month-day .date-number { font-size: 11px; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { border-radius: 20px 20px 0 0; width: 100%; max-height: 94dvh; padding: 22px 18px calc(23px + env(safe-area-inset-bottom)); }
}
@media (max-width: 390px) {
  .info-grid { grid-template-columns: 1fr; }
  .day-strip { gap: 1px; }
  .day-cell .day-number { font-size: 15px; }
  .card { padding: 14px; }
  .field-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *,*:before,*:after { transition-duration: .001ms !important; } }

/* Attributes for optional form fields */
[hidden] { display:none !important; }

/* Version 0.3: vorbereitete MDV-Monitore mit Haltestellenauswahl */
.tram-stations {display:flex;gap:5px;flex-wrap:wrap;margin:12px 0 11px;}
.station-choice {padding:7px 9px;border:1px solid #d8d3c8;border-radius:9px;background:rgba(255,255,255,.58);font-size:11px;font-weight:700;color:#6e6760;line-height:1.25;}
.station-choice.active {background:#2d6475;color:#fff;border-color:#2d6475;}
.tram-pending {display:flex;gap:10px;align-items:flex-start;background:rgba(255,255,255,.48);border:1px dashed #dacbb9;border-radius:12px;padding:10px;margin:4px 0 5px;}
.tram-pending-mark {font-size:23px;color:#9d765d;line-height:1;}
.tram-pending strong {font-size:12px;color:#544f48;}
.tram-pending p {font-size:11px;line-height:1.45;color:#796e65;margin:3px 0 0;}
.tram-monitor-frame {height:245px;border-radius:11px;overflow:hidden;border:1px solid #d9dfd9;background:#fff;}
.tram-monitor-frame iframe {width:100%;height:100%;border:0;background:#fff;}
.person-agenda {border-left:6px solid var(--event-color);}
.event-dot {width:20px;height:11px;border-radius:5px;}
@media (max-width: 1050px) { .tram-monitor-frame {height:200px;} .station-choice {font-size:10px;} }
@media (max-width: 760px) { .tram-monitor-frame {height:300px;} }

/* Version 0.4 – behutsames UI-Feintuning, ohne Layout-/Funktionsänderung.
   Die Familienfarben sind bewusst feste Pastelltöne; Schriftkontrast ist separat. */
:root {
  --bg: #edf3f6;
  --surface: #fffefa;
  --surface-soft: #eef5f3;
  --ink: #263840;
  --muted: #62757d;
  --line: #dbe5e5;
  --primary: #335f70;
  --primary-soft: #e0eff4;
  --shadow: 0 6px 24px rgba(47, 64, 68, .055);
  -webkit-font-smoothing: antialiased;
}
body {
  background: linear-gradient(125deg, #e9f3f8 0%, #f3f2ec 48%, #f2e9e1 100%);
}
.sidebar { background: rgba(233, 242, 245, .92); }
.topbar { background: rgba(246, 250, 249, .9); }
.card {
  border-radius: 19px;
  border-color: var(--line);
  box-shadow: var(--shadow);
}
.card-head h2, .card h2 { font-weight: 700; letter-spacing: -.018em; }
.page-head h1 { letter-spacing: -.035em; }
.dashboard-page-head { justify-content: flex-end; margin-bottom: 13px; }
.dashboard-page-head .person-filter { justify-content: flex-end; }
/* Große und eindeutig unterscheidbare Farbflächen bleiben auch bei Pastelltönen klar. */
.person-agenda {
  background: var(--event-soft);
  border-left: 5px solid var(--event-ink);
  padding: 12px 12px;
  border-radius: 12px;
  gap: 12px;
}
.person-agenda .event-title { color: var(--event-ink); font-weight: 720; font-size: 14px; }
.person-agenda .event-time { color: var(--event-ink); font-weight: 740; }
.person-agenda .event-sub { color: var(--event-ink); opacity: .88; }
.person-agenda .event-vertical { background: var(--event-ink) !important; min-height: 39px; width: 5px; flex-basis: 5px; opacity: .75; }
.person-agenda .icon-button { background: rgba(255,255,255,.48); color: var(--event-ink); }
.event-dot {
  width: 21px;
  height: 11px;
  border-radius: 5px;
  border: 1px solid var(--person-ink);
  background: var(--person-color);
  opacity: 1;
}
.legend-dot { width: 27px; height: 14px; border: 1px solid; }
.legend-item { color: var(--ink); font-size: 12px; gap: 7px; }
.person-legend { gap: 14px; }
/* Die Zuordnung ist zusätzlich als Name sichtbar, nicht ausschließlich als Farbe. */
.chip { min-height: 43px; padding: 10px 14px; color: var(--ink); }
.chip.person-chip.active { background: var(--chip-color); color: var(--chip-ink); border-color: var(--chip-ink); }
.chip.person-chip:hover:not(.active) { background: var(--chip-color); color: var(--chip-ink); }
.day-cell { min-height: 67px; }
.day-cell.active { background: #dbeef3; border-color: #abcbd2; }
.day-cell:active, .month-day:active { transform: scale(.985); }
.month-day.selected { border-color: #6b9aac; }
.primary-button, .secondary-button { min-height: 44px; }
.nav-item { min-height: 46px; }
.icon-button { width: 44px; height: 44px; border-radius: 11px; }
.row-actions .icon-button { width: 44px; height: 44px; opacity: .85; }
.checkbox-round { width: 28px; height: 28px; flex-basis: 28px; border-radius: 8px; }
.checkbox-round .icon { width: 17px; height: 17px; }
.task-row, .grocery-line { min-height: 48px; align-items: center; }
.event-title, .task-title, .grocery-line .label { line-height: 1.35; }
.weather-condition, .weather-detail, .station-choice { font-size: 12px; }
.weather-credit { font-size: 10px; }
.info-card { background: #e3f1f7; }
.info-card:nth-child(2) { background: #f4e7db; }
.station-choice { min-height: 44px; }
input, textarea, select { min-height: 44px; }
button { touch-action: manipulation; }
button:active { filter: brightness(.965); }
:focus-visible { outline: 3px solid #28748e; outline-offset: 3px; }
@media (max-width: 1050px) {
  .dashboard-page-head { margin-bottom: 10px; }
  .chip { min-height: 42px; padding: 9px 11px; }
  .person-agenda { padding: 10px 9px; }
}
@media (max-width: 760px) {
  .dashboard-page-head { margin-bottom: 10px; }
  .dashboard-page-head .person-filter { justify-content: flex-start; }
  .person-filter { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; width: 100%; padding: 1px 0 5px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .person-filter::-webkit-scrollbar { display: none; }
  .chip { min-height: 44px; }
  .mobile-nav button { min-height: 52px; justify-content: center; }
  .month-day { min-height: 59px; }
  input, textarea, select { font-size: 16px; }
  .row-actions .icon-button { width: 44px; height: 44px; }
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #202b30;
    --surface: #29363b;
    --surface-soft: #324146;
    --ink: #edf3f4;
    --muted: #b4c5ca;
    --line: #45575d;
    --primary: #8fc7d7;
    --primary-soft: #304952;
    --brand: #e5b89d;
    --danger: #ffb4aa;
    --shadow: 0 6px 24px rgba(0, 0, 0, .12);
  }
  body { background: linear-gradient(125deg, #25353c, #2a302f 56%, #332c2a); }
  .sidebar, .topbar { background: rgba(37, 50, 55, .94); border-color: var(--line); }
  .brand-symbol { background: #385058; color: #d5eff5; }
  .brand span, .nav-item, .topbar-title, .card-meta, .hint, .muted-note { color: var(--muted); }
  .nav-item:hover, .nav-item.active, .day-cell:hover, .month-day:hover { background: #3a5056; color: #eef5f6; }
  .nav-item.active { background: #35575c; }
  .left-stack > .card, .right-stack > .card:nth-child(1) { background: var(--surface); }
  .info-card { background: #284550; }
  .info-card:nth-child(2) { background: #443a36; }
  .card, .modal { color: var(--ink); background: var(--surface); }
  .page-subtitle, .event-time, .event-sub, .task-sub, .legend-item, .weather-credit, .row-footer { color: var(--muted); }
  .text-button, .tile-link { color: #9adbea; }
  .primary-button, .chip.active { background: #b2dae4; color: #1d3943; }
  .primary-button:hover { background: #c6e5ec; }
  .chip, .secondary-button, .icon-button, .station-choice { background: #34464c; color: #edf4f5; border-color: var(--line); }
  .secondary-button:hover, .icon-button:hover { background: #3e555c; }
  .chip.person-chip.active { background: var(--chip-color); color: var(--chip-ink); border-color: var(--chip-ink); }
  .day-cell.active, .month-day.selected { background: #37525d; border-color: #78aaba; }
  .day-cell .weekday, .week-label { color: #c4d0d3; }
  .month-day, .empty, .notice { background: #314249; color: var(--ink); border-color: var(--line); }
  .month-day.outside { opacity: .55; }
  .section-divider, .agenda-row, .task-row, .grocery-line, .row-footer { border-color: var(--line); }
  input, select, textarea { background: #34464c; color: var(--ink); border-color: #667b81; }
  input::placeholder, textarea::placeholder { color: #bec9cc; }
  .checkbox-round { background: #34464c; border-color: #b4c8ce; }
  .checkbox-round.done { background: #6eaa98; border-color: #6eaa98; color: #152b25; }
  .danger-button { background: #483636; color: #ffc5bd; border-color: #8b5959; }
  .mobile-nav { background: #29383e; border-color: var(--line); }
  .mobile-nav button { color: #c3d0d4; }
  .mobile-nav button.active, .mobile-brand { color: #b5e2ec; }
  .modal-backdrop { background: rgba(0,0,0,.6); }
  .notice.warning { background: #443831; color: #f2d1b7; border-color: #665347; }
  .tram-pending { background: rgba(255,255,255,.06); border-color: #796c62; }
  .tram-pending strong, .tram-pending p, .tram-pending-mark { color: #f4d8c9; }
  .person-agenda { background: var(--event-soft); border-color: var(--event-ink); }
  .person-agenda .event-time, .person-agenda .event-title, .person-agenda .event-sub { color: var(--event-ink); opacity: 1; }
  .person-agenda .icon-button { background: rgba(255,255,255,.48); color: var(--event-ink); border: 0; }
  .person-agenda .icon-button:hover { background: rgba(255,255,255,.7); }
  .legend-item { color: var(--ink); }
}
@media (prefers-contrast: more) {
  :root { --line: #708990; --muted: #40555e; --ink: #162930; }
  .card, .chip, .day-cell.active, .month-day.selected, input, select, textarea { border-width: 2px; }
  .person-agenda { border-left-width: 7px; }
  .event-dot, .legend-dot { border-width: 2px; }
  .nav-item.active { outline: 2px solid currentColor; }
}
/* Auf iPad-Breiten: Wetter und Abfahrten bekommen volle Kartenbreite,
   damit Haltestellen- und Wettertexte lesbar bleiben. */
@media (min-width: 761px) and (max-width: 1280px) {
  .info-grid { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root { --line: #a5c3cc; --muted: #d4e4e9; --ink: #ffffff; }
}

/* Version 0.5: persönlichere Filter, bewusst behutsames Design-Feintuning. */
.person-filter .chip { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 6px 10px; }
.person-filter .person-chip { padding-left: 6px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--avatar-color); color: var(--avatar-ink); background: #fff; overflow: hidden; font-size: 13px; font-weight: 760; vertical-align: middle; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-large { width: 54px; height: 54px; flex-basis: 54px; border-width: 4px; font-size: 20px; }
.profile-setting { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.profile-setting:last-of-type { border-bottom: 0; }
.profile-preview { display: flex; align-items: center; gap: 12px; min-width: 0; }
.profile-preview strong { font-size: 14px; }
.profile-buttons { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.profile-buttons button { font-size: 12px; padding: 8px 10px; }
.toggle-end { display: inline-flex; gap: 9px; align-items: center; font-size: 13px; font-weight: 650; cursor: pointer; }
.toggle-end input { width: 19px; min-height: 19px; height: 19px; accent-color: var(--primary); }
.geo-field { position: relative; }
.geo-caption { margin: 1px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.geo-caption a { color: var(--primary); }
.geo-suggestions { position: relative; z-index: 4; margin-top: 0; padding: 3px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 8px 18px rgba(23, 45, 53, .13); max-height: 210px; overflow-y: auto; }
.geo-result { display: flex; flex-direction: column; align-items: stretch; text-align: left; gap: 2px; width: 100%; min-height: 48px; border: 0; border-radius: 8px; padding: 8px 10px; background: transparent; color: var(--ink); }
.geo-result + .geo-result { border-top: 1px solid var(--line); }
.geo-result strong { font-size: 13px; }
.geo-result span { color: var(--muted); font-size: 11px; }
.geo-result:hover, .geo-result.selected { background: var(--primary-soft); }
/* MDV 0.5.1: Tabellen aus dem offiziellen Breitbild-Monitor einblenden. */
.info-grid { grid-template-columns: minmax(0,1fr); }
.tram-description { font-weight: 660; font-size: 12px; margin: 10px 0 9px; color: var(--ink); }
.live-marker { float: right; font-size: 10px; font-weight: 750; border-radius: 99px; padding: 3px 7px; color: #38635a; background: #dcefe9; }
.tram-station-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.tram-station-tabs .station-choice { min-height: 37px; padding: 7px 13px; font-size: 12px; }
.tram-monitor-frame {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 130px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.tram-monitor-frame iframe {
  position: absolute;
  left: 0;
  top: 0;
  border: 0;
  display: block;
  width: 1660px;
  height: 960px;
  max-width: none;
  transform-origin: top left;
  pointer-events: none;
}
.tram-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; }
.tram-controls .text-button { font-size: 12px; }
.tram-controls .tile-link { font-size: 12px; margin: 0; }
.mdv-full { width: min(94vw, 1100px); max-height: 96vh; }
.mdv-focus { overflow-y: auto; }
.mdv-focus .tram-monitor-frame { margin-top: 12px; }
.mdv-full iframe { border: 1px solid var(--line); border-radius: 10px; width: 100%; height: min(73vh,750px); background: white; }
.mdv-full > a { display: inline-block; padding-top: 9px; font-size: 12px; color: var(--primary); }
@media (max-width: 760px) {
  .person-filter .chip { flex-shrink: 0; }
  .avatar { width: 28px; height: 28px; flex-basis: 28px; }
  .profile-setting { align-items: flex-start; flex-direction: column; }
  .profile-buttons { padding-left: 64px; }
  .tram-station-tabs .station-choice { min-height: 44px; }
  .mdv-full { width: 100%; }
  .mdv-full iframe { height: 68dvh; }
}
@media (prefers-color-scheme: dark) {
  .avatar { background: #fff; color: var(--avatar-ink); }
  .geo-suggestions { background: var(--surface); }
  .geo-caption a, .mdv-full > a { color: #a9dbe5; }
  .live-marker { background: #34524b; color: #c8f1df; }
}

/* Version 0.5.2: kompakte Kopfzeile, Personenwahl links und breitere MDV-Kachel. */
.sidebar { padding-top: 22px; }
.side-nav { margin-bottom: 17px; }
.sidebar-person-filter { padding: 15px 7px 0; border-top: 1px solid var(--line); }
.sidebar-filter-head { color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .05em; margin: 0 5px 11px; }
.sidebar-all { display: block; width: 100%; text-align: center; border: 1px solid var(--line); background: rgba(255,255,255,.4); color: var(--ink); border-radius: 10px; min-height: 37px; font-size: 12px; font-weight: 650; margin-bottom: 13px; }
.sidebar-all.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.sidebar-person-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 5px; }
.sidebar-person { display: flex; align-items: center; flex-direction: column; gap: 7px; width: 100%; padding: 8px 3px 9px; border: 1.5px solid transparent; border-radius: 14px; background: transparent; color: var(--ink); min-height: 107px; }
.sidebar-person:hover { background: rgba(255,255,255,.48); }
.sidebar-person.active { background: var(--profile-color); color: var(--profile-ink); border-color: var(--profile-ink); }
.sidebar-avatar { display: flex; width: 65px; height: 65px; flex-basis: 65px; border: 2px solid var(--avatar-color); background: var(--avatar-color); color: var(--avatar-ink); font-size: 24px; }
.sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-person-name { font-size: 11px; font-weight: 670; line-height: 1.12; text-align: center; }
.avatar { background: var(--avatar-color); border-color: var(--avatar-color); }
.avatar-large { width: 66px; height: 66px; flex-basis: 66px; border-width: 2px; font-size: 24px; }
.topbar { min-height: 67px; padding-top: 11px; padding-bottom: 11px; }
.view { padding-top: 19px; }
.dashboard-page-head.mobile-person-filter { display: none; }
.calendar-mobile-filter { display: none; }
.tram-card { background: #f4e6da; min-height: 0; }
.weather-card { background: #e3f1f7; }
.tram-card .tram-monitor-frame { width: 100%; }
@media (min-width: 761px) and (max-width: 1140px) {
  .sidebar { width: 190px; flex-basis: 190px; padding-left: 10px; padding-right: 10px; }
  .sidebar-avatar { width: 59px; height: 59px; flex-basis: 59px; }
  .sidebar-person { min-height: 103px; }
  .dash-grid { grid-template-columns: minmax(0,1.65fr) minmax(245px,1fr); }
}
@media (max-width: 760px) {
  .dashboard-page-head.mobile-person-filter { display: flex; margin-bottom: 11px; }
  .calendar-mobile-filter { display: block; width: 100%; }
  .sidebar-person-filter { display: none; }
  .view { padding-top: 17px; }
  .topbar { min-height: 61px; }
  .person-filter .chip { gap: 5px; }
  .person-filter .avatar { width: 38px; height: 38px; flex-basis: 38px; border: 2px solid var(--avatar-color); background: var(--avatar-color); }
  .person-filter .chip { display: flex; flex-direction: column; padding: 5px 8px 6px; border-radius: 14px; gap: 3px; font-size: 11px; }
  .person-filter .chip:first-child { justify-content: center; min-width: 66px; }
  .tram-card { background: #f4e6da; }
}
@media (prefers-color-scheme: dark) {
  .sidebar-all { background: rgba(255,255,255,.06); color: var(--ink); }
  .sidebar-all.active { background: #b2dae4; color: #1d3943; }
  .sidebar-person:hover { background: rgba(255,255,255,.08); }
  .sidebar-person.active { background: var(--profile-color); color: var(--profile-ink); }
  .tram-card { background: #443a36; }
  .weather-card { background: #284550; }
}
/* Wetter behält sein Pastellblau auch nach dem Verschieben der Kacheln. */
.right-stack > .weather-card { background: #e3f1f7; }
@media (prefers-color-scheme: dark) {
  .right-stack > .weather-card { background: #284550; }
}

/* 0.5.3 – weiße Dashboard-Kacheln; Personenfotos mit kräftigen Farbringen. */
.card,
.left-stack > .card,
.right-stack > .card,
.right-stack > .card:nth-child(1),
.info-card,
.info-card:nth-child(2),
.tram-card,
.weather-card,
.right-stack > .weather-card { background: #ffffff; }

/* Kein weißer Innenring; der 6px dicke Ring entspricht der Personenfarbe. */
.sidebar-avatar {
  width: 72px;
  height: 72px;
  flex-basis: 72px;
  border: 6px solid var(--avatar-color);
  box-shadow: 0 0 0 1px var(--avatar-ink);
}
.sidebar-person { min-height: 113px; }
.sidebar-person.active { background: rgba(255,255,255,.72); color: var(--ink); border-color: var(--profile-color); }
/* Die Profilvorschau in den Einstellungen übernimmt denselben Farbring. */
.avatar-large { border-width: 6px; }
@media (min-width: 761px) and (max-width: 1140px) {
  .sidebar-avatar { width: 68px; height: 68px; flex-basis: 68px; }
  .sidebar-person { min-height: 110px; }
}
@media (max-width: 760px) {
  .person-filter .avatar { border-width: 5px; width: 44px; height: 44px; flex-basis: 44px; }
}
/* Dark Mode bleibt weiterhin kontrastreich, anstatt dunkel eingefärbten Text auf weißen Karten zu zeigen. */
@media (prefers-color-scheme: dark) {
  .card, .left-stack > .card, .right-stack > .card,
  .right-stack > .card:nth-child(1), .info-card, .info-card:nth-child(2),
  .tram-card, .weather-card, .right-stack > .weather-card { background: var(--surface); }
  .sidebar-person.active { background: rgba(255,255,255,.10); color: var(--ink); }
}

/* Cloud-Einstellungen: kompakt und fuer Touchbedienung geeignet. */
.cloud-status { padding: 12px 14px; border-radius: 12px; background: var(--surface, #eef4f6); border: 1px solid var(--line); display:flex; gap:9px; align-items:center; margin: 12px 0; font-size: 13px; }
.cloud-dot {width:9px;height:9px;border-radius:50%;display:inline-block;flex:none;background:#b89a72;}
.cloud-dot.ok {background:#3b956a;}
.cloud-form {display:grid;gap:12px;margin:14px 0;}
.cloud-form input {width:100%;min-width:0;border:1px solid var(--line);background:var(--card,#fff);color:var(--ink);padding:12px 13px;border-radius:10px;font:inherit;}
.cloud-actions {display:flex;flex-wrap:wrap;gap:10px;margin:12px 0;}
.cloud-actions button {max-width:100%;white-space:normal;text-align:center;}
.cloud-alert {border-left:3px solid #c58d5f;padding:10px 12px;background:rgba(197,141,95,.08);font-size:12px;line-height:1.55;border-radius:6px;}
.cloud-small {font-size:12px;line-height:1.6;color:var(--muted);}
