:root {
  --sand-50: #f7f5f2;
  --sand-100: #f1eee8;
  --sand-200: #e4dfd6;
  --sand-300: #d4cec3;
  --ink-900: #1c1f1d;
  --ink-700: #3e4540;
  --ink-500: #6d756f;
  --sage-50: #f1f6f3;
  --sage-100: #dce8e1;
  --sage-600: #3b6e52;
  --sage-700: #2c5640;
  --line: #e7e2da;
  --shadow: 0 1px 2px rgba(28, 31, 29, 0.04), 0 12px 32px rgba(28, 31, 29, 0.05);
  --wine: #93253b;
  --wine-dark: #741d2e;
  --wine-soft: #f8eef1;
  --wine-mid: #e4c5cc;
  --surface: #fff;
  --portal: #fbf7f7;
  color-scheme: light;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --sand-50: #141b2b;
  --sand-100: #1c2538;
  --sand-200: #2c3850;
  --sand-300: #3d4c68;
  --ink-900: #f4f7fb;
  --ink-700: #d5dce8;
  --ink-500: #8e99ad;
  --sage-50: #152033;
  --sage-100: #243044;
  --sage-600: #c23154;
  --sage-700: #ffd0dc;
  --line: #2c3850;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(0, 0, 0, 0.35);
  --wine: #c23154;
  --wine-dark: #a32542;
  --wine-soft: #3a2230;
  --wine-mid: #6d3048;
  --surface: #1a2233;
  --portal: #0c1018;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--sand-50);
  color: var(--ink-900);
  font-family: Inter, system-ui, sans-serif;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--wine-soft); }
.hidden { display: none !important; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 32;
  background: var(--sand-50);
  border-bottom: 1px solid var(--sand-200);
}
.topbar-inner, .workspace, .site-footer {
  width: min(980px, calc(100% - 2rem));
  margin: 0 auto;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
}
.brand { display: flex; align-items: center; gap: 0.7rem; }
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--wine);
  color: white;
  display: grid;
  place-items: center;
  flex: none;
}
.brand-mark img { width: 32px; height: 32px; display: block; object-fit: contain; }
.brand-name { font-weight: 650; letter-spacing: -0.03em; }
.brand-sub { margin: 0; color: var(--ink-500); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 0.45rem; }

.btn {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.48rem 0.9rem;
  font-size: 13px;
  font-weight: 650;
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
}
.btn-white { border-color: var(--sand-300); }
.btn-white:hover { background: var(--sand-100); }
.btn-primary, .btn-sage { background: var(--wine); color: white; }
.btn-primary:hover, .btn-sage:hover { background: var(--wine-dark); }

.menu { position: relative; }
.menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  cursor: pointer;
  line-height: 1;
  border: 1px solid var(--sand-300);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.48rem 0.9rem;
  font-size: 13px;
  font-weight: 650;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary::marker { content: ""; }
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--surface);
  border: 1px solid var(--sand-200);
  border-radius: 14px;
  box-shadow: var(--shadow);
  min-width: 280px;
  padding: 0.35rem;
  z-index: 5;
}
.preset-form { display: flex; gap: 0.35rem; padding: 0.35rem; align-items: center; }
.preset-form input {
  flex: 1 1 auto;
  min-width: 0;
  width: 1px;
  border: 1px solid var(--sand-200);
  border-radius: 9px;
  padding: 0.45rem 0.55rem;
  background: var(--surface);
  color: var(--ink-900);
  caret-color: var(--ink-900);
  font-size: 13px;
}
.preset-label, .preset-empty {
  margin: 0.35rem 0.55rem 0.15rem;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.preset-row { display: grid; grid-template-columns: 1fr auto auto; gap: 0.15rem; align-items: center; }
.preset-row.preset-fixed { grid-template-columns: 1fr auto auto; }
.preset-row.is-editing { background: var(--sage-50); border-radius: 10px; }
.preset-mini { width: auto !important; color: var(--ink-500); font-size: 12px; padding: 0.4rem 0.35rem !important; }
.menu-panel button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  font-size: 13px;
}
.menu-panel button:hover { background: var(--sand-100); }
.menu-panel .preset-form button {
  display: inline-flex;
  width: auto;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--sage-50);
  color: var(--sage-700);
  font-weight: 700;
  white-space: nowrap;
}
.menu-panel .preset-form button:hover { background: var(--sage-100); }

