/* Apple-Optik: Systemschrift, Systemblau, weiche Karten, runde Schaltflächen, Haarlinien. Kein JavaScript, keine externen Schriften. */
:root {
  --bg: #f5f5f7; --card: #fff; --text: #1d1d1f; --muted: #6e6e73; --line: rgba(60,60,67,.16); --fill: rgba(120,120,128,.12);
  --accent: #0071e3; --accent-hover: #0077ed; --accent-text: #fff; --ring: rgba(0,113,227,.28);
  --warn: #9a5b00; --warn-bg: #fff6e0; --err: #c4261d; --err-bg: #fdebea; --ok-bg: #e8f6ec;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 18px rgba(0,0,0,.05);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000; --card: #1c1c1e; --text: #f5f5f7; --muted: #98989d; --line: rgba(84,84,88,.55); --fill: rgba(120,120,128,.24);
    --accent: #2997ff; --accent-hover: #409cff; --accent-text: #fff; --ring: rgba(41,151,255,.35);
    --warn: #ffd60a; --warn-bg: #2b2410; --err: #ff6961; --err-bg: #301917; --ok-bg: #12261a;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif; letter-spacing: -.01em; -webkit-font-smoothing: antialiased; }
main { max-width: 54rem; margin: 0 auto; padding: 1.5rem 20px 4rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 2rem; line-height: 1.15; font-weight: 700; letter-spacing: -.025em; margin: .4rem 0 1rem; }
h2 { font-size: 1.3rem; font-weight: 600; letter-spacing: -.02em; margin: 0; }
section { margin-top: 2.4rem; }

.top { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; padding: .65rem 20px; font-size: .9rem;
  background: color-mix(in srgb, var(--card) 72%, transparent); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 600; text-decoration: none; color: var(--text); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

button, .button {
  display: inline-block; font: inherit; font-size: .95rem; padding: .5rem 1.15rem; border-radius: 980px; border: 0;
  background: var(--accent); color: var(--accent-text); cursor: pointer; text-decoration: none; transition: background .15s, transform .05s;
}
button:hover, .button:hover { background: var(--accent-hover); text-decoration: none; }
button:active, .button:active { transform: scale(.98); }
button.secondary, .button.secondary { background: var(--fill); color: var(--accent); }
button.secondary:hover, .button.secondary:hover { background: color-mix(in srgb, var(--fill) 70%, var(--accent) 12%); }
button.danger { background: var(--err); color: #fff; }
button.secondary.danger { background: var(--fill); color: var(--err); }
button.link { background: none; padding: 0; border-radius: 0; color: var(--accent); }
button.link:hover { background: none; text-decoration: underline; }
:focus-visible { outline: 0; box-shadow: 0 0 0 4px var(--ring); }
a:focus-visible { border-radius: 4px; }

input, textarea, select { font: inherit; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); }
input, textarea { width: 100%; }
input:focus, textarea:focus, select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
textarea { resize: vertical; line-height: 1.5; }
label { display: block; font-size: .85rem; color: var(--muted); }
label > input, label > textarea { margin-top: .3rem; color: var(--text); font-size: 1rem; }
.stack { display: grid; gap: 1rem; margin-top: 1rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.inline { display: flex; gap: 1rem; align-items: end; flex-wrap: wrap; }
.inline label { flex: 0 0 auto; }
.inline input { width: auto; }
.search { display: flex; gap: .6rem; margin: 1rem 0; }
.search input[type=search] { border-radius: 980px; padding-left: 1.1rem; background: var(--fill); border-color: transparent; }
.search input[type=search]:focus { background: var(--card); border-color: var(--accent); }

table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: .8rem; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
th, td { text-align: left; padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
tr:last-child > td { border-bottom: 0; }
th { font-size: .78rem; color: var(--muted); font-weight: 500; text-transform: none; background: color-mix(in srgb, var(--fill) 45%, transparent); }
tbody tr:hover td { background: color-mix(in srgb, var(--fill) 40%, transparent); }
tr.current td { background: var(--ok-bg); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1.5rem; margin: 1rem 0; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }
.tag { font-size: .72rem; font-weight: 500; padding: .12rem .6rem; border-radius: 99px; vertical-align: middle; color: var(--muted); background: var(--fill); letter-spacing: 0; }
.tag.warn { color: var(--warn); background: var(--warn-bg); }
.hint { color: var(--muted); font-size: .9rem; }
.flash { padding: .8rem 1.1rem; border-radius: var(--radius); background: var(--ok-bg); margin: 1rem 0; }
.flash.err { background: var(--err-bg); color: var(--err); list-style-position: inside; }
.flash.warn { background: var(--warn-bg); color: var(--warn); }
.flash a { color: inherit; font-weight: 500; }
pre.note { white-space: pre-wrap; word-wrap: break-word; font: inherit; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; }
details { margin-top: 1.5rem; }
summary { cursor: pointer; font-weight: 600; }
.login { max-width: 24rem; margin: 12vh auto 0; padding: 0 20px; }
.login form { display: grid; gap: 1rem; }
@media (max-width: 560px) { .two { grid-template-columns: 1fr; } .facts { grid-template-columns: 1fr; } }

.top nav { display: flex; gap: 1.4rem; align-items: center; flex-wrap: wrap; }
.top nav a { color: var(--text); opacity: .8; }
.top nav a:hover { opacity: 1; text-decoration: none; }
.badge { display: inline-block; min-width: 1.3rem; padding: 0 .4rem; border-radius: 99px; background: var(--err); color: #fff; font-size: .72rem; text-align: center; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem; margin-top: 1rem; }
.card h3 { margin: 0 0 .3rem; font-size: 1.05rem; font-weight: 600; }
.card form { margin-top: .6rem; }
.card .inline select { width: auto; max-width: 100%; }
select { padding: .5rem 2rem .5rem .8rem; -webkit-appearance: none; appearance: none;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238e8e93' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right .8rem center; }
.codes { columns: 2; font-family: ui-monospace, "SF Mono", monospace; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.5rem; }
td.mono { font-family: ui-monospace, "SF Mono", monospace; font-size: .85rem; }

/* ---- Dokumentationsansicht: oben das Neue, unten das letzte Mal. Die obere Fläche lässt sich an der Ecke unten rechts in der Höhe ziehen (ohne JavaScript). */
main.doc { max-width: none; padding: .6rem .9rem; height: calc(100vh - 3.4rem); display: flex; flex-direction: column; }
.docbar { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; font-size: .95rem; padding-bottom: .5rem; }
.docview { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: .7rem; }
.docview .merk { margin: 0; padding: .6rem .9rem; border-radius: var(--radius); background: var(--warn-bg); max-height: 26%; overflow: auto; flex: none; }
.docview .merk h2 { font-size: .95rem; color: var(--warn); }
.docview .merk pre.note { margin: .3rem 0 0; padding: .4rem .2rem; background: transparent; box-shadow: none; font-weight: 500; }
.docview .merk details { margin-top: .3rem; }
.pane { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem 1rem; overflow: auto; }
.pane h2 { font-size: .85rem; font-weight: 500; color: var(--muted); }
.pane-new { flex: none; height: 58%; min-height: 9rem; resize: vertical; display: flex; flex-direction: column; gap: .6rem; }
.pane-new label.grow { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 6rem; }
.pane-new label.grow textarea { flex: 1 1 auto; resize: none; min-height: 5rem; }
.pane-new pre.note { margin: 0; padding: 0; background: transparent; box-shadow: none; }
.pane-prev { flex: 1 1 0; min-height: 4rem; background: color-mix(in srgb, var(--fill) 60%, var(--bg)); box-shadow: none; }
.pane-prev pre.note { margin: .3rem 0 0; background: transparent; box-shadow: none; padding: .2rem 0; }
.filters { display: inline-flex; gap: 2px; padding: 2px; background: var(--fill); border-radius: 980px; font-size: .85rem; margin: 0 0 1rem; }
.filters a { padding: .25rem .9rem; border-radius: 980px; color: var(--text); }
.filters a:hover { text-decoration: none; }
.filters a[aria-current] { background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.15); font-weight: 600; }

td.nowrap { white-space: nowrap; }
.dur { font-size: .95rem; color: var(--muted); align-self: end; padding-bottom: .5rem; }
.dur details { display: inline; margin: 0; }
.dur summary { display: inline; cursor: pointer; font-weight: 400; color: var(--accent); }
.dur details[open] input { display: block; width: 7rem; margin-top: .3rem; }

/* ---- Wochenansicht auf der Startseite */
.weeknav { display: flex; gap: .4rem; margin: 0; }
.weeknav .button { padding: .3rem .9rem; }
.weekgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; margin-top: .8rem; }
.day { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: .5rem; min-height: 6rem; font-size: .8rem; }
.day.today { box-shadow: 0 0 0 2px var(--accent); }
.dayhead { font-weight: 600; margin-bottom: .4rem; }
.dayhead span { color: var(--muted); font-weight: 400; }
.appt { padding: .35rem .45rem; border-radius: 8px; background: var(--fill); margin-bottom: .35rem; line-height: 1.3; word-break: break-word; }
.appt .t { display: block; font-variant-numeric: tabular-nums; color: var(--muted); }
.appt .ty { display: block; color: var(--muted); }
.appt.matched { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.appt.needs_review { background: var(--warn-bg); }
.appt a.doc { display: inline-block; margin-top: .15rem; font-size: .75rem; }
@media (max-width: 900px) { .weekgrid { grid-template-columns: 1fr; } .day { min-height: 0; } }

/* ---- Stiftsymbole statt Textlinks, aufklappbare frühere Sitzungen */
.pen-head { display: flex; align-items: center; gap: .5rem; cursor: pointer; list-style: none; }
.pen-head::-webkit-details-marker, .pen-amend > summary::-webkit-details-marker { display: none; }
.pen-amend > summary { list-style: none; display: inline-block; }
.pen-wrap { margin: 0; }
.pen { color: var(--accent); font-size: 1rem; line-height: 1; padding: .2rem .4rem; border-radius: 6px; cursor: pointer; }
.pen:hover { background: var(--fill); }
.pen-amend { margin: 0 0 .4rem; text-align: right; }
.pen-amend[open] { text-align: left; }
.pane-prev details.past { margin: 0 0 .5rem; padding: .1rem 0; border-top: 1px solid var(--line); }
.pane-prev details.past > summary { padding: .3rem 0; font-weight: 500; font-size: .95rem; }
.pane-prev details.past > summary:hover { color: var(--accent); }
details.verlauf { margin-top: 1rem; }
details.verlauf > summary { font-weight: 400; font-size: .85rem; color: var(--muted); }

main.wide { max-width: 84rem; }
.appt { overflow-wrap: anywhere; word-break: normal; }

.dot { display: inline-block; width: .75rem; height: .75rem; border-radius: 50%; vertical-align: middle; }
.dot.on { background: #30d158; box-shadow: 0 0 0 3px rgba(48,209,88,.2); }
.dot.off { background: #ff453a; box-shadow: 0 0 0 3px rgba(255,69,58,.2); }

/* Übersicht: KlientInnen unter der Woche, Zahlen, sortierbare Spalten */
#klienten { margin-top: 2.5rem; scroll-margin-top: 4.5rem; }   /* Platz für die feste Navigationsleiste beim Springen zur Liste */
.list-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; margin-bottom: .9rem; }
.list-head h2 { margin: 0; }
.list-tools { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.list-tools .filters { margin: 0; }
.search.compact { margin: 0; gap: 0; position: relative; align-items: center; }
.search.compact input[type=search] { width: 15rem; padding: .42rem 2rem .42rem 2.1rem; font-size: .9rem;
  background: var(--fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Ccircle cx='6' cy='6' r='4.6' fill='none' stroke='%238e8e93' stroke-width='1.7'/%3E%3Cpath d='M9.5 9.5l3.2 3.2' stroke='%238e8e93' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat .8rem center; }
.search.compact input[type=search]:focus { background-color: var(--card); }
.search.compact .reset { position: absolute; right: .7rem; color: var(--muted); font-size: .8rem; line-height: 1; }
.search.compact .reset:hover { color: var(--text); text-decoration: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Zahlenleiste: gleich breite Felder in einer Karte, feine Trennlinien (auch beim Umbruch auf schmalen Bildschirmen) */
.statbar { display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin: 0 0 1rem; }
.statbar > * { flex: 1 1 7.25rem; background: var(--card); padding: .8rem 1rem .75rem; display: flex; flex-direction: column; gap: .15rem; }
.statbar strong { display: flex; align-items: center; gap: .5rem; font-size: 1.55rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.statbar strong .dot { width: .6rem; height: .6rem; }
.statbar span:not(.dot) { color: var(--muted); font-size: .8rem; line-height: 1.3; }
@media (max-width: 640px) {
  .list-tools, .search.compact { width: 100%; }
  .search.compact input[type=search] { width: 100%; }
  .statbar > * { flex-basis: 40%; }
  /* Handy: Bereich, Monat und Jahr ausblenden, damit die Tabelle in die Breite passt */
  .clients th:nth-child(2), .clients td:nth-child(2), .clients th:nth-child(3), .clients td:nth-child(3), .clients th:nth-child(5), .clients td:nth-child(5), .clients th:nth-child(6), .clients td:nth-child(6) { display: none; }
  .clients th, .clients td { padding: .6rem .7rem; }
}
th a.sort { color: inherit; display: inline-flex; gap: .3rem; }
th a.sort:hover { color: var(--accent); text-decoration: none; }
th[aria-sort] a.sort { color: var(--text); font-weight: 600; }
.sessions details.past { border-top: 0; }
.sessions details.past > summary { font-size: 1.2rem; font-weight: 600; padding: .55rem 0; letter-spacing: -.02em; }
.sessions details.past[open] > summary { color: var(--accent); }

.finance-frame { width: 100%; height: calc(100vh - 11rem); min-height: 28rem; border: 0; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); margin-top: .5rem; }

/* ---- Dokumentationsansicht: eine Seite zum Scrollen (Merkpunkte, neue Sitzung, bisherige Sitzungen), Datum/Dauer nur als kleine Angabe oben */
main.doc { height: auto; display: block; padding-bottom: 4rem; }
.docview { display: block; }
.docview > * { margin-bottom: .7rem; }
.docview .merk { max-height: 30vh; }
.pane-new { height: auto; resize: none; min-height: 0; display: block; }
.pane-new label.grow { display: block; min-height: 0; }
.pane-new label.grow textarea { display: block; width: 100%; min-height: 36vh; resize: vertical; field-sizing: content; margin-top: .3rem; }
.pane-new .actions { margin-top: .7rem; }
.pane-prev { overflow: visible; min-height: 0; }
.meta-edit { display: inline-block; margin: 0; font-size: .95rem; color: var(--muted); }
.meta-edit > summary { display: inline; cursor: pointer; font-weight: 400; list-style: none; }
.meta-edit > summary::-webkit-details-marker { display: none; }
.meta-edit .meta-fields { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: .4rem; }
.meta-edit .meta-fields label { display: flex; gap: .4rem; align-items: center; }
.meta-edit .meta-fields input { width: auto; }
.docbar { position: sticky; top: 3.1rem; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); padding-top: .3rem; }

/* ---- Finanzen (Kennzahlen, Diagramme als SVG, Balken als progress; alles ohne Inline-Styles wegen der strengen Sicherheitsregel) */
.fin h2 { margin: 2rem 0 .6rem; }
.fin-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-top: .8rem; }
.fin-cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } .fin-cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fin-cards .card { margin-top: 0; }
.fin .card.hero { grid-column: span 2; background: linear-gradient(160deg, var(--accent), #1c5cab); color: #fff; }
.fin .lab { margin: 0 0 .3rem; font-size: .8rem; color: var(--muted); } .fin .hero .lab, .fin .hero .sub { color: rgba(255,255,255,.8); }
.fin .val { margin: 0; font-size: 1.7rem; font-weight: 650; letter-spacing: -.025em; } .fin .val.big { font-size: 2.8rem; }
.fin .sub { margin: .3rem 0 0; font-size: .8rem; color: var(--muted); } .fin .cap { margin: 0 0 .5rem; font-size: .85rem; color: var(--muted); }
.fin .ku { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; margin-top: .8rem; } .fin .ku .sub { margin: 0; }
.fin progress { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border: 0; border-radius: 4px; background: var(--fill); overflow: hidden; }
.fin progress::-webkit-progress-bar { background: var(--fill); } .fin progress::-webkit-progress-value { background: #30d158; border-radius: 4px; } .fin progress::-moz-progress-bar { background: #30d158; }
.fin progress.warn::-webkit-progress-value { background: #ffb340; } .fin progress.warn::-moz-progress-bar { background: #ffb340; }
.fin progress.bad::-webkit-progress-value { background: #ff453a; } .fin progress.bad::-moz-progress-bar { background: #ff453a; }
.fin progress.on::-webkit-progress-value { background: var(--accent); } .fin progress.on::-moz-progress-bar { background: var(--accent); }
.fin progress.out::-webkit-progress-value { background: #ff9f0a; } .fin progress.out::-moz-progress-bar { background: #ff9f0a; }
.hbars { display: grid; gap: .55rem; } .hb { display: grid; grid-template-columns: minmax(6rem, 10rem) 1fr auto; gap: .7rem; align-items: center; font-size: .85rem; } .hb b { font-weight: 600; font-variant-numeric: tabular-nums; }
.chart { width: 100%; height: auto; display: block; } .chart .grid { stroke: var(--line); stroke-width: 1; } .chart .ax { fill: var(--muted); font-size: 11px; }
.chart .b1, .chart .dot-s1 { fill: var(--accent); } .chart .b2 { fill: #ff9f0a; } .chart .plan { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 6 5; } .chart .s1 { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.key { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin: 0 .3rem 0 .6rem; } .key.k1 { background: var(--accent); } .key.k2 { background: #ff9f0a; } .key.kp { background: var(--muted); }
.tablecard { overflow-x: auto; } table.termine { box-shadow: none; margin-top: 0; font-variant-numeric: tabular-nums; } table.termine td:not(:first-child), table.termine th:not(:first-child) { text-align: right; white-space: nowrap; }
table.termine tr.sub td { font-size: .8rem; color: var(--muted); } table.termine tr.leer td { color: var(--muted); } table.termine tr.summe td { font-weight: 650; border-top: 2px solid var(--line); } .vorl { color: var(--muted); }
.todo p { margin: .4rem 0; }
@media (max-width: 900px) { .fin-cards, .fin-cards.three, .fin-cards.two { grid-template-columns: 1fr 1fr; } .fin .card.hero { grid-column: span 2; } .fin .ku { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .fin-cards, .fin-cards.three, .fin-cards.two { grid-template-columns: 1fr; } .fin .card.hero { grid-column: auto; } }

.appt.free { background: transparent; border: 1.5px dashed var(--line); color: var(--muted); }
.appt.free .t { color: var(--muted); }

/* ---- Textauszeichnung (siehe src/markdown.php) */
.md { line-height: 1.55; } .md p { margin: .45rem 0; } .md ul, .md ol { margin: .4rem 0 .6rem; padding-left: 1.4rem; } .md li { margin: .15rem 0; }
.md .mdh { margin: 1rem 0 .3rem; letter-spacing: -.02em; line-height: 1.25; } .md h2.mdh { font-size: 1.35rem; } .md h3.mdh { font-size: 1.15rem; } .md h4.mdh { font-size: 1rem; }
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; } .merk-text .md { font-weight: 500; }
code { font: .85em ui-monospace, "SF Mono", monospace; background: var(--fill); padding: .05rem .3rem; border-radius: 5px; }

.rundoc-edit { min-height: 60vh; field-sizing: content; }
.rundoc .card { padding: 1.2rem 1.4rem; }

/* ---- Blockeditor (public/assets/editor.js) */
.be-wrap { position: relative; margin-top: .3rem; }
.be-bar { display: flex; gap: .25rem; flex-wrap: wrap; margin-bottom: .35rem; }
.be-btn { padding: .2rem .6rem; min-width: 2rem; border-radius: 8px; background: var(--fill); color: var(--text); font-size: .85rem; line-height: 1.3; }
.be-btn:hover { background: color-mix(in srgb, var(--fill) 60%, var(--accent) 18%); }
.be-btn.be-b { font-weight: 700; } .be-btn.be-i { font-style: italic; }
.be-root { position: relative; min-height: 8rem; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); outline: 0; overflow-wrap: anywhere; }
.be-root:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.be-root[data-empty]::before { content: attr(data-placeholder); position: absolute; left: .9rem; top: .7rem; color: var(--muted); pointer-events: none; }
.be-root p { margin: .4rem 0; } .be-root > :first-child { margin-top: 0; } .be-root ul, .be-root ol { margin: .4rem 0; padding-left: 1.5rem; }
.be-root h2, .be-root h3, .be-root h4 { margin: 1rem 0 .3rem; letter-spacing: -.02em; line-height: 1.25; }
.be-root h2 { font-size: 1.35rem; } .be-root h3 { font-size: 1.15rem; } .be-root h4 { font-size: 1rem; }
.pane-new .be-root { min-height: 36vh; } .rundoc .be-root { min-height: 50vh; }
.be-menu { position: absolute; z-index: 30; min-width: 14rem; padding: .3rem; border-radius: 12px; background: var(--card); box-shadow: 0 8px 30px rgba(0,0,0,.18), 0 0 0 1px var(--line); }
.be-menu[hidden] { display: none; }
label[hidden] { display: none; }
.be-item { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem .6rem; border-radius: 8px; cursor: pointer; font-size: .9rem; }
.be-item span { color: var(--muted); font-size: .8rem; } .be-item.on, .be-item:hover { background: var(--fill); }
.pane .be-root h2, .pane .be-root h3, .pane .be-root h4 { color: var(--text); font-weight: 650; }
.appt a.join { display: inline-block; margin: .15rem .5rem 0 0; padding: .1rem .55rem; border-radius: 980px; background: var(--accent); color: #fff; font-size: .75rem; }
.appt a.join:hover { text-decoration: none; filter: brightness(1.1); }
.appt a.docbtn { display: inline-block; margin: .15rem .5rem 0 0; padding: .1rem .55rem; border-radius: 980px; background: var(--fill); color: var(--accent); font-size: .75rem; }
.appt a.docbtn:hover { text-decoration: none; background: color-mix(in srgb, var(--fill) 60%, var(--accent) 18%); }
.be-status { min-height: 1.1rem; margin-top: .25rem; font-size: .8rem; color: var(--muted); }
.be-restore { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .5rem; padding: .5rem .8rem; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-size: .9rem; }
.be-restore button { padding: .25rem .8rem; font-size: .85rem; }

/* Stift zeigt nach links unten, damit man ihn mit der rechten Hand nehmen könnte (Zeichen gespiegelt) */
.pen, .pen-i { display: inline-block; transform: scaleX(-1); }

/* Farben im Kalender: eine Farbe für alles, grau für das Kennenlerngespräch (und Termine nur im Kalender) */
.appt.tone-main { background: color-mix(in srgb, var(--accent) 13%, transparent); }
.appt.tone-gray { background: var(--fill); }
.appt.needs_review.tone-main, .appt.needs_review.tone-gray { box-shadow: inset 3px 0 0 var(--warn); }
.appt.free.tone-main { background: transparent; border: 1.5px dashed color-mix(in srgb, var(--accent) 55%, transparent); color: var(--accent); }
.appt.free.tone-main .t { color: var(--accent); }
.appt.free.tone-gray { background: transparent; border: 1.5px dashed var(--line); color: var(--muted); }
.clients th.num, .clients td.num { text-align: center; font-variant-numeric: tabular-nums; }
.clients th.num a.sort { justify-content: center; }
.sessions-chart { margin: 1rem 0 1.5rem; padding: 1rem 1.25rem .5rem; }
.sessions-chart .chart .val { fill: var(--text); font-size: 11px; font-weight: 600; }

/* ---- Feinschliff im Apple-Stil: aktive Navigation, eigene Aufklapp-Pfeile, gruppierte Listen, Formulare als Karten */
.top nav { gap: .2rem; }
.top nav a { padding: .3rem .75rem; border-radius: 980px; }
.top nav a[aria-current] { opacity: 1; font-weight: 600; background: var(--fill); }
.top nav button.link { padding: .3rem .75rem; font-size: inherit; }
.tag { white-space: nowrap; }
.flash { padding: .7rem 1rem; border-radius: 12px; font-size: .95rem; }
.pill { display: inline-flex; align-items: center; padding: .2rem .75rem; border-radius: 980px; background: var(--fill); color: var(--text); font-size: .85rem; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.week-title { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }

/* Aufklappen: schlanker Pfeil (› zeigt nach rechts, offen nach unten) statt Dreieck */
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
details:not(.meta-edit):not(.pen-amend) > summary:not(.pen-head) { display: flex; align-items: center; gap: .55rem; }
details:not(.meta-edit):not(.pen-amend) > summary:not(.pen-head)::after { content: ''; flex: none; width: .42rem; height: .42rem; margin: 0 .2rem;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .2s ease; }
details[open]:not(.meta-edit):not(.pen-amend) > summary:not(.pen-head)::after { transform: rotate(45deg) translate(-2px, -2px); }
details.past > summary::after { margin-left: auto !important; }

/* Sitzungen in der Akte als gruppierte Liste (eine Karte, Zeilen mit Haarlinien, Pfeil rechts) */
.sessions details.past { margin: 0; background: var(--card); padding: 0 1.15rem; border-top: 1px solid var(--line); }
.sessions details.past:first-of-type { margin-top: .9rem; border-top: 0; border-radius: var(--radius) var(--radius) 0 0; }
.sessions details.past:last-of-type { border-radius: 0 0 var(--radius) var(--radius); }
.sessions details.past:first-of-type:last-of-type { border-radius: var(--radius); }
.sessions details.past > summary { font-size: 1.02rem; font-weight: 600; letter-spacing: -.01em; padding: .85rem 0; }
.sessions details.past[open] > summary { color: var(--text); }
.sessions details.past > .md { padding: 0 0 .4rem; }
.sessions details.past > p.hint { margin: .2rem 0 0; }
.sessions details.past[open] { padding-bottom: .9rem; }   /* Abstand innen, sonst scheint der Hintergrund durch */

/* Gruppierte Link-Liste wie in den Einstellungen: Titel, kleine Erklärung, Pfeil rechts */
.linklist { list-style: none; margin: .8rem 0 0; padding: 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.linklist li + li { border-top: 1px solid var(--line); }
.linklist a { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1.15rem; color: var(--text); }
.linklist a:hover { background: color-mix(in srgb, var(--fill) 45%, transparent); text-decoration: none; }
.linklist a::after { content: ''; flex: none; width: .45rem; height: .45rem; border-right: 2px solid var(--muted); border-top: 2px solid var(--muted); transform: rotate(45deg); opacity: .75; }
.linklist small { display: block; color: var(--muted); font-size: .82rem; margin-top: .1rem; }

/* Formulare stehen in einer Karte statt lose auf dem grauen Hintergrund */
main > form.stack:not(.plain), main > section > form.stack:not(.plain), main > section > form.inline { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.25rem; }
main > section > form.inline { margin-top: .8rem; }

/* Einfache Aufklapper (z. B. „Eigenen Termin anlegen“) sehen aus wie ein Link, nicht wie eine Überschrift */
:where(details:not(.past):not(.verlauf):not(.meta-edit):not(.pen-amend)) > summary:where(:not(.pen-head)) { color: var(--accent); font-weight: 500; }
:where(details:not(.past):not(.verlauf):not(.meta-edit):not(.pen-amend)) > summary:where(:not(.pen-head))::after { border-color: currentColor; }

/* Anmeldung: Formular als Karte in der Mitte */
.login h1 { text-align: center; margin-bottom: 1.2rem; }
.login form { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.4rem 1.4rem 1.5rem; }
.login form button { width: 100%; padding: .65rem 1rem; }
.login-mark { display: block; margin: 0 auto .6rem; width: 56px; height: 56px; }
@media (max-width: 640px) {
  .top { flex-wrap: wrap; gap: .25rem .5rem; padding: .5rem 14px; }
  .brand { white-space: nowrap; }
  .top nav { gap: 0; font-size: .8rem; margin-left: -.45rem; flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .top nav a, .top nav button.link { padding: .25rem .45rem; white-space: nowrap; }
  .top nav form { position: absolute; right: 8px; top: .4rem; }   /* Abmelden oben rechts neben dem Namen */
}
.tag.demo { margin-left: .4rem; color: #fff; background: #ff9f0a; }

/* Nachhaken: Zahl als Filter, Schnell-Knopf "✓ heute" in der Spalte Letzter Kontakt (erscheint beim Darüberfahren, auf Touch immer) */
.statbar > a.stat-link { color: var(--text); text-decoration: none; transition: background .15s; }
.statbar > a.stat-link:hover { background: color-mix(in srgb, var(--card) 85%, var(--accent) 6%); }
.statbar > a.stat-link strong { color: var(--warn); }
.statbar > a.stat-link.on { background: var(--warn-bg); }
.clients td.touch { white-space: nowrap; }
.clients td.touch > span { margin-right: .4rem; }
.clients form.quick { display: inline; margin: 0; }
.clients form.quick button { padding: .15rem .6rem; font-size: .75rem; background: var(--fill); color: var(--accent); opacity: 0; transition: opacity .15s; }
.clients form.quick button:hover { background: color-mix(in srgb, var(--fill) 60%, var(--accent) 18%); }
.clients tr:hover form.quick button, .clients form.quick button:focus-visible { opacity: 1; }
@media (hover: none) { .clients form.quick button { opacity: 1; } }
section[id] { scroll-margin-top: 4.5rem; }   /* Sprungziele (#kontakt, #dokument) nicht unter der festen Navigationsleiste */
.inline label.grow { flex: 1 1 14rem; } .inline label.grow input { width: 100%; }
.dot.warn { background: #ffcc00; box-shadow: 0 0 0 3px rgba(255,204,0,.25); }
.hint.version { text-align: center; margin-top: 3rem; font-size: .8rem; }
.login .hint.version { margin-top: 1rem; }
