:root {
  --bg: #f5efe7;
  --panel: rgba(250, 246, 240, 0.95);
  --panel-strong: #fffdf9;
  --border: #ddd0c2;
  --text: #2a221c;
  --muted: #6b6055;
  --green: #1d4b4a;
  --green-soft: #eaf1ee;
  --gold: #b08a4b;
  --gold-soft: #f2e7d1;
  --shadow: 0 20px 50px rgba(77, 58, 40, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.85), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: "DM Sans", "Noto Sans", Arial, sans-serif;
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand-lockup__logo {
  width: 118px;
  height: 118px;
  object-fit: contain;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 35px rgba(77, 58, 40, 0.08);
}

.brand-lockup__copy {
  max-width: 700px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Newsreader", "Noto Serif", Georgia, serif;
  font-weight: 500;
}

h1 {
  font-size: clamp(2.4rem, 4vw, 4rem);
  line-height: 0.96;
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.02;
}

h3 {
  font-size: clamp(1.4rem, 2vw, 2rem);
  line-height: 1.1;
}

.subcopy,
.muted-copy {
  color: var(--muted);
  line-height: 1.6;
}

.subcopy {
  margin: 14px 0 0;
  font-size: 1rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.view-switch {
  display: inline-flex;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
}

.view-switch__button {
  border: 0;
  background: transparent;
  padding: 12px 18px;
  border-radius: 999px;
  color: var(--muted);
}

.view-switch__button.is-active {
  background: var(--green);
  color: #fff;
}

.ghost-button,
.secondary-button,
.primary-button {
  border-radius: 999px;
  padding: 13px 18px;
}

.ghost-button,
.secondary-button {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
}

.primary-button {
  border: 0;
  background: var(--green);
  color: #fff;
}

.auth-area {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.auth-area__form {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-area__input {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  padding: 12px 16px;
  font-size: 0.92rem;
  color: var(--text);
  min-width: 160px;
}

.auth-area__input:focus {
  outline: none;
  border-color: var(--green);
}

.auth-area__panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.auth-area__mode {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.auth-area__mode-btn {
  border: 0;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.88rem;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.auth-area__mode-btn.is-active {
  background: var(--green);
  color: #fff;
}

.auth-area__forgot {
  border: 0;
  background: none;
  padding: 0;
  font-size: 0.85rem;
  color: var(--green);
  text-decoration: underline;
  cursor: pointer;
}

.auth-area__heading {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.auth-area__status {
  font-size: 0.88rem;
  color: var(--muted);
}
.auth-area__status--success { color: var(--green); }
.auth-area__requirement {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 0.76rem;
}

.auth-area__user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
}
.auth-area__identity { display: grid; gap: 2px; }
.auth-area__identity strong { font-size: 0.86rem; font-weight: 650; }
.auth-area__verified { color: var(--green); font-size: 0.7rem; }
.auth-area__roles { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.auth-role {
  padding: 4px 7px;
  border-radius: 999px;
  background: #edf3f1;
  color: #32534a;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}
.auth-role--admin { background: #fff1d6; color: #815816; }
.auth-role--super_admin { background: #f4e9ff; color: #694095; }

.screen {
  display: none;
}

.screen--active {
  display: block;
}

.notice-banner,
.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.notice-banner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.72fr);
  gap: 18px;
  margin-bottom: 18px;
  padding: 24px;
}

.notice-banner__aside {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--green-soft), #f6efe4);
}

.capture-layout,
.legacy-layout {
  display: grid;
  gap: 18px;
}

.capture-layout {
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.92fr);
}

.legacy-layout {
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.45fr) minmax(320px, 0.92fr);
}

.panel {
  padding: 20px;
}

.panel-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.panel-header--compact {
  margin-bottom: 12px;
}

.interview-stage {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.portrait-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--panel-strong);
}

.portrait-card__header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.portrait-card__header span {
  color: var(--muted);
  font-weight: 500;
}

.portrait-frame {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(180deg, #efe4d4, #e8dccb);
  border: 1px solid rgba(176, 138, 75, 0.18);
}

.portrait-frame--small {
  min-height: 320px;
}

.portrait-frame--large {
  min-height: 520px;
}

.portrait-frame__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: inherit;
}

.portrait-frame__empty {
  display: flex;
  min-height: inherit;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.portrait-frame__empty img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 24px;
}

.is-hidden {
  display: none;
}

.question-panel {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--panel-strong);
}

.guided-session {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 20px;
  margin-bottom: 22px;
  padding: 20px;
  border: 1px solid rgba(29, 75, 74, 0.18);
  border-radius: 18px;
  background: linear-gradient(135deg, #edf5f1, #fffaf1);
}

.guided-session h3 {
  margin: 4px 0 8px;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
}

.guided-session__copy > p:last-child,
.guided-session__progress p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.guided-session__progress {
  align-self: center;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
}

.guided-session__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.guided-session__meta span {
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 700;
}

.guided-session__track {
  height: 7px;
  overflow: hidden;
  margin-bottom: 9px;
  border-radius: 999px;
  background: #dce7e2;
}

.guided-session__track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 240ms ease;
}

#session-status.is-complete {
  color: var(--green);
  font-weight: 700;
}

.question-panel__top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.progress-copy {
  min-width: 180px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--green-soft);
}

.voice-capture {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(29, 75, 74, 0.18);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(234, 241, 238, 0.86), rgba(255, 253, 249, 0.92));
}

