/* Visual standard: PRODUCT_VISION.md#visual-design-guideline.
   Notion-inspired typography and surfaces; colors sampled from the user's reference. */
:root {
  font-family: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink); background: var(--surface); font-synthesis: none;
  --ink: #1f1f1d; --muted: #676762;
  --surface: #fff; --paper: #f7f7f5; --quiet-surface: #fafaf9; --surface-hover: #efefec;
  --line: #e7e7e3; --line-strong: #d2d2cd; --control-line: #858580;
  --primary: #0075de; --primary-hover: #005bab; --primary-ink: #005bab;
  --primary-pale: #e8f4fe; --primary-line: #cce4f8;
  --selected: #eaeae7;
  --teal-pale: #bde6e4; --teal-ink: #185e5b;
  --success: #34744e; --success-pale: #e2f1e8; --success-line: #c2dccb;
  --recap-surface: #fff; --recap-line: #e7e7e3; --recap-accent: var(--teal-pale); --recap-ink: var(--ink);
  --lavender: #f0e5fa; --lavender-ink: #68418a;
  --yellow: #fff0cc; --yellow-ink: #72551b;
  --peach: #fde5df; --peach-ink: #914638;
  --amber: #875400; --amber-pale: #fff3d6; --amber-line: #e8d29e;
  --red: #b3261e; --red-pale: #fce8e6; --red-line: #edc6c2;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; -webkit-font-smoothing: antialiased; }
::selection { background: var(--primary-line); color: var(--ink); }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled, button[aria-disabled=true] { opacity: .5; cursor: default; }
a { color: inherit; text-decoration: none; }
button, input, select, summary, a { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--primary-ink); }
h1, h2, h3, p { margin: 0; }
h1:focus, #evidenceTitle:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.icon { display: block; width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.flip { transform: rotate(180deg); }
.turn-up { transform: rotate(-90deg); }
.turn-down { transform: rotate(90deg); }
.skip-link { position: fixed; top: -60px; left: 24px; z-index: 100; background: var(--ink); color: white; padding: 12px 18px; border-radius: 8px; }
.skip-link:focus { top: 12px; }

.sidebar { width: 216px; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; background: var(--paper); border-right: 1px solid var(--line); padding: 32px 16px 24px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 12px; width: fit-content; font-size: 22px; font-weight: 700; letter-spacing: -.8px; }
.brand img { flex-shrink: 0; }
.brand-dot { color: var(--ink); }
.product-nav { display: grid; gap: 4px; margin-top: 36px; }
.product-nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 6px; color: var(--muted); font-size: 14px; transition: background .15s, color .15s; }
.product-nav a:hover { background: var(--surface-hover); color: var(--ink); }
.product-nav a[aria-current] { background: var(--selected); color: var(--ink); font-weight: 600; }
.product-nav .icon { width: 28px; height: 28px; }
.nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 12px; display: grid; place-items: center; font-size: 12px; background: var(--amber-pale); color: var(--amber); }
.sidebar-bottom { margin-top: auto; padding: 18px 14px 0; }
.local-label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.local-label .icon { width: 16px; height: 16px; }
.workspace { margin-left: 216px; min-height: 100svh; background: var(--surface); }
.workspace:focus { outline: 0; }
.page-content { max-width: 1280px; padding: 44px 40px 32px; margin: auto; }
.page-heading { margin-bottom: 28px; }
.status-dot[data-tone=ready] { background: var(--success); }
.status-dot[data-tone=attention] { background: var(--amber); }
.eyebrow { display: block; font-size: 12px; font-weight: 650; letter-spacing: 1px; color: var(--muted); margin-bottom: 12px; }
h1 { font-family: "Segoe UI Variable Display", "Segoe UI", sans-serif; font-size: 40px; font-weight: 720; letter-spacing: -1.4px; line-height: 1.15; text-wrap: balance; overflow-wrap: anywhere; }
.page-description { color: var(--muted); font-size: 15px; line-height: 1.65; margin-top: 10px; max-width: 610px; }
.status-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); flex: 0 0 auto; }

