:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #0e100d;
  --panel: #191c17;
  --panel2: #12140f;
  --border: #30362b;
  --text: #f5f1e6;
  --muted: #a8af9f;
  --accent: #ece2c9;
  --accentText: #151713;
  --green: #8ed56f;
  --yellow: #e8ca72;
  --danger: #ff9d9d;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 30% 0%, #252b20 0%, transparent 36%),
    linear-gradient(180deg, #11140f 0%, #0b0d0a 100%);
  color: var(--text);
}
button,input,select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.shell {
  width: min(920px, calc(100% - 28px));
  margin: 0 auto;
  padding: 20px 0 56px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 20px;
}
.brand { letter-spacing: .24em; font-weight: 900; font-size: 14px; }
.tagline { margin-top: 4px; color: #7f8778; font-size: 12px; }
.panel {
  background: rgba(25, 28, 23, .97);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: clamp(22px, 4vw, 38px);
  box-shadow: 0 24px 80px rgba(0,0,0,.28);
  margin-bottom: 14px;
}
.auth-panel { max-width: 620px; margin: 7vh auto 0; }
.eyebrow {
  color: #8d9585;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
  font-weight: 800;
}
h1 {
  margin: 10px 0 14px;
  font-size: clamp(42px, 8vw, 72px);
  line-height: .98;
  letter-spacing: -.045em;
}
h2 { margin: 8px 0 10px; font-size: clamp(27px, 5vw, 38px); line-height: 1.08; }
.lead { color: #c8cdbf; font-size: 18px; line-height: 1.55; max-width: 680px; }
.muted { color: var(--muted); line-height: 1.5; }
.small { font-size: 13px; }
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 26px 0 18px;
  background: #10120f;
  padding: 5px;
  border-radius: 15px;
}
.tab {
  border: 0;
  padding: 11px;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}
.tab.active { background: #2a2f26; color: var(--text); }
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 7px; }
label { color: var(--muted); font-size: 13px; font-weight: 650; }
input, select {
  width: 100%;
  border: 1px solid #383e33;
  border-radius: 15px;
  background: #10120f;
  color: var(--text);
  padding: 14px 15px;
  outline: none;
}
input:focus, select:focus { border-color: #6d7763; box-shadow: 0 0 0 3px rgba(109,119,99,.12); }
.primary, .secondary, .ghost {
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  font-weight: 850;
}
.primary { background: var(--accent); color: var(--accentText); }
.secondary { background: #343a30; color: var(--text); }
.ghost { background: #292e26; color: var(--text); }
button:disabled { opacity: .42; cursor: default; }
.wide { width: 100%; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.choice {
  display: grid;
  gap: 5px;
  padding: 16px;
  border: 1px solid #343a30;
  border-radius: 18px;
  background: #12140f;
  color: var(--text);
}
.choice input { width: auto; accent-color: #d9ceb2; }
.choice strong { font-size: 15px; }
.choice span { color: var(--muted); font-size: 12px; line-height: 1.35; }
.choice:has(input:checked) { border-color: #8d977e; background: #20251d; }
.dashboard-head, .voice-heading, .progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.progress-panel { padding-top: 24px; padding-bottom: 24px; }
#progressPercent { font-size: 28px; font-weight: 900; }
.progress-track {
  height: 10px;
  background: #0f110e;
  border-radius: 999px;
  overflow: hidden;
  margin: 16px 0 8px;
}
#progressFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7dc260, #c4d69e);
  border-radius: inherit;
  transition: width .35s ease;
}
.save-badge {
  font-size: 12px;
  color: #9aa290;
  background: #11130f;
  border: 1px solid #2c3128;
  border-radius: 999px;
  padding: 8px 11px;
}
.save-badge.saving { color: var(--yellow); }
.save-badge.saved { color: var(--green); }
.status {
  margin-top: 18px;
  background: #10120f;
  border: 1px solid #2b3027;
  border-radius: 18px;
  padding: 15px 17px;
}
.statusline { display: flex; align-items: center; gap: 11px; font-weight: 800; }
.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #747b6f;
  box-shadow: 0 0 0 7px rgba(116,123,111,.08);
}
.dot.live { background: var(--green); box-shadow: 0 0 0 7px rgba(142,213,111,.10); }
.dot.talking { background: var(--yellow); box-shadow: 0 0 0 7px rgba(232,202,114,.10); }
.meta { color: #858d7e; font-size: 12px; margin-top: 6px; }
.controls { display: flex; gap: 10px; margin-top: 16px; }
.controls .primary { flex: 1; }
.settings, .diagnostics { margin-top: 15px; color: #8f9688; font-size: 13px; }
.settings summary, .diagnostics summary { cursor: pointer; }
.settings .field { margin: 12px 0 8px; }
.meter { height: 6px; margin: 16px 0 0; background: #0f110e; border-radius: 999px; overflow: hidden; }
#meterFill { width: 0; height: 100%; background: var(--green); transition: width .08s linear; }
.conversation-now { display: grid; gap: 10px; margin-top: 16px; }
.box { background: #12140f; border: 1px solid #292f26; border-radius: 16px; padding: 14px 16px; }
.box h3 { margin: 0 0 6px; color: #858d7e; font-size: 11px; text-transform: uppercase; letter-spacing: .09em; }
.box p { margin: 0; min-height: 22px; line-height: 1.48; }
.error { margin-top: 12px; color: var(--danger); white-space: pre-wrap; }
pre { white-space: pre-wrap; word-break: break-word; background: #0c0e0b; padding: 12px; border-radius: 12px; max-height: 260px; overflow: auto; }
.project-list { display: grid; gap: 10px; margin: 18px 0; }
.project-row {
  border: 1px solid #33392f;
  background: #12140f;
  color: var(--text);
  border-radius: 17px;
  padding: 16px;
  text-align: left;
}
.project-row strong { display: block; margin-bottom: 4px; }
.project-row span { color: var(--muted); font-size: 12px; }
@media (max-width: 700px) {
  .shell { width: min(100% - 18px, 920px); padding-top: 10px; }
  .panel { border-radius: 22px; padding: 20px; }
  .choice-grid, .two-col { grid-template-columns: 1fr; }
  .dashboard-head, .voice-heading { align-items: flex-start; }
  .controls { flex-direction: column; }
  .topbar .tagline { display: none; }
}

.gift-panel { max-width: 720px; margin: 4vh auto 0; }
.gift-panel h1 { max-width: 680px; font-size: clamp(38px, 7vw, 62px); }
.gift-notice {
  display: grid;
  gap: 3px;
  margin-bottom: 18px;
  padding: 13px 14px;
  border: 1px solid #59634f;
  border-radius: 14px;
  background: #20261c;
}
.gift-notice strong { color: var(--text); }
.gift-notice span { color: var(--muted); font-size: 13px; line-height: 1.4; }
.gift-card-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 22px 0 12px;
}
.gift-card-info > div {
  display: grid;
  gap: 4px;
  padding: 15px;
  border: 1px solid #33392f;
  border-radius: 16px;
  background: #11130f;
}
.gift-message {
  margin: 12px 0;
  padding: 16px;
  border-left: 3px solid #8d977e;
  background: #151812;
  border-radius: 0 14px 14px 0;
}
.gift-message p { margin: 7px 0 0; line-height: 1.5; }
.gift-entitlement {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  padding: 17px;
  border: 1px solid #343a30;
  border-radius: 18px;
  background: #12140f;
}
.gift-entitlement span {
  color: var(--muted);
  font-size: 14px;
}
.gift-entitlement span::before {
  content: "✓";
  color: var(--green);
  margin-right: 9px;
  font-weight: 900;
}
.gift-actions { margin-top: 18px; }
#giftAuthedActions { display: grid; gap: 14px; margin-top: 20px; }
@media (max-width: 700px) {
  .gift-card-info { grid-template-columns: 1fr; }
}


.lifemap-categories { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 20px 0; }
.lifemap-category { padding: 12px; border: 1px solid #343c2f; border-radius: 12px; }
.lifemap-category progress { width: 100%; accent-color: #b9c78e; }
.lifemap-item { border-top: 1px solid #343c2f; padding: 14px 0; overflow-wrap: anywhere; }
.lifemap-item blockquote { margin: 12px 0; padding-left: 16px; border-left: 2px solid #899576; white-space: pre-wrap; }
.lifemap-item summary { cursor: pointer; }
.lifemap-warning { color: #e8c88e; }
.lifemap-source-full { margin: 8px 0 4px; }
.lifemap-source-full > summary { color: var(--muted); font-size: 0.9rem; padding: 6px 0; }
.lifemap-full-quote { max-height: 18rem; overflow-y: auto; overscroll-behavior: contain; padding-right: 12px; }
.lifemap-item summary:focus-visible, .lifemap-full-quote:focus-visible { outline: 2px solid #b9c78e; outline-offset: 4px; border-radius: 3px; }

/* Private photo/document workspace */
.asset-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.asset-card { border: 1px solid var(--border, #3d4437); border-radius: 14px; padding: 18px; min-width: 0; }
.asset-card h3 { margin: 0 0 8px; overflow-wrap: anywhere; }
.asset-caption { white-space: pre-wrap; overflow-wrap: anywhere; }
.asset-card .controls { flex-wrap: wrap; gap: 8px; }
.asset-pagination { margin-top: 18px; flex-wrap: wrap; align-items: center; }
.asset-dialog { background: #191d16; color: #f5f0e6; border: 1px solid #5b644f; border-radius: 18px; padding: 24px; width: min(640px, calc(100% - 24px)); max-height: 90dvh; overflow-y: auto; }
.asset-dialog::backdrop { background: #000b; }
.asset-dialog h2 { margin-top: 0; }
.asset-dialog fieldset { border: 1px solid #5b644f; border-radius: 10px; min-width: 0; }
.asset-dialog textarea { width: 100%; resize: vertical; min-height: 100px; padding: 12px; border: 1px solid #5b644f; border-radius: 10px; background: #10120f; color: inherit; font: inherit; box-sizing: border-box; }
.asset-link-options { max-height: 240px; overflow-y: auto; }
.asset-link-choice { display: flex; gap: 10px; padding: 9px 0; align-items: flex-start; }
.asset-link-choice input { width: auto; flex: 0 0 auto; margin-top: 4px; }
.asset-link-choice span { overflow-wrap: anywhere; }
.asset-preview { display: block; max-width: 100%; max-height: 72dvh; object-fit: contain; margin: 16px auto 0; }
#assetFile { max-width: 100%; }

/* The interview stays in front; the archive is available when the storyteller wants it. */
.dashboard-head { padding-block: 16px; box-shadow: none; background: transparent; border: 0; }
.dashboard-head h2 { font-size: clamp(23px, 4vw, 34px); }
.voice-panel { max-width: 760px; margin-inline: auto; }
.voice-panel .meta { color: var(--muted); }
.voice-panel .diagnostics { font-size: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.interview-attachment { margin-top: 16px; padding: 16px 0 0; border-top: 1px solid var(--border); }
.interview-attachment > button { width: auto; min-height: 48px; }
.interview-attachment > p { margin: 8px 0 0; }
.asset-current { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 10px; border: 1px solid var(--border); border-radius: 14px; font-size: 14px; overflow-wrap: anywhere; }
.asset-current img { width: 62px; height: 62px; object-fit: cover; border-radius: 8px; }
.interview-transcript { margin-top: 18px; }
.interview-transcript summary, .story-more > summary { cursor: pointer; color: var(--muted); }
.story-more { max-width: 760px; margin-inline: auto; box-shadow: none; }
.story-more > summary { font-size: 17px; font-weight: 750; color: var(--text); }
.story-more section { margin-top: 28px; border-top: 1px solid var(--border); padding-top: 22px; }
.story-more h2 { font-size: clamp(22px, 3vw, 29px); }
@media (max-width: 700px) {
  .voice-panel .voice-heading { flex-wrap: wrap; }
  .voice-panel .controls { flex-direction: column; }
  .interview-attachment > button { width: 100%; }
}


/* Interview home: deliberately simple, with Marin as the only dominant control. */
#dashboardView {
  max-width: 800px;
  margin-inline: auto;
}
#dashboardView .dashboard-head {
  margin: 0 4px 12px;
  padding: 4px 2px 10px;
}
#dashboardView .dashboard-head h2 {
  margin: 5px 0 4px;
  font-size: clamp(22px, 4vw, 31px);
}
#dashboardView .dashboard-head p {
  margin: 0;
  font-size: 13px;
}
.voice-panel {
  max-width: 760px;
  margin-inline: auto;
  padding: clamp(20px, 4vw, 34px);
}
.journey-overview {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.journey-overview-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}
.journey-overview-head strong {
  display: block;
  margin-top: 5px;
  font-size: clamp(18px, 3vw, 23px);
}
.journey-overview #progressPercent {
  font-size: 24px;
  font-weight: 900;
}
.journey-overview .progress-track {
  margin: 13px 0 7px;
}
.journey-overview #progressHint {
  margin: 0;
}
.voice-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(30px, 7vw, 54px) 0 26px;
  text-align: center;
}
.voice-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(190px, 47vw, 270px);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 30%, rgba(255,255,255,.17), transparent 26%),
    radial-gradient(circle at 50% 62%, #2d3728 0%, #1b2118 53%, #10140f 100%);
  color: var(--text);
  box-shadow:
    0 28px 70px rgba(0,0,0,.36),
    inset 0 0 0 1px rgba(236,226,201,.17);
  isolation: isolate;
}
.voice-orb:disabled {
  opacity: 1;
  cursor: default;
}
.voice-orb-ring {
  position: absolute;
  inset: -10px;
  border: 1px solid rgba(142,213,111,.22);
  border-radius: 50%;
  box-shadow: 0 0 0 9px rgba(142,213,111,.035);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
  z-index: -1;
}
.voice-orb:not(:disabled):hover .voice-orb-ring,
.voice-orb:not(:disabled):focus-visible .voice-orb-ring {
  transform: scale(1.035);
  border-color: rgba(236,226,201,.44);
}
.voice-orb:focus-visible {
  outline: 3px solid rgba(236,226,201,.5);
  outline-offset: 8px;
}
.voice-orb.live .voice-orb-ring {
  border-color: rgba(142,213,111,.72);
  box-shadow: 0 0 0 11px rgba(142,213,111,.07), 0 0 42px rgba(142,213,111,.14);
  animation: marinPulse 2.4s ease-in-out infinite;
}
@keyframes marinPulse {
  0%, 100% { transform: scale(1); opacity: .82; }
  50% { transform: scale(1.045); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .voice-orb.live .voice-orb-ring { animation: none; }
}
.voice-orb-core {
  display: grid;
  gap: 8px;
  place-items: center;
  width: 72%;
}
.voice-orb-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 8vw, 54px);
  line-height: 1;
  letter-spacing: -.03em;
}
.voice-orb-action {
  max-width: 150px;
  color: #b9c0b1;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 750;
}
.voice-status {
  width: min(460px, 100%);
  margin-top: 25px;
  padding: 0;
  border: 0;
  background: transparent;
}
.voice-status .statusline {
  justify-content: center;
}
.voice-status .meta {
  margin-top: 5px;
}
.voice-stage > .meter {
  width: min(380px, 76%);
  margin-top: 13px;
}
.voice-stage > .save-badge {
  margin-top: 12px;
}
.voice-stop {
  margin-top: 14px;
  min-width: 180px;
}
.voice-stop:disabled {
  display: none;
}
.story-indicators {
  padding: 22px 0 4px;
  border-top: 1px solid var(--border);
}
.story-indicators-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}
.story-indicators-head strong {
  font-size: 16px;
}
.story-indicators .lifemap-categories {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}
.lifemap-indicator {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid #343a30;
  border-radius: 14px;
  background: #12140f;
  user-select: none;
}
.lifemap-indicator-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 9px;
  min-height: 34px;
  font-size: 12px;
  line-height: 1.25;
}
.lifemap-indicator-head span {
  color: #d4d8ce;
}
.lifemap-indicator-head strong {
  flex: 0 0 auto;
  color: #949d8d;
  font-size: 11px;
}
.lifemap-indicator-track {
  height: 5px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #090b09;
}
.lifemap-indicator-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7dc260, #c4d69e);
  transition: width .35s ease;
}
.interview-attachment {
  margin-top: 24px;
  padding: 22px 0 0;
  border-top: 1px solid var(--border);
  text-align: center;
}
.attachment-main-button {
  width: 100%;
  min-height: 58px;
  border: 1px solid #59634f;
  border-radius: 18px;
  background: #22281e;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 850;
}
.attachment-main-button:not(:disabled):hover,
.attachment-main-button:not(:disabled):focus-visible {
  background: #2a3125;
  border-color: #76826a;
}
.interview-attachment > p {
  margin: 9px auto 0;
  max-width: 520px;
}
.attachment-status {
  margin: 9px 0 0;
  text-align: center;
}
.interview-more {
  margin-top: 22px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  color: var(--muted);
  font-size: 13px;
}
.interview-more > summary {
  cursor: pointer;
  text-align: center;
}
.interview-more-body {
  padding-top: 4px;
}
.interview-more .settings,
.interview-more .interview-transcript,
.interview-more .diagnostics {
  margin-top: 14px;
}
.story-more {
  max-width: 760px;
}
.story-more > summary {
  list-style-position: outside;
}
.story-more .assets-panel:first-of-type {
  margin-top: 24px;
}
@media (max-width: 700px) {
  #dashboardView .dashboard-head {
    align-items: flex-start;
  }
  .voice-panel {
    padding: 18px;
  }
  .journey-overview {
    padding-bottom: 18px;
  }
  .voice-stage {
    padding: 33px 0 22px;
  }
  .story-indicators .lifemap-categories {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .story-indicators-head {
    display: block;
  }
  .story-indicators-head .small {
    display: block;
    margin-top: 4px;
  }
  .lifemap-indicator {
    padding: 11px;
  }
  .attachment-main-button {
    min-height: 56px;
  }
}
@media (max-width: 380px) {
  .story-indicators .lifemap-categories {
    grid-template-columns: 1fr;
  }
}


/* Interview hamburger menu; scoped so the rest of the site keeps its current shell. */
.menu-button {
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
}
.menu-button span {
  display: block;
  width: 24px;
  height: 2px;
  margin: 5px auto;
  border-radius: 999px;
  background: currentColor;
}
body.interview-mode .topbar {
  padding-inline: 2px;
}
body.interview-mode .topbar .brand-block {
  margin-left: auto;
  text-align: right;
}
body.interview-mode .topbar .tagline {
  display: none;
}
.interview-menu {
  width: min(340px, calc(100% - 32px));
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0 auto 0 0;
  padding: 24px 18px;
  border: 0;
  border-right: 1px solid #394033;
  border-radius: 0 22px 22px 0;
  background: #151912;
  color: var(--text);
  box-shadow: 30px 0 90px rgba(0,0,0,.42);
}
.interview-menu::backdrop {
  background: rgba(0,0,0,.62);
}
.interview-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 4px 20px;
  border-bottom: 1px solid var(--border);
}
.interview-menu-head strong {
  font-size: 20px;
}
.menu-close {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #252b21;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}
.interview-menu-nav {
  display: grid;
  gap: 8px;
  padding-top: 18px;
}
.interview-menu-nav button {
  width: 100%;
  padding: 15px 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  font-weight: 750;
}
.interview-menu-nav button:hover,
.interview-menu-nav button:focus-visible {
  background: #242a20;
}
@media (max-width: 700px) {
  body.interview-mode .topbar {
    padding-bottom: 12px;
  }
  .interview-menu {
    width: min(320px, 88vw);
  }
}