.workspace { padding: 1.25rem 0 2rem; }
.sheet {
  background: var(--surface);
  border: 1px solid var(--sand-200);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 1.35rem 1.35rem 1rem;
}
.headline {
  width: 100%;
  border: 0;
  padding: 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  background: transparent;
  outline: none;
}
.headline:focus { box-shadow: inset 0 -1px 0 var(--wine); }
.church-line {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin: 0.2rem 0 0.9rem;
  color: var(--ink-700);
  font-size: 1.05rem;
}
.church-line input {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 1.05rem;
  padding: 0.1rem 0;
  outline: none;
}
.church-line input:focus { box-shadow: inset 0 -1px 0 var(--wine); }
.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem 0.7rem;
  align-items: end;
}
.date-nav { position: relative; grid-column: 1 / -1; display: flex; flex-direction: column; gap: 0.2rem; }
.date-nav > span {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.date-nav-row { display: flex; align-items: stretch; gap: 0.4rem; }
.date-step, .date-face {
  border: 1px solid var(--sand-200);
  background: var(--surface);
  border-radius: 12px;
  cursor: pointer;
}
.date-step {
  flex: 0 0 auto;
  padding: 0.45rem 0.75rem;
  font-size: 13px;
  font-weight: 650;
  color: #93253b;
  white-space: nowrap;
}
.date-step:disabled { opacity: 0.35; cursor: default; }
.date-face {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.35rem 0.8rem;
  text-align: left;
  background: var(--sand-50);
}
.date-face-copy { display: flex; flex-direction: column; gap: 0.05rem; min-width: 0; }
.date-cal { flex: none; color: #93253b; font-size: 12px; font-weight: 650; }
.date-face strong {
  font-size: 15px;
  font-weight: 650;
  color: var(--ink-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.date-face small { font-size: 12px; color: var(--ink-500); }
.date-step:hover:not(:disabled), .date-face:hover { border-color: #93253b; background: var(--surface); }
body.is-link .date-step,
body.is-link .date-cal,
body.is-link #date-pop { display: none !important; }
body.is-link .date-face { pointer-events: none; cursor: default; }
body.is-link .date-face:hover { border-color: var(--sand-200); background: var(--surface); }
.date-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.date-pop {
  position: absolute;
  z-index: 25;
  top: calc(100% + 8px);
  left: 0;
  width: min(26rem, calc(100vw - 2rem));
  background: var(--surface);
  border: 1px solid #eadfe2;
  border-radius: 20px;
  box-shadow: 0 22px 55px rgba(80, 24, 36, 0.18);
  padding: 0.95rem 0.95rem 1rem;
}
.date-pop[hidden] { display: none !important; }
.date-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.date-pop-head strong {
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-transform: capitalize;
}
.date-pop-head button {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--sand-200);
  background: var(--surface);
  color: #93253b;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.date-pop-head button:hover { background: #f8eef1; border-color: #93253b; }
.date-pop-week, .date-pop-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.28rem;
}
.date-pop-week { margin-bottom: 0.35rem; }
.date-pop-week span {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.date-pop-week span:last-child { color: #93253b; }
.date-day {
  height: 52px;
  border: 0;
  border-radius: 14px;
  background: var(--portal);
  font-size: 15px;
  font-weight: 650;
  color: var(--ink-900);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  line-height: 1;
}
.date-day:hover { background: #f3e4e8; }
.date-day.is-sunday { color: #93253b; }
.date-day.is-today:not(.is-on) { box-shadow: inset 0 0 0 2px #93253b; }
.date-dots { display: flex; gap: 3px; height: 6px; align-items: center; }
.date-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #93253b;
  display: block;
}
.date-day.is-on,
.date-day.is-on.is-sunday {
  background: #93253b;
  color: #fff;
}
.date-day.is-on .date-dots i { background: #fff; }
.date-empty { height: 48px; }
.link-card { width: min(32rem, 100%); max-height: none; }
.help-modal { z-index: 46; }
#link-modal { z-index: 60; }
.help-card { width: min(32rem, 100%); max-height: none; }
.help-text { margin: 0; color: var(--ink-700); line-height: 1.5; }
.help-hide { display: flex; align-items: center; gap: 0.5rem; margin-top: 1rem; font-size: 14px; font-weight: 650; }
.help-edit { display: none; width: 100%; }
body.can-infotext .help-edit { display: block; }
body.can-infotext .help-read { display: none; }
body.can-infotext .modal-foot .help-edit { display: inline-flex; width: auto; }
.help-edit textarea { width: 100%; min-height: 8rem; }
.link-body { padding: 1rem 1.1rem 0.3rem; }
.link-body select {
  width: 100%;
  margin-top: 0.35rem;
  border: 1px solid var(--sand-200);
  border-radius: 12px;
  padding: 0.6rem 0.7rem;
  background: var(--surface);
  font: inherit;
  font-size: 15px;
}
.meta-grid label { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.color-pick { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; position: relative; }
.color-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--sand-200);
  background: var(--sand-50);
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  text-align: left;
  cursor: pointer;
  outline: none;
}
.color-button:focus, .color-pick.is-open .color-button {
  background: var(--surface);
  border-color: var(--wine);
}
.color-button i, .color-menu i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(28, 31, 29, 0.2);
}
.color-menu {
  position: absolute;
  z-index: 12;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 9.5rem;
  background: var(--surface);
  border: 1px solid var(--sand-200);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.25rem;
}
.color-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 0.4rem 0.45rem;
  text-align: left;
}
.color-menu button:hover, .color-menu button.is-on { background: var(--sage-50); }
.color-menu button[data-color="grün"] i { background: #1b6b38; }
.color-menu button[data-color="violett"] i { background: #5c3d8f; }
.color-menu button[data-color="weiß"] i { background: #fff; }
.color-menu button[data-color="rot"] i { background: #9b2330; }
.color-menu button[data-color="schwarz"] i { background: #1c1f1d; }
.meta-grid label span, .color-pick > span, .detail label span, .stack-label {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.meta-grid input, .detail input, .detail select, .detail textarea, .stack-label input {
  width: 100%;
  border: 1px solid var(--sand-200);
  background: var(--sand-50);
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  outline: none;
}
.meta-grid input:focus, .detail input:focus, .detail select:focus, .detail textarea:focus, .stack-label input:focus {
  background: var(--surface);
  border-color: var(--wine);
}
.detail input[type="checkbox"] { width: auto; }
.span-2 { grid-column: span 2; }
.with-check { display: flex; align-items: center; gap: 0.35rem; }
.meta-grid .with-check input {
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
}
#target-input:disabled { opacity: 0.45; }
.header-note {
  width: 100%;
  margin-top: 0.65rem;
  border: 0;
  border-top: 1px dashed var(--sand-300);
  background: transparent;
  padding: 0.55rem 0 0;
  color: var(--ink-700);
  outline: none;
  resize: vertical;
  min-height: 2.4rem;
}
.time-pill {
  grid-column: 1 / -1;
  justify-self: start;
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-size: 12px;
  font-weight: 650;
  background: var(--sage-50);
  color: var(--sage-700);
}
.time-pill.over { background: #fff7ed; color: #9a3412; }
.time-pill.ok { background: #ecfdf3; color: #166534; }

.sheet-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 0.9rem;
  margin-top: 1.05rem;
}
.tool-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.tool-main { padding-right: 0.75rem; border-right: 1px solid var(--line); }
.tool-chips { flex: 1 1 16rem; justify-content: center; }
.tool-stream { padding-left: 0.75rem; border-left: 1px solid var(--line); }
.tool-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-700);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-size: 12px;
  font-weight: 650;
}
.chip svg { width: 14px; height: 14px; flex: none; }
.chip:hover { border-color: var(--wine); color: var(--wine); }
.chip-stream::before,
.chip-stream-end::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--wine);
  vertical-align: 1px;
}
.chip-stream-end::before { background: #e23b3b; }
.menu-left .menu-panel { left: 0; right: auto; }
.sheet-note { margin-top: 0.85rem; }
.table-head, .row, .plan-sum {
  display: grid;
  grid-template-columns: 22px minmax(10rem, 1fr) minmax(0, 2.4fr) 64px 112px 28px;
  gap: 0.45rem;
  align-items: center;
}
.table-head {
  margin-top: 0.85rem;
  padding: 0 0.2rem 0.4rem;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.table-head span:nth-child(4), .table-head span:nth-child(5), .clock, .duration { text-align: right; }
.row {
  padding: 0.32rem 0.2rem;
  border-bottom: 1px solid var(--sand-100);
  border-radius: 10px;
}
.row:hover { background: var(--sand-50); }
.row.is-marker {
  grid-template-columns: 22px minmax(0, 1fr) 28px;
  background: #fdecec;
  border-bottom-color: transparent;
  margin: 0.28rem 0;
  padding: 0.22rem 0.35rem;
}
.row.is-marker:hover { background: #fdecec; }
.stream-line { display: flex; align-items: center; gap: 0.45rem; min-width: 0; color: #c01515; }
.stream-dot { width: 8px; height: 8px; border-radius: 50%; background: #c01515; flex: none; }
.row .stream-line .what { width: auto; flex: 1 1 auto; color: #c01515; font-style: italic; font-weight: 650; }
.stream-time { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 13px; font-style: italic; white-space: nowrap; }
.row.is-marker.is-selected,
body.plan .row.is-marker.is-selected { background: #fdecec; box-shadow: inset 3px 0 0 #c01515; }
.row-gap { position: relative; height: 10px; margin: -5px 0; z-index: 3; }
.row-gap button {
  position: absolute;
  inset: -4px 0;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--ink-500);
  opacity: 0;
  cursor: pointer;
}
.row-gap button::before {
  content: "";
  position: absolute;
  left: 11%;
  right: 11%;
  top: 50%;
  border-top: 1px dashed var(--sand-300);
}
.row-gap button span {
  position: relative;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--sand-300);
  font-size: 14px;
  line-height: 1;
}
.row-gap:hover button,
.row-gap:focus-within button { opacity: 1; }
.row.is-selected { background: var(--wine-soft); box-shadow: inset 2px 0 0 var(--wine); }
.row.is-dragging {
  height: 0 !important;
  min-height: 0;
  padding: 0;
  margin: 0;
  border-width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}
.drag-ghost {
  position: fixed;
  top: -2000px;
  left: 0;
  z-index: 40;
  pointer-events: none;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(28, 31, 29, 0.18);
  padding: 0.2rem 0.35rem;
}
.drop-slot {
  height: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sage-700);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.drop-slot.is-open {
  height: var(--slot-h, 42px);
  margin: 0.12rem 0;
  background: var(--wine-soft);
  box-shadow: inset 0 0 0 1.5px var(--wine);
}
.plan-sum {
  padding: 0.45rem 0.15rem 0.15rem;
  color: var(--ink-900);
  font-size: 13px;
}
.plan-sum-label { text-align: center; font-style: italic; }
.plan-sum-end, .plan-sum-min { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.grip-col { display: flex; flex-direction: column; align-items: center; }
.grip, .mini {
  border: 0;
  background: transparent;
  color: var(--ink-500);
  padding: 0;
  line-height: 1;
}
.mini { opacity: 0.28; }
.row:hover .mini, .row:focus-within .mini { opacity: 1; }
.grip {
  cursor: grab;
  font-size: 12px;
  letter-spacing: -0.12em;
  padding: 0.45rem 0.2rem;
  -webkit-user-drag: element;
  user-select: none;
}
.grip:active { cursor: grabbing; }
.mini { font-size: 10px; width: 16px; }
.mini:disabled { opacity: 0.25; }
.song-entry {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  max-width: 100%;
  gap: 0.35rem;
  margin: 0.15rem 0 0.05rem;
}
.song-entry select,
.song-entry input {
  width: auto;
  border: 1px solid var(--sand-200);
  background: var(--surface);
  border-radius: 8px;
  padding: 0.2rem 0.35rem;
  font-family: Inter, system-ui, sans-serif;
  font-style: normal;
  font-size: 13px;
  color: var(--ink-900);
}
.song-entry select { width: 6.4rem; padding-right: 0.2rem; }
.song-entry .song-no { width: 3.2rem; }
.song-entry .song-verses { width: 5.6rem; }
.what-cell { display: flex; flex-direction: row; align-items: center; gap: 0.45rem; min-width: 0; }
.what-cell .what { flex: 1 1 auto; width: auto; min-width: 5.5rem; }
.song-entry { margin: 0; flex: 0 0 auto; }
.row input[type="text"],
.row textarea.what {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  padding: 0.38rem 0.35rem;
  outline: none;
  color: var(--lit-ink, inherit);
}
.row textarea.what,
.row textarea.song-title {
  display: block;
  resize: none;
  overflow: hidden;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.row.is-stream,
.row.is-stream input,
.row.is-stream textarea,
.row.is-stream select,
.row.is-stream .clock,
.row.is-stream .duration strong {
  color: #c01515;
  font-style: italic;
}
.row input[type="text"]:hover,
.row textarea.what:hover { background: var(--sand-50); }
.row input[type="text"]:focus,
.row textarea.what:focus { background: var(--surface); border-color: var(--sand-300); }
.row .song-entry input[type="text"],
.row .song-entry textarea {
  width: auto;
  border: 1px solid var(--sand-200);
  background: var(--surface);
  padding: 0.2rem 0.35rem;
  font-family: Inter, system-ui, sans-serif;
  font-style: normal;
  font-size: 13px;
  color: var(--ink-900);
}
.row .song-entry select { width: 6.6rem; flex: 0 0 6.6rem; }
.row .song-entry input.song-no[type="text"] { width: 3.6rem; flex: 0 0 3.6rem; }
.row .song-entry input.song-verses[type="text"] { width: 6rem; flex: 0 0 6rem; }
.song-entry.is-band { flex: 1 1 16rem; min-width: 0; }
.song-band { position: relative; flex: 1 1 12rem; min-width: 9rem; }
.row .song-entry textarea.song-title { width: 100%; min-width: 0; }
.row:focus-within { position: relative; z-index: 4; }
.song-suggest, .song-ask {
  position: absolute;
  z-index: 8;
  top: calc(100% + 4px);
  left: 0;
  min-width: 16rem;
  max-width: 22rem;
  background: var(--surface);
  color: var(--ink-900);
  font-style: normal;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.3rem;
}
.song-suggest button, .song-ask button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ink-900);
  font: inherit;
  font-style: normal;
  border-radius: 8px;
  padding: 0.38rem 0.5rem;
}
.song-suggest button:hover, .song-ask button:hover { background: var(--wine-soft); }
.song-ask p { margin: 0.25rem 0.5rem 0.35rem; color: var(--ink-500); font-size: 12px; font-weight: 650; }
.row .song-entry input[type="text"]:focus,
.row .song-entry textarea:focus { border-color: var(--wine); }
.row .song-entry :is(input, textarea).liednr-eg,
.row .song-entry :is(input, textarea).liednr-eg:hover,
.row .song-entry :is(input, textarea).liednr-eg:focus { background: #d9d9d9; }
.row .song-entry :is(input, textarea).liednr-e,
.row .song-entry :is(input, textarea).liednr-e:hover,
.row .song-entry :is(input, textarea).liednr-e:focus { background: #c5daf6; }
.row .song-entry :is(input, textarea).liednr-jubilate,
.row .song-entry :is(input, textarea).liednr-jubilate:hover,
.row .song-entry :is(input, textarea).liednr-jubilate:focus { background: #e3d4f2; }
.row .song-entry :is(input, textarea).liednr-band,
.row .song-entry :is(input, textarea).liednr-band:hover,
.row .song-entry :is(input, textarea).liednr-band:focus { background: #f6e3c0; }
.row.is-stream .song-entry input,
.row.is-stream .song-entry textarea,
.row.is-stream .song-entry select,
.row.is-stream .who,
.row.is-stream .what,
.row.is-stream .clock,
.row.is-stream .duration strong {
  color: #c01515;
  font-style: italic;
}
.who { font-weight: 650; }
.clock {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--ink-700);
}
.duration { display: flex; justify-content: flex-end; align-items: center; gap: 0.05rem; }
.duration strong { min-width: 3.1rem; text-align: center; font-size: 13px; font-weight: 600; color: var(--ink-700); }
.duration button {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-500);
  opacity: 0.4;
}
.duration button:hover,
.duration button:focus { opacity: 1; background: var(--sand-100); }
.row-remove {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-500);
  font-size: 16px;
  line-height: 1;
  padding: 0;
}
.row-remove:hover,
.row-remove:focus { color: #c01515; background: var(--sand-100); }
.duration strong {
  min-width: 1.2rem;
  text-align: center;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: #d97706;
  display: inline-block;
  margin-right: 0.25rem;
}
.empty-plan { padding: 1rem 0.2rem; color: var(--ink-500); }

.detail {
  margin-top: 0.8rem;
  background: var(--sand-50);
  border-radius: 16px;
  padding: 0.85rem;
}
.detail:empty { display: none; }
.detail-head { display: flex; justify-content: space-between; gap: 0.5rem; align-items: center; margin-bottom: 0.65rem; }
.detail-head strong { font-size: 13px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.detail label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 13px; }
.detail .full { grid-column: 1 / -1; }
.detail textarea { resize: vertical; min-height: 4.2rem; }
.check-inline { flex-direction: row !important; align-items: center; gap: 0.45rem !important; text-transform: none !important; letter-spacing: 0 !important; font-size: 13px !important; color: var(--ink-900) !important; font-weight: 550; }

.quick-row { display: flex; flex-wrap: wrap; gap: 0.2rem 0.75rem; }
.text-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--sage-700);
  font-size: 13px;
  font-weight: 650;
}
.text-btn.muted { color: var(--ink-500); }
.fine { margin: 0; flex-basis: 100%; color: var(--ink-500); font-size: 12px; }

.site-footer {
  margin-top: auto;
  padding-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink-500);
  font-size: 12px;
}
.site-footer p { margin: 0; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(28, 31, 29, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-card {
  width: min(1100px, 100%);
  max-height: min(92vh, 920px);
  background: var(--surface);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.modal-head, .modal-foot {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.9rem 1.1rem;
  background: var(--sand-50);
}
.modal-head { border-bottom: 1px solid var(--sand-200); }
.modal-foot { border-top: 1px solid var(--sand-200); flex-wrap: wrap; }
.modal-head h2 { margin: 0; font-size: 1.15rem; }
.modal-head p { margin: 0.15rem 0 0; color: var(--ink-500); font-size: 13px; }
.icon-btn { border: 0; background: transparent; border-radius: 10px; width: 36px; height: 36px; }
.icon-btn svg { width: 18px; height: 18px; }
.modal-body { overflow: auto; padding: 1rem 1.1rem 1.1rem; }
.output-layout { display: grid; grid-template-columns: minmax(260px, 0.82fr) minmax(0, 1.15fr); gap: 1rem; }
.output-layout h3, .preview-head h3 {
  margin: 0.85rem 0 0.4rem;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.output-layout h3:first-child { margin-top: 0; }
.design-pick { display: grid; gap: 0.4rem; }
.design-pick button {
  text-align: left;
  border: 1px solid var(--sand-200);
  background: var(--surface);
  border-radius: 14px;
  padding: 0.65rem 0.75rem;
}
.design-pick button strong { display: block; font-size: 14px; }
.design-pick button small { color: var(--ink-500); }
.design-pick button.is-active { border-color: var(--ink-900); background: var(--sand-50); }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; }
.check-card {
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
  border: 1px solid var(--sand-200);
  border-radius: 12px;
  padding: 0.45rem 0.55rem;
  font-size: 13px;
  font-weight: 600;
}
.check-card small { display: block; font-weight: 450; color: var(--ink-500); }
.rows-disclosure, .mail-box { margin-top: 0.85rem; }
.rows-disclosure { border-top: 1px solid var(--line); padding-top: 0.7rem; }
.rows-disclosure summary { cursor: pointer; font-size: 13px; font-weight: 650; }
.item-pick-head { display: flex; gap: 0.7rem; margin: 0.45rem 0; }
.pick-list { max-height: 160px; overflow: auto; border: 1px solid var(--sand-200); border-radius: 12px; }
.pick-row { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--line); font-size: 13px; }
.pick-row:last-child { border-bottom: 0; }
.pick-row label { display: flex; gap: 0.4rem; align-items: center; min-width: 0; }
.mail-box { display: flex; flex-direction: column; gap: 0.45rem; background: var(--sage-50); border-radius: 14px; padding: 0.75rem; }
.mail-box h3 { margin-top: 0; }
.preview-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.preview-head h3 { margin-top: 0; }
.mail-letter { margin: 0 0 0.8rem; }
.mail-letter textarea {
  width: 100%;
  min-height: 14rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.75rem;
  background: var(--surface);
  line-height: 1.45;
  resize: vertical;
}
#preview-count { font-size: 12px; color: var(--ink-500); }
.paper {
  border: 1px solid var(--sand-200);
  border-radius: 12px;
  min-height: 460px;
  max-height: 68vh;
  overflow: auto;
  padding: 1.1rem 1.15rem 1.3rem;
  background: #fff;
  color: #1c1f1d;
}
.paper h2 { margin: 0; font-family: "Source Serif 4", Georgia, serif; font-size: 1.25rem; letter-spacing: -0.02em; }
.paper .church { margin: 0.15rem 0 0; }
.paper .meta { display: flex; justify-content: space-between; gap: 1rem; margin: 0.35rem 0 0.75rem; font-size: 12px; }
.paper .hint { margin: 0 0 0.7rem; font-size: 12px; color: var(--ink-700); white-space: pre-line; }
.paper table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.paper th { text-align: left; font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; }
.paper td { vertical-align: top; padding: 0.32rem 0.3rem; }
.paper .who { font-weight: 700; }
.paper .sub { display: block; color: var(--ink-500); font-size: 11px; font-weight: 450; margin-top: 0.12rem; }
.num, .paper td.num, .paper th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.paper tfoot td { font-weight: 700; border-top: 1.5px solid var(--ink-900); }
.paper.klassisch {
  font-family: "Times New Roman", Times, serif;
  color: var(--lit-ink, #1b6b38);
  padding: 0.55rem 0.6rem 0.7rem;
  border-radius: 2px;
  min-height: 0;
  max-height: none;
}
.paper.klassisch .sheet-head {
  border: 2px solid var(--lit-ink, #1b6b38);
  padding: 8px 10px 6px;
  margin: 0 0 8px;
  text-align: center;
}
.paper.klassisch h2,
.paper.klassisch .church {
  text-align: center;
  font-weight: 700;
  letter-spacing: 0;
}
.paper.klassisch h2 { font-family: Arial, Helvetica, sans-serif; font-size: 20pt; line-height: 1.25; margin: 0 0 8px; }
.paper.klassisch .church { font-family: "Times New Roman", Times, serif; }
.paper.klassisch .church { display: none; }
.paper tr.is-stream,
.paper tr.is-stream td,
.paper tr.is-stream .who,
.paper tr.is-stream .sub,
.paper tr.is-stream .num {
  color: #c01515;
  font-style: italic;
}
.paper .sheet-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin: 0.15rem 0 0; }
.paper .occasion, .paper .stand-line, .paper .color-line { margin: 0; text-align: left; font-size: 13px; }
.paper .stand-line { text-align: right; white-space: nowrap; }
.paper .color-line { margin-top: 0.12rem; }
.paper .liednr,
.paper .liednr-eg { background: #d9d9d9; padding: 0 0.12rem; }
.paper .liednr-e { background: #c5daf6; padding: 0 0.12rem; }
.paper .liednr-jubilate { background: #e3d4f2; padding: 0 0.12rem; }
.paper .liednr-band { background: #f6e3c0; padding: 0 0.12rem; }
.paper .song-plain { font-style: italic; }
.paper .stream-mark { color: #c01515; font-style: italic; }
.paper.klassisch .hint { margin: 0.25rem 0 0; text-align: center; color: inherit; font-size: 13px; }
.paper.klassisch .empty-note { text-align: left; color: var(--ink-500); }
.paper.klassisch table { font-family: "Times New Roman", Times, serif; font-size: 13px; width: 100%; }
.paper.klassisch th,
.paper.klassisch td {
  border: 1px solid #000;
  text-align: center;
  vertical-align: middle;
  padding: 4px 6px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 400;
}
.paper.klassisch th { font-size: 10px; line-height: 1.15; font-weight: 700; }
.paper.klassisch td.who { font-weight: 400; width: 18%; }
.paper.klassisch td.what { white-space: nowrap; }
.paper.klassisch td.what .sub { white-space: normal; }
.paper.klassisch th.num,
.paper.klassisch td.num { text-align: center; width: 1%; padding-left: 2px; padding-right: 2px; }
.paper.klassisch td.num { white-space: nowrap; }
.paper.klassisch .sub {
  display: block;
  text-align: center;
  color: #000;
  font-size: 11px;
  font-weight: 400;
  margin-top: 0.08rem;
}
.paper.klassisch tfoot td { font-weight: 400; border-top: 1px solid #000; }
.paper.klassisch tfoot .dauer { font-style: italic; }
.paper.klassisch tr.is-stream td,
.paper.klassisch tr.is-stream .sub,
.paper.klassisch tr.is-stream .who,
.paper.klassisch tr.is-stream .num {
  color: #c01515;
  font-style: italic;
}
.paper.klassisch tfoot .num { font-weight: 700; }
.paper.modern { border-top: 6px solid var(--sage-600); }
.paper.modern h2 { font-family: Inter, sans-serif; font-size: 1.45rem; }
.paper.modern .meta { color: var(--ink-500); }
.paper.modern th { color: var(--sage-700); border: 0; border-bottom: 1px solid var(--sage-600); }
.paper.modern td { border: 0; border-bottom: 1px solid var(--line); padding: 0.48rem 0.25rem; }
.paper.modern tfoot td { border-bottom: 0; }
.paper.schlicht { padding: 1.4rem 1.3rem; }
.paper.schlicht h2 { font-size: 1.7rem; font-weight: 500; }
.paper.schlicht table, .paper.schlicht td, .paper.schlicht th { border: 0; }
.paper.schlicht td { padding: 0.55rem 0.2rem; border-bottom: 1px solid #eee; }
.paper.schlicht tfoot td { border-bottom: 0; padding-top: 0.8rem; }
.modal-foot-actions { display: flex; gap: 0.4rem; }
.feedback { margin: 0.75rem 0 0; background: var(--sage-50); color: var(--sage-700); border-radius: 12px; padding: 0.55rem 0.7rem; font-size: 13px; font-weight: 650; }

@media (max-width: 980px) {
  .tool-main, .tool-stream { border: 0; padding: 0; }
  .tool-chips { justify-content: flex-start; }
}

@media (max-width: 800px) {
  .meta-grid, .output-layout, .detail-grid, .check-grid { grid-template-columns: 1fr 1fr; }
  .span-2 { grid-column: span 2; }
  .table-head { display: none; }
  .row, .plan-sum { grid-template-columns: 28px 1fr auto 28px; }
  .plan-sum-label { grid-column: 2; text-align: left; }
  .plan-sum-end { grid-column: 3; grid-row: 1; }
  .plan-sum-min { grid-column: 3; grid-row: 2; }
  .grip-col { grid-row: 1 / span 2; }
  .who { grid-column: 2; grid-row: 1; }
  .what-cell { grid-column: 2; grid-row: 2; flex-direction: column; align-items: stretch; }
  .what-cell .what { grid-column: auto; grid-row: auto; }
  .clock { grid-column: 3; grid-row: 1; }
  .duration { grid-column: 3; grid-row: 2; }
  .row-remove { grid-column: 4; grid-row: 1 / span 2; }
  .row.is-marker { grid-template-columns: 28px 1fr 28px; }
  .row.is-marker .row-remove { grid-column: 3; grid-row: 1; }
  .row.is-marker .stream-line { grid-column: 2; }
}
.whoami {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-700);
  align-self: center;
  white-space: nowrap;
  padding: 0 0.15rem;
}
.gate { display: none; }
body.is-gated .gate {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 1.5rem;
  background: var(--portal);
}
body.is-gated .topbar,
body.is-gated .workspace,
body.is-gated .site-footer,
body.is-gated .chat,
body.is-gated #team-modal,
body.is-gated #roster-modal,
body.is-gated #rights-app { display: none; }
.gate-card[hidden] { display: none !important; }
.gate-card {
  width: min(26rem, 100%);
  background: var(--surface);
  border-radius: 18px;
  padding: 1.4rem 1.35rem 1.2rem;
  box-shadow: 0 18px 50px rgba(28, 31, 29, 0.08);
  display: grid;
  gap: 0.7rem;
}
.gate-card h1 { margin: 0; font-size: 1.45rem; }
.gate-card p { margin: 0; color: var(--ink-500); }
.gate-card label { display: grid; gap: 0.25rem; font-size: 13px; font-weight: 650; }
.gate-card input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  background: var(--surface);
  color: inherit;
  font: inherit;
  font-weight: 500;
}
.gate-error { min-height: 1.1rem; color: #9b2330; font-weight: 650; }
.mail-list { display: grid; gap: 0.35rem; margin: 0.4rem 0 0.55rem; }
.mail-person { margin: 0; font-size: 14px; }
.mail-person.is-missing { color: #9a3412; }
.mail-extra, .mail-extra-row {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}
.mail-extra { margin: 0 0 0.35rem; }
.mail-extra input {
  flex: 1 1 12rem;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.42rem 0.55rem;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  background: var(--surface);
}
.mail-extra-field {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.mail-extra-field input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0.42rem 0.45rem 0.42rem 0.55rem;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
}
.mail-extra-field input[readonly] { cursor: default; }
.mail-extra-edit, .mail-extra-delete {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.mail-extra-edit svg { width: 15px; height: 15px; display: block; }
.mail-extra-delete { font-size: 20px; line-height: 1; color: #9b2330; }
.mail-extra-edit:hover, .mail-extra-delete:hover { background: var(--sand-100); }
.mail-extra-note { min-height: 1.1rem; margin: 0 0 0.7rem; color: #9b2330; font-size: 13px; font-weight: 650; }
.mail-extra-note:empty { display: none; }
.chat {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  width: min(22rem, calc(100vw - 2rem));
  height: min(28rem, calc(100vh - 6rem));
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(28, 31, 29, 0.16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat.hidden { display: none; }
.chat-head, .chat-form { display: flex; align-items: center; gap: 0.4rem; padding: 0.55rem 0.7rem; }
.chat-head { justify-content: space-between; border-bottom: 1px solid var(--line); }
.chat-log { flex: 1; overflow: auto; padding: 0.7rem; display: grid; align-content: start; gap: 0.55rem; }
.chat-note { margin: 0; padding: 0 0.7rem 0.45rem; color: var(--ink-500); font-size: 12px; }
.chat-line { margin: 0; display: grid; gap: 0.15rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--line); }
.chat-line header { display: flex; flex-wrap: wrap; gap: 0.35rem 0.5rem; align-items: baseline; }
.chat-line strong { font-size: 13px; }
.chat-line time, .chat-via { font-size: 11px; color: var(--ink-500); }
.chat-line span { white-space: pre-wrap; font-size: 14px; }
.chat-quote { margin: 0; padding: 0.25rem 0.45rem; border-left: 2px solid var(--wine); background: var(--sand-100); color: var(--ink-500); font-size: 12px; }
.chat-files { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.chat-files a { font-size: 12px; font-weight: 650; color: var(--wine); }
.chat-reply { display: flex; justify-content: space-between; gap: 0.4rem; align-items: center; padding: 0.35rem 0.7rem; background: var(--wine-soft); color: var(--ink-700); font-size: 12px; }
.chat-reply[hidden] { display: none !important; }
.chat-reply button, .chat-line header button { border: 0; background: transparent; color: var(--wine); font: inherit; font-size: 12px; font-weight: 700; padding: 0; }
.chat-form { border-top: 1px solid var(--line); flex-wrap: wrap; }
.chat-form input[type="text"] { flex: 1; min-width: 8rem; border: 1px solid var(--line); border-radius: 999px; padding: 0.45rem 0.7rem; font: inherit; background: var(--surface); color: inherit; }
.chat-form input[type="file"] { flex: 1 0 100%; font-size: 12px; color: var(--ink-500); }
.team-card { max-width: 40rem; }
.team-form { display: grid; gap: 0.55rem; }
.team-form input, .team-list input[type="text"] {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  font: inherit;
}
.team-form fieldset {
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 0.25rem;
  padding: 0.55rem 0.75rem 0.7rem;
}
.team-form legend { padding: 0 0.3rem; font-size: 13px; font-weight: 700; }
.team-list { display: grid; gap: 0.6rem; margin-top: 0.9rem; }
.team-person {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  display: grid;
  gap: 0.35rem;
}
.team-person header { display: flex; justify-content: space-between; gap: 0.5rem; align-items: baseline; }
.team-rights { display: flex; flex-wrap: wrap; gap: 0.45rem 0.8rem; font-size: 13px; }
.team-actions { display: flex; gap: 0.4rem; }
body.is-reader .steps,
body.is-reader .wizard-panel,
body.is-reader #btn-roster,
body.is-reader #invite-menu,
body.is-reader #btn-help-again { display: none !important; }
.reader { display: grid; gap: 0.9rem; }
.reader[hidden] { display: none !important; }
.reader-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}
.reader-date { display: grid; gap: 0.1rem; min-width: 12rem; margin-right: auto; }
.reader-date strong { font-size: 1.05rem; }
.reader-date small { color: var(--ink-500); }
.reader .paper { max-height: none; }
body:not(.can-plan) .sheet-tools,
body:not(.can-plan) .grip-col,
body:not(.can-plan) .duration button,
body:not(.can-plan) .row-remove,
body:not(.can-plan) .sheet-head input,
body:not(.can-plan) .sheet-head textarea,
body:not(.can-plan) .sheet-head button,
body:not(.can-plan) .row input,
body:not(.can-plan) .row textarea,
body:not(.can-plan) .row select,
body:not(.can-plan) #detail textarea,
body:not(.can-plan) #detail input,
body:not(.can-plan) #detail select { pointer-events: none; }
body:not(.can-mail) #btn-mail,
body:not(.can-chat):not(.can-service-chat) #btn-chat,
body:not(.can-people) #btn-team,
body:not(.can-people) #btn-rights { display: none; }
.rights-app {
  position: fixed;
  z-index: 28;
  inset: 0;
  background: var(--portal);
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 5.2rem 1.2rem 1.2rem;
}
.rights-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: 0.8rem; }
.rights-head h2 { margin: 0; font-size: 1.6rem; }
.rights-head p { margin: 0.25rem 0 0; color: var(--ink-500); max-width: 40rem; }
.rights-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1rem; min-height: 0; }
.rights-people, .rights-board { background: var(--surface); border-radius: 16px; overflow: auto; }
.rights-people { padding: 0.45rem; display: grid; align-content: start; gap: 0.25rem; }
.rights-people button {
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.rights-people button.is-on { background: var(--wine); color: #fff; }
.rights-board { padding: 1rem 1.1rem 1.3rem; display: grid; align-content: start; gap: 0.8rem; }
.rights-group { border: 1px solid var(--line); border-radius: 14px; padding: 0.75rem 0.9rem 0.85rem; }
.rights-group h3 { margin: 0 0 0.45rem; font-size: 15px; }
.rights-group label { display: flex; gap: 0.45rem; align-items: center; padding: 0.18rem 0; font-size: 14px; }
@media (max-width: 800px) {
  .rights-layout { grid-template-columns: 1fr; }
  .rights-people { grid-auto-flow: column; overflow-x: auto; }
}
.roster-card { width: min(760px, 100%); }
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; margin-bottom: 0.6rem; }
.cal-names, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.25rem; }
.cal-names { margin-bottom: 0.25rem; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; color: var(--ink-500); text-align: center; }
.cal-day {
  min-height: 4.6rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 0.25rem 0.3rem;
  text-align: left;
}
.cal-day b { display: block; font-size: 13px; }
.cal-day small { display: block; font-size: 10px; line-height: 1.25; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-day .cal-event { font-weight: 650; }
.cal-day.is-sunday { background: #f4f7f2; }
.cal-day.is-duty {
  background: #f4e4ea;
  border-color: var(--wine);
  box-shadow: inset 0 0 0 1px var(--wine);
}
.cal-day.is-duty b,
.cal-day.is-duty small { color: var(--wine-dark, #6b2030); }
.cal-list { list-style: none; margin: 0.85rem 0 0; padding: 0; display: grid; gap: 0.35rem; }
.cal-list li {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  background: #f4e4ea;
  border: 1px solid var(--wine);
  font-size: 14px;
}
.cal-list time { font-weight: 650; }

body.plan {
  background: var(--portal);
}
body.plan .brand-mark,
body.plan .btn-primary,
body.plan .btn-sage {
  background: var(--wine);
  color: #fff;
}
body.plan .btn-primary:hover,
body.plan .btn-sage:hover { background: var(--wine-dark); }
body.plan .row.is-selected { box-shadow: inset 3px 0 0 var(--wine); background: var(--wine-soft); }
body.plan .headline:focus,
body.plan .church-line input:focus { box-shadow: inset 0 -2px 0 var(--wine); }
body.plan .topbar { background: var(--portal); }
body.plan .topbar-inner { width: min(1120px, calc(100% - 1.5rem)); align-items: center; }
body.plan .top-actions {
  flex: 1;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem 0.7rem;
}
body.plan .top-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
body.plan .brand-name,
body.plan .brand-sub,
body.plan .whoami,
body.plan .top-actions .btn,
body.plan .top-actions .menu summary {
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
}
body.plan .brand-sub { font-weight: 500; font-size: 12px; white-space: nowrap; }
body.plan .whoami {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 0.15rem;
  color: var(--ink-700);
}
body.plan .top-actions .btn,
body.plan .top-actions .menu summary {
  height: 34px;
  padding: 0 0.75rem;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.wizard-panel[hidden],
.wizard-bar [hidden] { display: none !important; }
body.plan { font-size: 15px; line-height: 1.45; }
body.plan .btn { font-size: 14px; font-weight: 600; }
.send-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.78fr) minmax(0, 1.22fr);
  gap: 1.2rem;
  align-items: start;
}
body.plan .headline { font-size: 1.55rem; }
body.plan .step-title { font-family: Inter, system-ui, sans-serif; font-size: 1.35rem; font-weight: 650; }
body.plan .step-lead,
body.plan .block-head p { font-size: 15px; }
body.plan .meta-grid label > span,
body.plan .color-pick > span,
body.plan .guest-card label { font-size: 12px; font-weight: 650; letter-spacing: 0.01em; }
body.plan input,
body.plan select,
body.plan textarea { font-size: 15px; }
.steps {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0 0 0.9rem;
  padding: 0.3rem;
  background: var(--sand-100);
  border: 1px solid var(--sand-200);
  border-radius: 16px;
}
.steps button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 12px;
  padding: 0.48rem 0.7rem;
  text-align: left;
  color: var(--ink-700);
}
.step-arrow {
  color: var(--wine, #93253b);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
}
.steps button b,
.steps button span {
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
}
.steps button b {
  width: 0.9rem;
  min-width: 0.9rem;
  height: auto;
  border-radius: 0;
  display: grid;
  place-items: center;
  background: transparent;
  color: inherit;
}
body.plan .steps button.is-on {
  border-color: transparent;
  background: var(--wine);
  color: #fff;
}
body.plan .steps button.is-on b {
  background: transparent;
  color: inherit;
  width: 0.9rem;
  height: auto;
}
.step-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.step-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.4rem;
}
.step-actions .btn { gap: 0.35rem; }
.step-actions svg { width: 15px; height: 15px; flex: none; }
.btn-done {
  flex: none;
  margin-top: 0.15rem;
  background: #1f9d55;
  color: #fff;
}
.btn-done:hover { background: #17864a; }
.btn-done:disabled { opacity: 0.7; }
.btn-done:focus { outline: none; }
.done-burst {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  overflow: hidden;
}
.done-bit {
  position: absolute;
  left: 0;
  top: 0;
}
.done-bit {
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  background: #5cbf86;
  opacity: 0.8;
  animation: done-spark 480ms ease-out forwards;
}
.done-bit.is-star {
  width: auto;
  height: auto;
  margin: 0;
  border-radius: 0;
  background: transparent;
  color: #8fd4ad;
  font-size: 11px;
  line-height: 1;
}
@keyframes done-spark {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); opacity: 0.75; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.4) rotate(var(--rot)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .done-bit { animation: none; }
}
.step-kicker {
  margin: 0;
  color: var(--wine);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.step-title { margin: 0.15rem 0 0.25rem; font-size: 1.45rem; letter-spacing: -0.03em; }
.step-lead { margin: 0 0 1rem; color: var(--ink-500); max-width: 40rem; }
.role-block { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.block-head { display: flex; justify-content: space-between; gap: 0.8rem; align-items: end; margin-bottom: 0.75rem; }
.block-head h3 { margin: 0; font-size: 1.05rem; }
.block-head p { margin: 0.2rem 0 0; color: var(--ink-500); font-size: 14px; }
.service-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.7rem; }
.role-card {
  background: var(--surface);
  border: 1px solid var(--sand-200);
  border-radius: 16px;
  padding: 0.75rem 0.8rem;
  display: grid;
  gap: 0.4rem;
}
.role-card header { display: flex; justify-content: space-between; gap: 0.5rem; align-items: baseline; }
.role-card header span { font-size: 12px; font-weight: 700; color: var(--sage-700); }
.plan-names { margin: 0.1rem 0 0.35rem; font-weight: 650; }
.sheet-facts { display: grid; gap: 0.6rem; margin: 0 0 1rem; }
.sheet-event { border: 1px solid var(--sand-200); border-radius: 14px; padding: 0.75rem 0.85rem; background: var(--surface); }
.sheet-event.is-primary { border-color: var(--wine-mid, #e4c5cc); background: var(--wine-soft, #f8eef1); }
.sheet-event h3 { margin: 0 0 0.45rem; font-size: 15px; font-weight: 650; }
.fact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem 0.8rem; }
.fact-grid div { display: grid; gap: 0.1rem; }
.fact-grid span { font-size: 12px; font-weight: 650; color: var(--ink-500); }
body.plan .sheet-tools .menu summary {
  height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.75rem;
  font-size: 14px;
  font-weight: 600;
  box-sizing: border-box;
}
.role-card.is-open header span { color: var(--wine); }
.role-card select,
.role-person {
  width: 100%;
  border: 1px solid var(--sand-200);
  border-radius: 10px;
  padding: 0.45rem 0.5rem;
  background: var(--sand-50);
  font: inherit;
}
.wizard-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}
.wizard-send {
  display: flex;
  flex: 1 1 16rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
}
.wizard-send[hidden] { display: none !important; }
body.plan #btn-mail {
  background: var(--wine, #93253b);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(147, 37, 59, 0.22);
}
body.plan #btn-mail:hover { background: var(--wine-dark, #741d2e); }
body.plan .grip { color: var(--wine); }
.guest-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(12rem, 0.8fr) auto;
  gap: 0.7rem;
  align-items: end;
  margin: 0 0 1rem;
  padding: 0.8rem;
  border: 1px solid var(--wine-mid, #e4c5cc);
  border-radius: 14px;
  background: var(--wine-soft, #f8eef1);
}
.guest-card label { display: grid; gap: 0.25rem; }
.guest-card input,
.guest-card select {
  border: 1px solid var(--sand-200);
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  background: var(--surface);
}
.guest-card .fine { grid-column: 1 / -1; margin: 0; }
.guest-card[hidden] { display: none !important; }
.invite-panel {
  display: grid;
  gap: 0.55rem;
  width: min(24rem, 78vw);
  padding: 0.75rem;
}
.invite-panel p { margin: 0; color: var(--ink-500); font-size: 13px; line-height: 1.4; }
.invite-panel .btn {
  display: inline-flex;
  width: auto;
  justify-self: start;
  justify-content: center;
  border: 1px solid var(--sand-300);
  background: var(--surface);
  text-align: center;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
}
.invite-row { display: flex; gap: 0.4rem; align-items: center; }
.invite-row[hidden] { display: none !important; }
.invite-row input {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--sand-200);
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  font-size: 13px;
  background: var(--surface);
}
#invite-menu[hidden] { display: none !important; }
.block-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: flex-end; }
.block-head .btn { white-space: nowrap; }
@media (max-width: 700px) {
  .steps { flex-wrap: wrap; }
  .step-arrow { display: none; }
  .block-head,
  .guest-card { flex-direction: column; align-items: stretch; grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .meta-grid, .detail-grid, .check-grid, .output-layout, .send-layout, .fact-grid { grid-template-columns: 1fr; }
  .span-2, .date-nav { grid-column: auto; }
  .date-nav-row { flex-wrap: wrap; }
  .date-face { flex: 1 0 100%; order: -1; }
}

.theme-toggle { gap: 0.35rem; }
.theme-toggle svg { width: 15px; height: 15px; display: block; }
html[data-theme="dark"] .theme-moon,
html:not([data-theme="dark"]) .theme-sun { display: none; }
.theme-auth { position: absolute; top: 0.85rem; right: 0.85rem; z-index: 2; }
html[data-theme="dark"] .paper {
  --ink-900: #1c1f1d;
  --ink-700: #3e4540;
  --ink-500: #6d756f;
  --sand-200: #e4dfd6;
  --line: #e7e2da;
  background: #fff;
  color: #1c1f1d;
}
html[data-theme="dark"] .date-pop { border-color: var(--sand-200); }
html[data-theme="dark"] body.plan .steps button.is-on {
  background: var(--wine);
  border-color: var(--wine);
  color: #fff;
}
html[data-theme="dark"] body.plan .steps button.is-on b {
  background: transparent;
  color: inherit;
}
html[data-theme="dark"] .step-arrow { color: #6d7890; }
html[data-theme="dark"] .table-head {
  background: #222b3e;
  border: 0;
  border-radius: 10px;
  margin-top: 0.7rem;
  padding: 0.42rem 0.55rem;
}
html[data-theme="dark"] .row { border-bottom-color: transparent; }
html[data-theme="dark"] .row:hover { background: #243044; }
html[data-theme="dark"] .row input[type="text"],
html[data-theme="dark"] .row textarea.what,
html[data-theme="dark"] .who,
html[data-theme="dark"] .clock,
html[data-theme="dark"] .duration strong {
  color: var(--ink-900);
}
html[data-theme="dark"] .clock,
html[data-theme="dark"] .duration strong { color: var(--ink-700); }
html[data-theme="dark"] .song-entry select,
html[data-theme="dark"] .song-entry input,
html[data-theme="dark"] .song-entry textarea {
  background: #121826;
  border-color: #3d4c68;
  color: #f4f7fb;
}
html[data-theme="dark"] .row:not(.is-stream) .song-entry :is(input, textarea).liednr-eg,
html[data-theme="dark"] .row:not(.is-stream) .song-entry :is(input, textarea).liednr-eg:hover,
html[data-theme="dark"] .row:not(.is-stream) .song-entry :is(input, textarea).liednr-eg:focus,
html[data-theme="dark"] .row:not(.is-stream) .song-entry :is(input, textarea).liednr-e,
html[data-theme="dark"] .row:not(.is-stream) .song-entry :is(input, textarea).liednr-e:hover,
html[data-theme="dark"] .row:not(.is-stream) .song-entry :is(input, textarea).liednr-e:focus,
html[data-theme="dark"] .row:not(.is-stream) .song-entry :is(input, textarea).liednr-jubilate,
html[data-theme="dark"] .row:not(.is-stream) .song-entry :is(input, textarea).liednr-jubilate:hover,
html[data-theme="dark"] .row:not(.is-stream) .song-entry :is(input, textarea).liednr-jubilate:focus,
html[data-theme="dark"] .row:not(.is-stream) .song-entry :is(input, textarea).liednr-band,
html[data-theme="dark"] .row:not(.is-stream) .song-entry :is(input, textarea).liednr-band:hover,
html[data-theme="dark"] .row:not(.is-stream) .song-entry :is(input, textarea).liednr-band:focus {
  color: #1a1d24;
  caret-color: #1a1d24;
}
html[data-theme="dark"] .row.is-stream .song-entry :is(input, textarea).liednr-eg,
html[data-theme="dark"] .row.is-stream .song-entry :is(input, textarea).liednr-eg:hover,
html[data-theme="dark"] .row.is-stream .song-entry :is(input, textarea).liednr-eg:focus,
html[data-theme="dark"] .row.is-stream .song-entry :is(input, textarea).liednr-e,
html[data-theme="dark"] .row.is-stream .song-entry :is(input, textarea).liednr-e:hover,
html[data-theme="dark"] .row.is-stream .song-entry :is(input, textarea).liednr-e:focus,
html[data-theme="dark"] .row.is-stream .song-entry :is(input, textarea).liednr-jubilate,
html[data-theme="dark"] .row.is-stream .song-entry :is(input, textarea).liednr-jubilate:hover,
html[data-theme="dark"] .row.is-stream .song-entry :is(input, textarea).liednr-jubilate:focus,
html[data-theme="dark"] .row.is-stream .song-entry :is(input, textarea).liednr-band,
html[data-theme="dark"] .row.is-stream .song-entry :is(input, textarea).liednr-band:hover,
html[data-theme="dark"] .row.is-stream .song-entry :is(input, textarea).liednr-band:focus {
  color: #c01515;
  caret-color: #c01515;
}
html[data-theme="dark"] .row.is-marker,
html[data-theme="dark"] .row.is-marker:hover,
html[data-theme="dark"] .row.is-marker.is-selected { background: #3a2430; }
html[data-theme="dark"] .time-pill.over { background: #3a2418; color: #fdba74; }
html[data-theme="dark"] .time-pill.ok { background: #14301f; color: #86efac; }
html[data-theme="dark"] .cal-day.is-sunday { background: #1c2420; }
html[data-theme="dark"] .cal-day.is-duty {
  background: #3a2228;
  border-color: #c46b86;
  box-shadow: inset 0 0 0 1px #c46b86;
}
html[data-theme="dark"] .cal-day.is-duty b,
html[data-theme="dark"] .cal-day.is-duty small { color: #f3c3d0; }
html[data-theme="dark"] .cal-list li { background: #3a2228; border-color: #c46b86; }
html[data-theme="dark"] .mail-person.is-missing,
html[data-theme="dark"] .mail-extra-note,
html[data-theme="dark"] .gate-error { color: #f0a090; }

.mail-always-label {
  margin: 0.75rem 0 0.2rem;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.copy-toggle.is-on { border-color: var(--wine); color: var(--wine); }
body.is-copy-edit [data-copy] { cursor: pointer; box-shadow: inset 0 -1px 0 var(--wine-mid); border-radius: 4px; }
body.is-copy-edit [data-copy]:hover { background: var(--wine-soft); }
.copy-ph { display: none; }
body.is-copy-edit .copy-ph {
  display: flex;
  width: fit-content;
  margin: 0 0 0.25rem;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: var(--wine-soft);
  color: var(--wine-dark);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.copy-pop {
  position: fixed;
  z-index: 80;
  width: min(22rem, calc(100vw - 1rem));
  padding: 0.7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.copy-pop textarea {
  width: 100%;
  min-height: 5.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  background: var(--surface);
  resize: vertical;
}
.copy-pop-note { min-height: 1.1rem; margin: 0.35rem 0; color: var(--wine); font-size: 13px; }
.copy-pop-actions { display: flex; justify-content: flex-end; gap: 0.4rem; }
body.show-auth-copy #auth {
  display: block !important;
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 0 1.2rem 2.5rem;
  min-height: 0;
}
body.show-auth-copy #gate-setup,
body.show-auth-copy #gate-login,
body.show-auth-copy #gate-account {
  display: block !important;
  margin: 0 auto 1rem;
}

@media print {
  @page { size: A4 portrait; margin: 10mm; }
  body.plan { background: #fff !important; }
  body.plan * { visibility: hidden; }
  #paper, #paper * { visibility: visible; }
  #paper {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    min-height: 0;
    max-height: none;
    overflow: visible;
    border: 0;
    box-shadow: none;
    padding: 0;
  }
  .paper.klassisch table { width: 100%; }
}
