/* Tagesboard im Freiraum-Design.
   1. Ein Signal: Gelb markiert nur die Hauptaktion, die aktive Navigation und "heute offen".
   2. Form folgt Funktion: Abgerundet ist, was man antippen kann. Informationen stehen kantig im Raster.
   3. Struktur über Raum und eine Linie pro Abschnitt, keine Karten-Stapel.
   4. Zahlen sind die Hauptsache: tabellarische Ziffern, enge Laufweite. */

:root,
[data-theme="dark"] {
  --bg: #1c1c1e;
  --raised: #262628;
  --raised-2: #313134;
  --line: #38383b;
  --line-strong: #545458;
  --text: #f2f2f2;
  --muted: #a1a1a6;
  --signal: #ffcc00;
  --on-signal: #1c1c1e;
  --neg: #ff6b5e;
  --warn: #ffb340;
  --focus: #ffcc00;
  --seg-reserve: #48484b;
  --overlay: rgb(0 0 0 / 0.6);
  --shadow: 0 8px 28px rgb(0 0 0 / 0.45);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f4f4f5;
  --raised: #ffffff;
  --raised-2: #e9e9eb;
  --line: #dcdcdf;
  --line-strong: #b4b4ba;
  --text: #1c1c1e;
  --muted: #5f5f66;
  --signal: #ffcc00;
  --on-signal: #1c1c1e;
  --neg: #c2261d;
  --warn: #8a5100;
  --focus: #1c1c1e;
  --seg-reserve: #c7c7cc;
  --overlay: rgb(28 28 30 / 0.4);
  --shadow: 0 8px 28px rgb(28 28 30 / 0.16);
  color-scheme: light;
}
:root {
  --font: "Proxima Nova", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --t-xs: 0.8125rem;
  --t-sm: 0.9375rem;
  --t-base: 1rem;
  --t-md: 1.25rem;
  --t-lg: 1.75rem;
  --t-xl: 2.25rem;
  --t-hero: clamp(3rem, 2.2rem + 4vw, 4.75rem);
  --gutter: 1.25rem;
  --r-ctl: 8px;
  --tab-h: 3.75rem;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  background: var(--bg);
}
body {
  font: 400 var(--t-base) / 1.5 var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
h1, h2 { line-height: 1.15; font-weight: 700; text-wrap: balance; }
svg { display: block; width: 22px; height: 22px; flex-shrink: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button {
  cursor: pointer;
  border: 0;
  background: none;
  min-height: 44px;
  text-align: inherit;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: fixed;
  top: -100px;
  left: var(--gutter);
  z-index: 100;
  background: var(--raised);
  padding: 0.75rem 1rem;
  color: inherit;
}
.skip:focus { top: max(1rem, env(safe-area-inset-top)); }

/* ---------- Marke ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.03em;
}
.brand svg { width: 24px; height: 24px; }

/* ---------- Bedienelemente ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0 1.25rem;
  border-radius: var(--r-ctl);
  font-size: var(--t-sm);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), transform 120ms var(--ease);
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--signal); color: var(--on-signal); }
.btn.secondary { border: 1px solid var(--line-strong); }
.btn.danger { border: 1px solid var(--neg); color: var(--neg); }
.btn.small { min-height: 44px; padding: 0 0.875rem; }
.btn.full { width: 100%; }
.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: var(--t-sm);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: var(--line-strong);
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
}
.icon-btn:active { background: var(--raised-2); }
.dots {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  margin-right: -10px;
  border-radius: 50%;
  text-align: center;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
}
@media (hover: hover) and (pointer: fine) {
  .btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--signal) 88%, var(--text)); }
  .btn.secondary:hover:not(:disabled),
  .btn.danger:hover:not(:disabled),
  .icon-btn:hover:not(:disabled),
  .dots:hover:not(:disabled) { background: var(--raised-2); }
  .text-btn:hover { text-decoration-color: currentColor; }
}

/* ---------- Formulare ---------- */
label { display: block; font-size: var(--t-xs); font-weight: 600; margin: 1rem 0 0.375rem; }
input:not([type="checkbox"]), select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl);
  background: var(--bg);
  font-size: 16px; /* kleiner löst Auto-Zoom in iOS Safari aus */
  line-height: 1.4;
}
textarea { resize: vertical; min-height: 88px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.8; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: inset 0 0 0 1px var(--focus);
}
input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--signal);
  flex-shrink: 0;
}
input[type="date"], input[type="time"] { display: block; -webkit-appearance: none; appearance: none; text-align: left; }
[data-theme="dark"] input::-webkit-calendar-picker-indicator { filter: invert(1); opacity: 0.7; }
input[type="color"] { padding: 4px; width: 48px; flex-shrink: 0; }
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 2.5rem;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 0.75rem; }
.hint { font-size: var(--t-xs); color: var(--muted); margin-top: 0.5rem; }
.check {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  margin: 0.75rem 0 0;
  font-size: var(--t-sm);
  font-weight: 400;
}
.message { font-size: var(--t-sm); color: var(--neg); overflow-wrap: anywhere; margin-top: 0.75rem; }
.message:empty { display: none; }

