@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 300 900;
  font-stretch: 100% 125%;
  font-display: swap;
  src: url("/fonts/archivo-latin.woff2") format("woff2");
}
/* Layout: the ferien-feiertage.de planner sheet (12 month columns x 31 day rows) under a slim budget bar; trip list below. */
:root {
  --ink: #1c1b19;
  --muted: #6a645c;
  --paper: #f7f1e7;
  --card: #fffaf2;
  --head: #f3e9dc;
  --line: #e3d9cc;
  --empty: #fbf6ee;
  --glow-1: #f6d7b3;
  --glow-2: #f0c7c7;
  --weekend: rgba(108, 140, 213, 0.13);
  --holiday: #dc4c4c;
  --bridge: #f6a04d;
  --ferien: #5aa47a;
  --plan: #6f47a8;
  --plan-strong: #53308a;
  --plan-soft: #e3d8f1;
  --plan-ink: #ffffff;
  --warn: #c0392b;
  --shadow: 0 20px 60px rgba(28, 27, 25, 0.12);
  color-scheme: light;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, var(--glow-1) 0%, transparent 45%),
    radial-gradient(circle at 80% 20%, var(--glow-2) 0%, transparent 40%),
    var(--paper);
}
/* one screen: top bar, then sheet + sidebar fill the rest; type scaled like the ferien-feiertage.de planner */
.page {
  min-width: 0;
  font-size: clamp(11px, 0.95vw, 15px);
  height: 100%;
  padding-inline: 16px;
  padding-block: 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}
