:root {
  color-scheme: light;
  --brown: #372416;
  --muted-brown: #5C4A38;
  --gold: #A8882E;
  --gold-dark: #80671f;
  --cream: #F9F6F0;
  --paper: #fffdf9;
  --line: #ded4c8;
  --soft-gold: #f1ead7;
  --red: #8b342c;
  --soft-red: #f8e9e6;
  --shadow: 0 14px 36px rgba(55, 36, 22, 0.1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--brown);
  background: var(--cream);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 19px;
}

.page-shell {
  width: min(880px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 80px;
}

.back-link, .text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  max-width: 100%;
  color: var(--muted-brown);
  font-family: "Proxima Nova", Arial, sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}

.back-link:hover, .text-link:hover { color: var(--gold-dark); text-decoration: underline; }
.masthead { margin: 36px auto 30px; text-align: center; }
.logo { width: 250px; max-width: 70vw; height: auto; }

.eyebrow, .notice-label {
  margin: 22px 0 8px;
  color: var(--gold-dark);
  font-family: "Proxima Nova", Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2, h3 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 500;
  line-height: 1.1;
}

h1 { margin: 0; font-size: clamp(2.6rem, 8vw, 4.8rem); }
h2 { margin: 0 0 18px; font-size: clamp(1.9rem, 5vw, 2.6rem); }
h3 { margin: 0 0 14px; font-size: 1.45rem; }
p { line-height: 1.58; }

.subtitle {
  max-width: 610px;
  margin: 16px auto 20px;
  color: var(--muted-brown);
  font-size: 1.3rem;
  font-style: italic;
}

.access-badge {
  display: inline-block;
  padding: 7px 12px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold-dark);
  font-family: "Proxima Nova", Arial, sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.setup-card, .ended-card { padding: clamp(24px, 6vw, 54px); }
.setup-card > p { color: var(--muted-brown); }

.information-notice {
  margin: 30px 0;
  padding: clamp(20px, 4vw, 30px);
  border-top: 3px solid var(--gold);
  background: var(--cream);
}

.information-notice .notice-label { margin-top: 0; }
.information-notice p { margin: 12px 0 0; font-size: 0.98rem; }

.field { display: grid; gap: 8px; margin: 18px 0; font-weight: 600; }
input[type="password"], textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: white;
  color: var(--brown);
  font: inherit;
  padding: 13px 14px;
}

select { min-width: 96px; font-family: "Proxima Nova", Arial, sans-serif; font-size: 0.86rem; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(168, 136, 46, 0.28);
  outline-offset: 2px;
}

.consent-row { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; margin: 22px 0 8px; line-height: 1.42; }
.consent-row input { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 4px; accent-color: var(--gold-dark); }
.optional-consent { padding-top: 18px; border-top: 1px solid var(--line); }
.consent-detail { margin: 7px 0 18px; color: var(--muted-brown); font-size: 0.82rem; line-height: 1.45; }
.access-field { max-width: 420px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  max-width: 100%;
  border: 0;
  border-radius: 2px;
  padding: 14px 22px;
  font-family: "Proxima Nova", Arial, sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  white-space: normal;
  cursor: pointer;
}

.button:disabled { cursor: not-allowed; opacity: 0.48; }
.primary { background: var(--gold); color: white; }
.primary:hover:not(:disabled) { background: var(--gold-dark); }
.secondary { border: 1px solid var(--gold); background: transparent; color: var(--brown); }
.secondary:hover:not(:disabled) { background: var(--soft-gold); }
.link-button { padding-inline: 0; background: transparent; color: var(--gold-dark); text-decoration: underline; }
.danger { border: 1px solid var(--red); background: transparent; color: var(--red); }
.danger:hover:not(:disabled) { background: var(--soft-red); }
.message { min-height: 1.5em; margin: 14px 0 0; color: var(--red); font-family: "Proxima Nova", Arial, sans-serif; font-size: 0.8rem; font-weight: 700; }

.session-heading { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 24px 28px; border-bottom: 1px solid var(--line); }
.session-heading .eyebrow { margin-top: 0; }
.session-heading h2 { margin: 0; }
.session-meta { display: grid; gap: 6px; text-align: right; color: var(--muted-brown); font-family: "Proxima Nova", Arial, sans-serif; font-size: 0.72rem; }
.status-panel { display: flex; align-items: center; justify-content: center; gap: 24px; min-height: 120px; padding: 26px; background: var(--cream); border-bottom: 1px solid var(--line); }
.breath-dot { width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%; background: var(--gold); opacity: 0.78; }
.breath-dot.waiting { animation: breathe 12s ease-in-out infinite; }
.status-label { margin: 0; font-family: "Playfair Display", Georgia, serif; font-size: 1.35rem; }
.status-detail { margin: 7px 0 0; color: var(--muted-brown); font-size: 0.98rem; }

@keyframes breathe { 0% { transform: scale(0.65); } 41.666% { transform: scale(2.1); } 100% { transform: scale(0.65); } }
@media (prefers-reduced-motion: reduce) { .breath-dot { animation: none !important; } }

.transcript { min-height: 270px; max-height: 500px; overflow-y: auto; padding: 28px; display: grid; align-content: start; gap: 16px; }
.turn { max-width: 82%; padding: 15px 18px; border-radius: 3px; line-height: 1.5; font-size: 1.08rem; white-space: pre-wrap; }
.turn .speaker { display: block; margin-bottom: 7px; color: var(--gold-dark); font-family: "Proxima Nova", Arial, sans-serif; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; }
.turn.companion { justify-self: start; background: var(--cream); }
.turn.user { justify-self: end; background: var(--soft-gold); }
.turn.safety { justify-self: start; border: 1px solid #d79b92; background: var(--soft-red); }
.writing-panel { padding: 18px 28px 24px; border-top: 1px solid var(--line); }
.primary-writing-panel textarea { min-height: 150px; }
.utility-controls { display: flex; gap: 10px; padding: 0 28px 20px; }
.session-footer { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 20px 28px 26px; border-top: 1px solid var(--line); }
.cost-message { margin: 0; max-width: 520px; color: var(--muted-brown); font-size: 0.82rem; line-height: 1.45; }
.hidden { display: none !important; }

.feedback-form { margin: 34px 0; padding-top: 28px; border-top: 1px solid var(--line); }
.feedback-intro { color: var(--muted-brown); }
.rating-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 20px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); line-height: 1.35; }
.next-steps { display: grid; justify-items: start; gap: 14px; margin: 30px 0; padding: 26px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.next-steps .consent-detail { margin: -6px 0 8px; }

@media (max-width: 640px) {
  body { font-size: 18px; }
  .page-shell { width: min(100% - 20px, 880px); padding-top: 18px; }
  .masthead { margin-top: 26px; }
  .session-heading, .session-footer { align-items: flex-start; flex-direction: column; }
  .session-meta { text-align: left; }
  .status-panel { justify-content: flex-start; }
  .turn { max-width: 94%; }
  .utility-controls { align-items: stretch; flex-direction: column; }
  .utility-controls .button, .session-footer .button { width: 100%; }
  .rating-row { grid-template-columns: 1fr; gap: 8px; }
  .rating-row select { min-height: 44px; max-width: 130px; font-size: 1rem; }
}