/* ---------- Anmeldung ---------- */
#login-panel {
  width: min(100%, 30rem);
  margin-inline: auto;
  padding: 2rem var(--gutter);
}
.gate-kicker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--t-xs);
  color: var(--muted);
  margin-bottom: 1rem;
}
.gate-kicker svg { width: 16px; height: 16px; }
#login-panel h1 { font-size: var(--t-xl); letter-spacing: -0.035em; line-height: 1.05; margin-bottom: 1rem; }
#login-panel > form > p:not(.gate-kicker):not(.message) { color: var(--muted); margin-bottom: 1.5rem; }
#login-submit { margin-top: 1.5rem; }

/* ---------- Rahmen ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: 72rem;
  margin-inline: auto;
  padding: max(0.75rem, env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 0.75rem max(var(--gutter), env(safe-area-inset-left));
}
.actions { display: flex; align-items: center; gap: 0.25rem; }
#settings-open { display: none; }
.shell {
  max-width: 72rem;
  margin-inline: auto;
  padding: 1rem max(var(--gutter), env(safe-area-inset-right)) calc(var(--tab-h) + 6rem + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
}
.shell:focus { outline: none; }
.tabs {
  position: fixed;
  z-index: 10;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 0 max(0.25rem, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(0.25rem, env(safe-area-inset-left));
}
.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: var(--tab-h);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
}
.tab[aria-current="page"] { color: var(--text); font-weight: 700; }
.tab[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 28%;
  right: 28%;
  height: 2px;
  background: var(--signal);
}
.tab:focus-visible { outline-offset: -4px; }
#new {
  position: fixed;
  z-index: 9;
  right: max(var(--gutter), env(safe-area-inset-right));
  bottom: calc(var(--tab-h) + 1rem + env(safe-area-inset-bottom));
  min-height: 52px;
  padding: 0 1.25rem 0 1rem;
  box-shadow: var(--shadow);
}

/* ---------- Seitenkopf ---------- */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin: 0.5rem 0 1.5rem;
}
.page-head h1 { font-size: var(--t-lg); letter-spacing: -0.03em; }
#page-sub { margin-top: 0.25rem; font-size: var(--t-sm); color: var(--muted); }
.head-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  min-width: 0;
  max-width: 100%;
}
.head-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 0.5rem; min-width: 0; max-width: 100%; }
#status { font-size: var(--t-xs); color: var(--muted); }
#status.bad { color: var(--warn); }
#error {
  background: var(--raised);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  font-size: var(--t-sm);
  color: var(--neg);
  overflow-wrap: anywhere;
  margin-bottom: 1.5rem;
}
#error:empty { display: none; }
#refresh-inline { margin-bottom: 1rem; }
.seg {
  display: inline-flex;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl);
  padding: 2px;
}
.seg button {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0 0.875rem;
  border-radius: 6px;
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.search-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin-bottom: 1.5rem; }
.search-wrap input { flex: 1 1 16rem; }
#search-count { font-size: var(--t-xs); color: var(--muted); }

