:root {
  --desk: #eef1f2;
  --ink: #13202e;
  --muted: #56616c;
  --line: #c9d0d5;
  --accent: #2456c4;
  --ok: #1d6b45;
  --warn: #9a3412;
  --sheet: #ffffff;
  --band: #18324f;
  --sans: "Avenir Next", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --doc: Arial, Helvetica, sans-serif;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--desk);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 16.5px; line-height: 1.5; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
button, input, textarea, select { font: inherit; color: inherit; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
[hidden] { display: none !important; }
.wrap { max-width: 1260px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10; }

header.site .wrap, footer.site .wrap { display: flex; align-items: baseline; justify-content: space-between; gap: 10px 24px; flex-wrap: wrap; }
header.site .wrap { padding-top: 20px; padding-bottom: 16px; }
.brand { font-size: 25px; font-weight: 800; letter-spacing: -0.8px; text-decoration: none; }
.brand b { color: var(--accent); font-weight: 800; }
.site nav { display: flex; gap: 6px 20px; flex-wrap: wrap; }
.site nav a { text-decoration: none; color: var(--muted); font-size: 15px; font-weight: 600; padding: 4px 0; }
.site nav a[aria-current="page"] { color: var(--ink); box-shadow: 0 2px 0 var(--accent); }
footer.site { border-top: 1px solid var(--line); margin-top: 96px; }
footer.site .wrap { padding-top: 28px; padding-bottom: 40px; }
footer.site .brand { font-size: 20px; }

.start { padding: 30px 0 28px; max-width: 820px; }
h1 { font-size: clamp(32px, 5.2vw, 56px); line-height: 1.03; letter-spacing: -1.7px; margin: 0 0 14px; font-weight: 800; text-wrap: balance; }
.lead { font-size: 18px; color: var(--muted); margin: 0; max-width: 42em; }

.workspace { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 56px; align-items: start; }

.fields section { padding: 22px 0 24px; border-bottom: 1px solid var(--line); counter-increment: part; }
.fields { counter-reset: part; }
.fields h2 { margin: 0 0 14px; font-size: 13px; letter-spacing: 1.4px; text-transform: uppercase; font-weight: 700; }
.fields h2::before { content: counter(part, decimal-leading-zero); color: var(--accent); margin-right: 10px; font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label, .choice legend { display: block; font-size: 14px; font-weight: 600; margin-bottom: 5px; padding: 0; }
input[type="text"], textarea, select { width: 100%; min-height: 46px; padding: 10px 12px; font-size: 16px; background: var(--sheet); border: 1px solid var(--line); border-radius: 4px; font-variant-numeric: tabular-nums; transition: border-color 0.15s ease; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 18px) 20px, calc(100% - 12px) 20px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 34px; }
textarea { resize: vertical; line-height: 1.4; display: block; }
input[type="text"]:hover, textarea:hover, select:hover { border-color: var(--muted); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
input::placeholder, textarea::placeholder { color: #93949a; }
.hint { font-size: 13.5px; color: var(--muted); margin: 5px 0 0; }
.error { font-size: 13.5px; color: var(--accent); margin: 5px 0 0; font-weight: 600; }
.error:empty { display: none; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.choice + .grid, .grid + .choice, .choice + .choice, .grid + .field, .field + .grid { margin-top: 16px; }
.segments { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.segments label { position: relative; margin: 0; cursor: pointer; }
.segments input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.segments span { display: flex; align-items: center; min-height: 46px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--sheet); font-size: 15px; font-weight: 600; transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease; }
.segments input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.segments input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; padding: 7px 0; font-size: 15.5px; cursor: pointer; }
input[type="checkbox"] { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ink); cursor: pointer; }

button { cursor: pointer; border: 1.5px solid var(--accent); background: var(--accent); color: #fff; border-radius: 4px; padding: 10px 16px; min-height: 46px; font-size: 15.5px; font-weight: 700; transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease; }
button:hover:not(:disabled) { background: var(--ink); border-color: var(--ink); }
button.secondary { background: transparent; border-color: var(--ink); color: var(--ink); }
button.secondary:hover:not(:disabled) { color: #fff; }
button:disabled { opacity: 0.35; cursor: not-allowed; }
button.link, .analytics-settings { border: 0; background: none; color: var(--muted); padding: 0; min-height: 32px; font-weight: 400; font-size: inherit; text-decoration: underline; text-underline-offset: 3px; }
button.link:hover:not(:disabled), .analytics-settings:hover { background: none; color: var(--accent); }
#reset { margin-top: 14px; font-size: 15px; }


.output { position: sticky; top: 0; align-self: start; container-type: inline-size; min-width: 0; }
.output-inner { padding-top: 18px; display: flex; flex-direction: column; max-height: 100vh; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.sheet-label { margin: 0; font-size: 13px; letter-spacing: 1.4px; text-transform: uppercase; font-weight: 700; }
.exports { display: flex; gap: 8px; flex-wrap: wrap; }
.status { margin: 10px 0 0; font-size: 15px; font-weight: 600; color: var(--muted); }
.status[data-state="ready"] { color: var(--ok); }
.status[data-state="error"] { color: var(--accent); }
#export-note:empty { display: none; }
.sheet { margin: 14px 0 24px; background: var(--sheet); color: #111; font-family: var(--doc); font-size: max(12px, 1.75cqi); line-height: 1.45; padding: 7cqi 7.5cqi 8cqi 9cqi; box-shadow: 0 1px 0 rgba(20, 24, 31, 0.08), 0 18px 40px -18px rgba(20, 24, 31, 0.4); overflow-y: auto; min-height: 0; overflow-wrap: anywhere; animation: sheet-in 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.sheet > * { transition: opacity 0.25s ease; }
.sheet.is-example > * { opacity: 0.5; }
.sheet p { margin: 0 0 0.7em; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(14px); } }

/* Calculator band: the end date is the anchor of the page. */
.band { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: 0; background: var(--band); color: #fff; border-radius: 6px; overflow: hidden; margin-bottom: 30px; }
.band-inputs { padding: 24px 26px 26px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-right: 0; border-radius: 6px 0 0 6px; }
.band h2 { margin: 0 0 14px; font-size: 13px; letter-spacing: 1.4px; text-transform: uppercase; font-weight: 700; color: var(--accent); }
.rules .segments { grid-template-columns: 1fr; }
.band .grid { margin-top: 14px; }
.readout { padding: 28px 30px 26px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.readout-label { margin: 0; font-size: 13px; letter-spacing: 1.4px; text-transform: uppercase; font-weight: 700; color: #a9c1e8; }
.readout-date { margin: 6px 0 2px; font-size: clamp(46px, 7.4vw, 86px); line-height: 1; font-weight: 800; letter-spacing: -2px; font-variant-numeric: tabular-nums; }
.readout-date.tick { animation: tick 0.45s cubic-bezier(0.2, 0.7, 0.2, 1); }
.readout-day { margin: 0 0 16px; font-size: 19px; font-weight: 600; }
.readout-detail { margin: 0 0 14px; font-size: 15px; line-height: 1.5; color: #d5e0ee; max-width: 36em; }
.readout[data-state="warn"] .readout-detail { color: #ffd7b0; }
.readout[data-state="error"] .readout-date { opacity: 0.4; }
.readout .link { color: #fff; align-self: flex-start; }
.readout .link:hover { color: #a9c1e8; }
@keyframes tick { from { opacity: 0.2; transform: translateY(8px); } }
.requests { margin-top: 18px; }
.requests legend { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
#vacation-days { margin-top: 8px; }

/* The letter on the sheet. */
.l-sender { font-size: 0.9em; margin-bottom: 3.2em; }
.l-recipient { min-height: 5.6em; margin-bottom: 2.2em; }
.l-place { text-align: right; }
.l-subject { font-weight: 700; margin-top: 1.4em !important; margin-bottom: 1.2em !important; }
.l-date { background: #dfe8fb; color: inherit; padding: 0 0.15em; border-radius: 2px; transition: background 0.4s ease; }
.l-closing { margin-top: 1.2em !important; }
.l-sign { height: 3.6em; border-bottom: 1px solid #111; width: 55%; display: flex; align-items: flex-end; }
.l-sign span { display: none; }
.l-sign + .l-name::before { content: "Eigenhändige Unterschrift"; display: block; font-size: 0.78em; color: #555; margin-bottom: 0.3em; }
.l-name { margin-top: 0.3em !important; }
.l-blank { color: #8a939b; font-style: italic; }
.l-receipt { margin-top: 2.4em; border-top: 1px solid #999; padding-top: 0.8em; font-size: 0.92em; }
.l-receipt-sign { margin-top: 2.6em !important; border-top: 1px solid #111; width: 55%; padding-top: 0.2em; font-size: 0.85em; color: #555; }

.notice { color: var(--muted); border-left: 3px solid var(--line); padding-left: 14px; }
.next { margin-top: 72px; border-top: 2px solid var(--ink); padding-top: 26px; transition: border-color 0.4s ease; scroll-margin-top: 12px; }
.next.is-current { border-top-color: var(--accent); }
.next > h2 { font-size: clamp(26px, 3.4vw, 38px); letter-spacing: -0.9px; line-height: 1.1; margin: 0 0 26px; font-weight: 800; }
.next ol { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.next li { counter-increment: step; }
.next li::before { content: counter(step, decimal-leading-zero); display: block; font-size: 13px; font-weight: 700; letter-spacing: 1.4px; color: var(--accent); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.next h3 { margin: 0 0 8px; font-size: 19px; line-height: 1.25; letter-spacing: -0.2px; }
.next p { margin: 0 0 10px; color: var(--muted); font-size: 15.5px; }
details { border-top: 1px solid var(--line); padding: 10px 0; }
summary { cursor: pointer; font-weight: 600; font-size: 15.5px; min-height: 28px; }
summary:hover { color: var(--accent); }
details p { margin: 8px 0 2px; }

.article { max-width: 740px; margin-top: 80px; }
.article.page { margin-top: 40px; }
.article h1 { font-size: clamp(31px, 5vw, 46px); }
.article h2 { font-size: 27px; line-height: 1.15; letter-spacing: -0.6px; margin: 52px 0 12px; font-weight: 800; }
.article h3 { font-size: 18.5px; margin: 30px 0 8px; }
.article p, .article ul, .article ol, .article dl { margin: 0 0 14px; }
.article ul { padding-left: 20px; }
.article ol { padding-left: 22px; }
.article li { margin-bottom: 5px; }
table { border-collapse: collapse; width: 100%; margin: 18px 0; font-size: 15px; font-variant-numeric: tabular-nums; }
caption { text-align: left; color: var(--muted); font-size: 14px; padding-bottom: 8px; }
th, td { text-align: left; padding: 8px 14px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: break-word; }
thead th { font-size: 12.5px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--ink); }
td:last-child, th:last-child { padding-right: 0; }
.article table { display: block; overflow-x: auto; max-width: 100%; }
.article { overflow-x: clip; }
.article blockquote { margin: 0 0 14px; padding: 14px 18px; background: var(--sheet); border-left: 3px solid var(--ink); font-family: var(--doc); font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.guide .lead { margin-bottom: 26px; }
.crumbs { margin: 0 0 10px; font-size: 13px; letter-spacing: 1.4px; text-transform: uppercase; font-weight: 700; }
.crumbs a { text-decoration: none; color: var(--accent); }
.meta { font-size: 13.5px; color: var(--muted); margin: 0 0 22px; }
.guide-links { list-style: none; padding: 0 !important; border-top: 1px solid var(--line); }
.guide-links li { border-bottom: 1px solid var(--line); margin: 0; padding: 12px 0; }
.guide-links a { font-weight: 700; text-decoration: none; }
.guide-links span { display: block; color: var(--muted); font-size: 15px; }
.changes { list-style: none; padding: 0 !important; }
.changes time { font-weight: 700; margin-right: 8px; }

.analytics-consent { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin: 0 auto; background: var(--ink); color: #fff; padding: 16px 18px; border-radius: 6px; z-index: 20; font-size: 15px; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.5); }
.analytics-consent p { margin: 0 0 12px; }
.analytics-consent .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.analytics-consent button.secondary { border-color: #fff; color: #fff; }
footer .notice { flex-basis: 100%; margin: 0; }
footer .notice:empty { display: none; }

@media (max-width: 980px) {
  .band { grid-template-columns: 1fr; }
  .band-inputs { border-right: 1px solid var(--line); border-radius: 6px 6px 0 0; }
  .workspace { grid-template-columns: 1fr; gap: 0; }
  .output { position: static; }
  .output-inner { max-height: none; }
  .sheet { max-height: 70vh; }
  .next ol { grid-template-columns: 1fr; gap: 26px; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  .band-inputs { padding: 18px 16px 20px; border-right: 1px solid var(--line); border-radius: 6px 6px 0 0; }
  .readout { padding: 22px 18px; }
  .grid { grid-template-columns: 1fr; }
  .segments { grid-template-columns: 1fr 1fr; }
  .exports { width: 100%; }
  .exports button { flex: 1 1 auto; }
  .article { margin-top: 56px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { header.site, footer.site, .band, .fields, .toolbar, .status, .next, .article, .start, .analytics-consent, .skip { display: none !important; } .workspace { display: block; } .output { position: static; } .output-inner { max-height: none; padding: 0; } .sheet { box-shadow: none; max-height: none; overflow: visible; margin: 0; padding: 0; font-size: 11pt; animation: none; } .sheet.is-example > * { opacity: 1; } .l-date { background: none; } body { background: #fff; } @page { size: A4; margin: 18mm 20mm 20mm 25mm; } }
