/* PHYSIO44 Praxissoftware – schlichtes, ruhiges Layout. Keine externen Schriften. */
:root {
  --bg: #f5f6f4;
  --surface: #ffffff;
  --text: #1d2321;
  --muted: #5d6763;
  --line: #d9ddd9;
  --primary: #1f6f5c;
  --primary-dark: #17574a;
  --primary-soft: #e3f0ec;
  --warn: #9a5b00;
  --warn-bg: #fff4dc;
  --danger: #a32020;
  --danger-bg: #fde8e8;
  --ok: #1d6b2b;
  --ok-bg: #e5f4e7;
  --info-bg: #e8f0fb;
  --radius: 8px;
  --tap: 44px;
  font-size: 17px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5;
}
a { color: var(--primary); }
h1 { font-size: 1.6rem; margin: .4rem 0 1rem; }
h2 { font-size: 1.25rem; margin: 0 0 .8rem; }
h3 { font-size: 1.05rem; margin: 1rem 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.mt { margin-top: 1rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
code.secret { font-size: 1.05rem; letter-spacing: .05em; background: var(--primary-soft); padding: .2rem .4rem; border-radius: 4px; }

/* Kopfzeile */
.topbar { display: flex; align-items: center; gap: 1rem; background: var(--primary); color: #fff; padding: 0 1rem; min-height: 56px; flex-wrap: wrap; }
.topbar .brand { color: #fff; font-weight: 600; text-decoration: none; font-size: 1.05rem; padding: .6rem 0; }
.mainnav { display: flex; gap: .2rem; align-items: center; flex-wrap: wrap; margin-left: auto; }
.mainnav a, .mainnav .linkbutton { color: #fff; text-decoration: none; padding: 0 .75rem; min-height: var(--tap); display: inline-flex; align-items: center; border-radius: 6px; }
.mainnav a.active, .mainnav a:hover, .mainnav .linkbutton:hover { background: rgba(255,255,255,.16); }
.navtoggle { display: none; margin-left: auto; background: transparent; border: 0; color: #fff; font-size: 1.6rem; min-width: var(--tap); min-height: var(--tap); }
@media (max-width: 900px) {
  .navtoggle { display: block; }
  .mainnav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: .5rem; }
  .mainnav.open { display: flex; }
}

main.container { max-width: 1280px; margin: 0 auto; padding: 1rem; }
main.narrow { max-width: 520px; margin: 3rem auto; padding: 1rem; }
.crumbs { margin: 0; font-size: .9rem; color: var(--muted); }

/* Karten, Kacheln */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; margin-bottom: 1rem; }
.card.login h1 { margin-top: 0; }
.narrow-card { max-width: 520px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .8rem; margin-bottom: 1.5rem; }
.tile { display: flex; flex-direction: column; gap: .3rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; text-decoration: none; color: var(--text); min-height: 90px; }
.tile:hover { border-color: var(--primary); }
.tile span { color: var(--muted); font-size: .9rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: var(--tap); padding: 0 1.1rem; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-small { min-height: 36px; padding: 0 .7rem; font-size: .92rem; }
.btn-large { min-height: 56px; padding: 0 1.6rem; font-size: 1.1rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.linkbutton { background: none; border: 0; color: var(--primary); font: inherit; cursor: pointer; padding: 0; min-height: var(--tap); }
form.inline { display: inline; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .8rem 0; }

/* Formulare */
.field { margin-bottom: .9rem; display: flex; flex-direction: column; gap: .25rem; }
.field label { font-weight: 600; font-size: .95rem; }
.field-check label { font-weight: normal; display: flex; align-items: center; gap: .5rem; min-height: var(--tap); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=search], input[type=tel], select, textarea {
  font: inherit; padding: .55rem .7rem; min-height: var(--tap); border: 1px solid #b9c0bc; border-radius: 6px; background: #fff; width: 100%; max-width: 100%;
}
textarea { min-height: 120px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 24px; height: 24px; accent-color: var(--primary); }
input[type=file] { min-height: var(--tap); }
.req { color: var(--danger); }
.help { color: var(--muted); }
.error { color: var(--danger); font-weight: 600; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 1rem; }
.searchbar { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.searchbar input { flex: 1; min-width: 200px; }

/* Meldungen */
.messages { margin-bottom: 1rem; }
.msg { padding: .75rem 1rem; border-radius: 6px; margin-bottom: .5rem; border: 1px solid transparent; }
.msg-success { background: var(--ok-bg); color: var(--ok); border-color: #b7dcbd; }
.msg-error { background: var(--danger-bg); color: var(--danger); border-color: #f0b4b4; }
.msg-warning { background: var(--warn-bg); color: var(--warn); border-color: #f0d79b; }
.msg-info { background: var(--info-bg); color: #1d3f72; border-color: #c4d6f2; }
.warnbar { background: var(--danger-bg); color: var(--danger); border: 1px solid #f0b4b4; border-left: 6px solid var(--danger); border-radius: 6px; padding: .7rem 1rem; margin-bottom: 1rem; font-weight: 600; }
.hintbar { background: var(--warn-bg); color: var(--warn); border: 1px solid #f0d79b; border-left: 6px solid var(--warn); border-radius: 6px; padding: .7rem 1rem; margin-bottom: 1rem; }
.slot-hint { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 60; max-width: calc(100% - 2rem); box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.placeholder-note { background: var(--warn-bg); border: 2px dashed var(--warn); padding: .6rem 1rem; border-radius: 6px; color: var(--warn); font-weight: 600; }

/* Tabellen */
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td { padding: .6rem .7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: .88rem; color: var(--muted); font-weight: 600; background: #fafbfa; }
.table tr.clickable { cursor: pointer; }
.table tr:hover td { background: #fafcfb; }
.table td.num, .table th.num { text-align: right; white-space: nowrap; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; }
.tablewrap .table { border: 0; }

/* Status-Etiketten */
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .82rem; font-weight: 600; background: #eceeed; color: #333; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: #1d3f72; }
.counter { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.counter .label { font-weight: normal; color: var(--muted); font-size: .8rem; }

/* Reiter (Kartei) */
.tabs { display: flex; gap: .2rem; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin-bottom: 1rem; }
.tabs a { padding: 0 .9rem; min-height: var(--tap); display: inline-flex; align-items: center; text-decoration: none; color: var(--text); border-radius: 6px 6px 0 0; }
.tabs a.active { background: var(--surface); border: 1px solid var(--line); border-bottom: 2px solid var(--surface); margin-bottom: -2px; font-weight: 600; color: var(--primary); }
.patienthead { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 1rem; }
.patienthead h1 { margin-bottom: .2rem; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }

/* Kalender */
.calnav { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .8rem; }
.calnav .title { font-weight: 600; font-size: 1.1rem; margin: 0 .5rem; }
.calendar { width: 100%; border-collapse: collapse; table-layout: fixed; background: var(--surface); }
.calendar th, .calendar td { border: 1px solid var(--line); padding: 0; vertical-align: top; }
.calendar th { padding: .4rem; font-size: .9rem; background: #fafbfa; }
.calendar th.today { background: var(--primary-soft); }
.calendar td.time, .calendar th.time { width: 3.2rem; text-align: right; padding: .25rem .3rem; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.calendar td.slot { height: 48px; }
.calendar td.slot a.free { display: block; height: 100%; min-height: 48px; text-decoration: none; }
.calendar td.slot a.free:hover { background: var(--primary-soft); }
.calendar td.closed, .calendar .lane-slot.closed { background: repeating-linear-gradient(45deg, #f3f3f3, #f3f3f3 6px, #ececec 6px, #ececec 12px); }
.calendar td.appt { padding: 2px; }
.appt-box { display: block; height: 100%; min-height: 44px; border-radius: 6px; padding: .3rem .45rem; text-decoration: none; color: var(--text); background: #dcebe6; border-left: 5px solid var(--primary); font-size: .88rem; overflow: hidden; }
.appt-box.st-durchgefuehrt { background: #e2efe3; border-left-color: var(--ok); }
.appt-box.st-abgesagt, .appt-box.st-nicht_erschienen { background: #f1f1f1; border-left-color: #999; color: #666; text-decoration: line-through; }
.appt-box .who { font-weight: 600; display: block; }
.appt-box .flag { color: var(--danger); font-weight: 700; }
/* eigener Scrollbereich: Tageskopf bleibt oben, Zeitspalte links stehen (ABNAHME DT18) */
.calendar-wrap { overflow: auto; max-height: var(--cal-h, 80vh); border: 1px solid var(--line); }
.calendar-wrap > .calendar { border-style: hidden; }
.calendar thead { position: sticky; top: 0; z-index: 5; }
.calendar thead th, .calendar thead td { box-shadow: inset 0 -1px 0 var(--line); }
.calendar td.time, .calendar th.time { position: sticky; left: 0; z-index: 4; background: var(--surface); box-shadow: inset -1px 0 0 var(--line); }
.calendar thead th.time, .calendar thead td.time { background: #fafbfa; }
/* Feld unter dem Mauszeiger: Uhrzeit und Tag in derselben Farbe hervorheben (ABNAHME DT17) */
.calendar th.hl, .calendar td.time.hl { background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; }
.calendar th.hl { box-shadow: inset 0 -3px 0 var(--primary); }
.calendar td.time.hl { box-shadow: inset -3px 0 0 var(--primary); }
.calendar.week { min-width: 760px; }
/* Kalender: Spalte für freie Einträge neben den Terminen, Buchungsmodus, Buchungsfenster */
.calendar td.entry-lane { width: 22%; padding: 2px; background: #fcfcfc; }
.calendar tr.allday td { padding: 2px; background: #fafbfa; }
.entry-box { display: block; border-radius: 6px; padding: .2rem .4rem; margin-bottom: 2px; font-size: .8rem; text-decoration: none; color: var(--text); overflow: hidden; }
.legend .entry-box, .legend .appt-box { display: inline-block; }
.entry-box .who { font-weight: 600; display: block; }
.entry-arbeitszeit { background: #e4ebf7; border-left: 4px solid #3b5ba9; }
.entry-freizeit { background: #fbeedd; border-left: 4px solid #c9822b; }
.appt-box.own { outline: 2px solid var(--primary); }
.bookingbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; background: var(--primary-soft); border: 1px solid var(--primary); border-radius: 8px; padding: .7rem 1rem; margin: .5rem 0 1rem; }
.bookingbar .counters { margin: .3rem 0; padding-left: 1.2rem; }
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 1rem; z-index: 50; overflow-y: auto; }
.modal-box { background: var(--surface); border-radius: 10px; box-shadow: 0 8px 30px rgba(0, 0, 0, .25); padding: 1.2rem 1.4rem; width: 100%; max-width: 720px; }
.modal-box h2 { margin-top: 0; }
.warn-text { color: var(--danger); }
/* Terminplan: markieren, Menü, Verschieben */
.appt-box[data-appt] { cursor: pointer; }
.appt-box.selected { outline: 3px solid #1f4fb8; outline-offset: -1px; box-shadow: 0 0 0 3px rgba(31, 79, 184, .2); }
.appt-box .attended { display: block; font-size: .75rem; color: var(--ok); font-weight: 600; }
.appt-box.mini { min-height: 0; font-size: .72rem; padding: .1rem .3rem; margin: 2px; }
.calendar td.slot { position: relative; }
.calendar .slot a.free { position: absolute; inset: 0; min-height: 0; }
.calendar .slot a.free:hover { background: var(--primary-soft); }
/* Spalte der Kalendereinträge: freie Fläche je Rasterzeile buchbar, nur der Eintrag selbst öffnet den Eintrag (ABNAHME DE2) */
.calendar td.entry-block { position: relative; vertical-align: top; }
.calendar .lane-slot { position: absolute; left: 0; right: 0; }
.calendar td.entry-block .entry-box { position: relative; z-index: 2; }
.calendar td.slot .appt-box.mini { position: relative; z-index: 1; }
body.moving .calendar .slot[data-start], body.dragging .calendar .slot[data-start] { cursor: copy; background: #eef4ff; }
body.moving .calendar .slot[data-start]:hover, body.dragging .calendar .slot[data-start]:hover { background: #cfe0ff; }
.keyhelp { color: var(--muted); margin: .3rem 0 .6rem; }
kbd { display: inline-block; min-width: 1.3em; padding: 0 .3em; border: 1px solid #bbb; border-bottom-width: 2px; border-radius: 4px; background: #fff; font: inherit; font-size: .85em; text-align: center; }
.ctxmenu { position: fixed; z-index: 60; min-width: 240px; max-width: 340px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); padding: .3rem 0; }
.ctxmenu-title { font-size: .8rem; color: var(--muted); padding: .3rem .8rem .4rem; border-bottom: 1px solid var(--line); margin-bottom: .2rem; }
.ctxitem-form { margin: 0; }
.ctxitem { display: flex; justify-content: space-between; align-items: center; gap: .6rem; width: 100%; padding: .45rem .8rem; background: none; border: 0; text-align: left; font: inherit; color: var(--text); text-decoration: none; cursor: pointer; }
.ctxitem:hover, .ctxitem:focus { background: var(--primary-soft); outline: none; }
.ctxitem.disabled { color: #999; cursor: not-allowed; flex-wrap: wrap; }
.ctxitem.disabled small { flex-basis: 100%; font-size: .72rem; color: #888; }
.btn.disabled { opacity: .5; cursor: not-allowed; }

/* Körperfigur */
.bodymap { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.bodymap svg { width: 220px; max-width: 45vw; height: auto; touch-action: manipulation; }
.bodymap .region { fill: #e8ecea; stroke: #7d8a85; stroke-width: 1.5; cursor: pointer; }
.bodymap .region.selected { fill: #e0684b; stroke: #8f2d17; }
.bodymap .silhouette { fill: #f6f7f6; stroke: #9aa5a1; stroke-width: 2; }
.bodymap text { font-size: 12px; fill: #5d6763; text-anchor: middle; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.chip { background: var(--primary-soft); color: var(--primary-dark); padding: .2rem .6rem; border-radius: 999px; font-size: .9rem; }

/* Medien */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .8rem; }
.media-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem; }
.media-item img, .media-item video { width: 100%; height: 150px; object-fit: cover; border-radius: 4px; background: #222; }
.media-item .cap { font-size: .88rem; margin-top: .3rem; }
.media-item label { display: flex; gap: .4rem; align-items: center; font-size: .88rem; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.compare img, .compare video { width: 100%; max-height: 70vh; object-fit: contain; background: #111; border-radius: 6px; }
@media (max-width: 700px) { .compare { grid-template-columns: 1fr; } }
.viewer img, .viewer video { max-width: 100%; max-height: 80vh; }

/* Kiosk */
body.kiosk { background: #fff; font-size: 19px; }
body.kiosk .kioskbar { display: flex; justify-content: space-between; align-items: center; background: var(--primary); color: #fff; padding: .4rem 1rem; }
body.kiosk .kioskbar a, body.kiosk .kioskbar button { color: #fff; }
body.kiosk main.container { max-width: 900px; }
.steps { display: flex; gap: .3rem; flex-wrap: wrap; margin: 1rem 0; padding: 0; list-style: none; }
.steps li { flex: 1; min-width: 90px; text-align: center; padding: .5rem; border-radius: 6px; background: #eef0ef; font-size: .85rem; color: var(--muted); }
.steps li.done { background: var(--ok-bg); color: var(--ok); }
.steps li.current { background: var(--primary); color: #fff; font-weight: 600; }
.steps li a { display: block; margin: -.5rem; padding: .5rem; color: inherit; text-decoration: underline; border-radius: 6px; }
.steps li a:hover, .steps li a:focus-visible { background: rgba(0,0,0,.06); }
.kiosk .field label { font-size: 1.05rem; }
.yesno { display: flex; gap: .6rem; flex-wrap: wrap; }
.yesno label { display: inline-flex; align-items: center; gap: .5rem; padding: 0 1.2rem; min-height: 56px; border: 2px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 600; }
.yesno input:checked + span { color: var(--primary-dark); }
.yesno label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.choice-list label { display: flex; align-items: center; gap: .6rem; min-height: 48px; }
.formtext { background: #fafbfa; border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.2rem; max-height: 55vh; overflow-y: auto; }
.signature-wrap { border: 2px dashed var(--primary); border-radius: 8px; background: #fff; touch-action: none; }
.signature-wrap canvas { width: 100%; height: 260px; display: block; touch-action: none; }
.slider { width: 100%; height: 48px; accent-color: var(--primary); }
.painvalue { font-size: 2rem; font-weight: 700; color: var(--primary); text-align: center; }

/* Vorlagen-Editor */
.editor { display: grid; grid-template-columns: 1fr 320px; gap: 1rem; }
.editor textarea { min-height: 460px; font-family: Consolas, "Courier New", monospace; font-size: .92rem; }
.fieldlist { max-height: 560px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.fieldlist button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: .5rem .7rem; cursor: pointer; font: inherit; min-height: var(--tap); }
.fieldlist button:hover { background: var(--primary-soft); }
.fieldlist code { font-size: .85rem; color: var(--primary-dark); }
.fieldlist small { display: block; color: var(--muted); }
@media (max-width: 900px) { .editor { grid-template-columns: 1fr; } }

/* Dashboard */
.dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; }
.dash .card h2 { display: flex; justify-content: space-between; align-items: center; }
.dash ul { list-style: none; margin: 0; padding: 0; }
.dash li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.dash li:last-child { border-bottom: 0; }

@media (max-width: 600px) {
  :root { font-size: 16px; }
  main.container { padding: .6rem; }
  .card { padding: .9rem; }
}
@media print {
  .topbar, .actions, .navtoggle { display: none !important; }
  .calendar-wrap { max-height: none !important; overflow: visible; }
}

/* Vorschau einer Vorlage (Rechnung, Formular, Bericht) wie auf Papier */
.paper { background: #fff; border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0,0,0,.06); padding: 2rem 2.4rem; max-width: 820px; margin: 1rem 0; font-size: .95rem; }
.paper h2 { font-size: 1.3rem; }
.paper .logo { text-align: right; }
.paper .logo img { max-height: 80px; max-width: 260px; }
.paper .praxiskopf { text-align: right; font-size: .9rem; }
.paper table.positionen, .paper table.antworten { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.paper table.positionen th, .paper table.positionen td, .paper table.antworten td { border-bottom: 1px solid #ddd; padding: .35rem .5rem; text-align: left; }
.paper .betrag { text-align: right !important; white-space: nowrap; }
.paper tr.summe td { font-weight: 700; border-top: 2px solid #333; }
.paper .fusszeile { margin-top: 2rem; border-top: 1px solid #ccc; padding-top: .5rem; font-size: .8rem; color: #444; }
/* Brief-Layout (Rechnung, Zahlungserinnerung, Mahnungen) in der Vorschau */
.paper:has(.brieffuss) { display: flex; flex-direction: column; }
.paper .brieffuss { order: 99; display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin-top: 2rem; border-top: 1px solid #ccc; padding-top: .5rem; font-size: .75rem; color: #444; }
.paper .briefkopf { text-align: right; min-height: 5rem; }
.paper .briefkopf img { max-height: 80px; max-width: 260px; }
.paper .briefkopf .praxisname { font-size: 1.3rem; font-weight: 700; }
.paper .briefkopf .untertitel { font-size: .85rem; color: #444; }
.paper .anschriftzeile { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin: 1rem 0 1.5rem; }
.paper .anschriftfeld { width: 22rem; max-width: 60%; }
.paper .ruecksende { font-size: .7rem; text-decoration: underline; color: #444; margin-bottom: .4rem; }
.paper .empfaenger { min-height: 5.5rem; }
.paper table.positionen .anzahl { width: 4rem; text-align: right; }
.paper .steuerhinweis { text-align: right; font-size: .75rem; color: #444; }
.paper .stornohinweis { font-weight: 700; }

/* Auswahlfelder (Anamnese) groß und touch-freundlich */
.choices > div > div label, .choices ul li label { display: flex; align-items: center; gap: .6rem; min-height: 48px; font-weight: normal; }
.choices > div { display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; }
.formtext.paper { max-height: 50vh; overflow-y: auto; }

[hidden] { display: none !important; }

/* Terminplan: Ansichten, Monat, Datumssprung, graue (buchbare) Zeiten außerhalb der Arbeitszeit */
.viewswitch { display: inline-flex; gap: .25rem; }
.datejump { display: inline-flex; gap: .25rem; align-items: center; }
.datejump input[type=date] { padding: .25rem .4rem; }
.calendar .slot.closed a.free:hover { background: #e6e6e6; }
.calendar.month td.monthday { height: 6.5rem; padding: 0; }
.calendar.month td.monthday.other { background: #fafafa; color: #999; }
.calendar.month td.monthday.today { background: var(--primary-soft); }
.monthlink { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: .3rem; color: var(--text); text-decoration: none; overflow: hidden; }
.monthlink:hover { background: #f1f6f4; }
.monthlink .daynum { font-weight: 700; }
.monthlink .mini-line { font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.monthlink .entry-box { padding: 0 .3rem; margin: 0; }
.week-list { display: none; }
.touchhelp { display: none; color: var(--muted); }
.drag-edge { outline: 3px dashed #1f4fb8; }

/* Smartphone: Tagesansicht, Woche als Liste, Fenster und Menü bildschirmfüllend, keine waagerechte Scrollleiste */
@media (max-width: 640px) {
  .calendar.week { display: none; }
  .week-list { display: block; }
  .week-list-day { border-bottom: 1px solid var(--line); padding: .5rem 0; }
  .week-list-day.today h3 { color: var(--primary); }
  .week-list-day h3 { font-size: 1rem; margin: .2rem 0 .4rem; }
  .week-list .appt-box, .week-list .entry-box { display: block; margin: .25rem 0; min-height: 0; padding: .5rem .6rem; font-size: .95rem; }
  .calendar-wrap { overflow-x: auto; }
  .calendar-wrap[data-view="woche"] { max-height: none; overflow: visible; border: 0; }  /* Wochenliste statt Tabelle */
  .calendar.day { min-width: 0; width: 100%; }
  .calendar.month td.monthday { height: 4.2rem; }
  .monthlink .mini-line { display: none; }
  .monthlink .badge { font-size: .7rem; padding: 0 .3rem; }
  .keyhelp { display: none; }
  .touchhelp { display: block; }
  .calnav .title { flex-basis: 100%; order: -1; margin: 0; }
  .datejump input[type=date] { max-width: 9.5rem; }
  .modal { padding: 0; }
  .modal-box { max-width: none; min-height: 100vh; border-radius: 0; padding: 1rem; }
  .modal-box .btn { min-height: 48px; }
  .ctxmenu { left: 0 !important; right: 0; top: auto !important; bottom: 0; max-width: none; min-width: 0; border-radius: 12px 12px 0 0; max-height: 85vh; overflow-y: auto; }
  .ctxitem { min-height: 52px; font-size: 1.05rem; }
  .bookingbar { flex-direction: column; }
}
/* Hinweis „Anamnese unvollständig“ */
.anamnesis-open summary { cursor: pointer; }
.anamnesis-open .open-questions { margin: .5rem 0; padding-left: 1.2rem; }
.anamnesis-open .open-questions li.warnq { color: var(--danger); }
.anamnesis-open .actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* Terminblatt im Rezept (docs/09 Abschnitt P) */
.inline-form { display: inline-block; margin: 0 .2rem .2rem 0; }
.field-check-inline { display: inline-flex; align-items: center; gap: .3rem; margin-right: .8rem; min-height: var(--tap); white-space: nowrap; }
table.sheet input[type="date"] { min-width: 9.5rem; }
