:root {
  --bg: #0B0D10; --card: #13161A; --card-2: #181C21; --line: #262D35; --text: #F4F2EE;
  --muted: #8C95A1; --muted-2: #B9C1CC; --accent: #1E8CFF; --accent-ink: #0A0B0D; --danger: #FF6B6B; --ok: #3DDC97;
  --display: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--sans); min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(11,13,16,.92); backdrop-filter: blur(10px); z-index: 10; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand span { font-family: var(--display); font-size: 28px; letter-spacing: 5px; line-height: 1; padding-top: 3px; }
.ghost-btn { text-decoration: none; font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; border: 1px solid var(--line); padding: 9px 14px; border-radius: 10px; }
.ghost-btn:hover { border-color: var(--accent); }

main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 28px 16px 48px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 18px 16px 28px; border-top: 1px solid var(--line); }
.loading { color: var(--muted); text-align: center; padding: 80px 0; }

.display { font-family: var(--display); letter-spacing: 1px; line-height: .95; font-weight: 400; margin: 0; }
.h1 { font-size: clamp(44px, 9vw, 76px); }
.h2 { font-size: clamp(32px, 5vw, 44px); }
.h3 { font-size: 26px; }
.label { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.accent { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 12px; padding: 14px 20px; font-weight: 700; letter-spacing: .5px; cursor: pointer; text-decoration: none; min-height: 48px; }
.btn:hover { filter: brightness(1.08); }
.btn[disabled] { opacity: .55; cursor: wait; }
.btn.full { width: 100%; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--accent); }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* auth */
.auth { display: grid; gap: 32px; align-items: center; }
@media (min-width: 860px) { .auth { grid-template-columns: 1.1fr 1fr; gap: 56px; padding-top: 24px; } }
.pitch ul { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; color: var(--muted-2); }
.pitch li::before { content: '✓'; color: var(--accent); font-weight: 700; margin-right: 10px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.tabs-auth { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--bg); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.tabs-auth button { border: 0; background: transparent; padding: 10px; border-radius: 9px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs-auth button[aria-pressed="true"] { background: var(--card-2); color: var(--text); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted-2); }
.input { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; font-size: 16px; }
.input:focus { border-color: var(--accent); outline: none; }
.msg { border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-bottom: 14px; }
.msg.err { background: rgba(255,107,107,.12); color: #FFB3B3; border: 1px solid rgba(255,107,107,.3); }
.msg.ok { background: rgba(30,140,255,.12); color: #BFDcff; border: 1px solid rgba(30,140,255,.35); }
.center-line { text-align: center; margin-top: 14px; font-size: 14px; }

/* quiz */
.quiz { max-width: 640px; margin: 0 auto; }
.dots { display: flex; gap: 6px; margin-bottom: 26px; }
.dots span { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.dots span.on { background: var(--accent); }
.opts { display: grid; gap: 10px; margin-top: 22px; }
@media (min-width: 560px) { .opts.two { grid-template-columns: 1fr 1fr; } }
.opt { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; font-weight: 600; cursor: pointer; min-height: 56px; }
.opt:hover { border-color: var(--muted); }
.opt[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.quiz-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 26px; gap: 12px; }

/* dashboard */
.dash-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { font-size: 12px; font-weight: 600; border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; color: var(--muted-2); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 12px 14px; color: var(--muted); font-weight: 600; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.grid { display: grid; gap: 16px; }
@media (min-width: 860px) { .grid.two { grid-template-columns: 1fr 1fr; } .span2 { grid-column: 1 / -1; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; min-width: 0; }
.card h3 { margin: 0 0 14px; }
.targets { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
@media (min-width: 560px) { .targets { grid-template-columns: repeat(4, minmax(0,1fr)); } }
.target { background: var(--bg); border-radius: 12px; padding: 14px; }
.target b { display: block; font-family: var(--display); font-size: 32px; font-weight: 400; line-height: 1; margin-top: 6px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 6px; margin: 6px 0 12px; }
.day { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-weight: 700; cursor: pointer; min-height: 40px; }
.day[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.day.today { box-shadow: inset 0 0 0 2px var(--muted); }
.bar { height: 8px; background: var(--bg); border-radius: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 8px; transition: width .3s; }
.check { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.check:last-child { border-bottom: 0; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.prod { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.prod:last-child { border-bottom: 0; }
.prod a { flex-shrink: 0; font-size: 13px; padding: 10px 14px; min-height: 0; }
.atlas-q { display: flex; flex-wrap: wrap; gap: 8px; }
.atlas-q button { background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; cursor: pointer; font-size: 14px; }
.atlas-q button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.bubble { margin-top: 14px; background: var(--bg); border-radius: 4px 14px 14px 14px; padding: 14px 16px; color: var(--muted-2); }
.meal { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.meal:last-child { border-bottom: 0; }
.meal time { font-family: var(--display); font-size: 22px; color: var(--accent); line-height: 1.1; }
.rules { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--muted-2); }
.chart { width: 100%; height: auto; display: block; }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.hist li:last-child { border-bottom: 0; }
.x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; padding: 4px 8px; }
.x:hover { color: var(--danger); }
.add-w { display: flex; gap: 10px; margin-top: 14px; }
.add-w .input { flex: 1; min-width: 0; }
.big-num { font-family: var(--display); font-size: 48px; line-height: 1; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--card-2); border: 1px solid var(--line); padding: 12px 18px; border-radius: 12px; font-size: 14px; z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.toast.err { border-color: rgba(255,107,107,.5); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
