/* ============================================================
   EISFELD PLANUNG 26/27
   Farbwelt: Papier / Tinte, Monate wechseln hell und dunkel.
   Akzente: Blau, Pink, Violett, Bernstein, Tannengrün.
   Mobile-First & Desktop Optimierung
   ============================================================ */

:root {
  --paper: #E8E5DF;
  --ink: #232323;
  --rule: rgba(35,35,35,.35);
  --rule-strong: #232323;
  --muted: rgba(35,35,35,.55);
  --field: rgba(35,35,35,.05);
  --field-hover: rgba(35,35,35,.09);
  --card-bg: rgba(255,255,255,.5);
  --c-post: #1F45C8;
  --c-reel: #C22B62;
  --c-story: #6E36C4;
  --c-ad: #A96500;
  --c-event: #0B6E56;
  --chip-bg: .10;
  --warn: #B4341F;
  --warn-bg: rgba(180,52,31,.08);
  --shadow: 0 16px 48px rgba(0,0,0,.22);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.08);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 18px;
  --gap: clamp(12px, 2vw, 24px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

body[data-theme="dark"] {
  --paper: #202020;
  --ink: #E8E5DF;
  --rule: rgba(232,229,223,.3);
  --rule-strong: #E8E5DF;
  --muted: rgba(232,229,223,.55);
  --field: rgba(232,229,223,.06);
  --field-hover: rgba(232,229,223,.12);
  --card-bg: rgba(0,0,0,.25);
  --c-post: #8AA6FF;
  --c-reel: #FF87B0;
  --c-story: #C3A6FF;
  --c-ad: #FFC24D;
  --c-event: #5FD9B4;
  --chip-bg: .16;
  --warn: #FF8A70;
  --warn-bg: rgba(255,138,112,.12);
  --shadow: 0 20px 50px rgba(0,0,0,.5);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.25);
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background .3s ease, color .3s ease;
  min-height: 100vh;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  touch-action: manipulation;
}

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

.wrap {
  max-width: 1600px;
  margin: 0 auto;
  padding: calc(var(--gap) + var(--safe-top)) calc(var(--gap) + var(--safe-right)) calc(48px + var(--safe-bottom)) calc(var(--gap) + var(--safe-left));
}

/* ============================================================
   KOPFZEILE / MASTHEAD
   ============================================================ */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  flex-wrap: wrap;
}

.brand-wrap {
  flex: 1 1 auto;
}

.brand {
  font-family: "Anton", "Archivo", Impact, sans-serif;
  font-size: clamp(26px, 4.8vw, 60px);
  line-height: .92;
  letter-spacing: .01em;
  text-transform: uppercase;
  margin: 0;
}

.brand small {
  display: block;
  font-family: "Archivo", sans-serif;
  font-size: clamp(10px, 1.8vw, 12px);
  letter-spacing: .2em;
  font-weight: 600;
  opacity: .6;
  margin-top: 6px;
}

.monthhead {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--field);
  padding: 4px 6px;
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--radius-sm);
}

.monthhead h2 {
  font-family: "Anton", "Archivo", Impact, sans-serif;
  font-size: clamp(22px, 4vw, 42px);
  line-height: .95;
  margin: 0;
  text-transform: uppercase;
  min-width: 5.2em;
  text-align: center;
  padding: 0 4px;
}

.navbtn {
  background: none;
  border: 1px solid var(--rule);
  color: var(--ink);
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background .15s, color .15s, transform .1s;
  border-radius: var(--radius-sm);
}

.navbtn:hover {
  background: var(--ink);
  color: var(--paper);
}

.navbtn:active {
  transform: scale(0.94);
}

/* ============================================================
   SAISONBAND (HORIZONTAL SCROLLBAR AUF MOBILE)
   ============================================================ */
.band-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 10px 0 var(--gap);
  border-top: 1.5px solid var(--rule-strong);
  border-bottom: 1.5px solid var(--rule-strong);
  background: var(--field);
}

.band-container::-webkit-scrollbar {
  display: none;
}

.band {
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  min-width: 100%;
}

.band-m {
  padding: 10px 12px;
  border-right: 1px solid var(--rule);
  background: none;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: none;
  border-bottom: none;
  border-left: none;
  transition: background .15s;
  position: relative;
}

.band-m:last-child {
  border-right: none;
}

.band-m:hover {
  background: var(--field-hover);
}

.band-m[aria-current="true"] {
  background: var(--paper);
  box-shadow: inset 0 -3px 0 var(--rule-strong);
}

