/* Lagerplaner – BdP corporate design (cd-2026), adapted from pfadfinden/bdp_template theme.css */

:root {
  /* Primary */
  --pfadiblau: #0e4278;
  --woelflingsgelb: #ffd208;
  --rr-rot: #971b2f;
  /* Secondary */
  --blau-hell: #a9bbce;
  --kluft: #0b2341;
  --gelb-hell: #ffe894;
  --gelb-dunkel: #8b7417;
  --rot-hell: #d5a4ac;
  --rot-dunkel: #52111b;
  /* Accent (icons, lines, category colours) */
  --kohte: #222423;
  --lagerplatzgruen: #009d3c;
  --waldgruen: #006c54;
  --glut: #e84e1b;
  --lagerfeuerorange: #ef7d00;
  --morgenkreis: #ef859d;
  --internationalerabend: #8a5ea3;
  --singekreislila: #a693c6;

  --bg: #ffffff;
  --bg-soft: #f4f6f9;
  --line: #d9e0e8;
  --text: var(--pfadiblau);
  --text-muted: #4d6a8c;

  --font: "Jost", -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Ubuntu,
    "Helvetica Neue", sans-serif;
  --radius: 4px;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --content-width: 72rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font);
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  line-height: 1.5;
}

h1,
h2,
h3 {
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 var(--space-3);
}

h1 {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
}

h2 {
  font-size: 1.4rem;
}

h3 {
  font-size: 1.1rem;
}

a {
  color: var(--pfadiblau);
}

a:hover,
a:focus-visible {
  color: var(--kluft);
}

:focus-visible {
  outline: 2px solid var(--kluft);
  outline-offset: 2px;
}

.shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* --- Header ------------------------------------------------------------------------- */

.meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 1.9rem;
  padding: 0 var(--space-4);
  background: var(--pfadiblau);
  color: var(--woelflingsgelb);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.meta-bar nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.meta-bar a,
.meta-bar button {
  color: inherit;
  background: none;
  border: 0;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  text-decoration: none;
  padding: var(--space-1) var(--space-2);
  cursor: pointer;
}

.meta-bar a:hover,
.meta-bar button:hover {
  background: var(--kluft);
}

.meta-bar form {
  margin: 0;
}

.main-bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.35rem;
}

/* The Kohte opening as a small brand mark. */
.brand-mark {
  width: 1.6rem;
  height: 1.4rem;
  background: var(--woelflingsgelb);
  clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%);
}

.user-name {
  margin-left: auto;
  color: var(--text-muted);
}

.switcher > summary {
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 600;
}

.switcher > summary::after {
  content: " ▾";
}

/* --- Content ------------------------------------------------------------------------ */

.content {
  flex: 1;
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-6) var(--space-4) var(--space-8);
}

.event-header {
  position: relative;
  margin: calc(-1 * var(--space-6)) calc(-1 * var(--space-4)) var(--space-6);
  padding: var(--space-6) var(--space-4) 0;
  overflow: hidden;
}

/* One Kohte cut-out at the right edge of the event header. */
.event-header::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: min(22vw, 11rem);
  height: 100%;
  background: var(--woelflingsgelb);
  clip-path: polygon(45% 0, 100% 0, 100% 100%, 0 100%, 30% 55%);
  z-index: -1;
}

.event-meta {
  color: var(--text-muted);
  margin: 0 0 var(--space-4);
}

.event-meta strong {
  color: var(--text);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  border-bottom: 2px solid var(--pfadiblau);
}

.tabs a {
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
  font-weight: 600;
}

.tabs a[aria-current="page"] {
  background: var(--pfadiblau);
  color: var(--woelflingsgelb);
}

.card-list {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  padding: 0;
  list-style: none;
}

.card {
  display: block;
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-left: 6px solid var(--woelflingsgelb);
  border-radius: var(--radius);
  text-decoration: none;
  background: var(--bg);
}

.card:hover {
  border-left-color: var(--pfadiblau);
}

.card h3 {
  margin-bottom: var(--space-1);
}

.card.is-past {
  border-left-color: var(--blau-hell);
  opacity: 0.8;
}

.muted {
  color: var(--text-muted);
}

.badge {
  display: inline-block;
  padding: 0 var(--space-2);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  vertical-align: middle;
}

.badge.head {
  background: var(--woelflingsgelb);
  border-color: var(--woelflingsgelb);
  color: var(--kluft);
}

/* --- Tables & forms ----------------------------------------------------------------- */

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.table th {
  font-weight: 700;
  background: var(--bg-soft);
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
}

.stack {
  display: grid;
  gap: var(--space-4);
  max-width: 32rem;
}

label {
  font-weight: 600;
}

input[type="text"],
input[type="search"],
input[type="date"],
select {
  font: inherit;
  color: inherit;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--blau-hell);
  border-radius: var(--radius);
  background: var(--bg);
  min-height: 2.5rem;
}

.field {
  display: grid;
  gap: var(--space-1);
}

