@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700;800&family=Open+Sans:wght@400;500;600;700&display=swap");

:root {
  --bg: #fdfdfb;
  --panel: #ffffff;
  --panel-soft: #f5f8f5;
  --surface-green: #ddede5;
  --surface-peach: #fceee6;
  --surface-blue: #eff6fd;
  --surface-lavender: #e6e7f9;
  --page-tint-primary: rgba(25, 84, 78, 0.14);
  --page-tint-secondary: rgba(217, 125, 90, 0.10);
  --line: #d7e1dc;
  --text: #17322e;
  --muted: rgba(23, 50, 46, 0.68);
  --accent: #19544e;
  --accent-strong: #0e2521;
  --accent-soft: #90c0ad;
  --warm: #f8f4ed;
  --alert: #dfa93e;
  --danger: #d97d5a;
  --shadow: 0 14px 34px rgba(25, 84, 78, 0.07);
  --shadow-soft: 0 8px 22px rgba(25, 84, 78, 0.055);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Open Sans", "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    linear-gradient(135deg, var(--page-tint-primary), rgba(253, 253, 251, 0.96) 38%, var(--page-tint-secondary)),
    var(--bg);
  min-height: 100vh;
}

.legal-page {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0;
}

.legal-back {
  display: inline-flex;
  margin-bottom: 16px;
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.legal-panel {
  display: grid;
  gap: 16px;
}

.legal-panel h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.legal-panel h2 {
  margin-top: 10px;
  font-size: 1.1rem;
}

.legal-panel a {
  color: var(--accent);
  font-weight: 800;
}

h1, h2, h3, h4, p {
  margin: 0;
}

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

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.sidebar {
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
  padding: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(245, 248, 245, 0.84)),
    var(--panel);
  border: 1px solid rgba(215, 225, 220, 0.92);
  border-radius: 28px;
  box-shadow: var(--shadow);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.sidebar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: auto;
}

