/* Fokus-Wochenplaner – ohne externe Schriften oder Ressourcen. */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eceef2;
  --text: #1b1d21;
  --muted: #4f5561;
  --border: #c9ced6;
  --accent: #1d5bbf;
  --accent-hover: #174a9c;
  --accent-text: #ffffff;
  --focus: #1d5bbf;
  --today-bg: #e8f0fd;
  --danger-text: #a8231b;
  --fill-green: #2e8b46;
  --fill-yellow: #d9a400;
  --fill-red: #d1352b;
  --fill-grey: #9aa0a8;
  --prio-1: #d1352b;
  --prio-2: #d9a400;
  --prio-3: #8a9099;
  --badge-overdue-bg: #fde3e1;
  --badge-overdue-text: #8a1c15;
  --badge-today-bg: #fff2cc;
  --badge-today-text: #5c4300;
  --badge-bg: #e6e9ee;
  --badge-text: #3c414a;
  --shadow: 0 1px 2px rgb(0 0 0 / 8%), 0 2px 8px rgb(0 0 0 / 6%);
  --radius: 8px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171b;
    --surface: #1f2228;
    --surface-2: #2a2e36;
    --text: #e9ebee;
    --muted: #aeb4be;
    --border: #3d434d;
    --accent: #7fb0ff;
    --accent-hover: #a3c6ff;
    --accent-text: #0d1726;
    --focus: #8fbaff;
    --today-bg: #1d2a40;
    --danger-text: #ff9d94;
    --fill-green: #3fae5c;
    --fill-yellow: #e7b521;
    --fill-red: #f0584d;
    --fill-grey: #6b717b;
    --badge-overdue-bg: #4a1f1c;
    --badge-overdue-text: #ffc4be;
    --badge-today-bg: #463a12;
    --badge-today-text: #ffe39a;
    --badge-bg: #333842;
    --badge-text: #d5d9df;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #15171b;
  --surface: #1f2228;
  --surface-2: #2a2e36;
  --text: #e9ebee;
  --muted: #aeb4be;
  --border: #3d434d;
  --accent: #7fb0ff;
  --accent-hover: #a3c6ff;
  --accent-text: #0d1726;
  --focus: #8fbaff;
  --today-bg: #1d2a40;
  --danger-text: #ff9d94;
  --fill-green: #3fae5c;
  --fill-yellow: #e7b521;
  --fill-red: #f0584d;
  --fill-grey: #6b717b;
  --badge-overdue-bg: #4a1f1c;
  --badge-overdue-text: #ffc4be;
  --badge-today-bg: #463a12;
  --badge-today-text: #ffe39a;
  --badge-bg: #333842;
  --badge-text: #d5d9df;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
}

h1, h2, h3 { margin: 0; font-weight: 600; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 8px; top: -40px; z-index: 100;
  background: var(--accent); color: var(--accent-text); padding: 6px 10px; border-radius: 4px;
}
.skip-link:focus { top: 8px; }

/* --- Knöpfe und Felder --------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 34px; padding: 4px 12px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--danger-text); }
.btn-small { min-height: 28px; padding: 2px 8px; }
.icon-btn { min-width: 34px; padding: 4px 8px; }

.input {
  width: 100%; min-height: 34px; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text);
}
.input::placeholder { color: var(--muted); opacity: 1; }
.input[aria-invalid="true"] { border-color: var(--danger-text); }
textarea.input { resize: vertical; }
.input-short { width: 8em; }

/* --- Kopfzeile ----------------------------------------------------------- */

.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.app-title { font-size: 1.15rem; }
.week-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.week-label { font-size: 1rem; min-width: 15em; text-align: center; }
.date-pick input { min-height: 34px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); }

/* --- Layout -------------------------------------------------------------- */

.layout {
  display: grid;
  grid-template-columns: 30% minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  align-items: start;
}

