:root {
  --page: #f7f8fa;
  --surface: #ffffff;
  --plum: #791877;
  --plum-deep: #4b0e4a;
  --plum-soft: #fff9ff;
  --neutral: #e7e9ed;
  --neutral-deep: #6f7177;
  --charcoal: #2d2d2f;
  --muted: #5f6167;
  --line: #e1e4e8;
  --white: #ffffff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at top left, rgba(121, 24, 119, 0.08), transparent 32rem),
    linear-gradient(135deg, #ffffff, var(--page) 62%, #f1f3f6);
  color: var(--charcoal);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(121, 24, 119, 0.26);
  outline-offset: 3px;
}

.app-shell {
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 34px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 6px;
  color: var(--plum);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1.08;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 5vw, 4.75rem);
  line-height: 0.98;
  max-width: 850px;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.05rem;
}

p {
  color: var(--muted);
  line-height: 1.6;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.nav-pill,
.primary-button,
.secondary-button,
.consult-button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 750;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.nav-pill {
  background: var(--white);
  color: var(--charcoal);
  border-color: var(--line);
  box-shadow: 0 8px 22px rgba(45, 45, 47, 0.04);
}

.nav-pill:hover {
  background: var(--plum-soft);
  border-color: rgba(121, 24, 119, 0.32);
  color: var(--plum-deep);
}

.nav-pill.active {
  background: var(--plum-deep);
  border-color: var(--plum-deep);
  color: var(--white);
}

.screen-wrap {
  flex: 1;
}

.welcome-layout,
.summary-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
  align-items: stretch;
}

.hero-panel,
.privacy-panel,
.summary-card,
.summary-actions,
.field-card,
.topic-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(45, 45, 47, 0.07);
}

.hero-panel {
  min-height: 560px;
  padding: clamp(28px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-panel p {
  max-width: 660px;
  font-size: 1.05rem;
}

.privacy-panel {
  padding: 26px;
  align-self: end;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 20px;
}

.mini-grid span {
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid rgba(121, 24, 119, 0.18);
  color: var(--plum-deep);
  font-weight: 800;
  padding: 12px 8px;
  text-align: center;
}

.primary-button {
  width: fit-content;
  margin-top: 12px;
  background: var(--plum-deep);
  color: var(--white);
  box-shadow: 0 16px 34px rgba(77, 49, 73, 0.18);
}

.secondary-button {
  background: var(--white);
  border-color: rgba(123, 47, 114, 0.42);
  color: var(--plum-deep);
}

.consult-button {
  background: var(--plum-deep);
  color: var(--white);
  border-color: var(--plum-deep);
}

.primary-button:hover,
.consult-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(90, 31, 85, 0.2);
}

.secondary-button:hover {
  transform: translateY(-2px);
  background: var(--plum-soft);
  border-color: var(--plum);
}

.topic-card:hover {
  transform: translateY(-2px);
  border-color: rgba(121, 24, 119, 0.28);
  box-shadow: 0 20px 52px rgba(45, 45, 47, 0.1);
}

.content-stack,
.tracker-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-heading {
  padding: 8px 4px 0;
}

.section-heading h2 {
  font-size: clamp(1.9rem, 4vw, 3.25rem);
}

.section-intro {
  max-width: 760px;
}

.topic-grid,
.tracker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.topic-card {
  min-height: 230px;
  padding: 22px;
  text-align: left;
  color: var(--charcoal);
  display: flex;
  flex-direction: column;
}

.topic-card span {
  display: block;
  font-size: 1.12rem;
  font-weight: 850;
  line-height: 1.18;
}

.topic-card p {
  margin: 14px 0 18px;
  font-size: 0.94rem;
  line-height: 1.45;
}

.topic-card small {
  display: inline-flex;
  margin-top: auto;
  color: var(--plum);
  font-weight: 800;
}

.action-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(45, 45, 47, 0.36);
}

.topic-modal {
  position: relative;
  width: min(680px, 100%);
  max-height: min(680px, 90vh);
  overflow: auto;
  border-radius: 24px;
  background: var(--surface);
  padding: clamp(26px, 4vw, 42px);
  box-shadow: 0 30px 100px rgba(45, 45, 47, 0.24);
}

.topic-modal h3 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  line-height: 1.04;
}

.close-button {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--plum-soft);
  color: var(--charcoal);
  font-size: 1.6rem;
  line-height: 1;
}

.tracker-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tracker-section {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  padding: clamp(16px, 2.4vw, 24px);
}

.tracker-section h3 {
  margin: 0 0 14px;
  color: var(--plum);
  font-size: 0.98rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tracker-section-description {
  max-width: 760px;
  margin: -4px 0 16px;
  font-size: 0.94rem;
}

.field-card {
  padding: 18px;
}

.field-card legend,
.field-card > span {
  display: block;
  margin-bottom: 12px;
  color: var(--charcoal);
  font-weight: 850;
}

.field-card {
  margin: 0;
}

.rating-row,
.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rating-helper {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
}

.rating,
.toggle {
  min-width: 42px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
  font-weight: 800;
}

.toggle {
  padding: 0 14px;
}

.rating.active,
.toggle.active {
  background: var(--plum);
  border-color: var(--plum);
  color: var(--white);
}

select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--charcoal);
}

select {
  min-height: 44px;
  padding: 0 12px;
}

.summary-card {
  padding: clamp(24px, 4vw, 42px);
}

.summary-card h2 {
  font-size: clamp(2rem, 4vw, 3.35rem);
}

.summary-card section {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.summary-card ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.65;
}

.summary-category-list {
  display: grid;
  gap: 14px;
}

.summary-category {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfcfd;
  padding: 16px;
}

.summary-category h4 {
  margin: 0 0 8px;
  color: var(--charcoal);
  font-size: 1rem;
}

.summary-category p {
  margin-bottom: 10px;
}

.summary-context {
  border-top: 1px solid var(--line);
  margin: 0;
  padding-top: 18px;
}

.summary-context p {
  margin: 0 0 8px;
  color: var(--charcoal);
  font-weight: 750;
}

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

.summary-actions {
  position: sticky;
  top: 20px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}

.summary-actions button {
  width: 100%;
}

.diagnostic-reminder {
  margin: 16px 0 0;
  border-radius: 16px;
  background: var(--plum-soft);
  border: 1px solid rgba(121, 24, 119, 0.14);
  padding: 16px;
  color: var(--charcoal);
  font-weight: 700;
}

.summary-card li::marker {
  color: var(--plum);
}

.muted,
.note-copy {
  color: var(--muted);
}

.disclaimer {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .topbar,
  .welcome-layout,
  .summary-layout {
    grid-template-columns: 1fr;
  }

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

  nav {
    justify-content: flex-start;
  }

  .hero-panel {
    min-height: 480px;
  }

  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .app-shell {
    padding: 14px;
  }

  .hero-panel {
    min-height: auto;
  }

  .topic-grid,
  .tracker-grid {
    grid-template-columns: 1fr;
  }

  .topic-card {
    min-height: 188px;
  }

  .action-row {
    justify-content: stretch;
  }

  .action-row button,
  .primary-button {
    width: 100%;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .topbar,
  .no-print,
  .nav-pill,
  .modal-backdrop {
    display: none !important;
  }

  .app-shell {
    min-height: auto;
    padding: 0;
  }

  .screen-wrap {
    display: block;
  }

  .summary-layout {
    display: block;
  }

  .summary-card {
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .disclaimer {
    margin-top: 24px;
    color: #000000;
  }
}
