/* Extensions to the approved QI-A frame for availability, recovery and reading. */
/* Connected evidence uses literal lab fields within the existing Records frame. */
.citation-content { max-width:48rem; margin:0 auto; }
:root[data-theme] body#sam-app #app-view .home-record-open { display:inline-flex; align-items:center; min-height:44px; padding:.5rem 0; background:transparent; border:0; color:var(--sam-color-text); text-align:left; text-decoration:underline; text-underline-offset:.2em; overflow-wrap:anywhere; }
:root[data-theme] body#sam-app #app-view .citation-back { display:inline-flex; align-items:center; min-height:44px; margin:0 0 1rem; padding:.5rem 0; background:transparent; color:var(--sam-color-trust-strong); border:0; text-decoration:underline; text-underline-offset:.2em; }
:root[data-theme] body#sam-app #app-view .lab-source-card { width:100%; max-width:48rem; box-sizing:border-box; padding:clamp(1.25rem,4vw,2rem); background:var(--sam-color-surface); border:1px solid var(--sam-color-border); border-radius:16px; color:var(--sam-color-text); overflow-wrap:anywhere; }
:root[data-theme] body#sam-app #app-view .lab-source-title { margin:0; font:700 1.75rem/1.25 var(--sam-font-heading); letter-spacing:-.02em; }
:root[data-theme] body#sam-app #app-view .lab-source-origin { margin:.5rem 0 1.5rem; color:var(--sam-color-text-secondary); font-size:1rem; }
.lab-source-result { border-top:1px solid var(--sam-color-border); padding:1.5rem 0; }
:root[data-theme] body#sam-app #app-view .lab-source-result h4 { margin:0 0 1rem; font-size:1.125rem; }
:root[data-theme] body#sam-app #app-view .lab-source-label { margin:0 0 .3rem; color:var(--sam-color-text-secondary); font-size:.875rem; }
.lab-source-measurement { display:flex; align-items:baseline; flex-wrap:wrap; gap:.3rem .75rem; margin-bottom:1.25rem; }
.lab-source-value { font:700 2.25rem/1.2 var(--sam-font-heading); font-variant-numeric:tabular-nums; }
.lab-source-unit { color:var(--sam-color-text-secondary); font-size:1.125rem; }
.lab-source-details { display:grid; gap:1rem; margin:0; }
.lab-source-details>div { display:grid; grid-template-columns:minmax(0,10rem) minmax(0,1fr); gap:.25rem 1rem; }
.lab-source-details dt { color:var(--sam-color-text-secondary); }
.lab-source-details dd { margin:0; white-space:pre-line; font-variant-numeric:tabular-nums; }
:root[data-theme] body#sam-app #app-view .lab-source-gap { margin:1rem 0 0; padding:1rem; background:var(--sam-color-warm-soft); color:var(--sam-color-warm-strong); font-size:.9375rem; }
.lab-source-provenance { border-top:1px solid var(--sam-color-border); padding-top:1.25rem; color:var(--sam-color-text-secondary); }
:root[data-theme] body#sam-app #app-view .lab-source-card:focus { outline:none; box-shadow:none; }
:root[data-theme] body#sam-app #app-view .lab-source-provenance p { margin:0 0 .4rem; font-size:.875rem; line-height:1.6; }
@media(max-width:480px) { .lab-source-details>div { grid-template-columns:minmax(0,1fr); } }
:root.sam-text-larger { font-size:125%; }
:root[data-theme] body#sam-app[data-family-experience] { font-size:.875rem; --sam-type-body:.875rem; --sam-type-label:.875rem; --sam-type-caption:.75rem; }
:root[data-theme] body#sam-app[data-family-text-size="larger"] { --sam-type-body:1rem; --sam-type-label:1rem; --sam-type-caption:.875rem; }
.sam-availability,.sam-draft-status { color:var(--sam-color-text); font:inherit; line-height:1.6; margin:1rem 0; max-width:65ch; }
.sam-draft-status button { display:inline-flex; align-items:center; min-height:44px; margin:.4rem .5rem .4rem 0; }
[data-unavailable] { cursor:not-allowed; }
.account-headshot { width:100%; height:100%; object-fit:cover; border-radius:50%; display:block; }
.has-headshot { position:relative; overflow:hidden; }
.has-headshot > :not(.account-headshot) { visibility:hidden; }
.has-headshot > .account-headshot { position:absolute; inset:0; }
.profile-photo-settings { padding:0 0 1.5rem; }
.profile-photo-settings > img { width:112px; height:112px; object-fit:cover; border-radius:50%; margin:.75rem 0; }
.profile-photo-settings form { max-width:36rem; }
.vaccination-entry { padding:1.25rem 0; border-bottom:1px solid var(--sam-color-border); }
.family-shell .vaccination-entry h2 { font-size:1.125rem; line-height:1.4; margin:0 0 .35rem; }
.vaccination-date { font-weight:600; }
.vaccination-entry details { margin-top:.75rem; }
:root[data-theme] body#sam-app #app-view .profile-menu-action { display:flex; align-items:center; width:100%; min-height:48px; margin:0; padding:.75rem 1rem; box-sizing:border-box; }
:root[data-theme] body#sam-app #settings-button { color:var(--sam-color-text); background:transparent; border-color:var(--sam-color-border); text-decoration:none; }
:root[data-theme] body#sam-app .family-access-status { color:var(--sam-color-text); padding:.75rem; }
:root[data-theme] body#sam-app #app-view .primary-tab:is(.is-active,[aria-expanded="true"]) { background:transparent; }
:root[data-theme] body#sam-app #app-view .primary-tab.is-active::after { content:""; position:absolute; bottom:.15rem; width:4px; height:4px; border-radius:50%; background:currentColor; }
:root[data-theme] body#sam-app #app-view .primary-tab { position:relative; white-space:nowrap; overflow-wrap:normal; word-break:normal; flex:1 0 auto; }
:root[data-theme] body#sam-app #app-view .primary-tab-bar,
.family-shell #family-navigation { display:flex; flex-wrap:wrap; }
/* Compact navigation retains the phone's gesture inset and full tap targets. */
.family-shell .health-executive { max-width:70ch; font-size:1.125rem; line-height:1.7; }
.family-shell #tool-summary>h2 { margin:2.5rem 0 .75rem; }
.family-shell .health-attention,.family-shell .health-trend { padding:1rem 0; border-bottom:1px solid var(--sam-color-border); }
.family-shell .health-understanding { margin-top:2.5rem; max-width:70ch; }
.family-shell .health-understanding>section { margin:1.5rem 0; }
.family-shell .health-understanding h3 { margin-bottom:.5rem; }
.family-shell .health-user-note { margin-block:1rem; padding:1rem; background:var(--sam-color-surface); }
.family-shell .health-trend table { width:100%; border-collapse:collapse; font-variant-numeric:tabular-nums; }
.family-shell .health-trend caption { text-align:left; padding-block:.75rem; font-weight:600; }
.family-shell .health-trend th,.family-shell .health-trend td { text-align:left; padding:.75rem .5rem; border-bottom:1px solid var(--sam-color-border); overflow-wrap:anywhere; }
.family-shell .health-trend svg { display:block; width:100%; height:10rem; color:var(--sam-color-text-primary); }
.family-shell .medication-reconciliation>summary,.family-shell .health-understanding summary { min-height:44px; padding:.75rem 0; cursor:pointer; }
.family-shell .health-user-note a,.family-shell .medication-reconciliation a { display:block; min-height:44px; padding:.5rem 0; }
.family-shell .health-attention>h3 { overflow-wrap:anywhere; }
:root[data-theme] body#sam-app #app-view .primary-tab-bar,
.family-shell #family-navigation {
  --sam-nav-safe-bottom:env(safe-area-inset-bottom, 0px);
  align-items:center;
  min-height:0;
  padding-top:4px;
  padding-bottom:max(2px, var(--sam-nav-safe-bottom));
}
:root[data-theme] body#sam-app #app-view .primary-tab,
.family-shell #family-navigation .primary-tab { min-width:44px; min-height:56px; padding:2px 2px 4px; gap:2px; }
:root[data-theme] body#sam-app #app-view .primary-tab-ask-mark,
.family-shell #family-navigation .primary-tab-ask-mark { width:32px; height:32px; flex:0 0 32px; }
:root[data-theme] body#sam-app #app-view .primary-tab-ask,
.family-shell #family-navigation .primary-tab-ask { margin-top:0; }
.family-shell #family-navigation .primary-tab { flex:1 0 auto; white-space:nowrap; overflow-wrap:normal; word-break:normal; }
:root[data-theme] body#sam-app #app-view { padding-bottom:calc(var(--sam-measured-nav,5rem) + 1.5rem); }
:root[data-theme] body#sam-app #app-view .primary-more-panel { position:static; inset:auto; width:100%; max-height:none; overflow:visible; display:block; padding-bottom:1.5rem; }
:root[data-theme] body#sam-app #app-view .primary-more-panel[hidden] { display:none; }
:root[data-theme] body#sam-app #app-view:has(#primary-more-panel:not([hidden])) :is(.content-shell,.app-footer) { display:none; }
:root[data-theme] body#sam-app #app-view .primary-more-heading h2 { color:inherit; margin:0; font:700 2.5rem/1.2 var(--sam-font-heading); }
.more-destinations { display:block; }
:root[data-theme] body#sam-app .skip-link:not(:focus) { clip-path:inset(50%); }
.more-destination { display:block; padding:1.25rem .25rem; border-bottom:1px solid var(--sam-color-border); color:var(--sam-color-text); text-decoration:none; }
.more-destination strong,.more-destination span { display:block; }
.more-destination strong { font-size:1.08rem; }
.more-destination span { margin-top:.3rem; line-height:1.5; }
.more-destination:hover { background:var(--sam-color-surface-soft); }
.record-tools-links { display:flex; flex-wrap:wrap; gap:1rem; margin:1.5rem 0; }
.records-vault { padding:1.5rem 0; border-block:1px solid var(--sam-color-border); }
.records-vault a,.record-tools-links a,.home-updates-link { display:inline-flex; align-items:center; min-height:44px; color:var(--sam-color-text); text-underline-offset:.2em; }
.home-updates-link { margin-bottom:1rem; }
.care-category-tabs { display:flex; gap:.25rem; flex-wrap:wrap; margin:0; padding:.25rem 0 .75rem; }
.care-category-tabs button { min-height:44px; padding:.5rem .75rem; flex:0 0 auto; white-space:nowrap; }
.care-category-tabs [aria-selected="true"] { background:var(--sam-aubergine); color:var(--sam-warm-white); }
.care-manual-action { display:inline-flex; min-height:44px; align-items:center; color:var(--sam-color-text); }
.family-shell .tool-form { max-width:46rem; }
.family-shell .tool-form fieldset { border:0; padding:0; min-width:0; }
.family-shell .tool-form :is(input,textarea,select) { font-size:1rem; }
.family-shell .tool-entry { padding-block:1.25rem; border-bottom:1px solid var(--sam-color-border); }
.family-shell .tool-entry p { white-space:pre-wrap; }
.family-shell .tool-entry a { overflow-wrap:anywhere; }
.family-shell .tool-entry .actions { margin-top:1rem; }
.family-shell .medication-search { max-width:32rem; margin-bottom:1.5rem; }
.family-shell .medication-section { margin:0 0 2rem; }
.family-shell .medication-section>h2 { font-size:1rem; margin:1.25rem 0 0; }
.family-shell .medication-entry { padding:1.25rem 0; border-bottom:1px solid var(--sam-color-border); }
.family-shell .medication-entry h3 { font-size:1.25rem; line-height:1.35; margin:0 0 .4rem; overflow-wrap:break-word; }
.family-shell .medication-directions { margin:0; font-weight:700; }
.family-shell .medication-status { font-size:.875rem; color:var(--sam-color-text-secondary); margin:.5rem 0 1rem; }
.family-shell .medication-facts { margin:0; max-width:46rem; }
.family-shell .medication-facts>div { display:grid; grid-template-columns:minmax(8rem, .7fr) minmax(0,1.3fr); gap:.5rem 1rem; padding:.3rem 0; }
.family-shell .medication-facts dt { font-weight:600; }
.family-shell .medication-facts dd { margin:0; overflow-wrap:break-word; }
.family-shell .medication-history { margin-top:.75rem; }
.family-shell .medication-section>summary,.family-shell .medication-history>summary { min-height:44px; padding:.6rem 0; cursor:pointer; }
.family-shell .medication-history-entry { padding:.5rem 0; border-top:1px solid var(--sam-color-border); }
.family-shell .medication-history-entry a { display:block; min-height:44px; padding:.5rem 0; }
.family-shell .medication-summary { margin:1.5rem 0; }
.family-shell .medication-summary ul { list-style:none; padding:0; }
.family-shell .medication-summary li { padding:.6rem 0; border-bottom:1px solid var(--sam-color-border); }
.family-shell .medication-summary li>* { display:block; }
@media(max-width:360px) { .family-shell .medication-facts>div { grid-template-columns:1fr; gap:.1rem; } }
.family-shell .account-section { margin-top:2.5rem; padding-top:1rem; border-top:1px solid var(--sam-color-border); }
.family-shell .danger-action { border-width:2px; }
.family-shell .tool-tabs { display:flex; flex-wrap:wrap; gap:.75rem; margin:1rem 0; }
.family-shell .tool-tabs button[aria-pressed="true"] { text-decoration:underline; text-underline-offset:.3em; }
:root[data-theme] body#sam-app #app-view .ask-intro { align-items:start; gap:.75rem; }
:root[data-theme] body#sam-app #app-view .ask-heading-row { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
:root[data-theme] body#sam-app #app-view .ask-heading-row h2 { margin:0; min-width:0; }
:root[data-theme] body#sam-app #app-view .ask-conversation-actions { display:flex; flex:none; gap:4px; margin:0; }
:root[data-theme] body#sam-app #app-view .ask-conversation-actions .ask-new-chat { display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; min-height:44px; padding:10px; margin:0; border:0; border-radius:8px; color:inherit; background:transparent; box-shadow:none; }
:root[data-theme] body#sam-app #app-view .ask-conversation-actions .ask-new-chat:hover { background:#45334C; }
:root[data-theme] body#sam-app #app-view .ask-conversation-actions .ask-new-chat:focus-visible { outline:2px solid currentColor; outline-offset:2px; }
.ask-conversation-actions svg { width:24px; height:24px; flex:none; }
:root[data-theme] body#sam-app #chat-history-status:empty { display:none; }
:root[data-theme] body#sam-app #app-view :is(.ask-suggestions button,.ask-new-chat) { font-size:.875rem; overflow-wrap:normal; word-break:normal; }
:root[data-theme] body#sam-app #chat-input { font-size:1rem; }
:root[data-theme] body#sam-app #app-view :is(input,select,textarea,button) { max-width:100%; }
:root[data-theme] body#sam-app #app-view .app-identity p { overflow-wrap:normal; word-break:normal; }
:root[data-theme] body#sam-app[data-family-text-size="larger"] :is(input,select,textarea,.ask-new-chat,.ask-answer-card,.experience-record-card) { font-size:1rem; }
.family-shell:not(.family-entry)[data-text-size="larger"] { font-size:1rem; }
.family-shell #family-subtitle { overflow-wrap:normal; word-break:normal; }
.family-shell #pending-transfers { margin:1.5rem 0; }
.family-shell #pending-transfers form { padding:1rem 0; border-bottom:1px solid var(--sam-color-border); }
.family-shell #enrollment-availability { font-size:.9rem; }
.sam-offline-vault :is(.primary-tab-bar,.profile-menu,.app-brand) { display:none!important; }
.sam-offline-vault #app-view { padding-bottom:1rem; }
@media(max-width:430px) {
  :root[data-theme] body#sam-app #app-view .app-header { flex-wrap:wrap; }
  :root[data-theme] body#sam-app #app-view .app-brand { flex:1; }
  :root[data-theme] body#sam-app #app-view .app-identity { min-width:4rem; }
  .family-shell:not(.family-entry) .family-header { flex-wrap:wrap; }
  .family-shell #family-subtitle { flex:1; min-width:5rem; }
}