.errorlist {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--rr-rot);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 2.5rem;
  padding: var(--space-2) var(--space-4);
  font: inherit;
  font-weight: 700;
  border: 2px solid var(--pfadiblau);
  border-radius: var(--radius);
  background: var(--pfadiblau);
  color: var(--woelflingsgelb);
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--kluft);
  border-color: var(--kluft);
  color: var(--woelflingsgelb);
}

.btn.secondary {
  background: transparent;
  color: var(--pfadiblau);
}

.btn.secondary:hover {
  background: var(--bg-soft);
}

.btn.danger {
  background: transparent;
  border-color: var(--rr-rot);
  color: var(--rr-rot);
}

.btn.small {
  min-height: 2rem;
  padding: var(--space-1) var(--space-3);
  font-size: 0.875rem;
}

.messages {
  max-width: var(--content-width);
  margin: var(--space-4) auto 0;
  padding: 0 var(--space-4);
  list-style: none;
}

.messages li {
  padding: var(--space-3) var(--space-4);
  border-left: 6px solid var(--lagerplatzgruen);
  background: var(--bg-soft);
  margin-bottom: var(--space-2);
}

.messages li.error {
  border-left-color: var(--rr-rot);
}

.panel {
  padding: var(--space-4);
  margin: var(--space-6) 0;
  background: var(--bg-soft);
  border-radius: var(--radius);
}

/* Hand-drawn style underline for section headlines (CD "Linien"). */
.underlined {
  display: inline-block;
  padding-bottom: var(--space-1);
  background: linear-gradient(var(--woelflingsgelb), var(--woelflingsgelb)) bottom left / 100% 4px
    no-repeat;
}

/* --- Login -------------------------------------------------------------------------- */

/* One centred panel at every width: sign-in on the left, a yellow aside with the CD's
   Kohte edge on the right. Phones stack it, aside below. */
.login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - 12rem);
}

.login-panel {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  max-width: 58rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: 0 12px 40px rgb(11 35 65 / 10%);
}

.login-card {
  padding: var(--space-8) var(--space-6);
}

.login-card h1 {
  margin: 0 0 var(--space-3);
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.15;
}

.login-lead {
  margin: 0 0 var(--space-6);
  font-size: 1.1rem;
  color: var(--text-muted);
}

.login-btn {
  padding: var(--space-3) var(--space-6);
  font-size: 1rem;
}

.login-hint {
  margin: var(--space-2) 0 0;
  font-size: 0.85rem;
}

.login-dev {
  margin: var(--space-6) 0 0;
  font-size: 0.9rem;
}

.login-aside {
  padding: var(--space-6);
  background: var(--woelflingsgelb);
  color: var(--pfadiblau);
}

.login-aside h2 {
  margin: 0 0 var(--space-3);
  font-size: 1.2rem;
}

.login-aside ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.login-aside li {
  position: relative;
  padding: var(--space-1) 0 var(--space-1) var(--space-6);
  font-weight: 500;
}

.login-aside li::before {
  content: "✓";
  position: absolute;
  left: 0;
  font-weight: 700;
}

@media (width >= 48rem) {
  .login-panel {
    grid-template-columns: 1.15fr 1fr;
    min-height: 24rem;
  }

  .login-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-8) calc(var(--space-8) * 1.5);
  }

  .login-aside {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-8) var(--space-8) var(--space-8) calc(var(--space-8) * 2.5);
    /* Kohte: the left edge runs diagonally, as in the CD's cut-out shapes. */
    clip-path: polygon(18% 0, 100% 0, 100% 100%, 0 100%);
  }
}

/* --- Footer ------------------------------------------------------------------------- */

.site-footer {
  margin-top: var(--space-8);
}

.footer-band {
  padding: var(--space-8) var(--space-4) var(--space-4);
  background: var(--pfadiblau);
  color: var(--woelflingsgelb);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  clip-path: polygon(0 35%, 30% 0, 100% 20%, 100% 100%, 0 100%);
}

@media print {
  .site-header,
  .site-footer,
  .tabs {
    display: none;
  }
}

/* --- Fonts (Jost, SIL OFL 1.1, see vendor/fonts/JOST-LICENSE.txt) ---------------------- */

@font-face {
  font-family: "Jost";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../../vendor/fonts/jost-latin-ext-wght-normal.7f44f6fd229b.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Jost";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../../vendor/fonts/jost-latin-wght-normal.928f4210aa48.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Jost";
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url("../../vendor/fonts/jost-latin-wght-italic.e5cfc05e59bf.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

.brand img {
  height: 2.5rem;
  width: auto;
}

/* --- Tagesplan --------------------------------------------------------------------- */

.planner {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: minmax(0, 1fr);
}

@media (width >= 64rem) {
  .planner.has-panel {
    grid-template-columns: minmax(0, 1fr) 24rem;
  }
}

.planner-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-3);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  border: 0;
}

.legend label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.legend input {
  margin: 0;
}

.side-panel {
  align-self: start;
  position: sticky;
  top: var(--space-4);
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-top: 6px solid var(--woelflingsgelb);
  border-radius: var(--radius);
  background: var(--bg);
}

