/* Reference fidelity, 2026-11-03. Presentation only, Shared geometry across current
   palettes; light navigation in the two original palettes, dark in Medical.
   Classic themes, visibility, clinical states and DOM order retain their contracts. */
html:root[data-interface-theme]:not([data-interface-theme="classic"]) {
  --reference-paper:var(--theme-paper,var(--surface));
  --reference-line:color-mix(in srgb,var(--workspace-ink) 9%,var(--reference-paper));
  --workspace-shadow:0 2px 5px #19233903,0 9px 24px #19233904;
  --workspace-radius:18px;
  --workspace-control-radius:12px;
}
/* A quiet rail lets the current patient and task lead the screen. */
@media(min-width:901px) {
  html:root[data-interface-theme]:is([data-interface-theme="lavender-apricot"],[data-interface-theme="ivory-terracotta"]) .app-shell.app-layout:not(.patient-mode) > #appSidebar,
  html:root[data-interface-theme]:is([data-interface-theme="lavender-apricot"],[data-interface-theme="ivory-terracotta"]) .app-shell.app-layout:not(.patient-mode) > #appSidebar:is(:hover,:focus-within,:has(.sidebar-account-menu:not(.hidden))) {
    background:var(--reference-paper); color:var(--workspace-ink); border-right:1px solid var(--reference-line); box-shadow:none;
  }
  html:root[data-interface-theme]:is([data-interface-theme="lavender-apricot"],[data-interface-theme="ivory-terracotta"]) #appSidebar :is(.sidebar-brand-name,.sidebar-user-name) {color:var(--workspace-ink);}
  html:root[data-interface-theme]:is([data-interface-theme="lavender-apricot"],[data-interface-theme="ivory-terracotta"]) #appSidebar :is(.sidebar-nav-item,.sidebar-footer-message) {color:var(--workspace-muted);}
  html:root[data-interface-theme]:is([data-interface-theme="lavender-apricot"],[data-interface-theme="ivory-terracotta"]) #appSidebar .sidebar-nav-item.active {color:var(--workspace-accent);background:var(--workspace-soft);box-shadow:none;}
  html:root[data-interface-theme]:is([data-interface-theme="lavender-apricot"],[data-interface-theme="ivory-terracotta"]) #appSidebar .sidebar-nav-item:not(.active):hover {color:var(--workspace-ink);background:var(--workspace-canvas);}
  html:root[data-interface-theme]:is([data-interface-theme="lavender-apricot"],[data-interface-theme="ivory-terracotta"]) #appSidebar .sidebar-footer {border-color:var(--reference-line);}
  html:root[data-interface-theme]:is([data-interface-theme="lavender-apricot"],[data-interface-theme="ivory-terracotta"]) #appSidebar .sidebar-footer-message {background:transparent;border-color:transparent;}
}
/* Text hierarchy is carried by size and weight, not a colored final word. */
html:root[data-interface-theme]:is([data-interface-theme="lavender-apricot"],[data-interface-theme="ivory-terracotta"]) :is(#dashboardGreetingTitle,.patient-overview h1,.app-section-header h1,.settings-page-header h1) :is(span,strong),
html:root[data-interface-theme]:is([data-interface-theme="lavender-apricot"],[data-interface-theme="ivory-terracotta"]) #dashboardTab #dashboardWorkspaceHeader #dashboardGreetingTitle span,
html:root[data-interface-theme]:is([data-interface-theme="lavender-apricot"],[data-interface-theme="ivory-terracotta"]) #patientTab .patient-overview h1 span {
  color:inherit;background:none;-webkit-text-fill-color:currentColor;
}
/* Remove the legacy bevel; selected, disabled and focus remain explicit. */
html:root[data-interface-theme]:is([data-interface-theme="lavender-apricot"],[data-interface-theme="ivory-terracotta"]) :is(.primary-btn:not(.danger):not(.danger-btn):not(.is-danger):not(.destructive),#addPatientBtn,#agendaBookBtn,#firstUseTutorialNextBtn) {
  background:var(--workspace-accent);color:#fff;border:1px solid transparent;box-shadow:0 3px 8px rgba(var(--primary-rgb),.1);border-radius:12px;
}
html:root[data-interface-theme]:is([data-interface-theme="lavender-apricot"],[data-interface-theme="ivory-terracotta"]) :is(.secondary-btn,.topbar-btn) {background:var(--reference-paper);border-color:var(--reference-line);box-shadow:none;border-radius:12px;}
html:root[data-interface-theme]:is([data-interface-theme="lavender-apricot"],[data-interface-theme="ivory-terracotta"]) :is(.primary-btn,.secondary-btn):disabled {box-shadow:none;opacity:.5;}
/* A compact introduction, one calendar control band, then the three counters. */
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab #dashboardWorkspaceHeader.synapse-overview-panel {
  grid-template-columns:minmax(0,1fr);gap:16px;margin:0 0 18px;padding:0;background:transparent;border:0;box-shadow:none;
}
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab #dashboardWorkspaceHeader .dashboard-overview-card {grid-row:1;grid-column:1;}
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab #dashboardWorkspaceHeader .dashboard-week-header {grid-row:2;grid-column:1;width:100%;padding:0;margin:0;}
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab #dashboardCalendarControls {
  width:100%;display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:0;margin:0;min-height:44px;
}
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardCalendarControls .dashboard-calendar-segments {order:0;flex:1 1 260px;max-width:450px;display:flex;padding:4px;min-height:44px;background:var(--workspace-soft);border:0;box-shadow:none;border-radius:14px;}
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardCalendarControls .dashboard-calendar-segments button {flex:1;min-height:44px;border-radius:10px;font-size:13px;}
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardCalendarControls .dashboard-week-range {order:1;margin:0 8px 0 auto;font-size:13px;}
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardCalendarControls .dashboard-calendar-period {order:2;}
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab #dashboardWorkspaceHeader #dashboardWeekDaySummary {grid-row:3;grid-column:1;gap:14px;}
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab #dashboardWorkspaceHeader .dashboard-day-counter {min-height:92px;padding:16px 18px;border-radius:18px;box-shadow:none;border-color:transparent;}
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab #dashboardWorkspaceHeader .dashboard-day-counter[aria-pressed="true"] {border-color:color-mix(in srgb,var(--workspace-accent) 34%,transparent);}
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab #dashboardWorkspaceHeader .dashboard-summary-scope {grid-row:4;grid-column:1;margin:0;font-size:12px;}
/* The agenda is one surface: rows no longer each repeat a raised card. */
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab #dashboardListActions {margin:0;padding:16px 20px;border:1px solid var(--reference-line);border-bottom:0;border-radius:18px 18px 0 0;box-shadow:none;}
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab #dashboardWeek > .dashboard-week-day {padding:0 20px 18px;border:1px solid var(--reference-line);border-top:0;border-radius:0 0 18px 18px;box-shadow:none;}
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab .dashboard-day-group-list {gap:0;}
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab .agenda-appointment-row {padding:0;margin:0;border-bottom:1px solid var(--reference-line);gap:6px;}
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab .agenda-appointment-row:last-child {border-bottom:0;}
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab .agenda-appointment-row::before,
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab .agenda-appointment-row::after {content:none;}
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab #dashboardWeek .agenda-appointment-row:not(.is-day-flow-focus):not([data-day-flow-state="direct"]):not(.has-unread-return) > .dashboard-week-appointment:not(.is-drop-target):not(.is-focus-current) {border:1px solid transparent;background:transparent;box-shadow:none;border-radius:12px;min-height:88px;padding:16px 10px;}
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab #dashboardWeek .agenda-appointment-row:not(.is-day-flow-focus):not([data-day-flow-state="direct"]):not(.has-unread-return) > .dashboard-week-appointment:not(.is-drop-target):hover {background:var(--workspace-canvas);}
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab .agenda-appointment-menu > summary {border-color:transparent;background:transparent;box-shadow:none;}
/* Directory: calmer metrics and consistent rows; semantic warning colors stay. */
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #patientTab .patient-overview {margin-bottom:20px;}
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #patientTableBody .clinical-patient-row:not(.clinical-patient-row-archived) {box-shadow:none;border-radius:16px;}
html:root[data-interface-theme]:not([data-interface-theme="classic"]) :is(.patient-dashboard-card,.patient-home-card,.summary-card,.gym-exercise-card) {box-shadow:var(--workspace-shadow);}
@media(max-width:900px) {
  html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardCalendarControls .dashboard-calendar-segments {flex-basis:100%;max-width:none;}
  html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardCalendarControls .dashboard-week-range {flex:1;margin:4px 0;}
  html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab #dashboardWorkspaceHeader .dashboard-day-counter {min-height:98px;padding:14px 10px;}
  html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab #dashboardListActions {padding:14px;flex-wrap:wrap;}
  html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab #dashboardWeek > .dashboard-week-day {padding:0 12px 12px;}
  html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab #dashboardWeek .dashboard-week-appointment:not(.is-drop-target) {padding:14px 8px;}
}
@media(prefers-reduced-motion:reduce) {
  html:root[data-interface-theme]:not([data-interface-theme="classic"]) :is(.primary-btn,.secondary-btn,.dashboard-week-appointment) {transition:none;transform:none;}
}

