:root {
  color-scheme: only light;
  --bg: #f3f4f5;
  --surface: #ffffff;
  --surface-2: #f7f8f9;
  --ink: #17191f;
  --muted: #747a84;
  --soft: #a7abb2;
  --line: #e7e9ec;
  --accent: #3f66ed;
  --accent-soft: #eef2ff;
  --positive: #24765b;
  --positive-soft: #edf8f3;
  --danger: #b5474a;
  --shadow: 0 14px 45px rgba(28, 32, 40, 0.065);
  --shadow-small: 0 7px 22px rgba(28, 32, 40, 0.055);
}

.catalogue-page { max-width: 1180px; }
.catalogue-page > h1 { font-size: clamp(42px, 6vw, 74px); line-height: 1.03; margin: 22px 0; letter-spacing: -.045em; }
.catalogue-page > h1 em { color: var(--accent); font-weight: 400; }
.catalogue-intro { color: var(--muted); max-width: 540px; line-height: 1.7; }
.catalogue-controls { display: grid; grid-template-columns: 1.3fr .7fr 1.5fr; gap: 18px; padding: 24px; margin-top: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.catalogue-controls label, .catalogue-modal label { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.catalogue-controls select, .catalogue-controls input:not([type=checkbox]), .catalogue-modal select, .catalogue-modal textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.catalogue-controls .catalogue-check { flex-direction: row; align-items: center; }
.catalogue-search { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.catalogue-note { padding: 24px 0; max-width: 800px; line-height: 1.7; font-size: 14px; }
.catalogue-note p { color: var(--muted); margin: 7px 0; }
.catalogue-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 22px; margin: 24px 0; }
.catalogue-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; }
.catalogue-photo { height: 210px; background: #f8f9fa; color: #777; display: flex; align-items: center; justify-content: center; position: relative; padding: 24px; }
.catalogue-photo img { max-width: 100%; height: 155px; object-fit: contain; }
.catalogue-photo span { position: absolute; bottom: 12px; left: 16px; font-size: 11px; background: white; padding: 5px 9px; border-radius: 20px; }
.catalogue-card-body { padding: 23px; display: flex; flex-direction: column; flex: 1; gap: 12px; }
.catalogue-card h2 { font-size: 20px; line-height: 1.3; margin: 0; overflow-wrap: anywhere; }
.catalogue-card p { margin: 0; }
.catalogue-match { color: var(--positive); background: var(--positive-soft); padding: 12px; border-radius: 8px; font-size: 13px; line-height: 1.5; }
.catalogue-reason, .catalogue-inci { font-size: 13px; line-height: 1.6; color: var(--muted); }
.catalogue-inci { overflow-wrap: anywhere; margin: 12px 0 !important; }
.catalogue-card summary { font-size: 13px; cursor: pointer; padding: 8px 0; }
.catalogue-links { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 10px; }
.catalogue-links a { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--accent); gap: 10px; }
.catalogue-empty { padding: 40px; background: var(--surface); border-radius: 16px; max-width: 640px; line-height: 1.6; }
.catalogue-attribution { margin-top: 36px; line-height: 1.8; }
.catalogue-attribution a { text-decoration: underline; }
.catalogue-modal { position: fixed; inset: 0; z-index: 100; background: #0007; display: grid; place-items: center; padding: 20px; }
.catalogue-modal { border: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; color: var(--ink); }
.catalogue-modal:not([open]) { display: none; }
.catalogue-modal > section { background: var(--surface); padding: 28px; border-radius: 18px; width: min(620px,100%); max-height: 90vh; overflow: auto; display: grid; gap: 16px; }
@media(max-width: 900px) { .catalogue-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width: 600px) { .catalogue-grid, .catalogue-controls { grid-template-columns: 1fr; } .catalogue-page > h1 { font-size: 46px; } }



* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-inter), "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.serif {
  font-family: inherit;
  font-style: normal;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: fixed;
  left: 18px;
  top: -80px;
  z-index: 100;
  padding: 11px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--surface);
}

