:root {
  color-scheme: light;
  --ink: #070707;
  --paper: #f4f1e9;
  --white: #ffffff;
  --taupe: #a39778;
  --taupe-dark: #776d55;
  --line: #d8d2c3;
  --muted: #68655e;
  --green: #6e856b;
  --blue: #687f94;
  --rose: #a76565;
  --gold: #aa8a43;
  --shadow: 0 10px 30px rgba(20, 18, 12, .10);
  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); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.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-height: 46px; padding: 10px 12px; border: 1px solid #aaa495; border-radius: 4px; background: var(--white); color: var(--ink); }
textarea { min-height: 105px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(163, 151, 120, .25); border-color: var(--taupe-dark); }
.primary-button, .secondary-button, .danger-button { min-height: 46px; padding: 10px 18px; border: 1px solid transparent; border-radius: 4px; font-weight: 700; }
.primary-button { background: var(--ink); color: var(--white); border-bottom: 4px 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(72px + env(safe-area-inset-bottom)); }
.app-header { position: sticky; top: 0; z-index: 20; height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 8px 18px; background: var(--ink); color: var(--white); border-bottom: 5px solid var(--taupe); }
.app-brand { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 800; }
.app-brand img { width: 40px; height: 40px; object-fit: contain; filter: grayscale(1) invert(1); }
.header-meta { min-width: 0; text-align: right; }
.header-meta strong { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.network-state { color: #b8d1b8; font-size: 11px; }
.network-state.offline { color: #e3b0a1; }

#main-content { width: min(100%, 820px); margin: 0 auto; }
.screen { display: none; padding: 24px 16px 30px; }
.screen.active { display: block; }
.screen-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.screen-heading h1 { margin: 0; font-size: 30px; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 4px; background: var(--white); color: var(--ink); font-size: 24px; line-height: 1; }
.summary-band { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 22px; background: var(--ink); color: var(--white); border-bottom: 6px solid var(--taupe); }
.summary-band div { min-width: 0; padding: 16px 12px; border-right: 1px solid #383630; }
.summary-band div:last-child { border: 0; }
.summary-band strong { display: block; font-size: 25px; }
.summary-band span { display: block; margin-top: 3px; color: #cbc4b5; font-size: 11px; }
.empty-state { padding: 34px 20px; border: 1px solid var(--line); background: var(--white); text-align: center; color: var(--muted); }

.vehicle-logbook { display: grid; gap: 10px; margin: -8px 0 22px; }
.work-status { display: grid; gap: 10px; margin: -8px 0 22px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; 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-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.work-status-actions button.active { background: var(--gold); color: #fff; border-color: var(--gold); }
.support-hub { display: grid; gap: 10px; margin: -8px 0 22px; }
.support-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.support-actions button { min-height: 48px; padding: 9px; border: 1px solid var(--line); background: var(--white); color: var(--ink); font-weight: 750; }
.support-actions button:first-child { background: var(--ink); color: var(--white); border-bottom: 4px solid var(--taupe); }
.support-panel { border: 1px solid var(--line); 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: 36px; padding: 6px 9px; border: 1px solid var(--line); background: var(--white); font-size: 12px; 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: 7px solid var(--gold); background: var(--white); box-shadow: 0 3px 10px rgba(20,18,12,.05); }
.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: 42px; }
.vehicle-entry button { min-height: 42px; padding: 8px 13px; border: 0; border-bottom: 4px solid var(--taupe); 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: 7px solid var(--blue); background: var(--white); box-shadow: 0 3px 10px rgba(20,18,12,.05); }
.stop-card.in-progress { border-left-color: var(--gold); }
.stop-card.completed { border-left-color: var(--green); opacity: .82; }
.stop-main { padding: 15px 14px 13px; }
.stop-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; }
.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; background: #fff3f0; border: 1px solid #d6a69c; color: #7d332a; font-size: 11px; font-weight: 700; }
.status-label { padding: 3px 7px; background: #ece8de; color: #575249; font-size: 11px; font-weight: 700; }
.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; }
.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: 18px; cursor: pointer; }
.patient-summary > span { display: inline-grid; gap: 5px; margin-left: 8px; vertical-align: middle; }
.patient-summary strong { font-size: 24px; }
.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: 40px; padding: 9px 12px; border: 1px solid var(--line); background: var(--white); color: var(--ink); text-decoration: none; font-weight: 700; }
.patient-warnings { display: grid; gap: 6px; margin: 12px 0; }
.patient-warning { padding: 9px 11px; border-left: 5px solid var(--rose); background: #fff7f5; }
.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 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; }
.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; height: calc(66px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom); background: var(--ink); border-top: 4px solid var(--taupe); }
.bottom-nav button { position: relative; display: grid; place-content: center; gap: 3px; border: 0; background: transparent; color: #b9b3a6; font-size: 11px; }
.bottom-nav button.active { color: var(--white); background: #1a1917; }
.nav-symbol { width: 24px; height: 21px; margin: 0 auto; border: 1px solid currentColor; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.badge { position: absolute; top: 5px; left: calc(50% + 10px); min-width: 18px; height: 18px; padding: 2px 4px; border-radius: 9px; background: #b25555; color: white; font-style: normal; font-size: 10px; }

dialog { width: min(calc(100% - 24px), 560px); max-height: calc(100vh - 30px); padding: 0; border: 1px solid var(--line); border-radius: 4px; 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: 38px; 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); }
#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; 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; }
.assistant-screen { padding-bottom: 105px; }
.assistant-heading { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 12px; align-items: center; margin-bottom: 18px; }
.assistant-heading h1 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 24px; }
.assistant-heading .eyebrow { margin-bottom: 2px; }
.assistant-progress { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); margin-bottom: 18px; border: 1px solid var(--line); 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; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.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: 15px; padding: 18px; background: var(--ink); color: var(--white); border-bottom: 6px 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: 42px; padding: 8px 11px; border: 1px solid var(--line); background: var(--white); color: var(--ink); font-weight: 700; }
.assistant-panel { padding: 17px; border: 1px solid var(--line); border-left: 6px solid var(--blue); background: var(--white); }
.assistant-panel h2 { margin: 0 0 12px; font-size: 19px; }
.assistant-panel > label + label { margin-top: 13px; }
.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-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: 84px; max-width: calc(100% - 32px); transform: translate(-50%, 25px); padding: 11px 16px; background: var(--ink); color: var(--white); border-bottom: 4px solid var(--taupe); opacity: 0; pointer-events: none; transition: .2s; text-align: center; font-size: 13px; }
.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: 34px; }
  .stop-actions { grid-template-columns: repeat(6, 1fr); }
  .bottom-nav { left: 50%; width: 520px; transform: translateX(-50%); }
}

@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 { height: 62px; padding: 7px 12px; }
  .app-brand img { width: 36px; height: 36px; }
  .screen { padding: 18px 12px 24px; }
  .screen-heading { margin-bottom: 14px; }
  .screen-heading h1 { font-size: 27px; }
  .summary-band { margin-bottom: 17px; }
  .summary-band div { padding: 13px 9px; }
  .summary-band strong { font-size: 22px; }
  .work-status-actions { grid-template-columns: 1fr; }
  .workspace-actions { grid-template-columns: 1fr; }
  .wound-form-actions { grid-template-columns: 1fr; }
  .support-actions { grid-template-columns: 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: 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; }
  .bottom-nav { height: calc(72px + env(safe-area-inset-bottom)); }
  .bottom-nav button { min-width: 0; min-height: 52px; padding: 5px 2px; font-size: 10px; }
  .nav-symbol { width: 26px; height: 23px; }
  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 strong { display: none; }
  .assistant-progress div { padding-block: 7px; }
  .assistant-progress span { margin-bottom: 0; }
  .assistant-heading { grid-template-columns: 42px minmax(0,1fr); }
  .assistant-heading > .status-label { display: none; }
  .medication-item { grid-template-columns: 1fr; }
}