html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab #dashboardWorkspaceHeader .dashboard-compact-hero {grid-row:1;grid-column:1 / -1;}
/* Keep the active consultation prominent. Other rows use the reference's
   horizontal rhythm on desktop without hiding presence/return information. */
@media(min-width:901px) {
  html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab #dashboardWeek .dashboard-day-flow .agenda-appointment-row:not(.is-day-flow-focus):not([data-day-flow-state="direct"]) > .dashboard-week-appointment {
    grid-template-columns:90px minmax(180px,1fr) minmax(180px,.65fr);gap:16px;align-items:center;min-height:94px;padding:16px 42px 16px 10px;
  }
  html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab #dashboardWeek .dashboard-day-flow .agenda-appointment-row:not(.is-day-flow-focus):not([data-day-flow-state="direct"]) > .dashboard-week-appointment > span {grid-column:auto;grid-row:1;}
  html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab #dashboardWeek .dashboard-day-flow .agenda-appointment-row:not(.is-day-flow-focus):not([data-day-flow-state="direct"]) .dashboard-week-appointment-time {display:grid;gap:4px;padding:0;font-size:13px;}
  html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab #dashboardWeek .dashboard-day-flow .agenda-appointment-row:not(.is-day-flow-focus):not([data-day-flow-state="direct"]) .dashboard-week-appointment-main strong {font-size:16px;line-height:1.4;}
  html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab #dashboardWeek .dashboard-day-flow .agenda-appointment-row:not(.is-day-flow-focus):not([data-day-flow-state="direct"]) .dashboard-week-appointment-status {display:grid;justify-items:start;gap:5px;font-size:12px;}
}