.skip:focus {
  top: 18px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(1180px, calc(100% - 48px));
  height: 84px;
  margin: 0 auto;
  border-bottom: 1px solid color-mix(in srgb, var(--line), transparent 35%);
  background: color-mix(in srgb, var(--bg), transparent 9%);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  font-size: 31px;
  font-weight: 800;
  letter-spacing: -2.25px;
  line-height: 1;
}

.brand-dot,
.footer-brand span {
  color: var(--accent);
}

.desktop-nav,
.header-actions,
.action-row,
.share-row {
  display: flex;
  align-items: center;
}

.desktop-nav {
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.desktop-nav a {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 9px 15px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.desktop-nav a.active {
  background: var(--ink);
  color: var(--surface);
}

.header-actions {
  justify-content: flex-end;
  gap: 8px;
}

.icon-button,
.round-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-small);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 19px;
  border: 1px solid var(--ink);
  border-radius: 14px;
  background: var(--ink);
  color: var(--surface);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.button:hover,
.round-link:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.button:disabled,
.text-link:disabled,
.icon-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.button.secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button.small {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
}

.button.full {
  width: 100%;
}

.text-link,
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.text-link.accent {
  color: var(--accent);
}

.back-link {
  margin-bottom: 32px;
  color: var(--muted);
}

.danger-link {
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.demo-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 48px));
  margin: 12px auto 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
}

.demo-strip span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.demo-strip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.demo-strip a {
  color: var(--accent);
  font-weight: 700;
}

.page {
  width: min(1120px, calc(100% - 48px));
  min-height: 62vh;
  margin: 0 auto;
  padding: 56px 0 72px;
}

.page.narrow,
.login-page {
  width: min(760px, calc(100% - 48px));
}

.loading-state,
.empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 15px;
}

.empty h1 {
  max-width: 620px;
  margin-bottom: 0;
  font-size: clamp(32px, 5vw, 56px);
  letter-spacing: -0.045em;
}

.empty p {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.11em;
  line-height: 1.3;
  text-transform: uppercase;
}

.dashboard-heading,
.screen-heading,
.section-heading,
.card-heading,
.category-goal-heading,
.goal-summary,
.goal-save-bar {
  display: flex;
  align-items: center;
}

.dashboard-heading {
  justify-content: space-between;
  margin-bottom: 26px;
}

.dashboard-heading h1,
.screen-title {
  margin: 7px 0 6px;
  font-size: clamp(37px, 5vw, 58px);
  font-weight: 680;
  letter-spacing: -0.052em;
  line-height: 1;
}

.dashboard-heading p,
.screen-heading > p,
.intro {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.category-switch {
  display: inline-flex;
  gap: 5px;
  margin-bottom: 20px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.category-switch button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 13px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.category-switch button.active {
  background: var(--ink);
  color: var(--surface);
}

.category-switch button > span {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor, transparent 88%);
  font-size: 9px;
}

.finding-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: end;
  min-height: 224px;
  padding: 34px;
  overflow: hidden;
  border-radius: 28px;
  background:
    radial-gradient(circle at 82% 25%, rgba(63, 102, 237, 0.3), transparent 24%),
    radial-gradient(circle at 60% 115%, rgba(111, 139, 80, 0.25), transparent 36%),
    #15181c;
  color: #fff;
  box-shadow: var(--shadow);
}

.finding-card::after {
  content: "";
  position: absolute;
  top: -50px;
  right: 100px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.finding-card .eyebrow {
  color: rgba(255, 255, 255, 0.56);
}

.finding-card h2 {
  max-width: 720px;
  margin: 24px 0 12px;
  font-size: clamp(25px, 3.2vw, 42px);
  font-weight: 550;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.finding-card p {
  max-width: 650px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.63);
  font-size: 12px;
  line-height: 1.6;
}

.finding-link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  min-width: 212px;
  padding: 8px 8px 8px 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  font-size: 11px;
  font-weight: 700;
}

.finding-link svg {
  box-sizing: content-box;
  padding: 11px;
  border-radius: 50%;
  background: #fff;
  color: #111;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.45fr 0.75fr;
  gap: 18px;
  margin-top: 18px;
}

