/* Familien-Bereitschaft — ruhig, gut lesbar, große Tippflächen. Hell/Dunkel folgt dem Gerät. */
:root {
  --bg: #f3f5f8; --card: #ffffff; --text: #1d2733; --muted: #5b6776; --line: #dce3ea;
  --accent: #2f5d8a; --on-accent: #ffffff; --accent-soft: #e2ecf6;
  --gap-bg: #fdeeee; --gap-line: #f0b9b9; --gap-text: #a42a2a;
  --ok-bg: #e5f4ea; --ok-text: #1f6b3a; --warn-bg: #fff3dd; --warn-text: #7f4d00;
  --past-bg: #eef1f4; --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10151b; --card: #19212a; --text: #e6ecf2; --muted: #9ba8b5; --line: #2b3643;
    --accent: #79aee0; --on-accent: #0b1520; --accent-soft: #1d3042;
    --gap-bg: #3a1d21; --gap-line: #6c3036; --gap-text: #ffb4b4;
    --ok-bg: #16331f; --ok-text: #9ee2b4; --warn-bg: #3a2c12; --warn-text: #ffd27a;
    --past-bg: #151b22;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
h1 { font-size: 24px; margin: 8px 0 12px; line-height: 1.2; }
h2 { font-size: 18px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Kopfzeile */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center;
  gap: 4px 12px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top));
  background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--accent); text-decoration: none; margin-right: auto; }
.nav { display: flex; flex-wrap: wrap; gap: 2px; }
.nav a { padding: 8px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: 15px; }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
@media (max-width: 560px) {
  .nav { width: 100%; justify-content: space-between; }
  .nav a { padding: 8px 6px; font-size: 14px; }
}

.content { max-width: 860px; margin: 0 auto; padding: 12px 12px 56px; }

/* Karten, Hinweise, Abzeichen */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 12px; }
.card-title { margin: 0 0 8px; font-size: 17px; }
.card-title a { color: inherit; text-decoration: none; }
.hint { color: var(--muted); font-size: 14px; }
.flash { padding: 10px 14px; border-radius: 12px; margin-bottom: 10px; background: var(--accent-soft); }
.flash-ok { background: var(--ok-bg); color: var(--ok-text); }
.flash-error { background: var(--gap-bg); color: var(--gap-text); }
.flash-warn { background: var(--warn-bg); color: var(--warn-text); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent); vertical-align: middle; }
.badge-gap { background: var(--gap-bg); color: var(--gap-text); }
.badge-ok { background: var(--ok-bg); color: var(--ok-text); }
.gap-text { color: var(--gap-text); font-weight: 600; font-size: 13px; }
.past-text { color: var(--muted); font-size: 13px; }
code { font-size: 14px; background: var(--past-bg); padding: 1px 5px; border-radius: 6px; word-break: break-all; }

/* Knöpfe */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px;
  padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:focus-visible, .mini:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-small { min-height: 34px; padding: 4px 10px; font-size: 14px; }
.btn-block { width: 100%; margin-top: 16px; }
.btn-add { width: 100%; min-height: 36px; padding: 4px 6px; border-style: dashed; color: var(--accent); font-size: 14px; }
.btn-mine { width: 100%; min-height: 36px; padding: 4px 6px; background: var(--accent); border-color: var(--accent);
  color: var(--on-accent); font-size: 14px; }
.btn-call { margin-left: auto; background: var(--ok-bg); color: var(--ok-text); border-color: transparent; }
.mini { background: none; border: 0; padding: 2px 4px; color: var(--muted); font: inherit; font-size: 13px;
  cursor: pointer; text-decoration: none; }
.mini-danger { color: var(--gap-text); }
.note-link, .cell .mini-danger { display: block; padding: 2px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.content > .actions { margin: 0 0 14px; }
form.inline { display: inline; margin: 0; }

/* Formulare */
label { display: block; font-weight: 600; margin: 14px 0 5px; }
input[type=text], input[type=password], input[type=tel], input[type=date], input[type=time],
input[type=number], input:not([type]), select {
  width: 100%; min-height: 46px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--text); font: inherit; }