.sidebar-links a {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.sidebar-links a:hover {
  color: var(--accent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 17px;
  background: linear-gradient(135deg, var(--accent), #0e2521);
  color: #f8f8f5;
  display: grid;
  place-items: center;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(25, 84, 78, 0.16);
}

.brand-logo {
  width: 84px;
  height: 68px;
  object-fit: contain;
  border-radius: 12px;
  background: #ffffff;
}

.brand h1 {
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-size: 1.7rem;
}

.eyebrow {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: inherit;
  opacity: 0.72;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav button {
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 13px 14px;
  border-radius: 16px;
  cursor: pointer;
  transition: 160ms ease;
  font-weight: 700;
}

.nav button.active,
.nav button:hover {
  background: var(--surface-green);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(25, 84, 78, 0.08);
}

.sidebar-card {
  margin-top: auto;
  background: linear-gradient(135deg, var(--surface-green), rgba(252, 238, 230, 0.62));
  border: 1px solid rgba(25, 84, 78, 0.08);
  border-radius: var(--radius-lg);
  padding: 18px;
  line-height: 1.5;
  color: var(--text);
}

.main-panel {
  padding: 8px 8px 30px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  padding: 8px 6px 2px;
}

.topbar h2 {
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-size: clamp(1.9rem, 3.2vw, 2.7rem);
  letter-spacing: 0;
  line-height: 1.05;
}

.session-badge {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 16px;
  box-shadow: var(--shadow-soft);
  color: var(--muted);
  backdrop-filter: blur(14px);
}

.view-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero,
.panel,
.metric-card,
.list-card,
.message-box {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  padding: 28px;
  background: linear-gradient(135deg, rgba(221, 237, 229, 0.92), rgba(255, 255, 255, 0.94) 58%, rgba(252, 238, 230, 0.64));
}

.panel,
.message-box {
  padding: 22px;
}

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 18px;
}

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

.metric-card {
  padding: 18px;
  background: var(--panel-soft);
  box-shadow: none;
}

.metric-card strong {
  display: block;
  font-size: clamp(1.45rem, 2vw, 1.85rem);
  margin-top: 8px;
  color: var(--accent-strong);
}

.muted {
  color: var(--muted);
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.space-between {
  justify-content: space-between;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 13px;
  background: var(--surface-green);
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 700;
}

.pill.warning {
  background: #fff0d8;
  color: #9a6616;
}

.pill.danger {
  background: #f9e0dc;
  color: #a34d40;
}

.status-action {
  border: 0;
  cursor: pointer;
  font-weight: 700;
  transition: 160ms ease;
}

.status-action:hover,
.status-action:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(217, 125, 90, 0.2);
  outline: none;
}

.button,
.ghost-button {
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  padding: 12px 18px;
  font-weight: 700;
  transition: 160ms ease;
}

.button {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow);
}

.ghost-button {
  background: var(--surface-green);
  color: var(--accent-strong);
  border: 1px solid var(--line);
}

.button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(25, 84, 78, 0.12);
}

.button:hover {
  background: var(--accent-strong);
  box-shadow: var(--shadow);
}

.ghost-button.small {
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 0.9rem;
}

.ghost-button.active {
  background: var(--accent);
  color: #fff;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field input,
.field select,
.field textarea {
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  outline: none;
  transition: 160ms ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(25, 84, 78, 0.42);
  box-shadow: 0 0 0 4px rgba(144, 192, 173, 0.18);
  background: #fff;
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.anthropometry-panel {
  background: linear-gradient(135deg, rgba(221, 237, 229, 0.86), rgba(255, 255, 255, 0.94) 48%, rgba(252, 238, 230, 0.52));
}

.anthro-form {
  margin-bottom: 18px;
}

.anthro-results {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.anthro-summary .metric-card {
  min-height: 124px;
}

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

.anthro-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.anthro-card h4 {
  font-family: "Montserrat", "Segoe UI", sans-serif;
  color: var(--accent-strong);
  margin-bottom: 12px;
}

.anthro-row {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) minmax(116px, 148px);
  gap: 6px 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid rgba(25, 84, 78, 0.08);
}

.anthro-row:first-of-type {
  border-top: 0;
}

.anthro-row span,
.anthro-row small {
  color: var(--muted);
}

.anthro-row > span {
  min-width: 0;
  line-height: 1.3;
  overflow-wrap: break-word;
}

.anthro-value {
  justify-self: stretch;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 4px 8px;
  border: 1px solid rgba(25, 84, 78, 0.10);
  border-radius: 12px;
  background: rgba(245, 248, 245, 0.76);
}

.anthro-value input {
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 3px 0;
  background: transparent;
  color: var(--accent-strong);
  font-weight: 800;
  text-align: right;
  outline: none;
}

.anthro-value:focus-within {
  border-color: rgba(25, 84, 78, 0.38);
  box-shadow: 0 0 0 3px rgba(144, 192, 173, 0.16);
  background: #fff;
}

.anthro-value em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.82rem;
}

.anthro-row small {
  grid-column: 1 / -1;
  font-size: 0.82rem;
}

.phone-field {
  display: grid;
  grid-template-columns: minmax(150px, 0.42fr) minmax(160px, 1fr);
  gap: 10px;
}

.intake-section {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  background: rgba(237, 244, 239, 0.36);
}

.intake-section legend {
  padding: 0 8px;
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--accent-strong);
}

.intake-section > .muted {
  margin-bottom: 14px;
}

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

.choice-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdfb;
  color: var(--text);
}