/* Keyboard covers navigation; only the composer follows the keyboard edge. */
:root[data-theme] body#sam-app #app-view #panel-chat .ask-experience-shell { gap:.8rem; }
:root[data-theme] body#sam-app #app-view #panel-chat .ask-messages { min-height:0; padding:0; margin:0; }
:root[data-theme] body#sam-app #app-view #panel-chat .ask-messages:empty { display:none; }
/* A transformed/filtered panel becomes the containing block for fixed children.
   Keep Ask out of the legacy settling animation so its composer uses the viewport. */
:root[data-theme] body#sam-app #app-view #panel-chat { padding-bottom:1rem; animation:none; transform:none; filter:none; }
:root[data-theme] body#sam-app #app-view #panel-chat > .brand-screen-heading { margin-bottom:0; }
#ask-reading-pane { max-height:var(--sam-ask-reading-height,none); overflow-y:auto; }
:root[data-theme] body#sam-app #app-view #panel-chat > .ask-composer { position:fixed; display:block; z-index:25; inset-inline:1rem; bottom:var(--sam-composer-bottom,var(--sam-measured-nav,5rem)); width:auto; max-width:50rem; margin:0 auto; padding:.75rem; border:1px solid var(--sam-color-border); border-radius:16px 16px 0 0; background:var(--sam-color-surface); }
:root[data-theme] body#sam-app #app-view:has(#panel-chat:not([hidden])) .primary-tab-bar { bottom:0; }
:root[data-theme] body#sam-app.sam-keyboard-open #app-view #panel-chat > .ask-composer {
  position:fixed; bottom:auto; top:calc(var(--sam-keyboard-top) - var(--sam-composer-height));
}
:root[data-theme] body#sam-app.sam-keyboard-open #app-view:has(#panel-chat:not([hidden])) .primary-tab-bar {
  top:calc(var(--sam-screen-bottom) - var(--sam-measured-nav)); bottom:auto;
  /* Keep its screen-bottom geometry, but never paint it over the keyboard. */
  visibility:hidden; pointer-events:none;
}
:root[data-theme] body#sam-app #app-view .ask-composer #chat-input { display:block; width:100%; height:2.75rem; min-height:2.75rem; max-height:25vh; padding:.6rem; margin:0; resize:vertical; }
.ask-composer-controls { display:flex; align-items:center; gap:.4rem; margin-top:.5rem; }
:root[data-theme] body#sam-app #app-view .ask-composer-controls button { display:inline-flex; align-items:center; justify-content:center; min-width:44px; min-height:44px; gap:.3rem; margin:0; padding:.4rem .65rem; font-size:.875rem; }
.ask-composer-controls button svg { width:20px; height:20px; flex-shrink:0; }
:root[data-theme] body#sam-app #app-view .ask-composer-controls button { flex:0 0 auto; white-space:nowrap; word-break:normal; overflow-wrap:normal; }
:root[data-theme] body#sam-app #app-view .ask-composer-controls .ask-send { width:44px; height:44px; flex:0 0 44px; margin-left:auto; padding:10px; border-radius:50%; }
#ask-capability-message,#ask-composer-status { font-size:.8rem; line-height:1.4; margin:0 0 .5rem; }
#ask-capability-message { display:flex; align-items:center; gap:.5rem; }
#ask-capability-message[hidden] { display:none; }
#ask-capability-message button { flex:0 0 44px; width:44px; height:44px; min-height:44px; margin:0; padding:10px; border:0; background:transparent; }
#ask-capability-message button svg { width:20px; height:20px; }
#ask-composer-status:empty,#ask-attached:empty { display:none; }
#ask-composer-status:not(:empty) { margin:.5rem 0 0; }
#ask-attached { font-size:.8rem; overflow-wrap:anywhere; max-height:6rem; overflow-y:auto; }
#ask-attached a { color:var(--sam-color-text); }
#ask-attachment-dialog { width:min(32rem,calc(100% - 2rem)); max-height:85dvh; padding:1.25rem; border-radius:16px; overflow-y:auto; background:var(--sam-color-surface); color:var(--sam-color-text); }
#ask-attachment-dialog label { display:block; margin:1rem 0; }
#ask-attachment-dialog select { width:100%; min-height:44px; font-size:1rem; }
.ask-file-actions { display:flex; flex-wrap:wrap; gap:.5rem; }
.ask-file-actions button { min-height:44px; }
.ask-file-consent input { width:1.25rem; height:1.25rem; }
:root[data-theme] body#sam-app #app-view:has(#panel-chat:not([hidden])) .app-footer { display:none; }
#voice-presence #chat-form { position:static; width:100%; margin:0; }
#voice-presence #ask-voice { display:none; }
@media(max-width:360px) { :root[data-theme] body#sam-app #app-view #panel-chat > .ask-composer { inset-inline:.5rem; padding:.5rem; } }
@media(max-height:500px) {
  :root[data-theme] body#sam-app #app-view:has(#panel-chat:not([hidden])) .app-header { min-height:3.5rem; padding-block:.375rem; }
  :root[data-theme] body#sam-app #app-view .content-shell:has(#panel-chat:not([hidden])) { margin-top:3.75rem; }
  :root[data-theme] body#sam-app #app-view #panel-chat > .brand-screen-heading { margin-top:-3.75rem; min-height:3.75rem; padding-block:0 .375rem; }
  :root[data-theme] body#sam-app #app-view #panel-chat .brand-screen-heading h2 { font-size:1.5rem; }
  :root[data-theme] body#sam-app #app-view #panel-chat > .ask-composer { padding:.5rem; }
}
@media(max-height:500px) {
  :root[data-theme] body#sam-app #app-view #panel-chat > .ask-composer { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:.5rem; }
  #panel-chat .ask-composer > :is(#ask-capability-message,#ask-attached,#ask-composer-status) { grid-column:1 / -1; margin:0; }
  #panel-chat .ask-composer-controls { margin:0; }
  :root[data-theme] body#sam-app #app-view #panel-chat .ask-composer-controls #ask-voice { font-size:0; gap:0; width:44px; }
}
/* At very large text sizes, reflow all content instead of obscuring it with
   fixed controls that can occupy most of a phone's available height. */
body.sam-ask-reflow #ask-reading-pane { max-height:none; overflow:visible; }
body.sam-ask-reflow .ask-composer-controls { flex-wrap:wrap; }
.care-team-scope { display:flex; flex-wrap:wrap; gap:.5rem; margin-block:1rem; }
.care-team-scope button[aria-pressed="true"] { background:var(--sam-color-trust)!important; color:var(--sam-color-on-trust)!important; }
.care-experience-portrait { float:left; width:64px; height:64px; margin:0 1rem .75rem 0; border-radius:50%; overflow:hidden; background:var(--sam-color-trust-soft); display:grid; place-items:center; font-weight:600; }
.care-experience-portrait img { width:100%; height:100%; object-fit:cover; }
.care-phone-link { display:inline-flex; min-height:44px; align-items:center; }
.care-office-address { margin-block:.5rem; }
.care-profile-details { clear:both; margin-top:.5rem; }
.care-profile-details summary { min-height:44px; padding-block:.5rem; cursor:pointer; }
/* Care Team: compact identities, progressively disclosed contact details. */
:root:has(#panel-care-team:not([hidden])),body:has(#panel-care-team:not([hidden])) { overflow-x:clip; }
#panel-care-team > .brand-screen-heading p,#panel-care-team .care-experience-intro { display:none; }
#panel-care-team #care-experience-status { position:static; width:auto; height:auto; clip-path:none; margin:0 0 1.25rem; color:var(--sam-color-text-secondary); font-size:.875rem; }
:root[data-theme] body#sam-app #app-view #panel-care-team .care-category-tabs { background:var(--sam-aubergine); margin-inline:-1.25rem; padding-inline:1.25rem; }
:root[data-theme] body#sam-app #app-view #panel-care-team .care-category-tabs button { border:0; border-radius:0; background:transparent; color:#E6E4EC; }
:root[data-theme] body#sam-app #app-view #panel-care-team .care-category-tabs [aria-selected="true"] { color:#F7F4EE; box-shadow:inset 0 -3px #AAA5F4; }
.care-team-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:.75rem; margin-block:.5rem 1rem; }
.care-team-toolbar .care-team-search { flex:1 1 12rem; min-width:0; width:auto; min-height:44px; }
.care-team-toolbar .care-manual-action { display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:.55rem 1rem; border-radius:.75rem; background:var(--sam-color-trust); color:var(--sam-color-on-trust)!important; font-weight:600; text-decoration:none; }
#panel-care-team .care-team-scope { gap:.375rem; margin:0 0 1.25rem; }
#panel-care-team .care-team-scope button { font-size:.875rem; min-height:44px; padding:.5rem .75rem; }
#panel-care-team .care-category-panel { display:grid; grid-template-columns:minmax(0,1fr); align-items:start; gap:1rem; }
#panel-care-team :is(.care-scope-note,.care-empty-category,.sam-empty-state) { grid-column:1/-1; margin:.25rem 0; }
:root[data-theme] body#sam-app #app-view #panel-care-team .care-experience-provider { display:block; min-width:0; padding:1rem; margin:0; border:1px solid var(--sam-color-border); border-radius:1rem; background:var(--sam-color-surface); }
:root[data-theme] body#sam-app #app-view #panel-care-team .care-provider-identity { display:grid; grid-template-columns:3.5rem minmax(0,1fr); align-items:start; gap:.875rem; padding:0; background:transparent; color:var(--sam-color-text); }
:root[data-theme] body#sam-app #app-view #panel-care-team .care-experience-portrait { float:none; width:3.5rem; height:3.5rem; margin:.15rem 0 0; background:var(--sam-color-trust-soft); color:var(--sam-color-trust-strong); font-size:1rem; }
:root[data-theme] body#sam-app #app-view #panel-care-team .care-provider-identity h3 { color:var(--sam-color-text); font-size:1.125rem; line-height:1.35; letter-spacing:-.015em; overflow-wrap:break-word; hyphens:none; margin:0 0 .3rem; }
:root[data-theme] body#sam-app #app-view #panel-care-team .care-provider-identity p { margin:.25rem 0; color:var(--sam-color-text-secondary); font-size:.875rem; line-height:1.45; }
:root[data-theme] body#sam-app #app-view #panel-care-team .care-provider-identity .care-primary-label { color:var(--sam-color-trust-strong); font-size:.75rem; font-weight:600; margin:0 0 .25rem; }
#panel-care-team .care-profile-details { margin:.75rem 0 0; border-top:1px solid var(--sam-color-border); }
#panel-care-team .care-profile-details > summary { min-height:44px; padding:.75rem 0 .25rem; color:var(--sam-color-trust-strong); font-size:.875rem; font-weight:600; }
:root[data-theme] body#sam-app #app-view #panel-care-team .care-provider-contact { background:transparent; color:var(--sam-color-text); padding:1rem 0 0; }
#panel-care-team .care-office + .care-office { margin-top:1rem; padding-top:1rem; border-top:1px solid var(--sam-color-border); }
#panel-care-team .care-office-label { margin:0 0 .25rem; font-size:.8rem; color:var(--sam-color-text-secondary); }
#panel-care-team .care-office-name { font-size:1rem; line-height:1.4; margin:0 0 .5rem; }
#panel-care-team .care-office-address { font-style:normal; font-size:.875rem; line-height:1.5; margin:0 0 .75rem; }
#panel-care-team .care-office-address span { display:block; }
#panel-care-team .care-office-call { display:flex; align-items:center; gap:.75rem; min-height:44px; box-sizing:border-box; padding:.65rem .875rem; background:var(--sam-color-trust); color:var(--sam-color-on-trust)!important; border-radius:.75rem; text-decoration:none; }
#panel-care-team .care-office-call > svg { width:1.25rem; height:1.25rem; flex:0 0 1.25rem; }
#panel-care-team .care-office-call span span { font-size:.75rem; }
#panel-care-team .care-office-call span span,#panel-care-team .care-office-call strong { display:block; }
#panel-care-team .care-office-call > span { min-width:0; }
#panel-care-team .care-office-call strong { font-size:1rem; line-height:1.4; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
#panel-care-team .care-office-actions { display:flex; flex-wrap:wrap; gap:.5rem; margin-top:.5rem; }
#panel-care-team .care-contact-action { flex:1 1 9rem; min-width:0; display:flex; align-items:center; gap:.5rem; padding:.6rem; min-height:44px; box-sizing:border-box; border:1px solid var(--sam-color-border); border-radius:.65rem; font-size:.875rem; line-height:1.3; text-decoration:none; overflow-wrap:anywhere; }
#panel-care-team .care-contact-action > svg { width:1.25rem; height:1.25rem; flex:0 0 1.25rem; }
#panel-care-team .care-profile-origin { margin:1rem 0 .5rem; font-size:.75rem; line-height:1.5; color:var(--sam-color-text-secondary); }
#panel-care-team .care-provider-evidence { margin-top:.75rem; font-size:.8rem; }
.care-provider-actions { display:flex; flex-wrap:wrap; gap:.5rem; border-top:1px solid var(--sam-color-border); margin-top:1rem; padding-top:.75rem; }
.care-provider-actions p { flex-basis:100%; }
.care-action-feedback:empty { display:none; }
.care-team-notice { display:flex; align-items:center; flex-wrap:wrap; gap:.75rem; padding:.75rem 1rem; margin-bottom:1rem; border:1px solid var(--sam-color-border); border-radius:.75rem; background:var(--sam-color-trust-soft); }
.care-skeleton { display:flex; gap:1rem; padding:1.25rem; margin-bottom:1rem; border:1px solid var(--sam-color-border); border-radius:1rem; }
.care-skeleton span:first-child { width:3.5rem; height:3.5rem; border-radius:50%; background:var(--sam-color-trust-soft); }
.care-skeleton span:last-child { width:60%; height:3rem; border-radius:.5rem; background:var(--sam-color-trust-soft); }
@media(min-width:64rem) { #panel-care-team .care-category-panel { grid-template-columns:repeat(2,minmax(0,1fr)); } }
.medication-difference { border-top:1px solid var(--sam-color-border); padding-top:1rem; margin-block:1rem; }
/* Connections is a first-class SAM screen, outside the legacy record explorer. */
:root[data-theme] body#sam-app #app-view #panel-connections { animation:none; }
:root[data-theme] body#sam-app #app-view #connections-heading:focus { outline:none; box-shadow:none; }
:root[data-theme] body#sam-app #app-view .connections-content { max-width:52rem; margin:auto; color:var(--sam-color-text); font:1rem/1.55 var(--sam-font-sans); }
:root[data-theme] body#sam-app #app-view .connections-content :is(h3,h4) { margin:0 0 .5rem; font:700 1.25rem/1.35 var(--sam-font-heading); color:var(--sam-color-text); word-break:normal; overflow-wrap:break-word; }
.connections-content .connection-person { display:flex; flex-wrap:wrap; align-items:center; gap:.6rem 1rem; padding:0 0 1.5rem; }
.connections-content .connection-person>div { flex-basis:100%; }
.connections-content .connection-person p { margin:.4rem 0; max-width:65ch; }
.connections-content .connection-person-change { display:inline-flex; align-items:center; min-height:44px; margin-left:auto; color:var(--sam-color-trust-strong); text-underline-offset:.2em; }
.fhir-connection-card .connection-remove svg { flex:none; width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
:root[data-theme] body#sam-app #app-view .connections-content .record-section { margin:0 0 2rem; padding:0; border:0; background:none; box-shadow:none; }
:root[data-theme] body#sam-app #app-view .connections-content .record-section-heading { display:block; margin-bottom:1rem; }
:root[data-theme] body#sam-app #app-view .connections-content .record-section-heading p { color:var(--sam-color-text-secondary); margin:.25rem 0 0; text-align:left; max-width:none; }
:root[data-theme] body#sam-app #app-view .connections-content :is(.card,.record-card) { background:var(--sam-color-surface); border:1px solid var(--sam-color-border); border-radius:16px; box-shadow:none; padding:1.25rem; margin:0; min-width:0; }
:root[data-theme] body#sam-app #app-view .connections-content .record-card-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:1rem; }
:root[data-theme] body#sam-app #app-view .connections-content .record-card-heading { display:flex; flex-wrap:wrap; align-items:center; gap:.5rem; }
:root[data-theme] body#sam-app #app-view .connections-content :is(label,input,select,button) { font:inherit; min-width:0; max-width:100%; }
:root[data-theme] body#sam-app #app-view .connections-content label { display:block; }
:root[data-theme] body#sam-app #app-view .connections-content select { display:block; width:100%; min-height:48px; margin:.5rem 0 1rem; padding:.6rem; color:var(--sam-color-text); background:var(--sam-color-surface); border:1px solid var(--sam-color-border-strong); border-radius:12px; }
:root[data-theme] body#sam-app #app-view .connections-content button { min-height:48px; padding:.6rem 1rem; border-radius:12px; }
:root[data-theme] body#sam-app #app-view .connections-content .fhir-connection-card .record-card-heading { display:grid; grid-template-columns:minmax(0,1fr) 48px; align-items:start; }
:root[data-theme] body#sam-app #app-view .connections-content .fhir-connection-card .record-card-heading .record-status { grid-column:1; justify-self:start; }
:root[data-theme] body#sam-app #app-view .connections-content button.connection-remove { display:inline-flex; align-items:center; justify-content:center; grid-column:2; grid-row:1 / span 2; width:48px; min-width:48px; height:48px; padding:10px; }
:root[data-theme] body#sam-app #app-view .connections-content .record-definition-list { display:block; font-size:.9rem; }
:root[data-theme] body#sam-app #app-view .connections-content .record-definition { display:grid; grid-template-columns:minmax(7rem,1fr) minmax(0,1.5fr); gap:.6rem 1rem; margin:.7rem 0; }
.connections-content .record-status { color:var(--sam-color-trust-strong); background:var(--sam-color-trust-soft); border-color:var(--sam-color-border); }
:root[data-theme] body#sam-app #app-view .connections-content button.quiet { color:var(--sam-color-text); background:var(--sam-color-surface); border:1px solid var(--sam-color-border-strong); }
.connections-content .record-definition-list dd { margin:0; overflow-wrap:anywhere; }
.connections-content .record-definition-list dt { color:var(--sam-color-text-secondary); }
:root[data-theme] body#sam-app #app-view .connections-content .item-actions { display:flex; flex-wrap:wrap; gap:.6rem; }
.connections-content .connection-source-review { border-top:1px solid var(--sam-color-border); padding-top:.5rem; }
.connections-content .connection-source-review>summary { cursor:pointer; min-height:48px; display:flex; align-items:center; text-decoration:underline; text-underline-offset:.2em; }
.connections-content .connection-source-review[open]>summary { margin-bottom:1rem; }
.connections-content .connection-outcome { padding:1rem; background:var(--sam-color-trust-soft); border-radius:12px; }
.connections-content .form-message:empty { display:none; }
.health-system-picker { position:relative; margin:0 0 1rem; min-width:0; }
.health-system-label { display:block; margin-bottom:.5rem; }
:root[data-theme] body#sam-app #app-view .health-system-picker .health-system-trigger {
  display:block; width:100%; min-height:52px; padding:.75rem; font:inherit;
  color:var(--sam-color-text); background:var(--sam-color-surface);
  border:1px solid var(--sam-color-border-strong); text-align:left; box-shadow:none;
}
.connection-system-name { display:flex; align-items:center; gap:.75rem; min-width:0; }
.health-system-feedback { margin:.5rem 0 0; font-size:.9rem; }
.health-system-feedback:empty { display:none; }
.health-system-name { flex:1; min-width:0; line-height:1.4; white-space:normal; overflow-wrap:break-word; }
.health-system-mark { display:flex; align-items:center; justify-content:center; flex:0 0 36px; width:36px; height:36px; background:#fff; border-radius:4px; }
.health-system-mark img { display:block; width:36px; height:36px; object-fit:contain; border-radius:4px; }
.health-system-mark[hidden] { display:none; }
.health-system-options {
  position:absolute; z-index:20; top:calc(100% + 6px); left:0; right:0;
  padding:4px; overflow-y:auto; overscroll-behavior:contain; scroll-padding:4px;
  color:var(--sam-color-text); background:var(--sam-color-surface);
  border:1px solid var(--sam-color-border-strong); border-radius:12px;
  box-shadow:0 8px 24px rgb(43 27 48 / .16);
}
.health-system-options[hidden] { display:none; }
.health-system-picker.opens-above .health-system-options { top:auto; }
.health-system-option { display:flex; align-items:center; gap:.75rem; min-height:52px; padding:.65rem .5rem; border:2px solid transparent; border-radius:8px; cursor:pointer; }
.health-system-option[hidden] { display:none; }
.health-system-option:is(:hover,.is-highlighted) { background:var(--sam-color-trust-soft); }
.health-system-option.is-highlighted { border-color:var(--sam-color-trust-strong); }
@media(max-width:430px) {
  :root[data-theme] body#sam-app #app-view .connections-content .item-actions button { width:100%; }
}
:root[data-theme] body#sam-app.sam-ask-reflow #app-view #panel-chat > .ask-composer { position:static; margin:1rem auto; width:100%; border-radius:16px; }
:root[data-theme] body#sam-app.sam-ask-reflow #app-view .ask-composer-controls button { max-width:100%; white-space:normal; }

/* One opaque frame on every signed-in page. Ask voice keeps its own full screen.
   Safe-area space belongs to the header; records never scroll behind its text. */
html:has(body.sam-fixed-shell),body.sam-fixed-shell { height:100%; overflow:hidden; overscroll-behavior:none; }
body.sam-fixed-shell {
  --sam-shell-safe-top:env(safe-area-inset-top,0px);
  --sam-shell-gutter:1.25rem;
  background:var(--sam-aubergine);
}
:root[data-theme] body#sam-app.sam-fixed-shell #app-view { padding-bottom:0; }
:root[data-theme] body#sam-app.sam-fixed-shell #app-view .app-header,
body#sam-family.sam-fixed-shell .family-header {
  position:fixed; z-index:40; inset:0 0 auto; width:100%; max-width:72rem;
  margin:0 auto; box-sizing:border-box; min-height:0;
  padding:calc(.25rem + var(--sam-shell-safe-top)) max(var(--sam-shell-gutter),env(safe-area-inset-right)) .25rem max(var(--sam-shell-gutter),env(safe-area-inset-left));
  background:var(--sam-aubergine); backdrop-filter:none; -webkit-backdrop-filter:none;
}
/* Optical alignment requested by Brad; keep the fixed frame's measured height. */
:root[data-theme] body#sam-app.sam-fixed-shell .app-header :is(.brand-header-logo,#profile-menu-button),
body#sam-family.sam-fixed-shell .family-header .wordmark img,
body#sam-family.sam-fixed-shell .family-header #settings-button { translate:0 -3px; }
:root[data-theme] body#sam-app.sam-fixed-shell #app-view > .sam-heading-frame,
body#sam-family.sam-fixed-shell > .sam-heading-frame {
  position:fixed; z-index:35; inset:var(--sam-shell-header) 0 auto;
  width:100%; max-width:72rem; min-height:0; margin:0 auto; box-sizing:border-box;
  padding:0;
  background:var(--sam-aubergine); color:var(--sam-warm-white);
  border:0; border-radius:0; box-shadow:none; backdrop-filter:none; -webkit-backdrop-filter:none;
}
:root[data-theme] body#sam-app.sam-fixed-shell #app-view .sam-heading-frame > .sam-fixed-heading,
body#sam-family.sam-fixed-shell .sam-heading-frame > .sam-fixed-heading {
  position:static; inset:auto; min-height:0; max-width:none; width:100%; margin:0; box-sizing:border-box;
  padding:0 max(var(--sam-shell-gutter),env(safe-area-inset-right)) .5rem max(var(--sam-shell-gutter),env(safe-area-inset-left));
  color:var(--sam-warm-white); background:var(--sam-aubergine); border:0; border-radius:0; box-shadow:none;
}
:root[data-theme] body#sam-app.sam-fixed-shell #app-view .sam-fixed-heading h2,
body#sam-family.sam-fixed-shell h1.sam-fixed-heading { font:700 1.75rem/1.2 var(--sam-font-heading); letter-spacing:-.025em; }
:root[data-theme] body#sam-app.sam-fixed-shell #app-view .sam-fixed-heading h2 { margin:0; }
:root[data-theme] body#sam-app.sam-fixed-shell #app-view .sam-fixed-heading > p,
:root[data-theme] body#sam-app.sam-fixed-shell #app-view .sam-fixed-heading .eyebrow { display:none; }
:root[data-theme] body#sam-app.sam-fixed-shell #app-view .sam-fixed-heading :is(h2,p) { color:var(--sam-warm-white); }
:root[data-theme] body#sam-app.sam-fixed-shell #app-view :is(#main-content,#primary-more-panel).sam-fixed-scroller,
body#sam-family.sam-fixed-shell #main.sam-fixed-scroller {
  position:fixed; inset:calc(var(--sam-shell-header) + var(--sam-shell-heading)) 0 var(--sam-measured-nav);
  width:100%; max-width:72rem; height:auto; min-height:0; max-height:none;
  margin:0 auto; box-sizing:border-box;
  padding:1rem max(var(--sam-shell-gutter),env(safe-area-inset-right)) 2rem max(var(--sam-shell-gutter),env(safe-area-inset-left));
  overflow-y:auto; overflow-x:hidden; overscroll-behavior-y:contain; scroll-padding:1rem;
  background:var(--sam-color-canvas); border-radius:24px 24px 0 0;
}
/* A transformed ancestor would make fixed titles scroll with its contents. */
:root[data-theme] body#sam-app.sam-fixed-shell #app-view .panel { animation:none; transform:none; filter:none; }
:root[data-theme] body#sam-app.sam-fixed-shell #app-view .sam-heading-frame > .care-category-tabs {
  position:static; inset:auto; margin:0; padding:0 max(var(--sam-shell-gutter),env(safe-area-inset-right)) .5rem max(var(--sam-shell-gutter),env(safe-area-inset-left));
  background:var(--sam-aubergine); color:var(--sam-warm-white); box-sizing:border-box;
}
:root[data-theme] body#sam-app #app-view .sam-heading-frame .care-category-tabs button { border:0; border-radius:0; background:transparent; color:#E6E4EC; }
:root[data-theme] body#sam-app #app-view .sam-heading-frame .care-category-tabs [aria-selected="true"] { color:#F7F4EE; box-shadow:inset 0 -3px #AAA5F4; }
:root[data-theme] body#sam-app.sam-fixed-shell #app-view .app-footer,
body#sam-family.sam-fixed-shell > footer { display:none; }
/* Navigation announces headings without drawing a control outline around text.
   Links, buttons and form controls retain their keyboard focus indicators. */