.voice-capture__header,
.voice-capture__actions,
.voice-capture__review-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.voice-capture__header {
  justify-content: space-between;
}

.voice-capture h4 {
  margin: 0;
  font-family: "Newsreader", "Noto Serif", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 500;
}

.voice-capture__timer {
  min-width: 64px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--green);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: center;
}

.voice-capture__timer.is-recording {
  background: #7e302b;
  color: #fff;
}

.voice-capture__intro {
  max-width: 660px;
  margin: 12px 0 16px;
  color: var(--muted);
  line-height: 1.55;
}

.voice-capture__actions {
  flex-wrap: wrap;
}

.voice-capture button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.voice-capture__review {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(29, 75, 74, 0.14);
}

.voice-capture__review.is-hidden {
  display: none;
}

.voice-capture__review audio {
  width: 100%;
}

.transcript-review-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.82rem;
}

.transcript-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef0ef;
  color: #5f6763;
  font-weight: 700;
}

.transcript-status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.transcript-status--needs-review { background: #fff3d6; color: #93631b; }
.transcript-status--approved { background: #e4f5ec; color: #166743; }
.transcript-status--failed { background: #fae8e7; color: #8d332f; }

.voice-transcript-input {
  min-height: 130px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: #fff;
  color: var(--text);
  line-height: 1.55;
}

.voice-transcript-input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(29, 75, 74, 0.1);
}

.voice-capture__review-actions {
  flex-wrap: wrap;
}

.progress-copy strong,
.progress-copy span {
  display: block;
}

.progress-copy span {
  margin-top: 6px;
  color: var(--muted);
}

.input-label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.92rem;
  font-weight: 700;
}

.answer-input,
.text-input,
.file-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
}

.answer-input,
.text-input {
  padding: 16px 18px;
}

.answer-input {
  min-height: 180px;
  resize: vertical;
}

.answer-input--compact {
  min-height: 120px;
}

.file-input {
  padding: 14px;
}

.question-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.prompt-grid,
.library-groups,
.memory-topic-list,
.conversation-feed,
.saved-answers__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prompt-group {
  display: grid;
  gap: 10px;
}

.prompt-group__title {
  margin: 12px 0 2px;
  color: var(--muted);
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prompt-grid {
  margin-top: 18px;
}

.prompt-card,
.memory-topic,
.conversation-item,
.answer-card,
.library-group {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
}

.prompt-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px;
}

.prompt-card__topic {
  display: block;
  margin-bottom: 4px;
  color: var(--gold-deep);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prompt-card button {
  border: 0;
  background: transparent;
  color: var(--green);
  font-weight: 700;
}

.saved-answers {
  margin-top: 18px;
}

.saved-answers__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.answer-card {
  padding: 16px;
}

.answer-card h4 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.answer-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  white-space: pre-wrap;
}

.answer-card__footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  font-size: 0.88rem;
  color: var(--muted);
}

.upload-form {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.pending-upload {
  margin-bottom: 18px;
}

.pending-upload__panel {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
}

.pending-upload__controls {
  margin-top: 14px;
}

.thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(3, 112px);
  gap: 12px;
}

.thumbnail-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  width: 112px;
}

.thumbnail-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.thumbnail-card__footer {
  padding: 10px;
}

.thumbnail-card__meta {
  display: grid;
  gap: 6px;
}