.choice-card input {
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 2px 0 0;
  border-radius: 4px;
  background: transparent;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.choice-card span {
  line-height: 1.35;
}

.consent-card {
  background: #fffaf0;
  border-color: rgba(223, 169, 62, 0.28);
}

body.intake-wizard-mode {
  background:
    radial-gradient(circle at 14% 16%, rgba(144, 192, 173, 0.24), transparent 28%),
    radial-gradient(circle at 86% 78%, rgba(223, 169, 62, 0.10), transparent 24%),
    linear-gradient(120deg, rgba(25, 84, 78, 0.08), transparent 42%),
    var(--bg);
}

body.intake-wizard-mode .app-shell {
  grid-template-columns: 1fr;
}

body.intake-wizard-mode .sidebar,
body.intake-wizard-mode .topbar {
  display: none;
}

body.intake-wizard-mode .main-panel {
  min-height: 100vh;
  padding: 0;
}

body.intake-wizard-mode .view-container {
  min-height: 100vh;
  gap: 0;
}

.intake-wizard-shell {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  padding: 34px clamp(18px, 6vw, 72px) 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.intake-wizard-shell::before,
.intake-wizard-shell::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.intake-wizard-shell::before {
  background:
    linear-gradient(96deg, rgba(25, 84, 78, 0.94) 0 18%, transparent 18% 100%),
    linear-gradient(84deg, transparent 0 76%, rgba(25, 84, 78, 0.88) 76% 100%);
}

.intake-wizard-shell::after {
  background:
    linear-gradient(174deg, transparent 0 32%, rgba(144, 192, 173, 0.20) 32% 43%, transparent 43% 100%),
    linear-gradient(354deg, transparent 0 78%, rgba(217, 125, 90, 0.10) 78% 100%);
}

.intake-wizard-top {
  width: min(1220px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--accent);
  margin-bottom: clamp(50px, 9vh, 118px);
}

.intake-wizard-top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.intake-dashboard-link {
  min-height: 42px;
  border: 1px solid rgba(25, 84, 78, 0.14);
  border-radius: 999px;
  padding: 10px 16px;
  background: #fff;
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(25, 84, 78, 0.06);
}

.intake-dashboard-link:hover {
  border-color: rgba(25, 84, 78, 0.28);
}

.intake-wizard-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-size: 1.42rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bg);
  transform: translateX(clamp(-72px, -4vw, -24px));
}

.intake-wizard-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #f8f8f5;
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 800;
}

.intake-language-pill {
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(144, 192, 173, 0.22);
  border: 1px solid rgba(25, 84, 78, 0.12);
  color: var(--accent-strong);
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(25, 84, 78, 0.06);
}

.intake-dashboard-link {
  border: 1px solid rgba(25, 84, 78, 0.14);
  border-radius: 999px;
  padding: 11px 16px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(25, 84, 78, 0.06);
}

.intake-dashboard-link:hover {
  background: #fff;
}

.intake-wizard-card {
  width: min(1220px, 100%);
  min-height: min(680px, calc(100vh - 150px));
  background: #fff;
  border: 1px solid rgba(25, 84, 78, 0.10);
  border-radius: var(--radius-xl);
  box-shadow: 0 28px 70px rgba(25, 84, 78, 0.10);
  padding: clamp(42px, 6vw, 94px) clamp(32px, 8vw, 112px) clamp(32px, 5vw, 64px);
  display: flex;
  flex-direction: column;
}

.intake-step {
  display: none;
}

.intake-step.is-active {
  display: block;
}

.intake-step h3 {
  margin-bottom: clamp(30px, 5vw, 58px);
  color: var(--accent);
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  font-weight: 700;
  line-height: 1.08;
  text-align: center;
}

.wizard-field {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 24px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
}

.wizard-field input,
.wizard-field select,
.wizard-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid rgba(25, 84, 78, 0.22);
  border-radius: 12px;
  background: #fbfdfb;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  outline: none;
}

.wizard-field textarea {
  min-height: 76px;
  resize: vertical;
}

.wizard-field input:focus,
.wizard-field select:focus,
.wizard-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(144, 192, 173, 0.28);
}

.wizard-field input::placeholder,
.wizard-field textarea::placeholder {
  color: #b6b9bc;
}