:root[data-theme] body#sam-app #app-view :is(h1,h2,h3)[tabindex="-1"]:focus,
body#sam-family #workspace :is(h1,h2,h3)[tabindex="-1"]:focus,
body#sam-family .sam-heading-frame :is(h1,h2,h3)[tabindex="-1"]:focus { outline:none; box-shadow:none; }
@media(max-width:360px) { body.sam-fixed-shell { --sam-shell-gutter:1rem; } }
@media(min-width:900px) { body.sam-fixed-shell { --sam-shell-gutter:3rem; } }
/* Large text gets ordinary page scrolling so fixed titles cannot consume the view. */
html:has(body.sam-care-reflow),body.sam-care-reflow { height:auto; overflow:auto; }
:root[data-theme] body#sam-app.sam-care-reflow #app-view :is(.app-header,.sam-heading-frame,#main-content.sam-fixed-scroller) { position:static; inset:auto; height:auto; max-height:none; }
:root[data-theme] body#sam-app.sam-care-reflow #app-view #main-content.sam-fixed-scroller { padding-bottom:calc(var(--sam-measured-nav) + 2rem); }
body#sam-family.sam-care-reflow :is(.family-header,.sam-heading-frame,#main.sam-fixed-scroller) { position:static; inset:auto; height:auto; max-height:none; }
body#sam-family.sam-care-reflow #main.sam-fixed-scroller { padding-bottom:calc(var(--sam-measured-nav) + 2rem); }
body.sam-care-reflow .care-category-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
body.sam-care-reflow .care-category-tabs button { white-space:normal; min-width:0; overflow-wrap:anywhere; }
@media(max-height:500px) {
  :root[data-theme] body#sam-app.sam-fixed-shell #app-view .app-header,
  :root[data-theme] body#sam-app.sam-fixed-shell #app-view:has(#panel-chat:not([hidden])) .app-header,
  body#sam-family.sam-fixed-shell .family-header { padding-top:var(--sam-shell-safe-top); padding-bottom:0; }
  /* This logo is already flush with the safe-area edge in short viewports. */
  body#sam-family.sam-fixed-shell .family-header .wordmark img { translate:none; }
  :root[data-theme] body#sam-app.sam-fixed-shell #app-view .sam-fixed-heading h2,
  body#sam-family.sam-fixed-shell .sam-fixed-heading { font-size:1.5rem; }
}

