:root {
  color-scheme: light;
  --bg: #f5f1e8;
  --ink: #17211d;
  --muted: #66716b;
  --line: rgba(23, 33, 29, 0.12);
  --surface: #fffdf8;
  --surface-soft: #ebe7dd;
  --sage: #6f8f7b;
  --sage-dark: #254f43;
  --coral: #d86e58;
  --blue: #6d91b9;
  --gold: #c69a46;
  --shadow: 0 24px 70px rgba(39, 45, 39, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 18%, rgba(216, 110, 88, 0.16), transparent 28vw),
    radial-gradient(circle at 84% 26%, rgba(109, 145, 185, 0.22), transparent 30vw),
    linear-gradient(135deg, #f5f1e8 0%, #e8efe8 46%, #efe6dc 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.prototype-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(330px, 460px);
  align-items: center;
  gap: clamp(28px, 7vw, 96px);
  width: min(1120px, calc(100% - 36px));
  min-height: 100svh;
  margin: 0 auto;
  padding: 40px 0;
}

.prototype-brief {
  max-width: 560px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 42px;
  color: var(--sage-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
}

.eyebrow,
.label {
  margin: 0;
  color: var(--coral);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 22px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4rem, 8vw, 6.1rem);
  font-weight: 400;
  line-height: 0.88;
  letter-spacing: 0;
}

.prototype-brief > p:last-of-type {
  max-width: 480px;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.16rem);
  line-height: 1.75;
}

.brief-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.brief-actions span {
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.58);
  color: var(--sage-dark);
  font-size: 0.76rem;
  font-weight: 800;
}

.phone-frame {
  justify-self: center;
  width: min(100%, 430px);
  padding: 12px;
  border-radius: 42px;
  background: #111915;
  box-shadow: var(--shadow);
}

.phone-screen {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: min(780px, calc(100svh - 44px));
  min-height: 660px;
  overflow: hidden;
  border-radius: 32px;
  background: var(--surface);
}

.phone-screen::before {
  position: absolute;
  left: 50%;
  top: 12px;
  z-index: 8;
  width: 82px;
  height: 23px;
  border-radius: 999px;
  background: #111915;
  content: "";
  transform: translateX(-50%);
}

.onboarding-screen {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: none;
  min-height: 0;
  overflow: auto;
  padding: 58px 20px 24px;
  background:
    radial-gradient(circle at 82% 11%, rgba(198, 154, 70, 0.23), transparent 34%),
    radial-gradient(circle at 12% 80%, rgba(109, 145, 185, 0.18), transparent 34%),
    linear-gradient(160deg, #fffdf8 0%, #edf4ec 56%, #f4e7df 100%);
}

.onboarding-screen.is-active {
  display: flex;
  flex-direction: column;
}

.onboarding-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
}

.onboarding-brand span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 15px;
  background: var(--sage-dark);
  color: #fffdf8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}

.onboarding-brand p {
  margin: 0;
  color: var(--sage-dark);
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.onboarding-copy h2 {
  max-width: 330px;
  margin: 9px 0 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.25rem, 10vw, 3.1rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: 0;
}

.onboarding-copy > p:last-child {
  max-width: 335px;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

.onboarding-steps {
  display: grid;
  gap: 10px;
  margin: 20px 0 12px;
}

.onboarding-steps article {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.76);
}

.onboarding-steps strong {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--coral);
  color: #fffdf8;
  font-size: 0.82rem;
}

.onboarding-steps h3 {
  margin: 0;
  font-size: 0.95rem;
}

.onboarding-steps p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.38;
}

.privacy-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  margin-top: auto;
  padding: 13px;
  border-radius: 18px;
  background: rgba(37, 79, 67, 0.09);
}

.privacy-note span {
  width: 16px;
  height: 20px;
  border: 2px solid var(--sage-dark);
  border-radius: 5px;
  box-shadow: 0 -7px 0 -4px var(--sage-dark);
}

.privacy-note p {
  margin: 0;
  color: var(--sage-dark);
  font-size: 0.77rem;
  font-weight: 760;
  line-height: 1.42;
}

.onboarding-button {
  margin-top: 14px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 54px 22px 18px;
  border-bottom: 1px solid var(--line);
}

.app-header p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-header h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-soft);
}

.icon-button span {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 9px -3px 0 -3px var(--gold);
}

.screen-view {
  display: none;
  min-height: 0;
  overflow: auto;
  padding: 18px 18px 94px;
}

.screen-view.is-active {
  display: block;
}

.hero-status,
.prompt-card,
.insight-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, #fdf7ed, #e8f0e8);
}

.hero-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
}

.hero-status h3 {
  margin: 5px 0 0;
  font-size: 1.5rem;
  line-height: 1.1;
}

.hero-status strong {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--sage-dark);
  color: #fffdf8;
  font-size: 1.3rem;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0 24px;
}

.quick-grid article,
.contact-card,
.person-row,
.settings-list label,
.settings-replay {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.78);
}

.quick-grid article {
  min-height: 84px;
  padding: 13px;
}

.quick-grid span {
  display: block;
  color: var(--sage-dark);
  font-size: 1.38rem;
  font-weight: 850;
}

