/* Forma — dark glass dashboard, warm glow, orange accent */
:root {
  --bg: #0b0a08;
  --bg-2: #14120e;
  --card: rgba(255, 255, 255, 0.045);
  --card-2: rgba(255, 255, 255, 0.075);
  --card-3: rgba(255, 255, 255, 0.11);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f3efe6;
  --muted: rgba(243, 239, 230, 0.58);
  --dim: rgba(243, 239, 230, 0.34);
  --orange: #ff6a1f;
  --orange-2: #ff8c42;
  --amber: #ffb547;
  --lime: #c9f24d;
  --green: #5ee08a;
  --blue: #4f8dff;
  --purple: #a26bff;
  --pink: #ff5c8a;
  --teal: #39d2c0;
  --red: #ff4d4d;
  --r: 22px;
  --r-sm: 14px;
  --r-xs: 10px;
  --font: 'Manrope', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --rail: 84px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(255, 106, 31, 0.35); }
svg { display: block; }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; padding: 22px 0; display: flex; flex-direction: column; align-items: center; gap: 10px;
  border-right: 1px solid var(--line); background: rgba(11, 10, 8, 0.6); backdrop-filter: blur(20px); z-index: 20;
}
.rail .logo { width: 44px; height: 44px; border-radius: 14px; background: var(--orange); display: grid; place-items: center; margin-bottom: 18px; box-shadow: 0 10px 30px rgba(255, 106, 31, 0.35); }
.rail .logo svg { width: 22px; height: 22px; }
.rail-btn {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: var(--muted);
  background: var(--card); border: 1px solid var(--line); transition: all .18s ease;
}
.rail-btn svg { width: 20px; height: 20px; }
.rail-btn:hover { color: var(--text); background: var(--card-2); }
.rail-btn.active { color: #0b0a08; background: var(--text); border-color: transparent; }
.rail .spacer { flex: 1; }

main { min-width: 0; padding: 0 28px 120px; position: relative; }

/* ---------- hero ---------- */
.hero { position: relative; margin: 0 -28px; padding: 30px 28px 26px; overflow: clip; }
.hero .glow { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.hero .glow i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .9; }
.hero .glow .g1 { width: 720px; height: 460px; left: 12%; top: -260px; background: radial-gradient(closest-side, rgba(255, 106, 31, .55), rgba(255, 106, 31, 0)); }
.hero .glow .g2 { width: 520px; height: 420px; right: -80px; top: -200px; background: radial-gradient(closest-side, rgba(57, 210, 192, .32), rgba(57, 210, 192, 0)); }
.hero .glow .g3 { width: 380px; height: 300px; left: -120px; top: -60px; background: radial-gradient(closest-side, rgba(255, 181, 71, .22), rgba(255, 181, 71, 0)); }
.hero .grain { position: absolute; inset: 0; opacity: .5; mix-blend-mode: overlay; pointer-events: none; z-index: 0; }
.hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 60%; background: linear-gradient(to bottom, rgba(11, 10, 8, 0), var(--bg)); z-index: 0; pointer-events: none; }
.hero-in { position: relative; z-index: 1; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.hero .kicker { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.hero h1 { font-size: 40px; line-height: 1.05; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.hero h1 span { color: var(--muted); font-weight: 500; }
.hero-actions { display: flex; gap: 10px; align-items: center; }

/* pills */
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px;
  background: var(--card-2); border: 1px solid var(--line-2); color: var(--text); font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: background .15s ease, transform .1s ease;
}
.pill:hover { background: var(--card-3); }
.pill:active { transform: scale(.98); }
.pill.primary { background: var(--text); color: #0b0a08; border-color: transparent; }
.pill.primary:hover { background: #fff; }
.pill.accent { background: var(--orange); color: #0b0a08; border-color: transparent; }
.pill.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.pill.icon { width: 40px; padding: 0; justify-content: center; }
.pill svg { width: 16px; height: 16px; }
.pill.ghost { background: transparent; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); gap: 2px; }
.seg button { height: 32px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button.active { background: var(--card-3); color: var(--text); }

/* ---------- stat strip ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 6px 0 22px; }
.stat { padding: 16px 18px; border-radius: var(--r-sm); background: var(--card); border: 1px solid var(--line); min-width: 0; }
.stat .l { font-size: 12px; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.stat .l i { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); display: inline-block; }
.stat .v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.stat .v small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.stat .d { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-top: 8px; }
.stat .d.up { color: var(--green); } .stat .d.down { color: var(--pink); }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.card {
  position: relative; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); padding: 20px; min-width: 0;
  backdrop-filter: blur(16px);
}
.card.dark { background: rgba(0, 0, 0, .35); }
.card.accent { background: linear-gradient(135deg, rgba(255, 106, 31, .22), rgba(255, 106, 31, .06)); border-color: rgba(255, 106, 31, .3); }
.c-4 { grid-column: span 4; } .c-5 { grid-column: span 5; } .c-6 { grid-column: span 6; } .c-7 { grid-column: span 7; } .c-8 { grid-column: span 8; } .c-12 { grid-column: span 12; } .c-3 { grid-column: span 3; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-h .t { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 16px; }
.card-h .t .ic { width: 38px; height: 38px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 17px; }
.card-h .t .ic svg { width: 18px; height: 18px; }
.ic svg, .li { width: 16px; height: 16px; flex: none; }
.card-h .t .ic .li { width: 18px; height: 18px; }
.emojis button .li { width: 18px; height: 18px; }
.emojis button { display: grid; place-items: center; color: var(--text); }
.macro .k .li { width: 13px; height: 13px; }
.item .title .li { width: 18px; height: 18px; color: var(--orange-2); }
.card-h .m { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.card-h .num { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-right: 8px; }
.big { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.big small { font-size: 14px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-left: 4px; }
.sub { font-size: 13px; color: var(--muted); margin-top: 6px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.chart { width: 100%; height: auto; }
.chart-box { width: 100%; position: relative; }
.chart-box svg { display: block; width: 100%; height: 100%; }
.card.fill { display: flex; flex-direction: column; }
.card.fill .card-h { flex: none; }
.chart text { font-family: var(--mono); font-size: 11px; fill: var(--dim); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.empty { color: var(--dim); font-size: 13px; padding: 20px 0; text-align: center; }
.empty b { display: block; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.card-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.card-foot .k { font-size: 11px; color: var(--dim); font-family: var(--mono); }
.card-foot .v { font-size: 15px; font-weight: 700; margin-top: 2px; }

/* macro rings */
.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.macro { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--r-sm); background: var(--card-2); border: 1px solid var(--line); }
.macro.dark { background: #0b0a08; }
.macro .ring { width: 44px; height: 44px; flex: none; }
.macro .k { font-size: 11px; color: var(--muted); }
.macro .v { font-size: 16px; font-weight: 700; }
.macro .v small { font-size: 11px; color: var(--dim); font-weight: 500; }
.bar { height: 8px; border-radius: 999px; background: var(--card-3); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--orange); transition: width .5s ease; }

/* habit list (overview) */
.hlist { display: flex; flex-direction: column; gap: 6px; }
.hitem { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--card-2); border: 1px solid var(--line); cursor: pointer; transition: background .15s; }
.hitem:hover { background: var(--card-3); }
.hitem .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 16px; background: rgba(255, 255, 255, .06); }
.hitem .n { flex: 1; font-weight: 600; font-size: 14px; }
.hitem .s { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.hitem .chk { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; transition: all .15s; }
.hitem .chk svg { width: 14px; height: 14px; opacity: 0; }
.hitem.done .chk { border-color: transparent; }
.hitem.done .chk svg { opacity: 1; }

/* lists */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { padding: 14px 16px; border-radius: var(--r-sm); background: var(--card-2); border: 1px solid var(--line); }
.item .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.item .title { font-weight: 700; font-size: 15px; }
.item .meta { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.item .body { margin-top: 8px; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.item .body b { color: var(--text); font-weight: 600; }
.item .body.cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 20px; }
.item .acts { display: flex; gap: 4px; }
.ibtn { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); background: transparent; }
.ibtn:hover { background: var(--card-3); color: var(--text); }
.ibtn svg { width: 15px; height: 15px; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-family: var(--mono); font-size: 10px; background: var(--card-3); color: var(--muted); }
.tag.pr { background: rgba(255, 106, 31, .2); color: var(--orange-2); }
.tag.src { text-transform: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 34px; padding: 0 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); }
.chip.active { background: var(--orange); color: #0b0a08; border-color: transparent; }
.chip:hover:not(.active) { background: var(--card-2); color: var(--text); }

/* workout journal table */
.wkwrap { overflow: auto; margin: 0 -20px; padding: 0 20px 6px; -webkit-overflow-scrolling: touch; }
.wktable { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: 13px; }
.wktable th, .wktable td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; vertical-align: top; min-width: 96px; }
.wktable thead th { border-bottom: 1px solid var(--line-2); }
.wktable th .d { font-family: var(--mono); font-size: 12px; color: var(--text); font-weight: 500; }
.wktable th .n { font-size: 11px; color: var(--muted); font-weight: 500; max-width: 120px; overflow: hidden; text-overflow: ellipsis; margin: 0 auto; }
.wktable th .a { display: flex; justify-content: center; gap: 0; margin-top: 4px; }
.wktable th .a .ibtn { width: 26px; height: 26px; }
.wktable .exc { text-align: left; position: sticky; left: 0; z-index: 1; font-weight: 600; min-width: 160px; max-width: 220px; white-space: normal; background: linear-gradient(var(--card), var(--card)), var(--bg); }
.wktable thead .exc { font-family: var(--mono); font-size: 11px; color: var(--dim); font-weight: 500; }
.wktable td .sr { display: block; font-family: var(--mono); font-size: 13px; }
.wktable td .w { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.wktable td.best { background: rgba(255, 106, 31, .1); }
.wktable td.best .sr { color: var(--orange-2); font-weight: 500; }
.wktable td.empty { color: var(--dim); }
.wktable .last:not(.exc) { background: rgba(255, 255, 255, .035); }
.wktable td.best.last { background: rgba(255, 106, 31, .14); }
.wktable tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 820px) { .wkwrap { margin: 0 -16px; padding: 0 16px 6px; } .wktable .exc { min-width: 120px; max-width: 150px; font-size: 12px; } .wktable th, .wktable td { min-width: 84px; padding: 8px 8px; } }

/* weight entries table */
.wtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.wtable th { font-family: var(--mono); font-size: 11px; color: var(--dim); font-weight: 500; text-align: left; padding: 0 10px 10px; }
.wtable td { padding: 11px 10px; border-top: 1px solid var(--line); white-space: nowrap; }
.wtable td.dt { font-weight: 600; }
.wtable td.wv { font-family: var(--mono); font-size: 15px; }
.wtable td.wv small { font-size: 11px; color: var(--muted); }
.wtable td.dl { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.wtable td.dl.down { color: var(--green); } .wtable td.dl.up { color: var(--pink); }
.wtable td.nt { color: var(--muted); font-size: 13px; white-space: normal; }
.wtable td.ac { text-align: right; }
.wtable td.ac .ibtn { display: inline-grid; }
@media (max-width: 820px) { .wtable td, .wtable th { padding-left: 6px; padding-right: 6px; } .wtable td.nt { display: none; } .wtable th:nth-child(4) { display: none; } }
.tabbar button { width: 52px; }

/* journal groups (compact) */
.wgroup { padding: 6px 0 10px; border-top: 1px solid var(--line); }
.wgroup:first-child { border-top: 0; padding-top: 0; }
.wg-h { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 0; text-align: left; }
.wg-h .chev { width: 22px; height: 22px; border-radius: 7px; background: var(--card-2); display: grid; place-items: center; color: var(--muted); transition: transform .15s; }
.wg-h .chev svg { width: 12px; height: 12px; }
.wgroup:not(.collapsed) .wg-h .chev { transform: rotate(90deg); }
.wg-h .n { font-weight: 700; font-size: 15px; }
.wg-h .m { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-left: auto; }
.wktable.compact th, .wktable.compact td { padding: 7px 10px; min-width: 78px; font-size: 13px; }
.wktable.compact thead th { border-bottom: 1px solid var(--line); }
.wktable.compact th .d { font-size: 11px; color: var(--muted); }
.wktable.compact .exc { min-width: 150px; max-width: 200px; font-size: 13px; font-weight: 600; }
.wktable.compact td .sr { display: inline; font-size: 13px; }
.wktable.compact td .w { display: inline; margin: 0 0 0 6px; font-size: 12px; color: var(--muted); }
.wktable.compact td .w::after { content: ' кг'; font-size: 10px; color: var(--dim); }
.wktable.compact td.best .w { color: var(--orange-2); opacity: .8; }
.wktable.compact th .a { margin-top: 2px; }
@media (max-width: 820px) { .wktable.compact th, .wktable.compact td { padding: 6px 6px; min-width: 70px; font-size: 12px; } .wktable.compact .exc { min-width: 110px; max-width: 140px; font-size: 12px; } .wg-h .m { display: none; } }

/* habit week table */
.hweek { width: 100%; border-collapse: collapse; }
.hweek th { font-family: var(--mono); font-size: 11px; color: var(--dim); font-weight: 500; padding: 0 0 10px; text-align: center; }
.hweek th:first-child { text-align: left; }
.hweek td { padding: 6px 0; text-align: center; }
.hweek td:first-child { text-align: left; }
.hweek .hn { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.hweek .hn .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 14px; }
.hweek .dot { width: 28px; height: 28px; border-radius: 50%; margin: 0 auto; background: var(--card-3); display: grid; place-items: center; cursor: pointer; transition: transform .1s; position: relative; }
.hweek .dot:hover { transform: scale(1.08); }
.hweek .dot svg { width: 12px; height: 12px; opacity: 0; }
.hweek .dot.on svg { opacity: 1; }
.hweek .dot.future { opacity: .35; cursor: default; }
.hweek .dot.today::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid var(--line-2); }
.hweek .link { position: relative; }
.hweek .link::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: var(--card-2); z-index: 0; }
.hweek .dot { position: relative; z-index: 1; }

/* heatmap card */
.hcard { display: flex; flex-direction: column; gap: 12px; }
.hcard .hh { display: flex; align-items: center; gap: 12px; }
.hcard .hh .ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 16px; }
.hcard .hh .n { flex: 1; font-weight: 700; }
.hcard .hh .stat { padding: 0; background: none; border: 0; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.hcard .btn-done { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--line); }
.hcard .btn-done svg { width: 15px; height: 15px; }
.hcard .btn-done.on { border-color: transparent; }