.summary-card,
.function-strip,
.quiet-note,
.routine-section,
.form-panel,
.dropzone,
.category-goal-card,
.recommendation {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.summary-card {
  min-height: 225px;
  padding: 26px;
  border-radius: 24px;
}

.card-heading {
  justify-content: space-between;
  margin-bottom: 25px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.card-heading a {
  color: var(--accent);
}

.card-heading > strong {
  color: var(--ink);
  font-size: 14px;
}

.goal-summary {
  align-items: flex-start;
  gap: 15px;
}

.category-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
}

.goal-summary strong {
  font-size: 20px;
  letter-spacing: -0.025em;
}

.goal-summary p {
  max-width: 500px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.other-goal {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 22px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
  font-size: 11px;
}

.other-goal span {
  color: var(--muted);
}

.progress-card {
  text-align: center;
}

.progress-ring {
  display: grid;
  grid-template-areas: "value";
  place-items: center;
  width: 102px;
  height: 102px;
  margin: -5px auto 10px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--progress), var(--line) 0);
}

.progress-ring::before {
  content: "";
  grid-area: value;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: var(--surface);
}

.progress-ring span,
.progress-ring small {
  position: relative;
  grid-area: value;
}

.progress-ring span {
  transform: translateY(-7px);
  font-size: 24px;
  font-weight: 750;
}

.progress-ring small {
  transform: translateY(13px);
  color: var(--muted);
  font-size: 9px;
}

.progress-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.routine-section {
  margin-top: 18px;
  padding: 27px;
  border-radius: 26px;
}

.section-heading {
  justify-content: space-between;
  margin-bottom: 21px;
}

.section-heading h2 {
  margin-bottom: 4px;
  font-size: 23px;
  letter-spacing: -0.035em;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.product-list {
  display: grid;
  gap: 9px;
}

.product-row,
.add-empty {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 90px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}

.product-row:hover,
.add-empty:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent), var(--line) 55%);
}

.product-thumb {
  align-self: stretch;
  overflow: hidden;
  border-right: 1px solid var(--line);
}

.product-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 3px;
  padding: 15px 18px;
}

