:root {
  --olive: #a3af33;
  --olive-dark: #7d871f;
  --sage: #efffeb;
  --cream: #faf9f6;
  --warm-tan: #d0a66c;
  --ink: #000;
  --ink-soft: #2a2a2a;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', sans-serif;
  font-weight: 300;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--cream);
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: 'Domine', serif;
  font-weight: 700;
  line-height: 1.2;
  text-wrap: balance;
}

h1 { font-size: 42px; }
h2 { font-size: 28px; }
h3 { font-size: 21px; }

p { text-wrap: balance; }

a { color: var(--olive-dark); text-decoration: underline; }
a:hover { color: var(--olive); }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  font-family: 'Poppins', sans-serif;
  font-weight: 300;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--olive-dark);
  margin-bottom: 12px;
}

/* Top nav */
.topnav {
  background: var(--cream);
  border-bottom: 4px solid var(--olive);
  padding: 16px 0;
}

.topnav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topnav__brand {
  font-family: 'Domine', serif;
  font-weight: 700;
  font-size: 20px;
  text-decoration: none;
  color: var(--ink);
}

.topnav__brand:hover { color: var(--olive-dark); }

.topnav__user {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.topnav__email {
  color: var(--ink-soft);
}

/* Buttons */
.btn {
  display: inline-block;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 28px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s, color 0.15s;
}

.btn--primary {
  background: var(--olive);
  color: var(--ink);
}

.btn--primary:hover {
  background: var(--olive-dark);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
}

.btn--ghost:hover {
  background: var(--ink);
  color: var(--cream);
}

.btn--small {
  font-size: 13px;
  padding: 8px 18px;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  background: var(--sage);
  color: var(--ink-soft);
  cursor: not-allowed;
}

/* Cards */
.card {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
}

.card--locked {
  background: var(--sage);
  opacity: 0.85;
}

/* Login page */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 48px 40px;
  max-width: 440px;
  width: 100%;
}

.login-card h1 {
  font-size: 32px;
  margin-bottom: 8px;
}

.login-card__subtitle {
  color: var(--ink-soft);
  margin-bottom: 32px;
}

.form-field {
  margin-bottom: 20px;
}

.form-field label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

.form-field input {
  width: 100%;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  padding: 12px 14px;
  border: 2px solid var(--cream);
  border-radius: 12px;
  background: var(--cream);
  transition: border-color 0.15s, background 0.15s;
}

.form-field input:focus {
  outline: none;
  border-color: var(--olive);
  background: #fff;
}

.form-error {
  background: #fef2f2;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 16px;
}

.form-error[hidden] { display: none; }

/* Dashboard */
.dashboard-hero {
  padding: 56px 0 24px;
}

.dashboard-hero h1 {
  margin-bottom: 8px;
}

.dashboard-hero__sub {
  color: var(--ink-soft);
  max-width: 640px;
}

.weeks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  padding: 24px 0 80px;
}

.week-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s;
}

.week-card:hover {
  transform: translateY(-3px);
}

.week-card--locked {
  background: var(--sage);
  cursor: not-allowed;
  opacity: 0.75;
}

.week-card--locked:hover {
  transform: none;
}

.week-card__number {
  font-family: 'Poppins', sans-serif;
  font-weight: 300;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--olive-dark);
}

.week-card__title {
  font-family: 'Domine', serif;
  font-size: 22px;
  font-weight: 700;
}

.week-card__anchor {
  flex-grow: 1;
  color: var(--ink-soft);
  font-size: 15px;
}

.week-card__status {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--olive-dark);
  font-weight: 600;
}

.week-card--locked .week-card__status {
  color: var(--ink-soft);
}

/* Week page */
.week-page {
  padding-bottom: 80px;
}

.week-hero {
  padding: 56px 0 32px;
}

.week-hero h1 {
  margin-bottom: 12px;
}

.week-section {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 24px;
}

.week-section__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.placeholder-block {
  background: var(--sage);
  border-radius: 12px;
  padding: 48px 32px;
  text-align: center;
  color: var(--ink-soft);
}

.placeholder-block strong { color: var(--ink); }

/* Lesson (written module content) */
.lesson p {
  margin-bottom: 16px;
}

.lesson p:last-child {
  margin-bottom: 0;
}

.lesson h3 {
  margin-top: 36px;
  margin-bottom: 12px;
}

.lesson strong {
  font-weight: 600;
  color: var(--ink);
}

