:root {
  --page: #f8f9fa;
  --surface: #ffffff;
  --surface-subtle: #f2f4f5;
  --ink: #121416;
  --muted: #6f757b;
  --faint: #9ba1a6;
  --line: #e3e6e8;
  --line-strong: #d2d6d9;
  --accent: #159b62;
  --accent-soft: #eaf7f0;
  --danger: #c8493d;
  --warning: #b97919;
  --blue: #3977ad;
  --radius: 8px;
  --shadow: 0 16px 44px rgba(18, 20, 22, 0.1);
}

* { box-sizing: border-box; }
html { background: var(--page); }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--page);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button { color: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(21, 155, 98, 0.18);
  outline-offset: 2px;
}
[hidden] { display: none !important; }
.visually-hidden { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.app-shell { min-height: 100vh; padding-bottom: 86px; }
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}
.identity-button { display: flex; align-items: center; gap: 10px; border: 0; padding: 0; background: transparent; text-align: left; cursor: pointer; }
.identity-button strong { display: block; font-size: 14px; font-weight: 700; }
.identity-button small, .account-card small { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  color: white;
  background: var(--accent);
  font-size: 13px;
  font-weight: 800;
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
  font-weight: 600;
}
.privacy-badge svg { width: 13px; color: var(--accent); }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid transparent; border-radius: 7px; background: transparent; cursor: pointer; }
.icon-button:hover { border-color: var(--line); background: var(--surface-subtle); }
.icon-button svg { width: 17px; }