.backlog, .day {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.backlog { padding: 12px; position: sticky; top: 12px; max-height: calc(100vh - 24px); display: flex; flex-direction: column; gap: 10px; }
.backlog-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.backlog-head h2 { font-size: 1.05rem; }
.count { color: var(--muted); font-weight: 400; }
.backlog-tools { display: flex; gap: 8px; align-items: center; }
.search { flex: 1; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; flex: none; }
.seg { border: 0; background: var(--surface); padding: 6px 10px; cursor: pointer; min-height: 32px; }
.seg + .seg { border-left: 1px solid var(--border); }
.seg.active { background: var(--accent); color: var(--accent-text); }
.backlog-list { overflow-y: auto; min-height: 120px; flex: 1; }

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }

.day { display: flex; flex-direction: column; min-height: 240px; padding: 8px; gap: 8px; }
.day.today { border-color: var(--accent); background: var(--today-bg); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.day.past .day-label { color: var(--muted); }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.day-head h3 { font-size: 0.95rem; }
.day-toggle { display: none; }
.today-tag {
  margin-left: 6px; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
  background: var(--accent); color: var(--accent-text); border-radius: 4px; padding: 1px 5px; vertical-align: middle;
}
.cap-btn {
  border: 1px solid transparent; background: transparent; border-radius: 6px; cursor: pointer;
  min-height: 28px; min-width: 28px; color: var(--muted);
}
.cap-btn:hover { border-color: var(--border); color: var(--text); }
.day-body { display: flex; flex-direction: column; flex: 1; gap: 6px; }
.day-foot { margin: 0; font-size: 0.85rem; color: var(--muted); }
.day-foot.over { color: var(--danger-text); font-weight: 600; }

/* --- Kapazitätsbalken ---------------------------------------------------- */

.meter-track { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.meter-fill { height: 100%; width: 0; transition: width 0.2s ease; }
.meter-green .meter-fill { background: var(--fill-green); }
.meter-yellow .meter-fill { background: var(--fill-yellow); }
.meter-red .meter-fill { background: var(--fill-red); }
.meter-grey .meter-fill { background: var(--fill-grey); }
.meter-text { font-size: 0.8rem; color: var(--muted); margin-top: 3px; }
.meter-red .meter-text { color: var(--danger-text); font-weight: 600; }
.override { font-style: italic; }

/* --- Aufgaben ------------------------------------------------------------ */

.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-height: 48px; border-radius: 6px; }
.task-list.drop-target { outline: 2px dashed var(--accent); outline-offset: 2px; }
.task-list .empty { color: var(--muted); font-size: 0.85rem; padding: 8px 4px; }

.task {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: start; gap: 2px 6px;
  padding: 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
  cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.task:hover { border-color: var(--muted); }
.task:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.task.dragging { opacity: 0.4; }
.task.ghost {
  position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none; opacity: 0.9;
  box-shadow: 0 6px 18px rgb(0 0 0 / 25%);
}

.check {
  width: 22px; height: 22px; margin-top: 1px; padding: 0;
  border: 2px solid var(--muted); border-radius: 50%; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; line-height: 1;
  color: transparent;
}
.check:hover { border-color: var(--accent); color: var(--muted); }
.task.done .check { background: var(--fill-green); border-color: var(--fill-green); color: #fff; }

.task-main { display: contents; }
.check { grid-column: 1; grid-row: 2; }
.task-title {
  grid-column: 1 / 4; grid-row: 1;
  display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer;
  font-weight: 500; overflow-wrap: break-word; hyphens: auto; min-width: 0;
}
.task-meta { grid-column: 2; grid-row: 2; align-self: center; }
.menu-btn { grid-column: 3; grid-row: 2; align-self: end; }
.task-title:hover { text-decoration: underline; }
.task.done .task-title { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.task.done .task-meta { color: var(--muted); }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 0.78rem; color: var(--muted); }

.prio { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.prio-1 { background: var(--prio-1); }
.prio-2 { background: var(--prio-2); }
.prio-3 { background: var(--prio-3); }

.badge { border-radius: 4px; padding: 0 5px; background: var(--badge-bg); color: var(--badge-text); font-weight: 500; }
.badge-overdue { background: var(--badge-overdue-bg); color: var(--badge-overdue-text); }
.badge-today { background: var(--badge-today-bg); color: var(--badge-today-text); }

.menu-btn {
  flex: none; border: 1px solid transparent; background: transparent; border-radius: 4px;
  min-width: 26px; min-height: 26px; padding: 0 4px; cursor: pointer; color: var(--muted); font-weight: 700;
}
.menu-btn:hover { border-color: var(--border); color: var(--text); }

.drop-indicator { height: 3px; border-radius: 2px; background: var(--accent); list-style: none; }

/* --- Skeleton und Fehler -------------------------------------------------- */

.skeleton .sk { border-radius: 4px; background: var(--surface-2); animation: pulse 1.2s ease-in-out infinite; }
.sk-title { height: 16px; width: 60%; }
.sk-bar { height: 8px; }
.sk-card { height: 40px; }
@keyframes pulse { 50% { opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) {
  .skeleton .sk { animation: none; }
  .meter-fill { transition: none; }
}
.week-error {
  grid-column: 1 / -1; padding: 24px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}

/* --- Menü ---------------------------------------------------------------- */

.menu {
  position: fixed; z-index: 150; min-width: 210px; padding: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 20%); display: flex; flex-direction: column;
}
.menu[hidden] { display: none; }
.menu button {
  text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 4px; cursor: pointer;
}
.menu button:hover, .menu button:focus-visible { background: var(--surface-2); }
.menu button[hidden] { display: none; }
.menu .danger { color: var(--danger-text); }

/* --- Dialoge ------------------------------------------------------------- */

.dialog {
  width: min(560px, calc(100vw - 24px)); padding: 0; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); box-shadow: 0 12px 40px rgb(0 0 0 / 30%);
}
.dialog-small { width: min(380px, calc(100vw - 24px)); }
.dialog::backdrop { background: rgb(0 0 0 / 45%); }
.dialog form { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.dialog h2 { font-size: 1.1rem; }
.field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.field label { font-weight: 500; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row .field { min-width: 180px; }
.field-error { margin: 0; color: var(--danger-text); font-size: 0.85rem; min-height: 0; }
.field-error:empty { display: none; }
.hint { margin: 0; color: var(--muted); font-size: 0.8rem; }
.stepper { display: flex; gap: 4px; }
.stepper .input { text-align: center; }
.dialog-actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.dialog-actions .spacer { flex: 1; }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 0; }
legend { font-weight: 600; padding: 0 4px; }
.cap-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; }
.radio-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.radio-row input { accent-color: var(--accent); }

/* --- Toasts -------------------------------------------------------------- */

.toasts {
  position: fixed; right: 16px; bottom: 16px; z-index: 300;
  display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px));
}
.toast {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-left: 5px solid var(--fill-green); border-radius: 8px; box-shadow: 0 6px 20px rgb(0 0 0 / 20%);
}
.toast-text { flex: 1; }
.toast-error { border-left-color: var(--fill-red); }
.toast-warning { border-left-color: var(--fill-yellow); }
.toast-delete { border-left-color: var(--fill-grey); }
.toast-close { border: 0; background: none; cursor: pointer; font-size: 1.2rem; line-height: 1; padding: 2px 6px; color: var(--muted); }

/* --- Anmeldung ----------------------------------------------------------- */

.inline-form { display: inline; margin: 0; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card {
  width: min(360px, 100%); padding: 24px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
}
.login-form { display: flex; flex-direction: column; gap: 8px; }
.login-form label { font-weight: 500; }
.login-card code { background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }

/* --- Responsiv ----------------------------------------------------------- */

@media (max-width: 1099px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .backlog { position: static; max-height: none; }
  .backlog-list { max-height: 40vh; }
  .week { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
}

@media (max-width: 699px) {
  .topbar { padding: 8px 12px; }
  .topbar-right { margin-left: 0; width: 100%; justify-content: space-between; }
  .week-label { min-width: 0; flex: 1 1 100%; order: -1; text-align: left; }
  .layout { padding: 12px; gap: 12px; }
  .week { grid-template-columns: minmax(0, 1fr); }
  .day { min-height: 0; }
  .day-label { display: none; }
  .day-toggle {
    display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 4px 0; cursor: pointer; font-weight: 600;
  }
  .day-toggle::before { content: "▸"; display: inline-block; width: 1em; }
  .day-toggle[aria-expanded="true"]::before { content: "▾"; }
  .day:not(.open) .day-body { display: none; }
  .backlog-tools { flex-wrap: wrap; }
}

/* --- Web-Version: Umschalter zwischen Trainingstagebuch und Planer ------- */

.appswitch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.appswitch a {
  padding: 5px 14px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.95rem;
}
.appswitch a:hover { background: var(--surface-2); }
.appswitch a[aria-current="page"] { background: var(--accent); color: var(--accent-text); }
.demo-banner { background: #fff2cc; color: #5c4300; padding: 6px 16px; font-size: 0.9rem; }
.file-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }

/* =====================================================================
   Feinschliff: gleiche Palette und Formen wie das Trainingstagebuch.
   ===================================================================== */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #15181d;
  --muted: #5a6270;
  --border: #e2e5ea;
  --accent: #2453c7;
  --accent-hover: #1f47ad;
  --accent-text: #ffffff;
  --accent-soft: #ebf0fc;
  --focus: #2453c7;
  --today-bg: #f4f7fe;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .04);
  --shadow-pop: 0 8px 28px rgba(16, 24, 40, .14);
  --radius: 16px;
  --banner-bg: #fff4e0;
  --banner-text: #6b3d00;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1116;
    --surface: #161a21;
    --surface-2: #1e232c;
    --text: #e8ebf0;
    --muted: #9aa3b0;
    --border: #272d37;
    --accent: #7ea6ff;
    --accent-hover: #9bbaff;
    --accent-text: #0b1220;
    --accent-soft: #1b2540;
    --focus: #7ea6ff;
    --today-bg: #151d2e;
    --shadow: none;
    --shadow-pop: 0 10px 32px rgba(0, 0, 0, .5);
    --banner-bg: #3a2a10;
    --banner-text: #ffd99a;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1116;
  --surface: #161a21;
  --surface-2: #1e232c;
  --text: #e8ebf0;
  --muted: #9aa3b0;
  --border: #272d37;
  --accent: #7ea6ff;
  --accent-hover: #9bbaff;
  --accent-text: #0b1220;
  --accent-soft: #1b2540;
  --focus: #7ea6ff;
  --today-bg: #151d2e;
  --shadow: none;
  --shadow-pop: 0 10px 32px rgba(0, 0, 0, .5);
  --banner-bg: #3a2a10;
  --banner-text: #ffd99a;
}

body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* Kopfzeile */
.topbar {
  position: sticky; top: 0; z-index: 50; min-height: 60px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(12px); backdrop-filter: saturate(1.6) blur(12px);
}
.week-label { font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.appswitch { padding: 3px; gap: 2px; background: var(--surface-2); }
.appswitch a { padding: 4px 14px; border-radius: 999px; color: var(--muted); font-size: .9rem; transition: background .15s, color .15s; }
.appswitch a:hover { background: transparent; color: var(--text); }
.appswitch a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, .1), 0 0 0 1px var(--border); }
.demo-banner { background: var(--banner-bg); color: var(--banner-text); font-weight: 500; }

/* Knöpfe und Felder */
.btn {
  border-radius: 10px; font-weight: 500; box-shadow: 0 1px 1px rgba(16, 24, 40, .04);
  transition: background .15s, border-color .15s, transform .06s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { font-weight: 600; box-shadow: 0 1px 2px rgba(36, 83, 199, .25); }
.input { border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
.input:hover { border-color: color-mix(in srgb, var(--muted) 45%, var(--border)); }
.input:focus-visible, .date-pick input:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.date-pick input { border-radius: 10px; }
.segmented { padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-2); }
.seg { border-radius: 7px; background: transparent; color: var(--muted); min-height: 28px; transition: background .15s, color .15s; }
.seg + .seg { border-left: 0; }
.seg:hover { color: var(--text); }
.seg.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, .1), 0 0 0 1px var(--border); }