.side-panel:empty {
  display: none;
}

.side-panel .field {
  margin-bottom: var(--space-3);
}

.side-panel input[type="text"],
.side-panel select,
.side-panel textarea {
  width: 100%;
}

textarea {
  font: inherit;
  color: inherit;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--blau-hell);
  border-radius: var(--radius);
}

.checkbox-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.checkbox-list label {
  font-weight: 500;
}

.alert {
  padding: var(--space-3);
  border-left: 6px solid var(--rr-rot);
  background: #fbeff1;
  margin-bottom: var(--space-3);
}

.hint {
  padding: var(--space-2) var(--space-3);
  border-left: 6px solid var(--blau-hell);
  background: var(--bg-soft);
}

.conflicts ul {
  margin: 0;
  padding-left: var(--space-4);
}

.history {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-left: var(--space-4);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-3) 0;
}

#tagesplan {
  --ec-border-color: var(--line);
  --ec-today-bg-color: transparent;
  font-size: 0.82rem;
}

#tagesplan .ec-event {
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgb(11 35 65 / 18%);
}

#tagesplan .ec-event.is-dimmed {
  opacity: 0.3;
}

.block-title {
  font-weight: 700;
  line-height: 1.2;
}

.block-meta {
  font-size: 0.75rem;
  opacity: 0.9;
}

.block-warning::before {
  content: "⚠ ";
}

.toast {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  z-index: 50;
  max-width: 24rem;
  padding: var(--space-3) var(--space-4);
  background: var(--kluft);
  color: var(--bg);
  border-left: 6px solid var(--rr-rot);
  border-radius: var(--radius);
}

.day-leads {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}

.day-leads form {
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.category-row {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--line);
}

.category-row input[type="number"] {
  width: 4.5rem;
}

input[type="color"] {
  width: 3rem;
  height: 2.5rem;
  padding: 2px;
  border: 1px solid var(--blau-hell);
  border-radius: var(--radius);
}

/* --- Methodenzettel ----------------------------------------------------------------- */

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  margin: 0 0 var(--space-4);
}

.facts dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.facts dd {
  margin: 0;
  font-weight: 600;
}

.stack.wide {
  max-width: 48rem;
}

.stack textarea {
  width: 100%;
}

.nowrap {
  white-space: nowrap;
}

.mz-table td {
  vertical-align: top;
}

.edit-row td {
  background: var(--bg-soft);
  padding-top: 0;
}

.step-form {
  display: grid;
  gap: var(--space-2) var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  padding: var(--space-3) 0;
}

.step-form .field-content,
.step-form .field-moderation,
.step-form .field-material_items,
.step-form .field-responsible,
.step-form .button-row {
  grid-column: 1 / -1;
}

.step-form textarea,
.step-form input[type="text"],
.step-form input[type="number"],
.step-form select {
  width: 100%;
}

form.inline {
  display: inline;
}

input[type="number"],
input[type="time"] {
  font: inherit;
  color: inherit;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--blau-hell);
  border-radius: var(--radius);
  min-height: 2.5rem;
}

/* --- Kitchen ---------------------------------------------------------------------- */

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  font-weight: 600;
}

.subnav a {
  text-decoration: none;
  padding-bottom: 2px;
}

.subnav a[aria-current="page"] {
  border-bottom: 3px solid var(--woelflingsgelb);
}

.badge.allergen {
  background: var(--rot-hell);
  border-color: var(--rot-hell);
}

.ok::before {
  content: "✓ ";
  color: var(--lagerplatzgruen);
}

.problem {
  color: var(--rr-rot);
  font-weight: 600;
}

.problem::before {
  content: "⚠ ";
}

tr.is-mine td {
  background: #fff8d6;
}

.bar-cell {
  width: 40%;
}

.bar {
  display: inline-block;
  height: 0.8rem;
  background: var(--pfadiblau);
  border-radius: 2px;
}

@media print {
  .no-print,
  .subnav {
    display: none;
  }
}

/* --- Shopping --------------------------------------------------------------------- */

