:root {
  --ivory: #faf8f5;
  --charcoal: #222222;
  --burgundy: #7a4a52;
  --stone: #d9d2c8;
  --cream: #efe6e2;
  --white: #fffdfa;
  --muted: #665f59;
  --line: rgba(34, 34, 34, 0.11);
  --shadow: 0 18px 54px rgba(70, 53, 42, 0.06);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--ivory);
  color: var(--charcoal);
  font-family: var(--sans);
  line-height: 1.55;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
select,
input[type="range"] {
  cursor: pointer;
}

.app-header,
main {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
  background: rgba(250, 248, 245, 0.9);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.brand,
.app-header a {
  color: inherit;
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  width: 172px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand img {
  width: 100%;
  height: auto;
}

.app-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.app-header nav a:hover {
  color: var(--burgundy);
}

.app-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: end;
  padding: clamp(42px, 7vw, 84px) 0 clamp(28px, 4vw, 46px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--burgundy);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 0.98;
}

h1 {
  max-width: 820px;
  margin-bottom: 18px;
  font-size: clamp(3.7rem, 8.4vw, 6.5rem);
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 4.3vw, 3.8rem);
}

h3 {
  margin: 0 0 16px;
  font-size: 1.7rem;
}

.hero-copy {
  max-width: 740px;
  margin-bottom: 0;
  color: #3d3632;
  font-size: clamp(1.04rem, 1.8vw, 1.24rem);
}

.prototype-note,
.panel,
.stat-card,
.compare-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.54);
  box-shadow: var(--shadow);
}

.prototype-note {
  padding: 22px;
}

.prototype-note span,
.stat-card span,
.chart-header,
.microcopy,
.placeholder-card span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prototype-note p,
.section-note,
.microcopy,
.stat-card p,
.placeholder-card p {
  color: var(--muted);
}

.prototype-note p {
  margin: 10px 0 0;
  font-size: 0.92rem;
}

.dashboard,
.profile-panel,
.workspace,
.progress-section,
.comparison-section,
.events-section,
.research-section,
.disclaimer-block {
  margin-top: clamp(42px, 6vw, 72px);
}

.panel {
  padding: clamp(18px, 3vw, 28px);
}

.section-heading,
.panel-heading,
.chart-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.section-heading {
  align-items: end;
}

.section-note {
  max-width: 360px;
  margin: 0;
  font-size: 0.92rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  min-height: 136px;
  padding: 20px;
}

.stat-card strong {
  display: block;
  margin-top: 22px;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 600;
  line-height: 0.92;
}

.stat-card p {
  margin: 12px 0 0;
  font-size: 0.86rem;
}

.metadata-grid,
.workspace,
.progress-layout,
.research-grid {
  display: grid;
  gap: 18px;
}

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

label {
  display: grid;
  gap: 8px;
  color: #433c37;
  font-size: 0.82rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--stone);
  border-radius: 8px;
  background: var(--ivory);
  color: var(--charcoal);
  padding: 11px 12px;
}

input,
select {
  min-height: 44px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--burgundy);
  outline: 3px solid rgba(122, 74, 82, 0.13);
}

.workspace {
  grid-template-columns: minmax(0, 1fr) minmax(390px, 0.82fr);
  align-items: start;
}

.compact {
  align-items: center;
}

.side-toggle {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 252px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ivory);
}

.side-toggle button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.side-toggle button.is-active {
  background: var(--burgundy);
  color: #fffaf8;
}

.diagram-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  place-items: center;
  min-height: 500px;
  margin: 20px 0 18px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(239, 230, 226, 0.48), rgba(250, 248, 245, 0.9)),
    repeating-linear-gradient(90deg, rgba(122, 74, 82, 0.045) 0 1px, transparent 1px 38px);
}