.band-m[aria-current="true"] .band-lab {
  opacity: 1;
}

.band-lab {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .15em;
  opacity: .6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.band-lab b {
  font-size: 11.5px;
  font-weight: 700;
  opacity: .9;
  background: var(--field);
  padding: 1px 6px;
  border-radius: 10px;
}

.band-days {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}

.band-d {
  width: 5px;
  height: 12px;
  background: var(--field);
  border: 1px solid transparent;
  border-radius: 1px;
}

.band-d[data-n="0"].in-season {
  border-color: color-mix(in srgb, var(--warn) 65%, transparent);
}

.band-d[data-n="1"] {
  background: color-mix(in srgb, var(--ink) 35%, transparent);
}

.band-d[data-n="2"] {
  background: color-mix(in srgb, var(--ink) 65%, transparent);
}

.band-d[data-n="3"] {
  background: var(--ink);
}

/* ============================================================
   MOBILE SECTION TABS (Planung / Notizen / Coach)
   ============================================================ */
.mob-tabs {
  display: none;
  gap: 6px;
  margin-bottom: 12px;
  border-bottom: 1.5px solid var(--rule-strong);
  padding-bottom: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.mob-tabs::-webkit-scrollbar {
  display: none;
}

.mob-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: none;
  border: 1.5px solid var(--rule);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 20px;
  white-space: nowrap;
  transition: all .15s ease;
}

.mob-tab.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.mob-tab .badge {
  display: none;
  background: var(--warn);
  color: #fff;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 8px;
  font-weight: 700;
  line-height: 1;
}

.mob-tab .badge.show {
  display: inline-block;
}

@media (max-width: 900px) {
  .mob-tabs {
    display: flex;
  }
}

/* ============================================================
   WERKZEUGLEISTE & VIEW SWITCHER
   ============================================================ */
.tools-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: var(--gap);
}

.tools-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.add-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  min-height: 42px;
}

.btn-icon {
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
}

/* Segmented View Switch (Raster / Agenda) */
.view-switch {
  display: inline-flex;
  background: var(--field);
  border: 1.5px solid var(--rule-strong);
  padding: 3px;
  border-radius: var(--radius-sm);
  gap: 2px;
}

.vbtn {
  background: none;
  border: none;
  color: var(--ink);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 2px;
  transition: background .15s, color .15s;
  min-height: 34px;
}

.vbtn.active {
  background: var(--ink);
  color: var(--paper);
}

.vbtn:not(.active):hover {
  background: var(--field-hover);
}

.tools-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.tools-actions::-webkit-scrollbar {
  display: none;
}

.tools-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .7;
  padding-top: 2px;
}

.btn {
  background: none;
  border: 1.5px solid var(--rule-strong);
  color: var(--ink);
  padding: 8px 14px;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: background .15s, color .15s, transform .1s;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 11px;
  min-height: 34px;
}

.btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn:active {
  transform: scale(0.97);
}

.btn.solid {
  background: var(--ink);
  color: var(--paper);
}

.btn.solid:hover {
  opacity: .88;
}

.savestate {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .7;
  font-weight: 600;
}

/* ============================================================
   HAUPTLAYOUT & SPALTEN
   ============================================================ */
.cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--gap);
  align-items: start;
}