main { width: min(1160px, 100%); margin: 0 auto; padding: 38px clamp(18px, 4vw, 48px) 60px; }
.view { display: none; }
.view.active { display: block; animation: viewIn 160ms ease-out; }
@keyframes viewIn { from { opacity: 0; transform: translateY(3px); } }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading h1 { margin: 5px 0 0; font-size: clamp(29px, 4vw, 38px); line-height: 1.08; font-weight: 680; }
.compact-heading h1 { font-size: clamp(28px, 4vw, 36px); }
.eyebrow { margin: 0; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
h2 { margin: 3px 0 0; font-size: 17px; font-weight: 680; }
p { line-height: 1.5; }
.count-pill, .local-label {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
  font-weight: 600;
}

.capture-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.me-setup {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 12px;
  margin: -8px 0 18px;
  padding: 12px;
  border: 1px solid #cfe8dc;
  border-radius: var(--radius);
  background: #f4fbf7;
}
.me-setup-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 7px; color: var(--accent); background: white; }
.me-setup-icon svg { width: 18px; }
.me-setup strong { display: block; font-size: 12px; }
.me-setup p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.capture-action {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 82px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color 130ms ease, background 130ms ease, transform 130ms ease;
}
.capture-action:hover { transform: translateY(-1px); border-color: var(--line-strong); background: #fbfcfc; }
.capture-action.primary { color: white; border-color: var(--ink); background: var(--ink); }
.capture-action svg { flex: 0 0 auto; width: 21px; }
.capture-action strong, .capture-action small { display: block; }
.capture-action strong { font-size: 13px; font-weight: 700; }
.capture-action small { margin-top: 3px; color: inherit; opacity: 0.65; font-size: 11px; }

.section-block { margin-top: 36px; }
.section-header { display: flex; align-items: end; justify-content: space-between; margin-bottom: 12px; }
.text-button { border: 0; padding: 4px; color: var(--accent); background: transparent; font-size: 12px; font-weight: 650; cursor: pointer; }
.text-button:hover { color: #0e7147; }
.moment-list { display: grid; gap: 7px; }
.empty-card { display: grid; place-items: center; min-height: 180px; padding: 26px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); text-align: center; }
.empty-card svg { width: 28px; margin-bottom: 9px; color: var(--faint); }
.empty-card strong { color: var(--ink); font-size: 13px; }
.empty-card p { max-width: 360px; margin: 5px 0 0; font-size: 12px; }
.moment-row { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 13px; min-height: 72px; padding: 7px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.moment-row:hover { border-color: var(--line-strong); }
.moment-thumb { display: grid; place-items: center; width: 58px; height: 56px; overflow: hidden; border: 0; border-radius: 6px; color: var(--muted); background: var(--surface-subtle); cursor: pointer; }
.moment-thumb img { width: 100%; height: 100%; object-fit: cover; }
.moment-thumb svg { width: 19px; }
.moment-row strong, .moment-row small { display: block; }
.moment-row strong { font-size: 13px; }
.moment-row small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.moment-people { display: flex; padding-right: 10px; }
.mini-avatar { display: grid; place-items: center; width: 27px; height: 27px; margin-left: -4px; border: 2px solid white; border-radius: 50%; color: white; background: var(--blue); font-size: 9px; font-weight: 750; }

.review-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(270px, 0.68fr); gap: 12px; }
.media-workbench, .review-panel, .identity-editor { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.media-stage { position: relative; display: grid; place-items: center; min-height: 445px; overflow: hidden; border-radius: 7px 7px 0 0; background: #16181a; }
.media-stage.empty { background: var(--surface-subtle); }
.media-stage > img, .media-stage > video { display: none; width: 100%; max-height: 610px; object-fit: contain; }
.media-stage.image-mode > img, .media-stage.video-mode > video { display: block; }
.media-empty { display: grid; place-items: center; color: var(--muted); text-align: center; }
.media-empty svg { width: 35px; margin-bottom: 10px; color: var(--faint); }
.media-empty strong, .media-empty span { display: block; }
.media-empty strong { font-size: 13px; }
.media-empty span { margin-top: 4px; font-size: 11px; }
.appearance-layer { position: absolute; inset: 0; pointer-events: none; }
.face-box { position: absolute; display: grid; place-items: start; border: 2px solid #36c982; border-radius: 5px; box-shadow: 0 0 0 1px rgba(0,0,0,.2); background: transparent; pointer-events: auto; cursor: pointer; }
.face-box.selected { border-color: #f1c04b; }
.face-box span { transform: translateY(-100%); padding: 3px 5px; border-radius: 3px 3px 0 0; color: #0d2017; background: #36c982; font-size: 9px; font-weight: 700; white-space: nowrap; }
.face-box.selected span { background: #f1c04b; }
.workbench-status { display: flex; align-items: center; justify-content: space-between; min-height: 43px; padding: 7px 11px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.workbench-status span { display: flex; align-items: center; gap: 6px; }
.workbench-status svg { width: 13px; }
.review-panel { min-height: 489px; padding: 14px; }
.review-panel-head { display: flex; justify-content: space-between; align-items: start; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.local-label { min-height: 22px; padding: 2px 7px; font-size: 9px; }
.appearance-list { display: grid; gap: 6px; margin-top: 10px; }
.appearance-card { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 9px; width: 100%; padding: 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; text-align: left; cursor: pointer; }
.appearance-card:hover { background: var(--surface-subtle); }
.appearance-card.active { border-color: #bde6d1; background: var(--accent-soft); }
.appearance-card strong, .appearance-card small { display: block; }
.appearance-card strong { font-size: 12px; }
.appearance-card small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.person-avatar { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 7px; color: white; background: var(--blue); font-size: 12px; font-weight: 750; }
.appearance-card .person-avatar { width: 34px; height: 34px; }
.state-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warning); }
.state-dot.connected { background: var(--accent); }
.identity-editor { margin-top: 12px; padding: 17px; }
.editor-summary { display: flex; align-items: center; gap: 11px; }
.editor-summary h2 { margin: 1px 0; font-size: 16px; }
.editor-summary p:last-child { margin: 0; color: var(--muted); font-size: 11px; }
.editor-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 16px; }
label { color: #4d5358; font-size: 11px; font-weight: 650; }
label.wide { grid-column: 1 / -1; }
input, textarea, select { width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); background: white; }
input, select { height: 39px; padding: 0 10px; }
textarea { padding: 10px; resize: vertical; }
input:hover, textarea:hover, select:hover { border-color: #bbc0c4; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
label > input, label > textarea, label > .search-row { margin-top: 5px; }
label small { display: block; margin-top: 5px; color: var(--muted); font-weight: 400; }
input:disabled { color: #92979c; background: var(--surface-subtle); }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.editor-actions, .modal-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 14px; }
.primary-button, .secondary-button, .danger-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 7px 13px; border-radius: 6px; font-size: 11px; font-weight: 700; cursor: pointer; }
.primary-button { color: white; border: 1px solid var(--ink); background: var(--ink); }
.primary-button:hover { background: #292c2f; }
.secondary-button { border: 1px solid var(--line-strong); background: white; }
.secondary-button:hover { background: var(--surface-subtle); }
.danger-button { color: var(--danger); border: 1px solid #efc7c3; background: white; }
.primary-button svg, .secondary-button svg, .danger-button svg { width: 14px; }
button:disabled { opacity: 0.42; cursor: not-allowed; }
.search-results { display: grid; gap: 6px; margin-top: 10px; }
.search-result { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 9px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; }
.search-result strong, .search-result small { display: block; }
.search-result small { color: var(--muted); }

.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.segmented button { min-height: 30px; padding-inline: 10px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 650; cursor: pointer; }
.segmented button.active { color: var(--ink); background: var(--surface-subtle); }
.people-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.person-card { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.person-card:hover { border-color: var(--line-strong); }
.person-card-head { display: flex; align-items: center; gap: 9px; }
.person-card h2 { margin: 0; font-size: 14px; }
.person-card p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.person-meta { display: flex; justify-content: space-between; margin-top: 15px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.status-tag { color: var(--warning); font-weight: 700; }
.status-tag.connected { color: var(--accent); }

.settings-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 42px; }
.settings-section { padding-top: 18px; border-top: 1px solid var(--ink); }
.settings-title { display: flex; gap: 11px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.settings-title > svg { width: 19px; color: var(--accent); }
.settings-title h2, .settings-title p { margin: 0; }
.settings-title p { margin-top: 3px; color: var(--muted); font-size: 11px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.setting-row span { max-width: 72%; }
.setting-row strong, .setting-row small { display: block; }
.setting-row strong { font-size: 12px; }
.setting-row small { margin-top: 3px; color: var(--muted); font-weight: 400; }
.setting-row select { width: auto; }
.setting-row input[type="checkbox"] { width: 36px; height: 19px; accent-color: var(--accent); }
.settings-section > .danger-button { margin-top: 16px; }
.account-card { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 9px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.settings-subtitle { display: flex; gap: 11px; margin-top: 24px; padding: 15px 0 12px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.settings-subtitle > svg { width: 18px; color: var(--accent); }
.settings-subtitle h3, .settings-subtitle p { margin: 0; }
.settings-subtitle h3 { font-size: 13px; }
.settings-subtitle p { margin-top: 3px; color: var(--muted); font-size: 11px; }
.me-card-details { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; }
.me-card-details:empty { display: none; }
.me-card-details span { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 5px 7px; border-radius: 5px; color: #4f565b; background: var(--surface-subtle); font-size: 10px; overflow-wrap: anywhere; }
.me-card-details svg { flex: 0 0 auto; width: 12px; }
.principles { margin-top: 14px; }
.principles p { display: flex; align-items: center; gap: 8px; margin: 9px 0; color: #464b50; font-size: 11px; }
.principles svg { width: 14px; color: var(--accent); }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 25;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(430px, calc(100% - 24px));
  padding: 4px;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 12px 34px rgba(18,20,22,.1);
  backdrop-filter: blur(18px);
}
.bottom-nav button { display: grid; place-items: center; gap: 2px; min-height: 47px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 9px; font-weight: 650; cursor: pointer; }
.bottom-nav button:hover { color: var(--ink); background: var(--surface-subtle); }
.bottom-nav button.active { color: var(--accent); background: var(--accent-soft); }
.bottom-nav svg { width: 17px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 18px; background: rgba(12, 14, 15, 0.48); }
.modal { width: min(460px, 100%); max-height: calc(100vh - 36px); overflow: auto; padding: 19px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.modal-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: 16px; }
.modal-head h2 { margin-top: 2px; }
.modal label { display: block; margin-top: 12px; }
.me-modal { width: min(560px, 100%); }
.profile-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.profile-form-grid .wide { grid-column: 1 / -1; }
.profile-form-grid label > small { color: var(--faint); font-weight: 400; }
.share-setting { display: flex !important; align-items: flex-start; gap: 9px; margin-top: 16px !important; padding: 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-subtle); }
.share-setting input { flex: 0 0 auto; width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--accent); }
.share-setting strong, .share-setting small { display: block; }
.share-setting small { margin-top: 2px; color: var(--muted); font-weight: 400; }
.modal-copy { margin: 0; padding: 11px; border-left: 2px solid var(--warning); color: var(--muted); background: #fffaf2; font-size: 11px; }
.voice-button { display: flex; align-items: center; gap: 7px; width: 100%; min-height: 39px; margin-top: 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-subtle); cursor: pointer; }
.voice-button svg { width: 15px; }
.voice-button.listening { color: white; border-color: var(--danger); background: var(--danger); }
.consent-check { display: flex !important; align-items: start; gap: 8px; padding: 11px; border: 1px solid #ead5a8; border-radius: 6px; background: #fffaf2; }
.consent-check input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--accent); }
.connect-options { display: grid; gap: 6px; margin-top: 14px; }
.connect-options button { display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 9px; min-height: 54px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: white; text-align: left; cursor: pointer; }
.connect-options button:hover { background: var(--surface-subtle); }
.connect-options svg { width: 18px; }
.connect-options strong, .connect-options small { display: block; }
.connect-options small { margin-top: 2px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 78px; z-index: 80; max-width: calc(100% - 32px); padding: 9px 13px; transform: translate(-50%, 12px); border-radius: 6px; color: white; background: var(--ink); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: 150ms ease; font-size: 11px; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 820px) {
  main { padding: 28px 16px 54px; }
  .capture-grid { grid-template-columns: 1fr 1fr; }
  .capture-action.primary { grid-column: 1 / -1; }
  .review-layout, .settings-layout { grid-template-columns: 1fr; }
  .settings-layout { gap: 30px; }
  .review-panel { min-height: auto; }
  .media-stage { min-height: 380px; }
  .people-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  html { background: var(--surface); }
  body { background: var(--surface); overscroll-behavior-y: none; }
  .app-shell { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  .app-header {
    height: calc(56px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 14px 0;
    background: rgba(255,255,255,.96);
  }
  .brand-mark { width: 30px; height: 30px; border-radius: 7px; font-size: 12px; }
  .identity-button { gap: 9px; }
  .identity-button strong { font-size: 14px; }
  .identity-button small { display: none; }
  .privacy-badge { display: none; }
  .icon-button { width: 42px; height: 42px; }
  main { padding: 20px 16px 40px; }
  .page-heading { align-items: end; gap: 12px; margin-bottom: 18px; }
  .page-heading h1 { margin-top: 4px; font-size: 30px; line-height: 1.05; }
  .count-pill { flex: 0 0 auto; margin-bottom: 1px; }
  .compact-heading { display: block; }
  .compact-heading > button { min-height: 44px; margin-top: 13px; }
  .capture-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .me-setup { grid-template-columns: 38px 1fr; margin: -3px 0 14px; }
  .me-setup .secondary-button { grid-column: 1 / -1; min-height: 42px; }
  .capture-action {
    min-height: 108px;
    padding: 13px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }
  .capture-action.primary {
    grid-column: 1 / -1;
    min-height: 84px;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
  }
  .capture-action svg { width: 36px; height: 36px; padding: 8px; border-radius: 7px; background: var(--surface-subtle); }
  .capture-action.primary svg { background: #292c2f; }
  .capture-action strong { font-size: 14px; }
  .capture-action small { font-size: 11px; line-height: 1.35; }
  .section-block { margin-top: 30px; }
  .section-header { margin-bottom: 10px; }
  .text-button { min-height: 38px; padding-inline: 8px; }
  .empty-card { min-height: 176px; padding: 24px 18px; }
  .moment-row { grid-template-columns: 54px 1fr; min-height: 68px; padding: 6px; }
  .moment-thumb { width: 54px; height: 54px; }
  .moment-row strong { font-size: 13px; }
  .moment-row small { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .moment-people { display: none; }

  #reviewView .compact-heading { margin-bottom: 14px; }
  .review-layout { grid-template-columns: minmax(0, 1fr); gap: 4px; min-width: 0; }
  .media-workbench {
    margin-inline: -16px;
    border-inline: 0;
    border-radius: 0;
  }
  .media-stage { min-height: 0; aspect-ratio: auto; border-radius: 0; }
  .media-stage.empty { min-height: 286px; }
  .media-stage.image-mode > img { height: auto; max-height: none; }
  .media-stage.video-mode { aspect-ratio: 16 / 9; }
  .media-stage.video-mode > video { height: 100%; max-height: 100%; }
  .workbench-status { min-height: 46px; padding-inline: 16px; align-items: center; gap: 8px; }
  .workbench-status span { max-width: 48%; line-height: 1.3; }
  .workbench-status .text-button { min-height: 40px; padding-inline: 0; }
  .review-panel { min-width: 0; min-height: 0; padding: 16px 0 12px; overflow: hidden; border: 0; background: transparent; }
  .review-panel-head { padding-bottom: 10px; }
  .appearance-list {
    display: flex;
    gap: 8px;
    margin: 10px -16px 0;
    width: calc(100% + 32px);
    max-width: 100vw;
    padding: 0 16px 5px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .appearance-list::-webkit-scrollbar { display: none; }
  .appearance-card {
    flex: 0 0 158px;
    min-height: 60px;
    padding: 8px;
    scroll-snap-align: start;
    border-color: var(--line);
    background: var(--surface);
  }
  .appearance-card.active { border-color: #a8ddc3; }
  .appearance-card .state-dot { align-self: start; margin-top: 5px; }
  .identity-editor {
    margin: 4px 0 0;
    padding: 20px 0 10px;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
  }
  .editor-summary { align-items: flex-start; }
  .editor-summary .person-avatar { width: 42px; height: 42px; }
  .editor-fields, .people-grid { grid-template-columns: 1fr; }
  .editor-fields { gap: 13px; margin-top: 18px; }
  label { font-size: 12px; }
  input, select { height: 46px; font-size: 16px; }
  textarea { font-size: 16px; }
  .search-row { grid-template-columns: 1fr; }
  .search-row button { width: 100%; min-height: 44px; }
  .editor-actions {
    position: sticky;
    bottom: calc(63px + env(safe-area-inset-bottom));
    z-index: 6;
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    margin: 16px -8px 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 8px 28px rgba(18,20,22,.08);
    backdrop-filter: blur(16px);
  }
  .editor-actions button { min-height: 44px; }
  .page-heading .segmented { width: 100%; margin-top: 12px; }
  #peopleView .page-heading { display: block; }
  .segmented button { flex: 1; min-height: 38px; }
  .people-grid { gap: 8px; }
  .person-card { padding: 13px; }
  .person-card .person-avatar { width: 42px; height: 42px; }
  .settings-layout { gap: 28px; }
  .settings-section { padding-top: 15px; }
  .setting-row { align-items: center; gap: 12px; padding-block: 15px; }
  .setting-row span { max-width: 67%; }
  .setting-row select { min-width: 124px; font-size: 14px; }
  .account-card { grid-template-columns: 38px 1fr; }
  .account-card button { grid-column: 1 / -1; width: 100%; min-height: 44px; }
  .profile-form-grid { grid-template-columns: 1fr; }
  .profile-form-grid .wide { grid-column: auto; }
  .principles p { align-items: flex-start; line-height: 1.4; }
  .bottom-nav {
    left: 0;
    bottom: 0;
    width: 100%;
    padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
    transform: none;
    border-inline: 0;
    border-bottom: 0;
    border-radius: 0;
    box-shadow: 0 -4px 18px rgba(18,20,22,.06);
  }
  .bottom-nav button { min-height: 54px; gap: 3px; font-size: 10px; }
  .bottom-nav svg { width: 19px; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal {
    position: relative;
    width: 100%;
    max-height: 90dvh;
    padding: 25px 18px calc(18px + env(safe-area-inset-bottom));
    border-inline: 0;
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
  }
  .modal::before { content: ""; position: absolute; top: 8px; left: 50%; width: 36px; height: 4px; transform: translateX(-50%); border-radius: 999px; background: var(--line-strong); }
  .modal-actions { position: sticky; bottom: 0; padding-top: 8px; background: var(--surface); }
  .modal-actions button { min-height: 44px; }
  .me-modal .modal-actions { display: grid; grid-template-columns: 0.8fr 1.2fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