.thumbnail-card__field-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.thumbnail-card__field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 8px;
  align-items: center;
}

.thumbnail-card__age-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: #fffdf9;
}

.thumbnail-card__action {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f7f1e7;
  color: var(--green);
  font-size: 1rem;
}

.thumbnail-card__action:hover {
  background: #efe6d7;
}

.thumbnail-card__action.is-idle {
  background: #f7f1e7;
  color: var(--green);
}

.thumbnail-card__action.is-pending {
  color: var(--gold);
  border-color: rgba(176, 138, 75, 0.45);
  background: #faf3e5;
}

.thumbnail-card__action.is-saved {
  color: #fff;
  border-color: #2c8f5f;
  background: #2c8f5f;
}

.thumbnail-card__delete {
  position: absolute;
  right: 6px;
  bottom: 52px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 253, 249, 0.45);
  box-shadow: none;
  font-size: 0.8rem;
  line-height: 1;
  opacity: 0.7;
}

.thumbnail-card__delete:hover {
  background: rgba(255, 253, 249, 0.72);
  opacity: 1;
}

.age-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.age-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  padding: 10px 14px;
}

.age-chip.is-active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.portrait-readiness {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
}

.portrait-readiness h4 { margin: 0 0 6px; }
.portrait-readiness__list { display: grid; gap: 8px; margin-top: 12px; }
.portrait-readiness__item { display: flex; justify-content: space-between; gap: 16px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.8); color: var(--muted); }
.portrait-readiness__item.is-ready { color: var(--green); background: var(--green-soft); }

.legacy-stage-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.legacy-stage-bar .muted-copy {
  max-width: 320px;
}

.legacy-reply {
  margin-top: 18px;
}

.legacy-reply__bubble {
  margin-top: 10px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--green-soft);
  line-height: 1.7;
  white-space: pre-wrap;
}

.memory-topic {
  padding: 14px;
}

.memory-topic strong,
.memory-topic span {
  display: block;
}

.memory-topic span {
  margin-top: 6px;
  color: var(--muted);
}

.memory-topic button {
  margin-top: 12px;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--gold-soft);
  color: var(--text);
}

.legacy-form {
  display: grid;
  gap: 12px;
}

