:root {
  --ink: #223a41;
  --petrol: #243d47;
  --petrol-2: #30444d;
  --muted: #627e94;
  --olive: #abb27b;
  --olive-dark: #777e57;
  --paper: #f2f4f6;
  --blue: #3c92ca;
  --fir: #2f5d4a;
  --fir-hover: #3a6d58;
  --red: #a8423f;
  --white: #ffffff;
  --snow: #eef3ef;
  --snow-line: #d8e3db;
  --mint: #f1f6f3;
  --line: #eef1f3;
  --line-2: #e3e8ec;
  --field: #c9d3da;
  --rule: #dbe2e7;
  --sum-bg: #f4f7f5;
  --shadow-pop: 0 18px 44px -16px rgba(34,58,65,.35), 0 2px 6px rgba(34,58,65,.08);
  --shadow-card: 0 1px 2px rgba(34,58,65,.05), 0 10px 28px -14px rgba(34,58,65,.22);
  --stick: 0px;
  --namew: 236px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--stick) + 72px); }
body {
  margin: 0; background: var(--white); color: var(--ink);
  font-family: var(--font); font-weight: 400; font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.logo { display: block; color: var(--petrol-2); }
.page { max-width: 1040px; margin: 0 auto; padding: 0 40px; }
.bleed { box-shadow: 0 0 0 100vmax var(--snow); clip-path: inset(0 -100vmax); background: var(--snow); }
#app ::selection { background: #d3e4d9; color: var(--ink); }
#app input, #app textarea { caret-color: var(--fir); }

/* ---------- Knöpfe ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  border: 1px solid #c6d4ca; border-radius: 8px;
  background: var(--white); color: var(--petrol-2);
  font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover:not(:disabled) { border-color: var(--olive-dark); background: #fbfcf8; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--petrol); border-color: var(--petrol); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--petrol-2); border-color: var(--petrol-2); }
.btn-danger { background: var(--red); border-color: var(--red); color: var(--white); }
.btn-danger:hover:not(:disabled) { background: #943835; border-color: #943835; }
.btn-quiet { border-color: var(--field); }
.btn-small { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; }
.btn .ico { width: 15px; height: 15px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0;
  border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted);
}
.icon-btn:hover:not(:disabled) { border-color: var(--field); color: var(--petrol-2); background: var(--white); }
.icon-btn.danger:hover:not(:disabled) { color: var(--red); border-color: #e4c6c5; }
.icon-btn:disabled { opacity: .3; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link:hover { color: var(--petrol-2); }
.link-quiet { color: var(--muted); font-size: 14px; text-decoration: none; padding: 6px 2px; border-radius: 4px; }
.link-quiet:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
button.link-quiet { background: none; border: 0; }

/* ---------- Felder ---------- */
.field {
  border: 1px solid var(--field); border-radius: 8px; background: transparent;
  padding: 7px 11px; min-height: 38px; transition: border-color .15s, box-shadow .15s;
}
.field:hover { border-color: #a9b8c3; }
.field:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(60,146,202,.16); }
.field::placeholder { color: #9aabb8; }
.lbl { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.datefield {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 6px;
  min-height: 38px; padding: 0 8px 0 10px; width: 100%;
  border: 1px solid var(--field); border-radius: 8px; background: transparent;
  font-size: 14px; font-variant-numeric: tabular-nums; text-align: left; white-space: nowrap;
  transition: border-color .15s, box-shadow .15s;
}
.datefield:hover { border-color: #a9b8c3; }
.datefield[aria-expanded="true"] { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(60,146,202,.16); }
.datefield .ico { color: var(--muted); width: 16px; height: 16px; }

/* ---------- Schneeflocken (Anmeldung) ---------- */
.flakes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.flake { position: absolute; color: #fff; fill: none; stroke: currentColor; stroke-width: 1.1; stroke-linecap: round; animation: drift 26s ease-in-out infinite; }
.flake:nth-child(2n) { animation-duration: 34s; animation-delay: -9s; }
.flake:nth-child(3n) { animation-duration: 41s; animation-delay: -17s; }
@keyframes drift { 0%, 100% { transform: translate(0, 0) rotate(0deg); } 50% { transform: translate(-4px, 8px) rotate(24deg); } }
@media (prefers-reduced-motion: reduce) { .flake { animation: none; } }

/* ---------- Anmeldung ---------- */
#login {
  position: relative; min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center; padding: 48px 16px;
  background: radial-gradient(120% 80% at 50% 0%, #2b4751 0%, var(--ink) 60%);
  overflow: hidden;
}
.login-inner { position: relative; width: 100%; max-width: 400px; }
.login-card { background: #fff; border-radius: 20px; padding: 30px 36px 36px; text-align: center; box-shadow: 0 30px 60px -20px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.12); }
.login-sprig { display: block; width: 176px; height: 40px; margin: 0 auto 18px; }
.login-logo { height: 64px; width: auto; color: var(--petrol-2); display: block; margin: 0 auto 28px; }
.login-card h2 { margin: 0 0 6px; font-size: 21px; font-weight: 500; letter-spacing: -.01em; }
.login-card p { margin: 0; color: var(--muted); }
.login-form { margin-top: 26px; display: grid; gap: 12px; text-align: left; }
.login-form input { height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid #cdd6dd; background: #fff; width: 100%; }
.login-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(60,146,202,.22); }
.login-form input.invalid { border-color: var(--red); }
.login-form .btn { min-height: 48px; width: 100%; font-size: 15px; border-radius: 12px; }
#login-error { margin: 0; color: var(--red); font-size: 13px; display: flex; align-items: center; gap: 6px; }
#login-error .ico { width: 14px; height: 14px; }
.login-hint { margin: 22px 0 0; text-align: center; color: rgba(255,255,255,.62); font-size: 13px; white-space: pre-line; }

/* ---------- Bearbeiten-Leiste ---------- */
#edit-bar { position: sticky; top: 0; z-index: 30; background: var(--ink); color: #fff; }
#edit-bar .page { display: flex; align-items: center; gap: 16px; min-height: 60px; padding-top: 10px; padding-bottom: 10px; }
.edit-ico { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(171,178,123,.22); color: var(--olive); flex: none; }
.edit-text { flex: 1; margin: 0; font-size: 14px; line-height: 1.45; }
.edit-text strong { font-weight: 500; }
.edit-text span { color: rgba(255,255,255,.72); }
#btn-done { background: #fff; border-color: #fff; color: var(--ink); }
#btn-done:hover { background: #eef3ef; }

/* ---------- Kopf (hellgrüne Fläche) ---------- */
.band { position: relative; background: var(--snow); overflow: hidden; }
.band .page { position: relative; z-index: 1; }
.masthead {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "logo seg actions" "title title title";
  align-items: center; column-gap: 16px; row-gap: 16px; padding: 16px 0 16px;
}
.masthead > .logo { grid-area: logo; height: 38px; width: auto; }
.seg { grid-area: seg; justify-self: end; display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: #fff; border: 1px solid var(--snow-line); }
.seg button { border: 0; background: none; min-height: 34px; padding: 0 16px; border-radius: 999px; font-size: 14px; color: var(--petrol-2); display: inline-flex; align-items: center; gap: 7px; transition: background-color .15s, color .15s; }
.seg button .ico { width: 15px; height: 15px; }
.seg button:hover:not(:disabled):not([aria-pressed="true"]) { background: var(--mint); }
.seg button[aria-pressed="true"] { background: var(--fir); color: #fff; }
.seg button:disabled { cursor: not-allowed; opacity: .5; }
.mh-actions { grid-area: actions; display: flex; align-items: center; gap: 14px; }
.mh-actions form { display: contents; }
.mh-title { grid-area: title; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; min-height: 40px; }
h1.title { margin: 0; font-size: 30px; font-weight: 500; letter-spacing: -.018em; line-height: 1.2; text-wrap: balance; }
#deadline-text {
  position: relative; margin: 0; display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 14px 0 10px;
  border-radius: 999px; background: #fff; border: 1px solid var(--snow-line); font-size: 13px; white-space: nowrap;
}
.dl-stars svg { position: absolute; fill: var(--olive); fill-opacity: .75; stroke: var(--olive-dark); stroke-width: 1.4; pointer-events: none; }
.dl-stars svg:first-child { width: 11px; height: 11px; top: -7px; right: -5px; }
.dl-stars svg:last-child { width: 7px; height: 7px; top: -11px; right: 9px; fill: var(--fir); fill-opacity: .35; stroke: var(--fir); }
#deadline-text .ico { width: 15px; height: 15px; color: var(--fir); }
#deadline-text strong { font-weight: 500; }
#deadline-text .sep { color: var(--olive); }
#deadline-text .left { color: var(--fir); }
#expired-note {
  position: relative; /* above the snowflake illustration, like #deadline-text */
  display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 8px 14px; border-radius: 12px;
  background: #fff; border: 1px solid var(--field); font-size: 14px; line-height: 1.45; max-width: 560px;
}
#expired-note .ico { margin-top: 2px; color: var(--muted); }
#expired-note strong { font-weight: 500; }
.ill { position: absolute; pointer-events: none; }
.ill-tr { right: 0; top: 56px; width: 210px; height: 84px; opacity: .7; z-index: 0; }
.ill-flake { transform-box: fill-box; transform-origin: center; animation: drift 44s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .ill-flake { animation: none; } }

/* Leiste unter dem Titel: Legende und Drucken (nur Tabellenansicht) */
.table-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 24px; padding: 0 0 16px; }
.legend { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: 0; padding: 0; font-size: 13px; color: var(--petrol-2); }
.legend li { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
#progress { margin: 0 0 0 auto; font-size: 13px; color: var(--petrol-2); }
#progress strong { font-weight: 500; color: var(--fir); }
.sw { width: 18px; height: 18px; border-radius: 5px; display: inline-grid; place-items: center; flex: none; }
.sw .ico { width: 12px; height: 12px; stroke-width: 2.4; }
.sw.da { background: var(--fir); color: #fff; }
.sw.nicht { color: #8ea2b2; }
.sw.nicht .ico { width: 13px; height: 13px; stroke-width: 2; }
.sw.offen { background: #fff; box-shadow: inset 0 0 0 1px var(--snow-line); }
.sw.offen::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background: #b5c2cc; }
.ill-bl { left: 0; bottom: 0; width: min(240px, calc((100vw - 960px) / 2 - 10px)); aspect-ratio: 240 / 150; opacity: .62; display: none; }
@media (min-width: 1200px) { .ill-bl { display: block; } }

/* ---------- Bereich über der Tabelle ---------- */
.pre { display: flow-root; }
.pre > :not([hidden]) { margin-bottom: 18px; }
#error-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px 10px 14px;
  border: 1px solid rgba(168,66,63,.55); border-radius: 12px; background: #fff; font-size: 14px; line-height: 1.45;
}
#error-bar .ico { color: var(--red); }
#error-bar p { margin: 0; flex: 1; min-width: 220px; }
#error-bar strong { color: var(--red); font-weight: 500; }
#first-hint {
  display: flex; align-items: flex-start; gap: 14px; padding: 14px 14px 14px 16px;
  background: #fff; border: 1px solid var(--snow-line); border-radius: 14px; font-size: 14px; line-height: 1.5;
}
.hint-star { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--snow); display: grid; place-items: center; }
.hint-star svg { width: 16px; height: 16px; }
.hint-text { flex: 1; min-width: 0; }
.hint-text p { margin: 0; }
.hint-text p + p { color: var(--muted); margin-top: 2px; }
#general { background: #fff; border: 1px solid var(--snow-line); border-radius: 14px; padding: 16px 18px 18px; }
.gen-h { margin: 0 0 12px; font-size: 15px; font-weight: 500; }
.gen-grid { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 14px 18px; }
.gen-grid .wide { grid-column: 1 / -1; }
.gen-danger { grid-column: 1 / -1; padding-top: 14px; border-top: 1px solid var(--line); }
.gen-danger .btn:hover:not(:disabled) { color: var(--red); border-color: #e4c6c5; }
#general .field { width: 100%; }
input#title { font-size: 17px; }
#intro-input { resize: vertical; min-height: 64px; line-height: 1.5; }

/* ---------- Tageszeile (klebt oben) ---------- */
#dayhead {
  position: sticky; top: var(--stick); z-index: 15; background: var(--snow);
  box-shadow: 0 0 0 100vmax var(--snow), 0 1px 0 100vmax var(--rule);
  clip-path: inset(0 -100vmax -1px -100vmax);
}
#dayhead-scroll { overflow-x: auto; scrollbar-width: none; }
#dayhead-scroll::-webkit-scrollbar { display: none; }
.grid { border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.grid th, .grid td { position: relative; padding: 0; text-align: center; vertical-align: middle; font-weight: 400; }
.grid .name-col { position: sticky; left: 0; z-index: 2; background: var(--white); text-align: left; }
.head th { height: 48px; vertical-align: middle; padding: 0 6px; font-size: 16px; font-weight: 600; line-height: 1.25; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.head th.name-col { background: var(--snow); padding-left: 12px; }
.head .wd { color: var(--muted); font-weight: 500; margin-right: 5px; }
.head .dm { font-weight: 600; }
.head .yr { display: block; font-size: 12px; font-weight: 400; color: var(--muted); line-height: 1.2; }
.editing .head th { padding: 10px 6px 8px; }
.editing .head th.name-col { padding-left: 12px; vertical-align: top; padding-top: 22px; }
.head .datefield { min-height: 44px; font-size: 16px; font-weight: 600; color: var(--ink); }
.day-edit { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.del-link { display: inline-flex; align-items: center; justify-content: center; gap: 4px; align-self: center; border: 0; background: none; padding: 2px 6px; border-radius: 6px; font-size: 12px; color: var(--muted); }
.del-link .ico { width: 12px; height: 12px; }
.del-link:hover { color: var(--red); }

/* ---------- Tabelle ---------- */
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-padding-left: var(--namew); padding-bottom: 2px; }
thead.sr-head th { height: 0; padding: 0; border: 0; overflow: hidden; }
.group-head td { padding: 48px 0 12px; text-align: left; }
tbody.group:first-of-type .group-head td { padding-top: 24px; }
.sticky-inner { position: sticky; left: 0; display: inline-block; max-width: calc(100vw - 32px); padding-left: 12px; }
h2.g-name { display: inline-block; margin: 0; font-size: 18px; font-weight: 500; letter-spacing: -.01em; line-height: 1.3; }
h2.g-name::after { content: ""; display: block; height: 3px; border-radius: 2px; background: var(--gc); margin-top: 5px; }
.g-target { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.no-name { color: var(--muted); font-style: italic; }

tr.person th, tr.person td { height: 48px; border-bottom: 1px solid var(--line); transition: background-color .15s ease-out; }
tr.person:hover th, tr.person:hover td { background: #f7faf8; }
.nm { display: block; padding: 0 10px 0 12px; font-size: 15px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tr.empty td { padding: 14px 0 14px; text-align: left; color: var(--muted); font-size: 14px; border-bottom: 1px solid var(--line); }

.cell {
  width: 44px; height: 44px; padding: 0; display: inline-grid; place-items: center;
  border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--muted);
  transition: background-color .12s, border-color .12s, transform .12s, opacity .2s;
  scroll-margin-left: calc(var(--namew) + 8px);
}
.cell .ico { width: 18px; height: 18px; stroke-width: 2.3; }
.cell[data-state="offen"]::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #c3cdd5; }
.cell[data-state="nicht_da"] { color: #8ea2b2; }
.cell[data-state="nicht_da"] .ico { width: 16px; height: 16px; stroke-width: 1.8; }
.cell[data-state="da"] { background: var(--fir); border-color: var(--fir); color: var(--white); }
.cell:hover:not(:disabled)[data-state="offen"] { border-style: dashed; border-color: #a5b5c1; background: #fff; }
.cell:hover:not(:disabled)[data-state="offen"]::after { background: var(--olive-dark); }
.cell:hover:not(:disabled)[data-state="nicht_da"] { border-color: #d6dee4; background: #fff; }
.cell:hover:not(:disabled)[data-state="da"] { background: var(--fir-hover); border-color: var(--fir-hover); }
.cell:active:not(:disabled) { transform: scale(.94); }
.cell:disabled { cursor: default; }
.editing .cell { opacity: .45; pointer-events: none; }

/* Summenzeile: Anker jeder Gruppe, Zahl lauter als die Haken */
tr.sum-row th, tr.sum-row td {
  height: 64px; padding: 8px 4px; vertical-align: middle;
  background: var(--sum-bg); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule);
}
tr.sum-row .name-col { background: var(--sum-bg); padding-left: 12px; font-size: 14px; font-weight: 500; color: var(--ink); }
.tally { display: inline-grid; justify-items: center; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tally-n { display: inline-flex; align-items: center; gap: 4px; }
.tally-n b { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.tally-n .of { font-size: 22px; font-weight: 500; letter-spacing: -.01em; color: inherit; opacity: .72; }
.tally-n .ico { order: -1; width: 22px; height: 22px; padding: 4px; margin: 0 2px 0 0; border-radius: 50%; background: rgba(47,93,74,.13); stroke-width: 3; }
.tally-st { min-height: 15px; padding-top: 3px; font-size: 12px; font-weight: 500; color: var(--red); }
.tally.ok { color: var(--fir); }
.tally.low { color: var(--red); }
.tally.none { color: var(--ink); }

/* Bearbeiten in der Tabelle */
.name-edit { display: flex; align-items: center; gap: 4px; padding: 0 4px 0 8px; }
.name-edit .field { flex: 1; min-width: 0; padding: 6px 10px; min-height: 36px; }
.row-tools { display: flex; }
.gh-edit { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px 14px; }
.gh-edit .g-name-field { font-size: 16px; font-weight: 500; width: 250px; }
.gh-edit .g-target-field { width: 96px; }
.gh-edit .icon-btn { margin-bottom: 4px; }
tr.group-tools td { padding: 12px 0 4px; text-align: left; }
.tools-inner { position: sticky; left: 0; display: block; max-width: calc(100vw - 32px); padding-left: 12px; }
.tools-row { display: flex; flex-wrap: wrap; gap: 8px; }
tr.add-group-row td { padding: 36px 0 6px; text-align: left; }
.add-col { text-align: center; }

.empty-state { color: var(--muted); padding: 28px 12px; margin: 0; }

/* ---------- Arbeitsplan ---------- */
.plan-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 2px 0 18px;
  box-shadow: 0 0 0 100vmax var(--snow), 0 1px 0 100vmax var(--snow-line); clip-path: inset(0 -100vmax -1px -100vmax); background: var(--snow);
}
#plan-status { margin: 0; font-size: 14.5px; }
#plan-status strong { font-weight: 500; color: var(--fir); }
.plan-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#btn-open-list { margin-right: auto; }
#open-panel {
  order: 1; display: grid; gap: 10px; justify-items: start; margin: 12px 0 6px; padding: 14px;
  border: 1px solid var(--field); border-radius: 12px; background: var(--white); width: min(440px, calc(100vw - 60px));
}
#open-text { width: 100%; resize: vertical; line-height: 1.5; }
.plan-scroll { overflow-x: auto; margin: 0 -10px; padding: 26px 10px 18px; }
.plan-grid { display: grid; grid-template-columns: repeat(var(--n), minmax(200px, 1fr)); gap: 18px; align-items: start; }
.pd { background: #fff; border-radius: 14px; border: 1px solid #e7ede9; box-shadow: var(--shadow-card); overflow: hidden; }
.pd-head { position: relative; padding: 16px 18px 14px; background: #f4f8f5; border-bottom: 1px solid #e3ebe5; }
.pd-sprig { position: absolute; right: 10px; top: 10px; width: 72px; height: 32px; opacity: .7; pointer-events: none; }
.pd-head h3 { position: relative; margin: 0; font-size: 20px; font-weight: 500; letter-spacing: -.01em; line-height: 1.25; }
.pd-head p { position: relative; display: flex; align-items: baseline; gap: 6px; margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.pd-head p b { font-size: 24px; line-height: 1; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.pd-g { padding: 14px 18px 16px; }
.pd-g + .pd-g { border-top: 1px solid var(--line); }
.pd-gh { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.pd-gh h4 { margin: 0; padding-top: 3px; font-size: 15px; font-weight: 500; line-height: 1.3; min-width: 0; }
.pd-gh .tally { justify-items: end; }
.pd-gh .tally-n b { font-size: 22px; }
.pd-gh .tally-st:empty { display: none; }
.pd-names { list-style: none; margin: 6px 0 0; padding: 0; font-size: 14px; line-height: 1.75; }
.pd-names li .ico { width: 12px; height: 12px; fill: var(--fir); margin-left: 5px; vertical-align: -1px; }
.pd-none { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); }

/* ---------- Fuß ---------- */
footer.foot { margin-top: 72px; background: var(--snow); font-size: 13px; color: var(--muted); }
footer.foot .page { padding-top: 24px; padding-bottom: 30px; }
.foot p { margin: 0; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 60; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px 10px 12px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px;
  box-shadow: var(--shadow-pop); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: none; }
#toast .ico { color: var(--olive); width: 16px; height: 16px; stroke-width: 2.4; }
#toast.bad { background: var(--red); }
#toast.bad .ico { color: #fff; }

/* ---------- Datums-Popover ---------- */
#datepick, #confirm {
  position: fixed; z-index: 50; background: #fff; color: var(--ink); border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: var(--shadow-pop);
}
#datepick { width: 300px; padding: 12px; }
#datepick.with-clear { width: 344px; } /* room for "Keine Frist" (spec section 14) */
.dp-top { display: flex; align-items: center; gap: 10px; }
#dp-input { width: 128px; font-variant-numeric: tabular-nums; }
#dp-wd { font-size: 13.5px; color: var(--fir); flex: 1; text-align: right; }
#dp-wd.bad { color: var(--red); }
.dp-nav { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 6px; }
#dp-month { font-size: 14px; font-weight: 500; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 36px); gap: 2px 4px; justify-content: space-between; }
.dp-wdh { height: 24px; display: grid; place-items: center; font-size: 11.5px; color: var(--muted); }
.dp-day { position: relative; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 10px; background: none; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.dp-day:hover { background: var(--mint); }
.dp-day.we { color: #8ea2b2; }
.dp-day.today::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--olive-dark); }
.dp-day.sel { background: var(--fir); color: #fff; }
.dp-day.sel::after { background: #fff; }
.dp-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
#dp-clear { margin-right: auto; }
#dp-backdrop { position: fixed; inset: 0; z-index: 49; background: rgba(34,58,65,.42); display: none; }
#confirm { width: 290px; padding: 14px 16px; }
#confirm p { margin: 0 0 12px; font-size: 14px; line-height: 1.45; }
#confirm .actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- Handy ---------- */
@media (max-width: 640px) {
  .page { padding: 0 16px; }
  .masthead { grid-template-columns: auto 1fr auto; grid-template-areas: "logo . actions" "title title title" "seg seg seg"; row-gap: 14px; padding: 14px 0 16px; }
  .masthead > .logo { height: 32px; }
  .seg { justify-self: stretch; }
  .seg button { flex: 1; justify-content: center; }
  #btn-edit { width: 40px; padding: 0; }
  #btn-edit .txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  h1.title { font-size: 24px; padding-right: 64px; }
  .mh-title { gap: 10px; }
  .ill-tr { top: 52px; right: -8px; width: 104px; height: 44px; opacity: .6; }
  .gen-grid { grid-template-columns: 1fr; }
  #first-hint { flex-wrap: wrap; }
  .hint-text { flex: 1 1 calc(100% - 50px); }
  #first-hint .btn { margin-left: 44px; }
  .nm { font-size: 14px; padding-left: 8px; white-space: normal; line-height: 1.25; }
  .sticky-inner, .tools-inner { padding-left: 8px; }
  .head th.name-col, tr.sum-row th.name-col { padding-left: 8px; }
  .gh-edit .g-name-field { width: 190px; }
  #edit-bar .page { flex-wrap: wrap; gap: 8px 12px; }
  .edit-ico { display: none; }
  .edit-text { flex-basis: calc(100% - 110px); font-size: 13px; }
  .plan-grid { grid-template-columns: 1fr; }
  .plan-scroll { overflow: visible; }
  .legend { gap: 6px 16px; }
  .table-top { padding-bottom: 14px; }
  .pd-sprig { width: 60px; height: 27px; }
  #datepick.center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); }
  #dp-backdrop.on { display: block; }
  .login-card { padding: 26px 24px 28px; }
  .login-logo { height: 56px; }
  #toast { left: 16px; right: 16px; bottom: 16px; justify-content: center; }
}

/* ---------- Druck ----------
   Zwei Teile: (1) PRINT-CSS-START … PRINT-CSS-END ist das Aussehen des Ausdrucks,
   nur über .print-root geschrieben, ohne @media print. v3-druck.html kopiert diesen
   Block unverändert in ein Blatt (.sheet). (2) Darunter nur die Umschaltung für den Druck. */
/* PRINT-CSS-START */
.print-root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 11pt; font-weight: 400; line-height: 1.35; color: #223a41; background: #fff;
  -webkit-font-smoothing: antialiased;
}
.print-root h1, .print-root h2, .print-root h3, .print-root p, .print-root ul { margin: 0; padding: 0; }
.print-root .pr-ico { width: 3.8mm; height: 3.8mm; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
/* Kopf: Logo links, Titel rechts, Linie in Tannengrün */
.print-root .pr-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10mm; padding-bottom: 3.5mm; margin-bottom: 5mm; border-bottom: 2pt solid #2f5d4a; }
.print-root .pr-logo { display: block; flex: none; width: 28mm; height: 11.9mm; color: #30444d; }
.print-root .pr-title { text-align: right; }
.print-root .pr-title h1 { font-size: 18pt; font-weight: 500; letter-spacing: -.01em; line-height: 1.15; color: #223a41; }
.print-root .pr-title p { margin-top: 1.2mm; font-size: 10pt; color: #627e94; }
.print-root .pr-foot { padding-top: 2mm; border-top: .5pt solid #dbe2e7; font-size: 8.5pt; color: #627e94; }
.print-root .pr-empty { color: #627e94; }
/* Zahl "im Büro": groß, Farbe im Text */
.print-root .pr-t { display: inline-flex; flex-direction: column; align-items: center; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.print-root .pr-tn { display: inline-flex; align-items: center; gap: 1mm; }
.print-root .pr-t b { font-size: 14pt; font-weight: 600; }
.print-root .pr-t .of { font-size: 14pt; font-weight: 500; color: inherit; opacity: .72; }
.print-root .pr-t .pr-ico { order: -1; width: 5mm; height: 5mm; padding: .9mm; margin-right: .5mm; border-radius: 50%; background: #e3eee8; stroke-width: 3; }
.print-root .pr-t.ok { color: #2f5d4a; }
.print-root .pr-t.low { color: #a8423f; }
.print-root .pr-t.none b { color: #223a41; }
.print-root .pr-ts { margin-top: .8mm; font-size: 7.5pt; font-weight: 500; }
/* Arbeitsplan: je Tag eine Spalte, ab 5 Tagen zwei Zeilen */
.print-root .pr-plan { display: grid; grid-template-columns: repeat(var(--pc, 4), minmax(0, 1fr)); gap: 5mm; align-items: start; }
.print-root .pr-card { border: .75pt solid #d3dfd7; border-radius: 3mm; overflow: hidden; background: #fff; break-inside: avoid; }
.print-root .pr-card-h { padding: 3.5mm 4mm 3mm; background: #e9f1ec; border-bottom: .75pt solid #d3dfd7; }
.print-root .pr-card-h h2 { font-size: 15pt; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.print-root .pr-card-h p { display: flex; align-items: baseline; gap: 1.4mm; margin-top: 1mm; font-size: 9.5pt; color: #627e94; }
.print-root .pr-card-h b { font-size: 17pt; font-weight: 600; line-height: 1; color: #223a41; font-variant-numeric: tabular-nums; }
.print-root .pr-cg { padding: 3mm 4mm 3.2mm; }
.print-root .pr-cg + .pr-cg { border-top: .5pt solid #e6ebee; }
.print-root .pr-cgh { display: flex; align-items: flex-start; justify-content: space-between; gap: 2mm; }
.print-root .pr-cgh h3 { padding-top: .8mm; font-size: 10.5pt; font-weight: 600; }
.print-root .pr-cgh .pr-t { align-items: flex-end; }
.print-root .pr-cgh .pr-t b { font-size: 13pt; }
.print-root .pr-cg ul { list-style: none; margin-top: 1.4mm; font-size: 10.5pt; line-height: 1.5; }
.print-root .pr-none { margin-top: 1.4mm; font-size: 9.5pt; color: #627e94; }
/* Tabelle: 11 pt, Zeilen 7 mm; Format und Seitenumbruch nach Spec Abschnitt 10 */
.print-root .pr-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.print-root .pr-cn { width: 62mm; }
.print-root .pr-table th, .print-root .pr-table td { padding: 0 2mm; text-align: center; vertical-align: middle; font-weight: 400; }
.print-root .pr-table .pr-name { text-align: left; }
.print-root .pr-table thead th { height: 8mm; font-size: 11pt; font-weight: 600; color: #223a41; border-bottom: .75pt solid #dbe2e7; }
.print-root .pr-table thead .wd { font-weight: 500; color: #627e94; }
.print-root .pr-keep { break-inside: avoid; page-break-inside: avoid; }
.print-root .pr-p { break-inside: avoid; }
.print-root .pr-sum { break-before: avoid; }
.print-root .pr-gh th { padding: 4mm 2mm 1.5mm; text-align: left; }
.print-root .pr-gname { position: relative; display: inline-block; padding-bottom: 1.2mm; font-size: 12pt; font-weight: 600; }
.print-root .pr-gname::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2pt; border-radius: 1pt; background: var(--gc, #2f5d4a); }
.print-root .pr-soll { margin-left: 3mm; font-size: 9pt; font-weight: 400; color: #627e94; }
.print-root .pr-p th, .print-root .pr-p td { height: 7mm; border-bottom: .5pt solid #e6ebee; }
.print-root .pr-p .pr-name { font-size: 11pt; }
.print-root .pr-c.nicht_da { color: #9aabb8; }
.print-root .pr-c.nicht_da .pr-ico { width: 3mm; height: 3mm; stroke-width: 2; }
.print-root .pr-chip { display: inline-flex; align-items: center; justify-content: center; width: 13mm; height: 5.2mm; border-radius: 1.6mm; background: #e3eee8; color: #2f5d4a; vertical-align: middle; }
.print-root .pr-sum th, .print-root .pr-sum td { height: 10mm; background: #f4f7f5; border-top: 1.5pt solid #223a41; border-bottom: .5pt solid #dbe2e7; }
.print-root .pr-sum .pr-name { font-size: 10.5pt; font-weight: 600; }
/* Farben gezielt erhalten (nicht pauschal auf body) */
.print-root .pr-head, .print-root .pr-logo, .print-root .pr-card-h, .print-root .pr-chip,
.print-root .pr-sum th, .print-root .pr-sum td, .print-root .pr-gname::after, .print-root .pr-t {
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
/* PRINT-CSS-END */

#print-root { display: none; }
@media print {
  html, body { background: #fff !important; }
  body > :not(#print-root):not(.sprite) { display: none !important; }
  #print-root { display: block; padding-bottom: 9mm; }
  #print-root .pr-foot { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; }
}