/* Home prioritizes the selected person's ongoing work, not ingestion setup. */
:root[data-theme] body#sam-app #app-view .home-authority-shell { display:grid; grid-template-columns:minmax(0,1fr); gap:1.5rem; padding:1.25rem; }
:root[data-theme] body#sam-app #app-view .home-welcome h2 { font-size:1.5rem; line-height:1.3; letter-spacing:0; max-width:none; }
:root[data-theme] body#sam-app #app-view .home-welcome p { margin-top:.35rem; max-width:none; }
:root[data-theme] body#sam-app #app-view .home-updates-link { justify-self:end; min-height:44px; display:inline-flex; align-items:center; margin-bottom:0; }
.home-care-links { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,10rem),1fr)); gap:.5rem 1rem; border-block:1px solid var(--sam-color-border); padding-block:.75rem; }
.home-care-links a { display:flex; align-items:center; gap:.6rem; min-width:0; min-height:48px; overflow-wrap:anywhere; color:var(--sam-color-text); text-decoration:none; }
.home-care-links a:hover { text-decoration:underline; text-underline-offset:.2em; }
.home-care-links svg { width:22px; height:22px; flex:0 0 22px; color:var(--sam-color-trust-strong); }
:root[data-theme] body#sam-app #app-view :is(.home-followups,.home-recent) { min-width:0; padding:0; border:0; border-radius:0; box-shadow:none; background:none; }
:root[data-theme] body#sam-app #app-view :is(.home-followups,.home-recent) h3 { margin:0 0 .5rem; font-size:1.2rem; line-height:1.4; letter-spacing:0; }
.home-record-row,.home-followup-row { padding-block:.6rem; border-bottom:1px solid var(--sam-color-border); overflow-wrap:anywhere; }
.home-record-row p,.home-followup-row p { margin:.25rem 0; font-size:.9rem; }
.home-record-row a,.home-followup-row a,.home-followups>a { display:inline-flex; align-items:center; min-height:44px; color:var(--sam-color-text); text-underline-offset:.2em; }
.home-recent>button { margin-top:.5rem; }
@media(min-width:760px) {
  :root[data-theme] body#sam-app #app-view .home-authority-shell { grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:1.5rem 2.5rem; }
  .home-authority-shell>:is(.home-welcome,.home-care-links,.home-updates-link) { grid-column:1 / -1; }
}
