@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;
}

.environment-banner {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 8px 16px;
  background: #f4c95d;
  color: #2c240e;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.environment-banner:not([hidden]) + .app-shell {
  min-height: calc(100vh - 34px);
}

.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;
  padding-right: 34px;
}

.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);
}

.topbar-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.notification-center {
  position: relative;
  display: none;
}

body.session-active .notification-center {
  display: block;
}

.sidebar-notification-center {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 12;
}

.sidebar-notification-center .notification-panel {
  right: 0;
  width: min(400px, calc(100vw - 48px));
}

.notification-bell {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.notification-bell-icon {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-count {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border: 2px solid white;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 900;
  width: min(400px, calc(100vw - 32px));
  max-height: min(620px, 72vh);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(8, 36, 33, 0.22);
}

.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.notification-list {
  max-height: 500px;
  overflow-y: auto;
  padding: 8px;
}

.notification-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.notification-item:hover {
  background: var(--surface-green);
}

.notification-item-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--surface-green);
  color: var(--primary);
  font-weight: 900;
}

.notification-item strong,
.notification-item small,
.notification-item time {
  display: block;
}

.notification-item small,
.notification-item time {
  margin-top: 3px;
  color: var(--muted);
}

.notification-item time {
  font-size: 0.72rem;
}

.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);
}

.messaging-shell {
  display: grid;
  grid-template-columns: minmax(270px, 320px) minmax(0, 1fr);
  gap: 18px;
  min-height: min(680px, calc(100vh - 180px));
}

.messaging-shell.patient-conversation {
  display: block;
  width: min(940px, 100%);
  margin-inline: auto;
}

.conversation-list-panel,
.chat-window {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.conversation-list-panel {
  min-width: 0;
  padding: 18px 12px;
}

.conversation-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 8px 16px;
}

.conversation-count {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-green);
  color: var(--accent-strong);
  font-weight: 800;
}

.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.conversation-contact {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 11px;
  width: 100%;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: 160ms ease;
}

.conversation-contact:hover {
  background: rgba(245, 248, 245, 0.9);
}

.conversation-contact.active {
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
  background: var(--surface-green);
}

.conversation-contact:disabled {
  opacity: 0.68;
  cursor: wait;
}

.conversation-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.03em;
}

.conversation-avatar.large {
  width: 50px;
  height: 50px;
  font-size: 0.9rem;
}

.conversation-contact-copy,
.conversation-contact-topline {
  min-width: 0;
}

.conversation-contact-topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.conversation-contact-topline strong,
.conversation-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-contact-topline time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.72rem;
}

.conversation-preview {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.message-box.chat-window {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
}

.chat-header .eyebrow {
  margin-bottom: 1px;
  font-size: 0.7rem;
}

.chat-header h3 {
  font-size: 1.05rem;
}

.chat-security {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.chat-thread {
  min-height: 390px;
  max-height: min(620px, calc(100vh - 330px));
  overflow-y: auto;
  padding: 24px;
  background:
    radial-gradient(circle at 10% 10%, color-mix(in srgb, var(--surface-green) 70%, transparent), transparent 28%),
    rgba(245, 248, 245, 0.54);
}

.chat-message-row {
  display: flex;
  width: 100%;
}

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

.chat-bubble {
  max-width: min(76%, 620px);
  padding: 11px 14px 8px;
  border: 1px solid var(--line);
  border-radius: 6px 18px 18px 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 5px 18px rgba(18, 50, 46, 0.06);
}

.chat-message-row.mine .chat-bubble {
  border-color: transparent;
  border-radius: 18px 6px 18px 18px;
  background: var(--accent);
  color: white;
}

.chat-bubble p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-bubble time {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  text-align: right;
}

.chat-message-row.mine .chat-bubble time {
  color: rgba(255, 255, 255, 0.76);
}

.chat-empty {
  align-self: center;
  margin: auto;
  text-align: center;
}

.chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
}

.chat-composer textarea {
  min-height: 48px;
  max-height: 130px;
  resize: vertical;
  border-radius: 16px;
}

.chat-composer .button {
  align-self: stretch;
  min-width: 108px;
}

.chat-feedback {
  margin: 0 16px 14px;
}

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

.patient-detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 16px;
}

.patient-directory-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
}

.patient-directory-search input {
  min-height: 52px;
  font-size: 1rem;
}

.patient-directory-toolbar .button {
  min-height: 52px;
}

.patient-directory-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 4px 0;
}

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

.patient-directory-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  width: 100%;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  color: inherit;
  text-align: left;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: 160ms ease;
}

.patient-directory-card:hover {
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
  background: var(--surface-green);
  transform: translateY(-2px);
}

.patient-directory-card:disabled {
  opacity: 0.65;
  cursor: wait;
}

.patient-directory-avatar {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-weight: 850;
}

.patient-directory-copy {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.patient-directory-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.patient-directory-name-row strong,
.patient-directory-copy .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patient-directory-open {
  margin-top: 4px;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 800;
}

.patient-directory-empty {
  grid-column: 1 / -1;
}

.patient-directory-back {
  padding: 0;
}

.patient-directory-back-row {
  display: flex;
  align-items: center;
  min-height: 30px;
  padding: 0 6px;
}

.reminder-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 36, 33, 0.48);
  backdrop-filter: blur(8px);
}

