/* Family Ask and Voice keep their existing controls and use the shared kit. */
.family-opening :is(#welcome-view,#login-view) { display:none!important; }
.family-opening body::before { content:"Opening your record…"; display:block; padding:32px; color:var(--sam-color-text); font:400 1rem/1.5 var(--sam-font-sans); }
.family-opening-failed :is(#welcome-view,#login-view,#app-view) { display:none!important; }
#family-opening-error { max-width:640px; margin:32px auto; padding:24px; color:var(--sam-color-text); font:400 1rem/1.5 var(--sam-font-sans); }
#family-opening-error h1 { font-family:var(--sam-font-heading); }
#family-opening-error :is(button,a) { display:inline-flex; align-items:center; min-height:48px; padding:12px 20px; margin:12px 12px 0 0; font:inherit; color:var(--sam-color-text); background:var(--sam-color-surface); border:1px solid var(--sam-color-border-strong); border-radius:var(--sam-radius-control); }
/* Record selection lives in the existing profile menu, not a second header. */
.family-record-choice { display:grid; gap:8px; padding:12px; }
.family-record-choice select { max-width:100%; min-width:0; min-height:44px; font:inherit; }
.family-access-status:empty { display:none; }
.family-access-status { padding:16px; margin:0; color:var(--sam-warm-white); }
.family-tools { border-top:1px solid var(--sam-color-border); padding-top:12px; }
.family-tools summary,.family-tools a { display:flex; align-items:center; min-height:48px; padding:12px 4px; color:var(--sam-color-text); }
.family-tools summary { cursor:pointer; }
.family-tools a { text-underline-offset:.2em; }
.family-voice-controls { display:flex; flex-wrap:wrap; gap:12px; margin-top:16px; }
.family-voice-controls[hidden] { display:none; }
/* Text enlargement remains an explicit preference, not an age-based redesign. */
:root[data-theme] body#sam-app[data-family-text-size="larger"] { --sam-type-body:1.25rem; --sam-type-label:1rem; --sam-type-caption:1rem; }
:root[data-theme] body#sam-app[data-family-text-size="larger"] :is(.ask-messages,.presence-transcript) { font-size:1.25rem; }
:root[data-theme] body#sam-app[data-family-experience] #voice-presence .answer-unit-text { font-size:1rem; }
:root[data-theme] body#sam-app[data-family-experience] :is(.answer-response.is-refusal,.answer-response.is-failed) .answer-state { color:var(--sam-color-warm-strong); }
:root[data-theme] body#sam-app[data-family-experience] :focus-visible { outline:3px solid var(--sam-color-focus); outline-offset:4px; }
:root[data-theme] body#sam-app[data-family-experience] #voice-presence :is(.presence-circle,#presence-retry,.presence-composer) { color:var(--sam-color-text); background:var(--sam-color-surface); border-color:var(--sam-color-border-strong); box-shadow:none; }
:root[data-theme] body#sam-app[data-family-experience] #voice-presence .presence-composer button { color:var(--sam-color-text); }
:root[data-theme] body#sam-app[data-family-experience] #voice-presence #presence-type { color:var(--sam-color-text-secondary); }
:root[data-theme] body#sam-app[data-family-experience] #voice-presence .presence-end { background:var(--sam-aubergine); color:var(--sam-warm-white); border-color:var(--sam-color-border-strong); }
:root[data-theme] body#sam-app[data-family-experience] #voice-presence #presence-mute[aria-pressed="true"] { background:var(--sam-color-trust-soft); border-color:var(--sam-color-trust-strong); }
:root[data-theme] body#sam-app[data-family-experience] #voice-presence :is(input[type="range"],input[type="checkbox"]) { accent-color:var(--sam-color-trust-strong); }
:root[data-theme] body#sam-app[data-family-experience] #voice-presence :is(.presence-interim,.transcript-entry.user,.chat-bubble.user) { border-color:var(--sam-color-border-strong); }
:root[data-theme] body#sam-app[data-family-experience] #voice-presence .presence-sheet { box-shadow:var(--sam-elevation-sheet); }
:root[data-theme] body#sam-app[data-family-experience="senior"] #voice-presence :is(.presence-circle,.presence-utility) { width:56px; height:56px; min-width:56px; min-height:56px; flex-basis:56px; }
.family-presence-logo { display:none; }
:root[data-theme] body#sam-app:not([data-family-experience]) .family-presence-logo { display:none; }
body[data-family-experience] .family-presence-logo { display:block; width:120px; height:auto; }
body[data-family-experience] .family-presence-logo.brand-mark-dark { display:none; }
:root[data-theme="dark"] body[data-family-experience] .family-presence-logo.brand-mark-light { display:none; }
:root[data-theme="dark"] body[data-family-experience] .family-presence-logo.brand-mark-dark { display:block; }
/* Decorative Voice colors come from the kit too. A retry is not clinical urgency. */
body[data-family-experience] #presence-orb .sam-eq-orb,
body[data-family-experience] #presence-orb.sam-eq-orb {
  --orb-color-from:var(--sam-periwinkle); --orb-color-to:var(--sam-apricot);
  --eq-from:var(--sam-periwinkle); --eq-to:var(--sam-apricot);
  --eq-ink:var(--sam-aubergine); --eq-surface-hi:var(--sam-color-surface);
  --eq-surface-lo:var(--sam-color-surface-soft); --eq-rim:var(--sam-color-border-strong);
  --eq-sheen:var(--sam-color-canvas); --eq-vignette:var(--sam-color-backdrop);
  --eq-shadow-tint:var(--sam-color-backdrop); --eq-shadow-tint-active:var(--sam-color-backdrop);
}
body[data-family-experience] #presence-orb .sam-eq-orb[data-state="error"],
body[data-family-experience] #presence-orb.sam-eq-orb[data-state="error"] { --eq-from:var(--sam-apricot); --eq-to:var(--sam-lilac-gray); }
body[data-family-experience] #presence-orb .sam-eq-bar { filter:none; background:linear-gradient(to top,var(--eq-from),var(--eq-to)); }
