: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", 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", 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;
}

.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);
}

.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);
}

.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-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 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;
}

.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;
}

.starter-question-section {
  margin-top: 18px;
}

.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) {
  .capture-layout,
  .legacy-layout,
  .notice-banner {
    grid-template-columns: 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(100% - 24px, 1480px);
    padding-top: 16px;
  }

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

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

  .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;
  }

  .question-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;
  }
}
