/* Layout: Anmeldung als schmale Karte; danach Formular links, Jahresübersicht rechts, darunter Liste und Verwaltung. Auf dem Handy untereinander. */
:root {
  --bg: #f3f5f6;
  --surface: #ffffff;
  --fg: #172326;
  --muted: #5b6b6f;
  --line: #d5dcde;
  --accent: #0e6a63;
  --accent-fg: #ffffff;
  --warn: #a4580a;
  --warn-bg: #fdf0dd;
  --ok: #0e6a63;
  --t-urlaub: #d32f2f;
  --t-gleit: #d58a1f;
  --t-sonder: #7a5bc2;
  --t-sonst: #6f7f84;
  --heat: #c2410c;
  --hol: #1d5fd1;
  --pl: 44%;
  --pfg: #ffffff;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1719; --surface: #172326; --fg: #e8eff0; --muted: #98a9ad; --line: #2b3b3f;
    --accent: #3ec2b6; --accent-fg: #07201d; --warn: #f2b35e; --warn-bg: #3a2a12; --ok: #3ec2b6;
    --t-urlaub: #ef5350; --t-gleit: #e9a444; --t-sonder: #a58be6; --t-sonst: #8b9ca1; --heat: #f08a4b; --hol: #6aa5ff;
    --pl: 58%; --pfg: #0b1416;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 16px; line-height: 1.45;
  padding: 24px max(16px, env(safe-area-inset-right, 0px)) 48px max(16px, env(safe-area-inset-left, 0px));
}
.wrap { max-width: 1180px; margin: 0 auto; display: grid; gap: 20px; }
header { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; }
h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.05; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
.sub { margin: 6px 0 0; color: var(--muted); max-width: 52ch; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.year { display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 3px; }
.year button { width: 36px; height: 36px; border: 0; border-radius: 6px; background: transparent; color: var(--fg); font-size: 1.2rem; cursor: pointer; }
.year button:hover { background: var(--bg); }
.year output { font-family: var(--font-display); font-weight: 700; min-width: 4.2ch; text-align: center; font-variant-numeric: tabular-nums; }
.who-am-i { font-size: 0.9rem; color: var(--muted); }
.who-am-i b { color: var(--fg); }
.grid { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .grid { grid-template-columns: minmax(0, 1fr); } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; min-width: 0; }
h2 { font-family: var(--font-display); font-size: 1.15rem; margin: 0 0 14px; font-weight: 700; }
form { display: grid; gap: 12px; }
label { display: grid; gap: 4px; font-weight: 600; font-size: 0.9rem; }
input, select { font: inherit; font-weight: 400; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; width: 100%; min-width: 0; }
input:focus-visible, select:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.primary { font: inherit; font-weight: 600; background: var(--accent); color: var(--accent-fg); border: 0; border-radius: 6px; padding: 11px 14px; cursor: pointer; }
.primary:disabled { opacity: 0.55; cursor: default; }
.ghost { font: inherit; font-size: 0.9rem; background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; cursor: pointer; }
.ghost:hover { border-color: var(--fg); }
.hint { font-size: 0.9rem; color: var(--muted); margin: 0; min-height: 1.3em; }
.hint.warn { color: var(--warn); background: var(--warn-bg); padding: 8px 10px; border-radius: 6px; }
.hint.err { color: var(--warn); }
.hint.ok { color: var(--ok); }
.notice { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 10px 12px; font-size: 0.95rem; }
.pinbox { background: var(--bg); border: 1px dashed var(--accent); border-radius: 8px; padding: 10px 12px; }
.pinbox strong { font-size: 1.3rem; letter-spacing: 0.15em; font-variant-numeric: tabular-nums; }
.board { display: grid; gap: 14px; }
.scroll { overflow-x: auto; }
.tl { min-width: 760px; display: grid; gap: 8px; }
.row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; align-items: center; }
.who { min-width: 0; }
.who b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.track { position: relative; height: 22px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.track.heat { height: 14px; }
.months { position: relative; height: 18px; font-size: 0.75rem; color: var(--muted); }
.months span { position: absolute; top: 0; padding-left: 4px; border-left: 1px solid var(--line); height: 18px; overflow: hidden; }
.gridlines { position: absolute; inset: 0; pointer-events: none; }
.gridlines i { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); opacity: 0.7; }
.bar { position: absolute; top: 3px; bottom: 3px; border-radius: 3px; min-width: 3px; }
.t-urlaub { background: var(--t-urlaub); } .t-gleit { background: var(--t-gleit); }
.t-sonder { background: var(--t-sonder); } .t-sonst { background: var(--t-sonst); }
.seg { position: absolute; top: 0; bottom: 0; background: var(--heat); }
.today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--fg); opacity: 0.6; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.85rem; color: var(--muted); margin: 0; padding: 0; list-style: none; }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.empty { color: var(--muted); padding: 18px 4px; margin: 0; }
ul.entries, ul.staff { list-style: none; margin: 0; padding: 0; display: grid; }
ul.entries li { display: grid; grid-template-columns: minmax(110px, 1.1fr) minmax(0, 1.6fr) auto auto; gap: 6px 14px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
ul.staff li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 10px 0; border-top: 1px solid var(--line); }
ul.entries li:first-child, ul.staff li:first-child { border-top: 0; }
.ename { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.edates { font-variant-numeric: tabular-nums; min-width: 0; }
.edates small { display: block; color: var(--muted); }
.chip { font-size: 0.78rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; color: #fff; white-space: nowrap; }
.chip.t-gleit { color: #2a1a00; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.del { font: inherit; font-size: 0.85rem; background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; cursor: pointer; }
.del:hover { color: var(--fg); border-color: var(--fg); }
.del.sure { color: var(--warn); border-color: var(--warn); font-weight: 600; }
details.account { position: relative; }
details.account summary { list-style: none; cursor: pointer; }
details.account summary::-webkit-details-marker { display: none; }
details.account[open] .acc-body { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; width: min(300px, 86vw); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); }
.login { max-width: 400px; margin: 8vh auto 0; display: grid; gap: 16px; }
.add-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; margin-top: 12px; }
@media (max-width: 560px) { ul.entries li { grid-template-columns: minmax(0, 1fr) auto; } .edates { grid-column: 1 / -1; } }
/* Kalender */
.boardhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.tabs { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 2px; }
.tabs button { font: inherit; font-size: 0.9rem; border: 0; background: transparent; color: var(--muted); padding: 6px 12px; border-radius: 6px; cursor: pointer; }
.tabs button.on { background: var(--surface); color: var(--fg); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal-year { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px 20px; }
.mcard { min-width: 0; }
.mtitle { font: inherit; font-family: var(--font-display); font-weight: 700; font-size: 1rem; background: transparent; border: 0; padding: 2px 0 6px; color: var(--fg); cursor: pointer; text-align: left; }
.mtitle:hover { color: var(--accent); text-decoration: underline; }
.days, .mdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.mdays { gap: 4px; }
.wd { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); text-align: center; padding-bottom: 2px; }
.d { aspect-ratio: 1; display: grid; place-items: center; font-size: 0.74rem; border-radius: 5px; font-variant-numeric: tabular-nums; position: relative; }
.d.blank { visibility: hidden; }
.d.we { color: var(--muted); }
.d.hol { color: var(--hol); font-weight: 700; }
.d.today { box-shadow: inset 0 0 0 2px var(--fg); }
.d.away, .d.hol.away { color: var(--pfg); font-weight: 600; }
.soft { position: relative; }
.soft::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0 3px, transparent 3px 6px); pointer-events: none; }
.mbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.mname { font-family: var(--font-display); font-size: 1.3rem; margin: 0 6px; min-width: 9ch; }
.mbar .ghost:last-child { margin-left: auto; }
.md { min-height: 84px; background: var(--bg); border-radius: 6px; padding: 5px; display: flex; flex-direction: column; gap: 3px; min-width: 0; overflow: hidden; }
.md.blank { background: transparent; }
.md.we .num { color: var(--muted); }
.md .num { font-size: 0.8rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.md.hol .num { color: var(--hol); }
.md.today { box-shadow: inset 0 0 0 2px var(--fg); }
.holname { font-size: 0.68rem; color: var(--hol); line-height: 1.15; }
.chip2 { position: relative; display: block; font-size: 0.72rem; font-weight: 600; color: var(--pfg); padding: 2px 6px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mlist { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.mlist li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 0.92rem; }
.mlist i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.soft-key { background: repeating-linear-gradient(135deg, var(--t-urlaub) 0 3px, var(--surface) 3px 6px); }
.hol-key { background: transparent; border: 2px solid var(--hol); }
.vac-key { background: var(--t-urlaub); }
.d.vac { color: #fff; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
.chip2 { color: #fff; }
@media (max-width: 560px) { .md { min-height: 58px; padding: 3px; } .chip2 { font-size: 0.62rem; padding: 1px 3px; } .holname { display: none; } }
@media (prefers-reduced-motion: no-preference) { .bar, .seg { transition: opacity .15s; } }

/* Hinweisband und rote Hervorhebung */
.away-banner { border-radius: 10px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); }
.away-banner.has { background: color-mix(in srgb, var(--t-urlaub) 12%, var(--surface)); border-color: var(--t-urlaub); border-left-width: 6px; }
.ab-head { font-size: 1.05rem; }
.away-banner.has .ab-head strong { color: var(--t-urlaub); }
.ab-sub { margin-top: 6px; font-size: 0.85rem; color: var(--muted); }
.ab-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ab-list li { background: var(--t-urlaub); color: #fff; border-radius: 99px; padding: 3px 12px; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.mcard.hasvac { background: color-mix(in srgb, var(--t-urlaub) 9%, transparent); outline: 2px solid var(--t-urlaub); outline-offset: 4px; border-radius: 6px; }
.mcard.hasvac .mtitle { color: var(--t-urlaub); }
.d.vac { background-color: var(--t-urlaub); }
.mt12 { margin: 12px 0 0; } .mb12 { margin-bottom: 12px; } .m0 { margin: 0; } .cnt { color: var(--muted); font-weight: 400; }
.chip2.urlaub { background: var(--t-urlaub); }
.mlist i.urlaub { background: var(--t-urlaub); }
