:root {
  --background: #f4f7f8;
  --foreground: #17323b;
  --card: #fff;
  --primary: #0d6970;
  --primary-foreground: #fff;
  --secondary: #e8f1f2;
  --muted: #edf2f3;
  --muted-foreground: #60747b;
  --accent: #dcebed;
  --destructive: #b8324b;
  --border: #d9e3e5;
  --ring: #4e9398;
  --radius: 0.75rem;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--background); color: var(--foreground); font-family: "Segoe UI", Aptos, Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; display: block; }

.btn, .btn-outline, .btn-ghost, .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 10px; border: 1px solid transparent; padding: 9px 14px; cursor: pointer;
  font-weight: 650; font-size: 14px;
}
.btn { background: var(--primary); color: #fff; }
.btn:hover { background: #0b5c62; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-outline { background: #fff; color: #16464c; border-color: var(--border); }
.btn-ghost { background: transparent; color: #2f7d82; }
.btn-secondary { background: var(--secondary); color: #16464c; }
.btn-lg { padding: 12px 18px; font-size: 15px; }
.btn svg, .btn-outline svg, .btn-ghost svg, .btn-secondary svg { width: 16px; height: 16px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 3px 8px; font-size: 11px; font-weight: 700;
  border: 1px solid var(--border); background: #fff; color: #17323b;
}
.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; }
[data-slot="card-header"] { padding: 18px 18px 8px; }
[data-slot="card-content"] { padding: 8px 18px 18px; }
[data-slot="card-title"] { font-size: 18px; font-weight: 750; margin: 0; }

.progress { height: 8px; background: #dce7e8; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); }

.role-tabs { display: flex; gap: 4px; margin: 25px 0 22px; background: #e5edef; height: 42px; padding: 4px; border-radius: 10px; width: max-content; max-width: 100%; }
.role-tabs button { min-width: 92px; border: 0; background: transparent; border-radius: 8px; color: #16464c; cursor: pointer; }
.role-tabs button.active { background: #fff; font-weight: 700; box-shadow: 0 1px 0 rgba(23,50,59,.06); }

.topbar { height: 68px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 26px; position: sticky; top: 0; z-index: 20; }
.brand, .header-actions { display: flex; align-items: center; gap: 12px; }
.brand { font-weight: 750; font-size: 18px; }
.brandmark { display: grid; place-items: center; width: 34px; height: 34px; background: #0d6970; color: #fff; border-radius: 10px; }
.brandmark svg { width: 20px; height: 20px; }
.header-actions button { border: 0; background: transparent; color: #5d7178; padding: 8px; border-radius: 9px; cursor: pointer; }
.header-actions button:hover { background: #eef4f4; }
.header-actions svg { width: 19px; height: 19px; }
.avatar, .patient-avatar { display: grid; place-items: center; border-radius: 50%; font-weight: 750; }
.avatar { width: 34px; height: 34px; background: #17323b; color: #fff; font-size: 12px; }
.app-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.sidebar { background: #15343d; color: #dce9eb; padding: 28px 18px; display: flex; flex-direction: column; }
.sidebar-label, .eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: 11px; font-weight: 750; }
.sidebar-label { color: #85a9af; padding: 0 12px 12px; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav button { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 0; border-radius: 9px; color: #c8dadd; font-size: 14px; background: transparent; text-align: left; cursor: pointer; }
.sidebar nav button:hover { background: #1d454f; }
.sidebar nav button.active { background: #24515b; color: #fff; }
.sidebar nav svg { width: 18px; height: 18px; }
.nav-indicator { width: 6px; height: 6px; background: #62d5cc; border-radius: 50%; margin-left: auto; }
.privacy-note { margin-top: auto; display: flex; gap: 10px; padding: 15px 12px; border-top: 1px solid #2e535c; }
.privacy-note svg { width: 18px; height: 18px; }
.privacy-note div { display: grid; }
.privacy-note strong { font-size: 12px; }
.privacy-note span { font-size: 11px; color: #9bb8bd; }
.workspace { padding: 30px clamp(20px, 4vw, 52px) 52px; max-width: 1500px; width: 100%; margin: auto; }
.workspace-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.workspace-head h1 { font-size: clamp(28px, 3vw, 38px); letter-spacing: -.03em; margin: 2px 0 7px; }
.workspace-head p { margin: 0; color: #60747b; }
.eyebrow { color: #2f7d82; margin: 0; }
.clinical-grid { display: grid; grid-template-columns: minmax(300px, .72fr) minmax(540px, 1.55fr); gap: 18px; }
.queue-card { grid-row: span 2; }
.queue-card, .review-card, .timeline-card, .patient-hero, .wide-card, .metric-card, .audit-card { box-shadow: 0 8px 30px rgba(31, 68, 76, .06); border-color: #d8e4e6; }
.queue-card [data-slot="card-header"], .review-card [data-slot="card-header"], .timeline-card [data-slot="card-header"], .wide-card [data-slot="card-header"] { display: flex; align-items: start; justify-content: space-between; }
.muted { color: #667c83; font-size: 13px; margin-top: 7px; }
.soft-badge { background: #e9f5f1; color: #27705f; border-color: transparent; }
.queue-list { padding: 0 12px 12px; }
.queue-item { width: 100%; display: grid; grid-template-columns: 42px 1fr auto 18px; gap: 11px; align-items: center; text-align: left; border: 1px solid transparent; background: transparent; padding: 14px 10px; border-radius: 11px; color: inherit; cursor: pointer; }
.queue-item.selected { background: #edf6f6; border-color: #a9d0d3; }
.patient-avatar { width: 42px; height: 42px; background: #dcebed; color: #1d666c; font-size: 12px; }
.queue-copy { display: grid; gap: 2px; }
.queue-copy small { color: #72858b; font-size: 11px; }
.queue-copy span { font-size: 12px; }
.queue-item > svg { width: 16px; color: #789096; }
.urgency { font-size: 10px; }
.urgency.rose { background: #f9e5e8; color: #9b2941; border: 0; }
.urgency.amber { background: #fff0d5; color: #8a5b00; border: 0; }
.urgency.blue { background: #e4eff8; color: #275b82; border: 0; }
.consent { background: #e9f5f1; color: #27705f; border: 0; }
.consent svg { width: 13px; height: 13px; }
.alert-strip, .success-strip { display: flex; gap: 12px; border-radius: 10px; padding: 12px 14px; }
.alert-strip { background: #fff3dc; border: 1px solid #f2d395; color: #684b17; }
.success-strip { background: #e9f6f1; border: 1px solid #add8c8; color: #205f50; }
.alert-strip svg, .success-strip svg { width: 19px; height: 19px; flex: none; }
.alert-strip div, .success-strip div { display: grid; }
.alert-strip span, .success-strip span { font-size: 12px; margin-top: 2px; }
.image-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 17px 0; }
.wound-frame { height: 186px; border-radius: 13px; position: relative; overflow: hidden; background: radial-gradient(circle at 50% 45%, #c78676 0 10%, #d8a795 11% 19%, #e6c7b6 20% 35%, #d4a88d 36% 51%, #b4836b 52% 70%, #8c6554); border: 4px solid #f1e6df; }
.wound-frame.current { filter: saturate(.85) brightness(1.04); }
.wound-frame img { width: 100%; height: 100%; object-fit: cover; }
.wound-shape { position: absolute; width: 32%; height: 26%; border-radius: 48% 52% 44% 56%; left: 34%; top: 33%; background: radial-gradient(circle, #7d3733 0 28%, #a34b40 30% 58%, #c77d65 60%); box-shadow: 0 0 0 8px rgba(137, 63, 52, .16); }
.wound-frame.current .wound-shape { width: 25%; height: 21%; left: 38%; top: 36%; }
.wound-frame span, .wound-frame small { position: absolute; left: 10px; background: #17323bd9; color: #fff; padding: 4px 7px; border-radius: 5px; }
.wound-frame span { top: 10px; font-size: 11px; font-weight: 700; }
.wound-frame small { bottom: 9px; font-size: 10px; }
.measurement-row { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border); border-radius: 11px; overflow: hidden; }
.measurement-row > div { padding: 12px 14px; display: grid; gap: 2px; }
.measurement-row > div + div { border-left: 1px solid var(--border); }
.measurement-row span, .measurement-row small { color: #72858b; font-size: 11px; }
.measurement-row strong { font-size: 16px; }
.review-checks { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 15px; padding: 12px 14px; background: #f5f8f8; border-radius: 10px; }
.review-checks label { font-size: 12px; display: flex; gap: 8px; align-items: center; }
.review-checks input { accent-color: #0d6970; }
.review-footer { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-top: 17px; }
.review-footer > div { display: grid; gap: 3px; }
.review-footer span { color: #72858b; font-size: 11px; }
.timeline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.timeline > div { position: relative; border-top: 2px solid #dce7e8; padding: 14px 8px 0 0; }
.timeline .dot { position: absolute; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: #a6bdc1; }
.timeline .dot.current { background: #0d6970; }
.timeline p { font-size: 13px; margin: 5px 0; }
.timeline small { font-size: 11px; color: #73878d; }
.patient-layout { display: grid; grid-template-columns: 1.35fr .8fr; gap: 18px; }
.patient-hero { min-height: 520px; background: linear-gradient(145deg, #fff 0 65%, #e5f1f2); }
.patient-hero [data-slot="card-content"] { max-width: 660px; padding: 38px; }
.patient-hero h2 { font-size: 34px; margin: 8px 0; }
.patient-hero p { color: #5f747b; max-width: 550px; }
.phone-icon { width: 58px; height: 58px; display: grid; place-items: center; background: #dceff0; color: #0d6970; border-radius: 17px; }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; color: #657b82; margin: 8px 0 26px; }
.patient-hero small { display: block; color: #6e8288; margin-top: 20px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.next-path { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 22px; }
.next-path button { text-align: left; border: 1px solid #c5d8d8; background: #fff; border-radius: 12px; padding: 12px; cursor: pointer; display: grid; gap: 4px; }
.next-path button:hover { border-color: #0d6970; background: #edf6f6; }
.next-path small { margin: 0; color: #667c83; font-size: 12px; }
.workspace-demo { margin: 0 0 16px; max-width: 520px; }
.workspace-demo .role-tabs { margin: 10px 0 0; }
.patient-side { display: grid; gap: 18px; }
.patient-side [data-slot="card-header"] { display: flex; justify-content: space-between; }
.patient-side svg { color: #2c777c; }
.patient-side p { color: #63777e; margin: 4px 0 16px; }
.metric-layout { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.metric-card [data-slot="card-header"] { display: flex; align-items: center; gap: 10px; }
.metric-card p { margin: 0; color: #63777e; }
.metric-icon { width: 36px; height: 36px; border-radius: 10px; background: #e3f0f1; color: #176a70; display: grid; place-items: center; }
.metric-icon svg { width: 19px; height: 19px; }
.metric-card [data-slot="card-content"] { display: grid; }
.metric-card [data-slot="card-content"] strong { font-size: 32px; }
.metric-card [data-slot="card-content"] span { font-size: 12px; color: #667c83; }
.wide-card { grid-column: 1 / -1; min-height: 370px; }
.wide-card.compact { min-height: 0; }
.gate-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.readiness-pass { color: #27705f; font-weight: 700; text-transform: capitalize; }
.readiness-gap { color: #b8324b; font-weight: 700; text-transform: capitalize; }
.notice-banner { background: #f8f1e8; border: 1px solid #ead7b8; color: #6a4b1d; border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.bar-chart { height: 220px; display: flex; gap: 32px; align-items: end; padding: 18px 24px 0; border-left: 1px solid #d8e3e5; border-bottom: 1px solid #d8e3e5; background: linear-gradient(#e9eff0 1px, transparent 1px); background-size: 100% 25%; }
.bar-chart div { height: 100%; flex: 1; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 7px; }
.bar-chart span { width: min(58px, 75%); background: linear-gradient(#3d9297, #0d6970); border-radius: 7px 7px 0 0; }
.bar-chart small { font-size: 12px; }
.bar-chart em { font-size: 10px; color: #61767d; font-style: normal; }
.chart-note { font-size: 12px; color: #667c83; margin: 18px 0 0; }
.control-list { display: grid; }
.control-list > div { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 16px 0; border-top: 1px solid var(--border); }
.control-list > div:first-child { border-top: 0; }
.control-list svg { color: #2a797e; width: 18px; }
.control-list span { display: grid; }
.control-list small { color: #6a7f85; margin-top: 3px; }
.step-kicker { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.patient-action-card { min-height: 92px; background: #f5f9f9; border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin: 18px 0; }
.symptom-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.symptom-grid span { display: grid; color: #64787f; font-size: 12px; }
.symptom-grid strong { color: #17323b; font-size: 16px; }
.patient-action-card ul { margin: 0; padding-left: 20px; font-size: 14px; }
.capture-ready { display: flex; align-items: center; gap: 12px; }
.capture-ready svg { width: 34px; height: 34px; color: #0d6970; }
.capture-ready span { display: grid; }
.review-summary { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.review-summary svg { width: 17px; height: 17px; color: #27705f; }
.button-row { display: flex; justify-content: flex-end; gap: 10px; }
.urgent-note { display: flex !important; align-items: flex-start; gap: 7px; line-height: 1.45; }
.urgent-note svg { width: 16px; height: 16px; flex: none; color: #9b5e05; }
.header-controls { display: flex; gap: 10px; align-items: center; }
.header-controls select { height: 34px; border: 1px solid var(--border); border-radius: 8px; background: #fff; padding: 0 10px; color: #17323b; }
.data-quality { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 14px 0 0; }
.data-quality div { display: grid; }
.data-quality span { font-size: 12px; color: #667c83; margin-top: 2px; }
.resolved-row { background: #f3faf7; border-radius: 10px; padding-left: 10px !important; padding-right: 10px !important; }
.audit-card { grid-column: 1 / -1; }
.audit-card [data-slot="card-header"] { display: flex; justify-content: space-between; align-items: center; }
.audit-card [data-slot="card-content"] { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.audit-card [data-slot="card-content"] > div { display: flex; gap: 10px; align-items: flex-start; background: #f6f9f9; padding: 13px; border-radius: 10px; }
.audit-card svg { width: 17px; height: 17px; color: #2a797e; }
.audit-card span { display: grid; }
.audit-card small { color: #6a7f85; margin-top: 3px; }
.symptom-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.symptom-form label { font-size: 12px; color: #64787f; display: grid; gap: 4px; }
.symptom-form input, .symptom-form select { height: 36px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; }
.qc-canvas { width: 100%; border-radius: 10px; background: #17323b; margin-top: 8px; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 82px minmax(0, 1fr); }
  .sidebar { padding: 25px 11px; }
  .sidebar-label, .privacy-note div { display: none; }
  .sidebar nav button { justify-content: center; font-size: 0; }
  .sidebar nav button svg { width: 20px; height: 20px; }
  .clinical-grid, .metric-layout, .patient-layout, .next-path { grid-template-columns: 1fr; }
  .queue-card { grid-row: auto; }
}
@media (max-width: 680px) {
  .topbar { padding: 0 16px; }
  .brand > span:nth-child(2) { display: none; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .workspace { padding: 22px 14px 40px; }
  .workspace-head { display: grid; }
  .role-tabs { width: 100%; overflow: auto; }
  .image-compare, .measurement-row, .timeline, .symptom-grid, .audit-card [data-slot="card-content"] { grid-template-columns: 1fr; }
  .review-footer, .button-row { flex-direction: column; }
  .patient-hero h2 { font-size: 28px; }
}

.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.login-art { background: linear-gradient(165deg, #123f46, #0d6970 55%, #3d9297); color: #eef7f7; padding: 48px 56px; display: flex; flex-direction: column; justify-content: flex-start; gap: 28px; overflow: auto; }
.login-art h1 { font-size: 42px; letter-spacing: -.03em; max-width: 12ch; margin: 12px 0; }
.login-art p { max-width: 42ch; color: #d5e8ea; }
.login-art h2 { font-size: 16px; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 8px; }
.service-showcase-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.service-showcase article { background: rgba(255,255,255,.1); border-radius: 12px; padding: 12px 14px; }
.service-showcase article h3 { font-size: 14px; margin: 0 0 6px; }
.service-showcase article p { font-size: 12px; max-width: none; margin: 0 0 8px; }
.service-showcase article small { color: #9bb8bd; font-size: 11px; }
.account-select-wrap { display: grid; gap: 6px; font-size: 12px; color: #667c83; margin: 16px 0 10px; }
.account-select { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: #fff; }
.account-detail { border: 1px solid #c5d8d8; border-radius: 12px; padding: 12px 14px; background: #edf6f6; margin: 0 0 16px; display: grid; gap: 4px; }
.account-detail small { color: #667c83; }
.account-detail p { margin: 6px 0 0; font-size: 13px; color: #17323b; }
.login-mark { display: flex; align-items: center; gap: 10px; font-weight: 750; }
.login-mark span { display: grid; place-items: center; width: 36px; height: 36px; background: #fff; color: #0d6970; border-radius: 10px; }
.login-mark svg { width: 20px; height: 20px; }
.principles { display: grid; gap: 8px; margin-top: 24px; font-size: 13px; color: #d5e8ea; }
.principles span { padding-left: 12px; border-left: 2px solid #7ec4c8; }
.filmstrip { display: flex; gap: 8px; overflow: auto; padding: 4px 0 8px; }
.filmstrip img { width: 88px; height: 66px; object-fit: cover; border-radius: 8px; border: 2px solid transparent; cursor: pointer; }
.filmstrip img.active { border-color: #0d6970; }
.overlay { position: fixed; inset: 0; background: #0d2a3088; z-index: 40; display: grid; place-items: start center; overflow: auto; padding: 48px 16px; }
.overlay-card { background: #fff; border-radius: 16px; max-width: 1100px; width: 100%; padding: 22px; }
.overlay-card.guide-card { max-width: 720px; }
.overlay-card.guide-card .bubble { margin: 10px 0; }
.overlay-card.guide-card ul { margin: 8px 0 0 18px; }
.audit-loop td:nth-child(2) { font-weight: 650; }
.audit-loop .chip { background: #e7f3f3; color: #0d6970; margin-left: 6px; }
.btn-danger { background: #b8324b; color: #fff; border: 0; }
.btn-warn { background: #f4e3b8; color: #684b17; border: 1px solid #e4ce8a; }
.sign-out { border: 0; background: transparent; color: #5d7178; cursor: pointer; font-size: 12px; }
.toast { position: fixed; bottom: 18px; right: 18px; background: #17323b; color: #fff; padding: 12px 16px; border-radius: 10px; z-index: 50; max-width: 360px; }
.ai-box { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin: 8px 0; background: #fbf8f1; }
.ai-box .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.ai-comment, .ai-extra { width: 100%; margin-top: 8px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: #fff; }
.timeline.full { grid-template-columns: 1fr; }
.timeline.full > div { border-top: 0; border-left: 2px solid #dce7e8; padding: 0 0 16px 16px; }
.header-actions .who { display: grid; font-size: 11px; color: #667c83; text-align: right; }
.header-actions .who strong { color: #17323b; font-size: 12px; }
.service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 8px; }
.service-card h3 { margin: 4px 0 8px; font-size: 16px; }
.video-stage { background: linear-gradient(165deg, #123f46, #0d6970 70%); color: #eef7f7; }
.video-stage .muted, .video-stage p { color: #d5e8ea; }
.video-frame { display: flex; gap: 14px; align-items: center; min-height: 140px; background: #0b2f35; border-radius: 14px; padding: 18px; margin-bottom: 12px; color: #e8f4f4; }
.video-frame.live-video { display: grid; grid-template-columns: 1fr 1fr; }
.video-frame video { width: 100%; border-radius: 10px; background: #071c20; min-height: 140px; }
.video-frame svg { width: 42px; height: 42px; }
.video-frame div { display: grid; }
.video-frame span { font-size: 12px; color: #9bb8bd; }
.video-stage textarea, .video-stage input, .video-stage select { color: #17323b; }
.video-meta { display: grid; gap: 2px; margin: 8px 0 10px; }
.video-meta span { font-size: 12px; color: #9bb8bd; }
.video-tile { display: grid; gap: 6px; }
.video-tile span { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: #9bb8bd; }
.video-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 12px; }
.video-controls .btn, .video-controls .btn-outline { min-width: 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.chip.ok { background: #d8efe6; color: #1d6b56; }
.notice-banner.emergency { background: #f8ecec; border-color: #e3c0c0; color: #7a3030; }
.tele-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 18px; }
.prejoin-form { background: rgba(255,255,255,.08); border-radius: 12px; padding: 12px; margin: 10px 0; }
@media (max-width: 900px) {
  .tele-layout, .split-2 { grid-template-columns: 1fr; }
}
.login-panel { padding: 40px 44px; display: flex; flex-direction: column; justify-content: center; overflow: auto; background: #f7fbfb; }
.login-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.login-head h2 { margin: 4px 0 0; font-size: 28px; letter-spacing: -.02em; }
.login-tabs { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; background: #e5edef; padding: 4px; border-radius: 12px; margin: 16px 0 18px; }
.login-tabs button { border: 0; background: transparent; padding: 10px 8px; border-radius: 10px; font-weight: 700; color: #4d656b; cursor: pointer; }
.login-tabs button.active { background: #fff; color: #0d6970; box-shadow: 0 1px 4px rgba(13,105,112,.12); }
.login-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
.login-card .btn.btn-lg { width: 100%; min-height: 46px; }
.login-card .btn-outline { width: 100%; min-height: 42px; }
.mail-chip { display: inline-flex; align-items: center; margin: 10px 0 0; padding: 6px 10px; border-radius: 999px; background: #eef4f4; color: #4d656b; font-size: 12px; }
.mail-chip.ok { background: #d8efe6; color: #1d6b56; }
.mfa-card { background: #edf6f6; border: 1px solid #c5d8d8; border-radius: 14px; padding: 14px; display: grid; gap: 8px; }
.mfa-card input { font-size: 22px; letter-spacing: .28em; text-align: center; font-weight: 750; }
.dev-code { margin: 0; font-size: 28px; letter-spacing: .35em; font-weight: 800; color: #0d6970; text-align: center; }
.demo-drawer { margin-top: 8px; color: #667c83; font-size: 13px; }
.demo-drawer summary { cursor: pointer; font-weight: 700; color: #0d6970; }
.next-steps { margin-top: 22px; background: rgba(255,255,255,.1); border-radius: 12px; padding: 14px 16px; }
.next-steps ol { margin: 8px 0 0 18px; padding: 0; color: #d5e8ea; }
.login-art-btn { margin-top: 18px; color: #eef7f7; border-color: #7ec4c8; background: transparent; }
.login-foot { margin-top: 16px; }
.account-group { display: grid; gap: 8px; margin: 0 0 16px; }
.account-group h3 { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #667c83; margin: 0; }
.account-grid { display: grid; gap: 8px; margin: 16px 0 18px; }
.account-grid button { text-align: left; border: 1px solid var(--border); background: #fff; border-radius: 12px; padding: 12px; cursor: pointer; }
.account-grid button.active { border-color: #0d6970; background: #edf6f6; }
.account-grid small { color: #667c83; }
.stack { display: grid; gap: 10px; }
.stack label { font-size: 12px; color: #667c83; }
.stack input, .stack select, .stack textarea, .form-grid input, .form-grid select, .form-grid textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: #fff;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #667c83; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.table td { padding: 11px 6px; border-bottom: 1px solid #edf2f3; vertical-align: top; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover { background: #edf6f6; }
.thread { display: grid; gap: 10px; margin: 12px 0; }
.bubble { background: #f5f9f9; border-radius: 12px; padding: 12px; }
.bubble.me { background: #e9f5f1; }
.custody-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.chip { font-size: 11px; background: #e7f2f2; color: #0d6970; border-radius: 999px; padding: 4px 10px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filter-chip { border: 1px solid #c5d8d8; background: #fff; color: #0d6970; border-radius: 999px; padding: 6px 12px; font-size: 12px; cursor: pointer; }
.filter-chip.active { background: #0d6970; color: #fff; border-color: #0d6970; }
.notice-banner.ok { background: #e9f6f1; border-color: #add8c8; color: #205f50; }
.error { color: var(--destructive); min-height: 1.2em; font-size: 13px; }
.split-2 { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; }
.chart { width: 100%; height: 170px; }
.locale-btn, .locale-select {
  border: 1px solid var(--border); background: #fff; color: #16464c; border-radius: 8px;
  padding: 6px 10px; cursor: pointer; font-size: 12px; font-weight: 700;
}
.locale-select { max-width: 168px; }
.locale-wrap { display: inline-flex; align-items: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
html[dir="rtl"] .login-shell { direction: rtl; }
html[dir="rtl"] .header-actions { flex-direction: row-reverse; }
html[dir="rtl"] .sidebar { text-align: right; }
.demo-strip { font-size: 11px; color: #7a8e94; margin: 0 0 14px; }
.role-tabs { margin-top: 0; }
.notes-wrap { position: relative; }
.notes-drawer { position: absolute; right: 0; top: 42px; width: min(360px, 80vw); background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 40px rgba(23,50,59,.12); padding: 8px; z-index: 30; max-height: 70vh; overflow: auto; }
.notes-drawer button { display: grid; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px; border-radius: 8px; cursor: pointer; gap: 2px; }
.notes-drawer button:hover { background: #edf6f6; }
.notes-drawer strong { font-size: 13px; }
.notes-drawer span { font-size: 12px; color: #667c83; }
.note-badge { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; border-radius: 99px; background: #b8324b; color: #fff; font-size: 10px; display: grid; place-items: center; }
.load-banner, .error-banner { border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; font-size: 13px; }
.load-banner { background: #e8f1f2; color: #16464c; }
.error-banner { background: #f9e5e8; color: #9b2941; }
.pain-row { display: flex; align-items: center; gap: 10px; }
.pain-row output { font-weight: 750; min-width: 1.5ch; }
.coach-stage { position: relative; border-radius: 14px; overflow: hidden; background: #071c20; }
.coach-stage video, .coach-stage canvas, .coach-stage img { width: 100%; display: block; max-height: 320px; object-fit: cover; }
.coach-frame { pointer-events: none; position: absolute; inset: 12% 18%; border: 2px dashed #7ec4c8; border-radius: 18px; }
.coach-hint { position: absolute; left: 10px; right: 10px; bottom: 10px; background: #17323bd9; color: #fff; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.bottom-nav { display: none; }
.chart-page { display: grid; gap: 16px; }
.encounter-panel .video-frame { min-height: 180px; }
@media (max-width: 980px) {
  .login-shell { grid-template-columns: 1fr; grid-template-areas: "panel" "art"; }
  .login-panel { grid-area: panel; padding: 28px 20px 36px; }
  .login-art { grid-area: art; min-height: 240px; padding: 28px; }
  .split-2, .form-grid, .service-showcase-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .bottom-nav { position: sticky; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 25; }
  .app-shell.patient-shell { padding-bottom: 0; }
  .bottom-nav button { border: 0; background: transparent; font-size: 10px; color: #5d7178; display: grid; justify-items: center; gap: 2px; padding: 6px 2px; }
  .bottom-nav button.active { color: #0d6970; font-weight: 700; }
  .bottom-nav svg { width: 18px; height: 18px; }
  .workspace.patient-shell { padding-bottom: 12px; }
}
