:root {
  color-scheme: light;
  --page: #e4e7e3;
  --bg: #f3f5f2;
  --surface: #ffffff;
  --surface-muted: #ecefeb;
  --ink: #151a18;
  --ink-soft: #5f6864;
  --ink-faint: #8b928f;
  --line: #dde2de;
  --green: #2e6652;
  --green-dark: #214d3e;
  --green-wash: #e3eee8;
  --coral: #c45b43;
  --coral-wash: #f6e7e2;
  --gold: #a87b35;
  --gold-wash: #f4eddf;
  --danger: #a94535;
  --shadow: 0 22px 64px rgba(25, 35, 30, 0.18);
  --radius: 8px;
  --bottom-nav-height: 72px;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(46, 102, 82, 0.24);
  outline-offset: 2px;
}

img {
  display: block;
  max-width: 100%;
}

.app-stage {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.phone-app {
  position: relative;
  width: min(100%, 430px);
  height: min(900px, calc(100dvh - 48px));
  min-height: 680px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid rgba(22, 29, 26, 0.16);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.status-bar {
  height: 31px;
  padding: 8px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(243, 245, 242, 0.94);
  font-size: 12px;
  font-weight: 700;
  position: relative;
  z-index: 20;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
}

.app-header {
  height: 69px;
  padding: 10px 18px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(243, 245, 242, 0.92);
  border-bottom: 1px solid rgba(221, 226, 222, 0.8);
  backdrop-filter: blur(18px);
  position: relative;
  z-index: 12;
}

.header-kicker,
.section-label {
  display: block;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
}

.app-header h1 {
  margin: 3px 0 0;
  font-size: 22px;
  line-height: 1.12;
  font-weight: 730;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.demo-mode-button {
  height: 30px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 680;
  white-space: nowrap;
}

.icon-button,
.small-icon-button,
.avatar-button {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
}

.icon-button:active,
.small-icon-button:active,
.avatar-button:active {
  transform: scale(0.96);
}

.notification-button {
  position: relative;
}

.notification-dot {
  position: absolute;
  right: 8px;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
  border: 1.5px solid var(--surface);
}

.avatar-button {
  background: var(--green);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.account-guest-mark {
  display: grid;
  place-items: center;
}

.app-content {
  position: absolute;
  inset: 100px 0 var(--bottom-nav-height);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.app-content::-webkit-scrollbar {
  display: none;
}

.app-view {
  display: none;
  min-height: 100%;
  padding: 18px 16px 32px;
}

.app-view.is-active {
  display: block;
  animation: view-in 180ms ease-out;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

.home-greeting {
  margin: 0 2px 15px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.home-greeting p {
  margin: 0;
  font-size: 15px;
  font-weight: 680;
}

.home-greeting span {
  color: var(--ink-faint);
  font-size: 10px;
  white-space: nowrap;
}

.demo-guide {
  min-height: 58px;
  margin: -4px -16px 16px;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
}

.demo-guide div {
  min-width: 0;
}

.demo-guide strong {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 650;
}

.demo-guide button,
.view-demo-command,
.account-switch-button {
  min-height: 34px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 7px;
  background: var(--green-wash);
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 680;
  white-space: nowrap;
}

.personal-home {
  min-height: 100%;
}

.personal-greeting {
  padding: 6px 2px 22px;
  border-bottom: 1px solid var(--line);
}

.personal-greeting h2 {
  margin: 8px 0 5px;
  font-size: 24px;
  line-height: 1.2;
}

.personal-greeting p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.personal-start-panel {
  min-height: 84px;
  padding: 16px 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--line);
}

.personal-start-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-wash);
  color: var(--green);
}

.personal-start-panel strong,
.personal-start-panel span {
  display: block;
}

.personal-start-panel strong {
  font-size: 14px;
}

.personal-start-panel div > span {
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 10px;
}

.round-command {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
}

.personal-starters {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.personal-starters button {
  width: 100%;
  min-height: 67px;
  padding: 8px 2px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 9px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--green);
  text-align: left;
}

.personal-starters button > span,
.personal-starters strong,
.personal-starters small {
  display: block;
}

.personal-starters strong {
  color: var(--ink);
  font-size: 12px;
}

.personal-starters small {
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 9px;
}

.view-demo-command {
  width: 100%;
  margin-top: 20px;
  background: transparent;
  color: var(--ink-soft);
}

.personal-empty {
  min-height: 440px;
  padding: 92px 18px 32px;
  text-align: center;
}

.personal-empty > span {
  width: 54px;
  height: 54px;
  margin: 0 auto 17px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-wash);
  color: var(--green);
}

.personal-empty h2 {
  margin: 0;
  font-size: 18px;
}

.personal-empty p {
  max-width: 260px;
  margin: 9px auto 22px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.7;
}

.personal-empty .primary-command {
  min-width: 152px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.story-prompt {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.story-photo-wrap {
  position: relative;
  aspect-ratio: 16 / 8.5;
  overflow: hidden;
}

.story-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 43%;
}

.story-date {
  position: absolute;
  top: 12px;
  left: 12px;
  height: 25px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  background: rgba(20, 25, 23, 0.76);
  color: #fff;
  font-size: 11px;
  font-weight: 650;
  backdrop-filter: blur(8px);
}

.story-prompt-copy {
  padding: 15px 15px 12px;
}

.story-prompt-copy h2 {
  margin: 6px 0 8px;
  font-size: 18px;
  line-height: 1.45;
  font-weight: 720;
}

.story-prompt-copy p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.record-entry {
  min-height: 74px;
  padding: 12px 15px;
  display: grid;
  grid-template-columns: 48px 1fr 20px;
  align-items: center;
  gap: 11px;
  border-top: 1px solid var(--line);
  background: var(--green-wash);
}

.record-orb {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  box-shadow: 0 7px 18px rgba(46, 102, 82, 0.22);
}

.record-orb:active {
  transform: scale(0.96);
}

.record-entry strong,
.record-entry span {
  display: block;
}

.record-entry strong {
  font-size: 15px;
}

.record-entry span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 11px;
}

.record-entry-arrow {
  color: var(--green);
}

.home-section,
.family-section {
  margin-top: 23px;
}

.section-heading {
  min-height: 28px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 720;
}

.text-command {
  min-width: 40px;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: 12px;
  font-weight: 650;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.quick-action {
  height: 92px;
  padding: 11px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--surface);
  font-size: 11px;
  font-weight: 650;
}

.quick-action:active {
  background: var(--surface-muted);
}

.quick-icon {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.quick-icon.coral { color: var(--coral); background: var(--coral-wash); }
.quick-icon.green { color: var(--green); background: var(--green-wash); }
.quick-icon.gold { color: var(--gold); background: var(--gold-wash); }

.memory-row {
  min-height: 94px;
  padding: 10px;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.memory-row + .memory-row {
  margin-top: 9px;
}

.memory-row img {
  width: 74px;
  height: 72px;
  border-radius: 6px;
  object-fit: cover;
}

.memory-row > svg {
  color: var(--ink-faint);
}

.memory-meta {
  color: var(--green);
  font-size: 10px;
  font-weight: 650;
}

.memory-row-copy {
  min-width: 0;
}

.memory-row-copy h3 {
  margin: 5px 0 4px;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-row-copy p {
  margin: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-nav {
  position: absolute;
  z-index: 16;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--bottom-nav-height);
  padding: 7px 10px max(8px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(250, 251, 249, 0.94);
  border-top: 1px solid rgba(214, 220, 216, 0.9);
  backdrop-filter: blur(20px);
}

.nav-button {
  position: relative;
  min-width: 0;
  height: 56px;
  border: 0;
  background: transparent;
  color: var(--ink-faint);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
}

.nav-button.is-active {
  color: var(--green);
}

.nav-button b {
  position: absolute;
  top: 3px;
  left: calc(50% + 7px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--coral);
  color: #fff;
  font-size: 9px;
}

.view-intro,
.family-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.compact-intro h2,
.family-hero h2 {
  margin: 4px 0 0;
  font-size: 22px;
  line-height: 1.15;
}

.segmented-control {
  height: 38px;
  margin: 18px 0 20px;
  padding: 3px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  border-radius: 8px;
  background: #e3e7e3;
}

.segment {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.segment.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(25, 35, 30, 0.12);
}

.memory-panel {
  display: none;
}

.memory-panel.is-active {
  display: block;
  animation: view-in 160ms ease-out;
}

.timeline-year {
  min-height: 42px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.timeline-year span {
  color: var(--coral);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}

.timeline-year strong {
  font-size: 13px;
}

.timeline-year.later-year {
  margin-top: 17px;
}

.timeline-item {
  position: relative;
  min-height: 112px;
  margin-left: 10px;
  padding: 7px 0 18px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  align-items: start;
  gap: 12px;
  border-left: 1px solid #cdd6d1;
}

.timeline-item:not(:has(img)) {
  grid-template-columns: 1fr;
}

.timeline-dot {
  position: absolute;
  left: -5px;
  top: 10px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 1px var(--green);
}

.timeline-copy > span {
  color: var(--ink-faint);
  font-size: 10px;
}

.timeline-copy h3 {
  margin: 5px 0;
  font-size: 14px;
}

.timeline-copy p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
}

.timeline-item > img {
  width: 82px;
  height: 94px;
  border-radius: 6px;
  object-fit: cover;
}

.evidence-line {
  margin-top: 9px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--green);
  font-size: 9px;
}

.evidence-line svg:not(:first-child) {
  margin-left: 6px;
}

.people-summary {
  min-height: 86px;
  margin-bottom: 10px;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 15px;
  border-radius: var(--radius);
  background: var(--green-wash);
}

.people-count {
  font-family: Georgia, serif;
  color: var(--green);
  font-size: 39px;
}

.people-summary strong,
.people-summary p {
  display: block;
  margin: 0;
}

.people-summary strong { font-size: 14px; }
.people-summary p { margin-top: 4px; color: var(--ink-soft); font-size: 10px; }

.person-row {
  width: 100%;
  min-height: 67px;
  padding: 9px 2px;
  display: grid;
  grid-template-columns: 44px 1fr 20px;
  align-items: center;
  gap: 11px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.person-avatar,
.activity-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
}

.person-avatar.elder { color: var(--green-dark); background: var(--green-wash); }
.person-avatar.family { color: var(--coral); background: var(--coral-wash); }
.person-avatar.friend { color: var(--gold); background: var(--gold-wash); }

.person-row strong,
.person-row small {
  display: block;
}

.person-row strong { font-size: 13px; }
.person-row small { margin-top: 4px; color: var(--ink-faint); font-size: 10px; }
.person-row > svg { color: var(--ink-faint); }

.photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 142px;
  gap: 8px;
}

.photo-cell {
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: #dfe3df;
}

.photo-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-cell span {
  position: absolute;
  left: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  padding: 5px 7px;
  border-radius: 5px;
  background: rgba(19, 24, 22, 0.72);
  color: #fff;
  font-size: 10px;
}

.photo-cell.wide {
  grid-column: 1 / -1;
}

.book-cover {
  position: relative;
  aspect-ratio: 1.65 / 1;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--green-dark);
}

.book-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(16, 21, 19, 0.4);
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-cover-copy {
  position: absolute;
  z-index: 2;
  left: 19px;
  right: 19px;
  bottom: 17px;
  color: #fff;
}

.book-cover-copy span {
  font-size: 10px;
  opacity: 0.82;
}

.book-cover-copy h2 {
  margin: 7px 0 5px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 26px;
  font-weight: 600;
}

.book-cover-copy p {
  margin: 0;
  font-size: 11px;
  opacity: 0.88;
}

.book-progress {
  min-height: 77px;
  margin-top: 10px;
  padding: 13px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.book-progress div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.book-progress div + div {
  border-left: 1px solid var(--line);
}

.book-progress strong {
  font-size: 18px;
}

.book-progress span {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 9px;
}

.chapter-heading {
  margin-top: 18px;
}

.chapter-row {
  width: 100%;
  min-height: 70px;
  padding: 11px 2px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.chapter-index {
  font-family: Georgia, serif;
  color: var(--coral);
  font-size: 19px;
}

.chapter-copy strong,
.chapter-copy small {
  display: block;
}

.chapter-copy strong { overflow-wrap: anywhere; font-size: 13px; }
.chapter-copy small { margin-top: 5px; color: var(--ink-faint); font-size: 9px; }

.source-status {
  height: 26px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 7px;
  font-size: 9px;
  white-space: nowrap;
}

.source-status.verified { color: var(--green); background: var(--green-wash); }
.source-status.pending { color: var(--gold); background: var(--gold-wash); }

.export-button,
.primary-command,
.secondary-command,
.choice-button {
  height: 46px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 680;
}

.export-button {
  width: 100%;
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: var(--green);
  color: #fff;
}

.family-hero {
  min-height: 76px;
  padding: 6px 0 18px;
  border-bottom: 1px solid var(--line);
}

.family-hero > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.family-hero h2 {
  overflow-wrap: anywhere;
  font-size: 16px;
}

.family-stack {
  position: relative;
  width: 84px;
  height: 44px;
  flex: 0 0 84px;
}

.family-avatar {
  position: absolute;
  top: 0;
  width: 44px;
  height: 44px;
  border: 3px solid var(--bg);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.family-avatar.one { left: 0; z-index: 3; background: var(--green); }
.family-avatar.two { left: 21px; z-index: 2; background: var(--coral); }
.family-avatar.three { left: 42px; z-index: 1; background: var(--gold); }

.count-badge {
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--coral-wash);
  color: var(--coral);
  font-size: 11px;
  font-weight: 700;
}

.review-task {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.review-task + .review-task {
  margin-top: 10px;
}

.review-task-top {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 10px;
}

.review-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--green);
  background: var(--green-wash);
}

.review-icon.photo {
  color: var(--coral);
  background: var(--coral-wash);
}

.review-task-top span {
  color: var(--ink-faint);
  font-size: 9px;
}

.review-task-top h3 {
  margin: 4px 0 0;
  font-size: 13px;
}

.audio-snippet {
  height: 43px;
  margin-top: 13px;
  padding: 0 9px;
  display: grid;
  grid-template-columns: 31px 1fr 30px;
  align-items: center;
  gap: 8px;
  border-radius: 7px;
  background: var(--surface-muted);
}

.small-icon-button {
  width: 31px;
  height: 31px;
  flex-basis: 31px;
  color: var(--green);
}

.audio-snippet > span {
  color: var(--ink-faint);
  font-size: 9px;
}

.mini-wave {
  height: 26px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.mini-wave i {
  width: 2px;
  height: 8px;
  border-radius: 2px;
  background: #9eb2a8;
}

.mini-wave i:nth-child(3n) { height: 17px; }
.mini-wave i:nth-child(4n) { height: 12px; }

.choice-row {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.choice-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
}

.choice-button.is-selected {
  border-color: var(--green);
  background: var(--green-wash);
  color: var(--green-dark);
}

.person-evidence {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 70px 1fr;
  align-items: center;
  gap: 11px;
}

.person-evidence img {
  width: 70px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
  object-position: center 25%;
}

.secondary-command,
.primary-command {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.secondary-command {
  background: var(--surface-muted);
  color: var(--ink);
}

.primary-command {
  background: var(--green);
  color: #fff;
}

.activity-row {
  min-height: 61px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.activity-avatar {
  width: 36px;
  height: 36px;
  font-size: 11px;
}

.activity-avatar.daughter { color: var(--coral); background: var(--coral-wash); }
.activity-avatar.grandson { color: var(--gold); background: var(--gold-wash); }

.activity-row strong,
.activity-row p {
  display: block;
  margin: 0;
}

.activity-row strong { font-size: 11px; }
.activity-row p { margin-top: 4px; color: var(--ink-faint); font-size: 9px; }
.activity-row small { color: var(--ink-faint); font-size: 8px; white-space: nowrap; }

.flow-overlay {
  position: absolute;
  z-index: 40;
  inset: 0;
  display: flex;
  flex-direction: column;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background: #17352c;
  color: #fff;
  transform: translateY(16px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
}

.flow-overlay.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.flow-header {
  min-height: 84px;
  padding: max(18px, env(safe-area-inset-top)) 16px 10px;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
}

.flow-header > div {
  text-align: center;
}

.flow-header span,
.flow-header strong {
  display: block;
}

.flow-header span {
  font-size: 11px;
  opacity: 0.72;
}

.flow-header strong {
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.icon-button.on-dark {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.interview-stage {
  flex: 1;
  min-height: 0;
  padding: 28px 26px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.agent-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.19);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  color: #d8eadf;
}

.listening-status {
  margin-top: 14px;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.listening-label {
  color: #bad2c6;
  font-size: 11px;
}

.listening-label[data-status="ready"] { color: #d2eedf; }
.listening-label[data-status="warning"] { color: #f0d5a4; }
.listening-label[data-status="error"] { color: #ffc3ba; }

.retry-microphone-button {
  min-height: 24px;
  padding: 0 7px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 10px;
}

.interview-stage h2 {
  width: 100%;
  max-width: 340px;
  margin: 13px 0 24px;
  font-size: 21px;
  line-height: 1.55;
  font-weight: 680;
}

.live-transcript {
  width: 100%;
  min-height: 96px;
  max-height: 180px;
  padding: 16px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  line-height: 1.75;
  text-align: left;
}

.live-transcript.is-placeholder {
  color: rgba(255, 255, 255, 0.58);
}

.waveform {
  height: 70px;
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.waveform i {
  width: 3px;
  height: 10px;
  border-radius: 3px;
  background: #b8dac9;
  animation: wave 1.05s ease-in-out infinite;
  animation-play-state: paused;
}

.waveform.is-live i {
  animation-play-state: running;
}

.waveform.has-meter i {
  animation: none;
  transition: height 70ms linear, opacity 70ms linear;
}

.waveform i:nth-child(3n) { animation-delay: -0.18s; }
.waveform i:nth-child(4n) { animation-delay: -0.42s; }
.waveform i:nth-child(5n) { animation-delay: -0.65s; }

@keyframes wave {
  0%, 100% { height: 9px; opacity: 0.52; }
  50% { height: 44px; opacity: 1; }
}

.interview-controls {
  min-height: 116px;
  padding: 12px 30px max(22px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 64px 78px 64px;
  align-items: center;
  justify-content: space-between;
}

.control-button {
  height: 64px;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: 10px;
}

.stop-record-button {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border: 6px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: #fff;
  color: var(--coral);
}

.text-composer {
  position: absolute;
  z-index: 3;
  left: 14px;
  right: 14px;
  bottom: 16px;
  min-height: 54px;
  padding: 7px 7px 7px 13px;
  display: none;
  grid-template-columns: 1fr 36px;
  align-items: center;
  gap: 7px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 12px 32px rgba(6, 18, 13, 0.28);
}

.text-composer.is-open {
  display: grid;
}

.text-composer input {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 0;
  outline: 0;
  color: var(--ink);
  font-size: 14px;
}

.send-text-button {
  width: 36px;
  height: 36px;
  background: var(--green);
  color: #fff;
}

.review-overlay {
  background: var(--bg);
  color: var(--ink);
}

.review-header {
  min-height: 76px;
  padding: max(16px, env(safe-area-inset-top)) 16px 9px;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.review-header > span:nth-child(2) {
  text-align: center;
  font-size: 14px;
  font-weight: 680;
}

.model-status {
  height: 28px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 7px;
  background: var(--green-wash);
  color: var(--green);
  font-size: 9px;
}

.review-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 28px 20px 22px;
}

.review-check {
  width: 54px;
  height: 54px;
  margin-bottom: 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
}

.review-content h2 {
  margin: 7px 0 12px;
  font-size: 25px;
  line-height: 1.25;
}

.review-content > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.85;
}

.fact-list {
  margin-top: 22px;
  border-top: 1px solid var(--line);
}

.fact-list div {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.fact-list span {
  color: var(--ink-faint);
  font-size: 11px;
}

.fact-list strong {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}

.fact-list strong.is-missing {
  color: var(--ink-faint);
  font-weight: 500;
}

.review-audio-button {
  min-height: 34px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--green-wash);
  color: var(--green-dark);
  font-size: 11px;
}

.review-audio-button:disabled {
  background: var(--surface-muted);
  color: var(--ink-faint);
}

.next-thread {
  margin-top: 19px;
  padding: 14px;
  border-left: 3px solid var(--coral);
  background: var(--coral-wash);
}

.next-thread span {
  color: var(--coral);
  font-size: 9px;
  font-weight: 700;
}

.next-thread p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.55;
}

.review-actions {
  min-height: 76px;
  padding: 10px 16px max(14px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  border-top: 1px solid var(--line);
  background: rgba(250, 251, 249, 0.94);
  backdrop-filter: blur(18px);
}

.sheet-backdrop {
  position: absolute;
  z-index: 50;
  inset: 0;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background: rgba(12, 17, 15, 0.36);
  transition: opacity 180ms ease, visibility 180ms;
}

.sheet-backdrop.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet {
  position: absolute;
  z-index: 55;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 82%;
  padding: 8px 16px max(20px, env(safe-area-inset-bottom));
  overflow-y: auto;
  border-radius: 8px 8px 0 0;
  background: var(--surface);
  visibility: hidden;
  transform: translateY(102%);
  transition: transform 220ms ease, visibility 220ms;
}

.bottom-sheet.is-open {
  visibility: visible;
  transform: translateY(0);
}

.sheet-handle {
  width: 38px;
  height: 4px;
  margin: 1px auto 15px;
  border-radius: 2px;
  background: #cbd0cc;
}

.sheet-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sheet-heading h2 {
  margin: 4px 0 0;
  font-size: 21px;
}

.guest-account-panel {
  padding: 16px 0 18px;
  border-bottom: 1px solid var(--line);
}

.guest-account-panel p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.7;
}

.account-entry-actions {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 8px;
}

.account-entry-actions button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.member-account-panel {
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--line);
}

.member-account-summary {
  min-height: 42px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.member-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.member-account-panel strong,
.member-account-panel small {
  display: block;
}

.member-account-panel strong {
  font-size: 13px;
}

.member-account-panel small {
  max-width: 150px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-switch-button {
  min-height: 32px;
}

.account-logout-button {
  width: 100%;
  min-height: 40px;
  margin-top: 12px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid color-mix(in srgb, var(--danger) 22%, transparent);
  border-radius: 8px;
  background: var(--coral-wash);
  color: var(--danger);
  font-size: 12px;
  font-weight: 680;
}

.account-logout-button:active {
  background: color-mix(in srgb, var(--coral-wash) 78%, var(--danger));
}

.auth-sheet {
  max-height: 88%;
}

.auth-mode-control {
  height: 38px;
  margin-top: 18px;
  padding: 2px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 7px;
  background: var(--surface-muted);
}

.auth-mode-control button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.auth-mode-control button.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(22, 28, 25, 0.08);
}

.auth-form {
  padding: 18px 0 4px;
}

.auth-form label {
  display: block;
  margin-bottom: 13px;
}

.auth-form label > span {
  display: block;
  margin: 0 2px 7px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
}

.auth-form input {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
}

.auth-form input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-wash);
}

.auth-error {
  margin: -2px 2px 12px;
  color: var(--danger);
  font-size: 10px;
  line-height: 1.5;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.62;
}

.settings-list {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.setting-row {
  width: 100%;
  min-height: 64px;
  padding: 8px 0;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.setting-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--green-wash);
  color: var(--green);
}

.setting-row strong,
.setting-row small {
  display: block;
}

.setting-row strong { font-size: 12px; }
.setting-row small { margin-top: 4px; color: var(--ink-faint); font-size: 9px; }
.setting-row > svg { color: var(--ink-faint); }

.ios-switch {
  position: relative;
  appearance: none;
  width: 46px;
  height: 27px;
  border: 0;
  border-radius: 14px;
  background: #d5dad6;
  transition: background 160ms ease;
}

.ios-switch::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(22, 28, 25, 0.23);
  transition: transform 160ms ease;
}

.ios-switch:checked {
  background: var(--green);
}

.ios-switch:checked::after {
  transform: translateX(19px);
}

.range-setting {
  min-height: 100px;
  grid-template-columns: 38px 1fr;
  row-gap: 7px;
  padding-top: 12px;
  padding-bottom: 9px;
}

.setting-copy {
  min-width: 0;
}

.range-control {
  grid-column: 1 / -1;
  display: grid;
  gap: 1px;
  padding: 0 2px;
}

.range-control input[type="range"] {
  --range-fill: var(--green);
  --range-track: #d9dfdb;
  --range-progress: 50%;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y;
}

.range-control input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--range-fill) 0 var(--range-progress), var(--range-track) var(--range-progress) 100%);
}

.range-control input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 25px;
  height: 25px;
  margin-top: -10px;
  border: 1px solid rgba(20, 27, 24, 0.08);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 7px rgba(22, 28, 25, 0.22), 0 0 0 0 rgba(46, 102, 82, 0.12);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.range-control input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.08);
  box-shadow: 0 2px 9px rgba(22, 28, 25, 0.25), 0 0 0 7px rgba(46, 102, 82, 0.12);
}

.range-control input[type="range"]::-moz-range-track {
  height: 5px;
  border: 0;
  border-radius: 3px;
  background: var(--range-track);
}

.range-control input[type="range"]::-moz-range-progress {
  height: 5px;
  border-radius: 3px;
  background: var(--range-fill);
}

.range-control input[type="range"]::-moz-range-thumb {
  width: 25px;
  height: 25px;
  border: 1px solid rgba(20, 27, 24, 0.08);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 7px rgba(22, 28, 25, 0.22);
}

.range-limits {
  display: flex;
  justify-content: space-between;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1;
}

.provider-line {
  min-height: 50px;
  margin-top: 15px;
  padding: 0 4px;
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 10px;
}

.provider-line strong {
  color: var(--ink);
}

.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #46a176;
  box-shadow: 0 0 0 3px rgba(70, 161, 118, 0.12);
}

.chapter-preview {
  margin-top: 20px;
  color: #39413d;
  font-family: Georgia, "Songti SC", serif;
  font-size: 14px;
  line-height: 2;
}

.chapter-preview p {
  margin: 0 0 13px;
}

.source-footer {
  min-height: 49px;
  margin-top: 16px;
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 7px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 9px;
}

.source-footer button {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: 10px;
}

.toast {
  position: absolute;
  z-index: 80;
  left: 50%;
  bottom: 88px;
  width: max-content;
  max-width: calc(100% - 32px);
  min-height: 42px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  background: rgba(20, 26, 23, 0.9);
  color: #fff;
  font-size: 11px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 600px) {
  .app-stage {
    display: block;
    padding: 0;
  }

  .phone-app {
    width: 100%;
    height: 100dvh;
    min-height: 620px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

@media (max-height: 720px) {
  .interview-stage {
    padding-top: 12px;
  }

  .agent-mark {
    width: 48px;
    height: 48px;
  }

  .interview-stage h2 {
    margin-bottom: 14px;
    font-size: 18px;
  }

  .live-transcript {
    min-height: 80px;
  }

  .interview-controls {
    min-height: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