.sources {
  margin: var(--space-1) 0 0;
  padding-left: var(--space-4);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.shopping-table tr.status-bought td,
.shopping-table tr.status-in_stock td {
  color: var(--text-muted);
}

.shopping-table tr.status-bought summary {
  text-decoration: line-through;
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.checklist li {
  border-bottom: 1px solid var(--line);
}

.checklist label {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 3.5rem;
  padding: var(--space-2) 0;
  font-weight: 500;
  font-size: 1.1rem;
  cursor: pointer;
}

.checklist input[type="checkbox"] {
  width: 2rem;
  height: 2rem;
  flex: none;
  accent-color: var(--lagerplatzgruen);
}

.checklist input:checked + span {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* --- Small screens ---------------------------------------------------------------- */

@media (width < 40rem) {
  .meta-bar > span,
  .brand > span,
  .user-name {
    display: none;
  }

  .main-bar {
    gap: var(--space-2);
  }

  .switcher {
    margin-left: auto;
  }

  .switcher summary {
    max-width: 12rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .switcher ul {
    right: 0;
  }

  .content {
    padding-top: var(--space-4);
  }

  .table {
    font-size: 0.9rem;
  }

  .event-header::after {
    width: 4rem;
  }
}

/* --- Meine Sicht ------------------------------------------------------------------ */

.my-section {
  margin-bottom: var(--space-6);
}

.my-list {
  list-style: none;
  margin: 0 0 var(--space-3);
  padding: 0;
}

.my-list li {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--line);
}

.cat-dot {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  margin-right: var(--space-1);
  vertical-align: middle;
}

.due-list li.overdue {
  color: var(--rr-rot);
  font-weight: 600;
}

/* --- Tasks / Gantt ---------------------------------------------------------------- */

.gantt-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: var(--space-4);
  --g-bar-color: var(--blau-hell);
  --g-bar-border: var(--pfadiblau);
  --g-progress-color: var(--pfadiblau);
}

.gantt-wrap .bar-wrapper.status-done .bar {
  fill: #b9dfc6;
}

.gantt-wrap .bar-wrapper.urgency-soon .bar {
  fill: var(--gelb-hell);
  stroke: var(--gelb-dunkel);
}

.gantt-wrap .bar-wrapper.urgency-overdue .bar {
  fill: var(--rot-hell);
  stroke: var(--rr-rot);
}

.gantt-wrap .bar-wrapper.milestone .bar {
  fill: var(--woelflingsgelb);
  stroke: var(--kluft);
}

.legend-inline {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.swatch {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 2px;
  vertical-align: middle;
  margin-left: var(--space-2);
}

.swatch.overdue {
  background: var(--rot-hell);
}

.swatch.soon {
  background: var(--gelb-hell);
}

.swatch.done {
  background: #b9dfc6;
}

tr.urgency-overdue td:first-child {
  color: var(--rr-rot);
  font-weight: 700;
}

/* --- Budget ----------------------------------------------------------------------- */

.table.money td:not(:first-child),
.table.money th:not(:first-child) {
  text-align: right;
  white-space: nowrap;
}

.receipt-layout {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
}

@media (width >= 48rem) {
  .receipt-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.receipt-image img {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.facts.vertical {
  flex-direction: column;
}

.badge.receipt-submitted {
  background: var(--gelb-hell);
}

.badge.receipt-approved {
  background: #b9dfc6;
}

.badge.receipt-rejected {
  background: var(--rot-hell);
}

.badge.receipt-reimbursed {
  background: var(--blau-hell);
}

/* ===================================================================================
   Compact UI building blocks (declutter pass)
   =================================================================================== */

[x-cloak] {
  display: none !important;
}

/* --- ⋮ menu ----------------------------------------------------------------------- */

details.menu,
details.popover {
  position: relative;
  display: inline-block;
}

details.menu > summary,
details.popover > summary {
  list-style: none;
  cursor: pointer;
}

details.menu > summary::-webkit-details-marker,
details.popover > summary::-webkit-details-marker {
  display: none;
}

.icon-btn,
details.menu > summary.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--pfadiblau);
  font: inherit;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.icon-btn:hover,
details[open] > summary.icon-btn {
  background: var(--bg-soft);
  border-color: var(--line);
}

.menu-items {
  position: absolute;
  right: 0;
  z-index: 40;
  min-width: 13rem;
  margin-top: var(--space-1);
  padding: var(--space-1) 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(11 35 65 / 18%);
  text-align: left;
}

.menu-items.left {
  right: auto;
  left: 0;
}

.menu-items a,
.menu-items button {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-4);
  border: 0;
  background: none;
  color: var(--pfadiblau);
  font: inherit;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.menu-items a:hover,
.menu-items button:hover {
  background: var(--bg-soft);
}

.menu-items .danger {
  color: var(--rr-rot);
}

.menu-items hr {
  margin: var(--space-1) 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.menu-items form {
  margin: 0;
}

.menu-label {
  padding: var(--space-1) var(--space-4) 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* --- Toggle chips instead of checkbox grids ---------------------------------------- */

.checkbox-list,
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.checkbox-list li,
.chips li {
  position: relative;
}

.checkbox-list input,
.chips input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.checkbox-list label,
.chips label {
  display: inline-block;
  padding: 2px var(--space-3);
  border: 1px solid var(--blau-hell);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.checkbox-list input:checked + label,
.chips input:checked + label {
  background: var(--pfadiblau);
  border-color: var(--pfadiblau);
  color: var(--woelflingsgelb);
}

.checkbox-list input:focus-visible + label,
.chips input:focus-visible + label {
  outline: 2px solid var(--kluft);
  outline-offset: 2px;
}

/* --- Compact page parts ------------------------------------------------------------ */

.section-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-6) 0 var(--space-2);
}

.section-head h2,
.section-head h3 {
  margin: 0;
}

.section-head .spacer {
  flex: 1;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}

.toolbar .spacer {
  flex: 1;
}

.row-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.edit-row > td {
  background: var(--bg-soft);
}

.inline-edit {
  padding: var(--space-3);
  background: var(--bg-soft);
  border-radius: var(--radius);
  margin: var(--space-2) 0;
}

.grid-form {
  display: grid;
  gap: var(--space-2) var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  align-items: end;
}

.grid-form .wide,
.grid-form .button-row {
  grid-column: 1 / -1;
}

.grid-form input[type="text"],
.grid-form input[type="number"],
.grid-form select,
.grid-form textarea {
  width: 100%;
}

.add-btn {
  border: 1px dashed var(--blau-hell);
  background: transparent;
  color: var(--pfadiblau);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-4);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.add-btn:hover {
  background: var(--bg-soft);
}

.text-block {
  white-space: pre-line;
}

.color-dot {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  vertical-align: middle;
  border: 1px solid rgb(11 35 65 / 20%);
}

.status-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 var(--space-2);
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-soft);
  cursor: pointer;
}

.status-badge.status-needed,
.status-badge.status-to_buy {
  background: var(--gelb-hell);
}

.status-badge.status-bought,
.status-badge.status-packed,
.status-badge.status-have {
  background: #b9dfc6;
}

table td.check {
  width: 2rem;
}

input.big-check {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--lagerplatzgruen);
  cursor: pointer;
}

tr:has(input.big-check:checked) td:not(.check, .row-actions) {
  color: var(--text-muted);
  text-decoration: line-through;
}

/* --- Header: one bar, user menu ---------------------------------------------------- */

.user-menu {
  margin-left: auto;
}

.user-menu > summary {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius);
  font-weight: 600;
}

.user-menu > summary::after {
  content: " ▾";
}

.user-menu > summary:hover {
  background: var(--bg-soft);
}

/* --- Event header: compact --------------------------------------------------------- */

.event-header {
  padding-top: var(--space-4);
}

.event-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-4);
  margin-bottom: var(--space-3);
}