@media (max-width: 1080px) {
  .cols {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   KALENDER (GRID-ANSICHT)
   7 Spalten strikt ausgerichtet – alle Zeilen und der Kopf
   müssen exakt identische Spaltenbreiten haben, damit vertikale
   Linien durchgehend stimmen.
   ============================================================ */
.cal-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cal {
  border: 1.5px solid var(--rule-strong);
  background: var(--paper);
  width: 100%;
  min-width: 100%;
  box-sizing: border-box;
}

.cal-head, .cal-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  width: 100%;
  box-sizing: border-box;
}

.cal-head div {
  padding: 10px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  border-right: 1px solid var(--rule);
  border-bottom: 1.5px solid var(--rule-strong);
  text-transform: uppercase;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-head div:last-child {
  border-right: none;
}

.d-short {
  display: none;
}

.d-full {
  display: inline;
}

.cal-week {
  border-bottom: 1px solid var(--rule);
}

.cal-week:last-child {
  border-bottom: none;
}

.day {
  border-right: 1px solid var(--rule);
  min-height: 108px;
  padding: 6px 6px 8px;
  background: none;
  text-align: left;
  cursor: pointer;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  border-top: none;
  border-bottom: none;
  border-left: none;
  transition: background .12s, transform .1s;
  font: inherit;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.day:last-child {
  border-right: none;
}

.day:hover {
  background: var(--field-hover);
}

.day:active:not(.blank) {
  background: var(--field-hover);
  transform: scale(0.98);
}

.day.blank {
  cursor: default;
  background: color-mix(in srgb, var(--field) 40%, transparent);
}

.day.blank:hover {
  background: color-mix(in srgb, var(--field) 40%, transparent);
}

.day .num {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  opacity: .75;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.day.today .num {
  background: var(--ink);
  color: var(--paper);
  padding: 1px 5px;
  border-radius: 2px;
  align-self: flex-start;
  opacity: 1;
}

.day.weekend .num {
  opacity: .5;
}

.day.gap::after {
  content: "";
  position: absolute;
  inset: auto 6px 3px 6px;
  height: 2.5px;
  background: repeating-linear-gradient(90deg, var(--warn) 0 4px, transparent 4px 8px);
  opacity: .8;
}

.chip {
  font-size: 11px;
  line-height: 1.22;
  padding: 3px 5px 3px 6px;
  border-left: 2.5px solid var(--k);
  background: color-mix(in srgb, var(--k) calc(var(--chip-bg)*100%), transparent);
  color: var(--ink);
  word-break: break-word;
  border-radius: 0 2px 2px 0;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: grab;
}

.chip.dragging {
  opacity: .35;
  cursor: grabbing;
}

.day.drag-over {
  background: var(--field-hover);
  outline: 2px dashed var(--ink);
  outline-offset: -2px;
}

.chip b {
  font-weight: 700;
  color: var(--k);
}

.chip[data-t="post"]  { --k: var(--c-post); }
.chip[data-t="reel"]  { --k: var(--c-reel); }
.chip[data-t="story"] { --k: var(--c-story); }
.chip[data-t="ad"]    { --k: var(--c-ad); }
.chip[data-t="event"] { --k: var(--c-event); }

/* ============================================================
   AGENDA / LISTEN-ANSICHT (OPTIMAL FÜR MOBILE)
   ============================================================ */
.agenda-wrapper {
  width: 100%;
}

.agenda-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agenda-day {
  border: 1.5px solid var(--rule-strong);
  background: var(--card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow .2s;
}

.agenda-day.is-today {
  border-color: var(--c-post);
  box-shadow: 0 0 0 1px var(--c-post);
}

.agenda-day.has-gap {
  border-left: 4px solid var(--warn);
}

.agenda-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--field);
  border-bottom: 1px solid var(--rule);
}

.agenda-date-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agenda-num {
  font-family: "Anton", sans-serif;
  font-size: 20px;
  line-height: 1;
  background: var(--ink);
  color: var(--paper);
  padding: 4px 8px;
  border-radius: 4px;
  min-width: 32px;
  text-align: center;
}

.agenda-day-name {
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.agenda-season-tag {
  font-size: 10px;
  letter-spacing: .1em;
  font-weight: 700;
  opacity: .5;
  background: var(--field);
  padding: 2px 6px;
  border-radius: 4px;
}

.agenda-add-btn {
  background: none;
  border: 1px solid var(--rule);
  color: var(--ink);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  display: grid;
  place-items: center;
  cursor: pointer;
  line-height: 1;
  transition: all .15s;
}

.agenda-add-btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.agenda-items {
  padding: 6px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.agenda-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--k) calc(var(--chip-bg)*100%), transparent);
  border-left: 3.5px solid var(--k);
  border-radius: 0 6px 6px 0;
  cursor: grab;
  transition: background .15s;
}

.agenda-item:hover {
  background: color-mix(in srgb, var(--k) calc((var(--chip-bg) + .08)*100%), transparent);
}

.agenda-item.dragging {
  opacity: .35;
  cursor: grabbing;
}

.agenda-day.drag-over {
  outline: 2px dashed var(--ink);
  outline-offset: -2px;
}

.agenda-item-body {
  flex: 1;
  min-width: 0;
}

.agenda-item-type {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--k);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.agenda-item-text {
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--ink);
  word-break: break-word;
}

.agenda-item-del {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px 8px;
  font-size: 16px;
  line-height: 1;
  border-radius: 4px;
}

.agenda-item-del:hover {
  color: var(--warn);
  background: var(--warn-bg);
}

.agenda-empty {
  padding: 10px 14px;
  font-size: 12.5px;
  opacity: .5;
  font-style: italic;
}

.agenda-gap-hint {
  padding: 6px 12px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 11.5px;
  font-weight: 600;
  border-top: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
}

/* ============================================================
   LEGENDE & NOTIZEN
   ============================================================ */
.legend {
  display: flex;
  gap: 12px 18px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: .8;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 10px;
  height: 10px;
  background: var(--k);
  display: block;
  border-radius: 2px;
}

.notes {
  margin-top: var(--gap);
  border: 1.5px solid var(--rule-strong);
  background: var(--paper);
  border-radius: var(--radius-sm);
}

.notes label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  border-bottom: 1px solid var(--rule);
  text-transform: uppercase;
}