fieldset { border: 0; padding: 0; margin: 16px 0 0; }
legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 999px; font-weight: 600; cursor: pointer; }
.check small { color: var(--muted); font-weight: 400; }
.check-line { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; }
.check-line input { margin-top: 4px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.row > div { flex: 1 1 140px; }
.row-label { flex: 0 0 90px !important; font-weight: 600; padding-bottom: 12px; }
.copy-row { display: flex; gap: 8px; margin: 8px 0; }
.copy-row input { flex: 1; min-width: 0; font-size: 14px; }
details { margin: 8px 0; }
summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.steps { padding-left: 22px; }
.steps li { margin: 8px 0; }

/* Personen-Chips (Farbe je Person) */
.chip { display: inline-block; max-width: 100%; padding: 2px 9px; border-radius: 999px; font-size: 13px;
  font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.c1 { background: #d9e8f7; color: #123f69; } .c2 { background: #d2efe8; color: #0b5144; }
.c3 { background: #fce4c4; color: #744000; } .c4 { background: #e5ddfa; color: #41308c; }
.c5 { background: #f9d9d3; color: #83291c; } .c6 { background: #dcefcb; color: #2d5710; }
.c7 { background: #f7d7e6; color: #84214e; } .c8 { background: #e2e2dd; color: #3b3b37; }
@media (prefers-color-scheme: dark) {
  .c1 { background: #1d3a56; color: #cfe3f7; } .c2 { background: #16433a; color: #bdeee2; }
  .c3 { background: #4a3313; color: #ffd9a6; } .c4 { background: #33295b; color: #ddd2ff; }
  .c5 { background: #4d2620; color: #ffcdc4; } .c6 { background: #2b4119; color: #cdeab2; }
  .c7 { background: #4b2236; color: #ffc9e0; } .c8 { background: #34342f; color: #e0e0da; }
}
.note { display: block; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.note-inline { color: var(--muted); }

/* Tage mit drei Zeiträumen */
.day { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; margin-bottom: 10px; scroll-margin-top: 110px; }
.day-today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.day-title { display: flex; align-items: center; gap: 8px; margin: 2px 2px 8px; font-size: 16px; }
.cells { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cell { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 7px;
  border: 1px solid var(--line); border-radius: 12px; }
.cell-gap { background: var(--gap-bg); border-color: var(--gap-line); }
.cell-past { background: var(--past-bg); }
.cell-past .chip { opacity: .7; }
.cell-head { display: flex; flex-direction: column; line-height: 1.2; }
.cell-label { font-weight: 700; font-size: 14px; }
.cell-time { font-size: 12px; color: var(--muted); }
.cell-people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.cell form { margin: 0; }
.edit-add { display: flex; flex-direction: column; gap: 4px; }
.edit-add select { min-height: 34px; padding: 2px 6px; font-size: 14px; }

/* Start */
.now { border-width: 2px; border-color: var(--accent); }
.now-gap { background: var(--gap-bg); border-color: var(--gap-line); }
.eyebrow { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .03em; }
.now-title { font-size: 22px; margin: 0 0 10px; }
.people-list { list-style: none; margin: 0; padding: 0; }
.people-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.people-list li:first-child { border-top: 0; }
.people-list .chip { font-size: 16px; padding: 4px 12px; }
.section-title { font-size: 15px; color: var(--muted); margin: 18px 4px 8px; }
.plain { list-style: none; margin: 0; padding: 0; }
.gap-list li { padding: 3px 0; }

/* Woche */
.week-head { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 8px; margin: 4px 0 6px; }
.week-title { display: flex; flex-direction: column; align-items: center; }
.week-title span { color: var(--muted); font-size: 14px; }
.week-sub { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 14px; margin: 0 0 12px; font-size: 14px; }

/* Listen: Meine Zeiten, Verwaltung */
.line { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.line:first-child { border-top: 0; }
.person-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 0; border-top: 1px solid var(--line); }
.person-row:first-child { border-top: 0; }
.person-row.inactive { opacity: .6; }
.person-meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.person-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.log li { font-size: 14px; padding: 4px 0; border-top: 1px solid var(--line); }
.log li:first-child { border-top: 0; }
.log-time { color: var(--muted); font-variant-numeric: tabular-nums; }

/* Anmelden */
.auth { max-width: 420px; margin: 24px auto; text-align: center; }
.auth form { text-align: left; }
.auth-logo { border-radius: 18px; }
.logout { text-align: center; margin-top: 20px; }