.quick-grid p,
.person-row p,
.contact-card p,
.settings-list small {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

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

.section-heading h3 {
  margin: 0;
  font-size: 1.12rem;
}

.section-heading button,
.filter-row button,
.prompt-tabs button,
.mood-row button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdf8;
  color: var(--sage-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.contact-stack,
.people-list,
.settings-list {
  display: grid;
  gap: 10px;
}

.contact-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 13px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: var(--sage);
  color: #fff;
  font-weight: 900;
}

.contact-card:nth-child(2) .avatar,
.person-row:nth-child(2) .avatar {
  background: var(--coral);
}

.contact-card:nth-child(3) .avatar,
.person-row:nth-child(3) .avatar {
  background: var(--blue);
}

.contact-card h4,
.person-row h4 {
  margin: 0;
  font-size: 0.98rem;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.card-actions button,
.primary-button {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: var(--sage-dark);
  color: #fffdf8;
  font-size: 0.78rem;
  font-weight: 850;
}

.card-actions button {
  padding: 0 14px;
}

.card-actions button.secondary {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--sage-dark);
}

.filter-row,
.prompt-tabs,
.mood-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.filter-row button,
.prompt-tabs button,
.mood-row button {
  flex: 0 0 auto;
  padding: 0 14px;
}

.filter-row .is-selected,
.prompt-tabs .is-selected,
.mood-row .is-selected {
  border-color: var(--sage-dark);
  background: var(--sage-dark);
  color: #fffdf8;
}

.person-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.cadence {
  color: var(--coral);
  font-size: 0.72rem;
  font-weight: 900;
}

.prompt-card {
  margin: 10px 0 16px;
  padding: 22px;
}

.prompt-card h3 {
  margin: 10px 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
  font-weight: 400;
  line-height: 1.15;
}

.primary-button {
  width: 100%;
}

.note-field {
  display: grid;
  gap: 9px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

.note-field textarea {
  width: 100%;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  background: #fffdf8;
  color: var(--ink);
  line-height: 1.5;
}

.insight-card {
  margin-top: 14px;
  padding: 16px;
}

.insight-card span {
  color: var(--coral);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.insight-card p {
  margin: 8px 0 0;
  color: var(--sage-dark);
  font-weight: 760;
  line-height: 1.45;
}

.settings-list label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px;
}

.settings-list span {
  display: grid;
  gap: 2px;
  font-weight: 850;
}

.settings-list input {
  accent-color: var(--sage-dark);
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
}

.settings-replay {
  min-height: 48px;
  color: var(--sage-dark);
  font-size: 0.82rem;
  font-weight: 850;
}

.tab-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(18px);
}

.tab-bar button {
  min-width: 0;
  min-height: 44px;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.tab-bar button.is-active {
  background: var(--sage-dark);
  color: #fffdf8;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 10;
  max-width: min(360px, calc(100% - 32px));
  padding: 12px 16px;
  border-radius: 999px;
  background: #17211d;
  color: #fffdf8;
  font-size: 0.84rem;
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

body.theme-evening {
  --bg: #18231f;
  --ink: #fff9ef;
  --muted: #b8c5ba;
  --line: rgba(255, 249, 239, 0.14);
  --surface: #22312b;
  --surface-soft: #30443b;
  --sage-dark: #b7d0bd;
  background:
    radial-gradient(circle at 16% 18%, rgba(216, 110, 88, 0.14), transparent 28vw),
    radial-gradient(circle at 84% 26%, rgba(109, 145, 185, 0.16), transparent 30vw),
    #18231f;
}

body.theme-evening .phone-frame {
  background: #060908;
}

body.theme-evening .phone-screen::before {
  background: #060908;
}

body.theme-evening .onboarding-screen {
  background:
    radial-gradient(circle at 82% 11%, rgba(198, 154, 70, 0.15), transparent 34%),
    radial-gradient(circle at 12% 80%, rgba(109, 145, 185, 0.13), transparent 34%),
    linear-gradient(160deg, #22312b 0%, #26372f 56%, #2b302f 100%);
}

body.theme-evening .card-actions button,
body.theme-evening .hero-status strong,
body.theme-evening .tab-bar button.is-active,
body.theme-evening .filter-row .is-selected,
body.theme-evening .prompt-tabs .is-selected,
body.theme-evening .mood-row .is-selected,
body.theme-evening .primary-button {
  color: #17211d;
}

@media (max-width: 860px) {
  .prototype-shell {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 24px;
    padding-top: 24px;
  }

  .prototype-brief {
    max-width: 100%;
  }

  .back-link {
    margin-bottom: 28px;
  }

  h1 {
    font-size: clamp(3.7rem, 18vw, 5.2rem);
  }

  .phone-frame {
    width: min(100%, 410px);
  }
}

@media (max-width: 460px) {
  .prototype-shell {
    width: 100%;
    padding: 18px 0 0;
  }

  .prototype-brief {
    padding: 0 18px;
  }

  .brief-actions {
    display: none;
  }

  .phone-frame {
    width: 100%;
    padding: 0;
    border-radius: 34px 34px 0 0;
  }

  .phone-screen {
    height: 760px;
    max-height: calc(100svh - 18px);
    min-height: 640px;
    border-radius: 34px 34px 0 0;
  }

  .quick-grid {
    grid-template-columns: 1fr;
  }
}