/* ---------- Abschnitte ---------- */
.dashboard { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 3rem 4.5rem; }
.main-col { flex: 7 1 26rem; min-width: 0; }
.side-col { flex: 5 1 20rem; min-width: 0; }
.panel { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line-strong); min-width: 0; }
.side-col > .panel:first-child { margin-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.5rem; }
.section-head h2 { font-size: var(--t-md); letter-spacing: -0.02em; min-width: 0; overflow-wrap: anywhere; }
.section-count { font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.empty { padding-block: 1rem 0.5rem; font-size: var(--t-sm); color: var(--muted); }
.list-links { display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin-top: 0.5rem; }

/* ---------- Tagesstand ---------- */
.hero { padding-top: 0.5rem; }
.hero-label { font-size: var(--t-sm); color: var(--muted); }
.hero-amount {
  font-size: var(--t-hero);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  margin: 0.375rem 0 0 -0.04em;
  font-variant-numeric: tabular-nums;
}
.hero-note { margin-top: 0.75rem; font-size: var(--t-sm); color: var(--muted); }
.space-bar { display: flex; gap: 2px; height: 16px; margin-top: 1.75rem; }
.seg-part { flex: 0 1 var(--fill, 0%); min-width: 3px; transition: flex-basis 400ms var(--ease); }
.seg-part[data-fill="0"] { display: none; }
.is-done { background: var(--text); }
.is-open { background: var(--signal); }
.is-late { background: var(--neg); }
.is-undated { background: var(--seg-reserve); }
.space-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.25rem 1.5rem; margin-top: 0.75rem; }
.legend-item { display: block; min-height: 44px; padding: 0.25rem 0; border-radius: 4px; }
.legend-item span { display: flex; align-items: center; gap: 0.5rem; font-size: var(--t-xs); color: var(--muted); }
.legend-item i { width: 10px; height: 10px; flex-shrink: 0; }
.legend-item b { display: block; margin-left: calc(10px + 0.5rem); font-size: var(--t-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
.legend-item[aria-pressed="true"] b { text-decoration: underline; text-underline-offset: 3px; }
.legend-item[aria-pressed="true"] span { color: var(--text); }

/* ---------- Aufgabenzeilen ---------- */
.card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 64px;
  padding-block: 0.5rem;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.quick-done {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  margin-left: -10px;
  border-radius: 50%;
  color: transparent;
  font-size: 0.8125rem;
  font-weight: 700;
  text-align: center;
  line-height: 1;
  z-index: 0;
}
.quick-done::before {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  z-index: -1;
}
.quick-done[aria-pressed="true"] { color: var(--bg); }
.quick-done[aria-pressed="true"]::before { background: var(--text); border-color: var(--text); }
@media (hover: hover) and (pointer: fine) {
  .quick-done:hover:not(:disabled)::before { border-color: var(--text); }
}
.row-main { flex: 1; min-width: 0; }
.row-open { display: block; width: 100%; min-height: 0; }
.title { display: block; font-weight: 500; overflow-wrap: anywhere; line-height: 1.3; }
.meta { display: block; margin-top: 0.125rem; font-size: var(--t-xs); color: var(--muted); overflow-wrap: anywhere; }
.meta.late { color: var(--warn); }
.card.done .title { color: var(--muted); text-decoration: line-through; }
.row-side { flex-shrink: 0; text-align: right; max-width: 40%; }
.row-side b { display: block; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.3; }
.row-side span { display: block; margin-top: 0.125rem; font-size: var(--t-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tags { display: flex; flex-wrap: wrap; gap: 0.25rem 0.625rem; margin-top: 0.25rem; }
.tag { display: inline-flex; align-items: center; gap: 0.375rem; font-size: var(--t-xs); color: var(--muted); overflow-wrap: anywhere; }
.tag-dot, .swatch { width: 10px; height: 10px; flex-shrink: 0; background: var(--c, var(--muted)); }
.tag-remove { min-height: 32px; width: 32px; text-align: center; border-radius: 50%; }

/* ---------- Boards in der Übersicht ---------- */
.rank-row { display: block; width: 100%; padding-block: 0.625rem; border-radius: 4px; }
.rank-top { display: flex; justify-content: space-between; gap: 1rem; font-size: var(--t-sm); }
.rank-top span { min-width: 0; overflow-wrap: anywhere; }
.rank-top b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-track { display: block; height: 4px; margin-top: 0.375rem; background: var(--line); }
.rank-bar { display: block; height: 100%; width: var(--fill, 0%); background: var(--text); }
label:has(+ [hidden]) { display: none; }

/* ---------- Board ---------- */
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 2.25rem; align-items: start; }
.column { padding-top: 1rem; border-top: 1px solid var(--line-strong); min-width: 0; }
.bucket-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem; }
.bucket-header h2 { flex: 1; min-width: 0; font-size: var(--t-md); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.column > .text-btn { margin-top: 0.5rem; }
.mobile-buckets, #edit-mobile-bucket { display: none; }
.column.drag-over { border-top-color: var(--signal); }

/* ---------- Kalender ---------- */
.calendar-month-controls { display: flex; align-items: center; gap: 0.25rem; margin-bottom: 1rem; }
.calendar-month-controls strong { font-size: var(--t-md); letter-spacing: -0.02em; margin-right: auto; text-transform: capitalize; }
.grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); }
.weekday { padding: 0.5rem; font-size: var(--t-xs); font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
.day { min-width: 0; min-height: 7.5rem; padding: 0.375rem; border-bottom: 1px solid var(--line); cursor: pointer; }
.day + .day { border-left: 1px solid var(--line); }
.day:nth-child(7n + 1) { border-left: 0; }
.day-num {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  font-size: var(--t-xs);
  font-variant-numeric: tabular-nums;
}
.day.other .day-num { color: var(--muted); opacity: 0.6; }
.day.today .day-num { background: var(--text); color: var(--bg); font-weight: 700; }
.event {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.25rem;
  padding: 0.125rem 0.25rem;
  background: var(--raised);
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  min-width: 0;
}
.event .title { flex: 1; min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event.overdue .title { color: var(--warn); }
.event.done .title { color: var(--muted); text-decoration: line-through; }
.event .quick-done { width: 24px; height: 24px; min-height: 24px; margin: 0; font-size: 0.625rem; }
.event .quick-done::before { inset: 4px; }
.mobile-calendar-list { display: none; }
.mobile-date-controls { display: flex; align-items: center; gap: 0.25rem; }
.mobile-date-controls input { flex: 1; }
.calendar-list-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.mobile-calendar-list h2 { font-size: var(--t-md); letter-spacing: -0.02em; margin: 1.5rem 0 0.5rem; }

/* ---------- Bottom-Sheet / Dialog ---------- */
dialog {
  position: fixed;
  inset: auto 0 var(--kb, 0px) 0;
  width: min(100%, 34rem);
  max-width: 100%;
  max-height: calc(min(92dvh, var(--vvh, 100dvh)) - env(safe-area-inset-top) - 0.5rem);
  margin: 0 auto;
  padding: 1rem max(var(--gutter), env(safe-area-inset-right)) max(1.5rem, env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  border: 0;
  border-radius: 14px 14px 0 0;
  background: var(--raised);
  color: var(--text);
  box-shadow: var(--shadow);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
dialog[open] { animation: sheet-in 240ms var(--ease); }
@keyframes sheet-in { from { translate: 0 24px; opacity: 0; } }
dialog::backdrop { background: var(--overlay); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.sheet-head h2 { font-size: var(--t-md); letter-spacing: -0.02em; min-width: 0; overflow-wrap: anywhere; }
.sheet-head h2:focus { outline: none; }
.sheet-close {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--raised-2);
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  text-align: center;
}
.form-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.form-actions .primary { flex: 1 1 6rem; }
#dialog { padding-bottom: 0; }
#dialog .form-actions {
  position: sticky;
  bottom: 0;
  margin-inline: calc(-1 * var(--gutter));
  padding: 0.75rem var(--gutter) max(0.75rem, env(safe-area-inset-bottom));
  background: var(--raised);
  border-top: 1px solid var(--line);
}
#delete { margin-left: auto; }
.task-extra { margin-top: 0.75rem; border-top: 1px solid var(--line); padding-top: 0.25rem; }
summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
  font-size: var(--t-sm);
  font-weight: 600;
}
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; width: 1ch; color: var(--muted); }
details[open] > summary::before { content: "−"; }
.extra-preview { margin-left: auto; font-size: var(--t-xs); font-weight: 400; color: var(--muted); text-align: right; overflow-wrap: anywhere; }
details[open] > summary .extra-preview { display: none; }
.duration-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.duration-unit { position: relative; min-width: 0; }
.duration-unit input { padding-right: 2.5rem; }
.duration-unit span { position: absolute; right: 0.625rem; top: 50%; translate: 0 -50%; font-size: var(--t-xs); color: var(--muted); pointer-events: none; }
.duration-presets { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.5rem; }
.duration-presets button { padding: 0 0.625rem; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); font-size: var(--t-xs); font-weight: 600; }
.check-item, .checklist-add, .tag-editor { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.check-item input[type="text"], .checklist-add input, .tag-editor input:not([type="color"]) { flex: 1; width: 0; }
.check-item input.checked-text { text-decoration: line-through; color: var(--muted); }
.check-item button { width: 44px; flex-shrink: 0; text-align: center; color: var(--muted); }
.settings-list { display: grid; gap: 0.5rem; margin-top: 1.25rem; }
.settings-list button { width: 100%; }
#account-label { font-size: var(--t-xs); color: var(--muted); overflow-wrap: anywhere; margin-top: 1.25rem; }
.menu-date-row { display: flex; gap: 0.5rem; }
.menu-date-row input { flex: 1; width: 0; }
.task-action-list { display: grid; gap: 0.5rem; margin-top: 0.75rem; }
.feed-board { display: flex; align-items: center; gap: 0.75rem; min-height: 44px; margin: 0; font-size: var(--t-sm); font-weight: 400; }
#task-form-status:empty { display: none; }
#task-form-status { font-size: var(--t-sm); color: var(--neg); overflow-wrap: anywhere; }

/* ---------- Handy ---------- */
@media (max-width: 700px) {
  .head-side { align-items: flex-start; width: 100%; }
  .head-tools { justify-content: flex-start; width: 100%; }
  .head-tools .seg { display: flex; width: 100%; }
  .head-tools .seg button { flex: 1 0 auto; text-align: center; }
  .calendar-overview .event .quick-done { display: none; }
  .row-side { display: none; }
  .column.mobile-hidden { display: none; }
  .column { border-top: 0; padding-top: 0; }
  .column .bucket-header { display: none; }
  .mobile-buckets {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .mobile-buckets button { flex-shrink: 0; font-size: var(--t-sm); color: var(--muted); white-space: nowrap; }
  .mobile-buckets button[aria-pressed="true"] { color: var(--text); font-weight: 700; box-shadow: inset 0 -2px 0 var(--signal); }
  .board-only-wide { display: none !important; }
  #edit-mobile-bucket { display: inline-flex; }
  .calendar-overview { display: none; }
  .calendar-overview.month-open { display: block; overflow-x: auto; margin-bottom: 1rem; }
  .calendar-overview .grid { min-width: 34rem; }
  .mobile-calendar-list { display: block; }
}
@media (min-width: 701px) {
  .only-small { display: none; }
}

/* ---------- Tablet ---------- */
@media (min-width: 640px) {
  :root { --gutter: 2rem; }
  #login-panel { padding-top: 12vh; }
  #login-panel h1 { font-size: 2.75rem; }
  .space-legend { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Desktop: Navigation in die Kopfzeile ---------- */
@media (min-width: 960px) {
  body > header { border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; background: var(--bg); }
  .tabs {
    position: static;
    display: flex;
    gap: 0.25rem;
    margin-right: auto;
    margin-left: 1.5rem;
    padding: 0;
    border: 0;
    background: none;
  }
  .tab { flex-direction: row; min-height: 44px; padding: 0 0.75rem; font-size: var(--t-sm); border-radius: var(--r-ctl); }
  .tab svg, #settings-tab { display: none; }
  .tab[aria-current="page"]::before { top: auto; bottom: -0.8125rem; left: 0.75rem; right: 0.75rem; }
  #settings-open { display: inline-flex; }
  #new { position: static; min-height: 44px; margin-left: 0.5rem; box-shadow: none; }
  .shell { padding-top: 2.5rem; padding-bottom: 5rem; }
  .page-head { margin-bottom: 2.5rem; }
  .page-head h1 { font-size: var(--t-xl); }
  dialog { inset: calc(var(--vvh, 100dvh) / 2) 0 auto 0; translate: 0 -50%; border-radius: 14px; padding: 1rem 2rem 2rem; }
  #dialog { padding-bottom: 0; }
  @keyframes sheet-in { from { translate: 0 calc(-50% + 16px); opacity: 0; } }
}
@media (hover: hover) and (pointer: fine) and (min-width: 960px) {
  .tab:hover { color: var(--text); }
}

/* ---------- Barrierefreiheit ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .btn, dialog, .seg { border: 1px solid CanvasText; }
  .seg-part, .legend-item i, .rank-bar, .tag-dot, .swatch, .tab[aria-current="page"]::before { forced-color-adjust: none; }
}
