.clinical-plan-dialog { width: min(94vw, 900px); height: 90dvh; max-height: 90dvh; border-radius: 18px; border: 1px solid #67867c; padding: 16px; background: #fff; color: #20292d; }
.clinical-plan-dialog::backdrop { background: rgb(18 36 33 / 55%); }
.clinical-plan-pages { display: block; width: 100%; height: 53dvh; overflow: auto; border: 1px solid #ccd8d5; }
.clinical-plan-pages figure { margin: 8px; }
.clinical-plan-pages img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.clinical-plan-pages .clinical-page-zoom { min-width: 900px; }
.clinical-plan-pages .clinical-page-zoom img { cursor: zoom-out; }
.clinical-plan-dialog label { display: block; margin-block: 12px; }
.clinical-plan-reminder { border-inline-start: 4px solid #b28340; margin-block: 12px; }

:root {
  color-scheme: light;
  --ink: #171b19;
  --paper: #f5f4f0;
  --white: #ffffff;
  --taupe: #a39778;
  --taupe-dark: #665b43;
  --line: #dedbd2;
  --muted: #595e58;
  --green: #42634d;
  --blue: #43647c;
  --rose: #944e4e;
  --gold: #786024;
  --focus: #245e89;
  --shadow: 0 8px 28px rgba(20, 28, 22, .08);
  font-family: "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; min-height: 100vh; background: var(--paper); color: var(--ink); line-height: 1.45; }
button, input, select, textarea { font: inherit; }
button { min-height: 44px; min-width: 44px; border-radius: 8px; cursor: pointer; line-height: 1.35; }
button, a, summary { touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: .48; }
button:focus-visible, a:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
summary { min-height: 44px; padding: 11px 12px; cursor: pointer; font-weight: 650; overflow-wrap: anywhere; }
summary::marker { color: var(--taupe-dark); }
.skip-link { position: fixed; top: 8px; left: 12px; z-index: 110; transform: translateY(-160%); padding: 10px 16px; border-radius: 8px; background: var(--white); color: var(--ink); font-weight: 700; }
.skip-link:focus { transform: translateY(0); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 5px; color: var(--taupe-dark); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0; }

.login-shell { min-height: 100vh; display: grid; grid-template-rows: minmax(180px, 34vh) 1fr; background: var(--white); }
.brand-panel { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 30px; background: var(--ink); color: var(--white); border-bottom: 8px solid var(--taupe); }
.brand-panel strong { display: block; font-size: 28px; }
.brand-panel span { display: block; margin-top: 5px; color: #d4ccb8; font-size: 15px; }
.brand-logo { width: 88px; height: 88px; object-fit: contain; filter: grayscale(1) invert(1); }
.login-form { width: min(100%, 470px); margin: 0 auto; padding: 34px 24px 48px; display: grid; align-content: start; gap: 18px; }
.login-form h1, .login-form h2 { margin: 0; font-size: 34px; }
label { display: grid; gap: 7px; color: #3f3d37; font-size: 14px; font-weight: 650; }
input, select, textarea { width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px; border: 1px solid #aaa495; border-radius: 8px; background: var(--white); color: var(--ink); }
textarea { min-height: 105px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--focus); outline-offset: 2px; border-color: var(--focus); }
.primary-button, .secondary-button, .danger-button { min-height: 46px; padding: 10px 16px; border: 1px solid transparent; border-radius: 8px; font-weight: 700; }
.primary-button { background: var(--ink); color: var(--white); border-bottom: 2px solid var(--taupe); }
.secondary-button { background: #ece8de; color: var(--ink); border-color: var(--line); }
.danger-button { width: 100%; margin-top: 24px; color: #7e2d2d; background: #fff8f7; border-color: #d7aaaa; }
.text-button { border: 0; background: transparent; color: var(--taupe-dark); font-weight: 700; }
.form-message { min-height: 20px; margin: 0; color: #9b3333; font-size: 14px; }

.app-shell { min-height: 100vh; padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
.app-header { position: sticky; top: 0; z-index: 20; min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 18px; background: var(--ink); color: var(--white); border-bottom: 2px solid var(--taupe); }
.app-brand { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; font-size: 13px; font-weight: 750; }
.app-brand img { width: 32px; height: 32px; object-fit: contain; filter: grayscale(1) invert(1); }
.header-meta { min-width: 0; text-align: right; }
.header-meta strong { display: block; max-width: 240px; overflow-wrap: anywhere; font-size: 13px; }
.network-state { display: block; color: #b8d1b8; font-size: 12px; }
.network-state.offline { color: #e3b0a1; }

#main-content { width: min(100%, 820px); margin: 0 auto; }
.screen { display: none; padding: 18px 16px 24px; }
.screen.active { display: block; }
.screen-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.screen-heading h1 { margin: 0; font-size: 28px; line-height: 1.2; overflow-wrap: anywhere; }
.icon-button { flex: 0 0 44px; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink); font-size: 24px; line-height: 1; }
.summary-band { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); color: var(--ink); }
.summary-band div { min-width: 0; padding: 10px 12px; border-right: 1px solid var(--line); }
.summary-band div:last-child { border: 0; }
.summary-band strong { display: block; font-size: 23px; line-height: 1.2; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.summary-band span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.empty-state { padding: 22px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); text-align: center; color: var(--muted); }

.report-briefing { display: grid; gap: 10px; margin: 0 0 12px; padding: 12px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 12px; background: var(--white); }
.report-briefing.locked { border-color: #b05b56; background: #fff8f7; }
.report-briefing.ready { border-color: var(--green); background: #f6faf5; }
.report-briefing.unavailable { border-color: var(--gold); background: #fffdf6; }
.report-briefing > header { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 8px; }
.report-briefing h2 { margin: 0; font-size: 19px; line-height: 1.3; }
.report-briefing > header > span { flex: 0 0 auto; padding: 4px 8px; border-radius: 6px; background: var(--ink); color: var(--white); font-size: 12px; font-weight: 750; }
.report-briefing.ready > header > span { background: var(--green); }
.report-briefing > p { margin: 0; color: var(--muted); line-height: 1.45; }
.report-briefing > button { justify-self: start; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); font-weight: 650; }
.report-briefing.ready { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.report-briefing.ready h2 { font-size: 16px; }
.report-briefing-list, .report-list { display: grid; gap: 10px; }
.report-card { padding: 14px; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 10px; background: var(--white); overflow-wrap: anywhere; }
.report-card.unread { box-shadow: 0 4px 14px rgba(20,18,12,.08); }
.report-card.report-priority-info { border-left-color: var(--green); }
.report-card.report-priority-attention { border-left-color: var(--gold); }
.report-card.report-priority-action { border-left-color: #b04f49; }
.report-card.struck { border-left-color: #756f65; background: #f2f0eb; color: #68635b; }
.report-card.struck p { text-decoration: line-through; }
.report-card.struck .report-priority { background: #d9d5cc; color: #514d47; }
.report-card header { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 8px; }
.report-card header strong { font-size: 17px; }
.report-priority { padding: 4px 7px; border-radius: 5px; background: #ece8de; font-size: 12px; font-weight: 750; }
.report-priority-attention .report-priority { background: #fff0c7; color: #72520d; }
.report-priority-action .report-priority { background: #f6d8d5; color: #7b2924; }
.report-category { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.report-card p { margin: 10px 0; white-space: pre-wrap; line-height: 1.45; }
.report-card footer { color: var(--muted); font-size: 12px; }
.report-strike-reason { margin-top: 10px; padding: 8px 10px; border-left: 4px solid #756f65; background: #e7e4dc; font-size: 12px; }
.report-card button { min-height: 44px; margin-top: 12px; padding: 8px 12px; border: 0; border-bottom: 4px solid var(--taupe); background: var(--ink); color: var(--white); font-weight: 800; }
.report-scope-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 10px; border: 1px solid var(--line); background: var(--white); }
.report-scope-tabs button { min-height: 48px; border: 0; border-right: 1px solid var(--line); background: var(--white); color: var(--muted); font-weight: 800; }
.report-scope-tabs button:last-child { border-right: 0; }
.report-scope-tabs button.active { background: var(--ink); color: var(--white); box-shadow: inset 0 -5px var(--taupe); }
.report-scope-hint { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.report-patient-context { display: grid; gap: 4px; margin: 0; padding: 12px; border-left: 6px solid var(--green); background: #f6faf5; }
.report-patient-context strong, .report-patient-context span { display: block; }
.report-patient-context span { color: var(--muted); font-size: 12px; }
.tour-start-locked { display: grid; gap: 3px; margin-top: 11px; padding: 9px 11px; border-left: 5px solid #b04f49; background: #fff8f7; }
.tour-start-locked span { color: var(--muted); font-size: 12px; }

.vehicle-logbook { display: grid; gap: 10px; margin: 0 0 12px; }
.work-status { display: grid; gap: 8px; margin: 0 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.work-status header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.work-status header span { color: var(--muted); font-size: .9rem; }
.work-status-timer { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; font-size: .95rem; }
.work-status-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.work-status-actions button { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #f5f4f0; color: var(--ink); font-size: 14px; font-weight: 650; }
.work-status-actions button.active { background: var(--gold); color: #fff; border-color: var(--gold); }
.support-hub { display: grid; gap: 8px; margin: 0 0 12px; }
.support-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.support-actions button { min-height: 48px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); font-size: 14px; font-weight: 650; }
.support-panel { border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.support-panel > summary { padding: 13px 14px; cursor: pointer; font-weight: 750; }
.support-panel-body { display: grid; gap: 9px; padding: 0 12px 12px; }
.support-tour, .support-request { padding: 11px; border-left: 5px solid var(--blue); background: #faf9f6; }
.support-request.priority-high { border-left-color: var(--gold); }
.support-request.priority-critical { border-left-color: var(--rose); }
.support-tour header, .support-request header { display: flex; justify-content: space-between; gap: 10px; }
.support-tour strong, .support-tour span, .support-request strong, .support-request span { display: block; }
.support-tour span, .support-request span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.support-tour button, .support-stop button { min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); font-size: 13px; font-weight: 700; }
.support-stop { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.support-stop strong, .support-stop span { display: block; }
.support-empty { padding: 10px; color: var(--muted); font-size: 13px; text-align: center; }
.vehicle-card { border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 12px; background: var(--white); }
.vehicle-card.completed { border-left-color: var(--green); }
.vehicle-card header { display: flex; justify-content: space-between; gap: 12px; padding: 13px 14px 8px; }
.vehicle-card h2 { margin: 0; font-size: 17px; }
.vehicle-card header span { color: var(--muted); font-size: 12px; }
.vehicle-entry { display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: end; padding: 5px 14px 14px; }
.vehicle-entry label { font-size: 12px; }
.vehicle-entry input { min-height: 44px; }
.vehicle-entry button { min-height: 44px; padding: 8px 13px; border: 0; border-radius: 8px; background: var(--ink); color: var(--white); font-weight: 700; }
.vehicle-result { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding: 5px 14px 14px; }
.vehicle-result div { padding: 9px; background: #f4f1e9; }
.vehicle-result strong,.vehicle-result span { display: block; }
.vehicle-result span { margin-top: 2px; color: var(--muted); font-size: 11px; }

.tour-section { margin-bottom: 24px; }
.tour-title { display: flex; justify-content: space-between; align-items: baseline; padding: 0 2px 10px; border-bottom: 2px solid var(--ink); }
.tour-title h2 { margin: 0; font-size: 19px; }
.tour-title span { color: var(--muted); font-size: 13px; }
.stop-card { position: relative; margin-top: 10px; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 12px; background: var(--white); box-shadow: 0 2px 8px rgba(20,28,22,.04); overflow-wrap: anywhere; }
.stop-card.in-progress { border-left-color: var(--gold); }
.stop-card.completed { border-left-color: var(--green); }
.stop-main { padding: 15px 14px 13px; }
.stop-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px; }
.stop-time { color: var(--ink); font-weight: 800; font-size: 16px; }
.stop-main h3 { margin: 7px 0 3px; font-size: 20px; }
.stop-main p { margin: 3px 0; color: var(--muted); font-size: 14px; }
.live-stop-timer { margin-top: 11px; padding: 10px 12px; border-left: 5px solid var(--gold); background: #fff9e9; color: var(--ink); font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.warning-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.warning-chip { padding: 4px 7px; border-radius: 6px; background: #fff3f0; border: 1px solid #d6a69c; color: #7d332a; font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.status-label { padding: 4px 8px; border-radius: 6px; background: #ece8de; color: #575249; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.stop-actions { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.stop-actions button { min-height: 48px; padding: 7px 4px; border: 0; border-right: 1px solid var(--line); background: #faf9f6; color: var(--ink); font-size: 12px; font-weight: 700; }
.stop-actions button:last-child { border: 0; }
.stop-actions button.emphasis { background: var(--ink); color: var(--white); }
.clinical-details { border-top: 1px solid var(--line); }
.clinical-details summary { padding: 11px 14px; color: var(--taupe-dark); font-size: 13px; font-weight: 750; cursor: pointer; }
.detail-body { padding: 0 14px 15px; }
.detail-group { margin-top: 13px; }
.detail-group h4 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; }
.detail-item { padding: 9px 0; border-top: 1px solid #ebe7dd; font-size: 13px; }
.detail-item strong, .detail-item span { display: block; }
.detail-item span { margin-top: 3px; color: var(--muted); }
.unread-report { border-left: 3px solid var(--rose); padding-left: 9px; }
.struck-report { border-left: 3px solid #756f65; padding-left: 9px; color: #68635b; }
.struck-report span { text-decoration: line-through; }
.struck-report em { display: block; margin-top: 5px; font-style: normal; font-weight: 750; }
.inline-button { margin-top: 7px; padding: 5px 8px; border: 1px solid var(--line); background: var(--white); font-size: 12px; }

.notification-list, .device-list { display: grid; gap: 10px; }
.notification-item, .device-item { padding: 15px; border: 1px solid var(--line); background: var(--white); }
.notification-item.unread { border-left: 6px solid var(--rose); }
.notification-item header, .device-item { display: flex; justify-content: space-between; gap: 12px; }
.device-item > div strong, .device-item > div span { display: block; }
.device-item > div span { margin-top: 4px; }
.notification-item h3 { margin: 0; font-size: 16px; }
.notification-item p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.notification-item button, .device-item button { margin-top: 8px; padding: 5px 8px; border: 1px solid var(--line); background: var(--white); }
.profile-band { display: grid; gap: 4px; padding: 20px; background: var(--ink); color: var(--white); border-bottom: 5px solid var(--taupe); }
.profile-band strong { font-size: 21px; }
.profile-band span { color: #cbc4b5; }
.patient-search-label { display: block; margin-bottom: 14px; font-weight: 700; }
.patient-search-label input { margin-top: 6px; }
.patient-directory { display: grid; gap: 14px; margin-top: 16px; }
.patient-card { border: 1px solid var(--line); border-left: 6px solid var(--green); background: var(--white); }
.patient-summary { padding: 14px; cursor: pointer; }
.patient-summary > span { display: inline-grid; max-width: calc(100% - 26px); gap: 4px; margin-left: 4px; vertical-align: middle; overflow-wrap: anywhere; white-space: normal; }
.patient-summary strong { font-size: 22px; line-height: 1.3; }
.patient-summary small { color: var(--muted); font-size: 14px; font-weight: 400; }
.patient-details { padding: 0 18px 18px; border-top: 1px solid var(--line); }
.patient-card header { display: flex; justify-content: space-between; gap: 14px; align-items: start; }
.patient-card h2, .patient-card h3 { margin: 0; }
.patient-card .patient-meta { margin-top: 5px; color: var(--muted); }
.patient-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.patient-actions button, .patient-actions a { min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); text-decoration: none; font-weight: 650; }
.patient-warnings { display: grid; gap: 6px; margin: 12px 0; }
.patient-warning { padding: 9px 11px; border-left: 5px solid var(--rose); background: #fff7f5; }
.patient-card-readonly [data-patient-action="wound-followup"],
.patient-card-readonly [data-patient-action="wound-close"],
.patient-card-readonly .wound-new-button,
.patient-card-readonly .wound-form { display: none !important; }
.doctor-list, .relative-list, .care-report-list { display: grid; gap: 8px; margin-top: 12px; }
.doctor-card, .relative-card, .care-report-card { padding: 12px; border: 1px solid var(--line); background: #faf9f6; }
.doctor-card span, .relative-card span { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
.care-report-card header { align-items: baseline; }
.care-report-card header span { color: var(--muted); font-size: 12px; }
.care-report-card p { margin: 8px 0 0; white-space: pre-wrap; }
.care-report-list.hidden { display: none; }
.budget-hint { margin-top: 10px; padding: 11px; border-left: 5px solid var(--gold); background: #fffdf6; }
.settings-list { margin-top: 16px; border: 1px solid var(--line); background: var(--white); }
.settings-list button { width: 100%; min-height: 55px; display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.settings-list button:last-child { border: 0; }
.settings-list button:disabled { cursor: default; opacity: 1; color: var(--ink); }
.settings-list strong { color: var(--taupe-dark); font-size: 12px; }
.help-search-label { display: block; margin-bottom: 14px; font-weight: 700; }
.help-search-label input { margin-top: 6px; }
.safety-notice { margin-bottom: 14px; padding: 15px; border: 2px solid var(--rose); background: #fff8f7; }
.safety-notice strong { font-size: 18px; }
.safety-notice p { margin: 7px 0 12px; color: #573737; line-height: 1.45; }
.safety-notice a { min-height: 48px; display: grid; place-items: center; background: #8f3737; color: var(--white); text-decoration: none; font-weight: 800; }
.help-topics { display: grid; gap: 9px; }
.help-topic { border: 1px solid var(--line); background: var(--white); }
.help-topic > summary { min-height: 52px; padding: 14px; cursor: pointer; font-weight: 800; }
.help-topic ol { margin: 0; padding: 4px 34px 16px 42px; }
.help-topic li { margin: 0 0 8px; line-height: 1.45; }
.help-warning { margin: 0 14px 14px; padding: 10px; border-left: 5px solid var(--gold); background: #fffdf6; }
.workspace-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
.workspace-form { border: 1px solid var(--line); background: var(--white); }
.workspace-form > summary { min-height: 52px; padding: 14px; cursor: pointer; font-weight: 800; }
.workspace-form form, .wound-form { display: grid; gap: 11px; padding: 0 14px 14px; }
.secondary-section { border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.secondary-section > summary { padding: 11px 12px; color: var(--taupe-dark); font-size: 14px; }
.secondary-section > :not(summary) { margin: 0 12px 12px; }
.workspace-secondary { margin-top: 12px; }
.directory-help { background: transparent; }
.workspace-list, .clinical-mobile-list { display: grid; gap: 9px; }
.workspace-card, .clinical-mobile-card, .ti-card { padding: 13px; border: 1px solid var(--line); border-left: 5px solid var(--blue); background: var(--white); }
.workspace-card.critical, .clinical-mobile-card.critical { border-left-color: var(--rose); }
.workspace-card header { display: flex; justify-content: space-between; gap: 10px; }
.workspace-card p { margin: 7px 0; color: var(--muted); }
.workspace-card small, .clinical-mobile-card span, .ti-card span { display: block; margin-top: 4px; color: var(--muted); }
.workspace-card button { min-height: 44px; margin-top: 10px; padding: 8px 11px; border: 1px solid var(--line); background: var(--white); font-weight: 700; }
.clinical-mobile-card button { min-height: 44px; margin-top: 10px; padding: 8px 11px; border: 1px solid var(--line); background: var(--white); font-weight: 700; }
.ti-card { display: flex; justify-content: space-between; gap: 12px; border-left-color: var(--gold); }
.three-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wound-form-actions { display: grid; grid-template-columns: 1fr 1.5fr; gap: 9px; }
.wound-new-button { width: 100%; margin-top: 12px; }
.section-title { margin: 25px 0 10px; font-size: 16px; }
.sync-timestamp { margin: -11px 0 20px; color: var(--muted); font-size: 12px; }
.sync-list { display: grid; gap: 9px; }
.sync-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 13px 14px; border: 1px solid var(--line); border-left: 6px solid var(--blue); background: var(--white); }
.sync-item.conflict { border-left-color: var(--rose); }
.sync-item strong, .sync-item span { display: block; }
.sync-item span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.sync-item button { padding: 6px 9px; border: 1px solid var(--line); background: var(--white); font-size: 12px; font-weight: 700; }

.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; min-height: calc(74px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); padding: 4px 2px env(safe-area-inset-bottom); background: var(--white); border-top: 1px solid var(--line); box-shadow: 0 -4px 20px rgba(20,28,22,.07); }
.bottom-nav button { position: relative; min-width: 0; min-height: 68px; display: grid; place-content: center; gap: 5px; padding: 6px 0; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; }
.bottom-nav button.active { color: #244d37; background: #e8eee7; box-shadow: inset 0 3px #42634d; }
.bottom-nav button:focus-visible { outline-offset: -3px; }
.nav-symbol { width: 24px; height: 24px; margin: 0 auto; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-label { line-height: 1.25; white-space: nowrap; letter-spacing: -.2px; }
.badge { position: absolute; top: 3px; left: calc(50% + 7px); min-width: 19px; min-height: 19px; padding: 1px 4px; border: 1px solid var(--white); border-radius: 10px; background: #973f3f; color: white; font-style: normal; font-size: 11px; line-height: 1.4; }

dialog { width: min(calc(100% - 24px), 560px); max-height: calc(100vh - 30px); padding: 0; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.update-banner { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 9px; align-items: center; padding: 11px 16px; background: #f0ebdd; border-bottom: 1px solid var(--taupe); }
.update-banner div { display: grid; gap: 2px; min-width: 0; }
.update-banner span { color: var(--muted); font-size: 12px; }
.update-banner button { min-height: 44px; padding: 8px 12px; }
@media (max-width: 620px) { .update-banner { grid-template-columns: 1fr 1fr; } .update-banner div { grid-column: 1 / -1; } }
dialog::backdrop { background: rgba(0,0,0,.64); }
#central-review-dialog form { padding: 18px; }
#central-review-changes { max-height: 45vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; padding: 12px 0; margin-bottom: 12px; }
#action-form { padding: 18px; }
.dialog-header { display: flex; justify-content: space-between; align-items: start; padding-bottom: 13px; border-bottom: 2px solid var(--ink); }
.dialog-header h2 { margin: 0; font-size: 22px; }
#dialog-body { display: grid; gap: 13px; padding: 16px 0; max-height: 58vh; overflow-y: auto; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; }
.signature-wrap { border: 1px solid var(--line); background: #fff; }
#signature-canvas { display: block; width: 100%; height: 145px; touch-action: none; }
.signature-tools { display: flex; justify-content: space-between; padding: 5px 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.signature-tools button { border: 0; background: transparent; color: var(--taupe-dark); font-weight: 700; }
.check-list { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); background: #faf9f6; }
.check-list label { display: flex; align-items: center; min-height: 44px; gap: 9px; }
.check-list input { width: 20px; min-height: 20px; }
.privacy-note { margin: 0; padding: 10px 12px; border-left: 5px solid var(--rose); background: #fff8f7; color: var(--muted); font-size: 12px; }

body.assistant-active .bottom-nav { display: none; }
body.assistant-active .app-shell { padding-bottom: 0; }
.screen.assistant-screen { padding-bottom: calc(144px + env(safe-area-inset-bottom)); }
.assistant-heading { display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 6px 10px; align-items: start; margin-bottom: 12px; }
.assistant-heading h1 { margin: 0; min-block-size: 2.6em; white-space: normal; overflow-wrap: anywhere; line-height: 1.3; font-size: 22px; }
.assistant-heading > .status-label { grid-column: 2; justify-self: start; }
.assistant-heading .eyebrow { margin-bottom: 2px; }
.assistant-progress { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); margin-bottom: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.assistant-progress div { min-width: 0; padding: 9px 4px; border-right: 1px solid var(--line); text-align: center; color: var(--muted); }
.assistant-progress div:last-child { border-right: 0; }
.assistant-progress span { width: 22px; height: 22px; display: grid; place-items: center; margin: 0 auto 4px; border: 1px solid #aaa495; border-radius: 50%; font-size: 11px; font-weight: 800; }
.assistant-progress strong { display: block; white-space: normal; line-height: 1.3; font-size: 12px; font-weight: 650; }
.assistant-progress .active { background: var(--ink); color: var(--white); }
.assistant-progress .active span { border-color: var(--taupe); color: var(--white); }
.assistant-progress .done span { border-color: var(--green); background: var(--green); color: var(--white); }
.assistant-body { display: grid; gap: 12px; }
.assistant-hero { display: grid; gap: 12px; padding: 14px; border-radius: 12px; background: var(--ink); color: var(--white); border-bottom: 3px solid var(--taupe); }
.assistant-hero h2 { margin: 0; font-size: 22px; }
.assistant-hero p { margin: 6px 0 0; color: #d7d1c4; }
.assistant-hero .eyebrow { color: #c8b994; }
.assistant-quick-actions, .assistant-tools { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.assistant-quick-actions button, .assistant-tools button, .assistant-report button, .medication-item button { min-height: 44px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); font-weight: 650; }
.assistant-panel { padding: 14px; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 12px; background: var(--white); }
.assistant-panel h2 { margin: 0 0 12px; font-size: 19px; }
.assistant-panel > label + label { margin-top: 13px; }
.service-selection-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 10px; }
.service-selection-fields label, .service-selection-fields select { min-width: 0; width: 100%; }
.service-selection textarea { min-height: 72px; }
.service-selection-summary { margin: 10px 0; overflow-wrap: anywhere; font-size: .9rem; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-heading span { min-width: 28px; padding: 4px 7px; background: #ece8de; text-align: center; font-size: 12px; font-weight: 800; }
.assistant-notice { display: grid; gap: 4px; padding: 13px 15px; border-left: 6px solid var(--gold); background: #fffdf6; }
.assistant-notice span { color: var(--muted); font-size: 13px; }
.assistant-notice .assistant-live-timer { color: var(--ink); font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.measured-time-card { display: grid; gap: 5px; margin-bottom: 14px; padding: 14px; border-left: 6px solid var(--gold); background: #fff9e9; }
.measured-time-card span, .measured-time-card small { color: var(--muted); }
.measured-time-card strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.assistant-report { padding: 12px 0; border-top: 1px solid var(--line); }
.assistant-report:first-of-type { border-top: 0; }
.assistant-report strong, .assistant-report span { display: block; }
.assistant-report span, .assistant-report p { color: var(--muted); font-size: 12px; }
.assistant-report p { margin: 7px 0; }
.assistant-report.struck { color: #68635b; }
.assistant-report.struck p { text-decoration: line-through; }
.assistant-report.struck em { display: block; margin-top: 5px; font-size: 12px; font-style: normal; font-weight: 750; }
.assistant-checks, .care-list { display: grid; gap: 8px; }
.assistant-checks label, .care-item, .assistant-confirm { display: grid; grid-template-columns: 24px minmax(0,1fr); gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--line); background: #faf9f6; }
.assistant-checks input, .care-item input, .assistant-confirm input { width: 21px; min-height: 21px; margin: 0; }
.assistant-checks strong, .assistant-checks small, .care-item strong, .care-item small { display: block; }
.assistant-checks small, .care-item small { margin-top: 3px; color: var(--muted); font-weight: 400; line-height: 1.35; }
.assistant-confirm { margin-top: 13px; font-size: 13px; font-weight: 700; }
.medication-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.medication-item strong, .medication-item small { display: block; }
.medication-item small { margin-top: 3px; color: var(--muted); }
.assistant-report-fields { display: grid; gap: 12px; margin-top: 13px; padding: 13px; border-left: 5px solid var(--taupe); background: #f7f4ed; }
.assistant-tools { margin-top: 14px; }
.assistant-time-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.assistant-summary { display: grid; gap: 1px; margin: 14px 0; background: var(--line); }
.assistant-summary span { display: flex; justify-content: space-between; gap: 12px; padding: 10px 11px; background: #faf9f6; color: var(--muted); font-size: 12px; }
.assistant-summary strong { color: var(--ink); text-align: right; }
#assistant-signature-canvas { display: block; width: 100%; height: 145px; touch-action: none; }
.assistant-footer { position: fixed; z-index: 25; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr 1.35fr; gap: 9px; padding: 12px max(16px,calc((100vw - 788px) / 2)); padding-bottom: calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(244,241,233,.97); box-shadow: 0 -8px 24px rgba(20,18,12,.09); }
.assistant-single-button { grid-column: 1 / -1; }
.assistant-complete { padding: 36px 22px; border: 1px solid var(--line); border-bottom: 6px solid var(--green); background: var(--white); text-align: center; }
.assistant-complete h2 { margin: 5px 0 8px; font-size: 23px; }
.assistant-complete p, .assistant-complete small { color: var(--muted); }
.complete-mark { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 15px; border-radius: 50%; background: var(--green); color: var(--white); font-size: 30px; font-weight: 800; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); max-width: calc(100% - 32px); transform: translate(-50%, 8px); padding: 11px 16px; border-radius: 10px; background: var(--ink); color: var(--white); border-bottom: 2px solid var(--taupe); opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; text-align: center; font-size: 14px; }
.toast.visible { transform: translate(-50%, 0); opacity: 1; }

@media (min-width: 700px) {
  .login-shell { grid-template-columns: 44% 56%; grid-template-rows: 100vh; }
  .brand-panel { border-right: 8px solid var(--taupe); border-bottom: 0; }
  .brand-logo { width: 125px; height: 125px; }
  .login-form { align-content: center; }
  .app-header { padding-inline: max(24px, calc((100vw - 920px) / 2)); }
  .screen { padding-top: 20px; }
  .stop-actions { grid-template-columns: repeat(6, 1fr); }
  .bottom-nav { left: 50%; width: 660px; max-width: 100%; transform: translateX(-50%); border: 1px solid var(--line); border-bottom: 0; border-radius: 16px 16px 0 0; }
}

@media (max-width: 699px) {
  body { overflow-x: hidden; }
  input, select, textarea { min-height: 50px; font-size: 16px; }
  button, a { touch-action: manipulation; }
  .login-shell { grid-template-rows: minmax(145px, 27vh) 1fr; }
  .brand-panel { gap: 13px; padding: 22px 16px; }
  .brand-logo { width: 70px; height: 70px; }
  .brand-panel strong { font-size: 23px; }
  .login-form { padding: 26px 18px 40px; }
  .login-form h1, .login-form h2 { font-size: 30px; }
  .app-header { padding: 7px 12px; }
  .screen { padding: 14px 12px 24px; }
  .screen-heading { margin-bottom: 12px; }
  .screen-heading h1 { font-size: 27px; }
  .summary-band div { padding: 10px 9px; }
  .summary-band strong { font-size: 22px; }
  .workspace-actions { grid-template-columns: 1fr; }
  .wound-form-actions { grid-template-columns: 1fr; }
  .support-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stop-main { padding: 14px 12px 12px; }
  .stop-main h3 { font-size: 19px; }
  .stop-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stop-actions button { min-height: 52px; padding: 9px 6px; border-bottom: 1px solid var(--line); font-size: 13px; }
  .patient-summary { padding: 15px 12px; }
  .patient-summary strong { font-size: 20px; }
  .patient-details { padding: 0 12px 15px; }
  .patient-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .patient-actions button, .patient-actions a { width: 100%; min-height: 50px; display: grid; place-items: center; text-align: center; }
  .doctor-card header, .care-report-card header { display: grid; }
  .notification-item header, .device-item { align-items: start; }
  dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  #dialog-body { max-height: 55dvh; }
  .assistant-footer { padding-inline: 10px; }
}

@media (max-width: 380px) {
  .brand-panel strong { font-size: 22px; }
  .app-brand span { display: none; }
  .screen { padding-inline: 10px; }
  .vehicle-entry { grid-template-columns: 1fr; }
  .assistant-progress div { padding-block: 7px; }
  .report-briefing.ready { grid-template-columns: 1fr; gap: 6px; }
  .patient-actions, .three-fields { grid-template-columns: 1fr; }
  .medication-item { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .assistant-progress { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .assistant-progress div { grid-column: span 2; }
  .assistant-progress div:nth-child(3) { border-right: 0; }
  .assistant-progress div:nth-child(n+4) { grid-column: span 3; border-top: 1px solid var(--line); }
}

/* Ruhige Oberflächen, ohne fachliche Warnungen oder lange Identitäten abzuschneiden. */
.patient-card, .workspace-form, .notification-item, .device-item, .help-topic, .settings-list,
.workspace-card, .clinical-mobile-card, .ti-card, .doctor-card, .relative-card { border-radius: 10px; }
.patient-details, .workspace-card, .clinical-mobile-card, .ti-card, .assistant-body { overflow-wrap: anywhere; }
.work-status header, .support-tour header, .support-request header, .vehicle-card header,
.patient-card header, .workspace-card header, .notification-item header, .ti-card { flex-wrap: wrap; }
.patient-details > details + details { border-top: 1px solid var(--line); }
.patient-details > details > summary { padding-inline: 0; }
.work-status:empty, .support-hub:empty, .vehicle-logbook:empty, .summary-band:empty { display: none; }
.screen.active { animation: screen-enter .18s ease-out; }
button, summary { transition: background-color .15s ease, border-color .15s ease; }
@keyframes screen-enter { from { opacity: .7; } to { opacity: 1; } }
@media (hover: hover) {
  .secondary-button:hover, .patient-actions button:hover, .patient-actions a:hover, summary:hover { background-color: #eeeee7; }
  .bottom-nav button:not(.active):hover { background-color: #f1f3ef; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