.life-story-guide {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(176, 138, 75, 0.25);
  border-radius: 18px;
  background: linear-gradient(135deg, #fffaf1, #f4eee4);
}

.life-story-guide h3 {
  margin: 3px 0 7px;
  font-size: 1.35rem;
}

.life-story-guide .primary-button {
  justify-self: start;
}

.life-story-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.life-story-choices.is-hidden { display: none; }

.life-story-choice {
  padding: 11px 12px;
  border: 1px solid rgba(29, 75, 74, 0.2);
  border-radius: 10px;
  background: #fff;
  color: var(--green);
  font: inherit;
  font-weight: 700;
  text-align: left;
}

.life-story-choice:hover {
  border-color: var(--green);
  background: var(--green-soft);
}

@media (max-width: 760px) {
  .life-story-choices { grid-template-columns: 1fr; }
}

.starter-question-section {
  margin-top: 18px;
}
.starter-question-section > .secondary-button { width: 100%; margin-top: 10px; }

.starter-question-list {
  display: grid;
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
}

.starter-question-card {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  text-align: left;
  line-height: 1.5;
}

.starter-question-card:hover {
  background: var(--gold-soft);
}

.conversation-feed {
  margin-top: 18px;
}

.conversation-item {
  padding: 14px;
}

.conversation-item--user {
  background: #f4ece1;
}

.conversation-item--assistant {
  background: var(--green-soft);
}

.conversation-item__role {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.conversation-item__body {
  margin: 0;
  line-height: 1.65;
  white-space: pre-wrap;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

.photo-editor {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
}

.photo-editor__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.photo-editor__close {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(42, 34, 28, 0.12);
  border-radius: 999px;
  padding: 0;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  font-size: 1.7rem;
  line-height: 1;
  flex: 0 0 auto;
}

.photo-editor__close:hover {
  background: #fff;
}

.photo-editor__content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.photo-editor__image-wrap {
  overflow: hidden;
  border-radius: 24px;
  background: #efe4d4;
  width: min(240px, 100%);
  min-height: 240px;
}

.photo-editor__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f9f4ec;
}

.photo-editor__fields {
  display: grid;
  gap: 10px;
  align-content: start;
  max-width: 360px;
}

.photo-editor__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

@media (max-width: 1240px) {
  .guided-session {
    grid-template-columns: 1fr;
  }

  .capture-layout,
  .legacy-layout,
  .notice-banner {
    grid-template-columns: minmax(0, 1fr);
  }

  .legacy-stage-bar,
  .question-panel__top,
  .saved-answers__header {
    flex-direction: column;
  }

  .legacy-stage-bar .muted-copy {
    max-width: none;
  }
}

@media (max-width: 920px) {
  .interview-stage {
    grid-template-columns: 1fr;
  }

  .portrait-frame--small {
    min-height: 260px;
  }
  .photo-editor__image-wrap {
    min-height: 240px;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(calc(100% - 24px), 1480px);
    padding-top: 16px;
  }

  .topbar,
  .brand-lockup {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .auth-area,
  .auth-area__panel,
  .auth-area__form {
    width: 100%;
  }

  .auth-area__form {
    align-items: stretch;
    flex-direction: column;
  }

  .auth-area__input,
  .auth-area__form .primary-button {
    width: 100%;
    min-width: 0;
  }

  .auth-area__user {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .view-switch {
    width: 100%;
    flex-wrap: wrap;
    border-radius: 24px;
  }

  .view-switch__button {
    flex: 1 1 220px;
    text-align: center;
  }

  .question-actions {
    flex-direction: column;
  }

  .voice-capture__actions,
  .voice-capture__review-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .question-actions button,
  .voice-capture__actions button,
  .voice-capture__review-actions button,
  .saved-answers__header button,
  .memory-topic button,
  .starter-question-card,
  .prompt-card button,
  .topbar-actions > button {
    width: 100%;
  }

  .thumbnail-grid {
    grid-template-columns: repeat(2, 112px);
  }

  .portrait-frame--large {
    min-height: 360px;
  }
}

/* Product-dashboard visual language: precise, quiet, and easy to scan. */
:root {
  --bg: #f8f8f8;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-strong: #fff;
  --border: #e5e5e5;
  --text: #181818;
  --muted: #71717a;
  --green: #168f63;
  --green-soft: #eafaf2;
  --gold: #d77a2d;
  --gold-soft: #fff5e9;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.025);
  --radius-xl: 16px;
  --radius-lg: 14px;
  --radius-md: 12px;
  --radius-sm: 10px;
}

body {
  background-color: var(--bg);
  background-image: radial-gradient(rgba(24, 24, 24, 0.12) 0.65px, transparent 0.65px);
  background-size: 16px 16px;
}

.shell { padding: 32px 0 48px; }
.brand-lockup__logo { width: 88px; height: 88px; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.eyebrow, .section-kicker { color: #666; font-family: "IBM Plex Mono", "Noto Sans", monospace; font-size: 0.7rem; font-weight: 500; letter-spacing: 0.1em; }
h1, h2, h3 { font-family: "DM Sans", "Noto Sans", Arial, sans-serif; font-weight: 600; letter-spacing: -0.045em; }
h1 { font-size: clamp(2.1rem, 3.4vw, 3.35rem); line-height: 1.02; }
h2 { font-size: clamp(1.65rem, 2.5vw, 2.35rem); line-height: 1.08; }
h3 { font-size: clamp(1.25rem, 1.75vw, 1.65rem); line-height: 1.2; }
.view-switch { padding: 3px; border-radius: 10px; background: #fff; }
.view-switch__button { padding: 10px 15px; border-radius: 7px; }
.ghost-button, .secondary-button, .primary-button { border-radius: 9px; padding: 11px 15px; font-size: 0.92rem; font-weight: 600; }
.ghost-button, .secondary-button { background: #fff; }
.primary-button { border: 1px solid var(--green); }
.auth-area__input, .auth-area__user { border-radius: 9px; }
.auth-area__mode-btn { border-radius: 7px; }
.notice-banner { padding: 26px; }
.notice-banner__aside { border: 1px solid #ccefdc; border-radius: 12px; background: var(--green-soft); }
.panel { padding: 22px; }
.portrait-card, .question-panel { border-radius: 12px; }
.portrait-frame { border: 1px solid var(--border); border-radius: 10px; background: #f3f4f4; }
.progress-copy { border-radius: 10px; }
.voice-capture { border: 1px solid #ccefdc; border-radius: 12px; background: #f4fcf8; }
.voice-capture h4 { font-family: "DM Sans", "Noto Sans", Arial, sans-serif; font-size: 1.2rem; font-weight: 600; }
.voice-capture__timer { border: 1px solid #ccefdc; border-radius: 8px; background: #fff; }
.voice-transcript-input, .answer-input, .text-input, .file-input { border-radius: 9px; }
.prompt-card, .memory-topic, .conversation-item, .answer-card, .library-group { border-radius: 10px; background: #fff; }
.thumbnail-card { border-radius: 10px; }
.thumbnail-card__action, .age-chip, .memory-topic button, .starter-question-card { border-radius: 8px; }
.thumbnail-card__action, .thumbnail-card__action.is-idle { background: #f7f7f7; }
.thumbnail-card__action:hover { background: var(--green-soft); }
.legacy-reply__bubble { border-radius: 12px; }
.conversation-item--user { background: #f5f5f5; }
.photo-editor { border-radius: 14px; background: #fff; }
.fact-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.7fr) minmax(0, 1.3fr);
  gap: 18px;
}

.fact-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 10px;
}

.fact-summary div {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.fact-summary strong,
.fact-summary span { display: block; }
.fact-summary strong { font-size: 1.4rem; }
.fact-summary span { margin-top: 3px; color: var(--muted); font-size: 0.75rem; }

.fact-form { display: grid; }
.fact-form .input-label { margin-top: 12px; }
.fact-form .input-label:first-child { margin-top: 0; }
.fact-list { display: grid; gap: 12px; }

.fact-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.fact-card > strong { align-self: center; }
.fact-card h4,
.fact-card p { grid-column: 1 / -1; margin: 0; }
.fact-card h4 { font-size: 1.08rem; }
.fact-card p { color: var(--muted); }
.fact-source { padding-top: 7px; border-top: 1px solid var(--border); font-size: 0.82rem; }

.fact-status {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.fact-status--confirmed { background: #e4f5ec; color: #166743; }
.fact-status--needs_checking { background: #fff3d6; color: #93631b; }
.fact-status--corrected { background: #e9eefb; color: #3159a0; }
.fact-card__actions { display: flex; grid-column: 1 / -1; gap: 8px; }
.fact-card__actions button { padding: 8px 12px; }

@media (max-width: 920px) {
  .fact-layout { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .fact-summary { grid-template-columns: 1fr; }
  .fact-card__actions { flex-direction: column; }
}
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
}

.settings-main h2 { margin-bottom: 12px; }
.settings-counts {
  display: grid;
  grid-template-columns: repeat(5, minmax(90px, 1fr));
  gap: 9px;
  margin: 22px 0;
}
.settings-counts div {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.settings-counts strong,
.settings-counts span { display: block; }
.settings-counts strong { font-size: 1.5rem; }
.settings-counts span { margin-top: 4px; color: var(--muted); font-size: 0.76rem; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.archive-download-status { margin: 16px 0 0; color: var(--muted); }
.archive-contents ul { display: grid; gap: 13px; margin: 20px 0; padding: 0; list-style: none; }
.archive-contents li { display: grid; grid-template-columns: 110px 1fr; gap: 9px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.archive-contents li span { color: var(--muted); }
.archive-contents .notice-banner__aside { margin-top: 18px; }

@media (max-width: 1050px) {
  .settings-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .settings-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-actions { flex-direction: column; }
  .archive-contents li { grid-template-columns: 1fr; gap: 3px; }
}
.source-button {
  width: max-content;
  margin-top: 10px;
  padding: 7px 11px;
  border: 1px solid #c9d8d2;
  border-radius: 999px;
  background: #fff;
  color: var(--green);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
}

.source-button::before { margin-right: 6px; content: "↗"; }
.source-button:hover { background: var(--green-soft); }

.source-dialog {
  width: min(680px, calc(100% - 28px));
  max-height: calc(100vh - 40px);
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}
.source-dialog::backdrop { background: rgba(17, 24, 21, 0.55); backdrop-filter: blur(3px); }
.source-dialog__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.source-dialog__meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 18px 0; }
.source-dialog__meta span { padding: 6px 9px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 0.78rem; }
.source-dialog blockquote { margin: 0; padding: 18px; border-left: 4px solid var(--green); background: #f8faf9; line-height: 1.65; white-space: pre-wrap; }
.source-dialog__recording { margin-top: 18px; }
.source-dialog__recording audio { width: 100%; }

@media (max-width: 560px) {
  .source-dialog { padding: 18px; }
  .source-dialog__header { flex-direction: column; }
  .source-dialog__header button { width: 100%; }
}
.archive-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 9px;
}
.archive-summary div { padding: 12px; border-radius: 10px; background: #fff; }
.archive-summary strong, .archive-summary span { display: block; }
.archive-summary strong { font-size: 1.45rem; }
.archive-summary span { margin-top: 3px; color: var(--muted); font-size: 0.74rem; }
.archive-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr); gap: 18px; }
.archive-coverage, .archive-gaps { display: grid; gap: 11px; }
.coverage-card { padding: 15px; border: 1px solid var(--border); border-left-width: 5px; border-radius: 12px; background: #fff; }
.coverage-card--well_covered { border-left-color: #168f63; }
.coverage-card--begun { border-left-color: #d18a2f; }
.coverage-card--not_preserved { border-left-color: #9ca3af; }
.coverage-card > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.coverage-card h4 { margin: 0; }
.coverage-card p { margin: 8px 0; color: var(--muted); font-size: 0.84rem; }
.coverage-card ul { margin: 8px 0 0; padding-left: 19px; color: var(--muted); }
.coverage-state { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; background: #f1f3f2; font-size: 0.72rem; font-weight: 700; }
.archive-gap { padding: 13px 14px; border: 1px solid #ead5b0; border-radius: 10px; background: #fff9ed; }
.archive-principle { margin: 4px 0 0; padding: 14px; border-radius: 10px; background: var(--green-soft); color: var(--green); line-height: 1.5; }

@media (max-width: 980px) {
  .archive-layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .archive-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .coverage-card > div { align-items: flex-start; flex-direction: column; }
}

.contribution-layout { display: grid; grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr); gap: 18px; margin-top: 18px; }
.contribution-form, .contribution-list { display: grid; gap: 10px; }
.contribution-card { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255, 255, 255, 0.76); }
.contribution-card.is-hidden-by-steward { opacity: 0.62; border-style: dashed; }
.contribution-card__header { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; }
.contribution-card__header span, .contribution-card__status { color: var(--muted); font-size: 0.82rem; }
.contribution-card__image { width: min(100%, 420px); max-height: 280px; object-fit: cover; border-radius: 12px; }
.memory-topic--contribution { border-left: 4px solid var(--gold); }

@media (max-width: 900px) {
  .contribution-layout { grid-template-columns: 1fr; }
}

.contribution-layout--queue { margin-top: 18px; }
.check-row { display: flex; gap: 9px; align-items: flex-start; color: var(--muted); font-size: 0.9rem; }
.recipient-list, .family-question-queue, .family-question-history { display: grid; gap: 9px; margin-top: 14px; }
.recipient-card, .family-question-history__item { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.recipient-card div, .family-question-history__item { min-width: 0; }
.recipient-card strong, .recipient-card span, .family-question-history__item strong, .family-question-history__item span { display: block; }
.recipient-card span, .family-question-history__item span, .family-question-card > span { color: var(--muted); font-size: 0.8rem; }
.family-question-offer { display: grid; gap: 10px; margin: 16px 0; padding: 15px; border: 1px solid #d9c18d; border-radius: 14px; background: #fff9ed; }
.family-question-offer.is-hidden { display: none; }
.family-question-offer blockquote { margin: 0; font-weight: 600; line-height: 1.45; }
.family-question-card { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.conversation-schedule { margin-top: 18px; }
.schedule-form { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px 14px; align-items: end; }
.schedule-form .question-actions { grid-column: 1 / -1; }
.schedule-status { margin: 14px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--green-soft); color: var(--green); }
@media (max-width: 900px) { .schedule-form { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .schedule-form { grid-template-columns: 1fr; } .schedule-form .question-actions { grid-column: auto; } }

/* Dedicated sign-in and registration route ---------------------------------
   The public demo remains available at app.html. The #signin and #register
   routes deliberately show only identity, reassurance, and the auth form. */
body.auth-only {
  background:
    radial-gradient(circle at 12% 16%, rgba(223, 191, 137, 0.18), transparent 34%),
    radial-gradient(circle at 88% 82%, rgba(29, 75, 71, 0.10), transparent 30%),
    #f8f3ea;
}

body.auth-only .shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

body.auth-only main,
body.auth-only .view-switch,
body.auth-only #reset-app,
body.auth-only .topbar-actions > [data-lang-selector] {
  display: none;
}

body.auth-only .topbar {
  min-height: 100vh;
  margin: 0;
  padding: clamp(44px, 7vw, 108px);
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 520px);
  align-items: center;
  gap: clamp(54px, 9vw, 150px);
}

body.auth-only .brand-lockup {
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 26px;
}

body.auth-only .brand-lockup__logo {
  width: 120px;
  height: 68px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
  object-position: left center;
}

body.auth-only .brand-lockup__copy { max-width: 480px; }

body.auth-only .brand-lockup .eyebrow {
  margin-bottom: 20px;
  color: #636363;
  font-size: 0.88rem;
  letter-spacing: 0.52em;
}

body.auth-only .brand-lockup h1 {
  max-width: 440px;
  color: #2d2d2d;
  font-size: clamp(3rem, 5.5vw, 5.7rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

body.auth-only .brand-lockup .subcopy {
  max-width: 440px;
  margin-top: 24px;
  color: #606060;
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.72;
}

body.auth-only .topbar-actions {
  width: 100%;
  display: block;
  justify-self: end;
}

body.auth-only .auth-area {
  width: 100%;
  display: block;
}

body.auth-only .auth-area__panel {
  width: 100%;
  padding: clamp(30px, 4.2vw, 50px);
  gap: 22px;
  border: 1px solid rgba(99, 99, 99, 0.14);
  border-radius: 24px;
  background: rgba(255, 253, 249, 0.94);
  box-shadow: 0 30px 90px rgba(69, 55, 38, 0.12);
  backdrop-filter: blur(16px);
}

body.auth-only .auth-area__intro {
  display: grid;
  gap: 10px;
  margin-bottom: 2px;
}

body.auth-only .auth-area__intro h2 {
  color: #2d2d2d;
  font-size: clamp(2rem, 3vw, 2.7rem);
  font-weight: 400;
  letter-spacing: -0.04em;
}

body.auth-only .auth-area__intro p {
  max-width: 390px;
  margin: 0;
  color: #606060;
  line-height: 1.6;
}

body.auth-only .auth-area__intro .auth-area__kicker {
  color: #8d7550;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

body.auth-only .auth-area__mode {
  width: 100%;
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 12px;
  background: #f1ece4;
}

body.auth-only .auth-area__mode-btn {
  min-height: 42px;
  border-radius: 9px;
  color: #606060;
  font-size: 0.92rem;
}

body.auth-only .auth-area__mode-btn.is-active {
  color: #fff;
  background: #1d4b47;
  box-shadow: 0 4px 14px rgba(29, 75, 71, 0.16);
}

body.auth-only .auth-area__form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

body.auth-only .auth-area__input {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 14px 16px;
  border-color: #d8d0c5;
  border-radius: 11px;
  background: #fff;
  font-size: 0.98rem;
}

body.auth-only .auth-area__input:focus {
  border-color: #1d4b47;
  box-shadow: 0 0 0 3px rgba(29, 75, 71, 0.10);
}

body.auth-only .auth-area__form .primary-button {
  width: 100%;
  min-height: 52px;
  margin-top: 2px;
  border-radius: 11px;
  background: #1d4b47;
  font-weight: 600;
}

body.auth-only .auth-area__requirement,
body.auth-only .auth-area__status { line-height: 1.5; }

body.auth-only .auth-area__forgot {
  align-self: flex-start;
  color: #1d4b47;
  text-decoration: none;
}

body.auth-only .auth-area__forgot:hover { text-decoration: underline; }

@media (max-width: 820px) {
  body.auth-only .topbar {
    min-height: 100vh;
    padding: 34px 22px 44px;
    grid-template-columns: 1fr;
    align-content: center;
    gap: 34px;
  }

  body.auth-only .brand-lockup { gap: 14px; }

  body.auth-only .brand-lockup__logo {
    width: 92px;
    height: 48px;
  }

  body.auth-only .brand-lockup .eyebrow {
    margin-bottom: 10px;
    font-size: 0.74rem;
  }

  body.auth-only .brand-lockup h1 { font-size: clamp(2.5rem, 13vw, 4rem); }
  body.auth-only .brand-lockup .subcopy { display: none; }
  body.auth-only .topbar-actions { justify-self: stretch; }

  body.auth-only .auth-area__panel {
    padding: 28px 22px;
    border-radius: 18px;
  }
}
