/* ЛЮДИ: patient workspace. Kept before accessibility.css so vision mode wins. */
html:not(.vision-mode) .portal-open { --muted: var(--ludi-muted); --line: var(--ludi-line); background: var(--ludi-background); }
.portal-sidebar { padding: 28px 16px 20px; overflow-y: auto; }
.portal-brand { padding: 0 12px; }
.sidebar-label { margin: 32px 16px 14px; font-size: 12px; letter-spacing: 0; }
.portal-nav { gap: 4px; }
.portal-nav > button { font-size: 13px; min-height: 46px; padding: 12px 16px; }
.portal-nav > button.active { background: var(--ludi-active); color: var(--ludi-deep); }
.portal-nav > button.active::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--brand-blue); }
.sidebar-bottom { padding-top: 20px; }
.sidebar-care { display: block; width: calc(100% - 16px); margin: 12px 8px 20px; padding: 16px; text-align: left; }
.sidebar-care > strong { font-size: 13px; }
.sidebar-care > p, .sidebar-profile small, .portal-exit { font-size: 12px; }
.sidebar-care > p { margin-top: 5px; }
.sidebar-profile strong { font-size: 13px; }
.portal-topbar { height: 78px; background: #fff; }
.portal-breadcrumb, .topbar-date { font-size: 12px; }
.portal-page { padding-top: 30px; }
.portal-page-heading { align-items: flex-start; margin-bottom: 26px; }
.portal-page h1 { font-size: 30px; letter-spacing: -.9px; font-weight: 700; }
.portal-page-heading p { font-size: 14px; line-height: 1.7; }
.portal-primary, .portal-secondary { font-size: 13px; min-height: 46px; padding: 12px 18px; }
html:not(.vision-mode) .portal-open .portal-primary { background: var(--ludi-blue); border-radius: var(--ludi-control-radius); }
html:not(.vision-mode) .portal-open .portal-primary:hover { background: var(--ludi-deep); }
.portal-primary:hover { background: var(--brand-deep); }
.portal-secondary:hover { border-color: var(--brand-blue); }
.portal-demo-bar { margin-top: 16px; font-size: 12px; color: #755d29; background: #fffaf0; border-color: #ebdfc4; }
.portal-demo-bar > button { font-size: 12px; color: #755d29; min-height: 32px; }
.portal-panel { padding: 24px; border-radius: 16px; box-shadow: 0 2px 5px #19365303; }
.panel-heading > h2 { font-size: 17px; font-weight: 700; letter-spacing: -.35px; }
.panel-heading > button { font-size: 12px; color: var(--brand-blue); }
.home-priority-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(270px, 1fr); gap: 20px; margin-bottom: 20px; }
.portal-home .next-visit { position: relative; border-top: 3px solid var(--brand-blue); }
.portal-home .next-visit .panel-heading { margin-bottom: 4px; }
.next-visit-day { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.next-visit-day::first-letter { text-transform: uppercase; }
.appointment-row.compact { flex-wrap: wrap; padding: 12px 0 24px; }
.appointment-date { width: 60px; height: 68px; border: 0; background: #eaf3fb; color: #145e9a; }
.appointment-date > strong { font-size: 28px; color: #145e9a; }
.appointment-date > span { font-size: 12px; }
.appointment-details > h3 { font-size: 16px; line-height: 1.55; margin: 6px 0; }
.appointment-details > p, .appointment-details > .eyebrow-small { font-size: 13px; line-height: 1.6; }
.appointment-time > strong { font-size: 20px; font-weight: 650; }
.pill { font-size: 11px; color: #216248; background: #eaf5ee; padding: 5px 9px; border-radius: 6px; }
.pill-muted { color: var(--muted); background: #f0f3f7; }
.pill-pending { color: #77531d; background: #fff4dc; }
.visit-bottom { font-size: 12px; padding-top: 16px; flex-wrap: wrap; }
.visit-bottom > button { font-size: 13px; color: var(--brand-blue); }
.visit-bottom .portal-secondary { padding: 10px 13px; }
.visit-bottom .icon { width: 16px; height: 16px; }
.home-shortcuts { padding: 24px 20px 12px; }
.home-shortcuts h2 { margin: 0 0 10px; font-size: 17px; letter-spacing: -.35px; }
.home-shortcuts > button { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; padding: 16px 0; border-bottom: 1px solid var(--line); }
.home-shortcuts > button:last-child { border-bottom: 0; }
.home-shortcuts > button:hover strong { color: var(--brand-blue); }
.shortcut-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; background: #edf4fb; color: var(--brand-blue); }
.shortcut-icon .icon { width: 21px; height: 21px; }
.home-shortcuts > button > span:nth-child(2) { display: grid; gap: 5px; min-width: 0; flex: 1; }
.home-shortcuts strong { font-size: 13px; line-height: 1.5; }
.home-shortcuts small { font-size: 12px; line-height: 1.6; color: var(--muted); }
.home-shortcuts > button > .icon { width: 15px; height: 15px; color: var(--muted); }
.home-details-grid { grid-template-columns: minmax(0, 1.5fr) minmax(270px, 1fr); gap: 20px; margin-bottom: 20px; }
.portal-home .report-info > strong { font-size: 14px; }
.portal-home .report-info > span { font-size: 12px; }
.portal-home .report-row { padding: 17px 0; gap: 12px; }
.portal-home .report-icon { width: 40px; height: 40px; color: var(--brand-blue); }
.portal-home .new-label { background: #eaf3fb; color: #145e9a; font-size: 12px; }
.portal-home .report-ready { font-size: 12px; }
.portal-home .metric-header > div > span { font-size: 13px; }
.portal-home .metric-header strong { font-size: 32px; }
.portal-home .chart-caption { font-size: 12px; }
.portal-home .chart-fill { fill: #1a72b912; }
.portal-home .mini-chart { height: 110px; margin-top: 10px; }
.home-add-measurement { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; width: 100%; border-top: 1px solid var(--line); margin-top: 15px; padding-top: 12px; color: var(--brand-blue); font-size: 13px; }
.home-add-measurement .icon { width: 17px; height: 17px; }
.home-checkup-strip { display: flex; align-items: center; gap: 18px; padding: 20px 24px; background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 20px; }
.home-checkup-strip > div { min-width: 0; }
.home-checkup-strip h2 { font-size: 15px; margin: 0 0 5px; }
.home-checkup-strip p { font-size: 12px; color: var(--muted); margin: 0; }
.home-checkup-strip progress { width: 110px; height: 6px; accent-color: var(--brand-blue); margin-left: auto; border: 0; border-radius: 8px; overflow: hidden; }
.home-checkup-strip progress::-webkit-progress-bar { background: #e8eef4; }
.home-checkup-strip progress::-webkit-progress-value { background: var(--brand-blue); }
.portal-note { font-size: 12px; line-height: 1.8; }
.home-pending-notice { display: flex; align-items: center; gap: 9px; width: 100%; padding: 12px; margin-top: 16px; border-radius: 8px; background: #fff4dc; color: #77531d; text-align: left; font-size: 12px; line-height: 1.6; }
.home-pending-notice .icon { width: 18px; height: 18px; }
.home-appointment-state { padding: 15px 0 4px; }
.home-appointment-state > .icon { color: var(--brand-blue); width: 30px; height: 30px; }
.home-appointment-state h3 { font-size: 20px; margin: 14px 0 8px; }
.home-appointment-state p { font-size: 14px; line-height: 1.8; color: var(--muted); max-width: 400px; }
.appointments-toolbar { align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.appointment-filters { display: flex; flex-wrap: wrap; gap: 5px; padding: 4px; background: #f1f5f9; border-radius: 10px; }
.appointment-filters button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 14px; border-radius: 7px; color: var(--muted); font-size: 13px; }
.appointment-filters button[aria-pressed=true] { background: #fff; color: #145e9a; box-shadow: 0 1px 4px #19365315; font-weight: 700; }
.appointment-filters button > span { font-size: 11px; font-variant-numeric: tabular-nums; }
.appointment-search { display: grid; gap: 9px; color: var(--muted); font-size: 12px; max-width: 520px; }
.appointment-search > span:last-child { position: relative; }
.appointment-search .icon { position: absolute; left: 14px; top: 14px; width: 19px; height: 19px; pointer-events: none; }
.appointment-search input { font-size: 16px; width: 100%; min-width: 0; height: 48px; border: 1px solid #bacbdc; border-radius: 10px; color: var(--ink); background: #fff; padding: 10px 14px 10px 43px; }
.appointment-search input:focus-visible { outline: 3px solid var(--brand-blue); outline-offset: 3px; }
.appointment-search input::placeholder { color: #65788c; }
.appointment-result-count { font-size: 12px; color: var(--muted); margin: 22px 0 12px; }
.appointment-empty-action { margin: 0 auto 24px; }
.appointments-panel .portal-empty h3 { font-size: 18px; }
.appointments-panel .portal-empty p { font-size: 14px; }
.appointments-panel .appointments-checked { font-size: 12px; }
.portal-open :is(button,a,input,select):focus-visible { outline: 3px solid var(--brand-blue); outline-offset: 3px; }
.portal-open .portal-home .portal-page-heading p { font-size: 14px; }
.portal-open .visit-bottom > span, .portal-open .appointment-time > .pill { font-size: 12px; line-height: 1.6; }
.portal-home .metric-header strong > small, .portal-home .metric-header > .pill { font-size: 12px; }
html.vision-mode .appointment-search .icon { display: none; }
html.vision-mode .appointment-filters button[aria-pressed=true] { border: 2px solid #111; text-decoration: underline; }
html.vision-mode .home-pending-notice { border: 2px solid #111; background: #fff; }
/* The secondary patient screens use the same readable scale as the dashboard. */
html:not(.vision-mode) .portal-open :is(.records-secure,.record-document > small,.record-study small,.record-paper,.chart-caption,.metric-tile > p,.checkup-title p,.checkup-footnote,.chat-list small,.chat-heading > div > span,.chat-bubble > span) { font-size: 12px; line-height: 1.6; color: var(--muted); }
html:not(.vision-mode) .portal-open :is(.record-study strong,.record-document h3) { font-size: 16px; line-height: 1.5; }
html:not(.vision-mode) .portal-open :is(.record-document p,.record-download,.records-filters label,.metric-tile > div,.checkup-step strong,.chat-list strong,.chat-heading strong) { font-size: 14px; line-height: 1.6; }
html:not(.vision-mode) .portal-open :is(.record-document,.record-study,.metric-tile,.checkup-step > div) { min-width: 0; overflow-wrap: anywhere; }
html:not(.vision-mode) .portal-open :is(.record-download,.period-controls > button) { min-height: 44px; }
html:not(.vision-mode) .portal-open :is(.record-study > .pill,.checkup-step > .pill,.checkup-step p,.records-tabs button > span) { font-size: 12px; line-height: 1.6; }
html:not(.vision-mode) .portal-open .record-study > .pill { white-space: normal; }
html:not(.vision-mode) .portal-open .period-controls { flex-wrap: wrap; }
html:not(.vision-mode) .portal-open .period-controls > button { font-size: 13px; padding: 9px 13px; }
html:not(.vision-mode) .portal-open .measurement-table > div { font-size: 14px; line-height: 1.6; grid-template-columns: 1.1fr 1fr 1fr; }
html:not(.vision-mode) .portal-open .measurement-table > .table-header { font-size: 12px; }
html:not(.vision-mode) .portal-open .chat-bubble p { font-size: 15px; line-height: 1.7; }
html:not(.vision-mode) .portal-open .chat-form > input { font-size: 16px; min-height: 48px; }
html:not(.vision-mode) .portal-open .chat-form > button { width: 48px; height: 48px; flex-shrink: 0; }
html:not(.vision-mode) .portal-open .finance-wallet-history .wallet-transaction-info > strong { font-size: 14px; line-height: 1.6; }
html:not(.vision-mode) .portal-open .finance-wallet-history .wallet-transaction-info > small { font-size: 12px; line-height: 1.6; }
html:not(.vision-mode) .portal-open .finance-wallet-history .wallet-status { font-size: 12px; }
html:not(.vision-mode) .portal-open .finance-wallet-history .wallet-transaction-amount { font-size: 15px; }
html:not(.vision-mode) .portal-open :is(.profile-form label,.record-form label,.profile-source,.contacts-panel strong,.contacts-panel > p,.record-visit p,.record-form > p) { font-size: 14px; line-height: 1.7; }
html:not(.vision-mode) .portal-open :is(.contacts-panel small,.record-date,.record-date .pill,.report-table small,.portal-dialog .dialog-kicker) { font-size: 12px; line-height: 1.6; }
html:not(.vision-mode) .portal-open .report-table > div { font-size: 13px; line-height: 1.6; }
html:not(.vision-mode) .portal-open .report-table > .table-header { font-size: 12px; }
html:not(.vision-mode) .portal-open .portal-dialog-form label { font-size: 14px; line-height: 1.6; }
html:not(.vision-mode) .portal-open .portal-dialog-form :is(input,select) { font-size: 16px; min-height: 48px; }
.portal-open .portal-dialog .dialog-top > .icon-button { min-width: 44px; min-height: 44px; width: 44px; height: 44px; flex-shrink: 0; }
html:not(.vision-mode) .portal-open .location-summary small { font-size: 12px; line-height: 1.5; letter-spacing: .3px; }
html:not(.vision-mode) .portal-open .location-summary strong { font-size: 14px; line-height: 1.6; }
html:not(.vision-mode) .portal-open .location-summary > div > span { font-size: 12px; }
html:not(.vision-mode) .portal-open .location-summary > button { font-size: 14px; min-height: 44px; }
html.vision-mode .portal-open .record-download { font-size: 18px !important; line-height: 1.65 !important; border: 1px solid #111; }
@media (min-width: 1280px) {
  .portal-sidebar { width: 248px; }
  .portal-workspace { margin-left: 248px; width: calc(100% - 248px); }
  .portal-page, .portal-topbar { padding-left: 36px; padding-right: 36px; }
  .portal-demo-bar { margin-inline: 36px; }
}
@media (max-width: 1160px) {
  .home-priority-grid, .home-details-grid { grid-template-columns: minmax(0, 1fr); }
  .home-shortcuts { padding: 20px 24px 10px; }
  .home-shortcuts > button { padding-block: 14px; }
}
@media (max-width: 680px) {
  .portal-page { padding-top: 22px; }
  .portal-page-heading { gap: 16px; margin-bottom: 22px; }
  .portal-page-heading .portal-primary { min-height: 48px; font-size: 14px; }
  .portal-demo-bar { font-size: 11px; line-height: 1.6; margin: 12px 16px 0; }
  .portal-demo-bar > button { font-size: 11px; min-height: 44px; }
  .home-priority-grid, .home-details-grid { gap: 16px; margin-bottom: 16px; }
  .portal-home .portal-panel { padding: 20px; }
  .portal-home .appointment-row.compact { grid-template-columns: 52px minmax(0, 1fr); }
  .portal-home .appointment-date { width: 52px; height: 64px; }
  .portal-home .appointment-details > h3 { font-size: 16px; }
  .portal-home .appointment-details > p, .portal-home .appointment-details > .eyebrow-small { font-size: 12px; }
  .portal-home .appointment-time > .pill { font-size: 12px; }
  .portal-home .next-visit-day { font-size: 12px; }
  .portal-home .report-row .report-info { flex-basis: 0; }
  .portal-home .report-row > .new-label, .portal-home .report-row > .report-ready { margin-left: 0; font-size: 12px; }
  .portal-home .report-row > .icon { display: none; }
  .portal-home .report-info > strong { font-size: 14px; }
  .portal-home .report-info > span { font-size: 12px; }
  .home-checkup-strip { flex-wrap: wrap; padding: 18px; gap: 12px; }
  .home-checkup-strip > div { flex: 1; }
  .home-checkup-strip progress { flex-basis: 100%; width: 100%; margin: 4px 0; }
  .home-checkup-strip > button { width: 100%; }
  .appointment-filters { width: 100%; }
  .appointment-filters button { flex: 1; padding: 10px 6px; font-size: 12px; gap: 5px; }
  .appointment-search { font-size: 12px; line-height: 1.7; }
  .appointments-panel .appointment-row { gap: 12px; }
  .appointments-panel .appointment-details > h3 { font-size: 15px; }
  .appointments-panel .appointment-details > p { font-size: 12px; }
  .appointments-panel .appointment-time { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .appointments-panel .appointment-time > .pill { font-size: 11px; }
  html:not(.vision-mode) .portal-open .records-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; overflow: visible; }
  html:not(.vision-mode) .portal-open .records-tabs button { min-width: 0; padding: 10px 8px; font-size: 13px; }
  html:not(.vision-mode) .portal-open .records-tabs button > span { display: inline; font-size: 12px; }
  html:not(.vision-mode) .portal-open .records-doc-grid { grid-template-columns: minmax(0, 1fr); }
  html:not(.vision-mode) .portal-open .records-filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
  html:not(.vision-mode) .portal-open .records-filters label { min-width: 0; max-width: none; }
  html:not(.vision-mode) .portal-open .profile-fields { grid-template-columns: minmax(0, 1fr); }
  .portal-open .portal-dialog-form > .portal-primary { position: static; box-shadow: none; }
  html:not(.vision-mode) .portal-open .location-summary { flex-wrap: wrap; }
  html:not(.vision-mode) .portal-open .location-summary > div { flex-basis: calc(100% - 47px); overflow-wrap: anywhere; }
  html:not(.vision-mode) .portal-open .location-summary > button { margin-left: 47px; }
  html:not(.vision-mode) .portal-open .record-document { padding: 20px; }
  html:not(.vision-mode) .portal-open .record-paper { margin-bottom: 14px; }
  html:not(.vision-mode) .portal-open .record-document .record-download { font-size: 14px; padding: 10px 14px; }
  html:not(.vision-mode) .portal-open .record-study { flex-wrap: wrap; padding: 18px 16px; }
  html:not(.vision-mode) .portal-open .record-study > span:nth-child(2) { flex-basis: calc(100% - 50px); }
  html:not(.vision-mode) .portal-open .record-study > .pill { margin-left: 44px; }
  html:not(.vision-mode) .portal-open .metric-cards { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  html:not(.vision-mode) .portal-open .metric-tile { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; padding: 18px 20px; align-items: center; }
  html:not(.vision-mode) .portal-open .metric-tile > div { grid-column: 1; gap: 8px; }
  html:not(.vision-mode) .portal-open .metric-tile > strong { grid-column: 2; grid-row: 1 / 3; font-size: 28px; margin: 0; white-space: nowrap; }
  html:not(.vision-mode) .portal-open .metric-tile > strong > small { display: inline; font-size: 12px; margin: 0 0 0 4px; }
  html:not(.vision-mode) .portal-open .metric-tile > p { grid-column: 1; margin: 0; }
  html:not(.vision-mode) .portal-open .panel-heading > .period-controls { flex-basis: 100%; }
  html:not(.vision-mode) .portal-open .period-controls > button { flex: 1; }
  html:not(.vision-mode) .portal-open .measurement-table > div { font-size: 13px; gap: 8px; }
  html:not(.vision-mode) .portal-open .measurement-table > .table-header { font-size: 12px; }
  html:not(.vision-mode) .portal-open .checkup-step { gap: 10px; }
  html:not(.vision-mode) .portal-open .checkup-step > div { flex-basis: calc(100% - 44px); }
  html:not(.vision-mode) .portal-open .checkup-step > .pill { margin-left: 41px; }
  html:not(.vision-mode) .portal-open .chat-list { flex-direction: row; overflow-x: auto; scroll-snap-type: x proximity; }
  html:not(.vision-mode) .portal-open .chat-list > button { width: 230px; flex: 0 0 230px; scroll-snap-align: start; }
  html:not(.vision-mode) .portal-open .chat-heading { flex-wrap: wrap; }
  html:not(.vision-mode) .portal-open .chat-heading > div { min-width: 0; flex: 1 0 calc(100% - 39px); }
  html:not(.vision-mode) .portal-open .chat-heading > .pill { font-size: 12px; margin-left: 39px; }
  html:not(.vision-mode) .portal-open .finance-wallet-history .wallet-transaction { flex-wrap: wrap; }
  html:not(.vision-mode) .portal-open .finance-wallet-history .wallet-transaction-info { flex-basis: calc(100% - 48px); }
  html:not(.vision-mode) .portal-open .finance-wallet-history .wallet-transaction-amount { margin-left: 45px; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .portal-open *, .portal-open *::before, .portal-open *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 680px) {
  html.vision-mode .appointment-filters { flex-direction: column; gap: 8px; }
  html.vision-mode .appointment-filters button { width: 100%; justify-content: space-between; padding: 10px 14px; }
  html.vision-mode .portal-open .appointment-row { display: flex; flex-direction: column; align-items: stretch; }
  html.vision-mode .portal-open .appointment-date { align-self: flex-start; width: auto; height: auto; min-height: 48px; flex-direction: row; padding: 8px 12px; gap: 8px; }
  html.vision-mode .portal-open .appointment-details { width: 100%; }
  html.vision-mode .portal-open .appointment-time { align-items: flex-start; flex-wrap: wrap; }
}