/* Spalten */
.layout { grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); gap: 20px; padding: 20px; }
.backlog { padding: 16px; gap: 12px; top: 80px; max-height: calc(100vh - 100px); }
.backlog-head h2 { font-size: 1.05rem; letter-spacing: -.01em; }
.week { gap: 10px; }
.day { padding: 10px; gap: 10px; }
.day.today { background: var(--today-bg); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.day-head h3 { font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.today-tag { border-radius: 999px; padding: 1px 7px; font-size: .68rem; }
.cap-btn { border-radius: 8px; transition: background .15s, color .15s; }
.cap-btn:hover { background: var(--surface-2); border-color: transparent; }
.day-foot { font-variant-numeric: tabular-nums; }

/* Kapazitätsbalken */
.meter-track { height: 6px; border: 0; border-radius: 999px; }
.meter-fill { border-radius: 999px; transition: width .3s ease; }
.meter-text { font-variant-numeric: tabular-nums; }

/* Aufgaben */
.task {
  padding: 8px 8px 6px 10px; border-radius: 10px; border-color: var(--border); box-shadow: 0 1px 1px rgba(16, 24, 40, .04);
  transition: border-color .15s, box-shadow .15s;
}
.task:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); box-shadow: 0 2px 8px rgba(16, 24, 40, .06); }
.task-title { font-weight: 550; line-height: 1.3; }
.task-title:hover { text-decoration: none; color: var(--accent); }
.task.done { background: transparent; box-shadow: none; }
.check { border-width: 1.5px; border-color: color-mix(in srgb, var(--muted) 60%, transparent); transition: border-color .15s, background .15s; }
.badge { border-radius: 999px; padding: 0 7px; }
.menu-btn { border-radius: 8px; }
.menu-btn:hover { background: var(--surface-2); border-color: transparent; }
.task-list.drop-target { outline-color: color-mix(in srgb, var(--accent) 60%, transparent); border-radius: 10px; }