.interface-theme-option:is([data-theme-preview="lavender-apricot"],[data-theme-preview="ivory-terracotta"]) .theme-preview-rail {background:var(--preview-paper);border-right:1px solid #19233912;}
.interface-theme-option:is([data-theme-preview="lavender-apricot"],[data-theme-preview="ivory-terracotta"]) .theme-preview-rail i {background:var(--preview-soft);}
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab #dashboardWorkspaceHeader #dashboardGreetingTitle {margin:0;font-size:clamp(28px,2.7vw,36px)!important;line-height:1.2;}
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #dashboardTab #dashboardWeek .dashboard-week-appointment-status > small {font-size:12px;line-height:1.4;color:var(--workspace-accent);font-weight:650;}
/* Follow-up hierarchy remains primary / last / next; dates stop reading as
   page titles. Content height remains automatic for long clinical returns. */
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #patientDetailModal.patient-detail-page .follow-up-session-focus > .session-planning-card {padding:22px;border-radius:18px;box-shadow:var(--workspace-shadow);gap:12px;}
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #patientDetailModal.patient-detail-page .follow-up-session-focus > .session-planning-card[data-pyramid-slot="primary"] {min-height:190px;}
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #patientDetailModal.patient-detail-page .follow-up-session-focus > [data-pyramid-slot="primary"] .session-planning-card-date {font-size:24px;line-height:1.3;}
html:root[data-interface-theme]:not([data-interface-theme="classic"]) #patientDetailModal.patient-detail-page .follow-up-session-focus > [data-pyramid-slot="last"] .session-planning-card-date {font-size:18px;line-height:1.4;}
@media(max-width:900px) {
 html:root[data-interface-theme]:not([data-interface-theme="classic"]) #patientDetailModal.patient-detail-page .follow-up-session-focus > .session-planning-card {padding:18px;}
 html:root[data-interface-theme]:not([data-interface-theme="classic"]) #patientDetailModal.patient-detail-page .follow-up-session-focus > [data-pyramid-slot="primary"] .session-planning-card-date {font-size:22px;}
}