.primary-button, .secondary-button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; border-radius: 6px; font-size: 14px; font-weight: 600; padding: 10px 16px; line-height: 1.4; transition: background .15s, border-color .15s, transform .15s; }
.primary-button { background: var(--primary); color: #fff; border: 1px solid transparent; }
.primary-button:hover:not(:disabled) { background: var(--primary-hover); }
.primary-button:active:not(:disabled) { transform: translateY(1px); }
.primary-button .icon { width: 18px; height: 18px; }
.secondary-button { color: var(--ink); border: 1px solid var(--line-strong); background: var(--surface); }
.secondary-button:hover:not(:disabled) { background: var(--surface-hover); }
.secondary-button .icon { width: 16px; height: 16px; }
.text-button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 5px 0; min-height: 44px; font-size: 13px; color: var(--primary-ink); white-space: nowrap; }
.text-button:hover { color: var(--primary-ink); text-decoration: underline; text-underline-offset: 4px; }
.text-button.danger-text:hover { color: var(--red); }
.text-button .icon { width: 16px; height: 16px; }
.icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; color: var(--muted); background: transparent; border: 0; border-radius: 6px; }
.icon-button:hover:not(:disabled, [aria-disabled=true]) { background: var(--surface-hover); }
.full-width { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.camera-surface { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.camera-heading { position: absolute; z-index: 2; inset: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 28px; min-height: 64px; font-size: 13px; font-weight: 500; color: #fff; background: linear-gradient(#171b23cc, #171b23a6 65%, transparent); }
.camera-heading > span:first-child { display: flex; align-items: center; gap: 8px; min-width: 0; }
.camera-tools > .icon-button { color: #fff; background: #18211d99; backdrop-filter: blur(6px); }
.camera-tools > .icon-button:hover { background: #18211dcc; }
.camera-surface:not(.is-empty) .icon-button:focus-visible { outline-color: #fff; background: #18211de0; }
.camera-tools { position: absolute; z-index: 2; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 6px; }
.camera-state { display: flex; align-items: center; gap: 8px; color: inherit; font-size: 13px; font-weight: 600; }
.camera-state[data-live=true] { color: #fff; }
.camera-state[data-live=true] .status-dot { background: #86dca1; }
.video-wrap { position: relative; aspect-ratio: 16/9; background: #191919; overflow: hidden; }
.preview-loading { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: #e4e8e1; }
.video-wrap video, .video-wrap > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.is-empty > .video-wrap, .live-view-dialog.is-empty .video-wrap { aspect-ratio: auto; min-height: 314px; background: var(--paper); }
.camera-surface.is-empty .camera-heading { position: relative; color: var(--muted); background: transparent; padding-bottom: 12px; }
.camera-surface.is-empty { border: 1px solid var(--line); }
.empty-camera { display: flex; align-items: center; flex-direction: column; text-align: center; padding: 0 24px 30px; }
.home-illustration { width: 220px; height: 157px; display: block; margin: 0 auto 10px; }
.empty-camera h2 { font-size: 23px; font-weight: 600; letter-spacing: -.65px; line-height: 1.3; }
.empty-camera p { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 10px 0 20px; text-wrap: balance; }
.check-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.check-actions:not(:has(> :not([hidden]))) { display: none; }
.live-view-dialog { width: min(1200px, calc(100vw - 32px)); padding: 0; max-height: calc(100dvh - 32px); border-radius: var(--radius); }
.live-view-heading { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; gap: 16px; }
.live-view-heading h2 { font-size: 15px; font-weight: 600; }
.live-view-heading span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.live-view-dialog .video-wrap { width: 100%; max-height: calc(100dvh - 112px); }
.recap-section { min-width: 0; }
.recap-card { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.recap-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.recap-heading .quiet-label { flex: 1; white-space: normal; line-height: 1.6; }
.recap-heading .badge { background: #fff9; }
.recap-icon { display: grid; place-items: center; flex: 0 0 36px; height: 36px; }
.recap-icon .icon { width: 36px; height: 36px; }
.recap-card > h2, .recap-card > h3 { font-size: 24px; font-weight: 650; letter-spacing: -.5px; line-height: 1.35; }
.recap-card > #recapSummary, .recap-card > .recap-summary { font-size: 14px; color: var(--muted); line-height: 1.8; margin-top: 10px; }
.recap-moments { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-top: 20px; }
.recap-moments:empty { display: none; }
.recap-moment { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; padding: 0; background: var(--surface); color: var(--ink); text-align: left; min-width: 0; transition: border-color .15s, background .15s; }
button.recap-moment:hover { border-color: var(--recap-line); background: var(--surface); }
.recap-moment > img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.recap-moment:only-child { flex-direction: row; }
.recap-moment:only-child > img { width: 44%; flex: 0 0 44%; aspect-ratio: 16/10; }
.recap-moment:only-child .recap-moment-copy { align-content: center; }
.recap-moment-copy { display: grid; gap: 5px; padding: 14px; font-size: 14px; line-height: 1.6; }
.recap-moment-copy time { font-size: 12px; color: var(--muted); }
.recap-history { display: grid; gap: 12px; }
.recap-day { min-width: 0; border: 1px solid var(--recap-line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.recap-day-summary { display: grid; grid-template-columns: 40px minmax(0, 1fr) 16px; align-items: center; gap: 16px; padding: 20px; list-style: none; color: var(--recap-ink); }
.recap-day-summary::-webkit-details-marker { display: none; }
.recap-day-summary:hover { background: var(--quiet-surface); }
.recap-day-summary:focus-visible { outline-offset: -4px; }
.recap-day-icon { display: grid; place-items: center; width: 36px; height: 36px; }
.recap-day-icon .icon { width: 36px; height: 36px; }
.recap-day-copy { display: grid; min-width: 0; gap: 5px; }
.recap-day-date { font-size: 16px; font-weight: 600; line-height: 1.4; }
.recap-day-description { color: var(--ink); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.recap-day-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.recap-day-flags > span { padding: 2px 6px; border-radius: 4px; background: var(--paper); font-size: 12px; line-height: 1.5; font-weight: 500; }
.recap-day-warning { color: var(--amber); }
.recap-day-summary > .icon { width: 16px; height: 16px; transform: rotate(90deg); transition: transform .15s; }
.recap-day[open] > .recap-day-summary > .icon { transform: rotate(-90deg); }
.recap-day-body { padding: 20px; background: var(--surface); }
.recap-day-period { color: var(--muted); font-size: 12px; line-height: 1.6; }
.recap-day-body .recap-moments { margin-top: 16px; }
.recap-day-concerns { display: grid; gap: 8px; margin-top: 20px; }
.recap-day-body h3 { font-size: 13px; font-weight: 600; line-height: 1.6; }
.recap-day-concern { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 44px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--quiet-surface); text-align: left; }
button.recap-day-concern:hover { background: var(--paper); }
.recap-day-concern-copy { display: grid; flex: 1; min-width: 0; gap: 3px; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.recap-day-concern-state, .recap-day-unavailable { color: var(--muted); font-size: 12px; }
.recap-day-concern > .icon { width: 16px; height: 16px; color: var(--muted); }
.recap-day-coverage { display: grid; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.recap-day-coverage p { color: var(--muted); font-size: 12px; line-height: 1.7; }
@media (max-width: 450px) {
  .recap-day-summary { grid-template-columns: 36px minmax(0, 1fr) 16px; gap: 12px; padding: 16px; }
  .recap-day-icon { width: 36px; height: 36px; }
  .recap-day-date { font-size: 15px; }
  .recap-day-body { padding: 16px; }
}
.recap-limitations { color: var(--muted); margin-top: 8px; }
.recap-limitations p { font-size: 12px; line-height: 1.7; margin: 0 0 8px; }
.recap-form { margin: 16px 0 4px; }
.recap-form .field-pair { margin-top: 16px; grid-template-columns: minmax(120px, .6fr) minmax(180px, 1fr); }
.recap-form .field-help { margin-bottom: 8px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.section-heading h2 { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 600; letter-spacing: -.3px; }
.round-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; }
.round-icon .icon { width: 40px; height: 40px; }
.alert-panel { background: var(--red-pale); border: 1px solid var(--red-line); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.alert-panel .eyebrow { color: var(--red); }
.alert-panel h2 { font-size: 20px; letter-spacing: -.3px; }
.alert-panel p { font-size: 13px; line-height: 1.7; color: var(--ink); margin: 10px 0 18px; }
.alert-panel .action-help { color: var(--red); font-size: 12px; margin-bottom: 0; }
.global-alert { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--red-pale); border: 1px solid var(--red-line); border-radius: 12px; margin-bottom: 28px; color: var(--red); }
.global-alert > div { flex: 1; min-width: 0; }
.global-alert strong { display: block; font-size: 14px; font-weight: 600; line-height: 1.5; }
.global-alert span { display: block; font-size: 12px; line-height: 1.6; }
.global-alert .text-button { color: var(--red); }
body[data-view=guardian] .global-alert, body[data-view=guardian] .service-notice { display: none; }
.service-notice { color: var(--amber); background: var(--amber-pale); border: 1px solid var(--amber-line); border-radius: 10px; padding: 12px 16px; font-size: 13px; line-height: 1.6; margin-bottom: 24px; }

.activity-view { max-width: 920px; margin-inline: auto; }
.activity-toolbar { position: sticky; top: 0; z-index: 3; padding: 8px 0 12px; margin: -8px 0 16px; background: var(--surface); }
.activity-toolbar .segmented-control button { white-space: nowrap; }
.segmented-control { display: flex; align-items: center; gap: 4px; padding: 0; background: transparent; }
.segmented-control button { display: flex; justify-content: center; align-items: center; gap: 7px; border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 14px; line-height: 1.5; padding: 10px 14px; border-radius: 6px; min-height: 44px; }
.segmented-control button[aria-pressed=true] { background: var(--selected); border-color: var(--selected); color: var(--ink); font-weight: 600; }
.segmented-control button:hover { color: var(--primary-ink); }
.segmented-control button span { display: inline-grid; place-items: center; min-width: 18px; height: 18px; font-size: 11px; padding: 0 4px; color: var(--amber); background: var(--amber-pale); border-radius: 9px; }
.quiet-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.empty-activity { min-height: 240px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 24px; text-align: center; }
.empty-activity-icon { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 18px; }
.empty-activity-icon .icon { width: 64px; height: 64px; }
.empty-activity h2 { font-weight: 600; font-size: 22px; letter-spacing: -.5px; }
.empty-activity p { font-size: 14px; line-height: 1.7; color: var(--muted); max-width: 340px; margin: 10px 0 20px; }
.activity-list { display: grid; gap: 8px; }
.day-label { font-size: 13px; color: var(--muted); font-weight: 500; padding: 0 4px; margin: 8px 0 4px; }
.day-label:not(:first-child) { margin-top: 24px; }
.event-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.event-card[data-tone=attention] { background: var(--amber-pale); }
.event-card[data-tone=alert] { background: var(--red-pale); }
.event-open { display: flex; align-items: stretch; gap: 16px; width: 100%; padding: 16px; border: 0; border-radius: inherit; background: transparent; color: var(--ink); text-align: left; transition: background .15s; }
.event-open:hover { background: #1f1f1f05; }
.event-open:focus-visible { outline-offset: 2px; }
.event-preview { position: relative; display: grid; place-items: center; flex: 0 0 120px; width: 120px; min-height: 116px; overflow: hidden; background: var(--paper); border-radius: 8px; color: var(--muted); }
.event-preview > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.event-copy { display: flex; flex: 1; flex-direction: column; gap: 10px; min-width: 0; }
.event-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.event-meta time { font-variant-numeric: tabular-nums; }
.event-status { margin-left: auto; }
.event-card[data-tone=attention] .event-status { color: var(--amber); }
.event-card[data-tone=alert] .event-status { color: var(--red); }
.event-observation { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; font-size: 15px; line-height: 1.5; }
.event-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; color: var(--primary-ink); font-size: 12px; line-height: 1.5; font-weight: 600; }
.event-action .icon { width: 16px; height: 16px; }
.event-card[data-tone=attention] .event-action { color: var(--amber); }
.event-card[data-tone=alert] .event-action { color: var(--red); }
.event-card.without-image .event-open { padding: 20px; }
.image-count { position: absolute; bottom: 8px; left: 8px; padding: 3px 7px; border-radius: 12px; background: #1b2029de; color: white; font-size: 12px; line-height: 1.4; }
.evidence-meta { font-size: 12px; color: var(--muted); line-height: 1.7; margin-top: 14px; }
.badge { font-size: 12px; border: 1px solid transparent; border-radius: 4px; color: var(--muted); padding: 3px 7px; background: var(--paper); line-height: 1.5; white-space: nowrap; display: inline-block; font-weight: 500; }
.badge[data-tone=attention] { color: var(--amber); background: var(--amber-pale); border-color: var(--amber-line); }
.badge[data-tone=alert] { color: var(--red); background: var(--red-pale); border-color: var(--red-line); }

.setting-icon { display: grid; place-items: center; flex: 0 0 36px; height: 36px; align-self: flex-start; margin-top: 2px; }
.setting-icon .icon { width: 100%; height: 100%; }
.setting-copy { flex: 1; min-width: 0; }
.setting-copy h2, .setting-copy h3 { font-size: 15px; font-weight: 650; line-height: 1.5; letter-spacing: -.2px; }
.setting-copy p { font-size: 14px; color: var(--muted); line-height: 1.65; margin-top: 5px; overflow-wrap: anywhere; }
.setting-copy .setting-help { font-size: 12px; }
.advanced { margin: 16px 0 0; color: var(--muted); }
summary { font-size: 13px; cursor: pointer; min-height: 44px; align-content: center; }
.advanced > summary { display: flex; justify-content: space-between; align-items: center; list-style: none; padding: 10px 0; }
.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary .icon { width: 16px; height: 16px; transition: transform .15s; }
.advanced[open] > summary .icon { transform: rotate(90deg); }
.technical-details { border-left: 2px solid var(--primary-line); padding: 0 0 0 14px; margin-top: 16px; }
.technical-details p { font-size: 12px; line-height: 1.8; margin: 6px 0; overflow-wrap: anywhere; }
.session-setting p { font-size: 13px; line-height: 1.7; margin: 8px 0 14px; }
.technical-details > details { margin-top: 12px; }
pre { font: 10px/1.7 Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 250px; overflow: auto; padding: 15px; background: var(--paper); border-radius: 6px; }
.ptz-grid { display: grid; grid-template-columns: repeat(3, 48px); grid-template-rows: repeat(3, 44px); gap: 5px; margin: 16px 0; }
.ptz-grid button { display: grid; place-items: center; border: 1px solid var(--line); color: var(--primary-ink); background: var(--surface); border-radius: 6px; font-size: 12px; }
.ptz-grid button:first-child { grid-column: 2; }
.ptz-grid button:nth-child(2) { grid-row: 2; }
.ptz-grid button:last-child { grid-column: 2; grid-row: 3; }
.privacy-icon { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; }
.privacy-icon .icon { width: 100%; height: 100%; }

dialog { padding: 32px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: var(--surface); box-shadow: 0 24px 100px #1f1f1d26; max-width: calc(100vw - 32px); max-height: calc(100svh - 32px); }
dialog[open] { animation: dialog-in .18s ease-out; }
dialog::backdrop { background: #1f1f1d66; backdrop-filter: blur(4px); }
.camera-dialog { width: 480px; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.camera-dialog > h2 { font-size: 23px; font-weight: 600; letter-spacing: -.75px; line-height: 1.3; }
.camera-dialog > p:not(.dialog-privacy, .inline-error) { color: var(--muted); font-size: 13px; line-height: 1.8; margin-top: 8px; }
.camera-tabs { margin: 24px 0; }
.camera-tabs button { flex: 1; }
.field { display: block; font-size: 13px; font-weight: 550; color: var(--ink); margin-bottom: 9px; }
input, select { width: 100%; color: var(--ink); border: 1px solid var(--control-line); border-radius: 10px; background: var(--surface); padding: 12px 14px; font-size: 16px; line-height: 1.4; min-height: 48px; transition: border-color .15s, box-shadow .15s; }
input[aria-invalid=true] { border-color: var(--red); }
input::placeholder { color: var(--muted); }
.input-with-action { position: relative; }
.input-with-action input { padding-right: 58px; }
.input-action { position: absolute; right: 2px; top: 2px; bottom: 2px; min-width: 48px; border: 0; border-radius: 8px; background: var(--paper); color: var(--primary-ink); font-size: 12px; padding: 0 10px; }
.field-help { color: var(--muted); font-size: 12px; line-height: 1.8; margin: 12px 0 22px; }
.dialog-privacy { color: var(--muted); display: flex; justify-content: center; align-items: center; gap: 5px; font-size: 12px; margin-top: 23px; }
.dialog-privacy .icon { width: 16px; height: 16px; }
.connected-camera-actions { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 22px; padding-top: 16px; }
.camera-help { color: var(--muted); margin: -12px 0 20px; }
.camera-help summary { color: var(--primary-ink); }
.camera-help p { font-size: 13px; line-height: 1.7; margin: 4px 0 10px; }
.camera-progress { margin-top: 24px; }
.camera-progress ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.camera-progress li { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.step-marker .icon, .delivery-steps .icon { width: 16px; height: 16px; }
.step-marker { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-size: 13px; }
.camera-progress [data-state=current] { color: var(--ink); font-weight: 600; }
.camera-progress [data-state=current] .step-marker { background: var(--primary-pale); border-color: var(--primary-line); color: var(--primary-ink); }
.camera-progress [data-state=done] .step-marker { background: var(--success-pale); border-color: var(--success-line); color: var(--success); }
.camera-progress > p { margin: 24px 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.danger-text { color: var(--red); }
.inline-error { padding: 12px; margin-top: 16px; color: var(--red); background: var(--red-pale); border-radius: 7px; font-size: 12px; line-height: 1.6; }
.evidence-dialog { width: 880px; padding: 20px; }
.evidence-dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin: 5px 5px 18px; }
.evidence-dialog-heading .eyebrow { margin-bottom: 8px; }
.evidence-dialog h2 { font-size: 16px; font-weight: 550; line-height: 1.5; margin-top: 10px; }
.evidence-uncertainty { font-size: 13px; line-height: 1.7; color: var(--muted); margin: 0 5px 18px; }
.evidence-dialog > img { width: 100%; display: block; max-height: 45svh; object-fit: contain; background: #1e261d; border-radius: 8px; }
.evidence-controls { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 14px; }
.evidence-controls > div { display: grid; gap: 4px; font-size: 13px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.evidence-controls time { font-size: 12px; }
.close-concern-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 18px; }
.close-concern-row p { font-size: 13px; line-height: 1.6; color: var(--muted); max-width: 340px; }
.close-concern-row button { flex-shrink: 0; }
.toast { display: flex; align-items: center; gap: 10px; position: fixed; bottom: 28px; left: calc(50% + 108px); transform: translateX(-50%); z-index: 50; padding: 10px 12px 10px 16px; border-radius: 11px; background: var(--ink); color: var(--surface); border: 1px solid var(--ink); box-shadow: 0 8px 35px #23311820; max-width: min(500px, calc(100vw - 32px)); font-size: 12px; line-height: 1.6; }
.toast > .icon { width: 16px; height: 16px; }
.toast .icon-button { color: #d5ddcd; margin-left: 4px; }
.toast .icon-button:hover { background: #ffffff18; }
.toast[data-error=true] { background: var(--red); border-color: var(--red); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }

@media (min-width: 1500px) { .page-content { padding-top: 48px; } }
@media (max-width: 1100px) { .sidebar { width: 184px; padding-left: 12px; padding-right: 12px; } .workspace { margin-left: 184px; } .brand { font-size: 20px; gap: 8px; } .page-content { padding: 40px; } .toast { left: calc(50% + 92px); } }
@media (max-width: 850px) {
  body { --island-clearance: calc(92px + env(safe-area-inset-bottom)); }
  body[data-auth="ready"] { height: 100dvh; overflow: hidden; }
  .sidebar { position: static; width: auto; height: 74px; flex-direction: row; align-items: center; justify-content: space-between; padding: 18px 24px; background: var(--surface); border-right: 0; }
  .brand { padding: 0; font-size: 21px; }
  .brand img { width: 28px; height: 28px; }
  .sidebar-bottom { margin: 0; padding: 0; }
  .local-label { font-size: 12px; }
  .product-nav { display: flex; justify-content: center; gap: 2px; margin: 0; position: fixed; bottom: calc(12px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: min(320px, calc(100% - 32px)); height: 56px; padding: 6px; border-radius: 18px; background: var(--surface); box-shadow: 0 6px 24px #1f1f1d14, 0 1px 4px #1f1f1d0a, inset 0 0 0 1px var(--line); z-index: 30; }
  .product-nav a { position: relative; flex: 1; flex-direction: column; min-width: 0; min-height: 44px; padding: 0 6px; justify-content: center; gap: 2px; font-size: 10.5px; line-height: 12px; border-radius: 12px; }
  .product-nav a[aria-current] { background: var(--selected); color: var(--ink); }
  .nav-count { position: absolute; top: -3px; right: 4px; margin-left: 0; min-width: 18px; height: 18px; padding: 0 4px; font-size: 12px; }
  .workspace { margin-left: 0; min-height: 0; height: calc(100dvh - 74px); overflow-y: auto; overscroll-behavior: contain; scroll-padding-bottom: var(--island-clearance); }
  .page-content { padding: 24px 24px var(--island-clearance); max-width: 730px; }
  .page-heading { margin-bottom: 26px; }
  h1 { font-size: 30px; letter-spacing: -1.1px; }
  .page-description { margin-top: 10px; }
  .camera-surface.is-empty .video-wrap { min-height: 314px; }
  .home-illustration { width: 220px; height: 157px; }
  .empty-camera { padding-bottom: 28px; }
  .empty-camera p { margin: 8px 0 18px; }
  .empty-camera h2 { font-size: 23px; }
  .toast { left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); }
}
@media (max-width: 450px) {
  .sidebar { padding: 18px 20px; }
  .page-content { padding: 20px 16px var(--island-clearance); }
  h1 { font-size: 29px; }
  .home-illustration { width: 210px; height: 150px; }
  .empty-camera { padding: 5px 16px 30px; }
  .empty-camera h2 { font-size: 21px; }
  .camera-surface.is-empty .video-wrap { min-height: 320px; }
  .empty-camera p { max-width: 240px; }
  .setting-icon { flex-basis: 32px; height: 32px; }
  .setting-copy { min-width: 0; }
  .setting-copy h2 { font-size: 14px; }
  .segmented-control button { padding: 9px 10px; }
  .event-open { gap: 12px; padding: 14px; }
  .event-preview { width: 84px; flex-basis: 84px; min-height: 108px; border-radius: 12px; }
  .event-copy { gap: 8px; }
  .event-meta { gap: 2px 8px; }
  .event-status { margin-left: 0; }
  .event-observation { font-size: 14px; }
  .global-alert { flex-wrap: wrap; padding: 14px; gap: 8px; }
  .global-alert > a { margin-left: 28px; }
  .close-concern-row { flex-wrap: wrap; gap: 12px; }
  dialog { padding: 25px; }
  .camera-dialog > h2 { font-size: 21px; }
  .evidence-dialog { padding: 15px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

button[aria-busy=true] { cursor: progress; opacity: .6; }

.setup-guide { margin: 0 0 24px; padding: 20px; background: var(--quiet-surface); border: 1px solid var(--line); border-radius: var(--radius); }
.setup-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; list-style: none; margin: 0 0 16px; padding: 0; color: var(--muted); font-size: 13px; }
.setup-steps li { display: flex; align-items: center; gap: 7px; }
.setup-steps li > span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--paper); font-size: 12px; }
.setup-steps li[aria-current] { color: var(--ink); font-weight: 600; }
.setup-steps li[aria-current] > span { background: var(--teal-pale); color: var(--teal-ink); }
.setup-steps li[data-state=done] > span { background: var(--success-pale); color: var(--success); }
.setup-steps .icon { width: 24px; height: 24px; }
.setup-steps small { font-size: 12px; }
.setup-guide-content { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.setup-guide h2 { font-size: 17px; font-weight: 600; letter-spacing: -.25px; }
.setup-guide p, .setup-next p { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.setup-next { margin-top: 20px; }
.setup-next .button-row { margin-top: 12px; }
.delivery-notice { display: flex; align-items: center; gap: 12px; border: 1px solid var(--primary-line); background: var(--primary-pale); color: var(--primary-ink); padding: 12px 16px; border-radius: 12px; margin: 0 0 26px; font-size: 12px; line-height: 1.6; }
.delivery-notice p { flex: 1; }
.delivery-notice[data-attention=true] { background: var(--amber-pale); border-color: var(--amber-line); color: var(--amber); }
.pet-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(100px, .6fr); align-items: end; gap: 20px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.pet-form .form-save { grid-column: 1 / -1; }
.pet-form label { flex: 1; min-width: 0; }
.pet-form input, .pet-form select, .field-pair input, .field-pair select { margin-top: 7px; }
.pet-form label, .field-pair label { color: var(--muted); font-size: 12px; }
.delivery-dialog { width: 540px; }
.delivery-dialog h2 { font-size: 24px; letter-spacing: -.6px; }
.delivery-dialog .dialog-header { margin-bottom: 10px; }
.delivery-title { display: flex; align-items: center; gap: 12px; }
.delivery-steps { display: flex; gap: 18px; list-style: none; padding: 0; margin: 20px 0; font-size: 12px; color: var(--muted); }
.delivery-steps li { display: flex; align-items: center; gap: 7px; }
.delivery-steps span { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid var(--line); border-radius: 50%; font-size: 12px; }
.delivery-steps [data-state=current], .delivery-steps [data-state=done] { color: var(--primary-ink); font-weight: 600; }
.delivery-steps [data-state=current] span, .delivery-steps [data-state=done] span { background: var(--primary-pale); border-color: var(--primary-line); }
.delivery-form { margin-top: 20px; }
.delivery-form .field { margin-top: 16px; }
.delivery-dialog a { text-decoration: underline; text-underline-offset: 3px; color: var(--primary-ink); }
.compact-help { margin: 7px 0 14px; line-height: 1.6; }
.delivery-help { margin: 6px 0; font-size: 12px; color: var(--muted); }
.delivery-help summary { color: var(--primary-ink); padding: 4px 0; }
.delivery-help ol { padding-left: 20px; margin: 12px 0; line-height: 1.8; }
.delivery-help li + li { margin-top: 8px; }
.delivery-help p { margin: 12px 0; line-height: 1.7; }
.delivery-privacy { margin: 20px 0 16px; padding: 12px 14px; border-radius: 10px; background: var(--primary-pale); color: var(--primary-ink); font-size: 12px; line-height: 1.6; }
.delivery-manage { display: flex; justify-content: space-between; gap: 14px; margin-top: 20px; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.delivery-test-panel { margin-top: 20px; }
.delivery-test-panel h3 { font-size: 15px; }
.delivery-test-panel p { font-size: 13px; line-height: 1.7; color: var(--muted); margin: 10px 0 20px; }
.delivery-test-panel .delivery-destination { padding: 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); overflow-wrap: anywhere; }
.delivery-test-panel .field-help { font-size: 12px; }
.delivery-test-panel [data-error=true] { color: var(--red); }
@media (max-width: 700px) {
  .delivery-notice { flex-wrap: wrap; }
  .delivery-notice > button { margin-left: 32px; }
  .recap-form { margin-left: 0; }
  .recap-moments { grid-template-columns: 1fr; gap: 10px; }
  .recap-moment { flex-direction: row; align-items: stretch; }
  .recap-moment > img { width: 104px; min-height: 88px; aspect-ratio: auto; flex: 0 0 104px; }
  .recap-moment-copy { align-content: center; padding: 10px 12px; }
}
@media (max-width: 450px) {
  .field-pair { grid-template-columns: 1fr; }
  .recap-card { padding: 18px; }
  .recap-card > h2, .recap-card > h3 { font-size: 20px; }
  .recap-heading { gap: 8px; flex-wrap: wrap; }
  .recap-heading .quiet-label { font-size: 12px; }
  .recap-form .field-pair { grid-template-columns: 1fr; }
  .activity-toolbar .segmented-control { width: 100%; }
  .activity-toolbar .segmented-control button { flex: 1; font-size: 12px; padding: 9px 7px; }
}

/* Home: live camera and daily recap, using the shared visual system. */
.home-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; min-height: 124px; }
.home-heading > div { min-width: 0; flex: 1; }
.home-heading h1 { font-size: clamp(32px, 3.2vw, 44px); max-width: 720px; }
.home-date { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 500; margin-bottom: 12px; }
.home-date .icon { width: 17px; height: 17px; color: var(--primary-ink); }
.home-intro { font-size: 15px; line-height: 1.6; color: var(--muted); margin-top: 10px; }
.home-vignette { width: 206px; height: 124px; flex: 0 0 206px; }
/* Inherited properties also reach the reusable SVG <use> instances. */
.companion-cat { display: var(--companion-cat, none); }
.companion-dog { display: var(--companion-dog, none); }
.companion-pet { display: var(--companion-pet, none); }
.companion-smile { display: var(--companion-smile, inline); }
.companion-serious { display: var(--companion-serious, none); }
.companion-eyes { transform: translateX(var(--companion-gaze, 0px)); }
#homeCompanion[data-species=cat] { --companion-cat: inline; }
#homeCompanion[data-species=dog] { --companion-dog: inline; }
#homeCompanion[data-species=pet] { --companion-pet: inline; }
#homeCompanion[data-pose=attention], #homeCompanion[data-pose=offline] { --companion-smile: none; --companion-serious: inline; }
#homeCompanion[data-pose=away] { --companion-gaze: 3px; }
#homeCompanion [data-companion-pose]:not([hidden]) { animation: companion-arrive 180ms ease-out both; }
@keyframes companion-arrive { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  #homeCompanion [data-companion-pose] { animation: none; }
}
.home-grid, .home-journal { display: grid; gap: 24px; align-items: start; }
.home-live { display: grid; gap: 8px; min-width: 0; }
.camera-caption { padding: 0 4px 8px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.camera-caption[data-tone=attention] { color: var(--amber); }
.home-live .delivery-notice { margin: 0; }
#dailyRecap { padding: 24px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); }
#dailyRecap .recap-heading { gap: 10px; margin: -4px 0 20px; }
#dailyRecap .recap-heading h2 { font-size: 13px; font-weight: 600; flex: 1; }
#dailyRecap .recap-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
#dailyRecap h3 { font-size: 24px; font-weight: 650; letter-spacing: -.6px; line-height: 1.25; overflow-wrap: anywhere; }
#dailyRecap .badge { font-size: 12px; padding: 3px 9px; }
#dailyRecap .badge:not([data-tone=attention]) { background: var(--teal-pale); border-color: transparent; color: var(--teal-ink); }
#dailyRecap > #recapSummary { font-size: 14px; line-height: 1.65; margin-top: 12px; color: var(--muted); }
#dailyRecap .recap-moments { grid-template-columns: 1fr; gap: 0; margin-top: 16px; }
#dailyRecap .recap-moment { flex-direction: row; align-items: center; gap: 12px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 14px 0; background: var(--surface); }
#dailyRecap .recap-moment:last-child { border-bottom: 0; }
#dailyRecap button.recap-moment:hover { background: var(--quiet-surface); }
#dailyRecap .recap-moment > img { width: 64px; height: 68px; flex: 0 0 64px; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
#dailyRecap .recap-moment-copy { min-width: 0; padding: 0; font-size: 14px; line-height: 1.55; gap: 4px; }
#dailyRecap button.recap-moment .recap-moment-copy > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; }
#dailyRecap .recap-moment-copy time { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
#dailyRecap .recap-limitations { margin-top: 16px; border-top: 1px solid var(--recap-line); }
#dailyRecap .recap-limitations summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; min-height: 44px; font-size: 12px; list-style: none; color: var(--muted); }
#dailyRecap .recap-limitations summary::-webkit-details-marker { display: none; }
#dailyRecap .recap-limitations summary .icon { width: 16px; height: 16px; transform: rotate(90deg); transition: transform .15s; }
#dailyRecap .recap-limitations[open] summary .icon { transform: rotate(-90deg); }
#dailyRecap .recap-limitations p { padding: 0; margin: 0 0 10px; border: 0; }
.recap-history-link { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin-top: 12px; padding: 10px 0; font-size: 13px; font-weight: 600; color: var(--primary-ink); }
.recap-history-link .icon { width: 16px; height: 16px; }
.recap-history-link:hover { text-decoration: underline; text-underline-offset: 4px; }
@media (min-width: 1200px) {
  .home-grid { grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); }
}
@media (max-width: 850px) {
  .home-heading { min-height: 116px; gap: 16px; margin-bottom: 24px; }
  .home-heading h1 { font-size: 34px; }
  .home-vignette { width: 160px; height: 110px; flex-basis: 160px; }
}
@media (max-width: 600px) {
  .home-heading { gap: 8px; min-height: 100px; }
  .home-heading h1 { font-size: 30px; letter-spacing: -1px; }
  .home-date { font-size: 12px; gap: 6px; }
  .home-date .icon { display: none; }
  .home-intro { font-size: 13px; margin-top: 8px; }
  .home-vignette { width: 104px; height: 96px; flex-basis: 104px; }
  .home-grid, .home-journal { gap: 8px; }
  .camera-heading { padding-left: 16px; padding-right: 16px; font-size: 13px; }
  #dailyRecap { padding: 22px; }
  .live-view-dialog { width: calc(100vw - 20px); }
}
@media (max-width: 380px) {
  .home-vignette { width: 76px; height: 90px; flex-basis: 76px; }
  .home-heading h1 { font-size: 28px; }
  #dailyRecap { padding: 18px; }
}

/* Shared pet identity and form feedback. */
.setting-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.setting-title .badge { font-size: 12px; padding: 1px 6px; }
.badge[data-tone=ready] { color: var(--success); background: var(--success-pale); border-color: var(--success-line); }
.form-save { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 18px; }
.form-save .save-status { margin-right: auto; }
.save-status { font-size: 12px; color: var(--muted); }
.save-status[data-dirty=true] { color: var(--amber); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline-width: 3px; }


/* Settings: stable task navigation and one focused panel. */
[data-view=settings] { max-width: 1040px; }
.settings-heading { margin-bottom: 30px; }
.settings-heading h1 { font-size: 38px; letter-spacing: -1.2px; }
.settings-layout { display: grid; grid-template-columns: 164px minmax(0, 1fr); gap: 40px; align-items: start; }
.settings-nav { display: grid; gap: 5px; position: sticky; top: 24px; }
.settings-nav a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 12px; font-size: 14px; font-weight: 500; color: var(--muted); border-radius: 6px; }
.settings-nav .icon { width: 28px; height: 28px; }
.settings-nav a:hover { color: var(--ink); background: var(--paper); }
.settings-nav a[aria-current] { background: var(--selected); color: var(--ink); font-weight: 600; }
.settings-panels { min-width: 0; }
.settings-panel { padding: 4px 0 0; }
.settings-panel-heading { margin-bottom: 24px; }
.settings-panel-heading h2 { font-size: 24px; font-weight: 650; letter-spacing: -.55px; outline: none; }
.connection-card { display: flex; align-items: center; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.connection-card .setting-icon { flex-basis: 36px; height: 36px; align-self: center; margin: 0; }
.connection-card > button { flex-shrink: 0; }
.connection-card .setting-copy h3 { font-size: 16px; font-weight: 600; }
.connection-card .setting-copy p { font-size: 13px; }
.preference-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 23px 0; border-bottom: 1px solid var(--line); }
.preference-row > button { flex-shrink: 0; }
.preference-row .setting-copy p { line-height: 1.6; }
.preference-row .setting-copy .setting-help { font-size: 12px; margin-top: 7px; }
.setting-copy .dependency-help { font-size: 12px; color: var(--amber); margin-top: 8px; }
.switch-control { display: inline-flex; align-items: center; gap: 9px; flex-shrink: 0; min-height: 44px; padding: 4px 0 4px 6px; border: 0; background: transparent; border-radius: 8px; }
.switch-state { font-size: 12px; color: var(--muted); min-width: 18px; }
.switch-control:not([aria-busy=true]) .switch-state { display: none; }
.switch-track { width: 48px; height: 28px; padding: 3px; border: 1px solid var(--control-line); border-radius: 20px; background: var(--line); display: block; transition: background .16s; }
.switch-track::after { content: ""; width: 20px; height: 20px; display: block; border-radius: 50%; background: var(--muted); transition: transform .16s, background .16s; }
.switch-control[aria-checked=true] .switch-track { background: var(--primary); border-color: var(--primary); }
.switch-control[aria-checked=true] .switch-track::after { transform: translateX(20px); background: #fff; }
.switch-control[aria-checked=true] .switch-state { color: var(--primary-ink); }
.switch-control:disabled { opacity: .45; }
.recap-preference { padding: 24px; margin-top: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.recap-preference > h3 { margin: 0; font-size: 16px; font-weight: 600; color: var(--ink); }
.recap-description { margin-top: 8px; font-size: 13px; line-height: 1.7; color: var(--muted); }
.recap-preference h4 { margin: 0; font-size: 14px; font-weight: 500; }
.recap-preference > .preference-row { align-items: center; border-bottom: 0; padding: 12px 0; }
.recap-schedule { margin-top: 0; border-top: 1px solid var(--recap-line); }
.recap-schedule > summary { min-height: 48px; color: var(--recap-ink); }
.settings-disclosure > .preference-row { padding: 8px 0; border: 0; }
.schedule-editor { padding: 10px 0 0; margin: 0; border: 0; background: transparent; }
.schedule-editor .field-pair { grid-template-columns: minmax(105px, .65fr) minmax(0, 1fr); gap: 12px; }
.schedule-editor .form-save { border-top: 1px solid var(--line); padding-top: 12px; gap: 12px; }
.settings-footnote { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; line-height: 1.7; color: var(--muted); margin-top: 20px; }
.settings-footnote .icon { width: 16px; height: 16px; margin-top: 3px; }
.settings-disclosure { margin-top: 16px; padding: 4px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--quiet-surface); }
.settings-disclosure[open] { padding-bottom: 16px; }
.settings-disclosure > summary { min-height: 48px; color: var(--ink); }
#familyRecoveryMember { margin: 8px 0 12px; }
.setting-explanation { font-size: 13px; color: var(--muted); line-height: 1.8; margin-top: 10px; }
.privacy-callout { display: flex; gap: 16px; align-items: flex-start; background: var(--quiet-surface); padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); }
.privacy-callout h3 { font-size: 16px; color: var(--ink); }
.privacy-callout p, .privacy-section p { font-size: 13px; line-height: 1.7; color: var(--muted); margin-top: 7px; overflow-wrap: anywhere; }
.privacy-section { padding: 24px 0 6px; }
.privacy-section h3 { font-size: 15px; font-weight: 650; }
.retention-list { margin: 12px 0 0; }
.retention-list > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.6; }
.retention-list dt { color: var(--ink); }
.retention-list dd { margin: 0; color: var(--muted); }
@media (max-width: 1000px) {
  .settings-layout { grid-template-columns: 154px minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 850px) {
  .settings-heading { margin-bottom: 20px; }
  .settings-layout { grid-template-columns: 1fr; gap: 22px; }
  .settings-nav { position: relative; top: 0; display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px; scroll-padding-inline: 4px; scrollbar-width: none; }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-nav a { flex: 0 0 auto; min-height: 44px; padding: 10px 14px; font-size: 14px; background: var(--quiet-surface); }
  .settings-nav .icon { display: none; }
}

/* Family access shares the same surfaces and controls as Settings. */
body:not([data-auth="ready"]) > .sidebar,
body:not([data-auth="ready"]) > .workspace,
body:not([data-auth="ready"]) > .skip-link,
body[data-auth="ready"] > .sign-in-page,
body[data-role="family"] [data-owner-only] { display: none !important; }
.sign-in-page { min-height: 100dvh; display: grid; justify-items: center; align-content: center; gap: 28px; padding: 40px 20px; background: var(--paper); }
.sign-in-card { width: min(100%, 440px); background: var(--surface); padding: 36px; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 32px #1f1f1d06; }
.sign-in-card h1 { margin: 24px 0 10px; font-size: 30px; line-height: 1.15; letter-spacing: -1px; }
.sign-in-card > p, .sign-in-footer { font-size: 14px; line-height: 1.7; color: var(--muted); overflow-wrap: anywhere; }
.sign-in-card form { display: grid; gap: 18px; margin: 24px 0 18px; }
.sign-in-card label, .family-invite-form label { display: grid; gap: 8px; font-size: 13px; font-weight: 600; min-width: 0; }
.sign-in-card input, .family-invite-form input { width: 100%; min-height: 46px; }
.sign-in-card .remember-device { display: flex; align-items: center; font-weight: 400; line-height: 1.5; }
.sign-in-card .remember-device input { width: 18px; height: 18px; min-height: 0; accent-color: var(--primary-ink); flex-shrink: 0; }
#signInCode { font-size: 24px; font-variant-numeric: tabular-nums; letter-spacing: 5px; text-align: center; }
.sign-in-card > button { margin-top: 12px; }
.sign-in-card > #signInPortal { margin-top: 24px; }
.sign-in-card .text-button { white-space: normal; text-align: left; }
.sign-in-card .sign-in-privacy { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 24px; display: flex; align-items: center; gap: 8px; font-size: 12px; }
.sign-in-footer { text-align: center; font-size: 12px; }
.family-home { display: flex; align-items: center; gap: 16px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.family-home > div { min-width: 0; flex: 1; }
.family-home h3 { font-size: 20px; font-weight: 650; letter-spacing: -.4px; color: var(--ink); overflow-wrap: anywhere; }
.family-home p { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.family-symbol { display: grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; }
.family-symbol .icon { width: 36px; height: 36px; }
.family-section { padding: 26px 0; border-bottom: 1px solid var(--line); }
.family-section h3 { font-size: 15px; }
.family-section p { font-size: 13px; line-height: 1.7; color: var(--muted); margin: 8px 0 14px; }
.family-section .section-heading { margin-bottom: 0; gap: 12px; flex-wrap: wrap; }
.install-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.install-heading img { flex-shrink: 0; border-radius: 14px; }
.install-heading p { margin: 4px 0 0; }
.family-list { margin: 14px 0 0; padding: 0; list-style: none; }
.family-list li { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.family-list li:last-child { border-bottom: none; }
.family-list li > div { flex: 1; min-width: 0; }
.family-list strong { display: block; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.family-list span { display: block; font-size: 12px; color: var(--muted); line-height: 1.6; margin-top: 4px; overflow-wrap: anywhere; }
.family-list button { font-size: 13px; flex-shrink: 0; min-height: 44px; }
.family-invite-form { display: flex; align-items: end; gap: 12px; margin-top: 18px; }
.family-invite-form label { flex: 1; }
.family-invite-form button { min-height: 46px; }
.family-passkey { display: flex; align-items: center; gap: 16px; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; margin-top: 18px; }
.family-passkey h4 { font-size: 14px; }
.family-passkey p { margin-bottom: 0; }
.family-passkey button { flex-shrink: 0; }
.family-address { display: inline-block; overflow-wrap: anywhere; font-size: 14px; color: var(--primary-ink); text-decoration: underline; text-underline-offset: 3px; }
.remote-access .section-heading { align-items: center; }
.remote-access .badge[data-connected=true] { color: var(--success); background: var(--success-pale); }
.connection-code-form { margin-top: 20px; max-width: 430px; }
.connection-code-form > label { font-size: 13px; font-weight: 600; }
.connection-code-form input { width: 185px; min-height: 46px; letter-spacing: 4px; font-size: 20px; font-variant-numeric: tabular-nums; }
.phone-pairing { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 24px; align-items: center; margin-top: 20px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--quiet-surface); }
.phone-pairing img { width: 168px; height: 168px; border-radius: 8px; }
.phone-pairing h4 { margin: 0; font-size: 17px; letter-spacing: -.3px; }
.phone-pairing .family-address { display: block; font-size: 12px; }
.phone-pairing .text-button { padding-left: 0; margin-top: 8px; }
.remote-footnote { display: flex; align-items: flex-start; gap: 8px; margin-top: 20px !important; font-size: 12px !important; }
.remote-footnote .icon { width: 16px; height: 16px; margin-top: 2px; }
@media (max-width: 600px) {
  .phone-pairing { grid-template-columns: 1fr; gap: 16px; padding: 20px; }
  .phone-pairing img { justify-self: center; }
}
.family-confirm { width: min(440px, calc(100% - 32px)); padding: 28px; }
.family-confirm h2 { font-size: 22px; }
.family-confirm p { margin: 14px 0 24px; color: var(--muted); line-height: 1.7; overflow-wrap: anywhere; }
@media (max-width: 850px) {
  body[data-role="family"] .settings-nav a { flex: 1; justify-content: center; }
}
@media (max-width: 600px) {
  .family-invite-form, .family-passkey { flex-direction: column; align-items: stretch; }
  .family-home { gap: 12px; flex-wrap: wrap; padding: 20px; }
  .family-home .badge { margin-left: 48px; }
  .family-list li { gap: 10px; flex-wrap: wrap; }
  .family-list li > div { flex-basis: 100%; }
  .sign-in-card { padding: 26px 22px; }
}
@media (max-width: 450px) {
  .settings-heading h1 { font-size: 29px; }
  .settings-panel-heading h2 { font-size: 21px; }
  .settings-panel-heading { margin-bottom: 20px; }
  .connection-card { padding: 20px; gap: 12px; flex-wrap: wrap; }
  .connection-card > button { margin-left: 48px; }
  .connection-card .setting-copy { flex-basis: calc(100% - 48px); }
  .preference-row { gap: 12px; }
  .switch-control { gap: 5px; }
  .recap-preference, .privacy-callout, .pet-form { padding: 20px; }
  .schedule-editor .field-pair { grid-template-columns: 1fr; }
  .schedule-editor .form-save .save-status { flex-basis: 100%; }
  .schedule-editor .form-save > button:last-child { margin-left: auto; }
  .pet-form { grid-template-columns: 1fr; }
  .retention-list > div { grid-template-columns: 1fr; gap: 4px; }
}

/* Family Moments: photo-led white cards, fine outlines and small pastel labels. */
.moments-view { max-width: 1040px; margin: auto; }
.moments-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.moments-heading > .icon-button { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.moments-heading > .icon-button:hover { background: var(--paper); }
.moments-heading .eyebrow { display: inline-block; color: var(--lavender-ink); background: var(--lavender); padding: 4px 7px; border-radius: 6px; font-size: 11px; letter-spacing: .3px; }
.moments-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0 22px; }
.moments-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.moments-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); flex: 0 0 auto; }
.moments-status[data-enabled=true]::before { background: var(--success); }
.moments-toolbar .secondary-button { flex-shrink: 0; }
.moments-empty { display: flex; align-items: center; flex-direction: column; text-align: center; background: var(--quiet-surface); border: 1px solid var(--line); border-radius: 12px; padding: 44px 28px; }
.moments-empty h2 { font-size: 26px; font-weight: 650; letter-spacing: -.65px; }
.moments-empty > p { max-width: 370px; color: var(--muted); font-size: 14px; line-height: 1.8; margin: 12px 0 24px; }
.moment-illustration { position: relative; width: 235px; height: 165px; margin: 0 0 26px; }
.moment-paper { position: absolute; background: var(--surface); padding: 11px; border: 1.5px solid var(--ink); border-radius: 6px; }
.moment-paper .icon { width: 100%; height: 85px; padding: 8px; }
.moment-paper.back { transform: rotate(-14deg); left: 18px; top: 0; width: 132px; height: 143px; }
.moment-paper.front { transform: rotate(9deg); right: 5px; top: 20px; width: 145px; height: 141px; }
.moment-paper span { display: block; color: var(--muted); font-size: 10px; margin-top: 10px; }
.moment-spark { position: absolute; color: var(--ink); right: 3px; top: -5px; width: 24px; height: 24px; }
.moments-footnote { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); max-width: 640px; font-size: 12px; line-height: 1.7; margin: 26px 0 8px; }
.moments-footnote .icon { width: 16px; height: 16px; margin-top: 3px; }
.moment-day { margin: 16px 0 36px; }
.moment-day-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.moment-day-heading h2 { font-size: 23px; font-weight: 650; letter-spacing: -.5px; }
.moment-day-heading p { font-size: 12px; color: var(--muted); margin-top: 5px; }
.story-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--primary); background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 6px; min-height: 44px; font-size: 13px; font-weight: 600; transition: background .15s, border-color .15s; }
.story-button:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.moment-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.moment-card { padding: 0; text-align: left; color: var(--ink); border: 1px solid var(--line); background: var(--surface); border-radius: 10px; overflow: hidden; transition: border-color .15s; }
.moment-card:hover { border-color: var(--line-strong); }
.moment-photo { position: relative; aspect-ratio: 16 / 11; background: var(--paper); border-bottom: 1px solid var(--line); }
.moment-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.moment-photo-unavailable { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.moment-card-caption { display: block; padding: 14px; }
.moment-card-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.moment-card-meta time { font-size: 11px; color: var(--muted); }
.moment-tag { display: inline-block; font-size: 11px; font-weight: 500; background: var(--paper); color: var(--muted); padding: 3px 7px; border-radius: 6px; }
.moment-tag[data-category=pet_time], .moment-tag[data-category=play] { background: var(--success-pale); color: var(--success); }
.moment-tag[data-category=meal] { background: var(--peach); color: var(--peach-ink); }
.moment-tag[data-category=together] { background: var(--lavender); color: var(--lavender-ink); }
.moment-tag[data-category=celebration] { background: var(--yellow); color: var(--yellow-ink); }
.moment-card-text { display: block; margin-top: 12px; font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.moment-undo { display: flex; align-items: center; gap: 16px; background: var(--quiet-surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 16px; font-size: 13px; margin-bottom: 16px; }
.moment-preferences { width: 470px; }
.moment-preferences h2 { font-weight: 650; font-size: 23px; letter-spacing: -.5px; }
.moment-preferences .dialog-header { margin-bottom: 12px; gap: 8px; }
.moment-preferences .page-description { font-size: 14px; }
.moment-preferences .preference-row { margin: 10px 0 24px; align-items: center; }
.moment-preferences .preference-row h3 { font-size: 14px; font-weight: 600; }
.moment-preferences .preference-row p { color: var(--muted); font-size: 13px; line-height: 1.6; margin-top: 7px; }
.moment-preferences select { width: 100%; }
.moment-preferences > .primary-button { margin-top: 20px; width: 100%; }
.moment-story { width: 780px; padding: 24px; }
.moment-story-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.moment-story-heading .eyebrow { margin-bottom: 6px; font-size: 11px; letter-spacing: .5px; }
.moment-story-heading h2 { font-weight: 650; font-size: 23px; letter-spacing: -.5px; }
.moment-story > img { width: 100%; max-height: 48dvh; object-fit: contain; aspect-ratio: 16 / 9; background: var(--quiet-surface); border: 1px solid var(--line); border-radius: 10px; display: block; }
.moment-progress { display: flex; gap: 5px; margin-bottom: 14px; }
.moment-progress span { flex: 1; height: 3px; background: var(--line); border-radius: 5px; }
.moment-progress .seen { background: var(--primary); }
.moment-story-caption { padding-top: 20px; }
.moment-story-caption p { font-size: 20px; font-weight: 500; line-height: 1.5; margin: 10px 0 6px; overflow-wrap: anywhere; }
.moment-story-caption time { font-size: 12px; color: var(--muted); }
.moment-story-controls { display: flex; align-items: center; justify-content: center; gap: 16px; padding-top: 16px; }
.moment-story-controls > span { color: var(--muted); font-size: 12px; }
.moment-story-controls .text-button { margin-left: auto; }
@media (max-width: 1000px) { .moment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .moments-heading { margin-bottom: 16px; }
  .moments-toolbar { flex-wrap: wrap; gap: 12px; }
  .moments-toolbar .secondary-button { padding: 10px 14px; }
  .moments-empty { padding: 30px 22px; }
  .moments-empty h2 { font-size: 23px; }
  .moment-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .moment-photo { aspect-ratio: 16 / 10; }
  .moment-day-heading { align-items: flex-start; flex-wrap: wrap; }
  .moment-day-heading h2 { font-size: 21px; }
  .story-button { font-size: 12px; padding: 10px 12px; }
  .moment-story { padding: 18px; }
  .moment-story-heading h2 { font-size: 20px; }
  .moment-story-caption p { font-size: 17px; }
  .moment-story-controls { gap: 10px; }
}
.camera-picker select { max-width: 240px; min-height: 36px; border: 0; background: transparent; color: inherit; padding: 4px 26px 4px 8px; font: inherit; font-weight: 600; }
.camera-picker select:disabled { opacity: 1; appearance: none; padding-right: 8px; }
.camera-picker select option { color: #242424; background: white; }
.camera-devices { margin: 8px 0 20px; }
.camera-device { display: flex; align-items: center; gap: 14px; padding: 20px 0; border-bottom: 1px solid var(--line, #e9e9e7); }
.camera-device-symbol { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: #287f7b; background: #e8f5f2; flex: 0 0 auto; }
.camera-device .setting-copy { min-width: 0; flex: 1; }
.camera-device h3 { margin: 0 0 4px; font-size: 15px; overflow-wrap: anywhere; }
.camera-device p { margin: 0; font-size: 13px; color: #74746e; }
.camera-device-controls { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.camera-device-controls button { min-height: 36px; padding: 4px; font-size: 13px; }
.camera-device-controls button:last-child { color: #78756f; }
.camera-empty { padding: 20px 0; max-width: 42ch; color: #74746e; font-size: 14px; line-height: 1.6; }
#cameraName { margin-bottom: 16px; }
@media (max-width: 600px) {
  .camera-device { flex-wrap: wrap; gap: 10px 12px; }
  .camera-device-controls { width: 100%; padding-left: 54px; gap: 4px 18px; }
  .camera-picker select { max-width: 190px; }
}