.wizard-consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.45;
}

.wizard-consent input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.intake-wizard-actions {
  margin-top: auto;
  padding-top: 38px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 18px;
}

.wizard-back,
.wizard-next,
.wizard-submit {
  justify-self: center;
  min-width: 132px;
  min-height: 48px;
  border-radius: 14px;
  padding: 11px 28px;
  border: 1px solid rgba(25, 84, 78, 0.14);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.wizard-next,
.wizard-submit {
  border-color: transparent;
  background: linear-gradient(135deg, var(--danger), #e59a75);
  color: #fff;
}

.wizard-back:disabled {
  opacity: 0.55;
  cursor: default;
}

.wizard-next:hover,
.wizard-submit:hover {
  background: linear-gradient(135deg, #ca6d4f, var(--danger));
}

.intake-wizard-feedback {
  width: min(1220px, 100%);
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff;
  color: var(--muted);
  box-shadow: 0 14px 32px rgba(25, 84, 78, 0.10);
}

.intake-confirmation-card {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
}

.intake-confirmation-icon {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: rgba(144, 192, 173, 0.24);
  color: var(--accent);
  font-size: 2.4rem;
  font-weight: 800;
}

.intake-confirmation-card h3 {
  color: var(--accent);
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1.1;
}

.intake-confirmation-card p {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.intake-confirmation-card .wizard-submit {
  margin-top: 12px;
}

.recipe-journal-toast {
  position: fixed;
  left: 50%;
  bottom: clamp(20px, 5vh, 44px);
  z-index: 1000;
  transform: translate(-50%, 18px);
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 18px;
  border: 1px solid rgba(25, 84, 78, 0.18);
  border-radius: 999px;
  background: rgba(25, 84, 78, 0.84);
  color: #fff;
  box-shadow: 0 18px 48px rgba(25, 84, 78, 0.22);
  font-weight: 800;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

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

.table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.74);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table th,
.table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(215, 225, 220, 0.72);
}

.table th {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--panel-soft);
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-height: 220px;
  padding-top: 20px;
}

.line-chart-card {
  display: grid;
  gap: 14px;
}

.line-chart {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: stretch;
}

.line-chart-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.88rem;
  padding: 16px 0 20px;
}

.line-chart-svg {
  width: 100%;
  min-height: 210px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), var(--surface-green));
  border: 1px solid var(--line);
  overflow: visible;
}

.line-chart-baseline {
  stroke: #b8cec0;
  stroke-width: 1.2;
  stroke-dasharray: 4 5;
}

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

.line-chart-point {
  fill: white;
  stroke: var(--accent-strong);
  stroke-width: 3;
}

.line-chart-point-halo {
  fill: transparent;
}

.line-chart-labels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 10px;
}

.line-chart-label {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
}

.bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.bar-stack {
  width: 100%;
  max-width: 68px;
  height: 170px;
  border-radius: 16px 16px 10px 10px;
  background: linear-gradient(180deg, var(--panel-soft), var(--surface-green));
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: flex-end;
}

.bar-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  border-radius: 16px 16px 0 0;
}

.delta {
  font-weight: 700;
}

