@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;450;500;550;600;650;700&display=swap');

:root {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #edeef4;
  background: #14151b;
  color-scheme: dark;
  font-synthesis: none;
  --background: #14151b;
  --panel: #1d1e26;
  --border: #2c2d38;
  --muted: #989aa9;
  --lime: #c1f49d;
  --purple: #c3b1ff;
  --orange: #ffbb98;
  --yellow: #e9d193;
}

* { box-sizing: border-box; }
body { margin: 0; font-size: 1rem; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { color: inherit; cursor: pointer; transition: background 160ms, border-color 160ms, transform 160ms; }
button:active { transform: translateY(1px); }
a { color: inherit; }
button:focus-visible, a:focus-visible, .chart-point:focus-visible { outline: 2px solid var(--purple); outline-offset: 4px; }
input:focus, select:focus, textarea:focus { outline: 3px solid #c3b1ff1c; border-color: #9d8ac9; }
svg { flex-shrink: 0; vertical-align: middle; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 550; }
h1 { font-size: 2.15rem; line-height: 1.2; letter-spacing: -1.1px; }
h2 { font-size: 1.05rem; letter-spacing: -.2px; }
h3 { font-size: 1rem; }
.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; }
.positive { color: var(--lime); }
.secondary-text { color: var(--muted); }
.small-label, .eyebrow { font-size: .7rem; font-weight: 550; letter-spacing: 1.3px; }
.eyebrow { color: #9597a6; margin-bottom: 12px; }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 8px; padding: 11px 18px; font-size: .875rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.primary { background: var(--lime); color: #293421; box-shadow: 0 3px 12px #b8e8930a; }
.primary:hover { background: #d1ffb1; box-shadow: 0 3px 18px #b8e89320; }
.secondary { background: #292a35; border-color: #3b3c49; }
.secondary:hover { background: #323341; }
.full { width: 100%; }
.text-button { border: 0; padding: 8px 0; background: none; color: var(--purple); font-size: .875rem; font-weight: 500; text-align: left; }
.text-button:hover { color: #ded3ff; text-decoration: underline; }
.icon-button { border: 0; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: transparent; color: #a4a5b5; }
.icon-button:hover { color: var(--purple); background: #34303f; }
.icon-box { color: var(--purple); background: #b8a2ff15; width: 35px; height: 35px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; flex-shrink: 0; }
.icon-box.orange { background: #ffbb9815; color: var(--orange); }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 5px; padding: 4px 8px; font-size: .75rem; font-weight: 450; white-space: nowrap; }
.badge.green { background: #c1f49d12; color: #b5db98; }
.badge.neutral { background: #ffffff09; color: #a6a8b8; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.22rem; font-weight: 650; letter-spacing: -.8px; }
.brand-light { font-weight: 400; color: #a0a0ae; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 12px; color: #24301e; background: var(--lime); }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 226px; display: flex; flex-direction: column; padding: 30px 18px 22px; background: #18191f; border-right: 1px solid #292a33; z-index: 20; }
.sidebar .brand { padding: 0 7px; }
.nav-heading { color: #737582; font-size: .65rem; font-weight: 550; letter-spacing: 1.5px; margin: 52px 14px 14px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 11px 14px; border: 0; border-radius: 8px; background: none; color: #989aa9; font-size: .875rem; text-align: left; margin-bottom: 6px; }
.nav-item.active { color: var(--purple); background: #b8a2ff12; font-weight: 550; }
.nav-item:hover { background: #b8a2ff0c; color: #d1c8eb; }
.nav-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--purple); margin-left: auto; box-shadow: 0 0 9px #b8a2ff55; }
.sidebar-bottom { margin-top: auto; }
.local-label { display: flex; align-items: center; gap: 7px; color: #747684; font-size: .7rem; margin: 27px 13px 0; }
.local-dot { background: #a5c88b; width: 5px; height: 5px; border-radius: 50%; }
.main-shell { margin-left: 226px; }
.topbar { height: 80px; padding: 0 40px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #272831; background: #16171d; }
.breadcrumb { font-size: .8rem; color: #777987; }
.breadcrumb span { margin: 0 12px; color: #51535e; }
.breadcrumb strong { color: #b1b2bf; font-weight: 450; }
.topbar-right { display: flex; gap: 25px; align-items: center; }
.header-date { display: flex; align-items: center; gap: 9px; color: #9495a4; font-size: .8rem; }
.profile-avatar { width: 33px; height: 33px; border-radius: 50%; background: #d1c0ff15; border: 1px solid #d1c0ff22; color: var(--purple); display: grid; place-items: center; }
.main-content { max-width: 1440px; padding: 34px 40px 36px; margin: 0 auto; outline: none; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 29px; min-height: 46px; }
.page-heading p { color: var(--muted); font-size: .875rem; margin-top: 7px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; margin-bottom: 24px; }
.stat-card { border: 1px solid var(--border); border-radius: 12px; background: var(--panel); padding: 20px; position: relative; overflow: hidden; animation: arrive 400ms both; }
.stat-card:nth-child(2) { animation-delay: 40ms; }
.stat-card:nth-child(3) { animation-delay: 80ms; }
.stat-card:nth-child(4) { animation-delay: 120ms; }
.stat-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #acacba; font-size: .8125rem; }
.stat-heading .icon-box { width: 31px; height: 31px; border-radius: 9px; }
.stat-value { font-size: 2.15rem; line-height: 1.2; letter-spacing: -1px; font-weight: 550; margin: 15px 0 11px; font-variant-numeric: tabular-nums; }
.stat-value > span { color: #9595a7; font-size: .83rem; font-weight: 400; letter-spacing: 0; }
.stat-card p { font-size: .75rem; color: #8f91a2; }
.stat-card p strong { font-weight: 500; color: #b8b8c6; }
.stat-grid > .stat-card:first-child .stat-value { color: #d2c2ff; }
.stat-grid > .stat-card:nth-child(2) .stat-value { color: var(--lime); }
.stat-grid > .stat-card:nth-child(2) .icon-box { color: var(--lime); background: #c1f49d12; }
.stat-grid > .stat-card:nth-child(3) .stat-value { color: var(--orange); }
.goal-stat { background: linear-gradient(120deg, #27271f, #21221f); border-color: #3c3c2e; }
.goal-stat .stat-value { color: var(--yellow); }
.goal-stat .icon-box { background: #e9d19312; color: var(--yellow); }
.primary-grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(265px, 1fr); gap: 23px; align-items: stretch; margin-bottom: 24px; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; min-width: 0; }
.panel-heading { padding: 22px 24px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-heading p { color: #9293a4; font-size: .8125rem; margin-top: 5px; }
.chart-heading { align-items: flex-start; min-height: 80px; }
.chart-heading p strong { font-weight: 500; }
.segmented { display: flex; gap: 2px; padding: 3px; border: 1px solid #33343f; border-radius: 7px; background: #18191f; }
.segmented button { min-height: 31px; min-width: 32px; padding: 4px 7px; border: 0; border-radius: 5px; background: transparent; color: #8f90a2; font-size: .75rem; }
.segmented button.selected { color: var(--purple); background: #bca7ff20; font-weight: 550; }
.segmented button:hover { background: #bca7ff12; }
.chart-wrap { margin: 13px 20px 0 8px; }
.weight-chart { display: block; width: 100%; height: auto; min-height: 200px; max-height: 290px; overflow: visible; }
.weight-chart text { fill: #858698; font-family: inherit; font-size: 16px; }
.chart-line { stroke-dasharray: 1400; stroke-dashoffset: 0; animation: draw-chart 1000ms ease-out both; }
.chart-point { fill: #c4b1ff; stroke: #1d1e26; stroke-width: 1.5; }
.chart-point:hover, .chart-point:focus { r: 6; fill: #ddd0ff; }
.chart-legend { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 17px; padding: 10px 12px 14px; color: #a6a6b7; font-size: .8125rem; }
.chart-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.legend-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--purple); display: inline-block; }
.legend-line { width: 14px; height: 0; border-top: 1px dashed #a69b71; }
.legend-average { display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--lime); }
.average-summary { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 7px 16px; margin: 16px 24px 0; }
.average-summary > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; }
.average-summary span { color: #aaaabb; font-size: .875rem; }
.average-summary strong { color: var(--lime); font-size: 1.3rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.average-summary small { color: #aaaabb; font-size: .8125rem; }
.average-summary p { color: #9898aa; font-size: .8125rem; }
.chart-note { color: #9898aa; font-size: .8125rem; line-height: 1.65; margin: 0 24px 20px; }
.today-card { display: flex; flex-direction: column; border-radius: 12px; border: 1px solid #3d364e; background: linear-gradient(135deg, #2c253b, #25232e); padding: 24px; }
.today-top { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; }
.today-top .icon-box { background: #c3b1ff1c; }
.today-top .small-label { color: #b9a9d6; font-size: .65rem; }
.today-card h2 { font-size: 1.3rem; letter-spacing: -.5px; color: #e6dcfa; margin-bottom: 10px; }
.today-card > p { color: #aea3bd; font-size: .875rem; line-height: 1.7; }
.today-checklist { display: flex; gap: 16px; flex-wrap: wrap; margin: 20px 0 25px; color: #b0a2c2; font-size: .8125rem; }
.today-checklist > span { display: flex; align-items: center; gap: 7px; }
.today-card .button { background: var(--purple); color: #31273e; margin-top: auto; }
.today-card .button:hover { background: #d2c3ff; }
.today-foot { text-align: center; margin-top: 11px; color: #9b90ac; font-size: .7rem; }
.today-summary { display: flex; gap: 27px; padding: 18px 0 24px; }
.today-summary span { display: block; color: #a79ab7; font-size: .75rem; }
.today-summary strong { display: block; font-size: 1.1rem; color: #e3d8f6; font-weight: 550; margin-top: 3px; }
.today-summary small { font-size: .75rem; }
.goal-panel { display: grid; grid-template-columns: 1fr 235px; gap: 30px; align-items: center; margin-bottom: 24px; padding: 24px; }
.goal-title { display: flex; align-items: center; gap: 13px; }
.goal-title .icon-box { width: 40px; height: 40px; border-radius: 50%; background: #c1f49d10; color: var(--lime); }
.goal-title p { font-size: .8125rem; color: #9899a7; margin-top: 3px; }
.goal-track { position: relative; overflow: hidden; height: 8px; background: #32333b; border-radius: 5px; margin-top: 22px; }
.goal-track > div { height: 100%; background: var(--lime); border-radius: inherit; transform-origin: left; animation: fill-progress 750ms ease-out both; box-shadow: 0 0 14px #c1f49d30; }
.goal-track > span { position: absolute; top: 0; height: 8px; width: 2px; background: var(--panel); }
.goal-labels { display: flex; justify-content: space-between; gap: 10px; color: #9696a8; font-size: .75rem; margin-top: 10px; }
.goal-labels strong { font-weight: 450; }
.goal-labels > span > strong { color: #bbbccc; margin-left: 4px; }
.goal-milestone { display: flex; align-items: center; gap: 14px; padding-left: 25px; border-left: 1px solid #34343e; }
.milestone-icon { width: 45px; height: 45px; border-radius: 50%; background: #e9d19310; color: var(--yellow); display: grid; place-items: center; flex-shrink: 0; }
.goal-milestone .small-label { display: block; color: #baa57a; font-size: .6rem; letter-spacing: 1.2px; }
.goal-milestone strong { display: block; font-weight: 550; font-size: 1rem; margin: 4px 0; color: #efdbad; }
.goal-milestone p { color: #9f9785; font-size: .75rem; }
.milestone-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.milestone-badges > span:first-child { color: #8f91a3; font-size: .75rem; margin-right: 3px; }
.milestone-badges .badge { font-size: .7rem; }
.secondary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.subtle-icon { color: #78798b; }
.consistency-summary { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 18px; }
.consistency-summary > strong { font-size: 1.5rem; font-weight: 500; color: #d7c8ff; letter-spacing: -.5px; }
.consistency-summary > strong > span { color: #9595a8; font-size: .875rem; font-weight: 400; letter-spacing: 0; }
.consistency-summary .badge { font-size: .75rem; }
.checkin-days { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 5px; margin: 0 24px; }
.day-cell { min-width: 0; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border: 1px solid #34343e; border-radius: 4px; background: #262730; color: #6f7182; padding: 0; font-size: .6rem; }
.day-cell.logged { color: #2c2538; background: #b7a3e5; border-color: #b7a3e5; }
.day-cell:hover { background: #d1baff; color: #332844; transform: translateY(-2px); }
.day-cell.is-today { border-color: #c3b1ff; color: #c3b1ff; }
.day-cell.is-today.logged { color: #2c2538; }
.calendar-labels { display: flex; align-items: center; justify-content: space-between; margin: 12px 24px 23px; color: #858697; font-size: .7rem; }
.calendar-labels > span:nth-child(2) { display: flex; align-items: center; gap: 6px; }
.calendar-labels .legend-dot { border-radius: 2px; }
.meal-center { display: flex; align-items: center; gap: 12px; padding: 24px 24px 0; }
.meal-time { font-size: 1.8rem; font-weight: 500; letter-spacing: -.8px; line-height: 1.2; color: var(--orange); }
.meal-center .badge { color: #b99a8b; background: #ffbb9810; }
.meal-window-track { position: relative; height: 7px; background: #2f2e32; border-radius: 4px; margin: 25px 24px 10px; }
.meal-window-track > div { width: 58%; height: 100%; border-radius: inherit; background: #b88a6f; margin: auto; }
.meal-window-track > i { display: block; width: 12px; height: 12px; border: 2px solid var(--panel); outline: 1px solid #ffbb98; background: #ffbb98; position: absolute; left: calc(50% - 6px); top: -3px; border-radius: 50%; }
.meal-window-labels { display: flex; justify-content: space-between; margin: 0 24px; color: #8f8b91; font-size: .7rem; }
.meal-summary { display: flex; align-items: center; gap: 7px; border-top: 1px solid var(--border); margin: 20px 24px 0; padding: 15px 0; color: #9a9b9f; font-size: .75rem; }
.meal-summary > svg { color: #c1f49d; }
.meal-summary strong { color: #c1d1b3; font-weight: 500; }
.meal-summary > span:last-child { margin-left: auto; font-size: .7rem; }
.recent-panel .panel-heading { padding-bottom: 21px; }
.panel-heading > .text-button { font-size: .8125rem; }
.table-scroll { overflow-x: auto; border-radius: 0 0 12px 12px; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; text-align: left; white-space: nowrap; }
thead { background: #20212a; color: #9b9baa; }
th { padding: 12px 24px; font-size: .8125rem; font-weight: 400; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
td { padding: 10px 24px; color: #c0bfce; border-bottom: 1px solid #2a2b34; }
td:first-child strong { font-weight: 450; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #ffffff02; }
td:last-child { width: 50px; padding: 5px 13px; }
td .badge { font-size: .7rem; padding: 4px 7px; }
.entry-note { display: block; max-width: 240px; white-space: normal; overflow-wrap: anywhere; font-size: .75rem; color: #9292a5; margin-top: 4px; }
.mobile-detail { display: none; }
.app-footer { display: flex; justify-content: space-between; max-width: 1440px; margin: 0 auto; padding: 0 40px 26px; color: #696b79; font-size: .7rem; }
.empty-chart { display: flex; align-items: center; justify-content: center; flex-direction: column; min-height: 240px; padding: 24px; color: #77738d; }
.empty-chart h3 { color: #c6bce0; margin: 14px 0 6px; }
.empty-chart p { color: #8e8c9e; font-size: .875rem; text-align: center; }
.empty-chart .text-button { margin-top: 10px; }
.empty-table { text-align: center; padding: 35px 20px; }
.empty-table h3 { margin: 12px 0 6px; }
.empty-table p { color: var(--muted); font-size: .875rem; }
.empty-table .text-button { margin-top: 10px; }
.demo-banner { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 10px 40px; color: #aba1be; background: #2a2434; border-bottom: 1px solid #3a3048; font-size: .75rem; }
.demo-banner button { background: transparent; border: 0; font: inherit; color: #c5b1e8; font-weight: 550; text-decoration: underline; padding: 7px 0; white-space: nowrap; }
.comparison-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.comparison-grid .stat-value { color: var(--purple); }
.view-note { color: #8a899e; font-size: .75rem; line-height: 1.7; margin: 14px 0 24px; }
.insights-chart { margin-bottom: 24px; }
.insights-chart .weight-chart { max-height: 340px; }
.journey-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 25px; }
.journey-facts > div { display: flex; flex-direction: column; gap: 10px; padding-left: 25px; border-left: 1px solid var(--border); }
.journey-facts > div:first-child { border: 0; padding-left: 0; }
.journey-facts span { font-size: .75rem; color: var(--muted); }
.journey-facts strong { font-size: 1.25rem; font-weight: 500; color: #d0c5e7; }
.journey-facts small { font-size: .875rem; font-weight: 400; color: #9992aa; }
.count-label { background: #c3b1ff12; color: var(--purple); padding: 2px 7px; border-radius: 5px; margin-left: 6px; font-size: .75rem; }
select { appearance: none; background: #24252e url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m2 2 4 4 4-4' fill='none' stroke='%23c3b1ff' stroke-width='1.5'/%3E%3C/svg%3E") right 13px center no-repeat; padding-right: 35px !important; }
#history-month { padding: 9px 14px; border: 1px solid #3b3b4a; border-radius: 7px; font-size: .875rem; min-height: 44px; width: auto; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 24px; }
.settings-panel { padding: 27px; margin-bottom: 24px; }
.settings-panel > p { font-size: .875rem; color: var(--muted); margin-top: 9px; line-height: 1.8; }
.settings-panel form { margin-top: 26px; }
.settings-panel .field-help { font-size: .8125rem; color: #9390a5; margin: -10px 0 24px; }
.settings-actions { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; margin-top: 22px; }
.install-heading { display: flex; align-items: center; gap: 14px; }
.install-heading img, .install-help img { border-radius: 12px; }
.install-heading span { color: var(--muted); font-size: .875rem; }
.install-button, #install-panel > .badge { margin-top: 18px; }
.install-help h3 { margin: 24px 0 10px; color: var(--purple); }
.install-help ol { padding-left: 22px; color: #c2bbce; font-size: .875rem; line-height: 1.8; }
.install-help li { padding-left: 3px; margin-bottom: 7px; }
.install-help p { color: #a49bad; font-size: .8125rem; line-height: 1.7; margin-top: 18px; }
.entry-window-hint { color: #a19aad; font-size: .8125rem; line-height: 1.7; margin: -5px 0 20px; }
.danger { color: #f19b9b; }
.danger-panel .text-button { margin-top: 14px; }
.destructive { background: #c66f78; color: #1c1416; }
.destructive:hover { background: #e08c94; }

.onboarding { min-height: 100svh; display: grid; grid-template-columns: 1fr 1fr; background: #17181f; }
.setup-art { display: flex; flex-direction: column; min-height: 100svh; padding: 42px 52px; overflow: hidden; background: radial-gradient(ellipse at 35% 65%, #3e315159, transparent 65%), #1d1c27; border-right: 1px solid #302c3e; }
.setup-art .brand { font-size: 1.3rem; }
.setup-intro { margin: auto 0; padding: 65px 0 0; }
.setup-intro .eyebrow { color: #9b8eb3; font-size: .7rem; }
.setup-intro h1 { font-size: clamp(3.5rem, 6.3vw, 6rem); font-weight: 550; letter-spacing: -4px; line-height: 1.02; margin-top: 18px; }
.setup-intro h1 > span { color: var(--purple); }
.setup-intro > p { color: #a69bb6; font-size: 1rem; margin-top: 23px; }
.setup-foot { color: #82758f; font-size: .75rem; padding-top: 30px; }
.illustration { height: 265px; display: grid; place-items: center; position: relative; margin-top: 20px; }
.orbit { position: absolute; width: 220px; height: 220px; border: 1px solid #6a57733d; border-radius: 50%; }
.orbit-two { width: 290px; height: 290px; border-style: dashed; opacity: .8; }
.illustration-center { display: grid; place-items: center; width: 150px; height: 150px; color: var(--purple); background: #b8a2ff12; border: 9px solid #b8a2ff0c; border-radius: 50%; box-shadow: 0 0 70px #b8a2ff0a; animation: float 7s ease-in-out infinite; }
.floating-stat { display: flex; align-items: center; gap: 12px; position: absolute; padding: 13px 17px; background: #27232f; border: 1px solid #3e344c; border-radius: 10px; box-shadow: 0 12px 30px #09060c3d; color: var(--yellow); transform: rotate(-4deg); }
.floating-stat span { display: block; color: #9a88ae; font-size: .6rem; letter-spacing: 1px; }
.floating-stat strong { font-size: .875rem; font-weight: 500; color: #ded2ed; }
.float-top { top: 20px; left: 3%; }
.float-bottom { bottom: 20px; right: 0; transform: rotate(4deg); color: var(--lime); }
.setup-form-wrap { display: flex; align-items: center; justify-content: center; padding: 55px 50px; }
.setup-form { width: 100%; max-width: 365px; animation: arrive 500ms both; }
.setup-form > .small-label { color: var(--lime); font-size: .65rem; }
.setup-form h2 { font-size: 2rem; letter-spacing: -1px; margin: 12px 0; }
.setup-form > p { color: #9d9aaf; font-size: .875rem; line-height: 1.8; }
.setup-form form { margin-top: 33px; }
.field { display: flex; flex-direction: column; gap: 9px; color: #c6bfd7; font-size: .875rem; font-weight: 450; margin-bottom: 21px; }
input, select, textarea { width: 100%; min-width: 0; min-height: 49px; color: #eeebf5; background-color: #20212a; border: 1px solid #3b394a; border-radius: 8px; padding: 12px 13px; font-size: 1rem; font-weight: 400; }
input::placeholder, textarea::placeholder { color: #747184; }
input[type='date'], input[type='time'] { display: block; appearance: none; -webkit-appearance: none; text-align: left; }
textarea { min-height: 75px; max-height: 180px; resize: vertical; }
.window-hint { display: flex; align-items: center; gap: 9px; color: #a19aac; font-size: .8125rem; margin: -6px 0 29px; }
.window-hint svg { color: #b5a0d3; }
.setup-form .button { min-height: 49px; }
.setup-privacy { display: flex; align-items: center; justify-content: center; gap: 7px; color: #9892a7; font-size: .75rem; margin: 18px 0 29px; }
.setup-privacy svg { color: #a8c091; }
.setup-options { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; column-gap: 8px; border-top: 1px solid #2f2b3b; padding-top: 20px; }
.setup-options > span { color: #70687f; font-size: .75rem; }
.setup-options .text-button { font-size: .75rem; color: #ac9cc9; }
.notice { background: #b3904812; border: 1px solid #b3904830; padding: 13px; margin-top: 16px !important; color: #c9ae7b !important; border-radius: 8px; }

dialog { width: min(450px, calc(100% - 32px)); max-height: calc(100svh - 32px); padding: 28px; border: 1px solid #464052; border-radius: 15px; color: #eee7f6; background: #202029; box-shadow: 0 25px 100px #0008; overflow-y: auto; animation: modal-in 180ms ease-out; }
dialog::backdrop { background: #080910a8; backdrop-filter: blur(6px); }
.modal-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.modal-heading .icon-box { width: 44px; height: 44px; border-radius: 12px; }
dialog h2 { font-size: 1.5rem; letter-spacing: -.6px; }
.modal-description { font-size: .875rem; color: #a29bad; margin: 5px 0 24px; }
dialog .field { margin-bottom: 17px; }
.optional { display: inline; font-size: .75rem; color: #93869e; font-weight: 400; margin-left: 5px; }
.modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 15px; margin-top: 27px; }
.modal-actions .danger { margin-right: auto; }
.confirm-content > p { color: #aca0ba; font-size: .875rem; line-height: 1.8; margin-top: 12px; }
#toast { position: fixed; bottom: 25px; left: 50%; transform: translate(-50%, 10px); max-width: calc(100% - 30px); padding: 14px 22px; border: 1px solid #b9a4df55; border-radius: 9px; background: #342b41; color: #e8dcfa; box-shadow: 0 6px 24px #0005; font-size: .875rem; z-index: 100; opacity: 0; visibility: hidden; transition: opacity 160ms, transform 160ms; }
#toast.visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

@keyframes arrive { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes draw-chart { from { stroke-dashoffset: 1400; opacity: .4; } to { stroke-dashoffset: 0; opacity: 1; } }
@keyframes fill-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-8px) rotate(3deg); } }

@media (max-width: 1190px) {
  .sidebar { width: 202px; padding-inline: 12px; }
  .main-shell { margin-left: 202px; }
  .main-content { padding: 30px 25px; }
  .topbar { padding-inline: 25px; }
  .stat-grid { gap: 12px; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 2rem; }
  .primary-grid { gap: 18px; grid-template-columns: minmax(0, 1.8fr) minmax(250px, 1fr); }
  .chart-heading { flex-wrap: wrap; gap: 12px; }
  .panel-heading { padding-inline: 19px; }
  .today-card { padding: 20px; }
  .goal-panel { grid-template-columns: 1fr 215px; gap: 20px; padding: 22px; }
  .goal-milestone { padding-left: 20px; }
  .checkin-days { margin-inline: 18px; gap: 4px; }
  th, td { padding-inline: 18px; }
  .setup-art { padding: 36px; }
  .setup-form-wrap { padding: 40px; }
}

@media (max-width: 960px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .stat-card { padding: 20px; }
  .stat-heading { font-size: .875rem; }
  .stat-value { font-size: 2.15rem; }
  .primary-grid { grid-template-columns: 1fr; }
  .chart-heading { flex-wrap: nowrap; }
  .today-card { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
  .today-top { grid-column: 1 / -1; margin-bottom: 12px; }
  .today-card h2, .today-card > p { grid-column: 1; }
  .today-checklist, .today-summary { grid-column: 2; grid-row: 2 / 4; margin: 0; padding: 0; justify-content: flex-end; align-self: start; }
  .today-card .button { grid-column: 2; grid-row: 4; margin-top: 20px; }
  .today-foot { grid-column: 1; grid-row: 4; text-align: left; align-self: end; margin-bottom: 14px; }
  .goal-panel { grid-template-columns: 1fr; gap: 20px; }
  .goal-milestone { border-left: 0; border-top: 1px solid var(--border); padding: 18px 0 0; }
  .secondary-grid { grid-template-columns: 1fr; }
  .checkin-days { gap: 7px; }
  .day-cell { font-size: .75rem; }
  .day-cell svg { width: 18px; height: 18px; }
  .settings-grid { grid-template-columns: 1fr; gap: 0; }
  .comparison-grid { gap: 12px; }
  .comparison-grid .stat-card { padding: 15px; }
  .comparison-grid .stat-heading { font-size: .8125rem; }
  .comparison-grid .stat-heading .icon-box { display: none; }
  .journey-facts { grid-template-columns: 1fr 1fr; gap: 25px; }
  .journey-facts > div:nth-child(3) { border: 0; padding: 0; }
}

@media (max-width: 700px) {
  body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .sidebar { inset: auto 0 0; width: 100%; height: calc(66px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 3fr 1fr; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid #3c3648; background: #1b1a22ed; backdrop-filter: blur(16px); z-index: 30; }
  .sidebar > .brand, .nav-heading, .sidebar-bottom > [data-action='export-csv'], .local-label, .nav-dot { display: none; }
  .sidebar nav { display: grid; grid-template-columns: repeat(3, 1fr); }
  .sidebar-bottom { margin-top: 0; }
  .nav-item { flex-direction: column; justify-content: center; gap: 5px; min-height: 51px; padding: 5px 2px; font-size: .7rem; border-radius: 7px; margin: 0; font-weight: 400; }
  .nav-item svg { width: 20px; height: 20px; }
  .sidebar-bottom .nav-item { height: 100%; }
  .nav-item.active { background: transparent; color: var(--purple); }
  .nav-item.active svg { background: #b8a2ff1c; border-radius: 6px; outline: 5px solid #b8a2ff1c; }
  .main-shell { margin-left: 0; }
  .topbar { height: calc(61px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left)); }
  .breadcrumb { font-size: .75rem; }
  .breadcrumb > span { margin: 0 7px; }
  .topbar-right { gap: 12px; }
  .header-date { font-size: .65rem; gap: 6px; }
  .header-date svg { display: none; }
  .profile-avatar { width: 28px; height: 28px; }
  .profile-avatar svg { width: 16px; height: 16px; }
  .main-content { padding: 25px 18px 24px; }
  .page-heading { flex-wrap: wrap; gap: 20px; margin-bottom: 22px; }
  .page-heading h1 { font-size: 2rem; }
  .page-heading p { font-size: .875rem; }
  .page-heading > .button { width: 100%; min-height: 47px; }
  .stat-grid { gap: 10px; margin-bottom: 18px; }
  .stat-card { padding: 15px; border-radius: 10px; }
  .stat-heading { font-size: .8125rem; gap: 5px; align-items: flex-start; }
  .stat-heading .icon-box { width: 27px; height: 27px; border-radius: 8px; }
  .stat-heading .icon-box svg { width: 17px; height: 17px; }
  .stat-value { font-size: 1.9rem; margin-top: 13px; margin-bottom: 9px; white-space: nowrap; }
  .stat-value > span { font-size: .75rem; }
  .stat-card p { font-size: .75rem; min-height: 20px; line-height: 1.6; }
  .primary-grid { margin-bottom: 18px; gap: 18px; }
  .weight-panel .panel-heading { flex-wrap: wrap; gap: 15px; padding: 19px 18px 0; }
  .chart-heading > div:first-child { flex: 1; min-width: 130px; }
  .segmented { flex-shrink: 0; gap: 0; }
  .segmented button { font-size: .7rem; min-height: 34px; min-width: 28px; padding: 5px 6px; }
  .panel-heading h2 { font-size: 1rem; }
  .panel-heading p { font-size: .8125rem; }
  .chart-wrap { margin: 18px 10px 0 0; }
  .weight-chart { min-height: 180px; }
  .weight-chart text { font-size: 26px; }
  .chart-legend { font-size: .75rem; gap: 9px 13px; padding: 8px 12px 14px; }
  .average-summary { margin: 15px 18px 0; gap: 4px; }
  .average-summary > div { gap: 10px; }
  .chart-note { margin-inline: 18px; font-size: .8125rem; }
  .today-card { padding: 20px; display: flex; gap: 0; }
  .today-top { margin-bottom: 14px; }
  .today-card h2 { font-size: 1.3rem; }
  .today-card > p { font-size: .875rem; }
  .today-checklist { justify-content: flex-start; align-self: auto; margin: 16px 0 20px; font-size: .875rem; }
  .today-summary { justify-content: flex-start; align-self: auto; margin: 12px 0 20px; }
  .today-card .button { margin-top: 0; min-height: 46px; }
  .today-foot { align-self: auto; text-align: center; margin: 11px 0 0; font-size: .75rem; }
  .goal-panel { padding: 20px 18px; margin-bottom: 18px; gap: 18px; }
  .goal-title { gap: 11px; }
  .goal-title h2 { font-size: 1rem; }
  .goal-title p { font-size: .8125rem; }
  .goal-title .icon-box { width: 36px; height: 36px; }
  .goal-labels { font-size: .75rem; gap: 5px; flex-wrap: wrap; }
  .goal-labels > span > strong { margin-left: 1px; }
  .goal-milestone .small-label { font-size: .65rem; }
  .goal-milestone p { font-size: .8125rem; }
  .goal-milestone strong { font-size: 1.05rem; }
  .milestone-badges > span:first-child { flex-basis: 100%; }
  .secondary-grid { margin-bottom: 18px; gap: 18px; }
  .consistency-summary { padding: 18px; }
  .checkin-days { gap: 6px; grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .day-cell { aspect-ratio: 1.3; font-size: .75rem; border-radius: 6px; }
  .day-cell svg { width: 17px; height: 17px; }
  .calendar-labels { margin-inline: 18px; font-size: .7rem; }
  .calendar-labels .legend-dot { width: 7px; height: 7px; }
  .meal-window-labels, .meal-summary, .meal-summary > span:last-child { font-size: .75rem; }
  .meal-summary { margin-inline: 18px; }
  .recent-panel .panel-heading { align-items: flex-start; }
  .panel-heading > .text-button { font-size: .8125rem; padding-top: 1px; }
  th, td { padding-inline: 15px; }
  table { font-size: .875rem; }
  td:nth-child(3), th:nth-child(3), td:nth-child(5), th:nth-child(5) { display: none; }
  td:first-child { min-width: 113px; }
  td:nth-child(2) { min-width: 83px; }
  td:nth-child(4) { min-width: 91px; }
  td:last-child { padding-inline: 3px; }
  td .icon-button { width: 35px; height: 44px; }
  .entry-note { max-width: 170px; }
  .mobile-detail { display: block; font-size: .7rem; color: #9994a9; margin-top: 4px; }
  .mobile-detail.positive { color: #a9d389; }
  .app-footer { padding: 0 20px 16px; gap: 15px; font-size: .65rem; }
  .demo-banner { padding: 10px 18px; font-size: .75rem; gap: 18px; }
  .demo-banner button { white-space: normal; min-width: 85px; text-align: right; }
  .comparison-grid { grid-template-columns: 1fr; gap: 10px; }
  .comparison-grid .stat-card { padding: 18px; display: grid; grid-template-columns: 1fr 1fr; align-items: center; }
  .comparison-grid .stat-value { grid-column: 2; grid-row: 1 / 3; text-align: right; margin: 0; }
  .comparison-grid .stat-heading { font-size: .875rem; }
  .comparison-grid .stat-card p { margin-top: 5px; font-size: .75rem; }
  .view-note { font-size: .75rem; }
  .journey-facts { padding: 20px; gap: 25px 15px; }
  .journey-facts > div { padding-left: 15px; }
  .journey-facts span { font-size: .75rem; }
  .journey-facts strong { font-size: 1.1rem; }
  .settings-panel { padding: 22px; margin-bottom: 18px; }
  .settings-panel .button { width: 100%; }
  .settings-actions { align-items: stretch; }
  .settings-actions .text-button { min-height: 44px; }
  #history-month { max-width: 140px; font-size: .8125rem; }
  .onboarding { grid-template-columns: 1fr; }
  .setup-art { min-height: 0; padding: calc(26px + env(safe-area-inset-top)) 26px 25px; border-right: 0; border-bottom: 1px solid #302c3e; }
  .setup-art .brand { font-size: 1.2rem; }
  .setup-art .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .setup-intro { padding: 30px 0 0; }
  .setup-intro h1 { font-size: 3.5rem; letter-spacing: -2.6px; margin-top: 8px; }
  .setup-intro h1 br { display: none; }
  .setup-intro h1 > span::before { content: ' '; }
  .setup-intro .eyebrow { display: none; }
  .setup-intro > p { font-size: .875rem; margin-top: 12px; }
  .illustration, .setup-foot { display: none; }
  .setup-form-wrap { padding: 30px 26px 0; }
  .setup-form { max-width: 460px; }
  .setup-form h2 { font-size: 1.6rem; margin: 8px 0; }
  .setup-form > p { font-size: .875rem; }
  .setup-form form { margin-top: 25px; }
  .setup-form > .small-label { display: none; }
  .setup-privacy { font-size: .75rem; }
  .setup-options { padding-top: 12px; }
  .setup-options .text-button { min-height: 44px; font-size: .75rem; }
  body:has(.onboarding) { padding-bottom: 25px; }
  dialog { max-height: calc(100svh - 24px); padding: 23px; width: min(450px, calc(100% - 24px)); border-radius: 13px; }
  dialog h2 { font-size: 1.4rem; }
  .modal-heading { margin-bottom: 12px; }
  dialog .field { margin-bottom: 16px; }
  .modal-actions { margin-top: 22px; }
  #toast { bottom: calc(82px + env(safe-area-inset-bottom)); width: max-content; font-size: .8125rem; text-align: center; }
}

@media (max-width: 370px) {
  .main-content { padding-inline: 12px; }
  .stat-card { padding: 12px; }
  .stat-value { font-size: 1.7rem; }
  .stat-heading .icon-box { width: 23px; height: 23px; }
  .chart-heading > div:first-child { flex-basis: 100%; }
  .goal-labels { font-size: .7rem; }
  th, td { padding-inline: 10px; }
  .header-date { max-width: 95px; white-space: nowrap; overflow: hidden; }
  .setup-intro h1 { font-size: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