.event-title h1 {
  margin: 0;
  font-size: 1.6rem;
}

.event-title h1 a {
  text-decoration: none;
}

.event-title .event-meta {
  margin: 0;
}

.tabs {
  align-items: center;
  padding-right: min(22vw, 11rem);
}

.tabs details.menu > summary {
  padding: var(--space-2) var(--space-3);
  font-weight: 700;
}

.tabs details.menu.is-current > summary {
  background: var(--pfadiblau);
  color: var(--woelflingsgelb);
}

/* --- Tagesplan --------------------------------------------------------------------- */

.legend label {
  padding: 1px var(--space-2);
  font-size: 0.78rem;
}

.legend input {
  width: 0.8rem;
  height: 0.8rem;
}

.hints-badge > summary {
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  background: #fbeff1;
  color: var(--rr-rot);
  font-weight: 700;
  font-size: 0.85rem;
}

.hints-badge.ok > summary {
  background: #e3f3e8;
  color: var(--waldgruen);
}

.hints-badge .menu-items {
  min-width: 22rem;
  max-width: 90vw;
  max-height: 60vh;
  overflow: auto;
  padding: var(--space-3) var(--space-4);
  white-space: normal;
}

.hints-badge ul {
  margin: 0;
  padding-left: var(--space-4);
}

#tagesplan .ec-col-head.is-clickable {
  cursor: pointer;
}

#tagesplan .ec-col-head.is-clickable:hover {
  background: var(--bg-soft);
}

.day-lead-popover {
  position: absolute;
  z-index: 45;
  width: min(22rem, 90vw);
  padding: var(--space-3) var(--space-4);
  background: var(--bg);
  border: 1px solid var(--line);
  border-top: 4px solid var(--woelflingsgelb);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(11 35 65 / 18%);
}

.day-lead-popover h4 {
  margin: 0 0 var(--space-2);
}

.side-panel details.more > summary,
form.stack details.more > summary,
.side-panel details.history > summary {
  cursor: pointer;
  font-weight: 600;
  margin: var(--space-2) 0;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}

.panel-head h3 {
  flex: 1;
  margin: 0;
}

#tagesplan .ec-col-head {
  cursor: pointer;
}

#tagesplan .ec-col-head:hover {
  background: var(--bg-soft);
}

.small-hint {
  font-size: 0.8rem;
  margin: 0 0 var(--space-2);
}

.grid-form .field-content,
.grid-form .field-moderation,
.grid-form .field-material_items,
.grid-form .field-responsible,
.grid-form .field-notes,
.grid-form .field-depends_on,
.grid-form .field-goal {
  grid-column: 1 / -1;
}