.note-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--rule);
}

.note-toolbar button {
  background: none;
  border: none;
  cursor: pointer;
  min-width: 26px;
  height: 26px;
  padding: 0 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  border-radius: var(--radius-sm);
  transition: background .12s;
}

.note-toolbar button:hover {
  background: var(--field-hover);
}

.note-toolbar-sep {
  width: 1px;
  height: 16px;
  background: var(--rule);
  margin: 0 4px;
}

.note-input {
  width: 100%;
  padding: 12px;
  min-height: 72px;
  font-size: 14px;
  line-height: 1.55;
}

.note-input:focus {
  outline: none;
  background: var(--field);
}

.note-input:empty::before {
  content: attr(data-placeholder);
  opacity: .5;
}

.note-input h1, .note-card-body h1 { font-size: 1.3em; margin: .4em 0 .2em; }
.note-input h2, .note-card-body h2 { font-size: 1.1em; margin: .4em 0 .2em; }
.note-input blockquote, .note-card-body blockquote {
  margin: .4em 0; padding-left: 10px; border-left: 2px solid var(--rule-strong); opacity: .85;
}
.note-input pre, .note-card-body pre {
  margin: .4em 0; padding: 6px 8px; background: var(--field); border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; white-space: pre-wrap;
}
.note-input ul, .note-card-body ul,
.note-input ol, .note-card-body ol { margin: .3em 0; padding-left: 1.3em; }
.note-input a, .note-card-body a { color: inherit; text-decoration: underline; }

.note-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 10px 10px;
}

.note-save {
  background: none;
  border: 1.5px solid var(--rule);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all .15s;
}

.note-save:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.note-list {
  border-top: 1px solid var(--rule);
}

.note-card {
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
}

.note-card:last-child {
  border-bottom: none;
}

.note-card-body {
  font-size: 14px;
  line-height: 1.55;
}

.note-card-body:focus {
  outline: none;
  background: var(--field);
}

.note-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  opacity: .55;
}

.note-del {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  opacity: .6;
  padding: 2px 4px;
  color: inherit;
}

.note-del:hover {
  opacity: 1;
  color: var(--warn);
}

.note-empty {
  padding: 14px 12px;
  font-size: 13px;
  opacity: .55;
}

/* ============================================================
   COACH & PLAYBOOK
   ============================================================ */
.panel {
  border: 1.5px solid var(--rule-strong);
  margin-bottom: var(--gap);
  background: var(--paper);
  border-radius: var(--radius-sm);
}

.title-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.panel > h3 {
  margin: 0;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .15em;
  border-bottom: 1.5px solid var(--rule-strong);
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.panel > h3 em {
  font-style: normal;
  font-weight: 700;
  opacity: .7;
  letter-spacing: .06em;
  background: var(--field);
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10.5px;
}

.tip {
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule);
}

.tip:last-child {
  border-bottom: none;
}

.tip h4 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.tip h4::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--ink);
  flex: 0 0 auto;
  border-radius: 1px;
  transform: translateY(-1px);
}

.tip.warn h4::before {
  background: var(--warn);
}

.tip.warn h4 {
  color: var(--warn);
}

.tip.good h4::before {
  background: var(--c-event);
}

.tip p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  opacity: .85;
}

.tip p + p {
  margin-top: 6px;
}

.tip .doit {
  margin-top: 8px;
  background: none;
  border: 1.5px solid var(--rule);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all .15s;
}

.tip .doit:hover {
  background: var(--ink);
  color: var(--paper);
}

details.book {
  border-bottom: 1px solid var(--rule);
}

details.book:last-of-type {
  border-bottom: none;
}

