:root {
  /* Apple-Systemfarben (hell) */
  --bg: #f2f2f7;
  --surface: #ffffff;
  --surface-2: #e5e5ea;
  --fill: rgba(118, 118, 128, .12);
  --fill-2: rgba(118, 118, 128, .2);
  --field: var(--fill);
  --text: #000000;
  --muted: #6e6e73;
  --tertiary: #c4c4c7;
  --border: #c6c6c8;
  --accent: #c2410c;
  --accent-strong: #9a3412;
  --accent-soft: rgba(194, 65, 12, .12);
  --on-accent: #ffffff;
  --switch-on: #34c759;
  --seg-on: #ffffff;
  --ok: #248a3d;
  --ok-soft: rgba(52, 199, 89, .15);
  --warn: #b25000;
  --warn-soft: rgba(255, 149, 0, .16);
  --danger: #d70015;
  --danger-soft: rgba(255, 59, 48, .12);
  --info: #0066cc;
  --info-soft: rgba(0, 122, 255, .12);
  --bar: rgba(249, 249, 249, .82);
  --shadow: none;
  --radius: 10px;
  --nav-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --fill: rgba(118, 118, 128, .24);
    --fill-2: rgba(118, 118, 128, .32);
    --text: #ffffff;
    --muted: #98989f;
    --tertiary: #5a5a5e;
    --border: #38383a;
    --accent: #ff9f0a;
    --accent-strong: #ffb340;
    --accent-soft: rgba(255, 159, 10, .2);
    --on-accent: #000000;
    --switch-on: #30d158;
    --seg-on: #636366;
    --ok: #30d158;
    --ok-soft: rgba(48, 209, 88, .18);
    --warn: #ffd60a;
    --warn-soft: rgba(255, 159, 10, .18);
    --danger: #ff453a;
    --danger-soft: rgba(255, 69, 58, .18);
    --info: #0a84ff;
    --info-soft: rgba(10, 132, 255, .2);
    --bar: rgba(22, 22, 24, .82);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --fill: rgba(118, 118, 128, .24); --fill-2: rgba(118, 118, 128, .32);
  --text: #ffffff; --muted: #98989f; --tertiary: #5a5a5e; --border: #38383a; --accent: #ff9f0a; --accent-strong: #ffb340;
  --accent-soft: rgba(255, 159, 10, .2); --on-accent: #000000; --switch-on: #30d158; --seg-on: #636366;
  --ok: #30d158; --ok-soft: rgba(48, 209, 88, .18); --warn: #ffd60a; --warn-soft: rgba(255, 159, 10, .18);
  --danger: #ff453a; --danger-soft: rgba(255, 69, 58, .18); --info: #0a84ff; --info-soft: rgba(10, 132, 255, .2);
  --bar: rgba(22, 22, 24, .82); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--muted); }
code { font-size: .875em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; word-break: break-all; }

#app.loading::after {
  content: ""; display: block; width: 32px; height: 32px; margin: 30vh auto 0;
  border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 880px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; text-decoration: none; color: var(--text); }
.brand img { width: 30px; height: 30px; }
.main { max-width: 880px; margin: 0 auto; padding: 20px 16px calc(var(--nav-h) + 40px); }

.nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-around;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: .75rem; font-weight: 500;
}
.nav a svg { width: 24px; height: 24px; }
.nav a[aria-current="page"] { color: var(--accent); }
@media (min-width: 760px) {
  .nav { position: static; background: none; border: 0; padding: 0; margin-left: auto; gap: 4px; justify-content: flex-end; }
  .nav a { flex: none; flex-direction: row; gap: 8px; padding: 8px 12px; font-size: .9rem; }
  .nav a svg { width: 18px; height: 18px; }
  .nav a[aria-current="page"] { background: var(--accent-soft); }
  .main { padding-bottom: 60px; }
}

.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin-right: auto; }

/* ---------- Bausteine ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.card + .card, .section + .section { margin-top: 16px; }
.card h2 { margin-bottom: 10px; }
.stack > * + * { margin-top: 12px; }

.btn {
  appearance: none; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; font-size: .95rem; padding: 10px 16px; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; min-height: 44px;
}
.btn:hover { background: var(--surface-2); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .nav a:focus-visible, .row:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { background: none; border-color: transparent; }
.btn.small { padding: 6px 12px; min-height: 36px; font-size: .875rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row.end { justify-content: flex-end; }

.fab {
  position: fixed; right: 18px; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); z-index: 9;
  width: 58px; height: 58px; border-radius: 50%; border: 0;
  background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 20px rgba(194, 65, 12, .35);
  display: grid; place-items: center; cursor: pointer;
}
.fab svg { width: 28px; height: 28px; }
@media (min-width: 760px) { .fab { display: none; } }
.desktop-only { display: none; }
@media (min-width: 760px) { .desktop-only { display: inline-flex; } }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field + .field { margin-top: 14px; }
.field-row { display: grid; gap: 10px; grid-template-columns: 1fr 1.6fr 1.2fr; }
input[type=text], input[type=email], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; min-height: 44px;
}
textarea { min-height: 80px; resize: vertical; }
.hint { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; margin: 0; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }

.choices { display: grid; gap: 8px; }
.choice {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px; margin: 0;
  border: 1px solid var(--border); border-radius: 12px; cursor: pointer; font-weight: 400;
}
.choice input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice strong { display: block; }
.choice span { font-size: .875rem; color: var(--muted); }
.share-list { display: grid; gap: 8px; margin: 10px 0 0 30px; }

.notice { border-radius: 12px; padding: 12px 14px; font-size: .925rem; }
.notice.warn { background: var(--warn-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.notice.info { background: var(--info-soft); border: 1px solid color-mix(in srgb, var(--info) 30%, transparent); }
.notice.ok { background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
.notice.danger { background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }

.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 600;
  padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.badge svg { width: 12px; height: 12px; }
.badge.family { background: var(--info-soft); color: var(--info); }
.badge.private { background: var(--surface-2); color: var(--muted); }
.badge.selected { background: var(--warn-soft); color: var(--warn); }
.badge.new { background: var(--ok-soft); color: var(--ok); }
.badge.duplicate { background: var(--danger-soft); color: var(--danger); }
.badge.possible { background: var(--warn-soft); color: var(--warn); }
.badge.invalid { background: var(--surface-2); color: var(--muted); }

/* ---------- Liste ---------- */
.toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .85rem;
  padding: 6px 12px; border-radius: 99px; cursor: pointer; white-space: nowrap; min-height: 34px;
}
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

.group-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 4px 8px; font-weight: 700; }
.group-title:first-child { margin-top: 0; }
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; width: 100%;
  border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.row + .row { border-top: 1px solid var(--border); }