/* ---------- forms / sheet ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); backdrop-filter: blur(6px); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .2s; }
.backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; right: 0; top: 0; bottom: 0; width: min(520px, 100vw); background: var(--bg-2); border-left: 1px solid var(--line); z-index: 60;
  transform: translateX(105%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column;
}
.sheet.open { transform: none; }
.sheet .sh { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.sheet .sh h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.sheet .sb { flex: 1; overflow: auto; padding: 20px 24px; }
.sheet .sf { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea {
  height: 44px; padding: 0 14px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line-2); color: var(--text); outline: none; width: 100%;
}
.field textarea { height: auto; padding: 12px 14px; min-height: 70px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 106, 31, .18); }
.field select option { background: #1a1815; }
.frow { display: grid; gap: 10px; }
.frow.c2 { grid-template-columns: 1fr 1fr; } .frow.c3 { grid-template-columns: 1fr 1fr 1fr; } .frow.c4 { grid-template-columns: repeat(4, 1fr); }
.exblock { padding: 14px; border-radius: var(--r-sm); background: var(--card); border: 1px solid var(--line); margin-bottom: 12px; }
.exblock .exh { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.exblock .exh input { flex: 1; }
.setrow { display: grid; grid-template-columns: 34px 1fr 1fr 1fr 34px; gap: 8px; align-items: center; margin-bottom: 6px; }
.setrow .n { font-family: var(--mono); font-size: 12px; color: var(--dim); text-align: center; }
.setrow input { height: 38px; padding: 0 10px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); color: var(--text); width: 100%; outline: none; text-align: center; }
.setrow input:focus { border-color: var(--orange); }
.sethead { display: grid; grid-template-columns: 34px 1fr 1fr 1fr 34px; gap: 8px; font-family: var(--mono); font-size: 10px; color: var(--dim); text-align: center; margin-bottom: 4px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.sw.active { border-color: #fff; }
.emojis { display: flex; gap: 6px; flex-wrap: wrap; }
.emojis button { width: 36px; height: 36px; border-radius: 10px; background: var(--card-2); font-size: 18px; }
.emojis button.active { background: var(--card-3); outline: 2px solid var(--orange); }
.link-btn { color: var(--orange-2); font-weight: 600; font-size: 13px; }
.danger { color: var(--pink); }
.code { font-family: var(--mono); font-size: 12px; padding: 12px 14px; border-radius: 12px; background: #0b0a08; border: 1px solid var(--line); word-break: break-all; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.code span { flex: 1; }
.steps { counter-reset: s; display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.steps li { position: relative; padding-left: 38px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.steps li b { color: var(--text); }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--card-3); display: grid; place-items: center; font-family: var(--mono); font-size: 11px; color: var(--text); }
h3.sec { font-size: 14px; font-weight: 700; margin: 24px 0 12px; }
h3.sec:first-child { margin-top: 0; }
.note { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--text); color: #0b0a08; padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: 14px; opacity: 0; transition: all .25s; z-index: 100; pointer-events: none; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.err { background: var(--pink); color: #fff; }

/* auth gate */
.gate { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: grid; place-items: center; padding: 20px; }
.gate .box { width: min(420px, 100%); padding: 32px; border-radius: 26px; background: var(--card); border: 1px solid var(--line); text-align: center; }
.gate .logo { width: 56px; height: 56px; border-radius: 18px; background: var(--orange); display: grid; place-items: center; margin: 0 auto 18px; box-shadow: 0 14px 40px rgba(255, 106, 31, .4); }
.gate .logo svg { width: 28px; height: 28px; }
.gate h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -0.02em; }
.gate p { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.gate .field { text-align: left; }

/* tab bar (mobile) */
.tabbar { display: none; }

/* loading */
.loading { opacity: .5; pointer-events: none; }
.skeleton { height: 120px; border-radius: var(--r-sm); background: linear-gradient(90deg, var(--card), var(--card-2), var(--card)); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.fade { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .c-4, .c-5, .c-7, .c-8, .c-3 { grid-column: span 6; }
}
@media (max-width: 820px) {
  :root { --rail: 0px; }
  .app { grid-template-columns: 1fr; }
  .rail { display: none; }
  main { padding: 0 16px 110px; }
  .hero { margin: 0 -16px; padding: 22px 16px 18px; }
  .hero h1 { font-size: 30px; }
  .hero-in { align-items: flex-start; flex-direction: column; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 14px; }
  .stat .v { font-size: 22px; }
  .grid { gap: 12px; }
  .c-3, .c-4, .c-5, .c-6, .c-7, .c-8, .c-12 { grid-column: span 12; }
  .card { padding: 16px; border-radius: 18px; }
  .tabbar {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; height: 66px; border-radius: 22px; z-index: 40;
    background: rgba(20, 18, 14, .85); backdrop-filter: blur(20px); border: 1px solid var(--line-2); box-shadow: var(--shadow);
    justify-content: space-around; align-items: center; padding: 0 6px;
  }
  .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10px; color: var(--dim); width: 56px; height: 54px; justify-content: center; border-radius: 16px; }
  .tabbar button svg { width: 20px; height: 20px; }
  .tabbar button.active { color: var(--text); background: var(--card-2); }
  .tabbar .add { width: 48px; height: 48px; border-radius: 50%; background: var(--orange); color: #0b0a08; display: grid; place-items: center; }
  .tabbar .add svg { width: 22px; height: 22px; }
  .sheet { width: 100vw; border-left: 0; }
  .frow.c4 { grid-template-columns: 1fr 1fr; }
  .macros { grid-template-columns: 1fr; }
  .hweek .dot { width: 26px; height: 26px; }
}