/* Menü, Dialoge, Hinweise */
.menu { border-radius: 12px; padding: 6px; box-shadow: var(--shadow-pop); }
.menu button { border-radius: 8px; }
.dialog { border-radius: 18px; box-shadow: var(--shadow-pop); }
.dialog::backdrop { background: rgb(10 14 20 / 40%); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.dialog form { padding: 22px; gap: 14px; }
.dialog h2 { font-size: 1.15rem; letter-spacing: -.01em; }
fieldset { border-radius: 12px; border-color: var(--border); }
.toast { border-radius: 12px; border-left-width: 4px; box-shadow: var(--shadow-pop); }

@media (max-width: 1099px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .backlog { top: auto; }
}
@media (max-width: 699px) {
  .layout { padding: 12px; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .input, .seg, .task, .appswitch a, .meter-fill { transition: none; }
}

/* Mittlere Breiten: Backlog oben, Woche über die volle Breite (sonst zu schmale Spalten) */
.task-title { hyphens: manual; overflow-wrap: break-word; }
@media (max-width: 1359px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .backlog { position: static; max-height: none; }
  .backlog-list { max-height: 32vh; }
}
@media (min-width: 980px) and (max-width: 1359px) {
  .week { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
@media (max-width: 699px) {
  .topbar { gap: 10px 12px; }
  .topbar-right { gap: 8px; }
  .switch span { white-space: nowrap; }
}