.evaluation {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.evaluation p {
  margin: var(--space-1) 0 0;
}

.mz-table tbody + tbody {
  border-top: 0;
}

.table.money input[type="number"] {
  width: 8rem;
  text-align: right;
  min-height: 2rem;
  padding: var(--space-1) var(--space-2);
}

.table.money input[type="text"],
.table.money select {
  min-height: 2rem;
  padding: var(--space-1) var(--space-2);
}

details.menu > summary.btn::-webkit-details-marker {
  display: none;
}

.shopping-table td.nowrap {
  width: 7rem;
}

.shopping-table td:nth-child(3) {
  width: auto;
}

.shopping-table {
  table-layout: auto;
}

.shopping-table td.check,
.task-table td.check {
  width: 2.5rem;
}

@media (width < 40rem) {
  .event-header::after {
    display: none;
  }

  .tabs {
    padding-right: 0;
    gap: 0;
  }

  .tabs a,
  .tabs details.menu > summary {
    padding: var(--space-1) var(--space-2);
    font-size: 0.9rem;
  }

  .user-menu > summary,
  .switcher > summary {
    white-space: nowrap;
  }

  .event-title h1 {
    font-size: 1.3rem;
  }
}

/* Dropdowns in the tab bar must not be clipped; the Kohte shape stays inside anyway. */
.event-header {
  overflow: visible;
  z-index: 5;
}

.event-header::after {
  z-index: -1;
}

/* ===================================================================================
   Header, second pass: one row (logo · event · user menu) plus the tab row
   =================================================================================== */

.meta-bar {
  display: none;
}

.site-header {
  border-top: 4px solid var(--pfadiblau);
  border-bottom: 1px solid var(--line);
}

.main-bar {
  border-bottom: 0;
  padding: var(--space-2) var(--space-4);
  gap: var(--space-3);
}

.brand img {
  height: 2.2rem;
}

.header-center {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 var(--space-3);
}

.event-name {
  font-weight: 800;
  font-size: 1.25rem;
  text-decoration: none;
  white-space: nowrap;
}

.header-center .event-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.user-menu {
  margin-left: 0;
  flex: none;
}

.user-menu .menu-items {
  max-height: 70vh;
  overflow-y: auto;
}

.menu-items a.is-current {
  font-weight: 700;
  background: var(--bg-soft);
}

.site-header .tabs {
  position: relative;
  padding: 0 calc(var(--space-4) + 3rem) 0 var(--space-4);
  border-bottom: 0;
  gap: 0;
}

.site-header .tabs a {
  padding: var(--space-2) var(--space-3);
  border-bottom: 3px solid transparent;
}

.site-header .tabs a[aria-current="page"] {
  background: none;
  color: var(--pfadiblau);
  border-bottom-color: var(--woelflingsgelb);
}

.site-header .tabs details.menu.is-current > summary {
  background: none;
  color: var(--pfadiblau);
  box-shadow: inset 0 -3px 0 var(--woelflingsgelb);
}

/* The Kohte opening as a small cut-out at the right edge of the tab row (CD). */
.site-header .tabs::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 3rem;
  height: 100%;
  background: var(--woelflingsgelb);
  clip-path: polygon(45% 0, 100% 0, 100% 100%, 0 100%);
  pointer-events: none;
}

.content {
  padding-top: var(--space-4);
}

.help-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border: 1px solid var(--blau-hell);
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: help;
}

.site-footer {
  margin-top: var(--space-6);
}

.footer-band {
  padding: var(--space-3) var(--space-4) var(--space-2);
  font-size: 0.7rem;
  clip-path: polygon(0 30%, 30% 0, 100% 15%, 100% 100%, 0 100%);
}

@media (width < 40rem) {
  .brand img {
    height: 1.8rem;
    width: auto;
  }

  .header-center {
    flex-direction: column;
    gap: 0;
  }

  .event-name {
    font-size: 1.05rem;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .header-center .event-meta {
    font-size: 0.75rem;
    max-width: 100%;
  }

  .site-header .tabs {
    padding: 0 var(--space-2);
  }

  .site-header .tabs::after {
    display: none;
  }

  .site-header .tabs a {
    padding: var(--space-1) var(--space-2);
  }
}

/* --- Tagesplan filter button and static legend ------------------------------------- */

.filter-panel {
  width: min(24rem, 90vw);
  padding: var(--space-3) var(--space-4);
  white-space: normal;
}

.filter-panel .chips {
  margin: var(--space-1) 0 var(--space-3);
}

.filter-panel select {
  width: 100%;
  margin-top: var(--space-1);
}

#filter-summary.is-active {
  background: var(--pfadiblau);
  color: var(--woelflingsgelb);
}

.legend-static {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin: var(--space-2) 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- Tagesplan: bottom sheet on narrow screens, empty filter result ---------------- */

.panel-head h3:focus {
  outline: none;
}

.panel-backdrop {
  display: none;
}

@media (width < 64rem) {
  /* Below the two-column breakpoint the panel would land under the whole grid, out of
     sight. Show it as a bottom sheet over the calendar instead. */
  .side-panel {
    position: fixed;
    inset: auto 0 0;
    z-index: 60;
    max-height: 85dvh;
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: 0 -8px 32px rgb(11 35 65 / 25%);
  }

  body.sheet-open .panel-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgb(11 35 65 / 35%);
  }

  body.sheet-open {
    overflow: hidden;
  }
}