.delta.good { color: var(--accent-strong); }
.delta.warn { color: #a86e10; }
.delta.bad { color: #a34d40; }

.patient-list {
  display: grid;
  gap: 12px;
}

.patient-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(245, 248, 245, 0.82);
  border: 1px solid rgba(25, 84, 78, 0.08);
}

.meal-list,
.timeline,
.agenda-list,
.message-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agenda-list.compact {
  gap: 10px;
}

.agenda-item {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.agenda-item.compact {
  grid-template-columns: 112px 1fr;
}

.agenda-date {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border-radius: 12px;
  background: var(--surface-green);
  color: var(--accent-strong);
}

.agenda-date strong {
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-size: 1.35rem;
}

.agenda-date span {
  line-height: 1.3;
  color: var(--muted);
}

.agenda-body {
  min-width: 0;
}

.agenda-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.agenda-day {
  min-width: 120px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.agenda-day-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface-green);
  color: var(--accent-strong);
}

.agenda-day-body {
  min-height: 140px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.agenda-slot {
  width: 100%;
  border: 1px solid rgba(25, 84, 78, 0.12);
  border-radius: 12px;
  padding: 9px 10px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.agenda-slot strong,
.agenda-slot span,
.agenda-slot small {
  display: block;
}

.agenda-slot strong {
  color: var(--accent);
}

.agenda-slot small {
  margin-top: 3px;
  color: var(--muted);
}

.appointment-detail-panel textarea {
  min-height: 130px;
}

.patient-picker {
  margin-bottom: 14px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(221, 237, 229, 0.52);
  border: 1px solid var(--line);
}

.meal-item,
.timeline-item,
.message-item {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
}

.patient-card {
  cursor: pointer;
  transition: 160ms ease;
}

.patient-card:hover {
  border-color: rgba(25, 84, 78, 0.24);
  transform: translateY(-1px);
}

.message-item.mine {
  background: var(--surface-green);
}

.report-block {
  padding: 18px;
  border-radius: 18px;
  background: rgba(245, 248, 245, 0.82);
  border: 1px solid rgba(25, 84, 78, 0.08);
}

.login-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  min-height: calc(100vh - 128px);
}

.login-grid-simple {
  grid-template-columns: minmax(320px, 520px);
  justify-content: center;
}

.login-hero {
  min-height: 100%;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  padding: clamp(18px, 4vw, 44px) 0;
}

.login-stack {
  display: grid;
  gap: 18px;
}

.login-panel {
  padding: 26px;
}

.login-secondary-action {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.auth-single {
  min-height: calc(100vh - 128px);
  display: grid;
  place-items: center;
  padding: 18px;
}

.signup-panel {
  width: min(680px, 100%);
}

.login-panel h3,
.login-hero h3 {
  font-family: "Montserrat", "Segoe UI", sans-serif !important;
  font-weight: 700;
  line-height: 1.1;
}

.brand-note {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.brand-note-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(25, 84, 78, 0.08);
}

.login-panel details {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.login-panel summary {
  list-style: none;
  font-weight: 700;
  color: var(--accent);
}

.login-panel summary::-webkit-details-marker {
  display: none;
}

.login-option {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  cursor: pointer;
}

.login-option.active {
  border-color: var(--accent);
  background: var(--surface-green);
}

.empty-state {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px dashed var(--line);
  color: var(--muted);
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    gap: 18px;
  }

  .grid-4,
  .grid-3,
  .grid-2,
  .login-grid,
  .form-grid,
  .anthro-detail-grid,
  .choice-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .main-panel {
    padding: 18px;
  }

  .topbar {
    flex-direction: column;
  }

  .session-badge {
    width: fit-content;
  }

  .phone-field {
    grid-template-columns: 1fr;
  }

  .agenda-item {
    grid-template-columns: 1fr;
  }

  .intake-section {
    padding: 16px 14px;
  }

  .intake-wizard-shell {
    padding: 20px 14px 28px;
  }

  .intake-wizard-top {
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 28px;
  }

  .intake-wizard-top-actions {
    flex-direction: column-reverse;
    align-items: flex-end;
  }

  .intake-wizard-brand {
    font-size: 1.25rem;
  }

  .intake-language-pill {
    padding: 10px 12px;
  }

  .intake-wizard-card {
    min-height: auto;
    padding: 34px 20px 24px;
  }

  .intake-step h3 {
    margin-bottom: 26px;
  }

  .wizard-field {
    margin-bottom: 18px;
  }

  .intake-wizard-actions {
    grid-template-columns: 1fr;
    padding-top: 22px;
  }

  .wizard-back,
  .wizard-next,
  .wizard-submit {
    width: min(220px, 100%);
  }
}