.product-info > span {
  color: var(--accent);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.product-info strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-info small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-result {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  color: var(--muted);
  font-size: 10px;
}

.product-result .positive {
  color: var(--positive);
  font-weight: 700;
}

.add-empty {
  padding: 14px 18px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
}

.add-empty h3 {
  margin-bottom: 4px;
  font-size: 14px;
}

.add-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.bottle-scene {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 80px;
  padding-top: 13px;
  background:
    radial-gradient(circle at 50% 75%, rgba(63, 102, 237, 0.11), transparent 45%),
    var(--surface-2);
}

.bottle {
  position: relative;
  width: 27px;
  height: 52px;
  border-radius: 9px 9px 6px 6px;
  background: linear-gradient(145deg, #23272e, #08090b);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.bottle-cap {
  position: absolute;
  top: -7px;
  left: 7px;
  width: 13px;
  height: 8px;
  border-radius: 3px 3px 1px 1px;
  background: #0c0d0f;
}

.bottle-label {
  position: absolute;
  inset: 17px 3px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: #f7f7f5;
  color: #16181c;
  line-height: 1;
}

.bottle-label span {
  font-size: 7px;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.bottle-label small {
  margin-top: 5px;
  font-size: 3px;
  letter-spacing: 0.07em;
}

.bottle.tube {
  width: 28px;
  border-radius: 7px 7px 12px 12px;
  transform: rotate(4deg);
}

.bottle.jar {
  width: 43px;
  height: 31px;
  border-radius: 8px;
}

.bottle.jar .bottle-cap {
  top: -5px;
  left: 0;
  width: 43px;
  height: 7px;
}

.bottle.jar .bottle-label {
  inset: 7px 4px 4px;
}

.dashboard-bottom {
  display: grid;
  grid-template-columns: 1.45fr 0.75fr;
  gap: 18px;
  margin-top: 18px;
}

.function-strip,
.quiet-note {
  padding: 25px;
  border-radius: 24px;
}

.function-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.function {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 11px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 10px;
}

.function i {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.function.covered i {
  background: var(--positive-soft);
  color: var(--positive);
}

.function small {
  color: var(--muted);
  font-size: 8px;
}

.quiet-note {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.quiet-note > svg {
  flex: 0 0 auto;
  color: var(--accent);
}

.quiet-note h3 {
  margin-bottom: 8px;
  font-size: 14px;
}

.quiet-note p {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.quiet-note a {
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}

.footnote,
.fine-print {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}

.footnote {
  margin: 16px 4px 0;
}

.screen-heading {
  justify-content: space-between;
  gap: 50px;
  margin-bottom: 30px;
}

.screen-heading > div {
  flex: 1;
}

.screen-heading .screen-title {
  max-width: 680px;
}

.screen-heading > p {
  max-width: 330px;
}

.settings-page {
  width: min(1180px, calc(100% - 48px));
}

.category-goal-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.category-goal-card {
  padding: 27px;
  border-radius: 26px;
}

.category-goal-heading {
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 22px;
}

.category-goal-heading h2 {
  margin: 3px 0 6px;
  font-size: 22px;
  letter-spacing: -0.035em;
}

.category-goal-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.goal-options {
  display: grid;
  gap: 7px;
}

.goal-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 67px;
  padding: 12px 13px 12px 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-2);
  text-align: left;
}

.goal-option:hover {
  border-color: color-mix(in srgb, var(--accent), var(--line) 55%);
}

.goal-option.selected {
  border-color: color-mix(in srgb, var(--accent), transparent 38%);
  background: var(--accent-soft);
}

.goal-option > span {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.goal-option strong {
  font-size: 12px;
}

.goal-option small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.radio {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: #fff;
  font-style: normal;
}

.goal-option.selected .radio {
  border-color: var(--accent);
  background: var(--accent);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.field label,
.field-label {
  font-size: 11px;
  font-weight: 700;
}

.field label span {
  color: var(--muted);
  font-weight: 500;
}

.field input,
.field textarea,
.field select,
.ingredient-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: 0;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12px;
  transition: border-color 150ms ease;
}

.field textarea {
  min-height: 94px;
  resize: vertical;
  line-height: 1.5;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.ingredient-input:focus {
  border-color: var(--accent);
}

.field small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.compact-field {
  margin: 20px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.compact-field textarea {
  min-height: 76px;
}

.goal-save-bar {
  grid-column: 1 / -1;
  justify-content: space-between;
  gap: 24px;
  padding: 17px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.goal-save-bar > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.goal-save-bar strong {
  font-size: 12px;
}

.goal-save-bar span {
  color: var(--muted);
  font-size: 10px;
}

.goal-form-error {
  grid-column: 1 / -1;
}

.form-panel,
.dropzone {
  margin-top: 30px;
  padding: 28px;
  border-radius: 24px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 55px 30px;
  border: 1.5px dashed color-mix(in srgb, var(--accent), var(--line) 60%);
  text-align: center;
}

.dropzone.dragging {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.dropzone > svg {
  margin-bottom: 20px;
  color: var(--accent);
}

.dropzone h2 {
  margin-bottom: 8px;
  font-size: 23px;
  letter-spacing: -0.035em;
}

.dropzone p {
  max-width: 410px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.dropzone small {
  margin-top: 18px;
  color: var(--muted);
  font-size: 9px;
}

.action-row,
.share-row {
  flex-wrap: wrap;
  gap: 10px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.notice {
  margin: 18px 0;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.notice.error {
  border-color: color-mix(in srgb, var(--danger), transparent 65%);
  color: var(--danger);
}

.ingredient-edit {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.ingredient-edit > span {
  color: var(--soft);
  font-size: 9px;
}

.ingredient-edit .icon-button {
  width: 40px;
  height: 40px;
  box-shadow: none;
}

.suggestion {
  margin: -2px 0 10px 36px;
  color: var(--muted);
  font-size: 9px;
}

.suggestion button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
}

.gap-page {
  width: min(920px, calc(100% - 48px));
}

.gap-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 35px;
}

.gap-headline {
  max-width: 850px;
  margin-bottom: 20px;
  font-size: clamp(40px, 7vw, 76px);
  font-weight: 560;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.gap-consequence {
  max-width: 650px;
  margin-bottom: 35px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.recommendation {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 30px;
  margin-bottom: 24px;
  padding: 28px;
  border-radius: 23px;
}

.recommendation h2 {
  margin-bottom: 8px;
  font-size: 24px;
  letter-spacing: -0.035em;
}

.recommendation p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.share-row {
  margin-top: 12px;
}

.detail-header {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 30px;
  align-items: stretch;
  margin-bottom: 28px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.detail-header .screen-title {
  margin: 12px 0;
  font-size: clamp(32px, 5vw, 52px);
}

.detail-header p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.detail-header .bottle-scene {
  min-height: 160px;
  border-radius: 18px;
}

.detail-header .bottle {
  transform: scale(1.65);
  transform-origin: bottom;
}

.ingredient-group {
  margin-top: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.ingredient-group > h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 6px;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.count {
  display: inline-grid;
  place-items: center;
  min-width: 23px;
  height: 23px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 9px;
}

.ingredient-group > p {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 10px;
}

.ingredient-row {
  border-top: 1px solid var(--line);
}

.ingredient-row summary {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  cursor: pointer;
  list-style: none;
  font-size: 11px;
  font-weight: 650;
}

.ingredient-row summary::-webkit-details-marker {
  display: none;
}

.ingredient-row summary small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 500;
}

.row-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--soft);
}

.ingredient-group.helps .row-dot {
  background: var(--positive);
}

.ingredient-group.hinders .row-dot {
  background: var(--danger);
}

.ingredient-explanation {
  padding: 2px 27px 18px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.ingredient-explanation p {
  margin-bottom: 9px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 11px 0;
}

.tag {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 8px;
}

.evidence {
  padding: 12px;
  border-radius: 11px;
  background: var(--surface-2);
  font-size: 9px;
}

.evidence a,
.method-copy a,
.fine-print a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.method-copy {
  max-width: 760px;
}

.method-copy > p,
.method-copy > ul {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.method-copy h2 {
  margin: 36px 0 10px;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.method-copy li {
  margin-bottom: 7px;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 38px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -1.2px;
}

.footer a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink);
  font-weight: 700;
}

.mobile-nav {
  display: none;
}

@media (max-width: 880px) {
  .topbar {
    grid-template-columns: 1fr auto;
    width: min(100% - 36px, 720px);
    height: 72px;
  }

  .desktop-nav,
  .header-actions .button.small {
    display: none;
  }

  .demo-strip {
    width: min(100% - 36px, 720px);
  }

  .page,
  .page.narrow,
  .login-page,
  .gap-page,
  .settings-page {
    width: min(100% - 36px, 720px);
    padding-top: 38px;
  }

  .finding-card,
  .dashboard-grid,
  .dashboard-bottom {
    grid-template-columns: 1fr;
  }

  .finding-card {
    align-items: start;
  }

  .finding-link {
    width: max-content;
  }

  .category-goal-layout {
    grid-template-columns: 1fr;
  }

  .screen-heading {
    display: block;
  }

  .screen-heading > p {
    max-width: 540px;
    margin-top: 15px;
  }

  .goal-save-bar {
    grid-column: auto;
  }

  .footer {
    width: min(100% - 36px, 720px);
    padding-bottom: 115px;
  }

  .footer > span:nth-child(2) {
    display: none;
  }

  .mobile-nav {
    position: fixed;
    z-index: 45;
    left: 50%;
    bottom: max(14px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    width: min(420px, calc(100% - 28px));
    padding: 7px;
    transform: translateX(-50%);
    border: 1px solid var(--line);
    border-radius: 22px;
    background: color-mix(in srgb, var(--surface), transparent 7%);
    box-shadow: 0 18px 50px rgba(20, 24, 32, 0.16);
    backdrop-filter: blur(18px);
  }

  .mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-height: 55px;
    padding: 7px 4px 5px;
    border-radius: 16px;
    color: var(--soft);
    font-size: 8px;
    font-weight: 650;
  }

  .mobile-nav a.active {
    background: var(--surface-2);
    color: var(--ink);
  }
}

@media (max-width: 600px) {
  .topbar {
    width: calc(100% - 32px);
  }

  .brand {
    font-size: 27px;
  }

  .header-actions .account {
    display: none;
  }

  .demo-strip {
    width: calc(100% - 32px);
    padding: 9px 11px;
    font-size: 9px;
  }

  .page,
  .page.narrow,
  .login-page,
  .gap-page,
  .settings-page {
    width: calc(100% - 32px);
    padding: 30px 0 58px;
  }

  .back-link {
    margin-bottom: 26px;
  }

  .dashboard-heading h1,
  .screen-title {
    font-size: 36px;
  }

  .dashboard-heading p {
    max-width: 270px;
    font-size: 11px;
  }

  .category-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .category-switch button {
    justify-content: center;
  }

  .finding-card {
    min-height: 300px;
    padding: 27px 24px 24px;
    border-radius: 25px;
  }

  .finding-card h2 {
    margin-top: 48px;
    font-size: 29px;
  }

  .finding-card p {
    font-size: 10px;
  }

  .finding-link {
    justify-content: space-between;
    width: 100%;
  }

  .dashboard-grid {
    grid-template-columns: 1fr 0.8fr;
    gap: 10px;
  }

  .summary-card {
    min-height: 190px;
    padding: 19px;
    border-radius: 21px;
  }

  .current-goal-card .other-goal {
    display: none;
  }

  .goal-summary {
    display: block;
  }

  .goal-summary .category-icon {
    margin-bottom: 14px;
  }

  .goal-summary strong {
    font-size: 16px;
  }

  .goal-summary p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 9px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .progress-ring {
    width: 88px;
    height: 88px;
  }

  .progress-ring::before {
    width: 70px;
    height: 70px;
  }

  .progress-ring span {
    font-size: 20px;
  }

  .routine-section,
  .function-strip,
  .quiet-note,
  .category-goal-card,
  .form-panel {
    padding: 20px;
    border-radius: 22px;
  }

  .section-heading h2 {
    font-size: 20px;
  }

  .product-row {
    grid-template-columns: 62px minmax(0, 1fr) auto;
  }

  .product-result > span {
    display: none;
  }

  .product-result {
    padding: 0 14px 0 4px;
  }

  .function-list {
    grid-template-columns: 1fr;
  }

  .function {
    min-height: 45px;
  }

  .category-goal-heading .category-icon {
    width: 38px;
    height: 38px;
  }

  .goal-option {
    min-height: 64px;
  }

  .goal-save-bar {
    position: sticky;
    z-index: 10;
    bottom: 84px;
    padding: 12px;
  }

  .goal-save-bar > div {
    display: none;
  }

  .goal-save-bar .button {
    width: 100%;
  }

  .form-row,
  .recommendation,
  .detail-header {
    grid-template-columns: 1fr;
  }

  .dropzone {
    padding: 38px 20px;
  }

  .dropzone .action-row {
    flex-direction: column;
    width: 100%;
  }

  .dropzone .button {
    width: 100%;
  }

  .gap-label {
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
  }

  .gap-headline {
    font-size: 43px;
  }

  .gap-consequence {
    font-size: 13px;
  }

  .recommendation {
    gap: 14px;
  }

  .detail-header .bottle-scene {
    height: 130px;
  }

  .ingredient-group {
    padding: 19px;
  }

  .ingredient-row summary {
    grid-template-columns: auto 1fr auto;
  }

  .ingredient-row summary small {
    display: none;
  }

  .footer {
    width: calc(100% - 32px);
  }

  .footer a {
    font-size: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

.product-match { display: grid; gap: 10px; background: #f3f5f9; border-radius: 14px; padding: 16px; }
.product-match p { margin: 0; font-size: 13px; line-height: 1.55; }
.product-match small { display: block; color: #566170; font-size: 11px; line-height: 1.45; }
.product-match-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.product-match-heading strong { font-size: 32px; color: var(--match-colour, #707985); letter-spacing: -1px; }
.product-match meter { width: 100%; height: 12px; }
.product-match meter::-webkit-meter-bar { background: #dde3ed; border: 0; border-radius: 6px; }
.product-match meter::-webkit-meter-optimum-value { background: var(--match-colour, #707985); }

.product-match meter::-moz-meter-bar { background: var(--match-colour, #707985); border-radius: 6px; }