.calendar-empty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-left: 6px solid var(--woelflingsgelb);
  border-radius: var(--radius);
  background: var(--bg-soft);
  font-weight: 600;
}

.calendar-empty[hidden] {
  display: none;
}

/* --- Event home: open points first, directory folded --------------------------------- */

.open-points {
  margin-bottom: var(--space-4);
}

.section-title {
  font-size: 1.15rem;
  margin: var(--space-2) 0;
}

.conflict-list {
  margin: 0 0 var(--space-3);
  padding-left: var(--space-4);
}

.conflict-list li + li {
  margin-top: var(--space-1);
}

details.directory > summary {
  cursor: pointer;
  font-weight: 700;
  padding: var(--space-2) 0;
}

/* --- Wayfinding: skip link, hidden page heading, "Mehr" menu ------------------------ */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -4rem;
  z-index: 100;
  padding: var(--space-2) var(--space-3);
  background: var(--woelflingsgelb);
  color: var(--pfadiblau);
  font-weight: 700;
  border-radius: var(--radius);
}

.skip-link:focus {
  top: var(--space-2);
}

main.content:focus {
  outline: none;
}

/* Einstellungen: last entry of the tab row; just the gear on phones. */
.site-header .tabs .settings-tab {
  margin-left: auto;
  white-space: nowrap;
}

@media (width < 40rem) {
  .settings-label {
    display: none;
  }
}

.category-tag {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.settings-head h2 {
  margin-bottom: var(--space-2);
}

.toast.ok {
  border-left-color: var(--lagerplatzgruen);
}

/* --- Autosave feedback on rows ([data-autosave], see ui.js) ------------------------- */

.is-saving {
  opacity: 0.6;
}

.is-saved {
  background: #e3f3e8;
  transition: background 0.3s;
}

.is-failed {
  background: #fbeff1;
}

.checklist-readonly {
  display: block;
  padding: var(--space-3) 0;
  font-size: 1.1rem;
}

.checklist-readonly.is-bought {
  color: var(--text-muted);
  text-decoration: line-through;
}

.qty-label {
  cursor: pointer;
}

/* --- Aufgaben: "Liste | Zeitplan" switch ------------------------------------------- */

.segmented {
  display: inline-flex;
  border: 1px solid var(--pfadiblau);
  border-radius: 999px;
  overflow: hidden;
}

.segmented button {
  padding: var(--space-1) var(--space-3);
  border: 0;
  background: var(--bg);
  color: var(--pfadiblau);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.segmented button[aria-pressed="true"] {
  background: var(--pfadiblau);
  color: var(--woelflingsgelb);
}

[data-view][hidden] {
  display: none !important;
}

/* --- Phone tables: keep the columns a row is about, hide the rest ------------------- */

.show-sm {
  display: none;
}

.table-scroll {
  overflow-x: auto;
}

@media (width < 40rem) {
  .table th,
  .table td {
    padding: var(--space-2) var(--space-1);
  }

  /* Long e-mail addresses and notes may break anywhere; titles keep whole words. */
  .table td small {
    overflow-wrap: anywhere;
  }

  .table .hide-sm {
    display: none;
  }

  .show-sm {
    display: block;
  }

  .table td.nowrap,
  .table td .nowrap {
    white-space: normal;
  }

  .table .row-actions {
    width: 2rem;
  }
}

/* --- Phone navigation: one "Bereiche" button instead of a wrapping tab row ---------- */

.tab-links {
  display: contents;
}

.site-header .tabs .section-menu {
  display: none;
}

@media (width < 40rem) {
  .tab-links {
    display: none;
  }

  .site-header .tabs .section-menu {
    display: block;
  }

  .site-header .tabs .section-menu > summary {
    padding: var(--space-2) var(--space-2);
    font-weight: 700;
    color: var(--pfadiblau);
    box-shadow: inset 0 -3px 0 var(--woelflingsgelb);
  }

  .site-header .tabs .section-menu .menu-items {
    left: 0;
    right: auto;
  }

  .site-header .tabs .section-menu .menu-items a {
    padding: var(--space-2) var(--space-4);
    border-bottom: 0;
  }

  .site-header .tabs .section-menu .menu-items a[aria-current="page"] {
    font-weight: 700;
    background: var(--bg-soft);
  }

  .site-header .tabs {
    justify-content: space-between;
  }
}

/* --- Meine Sicht: next block and day selector ---------------------------------------- */

.next-up {
  margin-bottom: var(--space-6);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-left: 6px solid var(--woelflingsgelb);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.next-up-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.next-up-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--pfadiblau);
}

.next-up .button-row {
  margin-top: var(--space-3);
}

.day-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}