.row:hover { background: var(--surface-2); }
.datebox {
  flex: none; width: 3.125rem; text-align: center; border-radius: 10px; padding: 5px 0 6px;
  background: var(--surface-2); line-height: 1.1;
}
.datebox b { display: block; font-size: 1.25rem; }
.datebox span { font-size: .7rem; text-transform: uppercase; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.row.today .datebox { background: var(--accent); color: var(--on-accent); }
.row.today .datebox span { color: inherit; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-sub { font-size: .875rem; color: var(--muted); }
.row-side { text-align: right; font-size: .85rem; flex: none; }
.row-side strong { display: block; font-size: .95rem; }
.row.today .row-side strong { color: var(--accent); }

.hero {
  background: linear-gradient(135deg, var(--accent-soft), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 20px;
}
.hero h2 { font-size: 1.05rem; margin-bottom: 4px; }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .big { font-size: 2.5rem; }

/* ---------- Dialog ---------- */
dialog {
  border: 0; padding: 0; border-radius: 18px; background: var(--surface); color: var(--text);
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
dialog::backdrop { background: rgba(20, 12, 8, .45); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.dialog-body { padding: 18px; }
.dialog-foot { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }
.dialog-foot .right { display: flex; gap: 10px; margin-left: auto; }
.icon-btn { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 8px; border-radius: 8px; display: grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }
@media (max-width: 560px) {
  dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 92dvh; }
}

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 24px); transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-size: .925rem; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 1000; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 760px) { #toast { bottom: 28px; } }

/* ---------- Login ---------- */
.auth { max-width: 400px; margin: 0 auto; padding: 12vh 16px 40px; }
.auth .logo { width: 64px; height: 64px; display: block; margin: 0 auto 16px; }
.auth h1 { text-align: center; margin-bottom: 6px; }
.auth .lead { text-align: center; color: var(--muted); margin-bottom: 24px; }

/* ---------- Import ---------- */
.dropzone {
  display: block; border: 2px dashed var(--border); border-radius: var(--radius); padding: 28px 16px; text-align: center;
  cursor: pointer; background: var(--surface); font-weight: 500;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone svg { width: 32px; height: 32px; color: var(--accent); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
tr.dim td { color: var(--muted); }
td input[type=checkbox], th input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
td .reason { display: block; font-size: .8rem; color: var(--muted); }
.summary { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }

details.howto { border: 1px solid var(--border); border-radius: 12px; padding: 0 14px; background: var(--surface); }
details.howto + details.howto { margin-top: 8px; }
details.howto summary { cursor: pointer; font-weight: 600; padding: 12px 0; }
details.howto ol, details.howto ul { margin: 0 0 14px; padding-left: 20px; }
details.howto li + li { margin-top: 4px; }

.copy-field { display: flex; gap: 8px; }
.copy-field input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }

.member { display: flex; align-items: center; gap: 12px; padding: 12px 14px; flex-wrap: wrap; }
.member + .member { border-top: 1px solid var(--border); }
.avatar {
  width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong);
  display: grid; place-items: center; font-weight: 700; flex: none;
}
.member-main { flex: 1; min-width: 160px; }
.member-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.btn-row.center { justify-content: center; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.plain[disabled] { opacity: .55; }
@media (max-width: 559px) {
  .member-actions { width: 100%; padding-left: 52px; }
  .member-actions .btn { flex: 1 1 auto; }
}
fieldset.plain legend { font-weight: 600; font-size: .9rem; padding: 0; margin-bottom: 8px; }
.check span small { color: var(--muted); font-weight: 400; }
.check:has(span) { align-items: flex-start; }
.check:has(span) input { margin-top: 2px; }
.banner { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.banner-text { display: flex; gap: 12px; align-items: flex-start; }
.banner-text svg { width: 22px; height: 22px; flex: none; color: var(--info); margin-top: 2px; }
.notice svg { width: 16px; height: 16px; vertical-align: -3px; }
@media (min-width: 640px) { .banner { flex-direction: row; align-items: center; justify-content: space-between; } }
fieldset.plain + fieldset.plain { margin-top: 22px; }

/* =========================================================================
   Navigation & Einstellungen
   ========================================================================= */
:root {
  --pc0: #d9480f; --pc1: #007aff; --pc2: #248a3d; --pc3: #af52de; --pc4: #d1214f; --pc5: #0a7f95;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --pc0: #ff9f0a; --pc1: #0a84ff; --pc2: #30d158; --pc3: #bf5af2; --pc4: #ff375f; --pc5: #40c8e0; }
}
:root[data-theme="dark"] { --pc0: #ff9f0a; --pc1: #0a84ff; --pc2: #30d158; --pc3: #bf5af2; --pc4: #ff375f; --pc5: #40c8e0; }

.page-head.sub { flex-direction: column; align-items: flex-start; gap: 4px; }
.page-head.sub .sub-title { display: flex; align-items: center; gap: 12px; width: 100%; flex-wrap: wrap; }
.page-head.sub h1 { margin-right: auto; }
.back {
  display: inline-flex; align-items: center; gap: 2px; color: var(--accent); text-decoration: none;
  font-weight: 600; font-size: .95rem; margin-left: -6px; padding: 4px 6px; border-radius: 8px;
}
.back svg { width: 20px; height: 20px; }
.back:hover { background: var(--accent-soft); }

.menu { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-top: 16px; }
.menu-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: var(--text); text-decoration: none;
}
.menu .menu-item + .menu-item { border-top: 1px solid var(--border); }
.menu-item:hover { background: var(--surface-2); }
.menu-icon {
  width: 2.375rem; height: 2.375rem; border-radius: 10px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; flex: none;
}
.menu-icon svg { width: 20px; height: 20px; }
.menu-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.menu-text small { color: var(--muted); font-size: .85rem; }
.menu-chev { color: var(--muted); display: grid; place-items: center; }
.menu-chev svg { width: 18px; height: 18px; }
a.card.menu-item, .profile-card { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); }
a.card.menu-item { margin-top: 16px; padding: 14px 16px; }
.profile-card:hover, a.card.menu-item:hover { background: var(--surface-2); }
.avatar.big { width: 3.25rem; height: 3.25rem; font-size: 1.2rem; }

/* =========================================================================
   Dienste
   ========================================================================= */
.invisible { visibility: hidden; }
.setup-card h2 { display: flex; align-items: center; gap: 8px; }
.setup-card h2 svg { width: 22px; height: 22px; color: var(--accent); }

.week-nav { display: flex; align-items: center; gap: 6px; margin: 4px 0 12px; }
.week-nav .icon-btn { border: 1px solid var(--border); background: var(--surface); width: 40px; height: 40px; }
.week-title { flex: 1; text-align: center; display: flex; flex-direction: column; line-height: 1.25; }
.week-title span { color: var(--muted); font-size: .875rem; }

.day-row { display: flex; gap: 12px; padding: 10px 12px; align-items: flex-start; }
.day-row + .day-row { border-top: 1px solid var(--border); }
.day-row.weekend { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.day-row.today { box-shadow: inset 4px 0 0 var(--accent); background: var(--accent-soft); }
.day-label { width: 2.75rem; flex: none; display: flex; flex-direction: column; line-height: 1.2; padding-top: 4px; }
.day-label b { font-size: 1rem; }
.day-label span { font-size: .78rem; color: var(--muted); }
.day-row.today .day-label b { color: var(--accent); }
.day-chips { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; min-height: 34px; align-items: center; }

.shift-chip {
  --c: var(--pc0);
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 9px;
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
  background: color-mix(in srgb, var(--c) 12%, var(--surface));
  color: var(--text); font: inherit; font-size: .875rem; line-height: 1.3; min-height: 32px;
  font-variant-numeric: tabular-nums;
}
button.shift-chip { cursor: pointer; }
button.shift-chip:hover { border-color: var(--c); }
.shift-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.shift-chip b { font-weight: 700; }
.shift-chip em { font-style: normal; color: var(--c); }
.shift-chip.off { background: var(--surface); color: var(--muted); border-color: var(--border); }
.shift-chip.pattern { border-style: dashed; }
.shift-chip.me { box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 25%, transparent); }
.shift-chip.add {
  color: var(--accent); background: none; border: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent); font-weight: 600;
}
.shift-chip.add svg { width: 14px; height: 14px; }
.pc0 { --c: var(--pc0); } .pc1 { --c: var(--pc1); } .pc2 { --c: var(--pc2); }
.pc3 { --c: var(--pc3); } .pc4 { --c: var(--pc4); } .pc5 { --c: var(--pc5); }
.legend { margin: 8px 4px 16px; }

/* Tag bearbeiten */
.dialog-head .day-head { flex: 1; min-width: 0; text-align: center; display: flex; flex-direction: column; }
.dialog-head .day-head h2 { font-size: 1.05rem; }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.quick {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit;
  padding: 12px 14px; border-radius: 12px; cursor: pointer; min-height: 60px;
}
.quick:hover { border-color: var(--accent); background: var(--accent-soft); }
.quick small { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.quick.off strong { color: var(--muted); }
.custom-form { border-top: 1px solid var(--border); padding-top: 14px; }

.time-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.time-grid .field + .field { margin-top: 0; }
input[type=time] {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; min-height: 44px;
}
details.pause { margin-top: 10px; }
details.pause summary { cursor: pointer; font-weight: 600; font-size: .9rem; padding: 4px 0 8px; }

/* Einstellungen Dienstplan */
.settings-sections section + section { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 18px; }
.settings-sections h3 { font-size: 1rem; }
.weekday-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { margin: 0; cursor: pointer; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill span {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-size: .9rem; color: var(--muted);
}
.pill input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pill input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.per-day-row { border: 1px solid var(--border) !important; border-radius: 12px; padding: 10px 12px 12px !important; }
.per-day-row legend { padding: 0 4px; }
.toggle-row { padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.preset-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; flex-wrap: wrap; }
.preset-row + .preset-row { border-top: 1px solid var(--border); }
.list.presets { box-shadow: none; }
.pad { padding: 12px 14px; margin: 0; }
@media (max-width: 559px) {
  .preset-row .member-actions { width: 100%; padding-left: 0; }
}
.pattern-editor > * + * { margin-top: 12px; }
.pattern-editor > .check { margin-top: 16px; }

/* Urlaub / Krank */
.shift-chip.vacation, .shift-chip.sick { background: var(--surface); border-style: solid; }
.shift-chip.sick span:last-of-type { color: var(--danger); }
input[type=date] {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; min-height: 44px;
}
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-item { margin: 0; cursor: pointer; font-weight: 500; }
.seg-item input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-item span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface); font-size: .925rem;
}
.seg-item input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.seg-item input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.page-head .btn.small + .btn.small { margin-left: -4px; }
.time-grid + .check { margin-top: 16px; }

/* Wiederholungen */
.shift-chip.rule { border-style: dotted; }
.rule-mark { color: var(--c); font-weight: 700; }
.rule-row { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.rule-row:hover { background: var(--surface-2); }
.legend a { color: var(--accent); }

/* =========================================================================
   Termine
   ========================================================================= */
.ev-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.ev-controls input[type=search] { flex: 1 1 200px; }
.view-switch { flex: none; }
.view-switch .chip { min-width: 4rem; }

.owner-chip {
  --c: var(--pc0);
  display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 700; flex: none;
  padding: 3px 8px; border-radius: 99px; background: color-mix(in srgb, var(--c) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
}
.owner-chip .dot, .ev-chip .dot, .mc-label .dot, .mc-dots .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; display: inline-block; }

.ev-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; width: 100%;
  border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.ev-row + .ev-row { border-top: 1px solid var(--border); }
.ev-row:hover { background: var(--surface-2); }
.ev-row.past { opacity: .6; }
.ev-time { width: 4.625rem; flex: none; font-weight: 700; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; font-size: .95rem; }
.ev-time small { font-weight: 400; color: var(--muted); }
.ev-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ev-main small { color: var(--muted); font-size: .85rem; }

.day-label.link { border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; padding: 4px 0 0; }
.day-label.link:hover b { color: var(--accent); }
.ev-chip {
  --c: var(--pc0);
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 9px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
  background: color-mix(in srgb, var(--c) 12%, var(--surface));
  color: var(--text); font: inherit; font-size: .875rem; line-height: 1.3; min-height: 32px; max-width: 100%;
}
.ev-chip:hover { border-color: var(--c); }
.ev-chip .t { font-variant-numeric: tabular-nums; color: var(--muted); }
.ev-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.month-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.month-grid .mh { text-align: center; font-size: .75rem; font-weight: 700; color: var(--muted); padding: 8px 0; background: var(--surface-2); text-transform: uppercase; }
.mc {
  border: 0; border-top: 1px solid var(--border); border-left: 1px solid var(--border); background: none; font: inherit; color: inherit;
  min-height: 92px; padding: 4px; display: flex; flex-direction: column; align-items: stretch; gap: 2px; cursor: pointer; text-align: left; min-width: 0;
}
.mc:nth-child(7n + 1) { border-left: 0; }
.mc:hover { background: var(--surface-2); }
.mc.other { background: color-mix(in srgb, var(--surface-2) 50%, var(--surface)); }
.mc.other .mc-num { color: var(--muted); font-weight: 400; }
.mc-num { font-size: .85rem; font-weight: 700; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.mc.today .mc-num { background: var(--accent); color: var(--on-accent); }
.mc-items { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mc-label {
  --c: var(--pc0);
  display: flex; align-items: center; gap: 4px; font-size: .72rem; line-height: 1.25; padding: 1px 4px; border-radius: 4px;
  background: color-mix(in srgb, var(--c) 12%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mc-more { font-size: .72rem; color: var(--muted); padding-left: 4px; }
.mc-dots { display: none; gap: 3px; flex-wrap: wrap; padding: 2px 4px; }
.mc-dots .dot { width: 7px; height: 7px; }
@media (max-width: 640px) {
  .mc { min-height: 56px; align-items: center; }
  .mc-items { display: none; }
  .mc-dots { display: flex; justify-content: center; }
}

/* Personenfarben zuletzt, damit sie die Grundfarbe der Chips überschreiben */
.pc0 { --c: var(--pc0); } .pc1 { --c: var(--pc1); } .pc2 { --c: var(--pc2); }
.pc3 { --c: var(--pc3); } .pc4 { --c: var(--pc4); } .pc5 { --c: var(--pc5); }
#event-form .field + .check, #event-form .check + .time-grid { margin-top: 14px; }

/* Termin direkt am Tag anlegen */
.ev-add {
  width: 32px; height: 32px; border-radius: 9px; border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  background: none; color: var(--accent); display: inline-grid; place-items: center; cursor: pointer; flex: none;
}
.ev-add svg { width: 16px; height: 16px; }
.ev-add:hover { background: var(--accent-soft); }
.add-below { margin-top: 12px; }
.toggle-row.last { border-bottom: 0; padding-bottom: 0; }
#ev-body, #shift-week { will-change: transform; }

/* Gleicher Aufbau für Termine und Dienste: Kopf · Ansicht · Blättern · Tage */
.view-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; min-height: 40px; }
.view-row .chip { min-height: 36px; }
.search-row input[type=search] { flex: 1; min-height: 40px; }
.btn.icon-only { padding: 6px; width: 36px; }
.btn.icon-only svg { width: 18px; height: 18px; }
.day-row { min-height: 58px; }
.day-label.link { padding: 4px 0 0; line-height: 1.2; }
.ev-add { width: 30px; height: 30px; }
/* Dienste im Monat */
.shift-month .mc-label.off, .shift-month .mc-label.vacation, .shift-month .mc-label.sick { background: none; color: var(--muted); }
.mc-dots .dot.ring { background: none; box-shadow: inset 0 0 0 1.5px var(--c); }

/* Kompakte Chips, damit zwei Personen in eine Zeile passen */
.shift-chip, .ev-chip { padding: 4px 8px; gap: 5px; font-size: .82rem; min-height: 30px; }
.day-chips { gap: 5px; }
.shift-chip .dot, .ev-chip .dot { width: 7px; height: 7px; }

/* Kein Zoomen per Doppeltipp (wirkt wie eine echte App) */
html, body { touch-action: manipulation; }

/* =========================================================================
   Knöpfe oben rechts: Neuigkeiten & Rückmeldungen
   ========================================================================= */
.head-actions { display: flex; gap: 8px; margin-left: auto; }
@media (min-width: 760px) { .head-actions { margin-left: 8px; } }
.round-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; flex: none;
}
.round-btn:hover { background: var(--surface-2); }
.round-btn svg { width: 19px; height: 19px; }
.badge-dot {
  position: absolute; top: -1px; right: -1px; width: 12px; height: 12px; border-radius: 50%;
  box-shadow: 0 0 0 2px var(--bg);
}
.badge-dot.info { background: var(--info); }
.badge-dot.action { background: #f59e0b; animation: dot-pulse 2s ease-in-out infinite; }
@keyframes dot-pulse { 50% { transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .badge-dot.action { animation: none; } }

.news-item { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.news-item.is-new { border-color: color-mix(in srgb, var(--info) 45%, var(--border)); background: color-mix(in srgb, var(--info-soft) 40%, var(--surface)); }
.news-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.news-head small { margin-left: auto; }
.news-item ul { margin: 8px 0 0; padding-left: 20px; }
.news-item li + li { margin-top: 4px; }
.action-box {
  border-radius: 12px; padding: 12px 14px; margin-top: 10px;
  background: color-mix(in srgb, #f59e0b 14%, var(--surface)); border: 1px solid color-mix(in srgb, #f59e0b 45%, transparent);
}
.action-box p { margin: 4px 0 10px; }

.req { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.req.unread { border-color: color-mix(in srgb, var(--info) 45%, var(--border)); }
.req.closed { opacity: .65; }
.req-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.req-head small { margin-left: auto; }
.req-text { margin: 8px 0 0; white-space: pre-wrap; }
.req-note { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: .925rem; }
.req .btn-row { margin-top: 10px; }
.req-list-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; margin-top: 8px; }
.badge.status-new { background: var(--info-soft); color: var(--info); }
.badge.status-progress { background: var(--warn-soft); color: var(--warn); }
.badge.status-done { background: var(--ok-soft); color: var(--ok); }
.badge.status-rejected { background: var(--surface-2); color: var(--muted); }
.spacer { flex: 1; }

/* Offline-Hinweis unter der Kopfzeile */
.offline-bar {
  position: sticky; top: 65px; z-index: 9; text-align: center; font-size: .875rem; font-weight: 600;
  padding: 8px 16px; background: var(--warn-soft); color: var(--text);
  border-bottom: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
}

/* Personen & Gruppen */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

/* Termine per E-Mail */
ol.steps { margin: 0; padding-left: 20px; }
ol.steps li + li { margin-top: 6px; }

/* Hinweis Samsung-Browser */
.samsung-hint { margin-bottom: 16px; text-align: left; }
.auth .samsung-hint { margin-bottom: 16px; }

/* =========================================================================
   Größere Schrift (Einstellungen → Ansicht)
   Alles in rem wächst mit; Kästchen sind in rem, damit nichts überläuft.
   ========================================================================= */
html.large-text { font-size: 118.75%; } /* 19 px statt 16 px */
/* Untere Leiste: Beschriftung bleibt kompakt, damit 4 Tabs nebeneinander passen */
@media (max-width: 759px) {
  html.large-text .nav a { font-size: 12px; }
}
html.large-text .day-chips { gap: 4px; }
/* Größere Schrift auf schmalen Handys: „Übermorgen · wird 80“ unter den Namen statt daneben */
@media (max-width: 480px) {
  html.large-text .row { flex-wrap: wrap; row-gap: 2px; }
  html.large-text .row-side {
    flex-basis: 100%; text-align: left; padding-left: calc(3.125rem + 14px);
    display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap;
  }
  html.large-text .row-side strong { display: inline; }
}

/* Persönliche Adresse für Termine per E-Mail – ganz sichtbar, bricht um */
.addr-box {
  flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem;
  overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; align-self: center;
}

/* Zwei Felder nebeneinander: dürfen schmaler werden als ihr Inhalt (iPhone-Datums-/Zeitfelder) */
.time-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.time-grid > * { min-width: 0; }
input[type=date], input[type=time] { min-width: 0; max-width: 100%; display: block; -webkit-appearance: none; appearance: none; }
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: left; }
dialog { overflow-x: hidden; overscroll-behavior: contain; }
.dialog-body { overflow-x: hidden; }
.hint.overnight { margin-top: 8px; color: var(--text); }

/* Im Monat angetippter Tag – in der Woche kurz hervorgehoben */
.day-row.picked { animation: picked-day 1.8s ease-out; }
@keyframes picked-day { 0%, 40% { background: var(--accent-soft); } 100% { background: transparent; } }

/* =========================================================================
   Apple-Design (wie die iOS-Apps Kalender & Einstellungen)
   Steht bewusst am Ende und überschreibt die älteren Regeln weiter oben.
   ========================================================================= */
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem; line-height: 1.35; letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1 { font-size: 2.125rem; font-weight: 700; letter-spacing: .01em; line-height: 1.15; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1.0625rem; font-weight: 600; }
small, .muted { color: var(--muted); }

/* ---------- Kopfzeile mit Milchglas ---------- */
.topbar { background: var(--bar); border-bottom: .5px solid var(--border); }
.topbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.topbar-inner { padding: 8px 16px; }
.brand { font-size: 1.0625rem; font-weight: 600; gap: 8px; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.round-btn { border: 0; background: none; color: var(--accent); width: 38px; height: 38px; }
.round-btn:hover { background: var(--fill); }
.round-btn svg { width: 22px; height: 22px; }
.badge-dot { top: 3px; right: 3px; width: 10px; height: 10px; box-shadow: 0 0 0 2px var(--bg); }
.badge-dot.info { background: #007aff; }
.badge-dot.action { background: #ff9500; }

/* ---------- Tab-Leiste unten (Handy) ---------- */
@media (max-width: 759px) {
  .nav {
    background: var(--bar); border-top: .5px solid var(--border);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    padding: 4px 0 calc(2px + env(safe-area-inset-bottom));
  }
  .nav a { font-size: 10px; font-weight: 500; letter-spacing: .01em; gap: 2px; padding: 4px 0; color: #8e8e93; }
  .nav a svg { width: 26px; height: 26px; }
  .nav a[aria-current="page"] { color: var(--accent); }
}
@media (min-width: 760px) {
  .nav a { color: var(--muted); border-radius: 8px; }
  .nav a:hover { background: var(--fill); }
  .nav a[aria-current="page"] { background: var(--fill); color: var(--text); }
}

/* ---------- Seitenkopf: großer Titel ---------- */
.main { padding-top: 10px; }
.page-head { margin: 4px 0 14px; gap: 8px; }
.page-head.sub h1 { font-size: 1.75rem; }
.back { font-weight: 400; font-size: 1.0625rem; margin-left: -8px; }
.back svg { width: 22px; height: 22px; }
.back:hover { background: none; opacity: .7; }

/* ---------- Karten & Listen (gruppiert wie in iOS) ---------- */
.card, .list, .menu, .month-grid, .hero { border: 0; box-shadow: none; border-radius: var(--radius); }
.card { padding: 16px; }
.card + .card { margin-top: 20px; }
.card h2 { font-size: 1.125rem; }
.group-title, .sec-head {
  font-size: .8125rem; font-weight: 400; text-transform: uppercase; letter-spacing: .02em; color: var(--muted);
  margin: 26px 16px 7px;
}
.group-title:first-child, .sec-head:first-child { margin-top: 6px; }
.sec-foot { font-size: .8125rem; color: var(--muted); margin: 7px 16px 0; }
.group { background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.group + .group { margin-top: 20px; }

/* Haarlinien zwischen Zeilen, eingerückt wie in iOS */
.row + .row, .menu .menu-item + .menu-item, .member + .member, .preset-row + .preset-row, .ev-row + .ev-row, .day-row + .day-row { border-top: 0; }
.row, .menu-item, .member, .preset-row, .ev-row, .day-row, .cell { position: relative; }
.row + .row::before, .menu .menu-item + .menu-item::before, .member + .member::before, .preset-row + .preset-row::before,
.ev-row + .ev-row::before, .day-row + .day-row::before, .cell + .cell::before, .choice + .choice::before, .choices .share-list + .choice::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--border); pointer-events: none;
}
.row + .row::before { left: calc(16px + 3.125rem + 14px); }
.group.icons .cell + .cell::before, .menu .menu-item + .menu-item::before { left: 58px; }
.member + .member::before { left: calc(16px + 2.5rem + 12px); }

.row, .menu-item, .member, .preset-row, .ev-row { padding: 11px 16px; }
.row:hover, .menu-item:hover, .ev-row:hover, .rule-row:hover, a.cell:hover, button.cell:hover { background: var(--fill); }
.row:active, .menu-item:active, .ev-row:active, a.cell:active, button.cell:active { background: var(--fill-2); }

/* Zeilen für Einstellungen */
.cell {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 9px 16px; width: 100%;
  color: var(--text); text-decoration: none; border: 0; background: none; font: inherit; text-align: left; margin: 0;
}
button.cell, a.cell { cursor: pointer; }
.cell-icon {
  width: 30px; height: 30px; border-radius: 7px; flex: none; display: grid; place-items: center; color: #fff;
}
.cell-icon svg { width: 18px; height: 18px; }
.ic-red { background: #ff3b30; } .ic-orange { background: #ff9500; } .ic-blue { background: #007aff; }
.ic-sky { background: #32ade6; } .ic-green { background: #34c759; } .ic-gray { background: #8e8e93; }
.ic-indigo { background: #5856d6; } .ic-pink { background: #ff2d55; } .ic-brown { background: #a2845e; }
.cell-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cell-text small { font-size: .8125rem; color: var(--muted); }
.cell-value { color: var(--muted); flex: none; max-width: 50%; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-chev, .menu-chev { color: var(--tertiary); flex: none; display: grid; place-items: center; }
.cell-chev svg, .menu-chev svg { width: 16px; height: 16px; stroke-width: 2.6; }
.cell.tint { color: var(--accent); }
.cell.tint svg { width: 20px; height: 20px; }
.cell.danger { color: var(--danger); justify-content: center; }
.cell.center { justify-content: center; }
.cell .btn { flex: none; }

/* Auswahl in einer Zeile (wie iOS-Menü: Wert rechts) */
.select-cell select {
  width: auto; max-width: 62%; margin-left: auto; min-height: 0; padding: 4px 22px 4px 4px; text-align: right; text-align-last: right;
  background: none; color: var(--muted); border: 0; -webkit-appearance: none; appearance: none; font-size: 1.0625rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='16' viewBox='0 0 10 16' fill='none' stroke='%238e8e93' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.5 5.5 5 2l3.5 3.5M1.5 10.5 5 14l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 4px center; cursor: pointer;
}
.select-cell > span, .select-cell > label { flex: 1; min-width: 0; }
.select-cell { cursor: pointer; }

/* Menü der Einstellungen (alte Bausteine im neuen Look) */
.menu { margin-top: 0; }
.menu-icon { width: 30px; height: 30px; border-radius: 7px; background: var(--accent); color: #fff; }
.menu-icon svg { width: 18px; height: 18px; }
.menu-text small { font-size: .8125rem; }
a.card.menu-item { padding: 11px 16px; }
.profile-card { padding: 12px 16px; }
.avatar { background: linear-gradient(180deg, #a1a1a6, #8e8e93); color: #fff; font-weight: 600; }
.avatar.big { width: 3.75rem; height: 3.75rem; font-size: 1.5rem; }

/* ---------- Knöpfe ---------- */
.btn {
  border: 0; background: var(--fill); color: var(--accent); font-weight: 600; font-size: 1rem;
  border-radius: 12px; padding: 10px 18px; min-height: 44px; letter-spacing: -.01em;
}
.btn:hover { background: var(--fill-2); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { background: none; }
.btn.ghost:hover { background: var(--fill); }
.btn.small { min-height: 34px; padding: 6px 14px; border-radius: 99px; font-size: .9375rem; }
.btn.icon-only { width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: 50%; }
.btn.icon-only svg { width: 19px; height: 19px; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .nav a:focus-visible, .row:focus-visible, .cell:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 1px;
}
.fab { display: none !important; }

/* ---------- Eingabefelder ---------- */
input[type=text], input[type=email], input[type=number], input[type=search], select, textarea, input[type=time], input[type=date] {
  background: var(--field); border: 0; border-radius: 10px; font-size: 1.0625rem; color: var(--text); min-height: 44px; padding: 10px 12px;
}
input[type=search] { border-radius: 10px; padding-left: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 11px center; }
input::placeholder, textarea::placeholder { color: #8e8e93; opacity: 1; }
.field > label, fieldset.plain > legend {
  font-size: .8125rem; font-weight: 400; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); margin: 0 0 6px 4px;
}
.field > label .muted { text-transform: none; }
.hint { font-size: .8125rem; margin: 6px 4px 0; }

/* ---------- Schalter statt Häkchen ---------- */
.check { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 400; min-height: 44px; font-size: 1.0625rem; }
.check:has(span) { align-items: center; }
.check > input[type=checkbox] {
  order: 2; margin: 0 0 0 auto; flex: none; width: 51px; height: 31px; border-radius: 16px; position: relative; cursor: pointer;
  -webkit-appearance: none; appearance: none; background: var(--fill-2); transition: background .2s;
}
.check > input[type=checkbox]::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); transition: transform .2s;
}
.check > input[type=checkbox]:checked { background: var(--switch-on); }
.check > input[type=checkbox]:checked::before { transform: translateX(20px); }
.check > input[type=checkbox]:disabled { opacity: .5; }
.check:has(span) input { margin-top: 0; }
.check span small { font-size: .8125rem; }
.check + .check, .toggle-row + .toggle-row { border-top: .5px solid var(--border); padding-top: 8px; margin-top: 8px; }
.stack > .check + .check { margin-top: 8px; }
.toggle-row { border-bottom: 0; padding-bottom: 0; }
.check.cell + .check.cell { border-top: 0; margin-top: 0; padding-top: 9px; }

/* ---------- Auswahl als Liste mit Haken (Sichtbarkeit, Teilen) ---------- */
.choices { gap: 0; background: var(--field); border-radius: var(--radius); overflow: hidden; }
.choice { border: 0; border-radius: 0; padding: 10px 16px; align-items: center; position: relative; gap: 10px; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.choice > div { flex: 1; min-width: 0; }
.choice strong { font-weight: 400; }
.choice span { font-size: .8125rem; }
.choice::after {
  content: ""; flex: none; width: 14px; height: 12px; opacity: 0;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 12'%3E%3Cpath d='M1.5 6.5 5.2 10 12.5 1.8' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 12'%3E%3Cpath d='M1.5 6.5 5.2 10 12.5 1.8' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.choice:has(input:checked) { background: none; border: 0; }
.choice:has(input:checked)::after { opacity: 1; }
.choice:has(input:checked) strong { color: var(--accent); }
.choice:has(input:disabled) { opacity: .45; }
.choice:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: -3px; }
.choices .share-list, .share-list { margin: 0; padding: 0 16px 6px 32px; gap: 0; }
.share-list:not(.choices .share-list) { background: var(--field); border-radius: var(--radius); margin-top: 8px; padding: 2px 16px; }
.share-list .check { min-height: 40px; font-size: 1rem; }
.share-list .check + .check { padding-top: 4px; margin-top: 4px; }

/* ---------- Segmente (Tag | Woche | Monat) ---------- */
.seg, .view-switch {
  display: inline-flex; flex-wrap: nowrap; gap: 0; padding: 2px; border-radius: 9px; background: var(--fill);
}
.view-switch .chip, .seg-item > span {
  border: 0; background: none; border-radius: 7px; min-height: 30px; padding: 4px 16px; font-size: .875rem; font-weight: 500;
  color: var(--text); box-shadow: none; display: inline-flex; align-items: center; justify-content: center;
}
.view-switch .chip { min-width: 4.5rem; }
.view-switch .chip[aria-pressed="true"], .seg-item > input:checked + span {
  background: var(--seg-on); color: var(--text); font-weight: 600; box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04);
}
.seg-item { flex: 1; }
.seg-item > span { width: 100%; gap: 4px; }
.seg.full { display: flex; width: 100%; }
.view-row .chip { min-height: 30px; }

/* Filter-Chips (Geburtstage) */
.chip { border: 0; background: var(--fill); color: var(--text); font-weight: 500; font-size: .9375rem; min-height: 32px; padding: 5px 14px; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border: 0; }

/* ---------- Hinweise & Etiketten ---------- */
.notice { border: 0 !important; border-radius: var(--radius); font-size: .9375rem; }
.notice.info { background: var(--info-soft); }
.notice.warn { background: var(--warn-soft); }
.notice.ok { background: var(--ok-soft); }
.notice.danger { background: var(--danger-soft); }
.badge { font-weight: 500; font-size: .75rem; border-radius: 6px; padding: 2px 7px; background: var(--fill); }
.badge.family { background: var(--info-soft); color: var(--info); }
.badge svg { display: none; }

/* ---------- Geburtstage ---------- */
.hero { background: var(--surface); padding: 14px 16px; margin-bottom: 18px; }
.hero h2 { font-size: 1.0625rem; font-weight: 600; }
.hero p { margin: 0; }
.datebox { background: none; padding: 2px 0; width: 3.125rem; }
.datebox b { font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; }
.datebox span { color: var(--accent); font-weight: 600; font-size: .6875rem; }
.row.today .datebox { background: var(--accent); color: var(--on-accent); border-radius: 10px; }
.row-title { font-weight: 400; }
.row-sub, .row-side span { font-size: .875rem; }
.row-side strong { font-weight: 400; color: var(--muted); font-size: .9375rem; }
.row.today .row-side strong { font-weight: 600; }
.toolbar { gap: 10px; margin-bottom: 4px; }
.empty .big { font-size: 3rem; }

/* ---------- Dialoge als iOS-Sheet ---------- */
dialog { background: var(--bg); border-radius: 14px; box-shadow: 0 12px 48px rgba(0, 0, 0, .3); --field: var(--surface); }
dialog::backdrop { background: rgba(0, 0, 0, .4); }
.dialog-head { background: var(--bar); border-bottom: .5px solid var(--border); padding: 8px 16px; min-height: 52px;
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.dialog-head h2 { font-size: 1.0625rem; font-weight: 600; }
.dialog-head.sheet { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; }
.dialog-head.sheet h2 { grid-column: 2; grid-row: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
.sheet-btn {
  appearance: none; border: 0; background: none; color: var(--accent); font: inherit; font-size: 1.0625rem; cursor: pointer;
  padding: 8px 2px; min-height: 40px; grid-row: 1; white-space: nowrap;
}
.sheet-btn.cancel { grid-column: 1; justify-self: start; }
.sheet-btn.done { grid-column: 3; justify-self: end; font-weight: 600; }
.sheet-btn:disabled { opacity: .4; }
.sheet-btn svg { display: none; }
.dialog-body { padding: 16px; }
.dialog-body .card { background: var(--surface); }
.dialog-foot { background: var(--bg); border-top: 0; position: static; padding: 4px 16px calc(16px + env(safe-area-inset-bottom)); flex-direction: column; gap: 10px; }
.dialog-foot .right { margin-left: 0; display: flex; flex-direction: column; gap: 10px; }
.dialog-foot .btn { width: 100%; background: var(--surface); }
.dialog-foot .btn.primary { background: var(--accent); }
.dialog-foot .btn.danger { color: var(--danger); }
@media (max-width: 759px) {
  dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 12px 12px 0 0; max-height: calc(100dvh - 40px); }
  dialog[open] { animation: sheet-up .34s cubic-bezier(.2, .9, .25, 1); }
  .dialog-head { border-radius: 12px 12px 0 0; padding-top: 14px; }
  .dialog-head::before {
    content: ""; position: absolute; top: 5px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--tertiary);
  }
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { dialog[open] { animation: none; } }

/* ---------- Woche: wie die Listenansicht im Apple-Kalender ---------- */
.week-nav .icon-btn { border: 0; background: none; color: var(--accent); width: 38px; height: 38px; }
.week-nav .icon-btn:hover { background: var(--fill); }
.week-nav .icon-btn svg { width: 24px; height: 24px; }
.week-title strong { font-size: 1.0625rem; }
.week-title span { font-size: .8125rem; }
.week-nav .btn.small { background: none; padding: 6px 8px; }
.week-nav .btn.small:hover { background: var(--fill); }
.day-row { padding: 9px 16px; gap: 12px; }
.day-row.weekend { background: none; }
.day-row.today { box-shadow: none; background: none; }
.day-label { width: 3rem; padding-top: 2px; }
.day-label b { font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.day-label span { font-size: .9375rem; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.day-row.weekend .day-label span { color: var(--muted); }
.day-row.today .day-label b, .day-row.today .day-label span { color: var(--accent); }

.shift-chip, .ev-chip {
  border: 0; border-radius: 6px; background: color-mix(in srgb, var(--c) 15%, var(--surface));
  box-shadow: inset 3px 0 0 var(--c); padding: 4px 9px 4px 10px; font-size: .875rem; min-height: 30px;
}
.shift-chip .dot, .ev-chip .dot { display: none; }
.shift-chip b, .ev-chip b { font-weight: 600; color: var(--c); }
.ev-chip .t { color: var(--muted); }
button.shift-chip:hover, .ev-chip:hover { border: 0; background: color-mix(in srgb, var(--c) 24%, var(--surface)); }
.shift-chip.pattern { border: 0; background: color-mix(in srgb, var(--c) 8%, var(--surface)); box-shadow: inset 3px 0 0 color-mix(in srgb, var(--c) 55%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--c) 18%, transparent); }
.shift-chip.rule { box-shadow: inset 3px 0 0 var(--c), inset 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent); }
.shift-chip.off, .shift-chip.vacation, .shift-chip.sick { background: var(--fill); box-shadow: inset 3px 0 0 color-mix(in srgb, var(--c) 40%, transparent); color: var(--muted); }
.shift-chip.me { box-shadow: inset 3px 0 0 var(--c); }
.shift-chip.add, .ev-add { border: 0; background: none; box-shadow: none; color: var(--accent); }
.shift-chip.add:hover, .ev-add:hover { background: var(--fill); }
.ev-add { border-radius: 50%; }
.ev-add svg { width: 18px; height: 18px; }
.owner-chip { border: 0; background: color-mix(in srgb, var(--c) 15%, var(--surface)); color: var(--c); font-weight: 600; }
.owner-chip .dot { display: none; }
.ev-time { font-weight: 600; font-size: .9375rem; }

/* ---------- Monat: wie im Apple-Kalender ---------- */
.month-grid { background: var(--surface); }
.month-grid .mh { background: none; font-size: .6875rem; font-weight: 600; color: var(--muted); padding: 8px 0 6px; }
.mc { border-left: 0; border-top: .5px solid var(--border); align-items: center; padding: 4px 2px 6px; }
.mc.other { background: none; }
.mc.other .mc-num { color: var(--tertiary); }
.mc-num { width: 30px; height: 30px; font-size: 1.0625rem; font-weight: 400; }
.mc.today .mc-num { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.mc:hover { background: var(--fill); }
.mc-items { align-self: stretch; }
.mc-label { border-radius: 4px; background: color-mix(in srgb, var(--c) 15%, transparent); }
.mc-label .dot { display: none; }
.mc-dots .dot { width: 6px; height: 6px; }

/* ---------- Kleinkram ---------- */
.copy-field .btn { padding: 0 14px; }
.copy-field input, .addr-box { background: var(--field); border: 0; }
details.howto { border: 0; border-radius: 0; padding: 0; background: none; }
details.howto + details.howto { margin-top: 0; border-top: .5px solid var(--border); }
details.howto summary { font-weight: 400; padding: 12px 0; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.howto summary::-webkit-details-marker { display: none; }
details.howto summary::after { content: "›"; color: var(--tertiary); font-size: 1.4rem; line-height: 1; transition: transform .2s; }
details.howto[open] summary::after { transform: rotate(90deg); }
.pill span { border: 0; background: var(--fill); color: var(--text); font-weight: 500; }
.pill input:checked + span { background: var(--accent); color: var(--on-accent); }
.per-day-row { border: 0 !important; background: var(--field); }
.quick { border: 0; background: var(--surface); }
.quick:hover { background: var(--fill); border: 0; }
.news-item, .req { border: 0; background: var(--surface); }
.news-item.is-new { background: var(--surface); box-shadow: inset 3px 0 0 #007aff; }
.action-box { border: 0; background: var(--warn-soft); }
.req.unread { box-shadow: inset 3px 0 0 #007aff; }
.req-note { background: var(--fill); }
.table-wrap { border: 0; background: var(--surface); border-radius: var(--radius); }
th { background: var(--surface); }
.dropzone { border: 2px dashed var(--tertiary); }
#toast { background: rgba(30, 30, 30, .92); color: #fff; border-radius: 99px; padding: 10px 20px; font-size: .9375rem;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.offline-bar { background: var(--warn-soft); border-bottom: 0; top: 54px; }
.auth .logo { border-radius: 16px; }

/* Größere Schrift: Kopf und Leisten bleiben kompakt */
html.large-text .row + .row::before { left: calc(16px + 3.125rem + 14px); }

/* Kopf-Knöpfe am Handy: nur Symbol, wenn der Text nicht passt */
.page-head .btn.small:has(> .desktop-only) { gap: 6px; }
@media (max-width: 759px) {
  .page-head .btn.small:has(> .desktop-only) { width: 34px; height: 34px; padding: 0; border-radius: 50%; }
}
.page-head .btn.small svg { width: 18px; height: 18px; }

/* ---------- Einstellungen: zusätzliche Zeilenarten ---------- */
.group.spaced { margin-top: 32px; }
.sec-foot + .group.spaced, .sec-foot + .group { margin-top: 28px; }
.cell-note { margin: 0; padding: 12px 16px; font-size: .9375rem; color: var(--muted); }
.cell.red { color: var(--danger); }
.cell.tint.strong { font-weight: 600; }
.group.avatars .cell + .cell::before { left: calc(16px + 2.5rem + 12px); }
.profile-cell { margin-bottom: 4px; padding: 12px 16px; }
.profile-cell .cell-text strong { font-size: 1.25rem; font-weight: 600; }
.profile-top { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 4px 0 22px; text-align: center; }
.profile-top strong { font-size: 1.375rem; font-weight: 600; margin-top: 8px; }
.profile-top.small { margin: 0 0 18px; }
.avatar.huge { width: 5.5rem; height: 5.5rem; font-size: 2.25rem; }
.input-cell > span { flex: none; min-width: 5.5rem; }
.input-cell input { flex: 1; min-width: 0; min-height: 0; padding: 4px 0; background: none; text-align: right; border-radius: 0; }
.input-cell input:focus-visible { outline: none; }
.input-cell:focus-within { background: var(--fill); }
.feed-cell { flex-wrap: wrap; row-gap: 6px; }
.feed-cell .btn.small { flex: none; }
@media (max-width: 420px) {
  .feed-cell .cell-text { flex-basis: calc(100% - 42px); }
  .feed-cell .btn.icon-only { margin-left: 42px; }
  .feed-cell .btn.small:not(.icon-only) { flex: 1; }
}
.lead-foot { margin: 0 16px 14px; font-size: .9375rem; }
.howtos { padding: 0 16px; }
.howtos details.howto summary { min-height: 44px; }
.setup-card h2 svg { color: var(--accent); }
#s-pattern { padding: 14px 16px; }
#s-share .choices { background: var(--surface); }
.share-list .check > span { flex: 1; }
.group.cell, .cell.group { background: var(--surface); }
a.group.cell:hover { background: var(--fill); }

/* Sheet-Kopf: Titel nimmt den Platz dazwischen und kürzt notfalls mit „…“ */
.dialog-head.sheet { grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; }
.dialog-head.sheet h2 { max-width: none; }
.dialog-head.sheet:not(:has(.sheet-btn.cancel)) h2 { padding-left: 4em; }
.time-grid + .field, .field + .time-grid, .time-grid + .time-grid { margin-top: 14px; }

/* Großer Titel passt sich schmalen Handys an (auch mit größerer Schrift) */
.page-head:not(.sub) h1 { font-size: min(2.125rem, 8.6vw); }
.page-head.sub h1 { font-size: min(1.75rem, 8vw); }
/* Segmente in Dialogen: nie breiter als der Platz */
.dialog-body .seg { display: flex; max-width: 100%; }
.seg-item { min-width: 0; }
.seg-item > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 400px) { .seg-item > span { padding-left: 8px; padding-right: 8px; } }
/* Kopf der Sheets wie in iOS: feste Größe, damit der Titel Platz behält */
.sheet-btn, .dialog-head.sheet h2 { font-size: 17px; }

/* Geburtstage: Suche & Filter als runde Knöpfe */
.btn.icon-only.active { background: var(--accent); color: var(--on-accent); }
.filter-note {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -4px 0 10px;
  font-size: .9375rem; color: var(--muted);
}
.filter-note > span { display: inline-flex; align-items: center; gap: 6px; }
.filter-note svg { width: 16px; height: 16px; color: var(--accent); }
.search-row { margin-bottom: 12px; }
.cell.pick .pick-mark {
  flex: none; width: 14px; height: 12px; opacity: 0; background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 12'%3E%3Cpath d='M1.5 6.5 5.2 10 12.5 1.8' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 12'%3E%3Cpath d='M1.5 6.5 5.2 10 12.5 1.8' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.cell.pick.on .pick-mark { opacity: 1; }
.cell.pick.on .cell-text { color: var(--accent); }
@media (max-width: 359px) { .page-head:not(.sub) h1 { font-size: min(2.125rem, 8vw); } .page-head { gap: 6px; } }

/* Erinnerungen: Uhrzeit in einer Zeile (wie in den iOS-Einstellungen) */
.time-cell > span { flex: 1; min-width: 0; }
.time-cell input[type=time] {
  flex: none; width: auto; min-width: 0; min-height: 34px; padding: 4px 10px; margin-left: auto; border-radius: 8px;
  background: var(--fill); font-variant-numeric: tabular-nums; display: inline-block; text-align: center;
}
.group > [data-show] { padding-left: 32px; }
.group > [data-show]::before { left: 32px !important; }

/* ---------- Farben für Dienst-Vorlagen ---------- */
:root { --pk-blue: #007aff; --pk-green: #28a745; --pk-yellow: #e0a800; --pk-orange: #ff8a00; --pk-red: #ff3b30; --pk-purple: #af52de; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --pk-blue: #0a84ff; --pk-green: #30d158; --pk-yellow: #ffd60a; --pk-orange: #ff9f0a; --pk-red: #ff453a; --pk-purple: #bf5af2; }
}
:root[data-theme="dark"] { --pk-blue: #0a84ff; --pk-green: #30d158; --pk-yellow: #ffd60a; --pk-orange: #ff9f0a; --pk-red: #ff453a; --pk-purple: #bf5af2; }
.pcol-blue { --pk: var(--pk-blue); } .pcol-green { --pk: var(--pk-green); } .pcol-yellow { --pk: var(--pk-yellow); }
.pcol-orange { --pk: var(--pk-orange); } .pcol-red { --pk: var(--pk-red); } .pcol-purple { --pk: var(--pk-purple); }

/* Knopf beim Eintragen: farbiger Balken links und leicht getönt */
.quick.pcol { background: color-mix(in srgb, var(--pk) 14%, var(--surface)); box-shadow: inset 4px 0 0 var(--pk); }
.quick.pcol:hover { background: color-mix(in srgb, var(--pk) 22%, var(--surface)); }
/* Punkt in Listen */
.pdot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--pk, var(--tertiary)); display: inline-block; }
.pdot.none { background: none; box-shadow: inset 0 0 0 1.5px var(--tertiary); }
.chip .pdot { width: 9px; height: 9px; margin-right: 6px; vertical-align: 0; }

/* Farbauswahl */
.swatches { display: flex; flex-wrap: wrap; gap: 12px; padding: 4px 2px; }
.swatch { margin: 0; cursor: pointer; position: relative; }
.swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch span { display: block; width: 34px; height: 34px; border-radius: 50%; background: var(--pk); }
.swatch.none span { background: var(--surface); box-shadow: inset 0 0 0 2px var(--tertiary); position: relative; overflow: hidden; }
.swatch.none span::after { content: ""; position: absolute; left: 50%; top: 4px; bottom: 4px; width: 2px; margin-left: -1px; background: var(--tertiary); transform: rotate(45deg); }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--pk, var(--tertiary)); }
.swatch.none input:checked + span { box-shadow: inset 0 0 0 2px var(--tertiary), 0 0 0 2px var(--bg), 0 0 0 4px var(--muted); }
.swatch input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 4px; }

/* Termin aus eingebundenem Kalender */
.cell-text.pre > span { white-space: pre-wrap; }
.dialog-body .group + .sec-foot a { color: var(--accent); }

/* Filter nach Titel (eingebundene Kalender) */
.rules { margin-bottom: 8px; }
.rule-item { gap: 8px; min-height: 44px; padding: 6px 8px 6px 16px; }
.rule-prefix { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.rule-item select, .rule-add select {
  width: auto; min-height: 34px; padding: 4px 10px; font-size: .9375rem; border-radius: 8px; flex: none;
}
.rule-item select { background: var(--fill); }
.rule-item .icon-btn { width: 34px; height: 34px; padding: 0; color: var(--muted); }
.rule-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rule-add input { flex: 1 1 160px; min-width: 0; }
.rule-suggest { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.rule-suggest .hint { margin: 0 4px 0 4px; }
.rule-suggest .chip { min-height: 30px; padding: 4px 12px; font-size: .875rem; background: var(--surface); }

/* Testversion */
.test-pill {
  display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 6px;
  background: #ff9500; color: #fff; font-size: .75rem; font-weight: 700; letter-spacing: .04em; vertical-align: middle;
}