.reminder-dialog {
  width: min(520px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(8, 36, 33, 0.26);
}

.reminder-dialog h3 {
  margin: 6px 0 8px;
}

.reminder-dialog-actions {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.reminder-dialog-actions .button,
.reminder-dialog-actions .ghost-button {
  width: 100%;
}

.meals-workspace-hero h3 {
  margin: 7px 0 8px;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
}

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

.workspace-section-heading .eyebrow {
  margin-bottom: 4px;
}

.patient-detail-selector {
  width: min(360px, 100%);
  flex: 0 1 360px;
}

.intake-summary-disclosure {
  margin-top: 14px;
  border: 1px solid rgba(25, 84, 78, 0.1);
  border-radius: 18px;
  background: rgba(245, 248, 245, 0.82);
  overflow: hidden;
}

.intake-summary-disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  list-style: none;
  cursor: pointer;
  transition: background 160ms ease;
}

.intake-summary-disclosure summary::-webkit-details-marker {
  display: none;
}

.intake-summary-disclosure summary:hover {
  background: rgba(255, 255, 255, 0.46);
}

.intake-summary-heading {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.intake-summary-heading strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intake-summary-action {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 9px;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 800;
}

.summary-open-label {
  display: none;
}

.summary-chevron {
  display: inline-block;
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 180ms ease;
}

.intake-summary-disclosure[open] .summary-closed-label {
  display: none;
}

.intake-summary-disclosure[open] .summary-open-label {
  display: inline;
}

.intake-summary-disclosure[open] .summary-chevron {
  transform: rotate(180deg);
}

.intake-summary-content {
  display: grid;
  gap: 10px;
  padding: 2px 18px 18px;
  border-top: 1px solid rgba(25, 84, 78, 0.08);
}

.intake-summary-content p:first-child {
  margin-top: 16px;
}

.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;
}

.password-reset-grid {
  width: min(960px, 100%);
  min-height: auto;
  margin: auto;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
  gap: clamp(28px, 5vw, 56px);
}

.password-reset-title {
  margin: 10px 0 12px;
  font-size: clamp(2rem, 4vw, 2.8rem);
}

body.password-reset-mode .app-shell {
  min-height: inherit;
  grid-template-columns: minmax(0, 1fr);
  padding: clamp(18px, 4vw, 48px);
}

body.password-reset-mode .sidebar,
body.password-reset-mode .topbar {
  display: none;
}

body.password-reset-mode .main-panel {
  min-height: calc(100vh - 34px);
  padding: 0;
  display: flex;
}

body.password-reset-mode .view-container {
  width: 100%;
  min-height: 100%;
  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-text-button {
  display: block;
  width: fit-content;
  margin: 12px 0 0 auto;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.auth-text-button:hover {
  color: var(--accent-strong);
}

.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;
  }

  .password-reset-grid {
    width: min(620px, 100%);
  }

  body.auth-entry-mode .sidebar {
    display: none;
  }

  body.auth-entry-mode .app-shell {
    min-height: calc(100vh - 34px);
    padding: clamp(14px, 4vw, 28px);
  }

  body.auth-entry-mode .main-panel {
    min-height: calc(100vh - 62px);
    display: flex;
    flex-direction: column;
  }

  body.auth-entry-mode .view-container {
    flex: 1;
    justify-content: center;
  }

  body.auth-entry-mode .login-grid {
    min-height: auto;
  }

  .messaging-shell.has-conversation-list {
    grid-template-columns: 1fr;
  }

  .conversation-list {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .conversation-contact {
    min-width: min(260px, 82vw);
    scroll-snap-align: start;
  }

  .patient-directory-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body.password-reset-mode .app-shell {
    padding: 18px 14px 26px;
  }

  body.password-reset-mode .main-panel {
    min-height: calc(100vh - 34px);
    padding: 0;
  }

  .password-reset-grid {
    gap: 18px;
  }

  .password-reset-grid .login-hero {
    padding: 8px 4px 0;
  }

  .password-reset-grid .login-panel {
    padding: 22px 18px;
  }

  .password-reset-title {
    font-size: clamp(1.8rem, 9vw, 2.35rem);
  }

  .main-panel {
    padding: 18px;
  }

  .topbar {
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

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

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

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

  .patient-detail-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .patient-directory-toolbar {
    grid-template-columns: 1fr;
  }

  .patient-directory-toolbar .button {
    width: 100%;
  }

  .patient-directory-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .patient-directory-card {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 15px;
  }

  .patient-directory-avatar {
    width: 44px;
    height: 44px;
  }

  .patient-detail-selector {
    width: 100%;
    flex-basis: auto;
  }

  .intake-summary-disclosure summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .intake-summary-action {
    width: 100%;
    justify-content: space-between;
  }

  .chat-header {
    padding: 14px;
  }

  .chat-security {
    display: none;
  }

  .chat-thread {
    min-height: 360px;
    max-height: 58vh;
    padding: 18px 12px;
  }

  .chat-bubble {
    max-width: 88%;
  }

  .chat-composer {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .chat-composer .button {
    min-height: 46px;
  }

  .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%);
  }
}