.day-chips a {
  padding: 2px var(--space-3);
  border: 1px solid var(--pfadiblau);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.day-chips a[aria-current="page"] {
  background: var(--pfadiblau);
  color: var(--woelflingsgelb);
}

.detail-link {
  margin-left: var(--space-2);
  font-size: 0.85rem;
  font-weight: 600;
}

/* --- Venue picker ("Ort aus der Liste") ---------------------------------------------- */

.input-with-button {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.input-with-button input {
  flex: 1;
  min-width: 0;
}

.venue-dialog {
  width: min(56rem, 96vw);
  max-height: 92dvh;
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-top: 6px solid var(--woelflingsgelb);
  border-radius: var(--radius);
}

.venue-dialog::backdrop {
  background: rgb(11 35 65 / 35%);
}

.venue-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--space-2) var(--space-4);
}

.venue-filter label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  font-size: 0.9rem;
}

.venue-filter input[type="number"] {
  width: 7rem;
}

.venue-hint {
  margin: var(--space-2) 0;
  font-size: 0.85rem;
}

.venue-map {
  height: min(22rem, 40dvh);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.venue-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.venue-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--line);
}

.venue-results {
  margin-top: var(--space-3);
}

.venue-filter [hidden] {
  display: none;
}

/* --- Meine Sicht: dashboard with mini Tagesplan -------------------------------------- */

.dash-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.dash-hello {
  margin: 0 0 var(--space-1);
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.dash-meta {
  margin: 0;
}

.dash-stats {
  display: flex;
  gap: var(--space-3);
}

.stat {
  display: flex;
  flex-direction: column;
  min-width: 7rem;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--line);
  border-bottom: 4px solid var(--woelflingsgelb);
  border-radius: var(--radius);
  background: var(--bg);
  text-decoration: none;
  color: var(--pfadiblau);
}

.stat strong {
  font-size: 1.35rem;
  line-height: 1.2;
}

.stat span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stat.is-alert {
  border-bottom-color: var(--rr-rot);
}

.dash {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: minmax(0, 1fr);
}

@media (width >= 64rem) {
  .dash {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    align-items: start;
  }
}

.dash-main,
.dash-side {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}

.dash-card {
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.dash-card.is-alert {
  border-left: 6px solid var(--rr-rot);
}

.dash-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.dash-card-head h3,
.dash-card .section-title {
  margin: 0;
  font-size: 1.1rem;
}

.dash-card-head a {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.dash-card h4 {
  margin: var(--space-3) 0 var(--space-1);
  font-size: 0.95rem;
}

.dash-card .my-list {
  margin: 0;
}

.dash .next-up {
  margin-bottom: 0;
}

/* Mini Tagesplan: one narrow column per day, blocks positioned in % of the visible hours. */
.mini-scroll {
  overflow-x: auto;
}

.mini-plan {
  display: grid;
  grid-template-columns: 2.6rem repeat(var(--days), minmax(5rem, 1fr));
  gap: 0 3px;
}

.mini-head {
  height: 2.4rem;
  padding: 2px 4px;
  font-size: 0.75rem;
  line-height: 1.2;
  overflow: hidden;
}

.mini-head small {
  display: block;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-head small.is-me {
  color: var(--pfadiblau);
  font-weight: 700;
}

.mini-col {
  position: relative;
  height: 20rem;
}

.mini-day .mini-col {
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.mini-day.is-today .mini-head {
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--woelflingsgelb);
}

.mini-day.is-today .mini-col {
  box-shadow: inset 0 0 0 2px var(--woelflingsgelb);
}

.mini-axis span {
  position: absolute;
  right: 4px;
  transform: translateY(-50%);
  font-size: 0.65rem;
  color: var(--text-muted);
}

.mini-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed var(--line);
}

.mini-block {
  position: absolute;
  box-sizing: border-box;
  padding: 1px 3px;
  border: 1px solid var(--bg);
  border-radius: 3px;
  font-size: 0.65rem;
  line-height: 1.15;
  font-weight: 600;
  text-decoration: none;
  overflow: hidden;
  opacity: 0.3;
}

.mini-block.is-mine {
  z-index: 1;
  opacity: 1;
  box-shadow: 0 0 0 2px var(--kluft);
}

.mini-block:hover,
.mini-block:focus-visible {
  z-index: 2;
  opacity: 1;
}

.mini-now {
  position: absolute;
  z-index: 3;
  left: -3px;
  right: 0;
  border-top: 2px solid var(--rr-rot);
}

@media (width < 40rem) {
  .dash-stats {
    width: 100%;
  }

  .stat {
    flex: 1;
    min-width: 0;
    padding: var(--space-2) var(--space-3);
  }

  .stat strong {
    font-size: 1.1rem;
  }
}

/* --- Einstellungen: danger zone, Notfall card ---------------------------------------- */

.danger-zone {
  margin-top: var(--space-8);
  padding: var(--space-4);
  border: 1px solid var(--rot-hell);
  border-left: 6px solid var(--rr-rot);
  border-radius: var(--radius);
}

.danger-zone h3 {
  margin: 0 0 var(--space-3);
}

.danger-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--line);
}

.danger-row > div {
  flex: 1 1 20rem;
}

.danger-row p {
  margin: var(--space-1) 0 0;
}

.emergency-card {
  border-left: 6px solid var(--rr-rot);
}

.check-field {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

.check-field input {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--pfadiblau);
}
