:root {
  --bg: #0d0c0f; --panel: #17151b; --panel2: #1f1c24; --line: #2c2833; --text: #d8d5de; --muted: #8f8a99;
  --accent: #8b1e2d; --accent2: #b3283b; --ok: #3f7d58; --warn: #b07a1e; --err: #b3283b;
  --radius: 10px; --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
/* Designs: dunkel (Standard), hell, violett – Auswahl je Gerät (Cookie nornir_theme) */
:root[data-theme="light"] {
  --bg: #f6f4f1; --panel: #ffffff; --panel2: #f0ece6; --line: #ddd6cc; --text: #221f26; --muted: #6d6774;
  --accent: #8b1e2d; --accent2: #a8263a; color-scheme: light;
}
:root[data-theme="violet"] {
  --bg: #0f0b14; --panel: #191222; --panel2: #221830; --line: #33264a; --text: #e2dbec; --muted: #9a8fae;
  --accent: #7b3fbf; --accent2: #9555d9; color-scheme: dark;
}
:root[data-theme="light"] .side { background: linear-gradient(180deg, #efebe5, #e7e1d8); }
:root[data-theme="light"] .topbar { background: rgba(246,244,241,.92); }
:root[data-theme="light"] .entry, :root[data-theme="light"] .hit { border-bottom-color: #e6e0d6; }
:root[data-theme="light"] .flash { background: #e6f4ea; border-color: #9fd0b0; }
:root[data-theme="light"] .error { background: #fbe9eb; border-color: #e3a6ae; }
:root[data-theme="light"] .warn { background: #fdf3e2; border-color: #e6c48a; }
:root[data-theme="light"] .badge.bill { color: #2f7a4d; border-color: #9fd0b0; }
:root[data-theme="light"] .badge.no { color: #a33a48; border-color: #e3a6ae; }
:root[data-theme="light"] .badge.open { color: #8a5a12; border-color: #e0c08a; }
:root[data-theme="light"] .badge.emp { color: #6a4ea0; border-color: #c7b6e6; }
:root[data-theme="light"] .side a.nav.on { color: var(--text); }
:root[data-theme="violet"] .side { background: linear-gradient(180deg, #150e1d, #0c0811); }
:root[data-theme="violet"] .running { box-shadow: 0 0 0 1px var(--accent), 0 0 24px #7b3fbf33; }
.pre { white-space: pre-wrap; font-size: .85rem; color: var(--muted); }
.wide-card { max-width: 640px; }
.choice { display: flex; justify-content: space-between; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; margin-bottom: 8px; }
.choice:hover { border-color: var(--accent); }
.slots { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
.slots .btn { min-width: 76px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
.inline { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 6px 0 0; }
.inline input { width: auto; flex: 1 1 140px; padding: 6px 8px; }
.inline button { padding: 6px 12px; }
.session { grid-template-columns: 6px 1fr auto; }
.menu { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; overflow: hidden; }
.menuitem { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; padding: 14px 16px; text-decoration: none;
  color: var(--text); border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0;
  border-radius: 0; text-align: left; font: inherit; cursor: pointer; min-height: 60px; }
.menuitem:hover { background: var(--panel2); }
.menuitem small { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; }
.menuitem .mi { font-size: 1.3rem; text-align: center; }
.menuitem .chev { color: var(--muted); font-size: 1.3rem; }
.menuitem-form { margin: 0; }
.menuitem-form .menuitem { border-bottom: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px; border-radius: 12px; min-height: 0; }
.tile[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.tile-prev { display: block; height: 64px; border-radius: 8px; border: 1px solid rgba(128,128,128,.3); }
.tile-dark .tile-prev { background: linear-gradient(90deg, #121015 0 28%, #17151b 28% 100%), #0d0c0f; box-shadow: inset -40px -18px 0 -30px #8b1e2d; }
.tile-light .tile-prev { background: linear-gradient(90deg, #ebe6df 0 28%, #ffffff 28% 100%); box-shadow: inset -40px -18px 0 -30px #8b1e2d; }
.tile-violet .tile-prev { background: linear-gradient(90deg, #150e1d 0 28%, #191222 28% 100%); box-shadow: inset -40px -18px 0 -30px #7b3fbf; }
.attendees { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-top: 4px; }
.inline-badge { display: inline; margin: 0 0 0 4px; }
.modrow.small { font-size: .8rem; gap: 4px; }
a.link { color: var(--muted); font-size: .85rem; }
.modrow { display: flex; align-items: center; gap: 10px; font-size: 1rem; color: var(--text); }
.modrow input { width: 22px; height: 22px; }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); }
a { color: var(--text); text-decoration-color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: .02em; margin: 0 0 .6em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; color: var(--muted); }
.app { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: linear-gradient(180deg, #121015, #0b0a0d); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; text-decoration: none; }
.brand img { width: 38px; height: 38px; }
.brand b { font-family: var(--serif); font-size: 1.25rem; letter-spacing: .12em; text-transform: uppercase; }
.brand small { display: block; color: var(--muted); font-size: .72rem; letter-spacing: .05em; }
.side a.nav { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); }
.side a.nav:hover { background: var(--panel); color: var(--text); }
.side a.nav.on { background: var(--panel2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.side .grow { flex: 1; }
.side .search { margin: 0 0 10px; }
.side .search input { padding: 8px 10px; }
.hit { padding: 10px 4px; border-bottom: 1px solid #1d1a21; }
.hit .meta { color: var(--muted); font-size: .82rem; }
.objects { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.obj { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.obj dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 8px 0 0; font-size: .88rem; }
.obj dt { color: var(--muted); }
.obj dd { margin: 0; white-space: pre-wrap; }
.side form { margin: 0; }
.side .who { color: var(--muted); font-size: .8rem; padding: 8px 12px; border-top: 1px solid var(--line); }
main { padding: 26px 34px; max-width: 1200px; width: 100%; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 140px; }
.row > .narrow { flex: 0 1 110px; }
.row > .wide { flex: 3 1 280px; }
.row > form { flex: 0 0 auto; }
label { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 4px; }
input, select, textarea { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
input[type=color] { padding: 2px; height: 40px; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 16px; font: inherit; cursor: pointer; text-decoration: none; white-space: nowrap; }
button:hover, .btn:hover { border-color: var(--muted); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: var(--accent2); }
button.danger { color: #f0b3bb; border-color: #5a2029; }
button.link { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; }
.timer { display: grid; grid-template-columns: 3fr 2fr 2fr auto auto; gap: 10px; align-items: end; }
.clock { font-family: var(--serif); font-size: 2rem; font-variant-numeric: tabular-nums; min-width: 120px; text-align: right; }
.running { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 24px #8b1e2d33; }
.weeknav { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 14px; }
.sum { color: var(--muted); }
.sum b { color: var(--text); font-variant-numeric: tabular-nums; }
.day { margin-bottom: 16px; }
.dayhead { display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; padding: 0 4px 6px; border-bottom: 1px solid var(--line); }
.entry { display: grid; grid-template-columns: 6px 1fr auto auto; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid #1d1a21; }
.entry .bar { width: 6px; height: 34px; border-radius: 3px; background: var(--muted); }
.entry .desc { font-weight: 500; }
.entry .meta { color: var(--muted); font-size: .82rem; }
.entry .when { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .85rem; text-align: right; }
.entry .len { font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.badge { display: inline-block; font-size: .7rem; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.badge.bill { border-color: #2f5c43; color: #8fd0a9; }
.badge.no { border-color: #4a2a30; color: #d49aa3; }
.badge.open { border-color: #5c4a2a; color: #e0c08a; }
.badge.emp { border-color: #4b4060; color: #b8a8d8; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; font-size: .8rem; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; background: var(--muted); }
.flash, .error, .warn { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.flash { background: #15281d; border: 1px solid #2f5c43; }
.error { background: #2a1317; border: 1px solid #5a2029; }
.warn { background: #2a2113; border: 1px solid #5a4520; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 30px; }
.card .brand { justify-content: center; }
.card form > * + * { margin-top: 12px; }
.card button { width: 100%; }
.muted { color: var(--muted); }
.codes { font-family: ui-monospace, monospace; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.qr { background: #fff; padding: 10px; border-radius: 8px; width: 260px; display: block; margin: 10px auto; }
.mono { font-family: ui-monospace, monospace; word-break: break-all; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.right { text-align: right; }
footer { color: #57525f; font-size: .72rem; margin-top: 30px; }
/* ---------- Mobil (mobile first für die Bedienung unterwegs) ---------- */
.topbar { display: none; }
@media (max-width: 860px) {
  html, body { font-size: 16px; }
  .app { grid-template-columns: 1fr; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 5; background: rgba(13,12,15,.92); backdrop-filter: blur(8px); }
  .topbar img { width: 28px; height: 28px; }
  .topbar b { font-family: var(--serif); letter-spacing: .12em; text-transform: uppercase; }
  .topbar .btn { margin-left: auto; min-height: 40px; padding: 6px 12px; }
  .side { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; flex-direction: row; justify-content: space-around;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); gap: 0; }
  .side .brand, .side .grow, .side .who, .side form, .side a.nav.desk, .desk-only { display: none; }
  .side a.nav { flex: 1; text-align: center; padding: 8px 2px; font-size: .72rem; border-radius: 10px; min-height: 48px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
  .side a.nav::before { content: attr(data-icon); font-size: 1.25rem; line-height: 1; }
  .side a.nav.on { box-shadow: none; color: #fff; background: var(--panel2); }
  main { padding: 14px 14px 24px; }
  h1 { font-size: 1.35rem; }
  input:not([type=checkbox]):not([type=radio]), select, textarea, button, .btn { font-size: 16px; min-height: 46px; }
  .timer { grid-template-columns: 1fr; }
  .timer button, .running button { width: 100%; min-height: 54px; font-size: 1.05rem; }
  .row > *, .row > .narrow, .row > .wide { flex: 1 1 100%; }
  .row > .narrow { flex: 1 1 45%; }
  .clock { font-size: 2.2rem; text-align: left; }
  .weeknav { gap: 8px; flex-wrap: wrap; }
  .weeknav .sum { order: 3; width: 100%; text-align: center; }
  .entry { grid-template-columns: 6px 1fr auto; padding: 12px 2px; }
  .entry .when { grid-column: 2; text-align: left; order: 3; }
  .entry .len { grid-row: 1; grid-column: 3; font-size: 1.05rem; }
  .entry .len a { display: inline-block; padding: 10px 4px; }
  .panel { padding: 14px; border-radius: 12px; }
  table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .card { padding: 22px; border-radius: 12px; }
  .qr { width: 220px; }
  details summary { padding: 10px 0; }
}

/* Formulare */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.fpage { border: 0; padding: 0; margin: 0 0 16px; }
.fpage legend { font-weight: 600; font-size: 1.1rem; margin-bottom: 10px; }
.ffield { margin-bottom: 14px; }
.ffield .opts { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.fnav { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; }
.fform.js .fpage:not(.cur) { display: none; }
.ffield.off { display: none; }
.answer { margin-bottom: 10px; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tab { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; }
.tab.on { border-color: var(--accent); }
details.entry > summary { cursor: pointer; padding: 6px 0; }

/* Kundenportal: Handy einspaltig, Tablet/PC breit mit Navigation und Spalten */
.portal { max-width: 1120px; margin: 0 auto; padding: 12px 14px 40px; }
.pnav { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.pbrand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.pbrand img { height: 34px; width: auto; }
.pnav nav { display: flex; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.pnav nav a { white-space: nowrap; padding: 8px 12px; border-radius: 999px; text-decoration: none; }
.pnav nav a.on, .pnav nav a:hover { background: var(--panel); outline: 1px solid var(--accent); }
.pgrid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.pbox, .pcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.pcard { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.portal .choice { background: var(--panel); }
.portal button { width: auto; }
.portal table { width: 100%; }
@media (min-width: 760px) {
  .portal { padding: 18px 24px 48px; }
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pwide { grid-column: 1 / -1; }
  .pnav { justify-content: space-between; }
}
@media (min-width: 1100px) {
  .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Kalender */
.calbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.calnav { display: flex; gap: 6px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg a { padding: 6px 12px; text-decoration: none; }
.seg a.on { background: var(--accent); color: #fff; }
.legend { font-size: .82rem; color: var(--muted); margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.fillbar { display: inline-block; width: 56px; height: 6px; border-radius: 3px; background: rgba(127,127,127,.25); vertical-align: middle; overflow: hidden; }
.fillbar i { display: block; height: 100%; width: 0; }
.fillbar i.full { width: 100%; }
.f-red i { background: #c23b3b; } .f-yellow i { background: #d6a21e; } .f-green i { background: #3f9d5a; }
.cev { border-left: 3px solid var(--accent); background: var(--panel); border-radius: 6px; padding: 3px 6px; margin: 2px 0; font-size: .8rem; line-height: 1.25; overflow: hidden; }
.cev.cancelled { opacity: .55; text-decoration: line-through; } .cev.tentative { border-left-style: dashed; }
.cev a { text-decoration: none; } .cevt { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cevf, .cevl { color: var(--muted); margin-left: 4px; } .cevl { display: block; margin-left: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Tag/Woche: Handy gestapelt, ab Tablet Zeitleiste */
.tgrid { display: block; }
.thours { display: none; }
.tcol { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; padding: 6px; }
.tcol.today { border-color: var(--accent); }
.tcolhead { display: block; text-decoration: none; padding: 4px 2px; }
@media (min-width: 760px) {
  .tgrid { display: grid; grid-template-columns: 48px repeat(var(--cols, 7), minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
  .tgrid.cols-1 { --cols: 1; } .tgrid.cols-7 { --cols: 7; }
  .thours { display: block; padding-top: 58px; }
  .th { height: 60px; font-size: .72rem; color: var(--muted); text-align: right; padding-right: 6px; transform: translateY(-.5em); }
  .tcol { border: 0; border-left: 1px solid var(--line); border-radius: 0; margin: 0; padding: 0; }
  .tcolhead { height: 34px; text-align: center; font-size: .82rem; border-bottom: 1px solid var(--line); }
  .tallday { min-height: 24px; border-bottom: 1px solid var(--line); padding: 0 2px; }
  .tbody { position: relative; height: 960px; background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 100% 60px; }
  .tev { position: absolute; left: calc(2px + (100% - 4px) * var(--lane, 0) / var(--lanes, 1)); width: calc((100% - 4px) / var(--lanes, 1) - 2px); top: calc(var(--top, 0) * 1px); height: calc(var(--h, 30) * 1px); }
  .tev .cev { height: 100%; margin: 0; }
  .tev.movable { cursor: grab; user-select: none; -webkit-user-select: none; }
  .tev.dragging { cursor: grabbing; opacity: .85; z-index: 5; box-shadow: 0 4px 14px rgba(0,0,0,.18); border-radius: 6px; }
  .tev.dragging, .tev.dragging .cev { pointer-events: none; }
  .tev.saving { opacity: .5; }
  .tresize { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; touch-action: none; }
  .tresize::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 18px; margin-left: -9px; height: 3px; border-radius: 2px; background: currentColor; opacity: .25; }
  .tev.movable:hover .tresize::after { opacity: .6; }
  .tdragtip { position: absolute; right: 2px; top: -1.4em; font-size: .72rem; background: var(--text); color: var(--bg); padding: 1px 5px; border-radius: 4px; white-space: nowrap; pointer-events: none; }
  .tcol.today .tcolhead { color: var(--accent); }
}
/* Monat */
.mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mhead { padding: 6px; font-size: .78rem; color: var(--muted); text-align: center; border-bottom: 1px solid var(--line); }
.mcell { min-height: 110px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; overflow: hidden; }
.mcell.out { opacity: .45; } .mcell.today { box-shadow: inset 0 0 0 2px var(--accent); }
.mday { font-weight: 600; text-decoration: none; font-size: .85rem; }
.more { font-size: .75rem; color: var(--muted); }
@media (max-width: 759px) { .mcell { min-height: 64px; } .mcell .cev { font-size: .68rem; padding: 2px 3px; } .mcell .cevl, .mcell .cevf { display: none; } }
/* Jahr */
.ygrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.ymonth { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.yhead { display: block; font-weight: 600; text-decoration: none; margin-bottom: 6px; }
.ydays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; font-size: .72rem; text-align: center; }
.ywd { color: var(--muted); }
.yd { padding: 3px 0; border-radius: 4px; text-decoration: none; }
.yd.l1 { background: rgba(63,157,90,.25); } .yd.l2 { background: rgba(63,157,90,.5); } .yd.l3 { background: rgba(63,157,90,.8); color: #fff; }
.yd.today { outline: 2px solid var(--accent); }

/* öffentliche Seiten / Kundenportal: Schrift und Überschriftenfarbe aus dem Designeditor */
body[data-public="1"] { font-family: var(--font, var(--sans)); }
body[data-public="1"] h1, body[data-public="1"] h2, body[data-public="1"] h3, body[data-public="1"] .brand b, body[data-public="1"] .pbrand b { font-family: var(--font, var(--serif)); color: var(--heading, inherit); }
body[data-public="1"] .pbrand b { letter-spacing: .02em; }
body[data-public="1"] .btn.primary, body[data-public="1"] button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
body[data-public="1"] .pnav nav a.on { outline-color: var(--accent); }

.logo-preview { max-height: 48px; vertical-align: middle; background: #fff; padding: 4px; border-radius: 6px; }

/* Kalender: neuer Termin per Klick/Ziehen */
.mcell[data-day], .tbody { cursor: copy; }
.mcell .cev, .tev, .cev { cursor: pointer; }
.tsel { position: absolute; left: 2px; right: 2px; top: calc(var(--top, 0) * 1px); height: calc(var(--h, 60) * 1px); border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 30%, transparent); border: 1px dashed var(--accent); pointer-events: none; z-index: 3; }
.tbody { touch-action: pan-x; }
dialog.dlg { max-width: 720px; width: calc(100% - 24px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); padding: 18px; }
dialog.dlg::backdrop { background: rgba(0, 0, 0, .55); }
dialog.dlg .full { flex-basis: 100%; margin: 0 0 6px; }

/* Eingebettet auf der eigenen Website (?embed=1, nur im iframe): ohne Karte/Marke, durchsichtig, Stil der Website.
   Parameter: akzent, hover, text (Hex ohne #), radius (px). */
html.emb { color-scheme: normal; --emb-text: #0f172a; --emb-accent: #374151; --emb-hover: #1f2937; --emb-radius: .8rem; --emb-line: #e5e7eb; }
html.emb, html.emb body { background: transparent; min-height: 0; color: var(--emb-text); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
html.emb .center { display: block; min-height: 0; padding: 0; }
html.emb .card { max-width: none; background: none; border: 0; border-radius: 0; padding: 0; color: var(--emb-text); }
html.emb .card .brand { display: none; }
html.emb h3, html.emb legend { font-family: inherit; color: var(--emb-text); }
html.emb .muted, html.emb small { color: #475569; }
html.emb a { color: var(--emb-text); text-decoration: underline; text-decoration-color: currentColor; }
html.emb label { font-size: 14px; font-weight: 600; color: var(--emb-text); margin-bottom: 4px; }
html.emb label.modrow { font-weight: 400; font-size: 15px; }
html.emb input, html.emb select, html.emb textarea { background: #fff; color: var(--emb-text); border: 1px solid var(--emb-line); border-radius: var(--emb-radius); padding: .72rem .9rem; font: inherit; }
html.emb input:focus, html.emb select:focus, html.emb textarea:focus { outline: 0; border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14,165,233,.25); }
html.emb input[type=checkbox], html.emb input[type=radio], html.emb .modrow input { width: 16px; height: 16px; padding: 0; margin: 0; flex: none; accent-color: var(--emb-accent); box-shadow: none; }
html.emb .modrow { display: inline-flex; align-items: flex-start; gap: 8px; color: var(--emb-text); }
html.emb .modrow input { margin-top: .3em; }
html.emb .opts { display: flex; flex-wrap: wrap; gap: 4px 20px; }
html.emb button, html.emb .btn { width: auto; border-radius: var(--emb-radius); padding: .6rem .9rem; font-weight: 700; }
html.emb button.primary, html.emb .btn.primary, html.emb body[data-public="1"] button.primary { background: var(--emb-accent); border-color: var(--emb-accent); color: #fff; }
html.emb button.primary:hover { background: var(--emb-hover); border-color: var(--emb-hover); }
html.emb .card button { width: auto; }
html.emb fieldset.fpage { border: 0; margin: 0; padding: 0; min-width: 0; }
html.emb .fpage { display: grid; grid-template-columns: 1fr; gap: 14px 18px; }
html.emb .card form > * + * { margin-top: 14px; }
html.emb .ffield, html.emb .fnav { margin: 0; min-width: 0; }
html.emb .ffield .row { gap: 14px 18px; } /* Vor-/Nachname im selben Raster wie die übrigen Felder */
html.emb .ffield .row > div { flex: 1 1 140px; min-width: 0; }
html.emb .fnav { display: flex; gap: 10px; }
@media (min-width: 640px) { html.emb .fpage { grid-template-columns: 1fr 1fr; } html.emb .fpage > .full, html.emb .fpage > legend { grid-column: 1 / -1; } }
html.emb .embmsg p { margin: 0; }
html.emb .error { margin: 0 0 12px; }

/* Newsletter kompakt (Website-Fußzeile, ?embed=1&kompakt=1[&hell=1]): E-Mail + Anmelden in einer Zeile */
.nlc { font-size: 14px; line-height: 1.45; padding: 3px; }
.nlc.nlc-light, html.emb .nlc.nlc-light { color: #f3f1f4; }
.nlc form { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.nlc-row { display: flex; flex-wrap: wrap; gap: 6px; }
.nlc-row input { flex: 1 1 140px; min-width: 0; font: inherit; padding: .5rem .75rem; }
html.emb .nlc-row input { padding: .5rem .75rem; }
.nlc-row button { font: inherit; font-weight: 700; padding: .5rem .8rem; cursor: pointer; }
.nlc-light .nlc-row input { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.08); color: #f3f1f4; }
.nlc-light .nlc-row input::placeholder { color: rgba(243,241,244,.65); }
.nlc-consent, html.emb .nlc-consent { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; font-weight: 400; line-height: 1.35; margin: 0; }
.nlc-consent input, html.emb .nlc-consent input { width: 14px; height: 14px; margin: 2px 0 0; flex: none; }
.nlc-light label, .nlc-light .nlc-consent { color: #f3f1f4; }
.nlc-err, .nlc-ok { margin: 0 0 6px; font-size: 13px; }
.nlc-err { color: #b91c1c; } .nlc-light .nlc-err { color: #ffb4a8; }

/* Öffentlicher Kurskalender (/kalender, auch eingebettet) */
.pubcal { max-width: 1100px; margin: 0 auto; padding: 16px; }
html.emb .pubcal { padding: 0; max-width: none; }
.pcbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.pcbar h1 { margin: 0; }
.pcnav { display: flex; align-items: center; gap: 10px; }
.pclegend { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pctag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; text-decoration: none; }
.pctag.on { border-color: currentColor; font-weight: 600; }
.pcitem { display: inline-flex; align-items: center; gap: 2px; }
.pcinfo { text-decoration: none; padding: 0 4px; opacity: .7; } .pcinfo:hover { opacity: 1; }
.pcev { display: flex; flex-direction: column; gap: 1px; border-left: 4px solid var(--accent); background: var(--panel); border-radius: 5px; padding: 3px 6px; margin: 3px 0; font-size: .78rem; line-height: 1.25; text-decoration: none; overflow: hidden; }
.pcev .pct { font-size: .72rem; opacity: .75; }
.pcev .pcn { font-weight: 600; overflow-wrap: anywhere; }
.pcev .pcs, .pcfree { font-size: .7rem; font-weight: 600; }
.st-ok { color: #047857; } .st-few { color: #b45309; } .st-low { color: #b45309; } .st-full { color: #b91c1c; } .st-off { color: #6b7280; }
.pcev .pcs.st-ok, .pcev.st-ok .pcs { color: #047857; } .pcev.st-few .pcs, .pcev.st-low .pcs { color: #b45309; } .pcev.st-full .pcs { color: #b91c1c; } .pcev.st-off .pcs { color: #6b7280; }
.pcev.full { opacity: .75; } .pcev.cancelled .pcn, .pcrow.cancelled b { text-decoration: line-through; } .pcev.cancelled, .pcrow.cancelled { opacity: .6; }
.pcgrid .mcell { min-height: 96px; }
html.emb .pcev, html.emb .pcrow { background: #fff; }
.pclist { display: none; flex-direction: column; gap: 6px; }
.pcrow { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; border-left: 4px solid var(--accent); background: var(--panel); border-radius: 6px; padding: 8px 10px; text-decoration: none; }
.pcfree { font-size: .85rem; white-space: nowrap; }
.pcdetail { border-left: 5px solid var(--accent); padding-left: 14px; }
@media (max-width: 759px) { .pcgrid { display: none; } .pclist { display: flex; } }
.pubcal .pclist + h2, .pubcal h2 { margin-top: 18px; }
.pclist.pcshow { display: flex; }

/* Kursseiten (Markdown) */
.mdbar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 4px; }
.mdbar button, .mdbar .btn { padding: 3px 9px; font-size: .9em; }
.mdimg { cursor: pointer; }
.md { line-height: 1.55; }
.md img { max-width: 100%; height: auto; border-radius: 8px; display: block; margin: 10px 0; }
.md h2, .md h3, .md h4 { margin: 18px 0 6px; }
.md ul, .md ol { padding-left: 1.3em; }
.md a { text-decoration: underline; }
.md table { border-collapse: collapse; } .md td, .md th { border: 1px solid var(--line, #8884); padding: 4px 8px; }
.kurs .lead { font-size: 1.1em; }
.kurs .contents li { margin: 4px 0; }

/* Widerruf: Erklärung wie in der Bestätigungsmail */
.wdstatement { white-space: pre-wrap; word-break: break-word; padding: .8em 1em; border: 1px solid var(--line, #ccc); border-radius: 6px; font: inherit; }
/* Widerruf: große Antippflächen auf dem Handy */
.wdform .modrow { min-height: 44px; padding: 4px 0; }
.wdform .fnav { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 480px) { .wdform .fnav > * { flex: 1 1 100%; } .portal .pnav nav { flex-wrap: wrap; } }

/* Inline-Fenster: kompakter Kopf, Mandanten-Akzent für Hauptknöpfe */
html.inline .pnav { padding: .2rem 0 .6rem; }
html.inline .pnav .pbrand { display: none; }
html.inline button.primary, html.inline .btn.primary { background: var(--emb-accent); border-color: var(--emb-accent); color: #fff; }
html.inline button.primary:hover, html.inline .btn.primary:hover { background: var(--emb-hover); }
/* Kundenportal am Handy: Karten untereinander, Knöpfe volle Breite (Bezahlseite war zu eng) */
@media (max-width: 520px) {
  .pcard, .portal .choice { flex-direction: column; align-items: stretch; gap: .6rem; }
  .portal .choice form { width: 100%; }
  .portal .choice button { width: 100%; justify-content: center; }
  .pcard form, .pcard button, .pcard .btn { width: 100%; }
  .pcard > span { min-width: 0; }
  .portal .row { flex-direction: column; align-items: stretch; }
}
/* Kundenportal eingebettet (Inline-Fenster): helle Bausteine, gut lesbar (Kontrast), Akzent der Website/des Mandanten */
html.emb .portal .choice, html.emb .pcard { background: #fff; color: var(--emb-text); border: 1px solid var(--emb-line); }
html.emb .portal .choice b, html.emb .pcard b { color: var(--emb-text); }
html.emb .pnav a { color: var(--emb-text); border-color: transparent; }
html.emb .pnav a.on { background: var(--emb-accent); color: #fff; border-color: var(--emb-accent); text-decoration: none; }
html.emb .flash { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
html.emb .error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
html.emb button, html.emb .btn { background: #fff; color: var(--emb-text); border: 1px solid var(--emb-line); border-radius: var(--emb-radius); }
html.emb button.primary, html.emb .btn.primary, html.emb .portal .choice button { background: var(--emb-accent); border-color: var(--emb-accent); color: #fff; }
html.emb button.primary:hover, html.emb .portal .choice button:hover { background: var(--emb-hover); }
html.emb .badge { background: #f1f5f9; color: var(--emb-text); border-color: var(--emb-line); }
html.emb h1, html.emb h2 { color: var(--emb-text); }
/* Inline-Fenster: Anmelden/Registrieren luftig und volle Breite (statt der schmalen Formular-Einbettung) */
html.inline body { padding: 20px 24px 28px; }
html.inline .card { max-width: 440px; margin: 0 auto; }
html.inline .card input:not([type=checkbox]):not([type=radio]) { width: 100%; box-sizing: border-box; }
html.inline .card button.primary { width: 100%; }
html.inline .inline-hint { margin: 0 0 14px; }
fieldset.plain { display: contents; border: 0; margin: 0; padding: 0; }
/* Newsletter-Baukasten */
.nlwrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 50%); gap: 18px; align-items: start; }
.nlwrap.nlsent { grid-template-columns: minmax(0, 720px); }
.nlprev { position: sticky; top: 72px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.nlprevbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.nlprevbar button { padding: 4px 10px; }
.nlprevsw { display: inline-flex; gap: 0; }
.nlprevsw button { border-radius: 0; }
.nlprevsw button:first-child { border-radius: 8px 0 0 8px; }
.nlprevsw button:last-child { border-radius: 0 8px 8px 0; margin-left: -1px; }
.nlprevbar button[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.nlprevbox { height: calc(100vh - 170px); min-height: 480px; overflow: hidden; display: flex; justify-content: center; border: 1px solid var(--line); border-radius: 8px; background: #e9ecf1; }
#nl-prev-frame { display: block; flex: none; border: 0; background: #fff; transform-origin: top center; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.nlprev.big { position: fixed; inset: 12px; z-index: 60; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.nlprev.big .nlprevbox { flex: 1; height: auto; }
body.nlbig { overflow: hidden; }
body.nlbig::before { content: ""; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 59; }
.nled { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.nlset summary { cursor: pointer; color: var(--muted); }
.nlpal { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; position: sticky; top: 60px; z-index: 2; background: var(--panel); padding: 8px 0; }
.nlpal button { padding: 6px 12px; }
.nlki { border: 1px dashed var(--line); border-radius: 8px; padding: 12px; }
.nlblocks { display: flex; flex-direction: column; gap: 10px; }
.nlblock { border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); }
.nlblock.dragging { opacity: .5; }
.nlblock.over { outline: 2px dashed var(--accent); }
.nlhead { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.nlgrip { cursor: grab; color: var(--muted); font-size: 18px; user-select: none; }
.nlbtns { margin-left: auto; display: flex; gap: 4px; }
.nlbtns button { padding: 2px 8px; }
.nlbody { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.nlfield { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); flex: 1; }
.nlinline { display: flex; gap: 10px; flex-wrap: wrap; }
.nltools { display: flex; gap: 4px; margin-bottom: 4px; }
.nltools button { padding: 2px 8px; font-size: 13px; }
.nlimg img { max-width: 220px; max-height: 160px; border-radius: 6px; display: block; margin-bottom: 6px; }
.nlimgmiss { padding: 18px; border: 1px dashed var(--warn); border-radius: 6px; color: var(--warn); margin-bottom: 6px; }
.nlimgrow { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.nlimgrow input[type=file] { width: auto; flex: 1; }
.nlgallery { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.nlgallery button { padding: 2px; }
.nlgallery img { width: 72px; height: 54px; object-fit: cover; border-radius: 4px; }
.nlactions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.nltpl { display: flex; gap: 6px; }
.nltpl input { width: 220px; }
.nlsave { margin-top: 12px; display: flex; gap: 8px; }
@media (max-width: 1100px) { .nlwrap { grid-template-columns: 1fr; } .nlprev { position: static; } }

/* Newsletter: Kopf & Fuß, Bilder */
.nlframenote { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--bg2, rgba(127,127,127,.08)); font-size: .92rem; }
.nlinlinecheck { display: inline-flex; gap: 6px; align-items: center; margin-left: 8px; font-weight: 600; }
.nlinlinecheck input { width: auto; }
.nlblock.nlslot { border: 2px dashed var(--line); background: transparent; }
.nlimg { outline: none; border-radius: 8px; }
.nlimg:focus-visible, .nlimg.over { box-shadow: 0 0 0 3px var(--accent); }
.nldrop { display: flex; align-items: center; justify-content: center; min-height: 110px; border: 2px dashed var(--line); border-radius: 8px; padding: 8px; margin-bottom: 8px; background: rgba(127,127,127,.05); }
.nldrop.has { border-style: solid; min-height: 0; }
.nldrop img { max-height: 200px; width: auto; max-width: 100%; display: block; }
.nlimg.over .nldrop { border-color: var(--accent); }
.nldrop .nlimgmiss { border: 0; padding: 6px; margin: 0; text-align: center; color: var(--muted, #6b7280); }

/* Kundenportal: Reiter Meine/Alle Termine, Ansicht Kalender/Liste (automatisch: Handy Liste, breit Kalender) */
.ptabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 12px; }
.ptab { padding: 8px 14px; text-decoration: none; border-bottom: 3px solid transparent; font-weight: 600; opacity: .75; }
.ptab.on { border-bottom-color: var(--accent); opacity: 1; }
.pviewsw { display: inline-flex; }
.pviewsw .btn { border-radius: 0; }
.pviewsw .btn:first-child { border-radius: 8px 0 0 8px; }
.pviewsw .btn:last-child { border-radius: 0 8px 8px 0; margin-left: -1px; }
.pviewsw .btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.pview[data-view="kalender"] .pv-list, .pview[data-view="liste"] .pv-cal, .pview[data-view="auto"] .pv-list { display: none; }
@media (min-width: 760px) { .pviewsw .pv-btn-cal[data-view=""] { background: var(--accent); color: #fff; border-color: var(--accent); } }
@media (max-width: 759px) {
  .pview[data-view="auto"] .pv-cal { display: none; }
  .pview[data-view="auto"] .pv-list { display: block; }
  .pviewsw .pv-btn-list[data-view=""] { background: var(--accent); color: #fff; border-color: var(--accent); }
}

/* Vorschau „als Kunde ansehen“ */
.previewbar { position: sticky; top: 0; z-index: 70; background: #b45309; color: #fff; padding: 8px 14px; font-size: .92rem; text-align: center; }
.previewbar a { color: #fff; font-weight: 700; margin-left: 10px; }
/* Kundenportal-Kalender wie der öffentliche (Raster/Liste), Box-Abstand beibehalten */
.portal .pbox.pubcal { max-width: none; margin: 0; padding: 12px; }
@media (max-width: 759px) { .pview[data-view="kalender"] .pcgrid { display: grid; } }
.nlc-names { margin-bottom: 6px; }
.intro { margin: 0 0 14px; } .intro h2 { margin: 0 0 6px; } .intro .btn { display: inline-block; }
.poffer { max-width: 640px; }
.pcev.mine { border-left-width: 6px; font-weight: 600; }
.pcalhome .pbox.pubcal { border: 0; padding: 0; }
/* Einnahmen-Diagramm (SVG, Farben über Klassen) */
.revwrap { overflow-x: auto; margin: 12px 0 6px; }
.revchart { width: 100%; min-width: 420px; height: auto; display: block; }
.rc-grid { stroke: var(--line); stroke-width: 1; }
.rc-axis { fill: var(--muted, #888); font-size: 11px; }
.rc-selt { fill: var(--text); font-weight: 700; }
.rc-prev { fill: #9ca3af; opacity: .55; }
.rc-cur { fill: var(--accent); opacity: .8; }
.rc-cur.rc-sel { opacity: 1; }
.cardrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0; } .cardrow .inlineform input { width: 5em; }
.dot { display: inline-block; width: .75em; height: .75em; border-radius: 50%; vertical-align: middle; background: #9ca3af; }
.dot.rot { background: #dc2626; } .dot.gelb { background: #f59e0b; } .dot.gruen { background: #16a34a; } .dot.grau { background: #9ca3af; }
.ampel input { width: 3.5em; }
/* Kundenportal-Kalender/Liste: ruhig, ohne Unterstreichung; Handy und Website-Fenster gestapelt (Eli-Labor 14.11.) */
.portal .pcrow, .portal .pcev, .portal .pclist a, .portal .pcev * { text-decoration: none; color: inherit; }
.portal .pcrow b, .portal .pcev .pcn { color: var(--text); }
.portal .pcrow:hover b, .portal .pcev:hover .pcn { text-decoration: underline; text-decoration-thickness: 1px; }
.portal { max-width: 100%; overflow-wrap: anywhere; }
.ptabs { flex-wrap: wrap; }
.calbar { flex-wrap: wrap; gap: 8px; }
@media (max-width: 520px) {
  .portal .pcrow { grid-template-columns: 1fr; gap: 4px; padding: 10px 12px; }
  .portal .pcrow .pcdate br { display: none; }
  .portal .pcrow .pcdate small::before { content: " · "; }
  .portal .pcfree { justify-self: start; padding: 2px 10px; border-radius: 999px; background: rgba(127,127,127,.12); }
  .ptab { padding: 6px 10px; font-size: .95rem; }
  .pv-cal { overflow-x: auto; }
  .pviewsw .btn { padding: 6px 10px; }
}