/* Flow graphic */
.funnel {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin: 28px 0;
}

.funnel__stage {
  flex: 1;
  background: var(--sage);
  border-radius: 16px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.funnel__stage--end {
  background: var(--olive);
}

.funnel__label {
  font-family: 'Domine', serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
}

.funnel__desc {
  font-family: 'Poppins', sans-serif;
  font-weight: 300;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.funnel__stage--end .funnel__desc {
  color: var(--ink);
}

.funnel__arrow {
  display: flex;
  align-items: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--olive-dark);
}

/* Upcoming-weeks map */
.weekmap {
  list-style: none;
  margin: 24px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.weekmap li {
  background: var(--sage);
  border-radius: 16px;
  padding: 14px 18px;
  font-size: 15px;
  line-height: 1.5;
}

.weekmap__wk {
  font-family: 'Domine', serif;
  font-weight: 700;
  color: var(--olive-dark);
  margin-right: 10px;
}

/* Loading state */
.loading {
  text-align: center;
  padding: 80px 24px;
  color: var(--ink-soft);
}

/* Homework chat */
.homework {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.homework__loading,
.homework__error {
  background: var(--sage);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  color: var(--ink-soft);
}

.homework__error {
  background: #fef2f2;
  color: #991b1b;
}

.homework__intro {
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.homework__done-heading {
  margin-bottom: 12px;
}

.homework__done-note {
  color: var(--ink-soft);
  font-size: 14px;
}

.summary-block {
  background: var(--sage);
  border-radius: 12px;
  padding: 24px;
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--ink);
  overflow-x: auto;
}

/* Saved pipeline numbers - scannable, grouped layout */
.pipeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pipeline__group {
  background: var(--sage);
  border-radius: 16px;
  padding: 24px 28px;
}

.pipeline__group--emphasis {
  background: var(--olive);
}

.pipeline__group-label {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--olive-dark);
  margin-bottom: 16px;
}

.pipeline__group--emphasis .pipeline__group-label {
  color: var(--ink);
}

.pipeline__rows {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 24px;
  margin: 0;
}

.pipeline__row-label {
  font-family: 'Poppins', sans-serif;
  font-weight: 300;
  font-size: 15px;
  color: var(--ink-soft);
  align-self: center;
}

.pipeline__row-value {
  font-family: 'Domine', serif;
  font-weight: 700;
  font-size: 18px;
  text-align: right;
  color: var(--ink);
  margin: 0;
}

.pipeline__group--emphasis .pipeline__row-label {
  color: var(--ink);
  font-weight: 400;
}

.pipeline__group--emphasis .pipeline__row-value {
  font-size: 22px;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 520px;
  overflow-y: auto;
  padding: 8px 4px;
}

.chat-message {
  display: flex;
}

.chat-message--user {
  justify-content: flex-end;
}

.chat-message--assistant {
  justify-content: flex-start;
}

.chat-message__bubble {
  max-width: 80%;
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.chat-message--user .chat-message__bubble {
  background: var(--olive);
  color: var(--ink);
}

.chat-message--assistant .chat-message__bubble {
  background: var(--sage);
  color: var(--ink);
}

.chat-input {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.chat-input__textarea {
  flex: 1;
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 300;
  padding: 14px 16px;
  border: 2px solid var(--cream);
  border-radius: 16px;
  background: var(--cream);
  resize: vertical;
  min-height: 56px;
  max-height: 200px;
  transition: border-color 0.15s, background 0.15s;
}

.chat-input__textarea:focus {
  outline: none;
  border-color: var(--olive);
  background: #fff;
}

.chat-input__send {
  flex-shrink: 0;
}

.chat-input__error {
  background: #fef2f2;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
}

.chat-input__error[hidden] { display: none; }

/* Mobile */
@media (max-width: 640px) {
  h1 { font-size: 32px; }
  h2 { font-size: 24px; }
  .login-card { padding: 32px 24px; }
  .week-card { padding: 22px; }
  .topnav__email { display: none; }
  .chat-message__bubble { max-width: 92%; font-size: 14px; }
  .chat-thread { max-height: 460px; }
  .pipeline__group { padding: 20px; }
  .pipeline__row-value { font-size: 16px; }
  .pipeline__group--emphasis .pipeline__row-value { font-size: 19px; }
  .funnel { flex-direction: column; }
  .funnel__arrow { transform: rotate(90deg); align-self: center; }
}