.diagram-wrap.is-bilateral {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.breast-map {
  width: min(100%, 360px);
  height: auto;
}

.body-line {
  fill: rgba(255, 253, 250, 0.62);
  stroke: rgba(34, 34, 34, 0.18);
  stroke-width: 2;
}

.zone {
  fill: rgba(217, 210, 200, 0.44);
  stroke: rgba(122, 74, 82, 0.32);
  stroke-width: 2;
  transition: fill 160ms ease, stroke 160ms ease;
}

.zone:hover,
.zone.is-selected {
  fill: rgba(122, 74, 82, 0.34);
}

.zone.is-selected {
  stroke: #7a4a52;
  stroke-width: 3;
}

.zone[data-heat="near-normal"] {
  fill: rgba(113, 139, 103, 0.34);
}

.zone[data-heat="reduced"] {
  fill: rgba(204, 170, 93, 0.34);
}

.zone[data-heat="significant"] {
  fill: rgba(177, 111, 74, 0.34);
}

.zone[data-heat="absent"] {
  fill: rgba(122, 74, 82, 0.42);
}

.areola {
  fill: rgba(239, 230, 226, 0.74);
}

.region-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.region-button {
  display: grid;
  gap: 5px;
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(250, 248, 245, 0.72);
  color: var(--charcoal);
  text-align: left;
}

.region-button span {
  color: var(--burgundy);
  font-size: 0.72rem;
  font-weight: 700;
}

.region-button strong {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.02;
}

.region-button.is-selected {
  border-color: rgba(122, 74, 82, 0.5);
  background: rgba(239, 230, 226, 0.78);
}

.timepoint-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.selected-region {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.selected-region span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.selected-region strong {
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 600;
  text-align: right;
}

.assessment-block {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.slider-stack {
  display: grid;
  gap: 14px;
}

.metric {
  grid-template-columns: minmax(150px, 0.72fr) minmax(140px, 1fr) 2ch;
  gap: 14px;
  align-items: center;
}

.metric output {
  color: var(--burgundy);
  font-weight: 800;
  text-align: right;
}

input[type="range"] {
  accent-color: var(--burgundy);
  padding: 0;
}

.notes-field,
.file-field {
  margin-top: 16px;
}

.goal-row,
.action-row,
.event-form,
.compact-actions {
  display: flex;
  gap: 10px;
}

.goal-row select {
  flex: 1;
}

.goal-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.goal-item {
  grid-template-columns: minmax(140px, 0.7fr) minmax(120px, 1fr) 2ch auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(250, 248, 245, 0.64);
}

.goal-item button,
.delete-entry,
.event-item button {
  border: 0;
  background: transparent;
  color: var(--burgundy);
  font-size: 0.82rem;
  font-weight: 700;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--burgundy);
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 0.9rem;
  font-weight: 700;
}

.button.primary {
  background: var(--burgundy);
  color: #fffaf8;
}

.button.secondary {
  background: transparent;
  color: var(--burgundy);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.progress-layout,
.research-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.62fr);
}

.trend-chart {
  width: 100%;
  min-height: 260px;
  overflow: visible;
}

.trend-chart text {
  fill: var(--muted);
  font: 700 12px var(--sans);
}

.trend-chart .grid {
  stroke: rgba(34, 34, 34, 0.1);
}

.trend-chart .line {
  fill: none;
  stroke: var(--burgundy);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-chart .dot {
  fill: var(--burgundy);
}

.event-line {
  stroke: rgba(122, 74, 82, 0.28);
  stroke-dasharray: 5 6;
}

.event-label {
  fill: var(--burgundy);
  font-size: 10px;
}

.timeline-list,
.event-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
}

.timepoint,
.event-item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(250, 248, 245, 0.7);
}

.timepoint header,
.event-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.timepoint strong,
.event-item strong {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
}

.timepoint span,
.timepoint p,
.event-item span,
.event-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.comparison-panel {
  display: grid;
  grid-template-columns: minmax(180px, 0.4fr) minmax(180px, 0.4fr) 1fr;
  gap: 14px;
  align-items: end;
}

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

.compare-card {
  padding: 14px;
}

.compare-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.compare-card strong {
  display: block;
  margin-top: 8px;
  color: var(--burgundy);
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 600;
}

.compare-card.is-positive {
  background: rgba(113, 139, 103, 0.11);
}

.compare-card.is-negative {
  background: rgba(122, 74, 82, 0.1);
}

.event-form {
  align-items: end;
  margin-bottom: 16px;
}

.placeholder-card {
  padding: 22px;
}

.placeholder-card p {
  margin: 12px 0 18px;
}

.empty-state,
.empty-small {
  color: var(--muted);
  text-align: center;
}

.empty-state {
  display: grid;
  min-height: 240px;
  place-items: center;
}

.empty-small {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.disclaimer-block {
  padding-bottom: 48px;
}

.disclaimer-block p {
  max-width: 900px;
  margin: 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

.site-footer {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px 28px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--burgundy);
}

.site-footer p {
  margin: 8px 0 0;
}

.site-footer .disclaimer {
  grid-column: 1 / -1;
  max-width: 760px;
  font-size: 0.82rem;
}

@media (max-width: 1040px) {
  .metadata-grid,
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace,
  .progress-layout,
  .research-grid,
  .comparison-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-header,
  main,
  .site-footer {
    width: min(100% - 28px, 1220px);
  }

  .app-header {
    align-items: start;
    flex-direction: column;
    gap: 12px;
  }

  .brand {
    width: 148px;
  }

  .app-header nav {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .app-hero,
  .metadata-grid,
  .stat-grid,
  .comparison-grid,
  .site-footer {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(3.25rem, 16vw, 4.9rem);
  }

  h2 {
    font-size: clamp(2.15rem, 11vw, 3.2rem);
  }

  .section-heading,
  .panel-heading,
  .goal-row,
  .action-row,
  .event-form,
  .compact-actions {
    display: grid;
  }

  .side-toggle,
  .button {
    width: 100%;
  }

  .diagram-wrap,
  .diagram-wrap.is-bilateral {
    grid-template-columns: 1fr;
    min-height: 360px;
  }

  .breast-map {
    width: min(100%, 310px);
  }

  .region-strip {
    grid-template-columns: 1fr;
  }

  .metric,
  .goal-item {
    grid-template-columns: 1fr 2ch;
    gap: 8px 12px;
  }

  .metric input,
  .goal-item input,
  .goal-item button {
    grid-column: 1 / -1;
  }
}