header.top { display: flex; flex-wrap: wrap; min-width: 0; align-items: center; justify-content: space-between; gap: 8px 20px; }
h1 { margin: 0; font-size: 1.67em; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; }
.yearwrap { position: relative; display: inline-flex; align-items: center; gap: 0.12em; color: var(--plan); border-radius: 8px; padding: 0 0.12em; cursor: pointer; }
.yearwrap:hover { background: color-mix(in srgb, var(--plan) 12%, transparent); }
.yearwrap:focus-within { outline: 2px solid var(--plan); outline-offset: 2px; }
.yearwrap .caret { width: 0.4em; height: 0.26em; }
/* the real select sits invisibly on top at normal size, so its menu opens at normal size */
.yearpick { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 14px; cursor: pointer; border: 0; appearance: none; -webkit-appearance: none; }
.controls { flex: 0 1 auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 16px; align-items: center; }
select, input[type="number"], input[type="text"], input[type="date"] {
  font: inherit; font-size: 1.08em; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px;
}
input[type="number"] { width: 4.6em; font-variant-numeric: tabular-nums; }
select:focus-visible, input:focus-visible, button:focus-visible { outline: 2px solid var(--plan); outline-offset: 2px; }
.history { display: inline-flex; gap: 4px; align-items: center; flex: none; }
.help { position: relative; }
.help summary { list-style: none; cursor: pointer; font-weight: 700; width: 1.9em; height: 1.9em; display: grid; place-items: center; border-radius: 50%; background: var(--head); border: 1px solid var(--line); }
.help summary::-webkit-details-marker { display: none; }
.help[open] summary { background: var(--ink); color: var(--card); }
.help .pop { position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; width: min(370px, calc(100vw - 32px)); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px 12px; display: grid; gap: 4px; }
.help h3 { margin: 6px 0 2px; font-size: 0.8em; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.help h3:first-child { margin-top: 0; }
.help ul.keys { list-style: none; margin: 0; padding: 0; display: grid; }
.help ul.keys li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; border-top: 1px solid var(--line); }
.help ul.keys li:first-child { border-top: 0; }
.help ul.keys .k { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; flex: none; }
.help ul.keys .k kbd + kbd { margin-left: 1px; }
.help .g { color: var(--muted); font-size: 0.92em; }
.help kbd { min-width: 1.6em; text-align: center; font-size: 0.85em; padding: 1px 4px; line-height: 1.3; }
.help .muted { margin-top: 6px; font-size: 0.88em; }
.history button { line-height: 0; padding: 5px 8px; display: grid; place-items: center; }
button:disabled { opacity: 0.4; cursor: default; }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 1em; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 1em; }
.legend label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.dot { width: 0.7em; height: 0.7em; border-radius: 50%; display: inline-block; flex: none; }
.dot.h { background: var(--holiday); } .dot.b { background: var(--bridge); } .dot.f { background: var(--ferien); }
.swatch { width: 1em; height: 1em; border-radius: 3px; background: var(--sw, var(--plan)); display: inline-block; flex: none; }
.hint { font-size: 1em; color: var(--muted); flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
kbd { font: inherit; font-size: 0.92em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 3px; background: var(--card); }

.main { display: grid; grid-template-columns: minmax(0, 1fr) clamp(265px, 21vw, 330px); gap: 12px; min-height: 0; }

/* sheet */
.sheet {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  overflow: hidden; min-height: 0;
}
table.cal { width: 100%; height: 100%; border-collapse: collapse; table-layout: fixed; font-size: clamp(10px, 0.8vw, 13px); user-select: none; -webkit-user-select: none; }
.cal th { background: var(--head); font-weight: 600; padding: clamp(1px, 0.25vw, 3px) 2px; border: 1px solid var(--line); white-space: nowrap; height: clamp(12px, 1vh, 16px); }
.cal td { border: 1px solid var(--line); padding: clamp(1px, 0.25vw, 3px) 2px; height: 14px; min-width: 36px; cursor: pointer; position: relative; }
.cal td.x { background: var(--empty); cursor: default; }
.cal td.we { background: var(--weekend); }
.cal td .c { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 4px; white-space: nowrap; }
.cal th.oy { color: var(--muted); font-weight: 500; }
.cal td.oy:not(.p) .n { color: var(--muted); }
.cal .edge-r { border-right: 2px solid var(--muted); }
.cal .edge-l { border-left: 2px solid var(--muted); }
.cal td .n { font-variant-numeric: tabular-nums; }
.cal td .d { display: inline-flex; gap: 2px; }
.cal td .d .dot { width: 0.7em; height: 0.7em; }
.cal td:hover:not(.x) { box-shadow: inset 0 0 0 2px var(--line); }
/* --c is set per cell from the vacation's color */
.cal td.p { --soft: color-mix(in srgb, var(--c, var(--plan)) 24%, var(--card)); background: var(--soft); cursor: grab; }
.cal td.p.w { background: var(--c, var(--plan)); color: var(--plan-ink); font-weight: 600; }
.cal td.p.w.half { background: linear-gradient(135deg, var(--c, var(--plan)) 0 50%, var(--soft) 50% 100%); color: var(--ink); }
.cal td.p.w .dot { box-shadow: 0 0 0 1.5px var(--plan-ink); }
.cal td.inf:not(.p) { background: color-mix(in srgb, var(--it) 16%, var(--card)); }
.cal td.inf.we:not(.p) { background: color-mix(in srgb, var(--it) 20%, var(--head)); }
.cal[data-layer="info"] td.p { cursor: pointer; }
.cal[data-layer="info"] td.inf { cursor: grab; }
.colors { display: flex; flex-wrap: wrap; gap: 6px; }
.colors button { width: 1.7em; height: 1.7em; padding: 0; border-radius: 50%; border: 2px solid var(--card); background: var(--sw); box-shadow: 0 0 0 1px var(--line); }
.colors button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.cal td.pv { opacity: 0.8; }
/* resize grips on the first and last day of the selected vacation */
.cal td.sel.gs, .cal td.sel.ge { cursor: ns-resize; }
.cal td.sel.gs::before, .cal td.sel.ge::after {
  content: ""; position: absolute; left: 50%; width: 22px; height: 4px; margin-left: -11px;
  border-radius: 2px; background: var(--ink); opacity: 0.7; pointer-events: none;
}
.cal td.sel.gs::before { top: 1px; }
.cal td.sel.ge::after { bottom: 1px; }
.cal.dragging td { cursor: grabbing; }
.cal td.touchmove { touch-action: none; }

/* sidebar */
.side { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 10px; min-height: 0; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; min-width: 0; align-content: start; }
.panel h2 { margin: 0; font-size: 1.08em; font-weight: 700; }
.muted { color: var(--muted); font-size: 1em; margin: 0; line-height: 1.45; }
label.field { display: grid; gap: 3px; font-size: 0.83em; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
label.field > input { font-size: 1.3em; letter-spacing: 0; text-transform: none; }
.carry-note { margin: 0; font-size: 0.92em; color: var(--muted); line-height: 1.4; }
.carry-note.warn { color: var(--warn); }
.budget { gap: 6px; }
.until { display: flex; gap: 4px; flex: none; }
.until select { height: 2rem; font-size: 1.05em; padding: 0 4px; min-width: 0; }
.until { min-width: 0; }
.until select:first-child { width: 4.2em; }
.until select:last-child { width: 5.6em; }
/* result first: days left, bar with expiring leftover days, then the settings */
.bhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.big { display: flex; align-items: baseline; gap: 6px; color: var(--plan); }
.big .v { font-size: 2.2em; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.big .k { font-weight: 600; }
.big.over { color: var(--warn); }
.bhead .of { font-size: 0.92em; color: var(--muted); }
.bar b { position: absolute; inset: 0 0 0 auto; background: repeating-linear-gradient(135deg, var(--warn) 0 4px, color-mix(in srgb, var(--warn) 55%, var(--card)) 4px 7px); border-radius: 0 99px 99px 0; }
.carry-note { display: flex; gap: 6px; align-items: flex-start; }
.carry-note svg { flex: none; width: 1.1em; height: 1.1em; margin-top: 0.1em; }
.settings { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 2px; }
/* settings as even rows: muted label left, compact control right */
.srow { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.92em; color: var(--muted); white-space: nowrap; }
.srow[hidden] { display: none; }
.srow label { cursor: pointer; }
.stepper { display: inline-flex; align-items: stretch; height: 2rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card); overflow: hidden; }
.stepper button { border: 0; border-radius: 0; background: transparent; width: 1.9rem; padding: 0; font-size: 1.15em; line-height: 1; color: var(--ink); }
.stepper button:hover { background: var(--head); }
.stepper input[type="number"] { width: 2.9em; height: auto; border: 0; border-radius: 0; padding: 0; text-align: center; font-weight: 700; font-size: 1.1em; background: transparent; -moz-appearance: textfield; appearance: textfield; }
.stepper input[type="number"]::-webkit-inner-spin-button, .stepper input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper:focus-within { border-color: var(--plan); }
.stepper input:focus-visible { outline: none; }
ul.trips .chev { width: 12px; height: 12px; color: var(--muted); transition: transform 0.15s; }
ul.trips li.on .chev { transform: rotate(180deg); }
ul.trips li .chev { align-self: start; margin-top: 0.35em; }
.more { grid-column: 2 / -1; display: grid; gap: 8px; padding: 8px 0 2px; margin-top: 4px; border-top: 1px solid color-mix(in srgb, var(--sw, var(--plan)) 25%, transparent); cursor: default; font-size: 0.92em; }
.mrow { display: grid; grid-template-columns: 5.6em minmax(0, 1fr); align-items: center; gap: 8px; }
.ml { color: var(--muted); font-size: 0.92em; }
.mfoot { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 0.92em; }
.colors.small button { width: 1.2em; height: 1.2em; border-width: 1.5px; }
.colors.small { gap: 5px; flex-wrap: nowrap; }
button.link { background: none; border: 0; padding: 2px 0; color: var(--muted); font-size: 1em; }
button.link:hover, button.link:focus-visible { color: var(--warn); text-decoration: underline; }
.num { font-variant-numeric: tabular-nums; }
.inputs { display: flex; gap: 10px; }
.stats { display: flex; justify-content: space-between; align-items: end; }
.stat { display: grid; gap: 1px; }
.stat .k { font-size: 0.83em; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.stat .v { font-size: 1.67em; font-weight: 700; line-height: 1.1; }
.stat.left { text-align: right; }
.stat.left .v { font-size: 2.33em; color: var(--plan); }
.stat.left.over .v { color: var(--warn); }
.bar { height: 8px; border-radius: 99px; background: var(--head); overflow: hidden; position: relative; }
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--plan); border-radius: 99px; transition: width 0.2s; }
.bar.over i { background: var(--warn); }
.barwrap { display: grid; gap: 4px; font-size: 0.92em; color: var(--muted); }
.sel-range { font-size: 1.17em; font-weight: 700; }
.sel-facts { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 1em; }
.sel-facts b { font-variant-numeric: tabular-nums; }
.nudge { display: grid; gap: 5px; font-size: 1em; color: var(--muted); }
.nudge .grp { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.nudge .grp span { display: inline-flex; gap: 3px; }
button {
  font: inherit; font-size: 1em; color: var(--ink); background: var(--head); border: 1px solid var(--line);
  border-radius: 7px; padding: 3px 9px; cursor: pointer;
}
button:hover { border-color: var(--muted); }
button.sq { padding: 1px 7px; min-width: 26px; }
button.danger { color: var(--warn); justify-self: start; }
.halves { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--muted); }
.halves input { margin: 0; }
.halves label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; color: var(--ink); }
.list { min-height: 0; grid-template-rows: auto minmax(0, 1fr); }
.lhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 8px; }
.lhead .save { margin-left: auto; }
.tabs { display: inline-flex; flex: none; gap: 2px; padding: 2px; background: var(--head); border-radius: 9px; }
.tabs button { white-space: nowrap; border: 0; background: transparent; border-radius: 7px; padding: 4px 10px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(28, 27, 25, 0.12); }
.tabs .n { font-size: 0.85em; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.tabs .n:empty { display: none; }
ul.trips { list-style: none; margin: 0; padding: 0; overflow: auto; min-height: 0; }
/* color strip on the left edge, disclosure chevron in front */
ul.trips li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 4px 8px; align-items: center; padding: 6px 8px 6px 10px; box-shadow: inset 4px 0 0 var(--sw, var(--plan)); border-top: 1px solid var(--line); cursor: pointer; border-radius: 0 6px 6px 0; }
ul.trips li:first-child { border-top: 0; }
ul.trips li:hover { background: color-mix(in srgb, var(--sw, var(--plan)) 10%, var(--card)); }
ul.trips li.on { background: color-mix(in srgb, var(--sw, var(--plan)) 14%, var(--card)); }
ul.trips .swatch { width: 10px; height: 10px; }
ul.trips input.t { width: 100%; font-weight: 600; font-size: 1em; padding: 1px 4px; margin-left: -5px; border: 1px solid transparent; background: transparent; border-radius: 5px; text-overflow: ellipsis; }
ul.trips input.t::placeholder { color: var(--ink); opacity: 1; }
ul.trips input.t:hover { border-color: var(--line); }
ul.trips input.t:focus { border-color: var(--plan); background: var(--card); outline: none; }
ul.trips input.t:focus::placeholder { color: var(--muted); }
ul.trips .r { font-size: 0.88em; color: var(--muted); }
ul.trips .days { text-align: right; font-variant-numeric: tabular-nums; font-weight: 400; font-size: 0.92em; color: var(--muted); align-self: start; }
ul.trips .days b { font-size: 1.15em; font-weight: 700; color: var(--ink); }
ul.trips .days small { display: block; font-size: 0.92em; }
.save { font-size: 0.92em; color: var(--muted); transition: opacity 0.6s; }
.save.fade { opacity: 0; }
.save.warn { color: var(--warn); }
.save.ok { color: var(--ferien); display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.save.ok svg { width: 1.1em; height: 1.1em; }

@media (max-width: 900px) {
  html, body, .page { height: auto; }
  header.top { flex-wrap: wrap; justify-content: flex-start; }
  .hint { display: none; }
  .history { margin-left: auto; }
  .controls { flex-basis: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .help .pop { left: auto; right: 0; }
  .main { grid-template-columns: minmax(0, 1fr); }
  table.cal { height: auto; }
  .list { max-height: 60vh; }
  .sheet { overflow: auto; -webkit-overflow-scrolling: touch; }
  table.cal { width: calc(72px * 14); }
  .cal th, .cal td { width: 72px; min-width: 72px; }
}
@media (prefers-reduced-motion: reduce) { .bar i, ul.trips .chev { transition: none; } }

.sitefoot { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.85em; color: var(--muted); padding: 0 2px; }
.sitefoot a { color: inherit; }
.back { font-size: 0.92em; color: var(--muted); text-decoration: none; white-space: nowrap; }
.back:hover { color: var(--ink); }
.side { grid-template-rows: auto minmax(0, 1fr) auto; }
@media print { .page { display: none; } }

/* cookie banner, shared with the rest of the site (from /styles.css) */
.cookie-banner {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 18px;
  background: #fffaf2;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 12px 28px rgba(28, 27, 25, 0.18);
  display: grid;
  gap: 12px;
  z-index: 10000;
  pointer-events: auto;
  max-width: 720px;
  margin: 0 auto;
}

.cookie-banner * {
  pointer-events: auto;
}

.cookie-banner p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.cookie-banner a {
  color: var(--ink);
}

.cookie-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cookie-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.cookie-btn.is-primary {
  background: #1c1b19;
  color: #fffaf2;
  border-color: #1c1b19;
}
