/* Application frames, responsive layouts and business page patterns. */
html { scrollbar-gutter: stable; }
body { display: flex; flex-direction: column; }
a { color: var(--link); }
.icon { flex: 0 0 auto; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon-button { display: inline-flex; position: relative; align-items: center; justify-content: center; width: 38px; min-height: 38px; padding: 8px; border: 0; border-radius: 4px; background: transparent; color: inherit; text-decoration: none; }
.icon-button:hover { background: var(--brand-soft); color: var(--brand); }
.site-header { position: fixed; z-index: 20; inset: 0 0 auto; height: var(--header-height); border-bottom: 1px solid var(--line); background: white; }
.header-inner { display: flex; align-items: center; gap: 28px; height: 100%; padding: 0 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; text-decoration: none; color: var(--ink); line-height: 1.3; }
.brand:hover { color: inherit; }
.brand-mark { flex: 0 0 auto; width: 40px; height: 40px; object-fit: contain; }
.brand-text { font-size: 17px; font-weight: 650; white-space: nowrap; }
.brand-text small { display: block; margin-top: 3px; font-size: 10px; font-weight: 400; color: var(--muted); }
.main-nav { display: flex; align-items: stretch; height: 100%; gap: 3px; }
.nav-link { display: inline-flex; align-items: center; gap: 8px; padding: 0 15px; border-bottom: 3px solid transparent; color: var(--muted); white-space: nowrap; text-decoration: none; }
.nav-link.is-active { border-color: var(--brand); color: var(--brand); background: #087f8c06; }
.nav-link:hover { color: var(--brand); }
.header-account { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.account-menu { position: relative; }
.account-menu summary { display: flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; list-style: none; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--brand); background: var(--brand-soft); }
.account-name { max-width: 118px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.account-menu summary > .icon { width: 14px; height: 14px; }
.account-dropdown { position: absolute; z-index: 30; top: calc(100% + 10px); right: 0; display: grid; gap: 5px; width: 200px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--ink); box-shadow: 0 6px 24px #153b4720; }
.account-role { color: var(--muted); font-size: 11px; }
.account-logout { display: flex; align-items: center; gap: 9px; margin-top: 10px; padding: 10px 0 0; width: 100%; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--muted); text-align: left; }
.account-logout:hover { color: var(--danger); }
.notification-badge { position: absolute; top: 1px; right: -2px; padding: 1px 4px; min-width: 17px; background: var(--danger); color: white; border-radius: 8px; font-size: 10px; text-align: center; line-height: 1.4; }
.staff-site .site-header { background: var(--nav-top); color: white; border: 0; }
.staff-site .brand { color: white; }
.staff-site .brand-text small { display: none; }
.staff-site .nav-link { color: #b9d1d8; }
.staff-site .nav-link.is-active { color: white; background: #ffffff07; border-color: #73cecd; }
.staff-site .nav-link:hover { color: white; background: #ffffff07; }
.staff-site .account-avatar { background: #345a66; color: #dcecf1; }
.staff-site .notification-link:hover { background: #ffffff12; color: white; }
.staff-sidebar, .doctor-sidebar { position: fixed; z-index: 10; top: var(--header-height); bottom: 0; left: 0; width: var(--sidebar-width); background: var(--nav-side); padding: 24px 12px; overflow-y: auto; }
.doctor-sidebar { display: none; }
.sidebar-caption { color: #aed2d6; padding: 0 14px; margin: 0 0 18px; font-size: 11px; }
.side-link { display: flex; align-items: center; gap: 11px; min-height: 46px; padding: 11px 14px; margin: 4px 0; border-radius: 4px; color: #d5eaec; font-size: 14px; text-decoration: none; white-space: nowrap; }
.side-link:hover { background: #ffffff08; color: white; }
.side-link.is-active { color: white; background: var(--nav-selected); box-shadow: inset 3px 0 #90ddd8; font-weight: 600; }
.main-shell { flex: 1 0 auto; width: min(calc(100% - 40px), var(--content)); margin: var(--header-height) auto 0; padding: 26px 0 50px; }
.site-footer { flex: 0 0 auto; padding: 14px 16px max(14px, env(safe-area-inset-bottom)); text-align: center; font-size: 12px; }
.site-footer a { display: inline-block; padding: 6px 0; color: #536873; }
.site-footer a:hover { color: var(--link); }
.staff-site .site-footer { margin-left: var(--sidebar-width); }
.main-shell--narrow { width: min(calc(100% - 40px), 800px); }
.staff-site .main-shell { width: auto; margin-left: var(--sidebar-width); margin-right: 0; padding: 24px 20px 40px; }
.staff-site .main-shell--narrow { max-width: 1040px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.page-head p { margin-bottom: 0; font-size: 13px; color: var(--muted); }
.page-head .eyebrow { margin: 0 0 8px; color: var(--muted); font-size: 12px; font-weight: 400; }
.page-head h1 + p { margin-top: 9px; }
.page-date { font-size: 12px; color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.text-action { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 3px 0; color: var(--link); font-size: 13px; text-decoration: none; white-space: nowrap; }
.text-action:hover { text-decoration: underline; }
.text-action .icon { width: 16px; height: 16px; }
.button { font-size: 13px; }
.button-small { min-height: 30px; padding: 5px 10px; font-size: 12px; }
.card { min-width: 0; overflow: hidden; }
.card-body > :last-child { margin-bottom: 0; }
.card-header .help-text { font-size: 12px; }
.stack { gap: 20px; align-content: start; }
.filter-bar { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(150px, 1fr) auto; gap: 12px; align-items: end; margin-bottom: 20px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.filter-bar--inline { display: flex; flex-wrap: wrap; margin: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.filter-bar--inline .form-row { flex: 0 1 250px; min-width: 170px; }
.filter-bar label { color: var(--muted); font-size: 12px; font-weight: 400; }
.status-tabs { display: flex; gap: 25px; padding: 0 20px; border-bottom: 1px solid var(--line); background: white; overflow: auto; scrollbar-width: thin; }
.status-tab { display: flex; align-items: center; gap: 7px; padding: 13px 0; border-bottom: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: 13px; white-space: nowrap; }
.status-tab.is-active { color: var(--brand); border-color: var(--brand); font-weight: 600; }
.tab-count { padding: 0 6px; border-radius: 3px; background: #eef2f4; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.status-tab.is-active .tab-count { background: var(--brand-soft); color: var(--brand); }
.data-table th { height: 42px; font-size: 12px; font-weight: 500; }
.data-table td { height: 61px; font-size: 13px; vertical-align: middle; }
.data-table th, .data-table td { padding: 10px 18px; }
.data-table .actions-cell { text-align: right; }
.table-primary { font-weight: 550; }
.table-secondary { margin-top: 5px; font-size: 12px; }
.work-title { max-width: 400px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.data-table tbody tr:hover { background: #f8fbfc; }
.data-table-wrap { scrollbar-width: thin; }
.person-link { font-weight: 500; text-decoration: none; color: var(--ink); }
.pager { justify-content: flex-end; flex-wrap: wrap; padding: 13px 18px; gap: 9px; font-size: 12px; }
.pager-total { margin-right: auto; }
.metric-grid { gap: 16px; margin-bottom: 20px; }
.metric { padding: 19px 20px; }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: #72939f; gap: 6px; }
.metric-label { font-size: 13px; }
.metric-value { margin: 13px 0; font-size: 30px; line-height: 1.3; color: var(--ink); font-weight: 650; }
.metric-value small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 5px; }
.metric-accent { border-top: 3px solid var(--brand); padding-top: 17px; }
.metric-accent .metric-value { color: var(--brand); }
.metric-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.metric-foot a { display: flex; align-items: center; gap: 3px; white-space: nowrap; text-decoration: none; }
.metric-foot .icon { width: 15px; height: 15px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(285px, 1fr); gap: 20px; align-items: start; }
.module-bars { display: grid; gap: 22px; }
.module-bar > div:first-child { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 12px; }
.module-bar strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.module-bar small { color: var(--muted); font-weight: 400; }
.module-bar .progress-track { height: 7px; background: #edf2f4; }
.module-bar:nth-child(2) .progress-bar { background: #3f8fad; }
.module-bar:nth-child(3) .progress-bar { background: #63a8ad; }
.module-bar:nth-child(4) .progress-bar { background: #8cc7bb; }
.upcoming-row { display: flex; align-items: center; gap: 14px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.upcoming-row:last-child { border: 0; }
.upcoming-content { flex: 1; min-width: 0; }
.upcoming-content h3 { margin: 0 0 5px; }
.upcoming-content p { margin: 0; font-size: 12px; color: var(--muted); }
.date-tile { flex: 0 0 auto; width: 45px; border: 1px solid #cfe2e7; border-radius: 5px; padding: 5px 0; text-align: center; line-height: 1.3; font-size: 11px; color: var(--brand); background: #f3f9fa; }
.date-tile strong { display: block; font-size: 20px; }
.avatar { display: grid; flex: 0 0 auto; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 14px; font-weight: 600; }
.avatar-large { width: 52px; height: 52px; font-size: 20px; }
.compact-person { display: flex; align-items: center; gap: 11px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.compact-person:last-child { border: 0; }
.compact-person > div { flex: 1; min-width: 0; }
.compact-person small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.compact-person strong { font-size: 13px; font-weight: 600; }
.master-detail { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 620px; }
.doctor-list-pane { border-right: 1px solid var(--line); min-width: 0; }
.person-search { display: grid; gap: 10px; padding: 16px; }
.search-field { position: relative; }
.search-field > .icon { position: absolute; left: 10px; top: 9px; width: 18px; height: 18px; color: var(--muted); }
.search-field input { padding-left: 35px !important; }
.person-search-actions { display: flex; align-items: center; gap: 7px; }
.person-search-actions select { min-width: 0; }
.person-search-actions button { flex-shrink: 0; }
.person-list-label { display: flex; justify-content: space-between; padding: 0 16px 12px; color: var(--muted); font-size: 12px; }
.person-list { overflow-y: auto; max-height: max(450px, calc(100dvh - 380px)); scrollbar-width: thin; }
.person-row { display: flex; align-items: center; gap: 10px; padding: 16px; border-top: 1px solid #f0f3f5; text-decoration: none; color: var(--ink); }
.person-row:hover { background: #f4fafb; }
.person-row.is-active { background: var(--brand-soft); box-shadow: inset 3px 0 var(--brand); }
.person-summary { min-width: 0; }
.person-summary strong { font-size: 13px; font-weight: 600; }
.person-summary small { display: block; color: var(--muted); margin-top: 4px; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doctor-list-pane .pager { padding: 14px 12px; font-size: 11px; justify-content: flex-start; }
.doctor-list-pane .pager-total { flex-basis: 100%; }
.doctor-detail { min-width: 0; }
.doctor-detail-header { display: flex; align-items: center; gap: 15px; padding: 24px; }
.doctor-detail-header h2 { font-size: 20px; margin: 0; }
.doctor-detail-header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.title-and-status { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.doctor-profile-details { padding: 0 24px 24px; }
.doctor-profile-details summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; color: var(--muted); font-size: 12px; }
.doctor-profile-details summary::-webkit-details-marker { display: none; }
.doctor-profile-details summary .icon { width: 16px; }
.doctor-profile-details[open] summary { margin-bottom: 13px; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; margin: 0; }
.profile-grid > div { display: grid; grid-template-columns: 70px 1fr; gap: 8px; font-size: 12px; }
.profile-grid dt { color: var(--muted); }
.profile-grid dd { margin: 0; overflow-wrap: anywhere; }
.review-drawer { position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0; border: 0; width: 560px; max-width: 100vw; height: 100dvh; max-height: 100dvh; color: var(--ink); background: white; box-shadow: -8px 0 32px #153b4720; }
.review-drawer::backdrop { background: #153b4766; }
.drawer-layout { height: 100%; display: flex; flex-direction: column; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; min-height: 64px; border-bottom: 1px solid var(--line); }
.drawer-header h2 { margin: 0; font-size: 18px; }
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.drawer-body > [data-review-panel] { padding: 24px; }
.drawer-body .page-head { margin-bottom: 20px; }
.drawer-body .page-head h1 { font-size: 18px; }
.drawer-body .page-actions, .drawer-body [data-page-back] { display: none; }
.drawer-body .two-column { grid-template-columns: 1fr; }
.drawer-body .three-column { grid-template-columns: 1fr 1fr; }
.drawer-body .card { border: 0; border-radius: 0; box-shadow: none; overflow: visible; }
.drawer-body .card-header { padding: 0 0 14px; }
.drawer-body .card-body { padding: 18px 0; }
.drawer-body .card-header h2 { font-size: 14px; }
.drawer-actions { padding: 16px 24px; display: flex; gap: 10px; border-top: 1px solid var(--line); background: white; }
.drawer-body .primary-review-submit { display: none; }
.drawer-status { padding: 30px 24px; color: var(--muted); }
.drawer-error { padding: 20px 24px; color: var(--danger); }
body:has(.review-drawer[open]) { overflow: hidden; }
.review-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(290px, .9fr); gap: 20px; align-items: start; grid-template-areas: 'file form' 'history score'; }
.review-file { grid-area: file; }.review-form-panel { grid-area: form; }.review-history { grid-area: history; }.review-score { grid-area: score; }
.drawer-body .review-layout { display: flex; flex-direction: column; }
.drawer-body .review-layout > * { width: 100%; }
.drawer-body .review-file { order: 1; }.drawer-body .review-form-panel { order: 2; }.drawer-body .review-history { order: 3; }.drawer-body .review-score { order: 4; }
.file-summary { display: flex; align-items: center; gap: 12px; padding: 16px; background: #f8fbfc; border: 1px solid var(--line); border-radius: 5px; }
.file-summary > .icon { width: 30px; height: 30px; color: var(--brand); }
.file-summary > div { flex: 1; min-width: 0; }
.file-summary strong { display: block; overflow-wrap: anywhere; font-size: 13px; font-weight: 550; }
.file-summary small { color: var(--muted); font-size: 12px; }
.pdf-preview { margin-top: 18px; }
.pdf-preview summary { cursor: pointer; color: var(--link); font-size: 13px; }
.pdf-preview .document-frame { margin-top: 14px; height: 460px; min-height: 300px; }
.drawer-body .pdf-preview .document-frame { height: 340px; }
.review-decisions > div { display: flex; gap: 10px; }
.review-decisions > div > div { flex: 1; }
.review-decisions label { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; }
.review-decisions label:has(input:checked) { background: var(--brand-soft); border-color: var(--brand); }
.review-decisions input { margin: 0; }
.version-item { font-size: 13px; }
.doctor-bottom-nav { display: none; }
.doctor-home-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, 1fr); gap: 24px; align-items: start; }
.section-block { min-width: 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 13px; }
.section-head h2 { margin: 0; }
.welcome-card { padding: 24px; border-radius: 8px; background: var(--nav-top); color: white; }
.welcome-card h2 { color: white; font-size: 19px; margin: 0 0 5px; }
.welcome-card p { margin: 0 0 9px; color: #bad6df; font-size: 12px; }
.welcome-card .avatar { background: #ffffff14; color: #cbece8; }
.welcome-card .status-badge { background: #ffffff12; color: #cbece8; font-size: 11px; font-weight: 400; }
.welcome-card .status-badge::before { content: none; }
.profile-identity { display: flex; align-items: center; gap: 15px; }
.profile-identity h2 { margin: 0 0 5px; }
.profile-identity p { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.welcome-card .profile-identity p { color: #bad6df; }
.task-card { display: flex; align-items: center; gap: 12px; padding: 17px; margin-top: 10px; border: 1px solid var(--line); background: white; border-radius: 6px; }
.task-card > .icon { color: var(--brand); }
.task-content { flex: 1; min-width: 0; }
.task-content strong { font-size: 14px; font-weight: 600; }
.task-content p { font-size: 12px; color: var(--muted); margin: 3px 0 0; }
.module-card { position: relative; min-height: 165px; padding: 18px; }
.module-code { margin-bottom: 5px; font-size: 19px; font-weight: 650; color: var(--nav-side); }
.module-card h3 { font-size: 12px; font-weight: 400; color: var(--muted); margin-bottom: 18px; text-wrap: pretty; }
.module-card .status-badge, .module-card > .help-text, .module-card .module-submit { margin-top: auto; font-size: 11px; }
.module-open { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: flex-end; padding: 18px; color: var(--muted); border-radius: 6px; }
.module-open .icon { width: 16px; height: 16px; }
.module-submit { justify-content: space-between; }
.module-card:has(a:hover) { border-color: #9bbcc5; }
.download-template { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; color: var(--link); background: white; text-decoration: none; }
.download-template span { flex: 1; }
.physician-work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 20px; margin-bottom: 28px; }
.physician-work-card { padding: 20px; }
.physician-work-card h2 { font-size: 16px; margin: 14px 0 10px; line-height: 1.55; }
.physician-work-card h2 a { text-decoration: none; color: var(--ink); }
.work-card-meta { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.module-tag { background: var(--info-soft); color: var(--link); font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 4px; }
.work-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.work-opinion-summary { color: var(--danger); font-size: 12px; margin: 12px 0 0; }
.profile-details { margin-top: 20px; }
.profile-menu-link { display: flex; align-items: center; gap: 11px; padding: 17px 20px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.profile-menu-link:last-child { border-bottom: 0; }
.card-body > .profile-menu-link { padding-inline: 0; margin-top: 12px; padding-bottom: 0; }
.profile-menu-link span { flex: 1; }
.profile-menu-link > .icon:first-child { color: var(--brand); }
.profile-menu-link > .icon:last-child { color: var(--muted); width: 16px; height: 16px; }
.doctor-site .status-tabs { padding: 0; background: transparent; }
.public-site .header-inner { max-width: 1440px; margin: auto; }
.public-site .main-nav { margin-left: auto; align-items: center; }
.public-site .nav-link, .doctor-site .nav-link { height: 100%; }
.public-site .hero { padding: 50px 0; }
.public-site .hero h1 { font-size: clamp(26px, 3vw, 34px); margin-bottom: 18px; }
.public-site .hero-copy > p { font-size: 15px; }
.login-layout { max-width: 880px; margin: 0 auto; grid-template-columns: 1fr minmax(340px, 420px); gap: 50px; min-height: calc(100dvh - 160px); }
.login-intro h1 { font-size: 30px; line-height: 1.6; }
.login-card { box-shadow: 0 4px 24px #153b4706; }
.main-shell--login { width: min(calc(100% - 40px), 1000px); }
.empty-state { padding: 32px 20px; }
.empty-state h3 { font-size: 14px; color: var(--muted); font-weight: 500; }
.empty-state p { font-size: 12px; margin-bottom: 12px; }
.messages { margin-bottom: 20px; font-size: 13px; }
.inline-admin-form { grid-template-columns: minmax(180px, 1fr) minmax(140px, .55fr) auto; }
.selection-card:hover, .selection-card.is-selected { border-color: #9bbcc5; background: #f3f9fa; }
.selection-card:has(input:checked) { background: var(--brand-soft); border-color: var(--brand); }
.camera-panel { max-width: 620px; margin: 0 auto; background: #f5f8fa; }
.doctor-site .two-column { grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); }
.salon-tabs { margin-bottom: 20px; }
.phone-section[hidden] { display: none !important; }

@media (min-width: 761px) {
  .doctor-site { --sidebar-width: 196px; }
  .doctor-site .site-header { background: var(--nav-top); color: white; border: 0; }
  .doctor-site .brand { color: white; }
  .doctor-site .brand-text small { display: none; }
  .doctor-site .account-avatar { background: #345a66; color: #dcecf1; }
  .doctor-site .notification-link:hover { background: #ffffff12; color: white; }
  .doctor-sidebar { display: block; }
  .doctor-site .main-shell { width: auto; margin-left: var(--sidebar-width); margin-right: 0; padding: 24px 20px 40px; }
  .doctor-site .main-shell--narrow { max-width: 1040px; }
  .doctor-site .site-footer { margin-left: var(--sidebar-width); }
}

@media (max-width: 1180px) {
  .header-inner { gap: 16px; padding: 0 18px; }
  .brand-text { font-size: 15px; }
  .nav-link { padding: 0 11px; font-size: 12px; }
  .header-account { gap: 8px; }
  .account-name { max-width: 85px; font-size: 12px; }
  .metric { padding: 16px 14px; }.metric-accent { padding-top: 14px; }
  .metric-label { font-size: 12px; }.metric-value { font-size: 28px; }
  .metric-foot { font-size: 11px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.45fr) minmax(250px, 1fr); }
  .master-detail { grid-template-columns: 216px minmax(0, 1fr); }
  .profile-grid { grid-template-columns: 1fr; }
  .work-title { max-width: 285px; }
}
@media (max-width: 980px) {
  :root { --sidebar-width: 68px; }
  .staff-sidebar { padding: 20px 8px; }
  .staff-sidebar .sidebar-caption, .staff-sidebar .side-link span { display: none; }
  .staff-sidebar .side-link { justify-content: center; padding: 13px; }
  .account-name { display: none; }
  .metric-grid { gap: 12px; }
  .metric-top > .icon { display: none; }
  .doctor-home-grid { grid-template-columns: 1fr; }
  .brand-text { font-size: 14px; }
  .master-detail { grid-template-columns: 200px minmax(0, 1fr); }
  .doctor-detail-header { padding: 20px; }.doctor-profile-details { padding-inline: 20px; }
  .status-tabs { gap: 20px; }
  .inline-admin-form { grid-template-columns: 1fr 1fr; }
  .inline-admin-form > .button { grid-column: 1 / -1; width: fit-content; }
  .review-layout { grid-template-columns: 1fr; grid-template-areas: 'file' 'form' 'history' 'score'; }
}
@media (max-width: 760px) {
  .header-inner { gap: 10px; padding: 0 16px; }
  .brand-mark { width: 35px; height: 35px; }
  .brand-text { font-size: 14px; }
  .brand-text small { font-size: 9px; }
  .doctor-site .header-account { margin-left: auto; }
  .doctor-site .account-menu summary > .icon { display: none; }
  .doctor-bottom-nav { position: fixed; z-index: 20; inset: auto 0 0; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 8px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: white; }
  .doctor-bottom-nav .nav-link { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; padding: 6px; min-height: 48px; border: 0; color: var(--muted); font-size: 10px; }
  .doctor-bottom-nav .nav-link.is-active { background: transparent; color: var(--brand); font-weight: 600; }
  .doctor-bottom-nav .icon { width: 21px; height: 21px; }
  .doctor-site .main-shell { padding-bottom: 32px; }
  .doctor-site .site-footer { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .doctor-home-grid { grid-template-columns: 1fr; gap: 24px; }
  .doctor-home-grid .upcoming-doctor-salons { margin-top: 0; }
  .doctor-home-head { display: none; }
  .doctor-site .two-column { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .physician-work-grid { grid-template-columns: 1fr; }
  .doctor-site .page-head .eyebrow { display: none; }
  .staff-site .brand-text { font-size: 13px; }
  .staff-site .nav-link { padding: 0 9px; }
  .staff-site .main-nav .icon { display: none; }
  .login-layout { display: block; min-height: auto; }
  .login-intro { display: none; }
  .login-card { width: min(100%, 460px); margin: 36px auto 0; }
}
@media (max-width: 640px) {
  :root { --sidebar-width: 54px; }
  .staff-site { --header-height: 108px; }
  .staff-site .header-inner { height: auto; display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 0 12px; }
  .staff-site .brand { min-height: 64px; }
  .staff-site .main-nav { grid-column: 1 / -1; grid-row: 2; display: flex; justify-content: space-around; height: 44px; width: 100%; }
  .staff-site .main-nav .icon { display: block; width: 16px; height: 16px; }
  .staff-site .nav-link { justify-content: center; flex: 1; font-size: 12px; gap: 6px; }
  .staff-site .header-account { grid-row: 1; grid-column: 2; gap: 5px; }
  .staff-site .account-menu summary > .icon { display: none; }
  .staff-sidebar { padding: 16px 4px; }.staff-sidebar .side-link { padding: 12px; }
  .staff-site .main-shell { padding: 18px 12px 32px; }
  .main-shell, .main-shell--narrow, .main-shell--login { width: calc(100% - 32px); padding-top: 18px; }
  .page-head { align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
  .page-head h1 { font-size: 20px; }.page-head .eyebrow { font-size: 11px; }
  .page-date { display: none; }
  .page-actions { flex-wrap: wrap; }
  .card-header { padding: 16px; gap: 10px; flex-wrap: wrap; }
  .card-body { padding: 18px; }
  .button { min-height: 44px; }.button-small { min-height: 36px; }
  .icon-button { min-height: 40px; width: 36px; }
  .header-inner { padding: 0 14px; }
  .header-account { gap: 4px; }
  .brand { gap: 8px; }.brand-mark { width: 34px; height: 34px; }
  .brand-text { font-size: 13px; }
  .public-site .nav-link { display: none; }
  .public-site .main-nav .button { min-height: 34px; padding: 7px 10px; font-size: 11px; }
  .public-site .hero { padding: 35px 0; }
  .public-site .hero-actions .button { width: 100%; }
  .metric-value { font-size: 25px; }.metric-label { font-size: 11px; }
  .metric-foot { align-items: flex-start; gap: 4px; flex-direction: column; }
  .metric { padding: 14px 12px; }.metric-accent { padding-top: 12px; }
  .filter-bar { grid-template-columns: 1fr; padding: 16px; gap: 10px; }
  .filter-bar--inline .form-row { flex: 1 1 100%; }
  .status-tabs { gap: 18px; padding-inline: 16px; }
  .status-tab { font-size: 12px; }
  .data-table { min-width: 470px; }
  .data-table th, .data-table td { padding: 10px 13px; }
  .work-title { max-width: 235px; }
  .master-detail { grid-template-columns: 1fr; }
  .doctor-list-pane { border: 0; border-bottom: 1px solid var(--line); }
  .person-search { padding: 14px; }.person-list-label { display: none; }
  .person-list { display: flex; overflow-x: auto; overflow-y: hidden; }
  .person-row { flex: 0 0 190px; padding: 14px; }
  .doctor-list-pane .pager { padding: 8px 14px; }.doctor-list-pane .pager-total { flex-basis: auto; }
  .doctor-detail-header { padding: 18px; gap: 10px; }.doctor-detail-header h2 { font-size: 18px; }
  .doctor-profile-details { padding: 0 18px 18px; }
  .profile-grid { gap: 10px; }
  .title-and-status { gap: 7px; }
  .two-column, .three-column { grid-template-columns: 1fr; }
  .review-drawer { width: 100%; }
  .drawer-header { padding: 12px 18px; }.drawer-body > [data-review-panel] { padding: 20px; }
  .drawer-body .page-head h1 { font-size: 17px; }.drawer-actions { padding: 14px 20px max(14px, env(safe-area-inset-bottom)); }
  .drawer-actions .button { flex: 1; }
  .review-decisions label { font-size: 13px; padding: 10px; }
  .definition-list { grid-template-columns: 95px 1fr; }
  .definition-list dt, .definition-list dd { font-size: 12px; }
  .welcome-card { padding: 20px 18px; }.welcome-card h2 { font-size: 18px; }
  .profile-identity { gap: 12px; }.profile-identity .avatar-large { width: 46px; height: 46px; }
  .task-card { padding: 15px; gap: 10px; }.task-card .text-action { font-size: 12px; }
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .module-card { padding: 16px 13px; min-height: 156px; }.module-code { font-size: 18px; }.module-card h3 { font-size: 11px; }
  .module-open { padding: 16px 13px; }
  .physician-work-card { padding: 17px; }.physician-work-card h2 { font-size: 15px; }
  .work-card-actions { gap: 10px; }.work-card-actions .help-text { font-size: 11px; }
  .section-head .text-action { font-size: 12px; }
  .form-row-inline { grid-template-columns: minmax(0, 1fr) auto; }
  input:not([type='checkbox']):not([type='radio']):not([type='file']), select, textarea { min-height: 44px; font-size: 16px; }
  .filter-bar input, .filter-bar select, .person-search input, .person-search select, .table-form select { font-size: 13px; }
  .form-actions { align-items: stretch; }.form-actions .button { flex: 1; }
  .selection-card { padding: 13px; gap: 9px; }
  .selection-description { font-size: 12px; }
  .version-head { align-items: flex-start; }.version-head strong { font-size: 13px; }
  .document-frame { min-height: 350px; }
  .camera-actions .button { flex: 1; }.camera-panel { padding: 12px; }
  .inline-admin-form, .stage-grid { grid-template-columns: 1fr; }
  .inline-admin-form > .button { width: 100%; }
  .month-filter { width: 100%; }.month-filter input { flex: 1; min-width: 0; }
  .audit-detail { max-width: 240px; }
}
@media print {
  .site-header, .staff-sidebar, .doctor-sidebar, .doctor-bottom-nav, .review-drawer { display: none !important; }
  .staff-site .main-shell, .doctor-site .main-shell, .main-shell { margin: 0; width: 100%; padding: 0; max-width: none; }
}

/* Account permissions share the existing staff table and form styles. */
.account-layout { grid-template-columns: minmax(0, 1fr) 280px; }
.account-filters .form-row { flex: 1 1 120px; min-width: 120px; }
.account-filters .account-search { flex-basis: 200px; }
.account-actions { display: flex; gap: 12px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.account-actions form { margin: 0; }
.account-table .account-identity { min-width: 140px; max-width: 250px; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 1200px) {
  .account-layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .account-filters .account-search { flex-basis: 100%; }
  .account-table { min-width: 0; }
  .account-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .account-table tbody { display: block; }
  .account-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 16px; border-bottom: 1px solid var(--line); }
  .account-table td { display: block; height: auto; padding: 0; border: 0; }
  .account-table .account-identity { grid-row: 1 / 3; min-width: 0; max-width: none; }
  .account-table td:nth-child(2), .account-table td:nth-child(3) { grid-column: 2; text-align: right; }
  .account-table .actions-cell { grid-column: 1 / -1; padding-top: 10px; }
  .account-actions { gap: 8px; }
}