details.book > summary {
  padding: 12px 14px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .03em;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

details.book > summary::after {
  content: "+";
  font-size: 16px;
  opacity: .6;
  font-weight: 400;
}

details.book[open] > summary::after {
  content: "–";
}

details.book .body {
  padding: 0 14px 14px;
}

details.book ul {
  margin: 0;
  padding-left: 18px;
}

details.book li {
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 6px;
  opacity: .88;
}

details.book li b {
  opacity: 1;
}

/* ============================================================
   EDITOR & PASSWORT OVERLAY / BOTTOM SHEET
   ============================================================ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: none;
  place-items: center;
  padding: 16px;
  z-index: 90;
  transition: opacity .2s ease;
}

.overlay.open {
  display: grid;
}

.sheet {
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--rule-strong);
  width: min(480px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  border-radius: var(--radius-md);
  position: relative;
  animation: sheetPop .2s ease-out;
}

@keyframes sheetPop {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

.sheet-handle {
  display: none;
  width: 36px;
  height: 4px;
  background: var(--rule);
  border-radius: 2px;
  margin: 8px auto 0;
}

.sheet header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1.5px solid var(--rule-strong);
}

.sheet header h3 {
  margin: 0;
  font-family: "Anton", sans-serif;
  font-size: 24px;
  text-transform: uppercase;
  letter-spacing: .01em;
  line-height: 1.1;
}

.sheet header span {
  font-size: 11.5px;
  letter-spacing: .12em;
  opacity: .6;
  font-weight: 600;
}

.sheet .close {
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
  color: inherit;
  padding: 4px 8px;
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
}

.elist {
  padding: 8px 16px;
}

.erow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}

.erow:last-child {
  border-bottom: none;
}

.erow .k {
  width: 6px;
  align-self: stretch;
  background: var(--k);
  flex: 0 0 auto;
  border-radius: 2px;
}

.erow .t {
  flex: 1;
  font-size: 13.5px;
  line-height: 1.35;
  min-width: 0;
}

.erow .t b {
  display: block;
  font-size: 10.5px;
  letter-spacing: .12em;
  font-weight: 700;
  color: var(--k);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.erow button {
  background: none;
  border: 1px solid var(--rule);
  cursor: pointer;
  font-size: 11px;
  padding: 4px 8px;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 700;
  border-radius: var(--radius-sm);
  min-height: 32px;
}

.erow button:hover {
  background: var(--ink);
  color: var(--paper);
}

.empty {
  padding: 16px;
  font-size: 13.5px;
  opacity: .65;
  text-align: center;
}

.eform {
  padding: 14px 16px 18px;
  border-top: 1.5px solid var(--rule-strong);
  display: grid;
  gap: 10px;
}

.types-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .7;
}

.eform .types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
  gap: 6px;
}

.eform .types button {
  background: none;
  border: 1.5px solid var(--rule);
  cursor: pointer;
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  transition: all .12s;
  min-height: 38px;
}

.eform .types button[aria-pressed="true"] {
  background: var(--k);
  border-color: var(--k);
  color: #fff;
}

body[data-theme="dark"] .eform .types button[aria-pressed="true"] {
  color: #202020;
}

.eform input[type=text], .eform input[type=password] {
  border: 1.5px solid var(--rule);
  background: none;
  padding: 10px 12px;
  font-size: 15px;
  border-radius: var(--radius-sm);
  width: 100%;
}

.eform input[type=text]:focus, .eform input[type=password]:focus {
  outline: none;
  border-color: var(--ink);
}

/* ============================================================
   SPERRBILDSCHIRM & STATUS
   ============================================================ */
body.locked .wrap {
  display: none;
}

.lock {
  position: fixed;
  inset: 0;
  background: var(--paper);
  color: var(--ink);
  display: none;
  place-items: center;
  padding: 24px;
  z-index: 100;
}

body.locked .lock {
  display: grid;
}

.lockbox {
  width: min(420px, 100%);
}

.lockbox .brand {
  font-size: clamp(28px, 7vw, 44px);
  margin: 0 0 16px;
}

.lockmsg {
  font-size: 14.5px;
  line-height: 1.5;
  margin: 0 0 16px;
  opacity: .85;
}

.lockfields {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.lockfields input {
  border: 1.5px solid var(--rule);
  background: none;
  padding: 12px 14px;
  font-size: 15px;
  width: 100%;
  border-radius: var(--radius-sm);
}

.lockfields input:focus {
  outline: none;
  border-color: var(--ink);
}

.lockerr {
  color: var(--warn);
  font-size: 13px;
  margin: 8px 0 0;
  min-height: 1.2em;
  font-weight: 600;
}

.lockfoot {
  font-size: 12px;
  line-height: 1.5;
  opacity: .6;
  margin: 18px 0 0;
  border-top: 1px solid var(--rule);
  padding-top: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  font-size: 13px;
  letter-spacing: .02em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 110;
  max-width: min(480px, 92vw);
  text-align: center;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ============================================================
   RESPONSIVE & MOBILE-SPEZIFISCHE ANPASSUNGEN (PHONE / TABLET)
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --gap: 12px;
  }

  .wrap {
    padding-top: max(12px, var(--safe-top));
    padding-bottom: max(32px, var(--safe-bottom));
  }

  .masthead {
    align-items: center;
    gap: 8px;
  }

  .brand small {
    margin-top: 4px;
    letter-spacing: .14em;
  }

  .monthhead {
    width: 100%;
    justify-content: space-between;
    margin-top: 4px;
  }

  .monthhead h2 {
    font-size: 26px;
    flex: 1;
  }

  /* Wochentage Abkürzungen */
  .d-short {
    display: inline;
  }
  .d-full {
    display: none;
  }

  /* Das Raster bleibt streng 7-spaltig ausgerichtet */
  .cal-head, .cal-week {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .cal-head div {
    padding: 6px 1px;
    font-size: 10.5px;
    letter-spacing: .02em;
  }

  /* Auf Mobile: Saubere, feste Raster-Zellen ohne Ausreisser */
  .day {
    min-height: 68px;
    padding: 4px 3px 5px;
    gap: 2px;
    min-width: 0;
  }

  .day .num {
    font-size: 10.5px;
  }

  .chip {
    font-size: 9.5px;
    line-height: 1.15;
    padding: 2px 3px;
    border-left-width: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    width: 100%;
    min-width: 0;
  }

  .chip b {
    display: none;
  }

  /* Bottom Sheet Verhalten auf Mobile */
  .overlay {
    padding: 0;
    align-items: flex-end;
  }

  .sheet {
    width: 100%;
    max-height: 90vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
    padding-bottom: max(16px, var(--safe-bottom));
    animation: sheetSlideUp .25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes sheetSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }

  .sheet-handle {
    display: block;
  }

  .tools-actions {
    width: 100%;
  }

  .legend {
    gap: 8px 12px;
    font-size: 10px;
  }
}

/* ============================================================
   DRUCK / PDF (A4 QUERFORMAT)
   ============================================================ */
.sheets {
  display: none;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 8mm;
  }
  .wrap, .overlay, .toast {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .sheets {
    display: block;
  }
  .psheet {
    page-break-after: always;
    break-after: page;
    padding: 6mm;
    color: #232323;
    background: #E8E5DF;
    height: 190mm;
    display: flex;
    flex-direction: column;
  }
  .psheet:last-child {
    page-break-after: auto;
  }
  .psheet.dark {
    background: #232323;
    color: #E8E5DF;
  }
  .ph {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4mm;
  }
  .ph h1, .ph h2 {
    font-family: "Anton", Impact, sans-serif;
    font-size: 26pt;
    margin: 0;
    text-transform: uppercase;
    line-height: .9;
  }
  .pgrid {
    border: 1pt solid currentColor;
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  .prow {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    flex: 1;
    border-bottom: .5pt solid currentColor;
  }
  .prow.head {
    flex: 0 0 auto;
  }
  .prow:last-child {
    border-bottom: none;
  }
  .pcell {
    border-right: .5pt solid currentColor;
    padding: 1.5mm 2mm;
    font-size: 7pt;
    line-height: 1.25;
    overflow: hidden;
  }
  .pcell:last-child {
    border-right: none;
  }
  .prow.head .pcell {
    font-weight: 700;
    letter-spacing: .1em;
    font-size: 7pt;
    text-align: center;
    padding: 1.5mm;
  }
  .pcell .pn {
    font-weight: 700;
    font-size: 7.5pt;
    display: block;
    margin-bottom: .6mm;
  }
  .pcell div.pe {
    margin-bottom: .5mm;
  }
  .pnotes {
    border: 1pt solid currentColor;
    border-top: none;
    min-height: 20mm;
    padding: 2mm;
  }
  .pnotes b {
    font-size: 7pt;
    letter-spacing: .12em;
    display: block;
    margin-bottom: 1mm;
  }
  .pnotes p {
    margin: 0;
    font-size: 8pt;
    white-space: pre-wrap;
  }
}
