:root {
  --bg: #0a0a0a; --panel: #0a0a0a; --panel2: #151515; --ink: #f5f5f3;
  --muted: #858585; --line: #282828; --brand: #ff5a1f; --brand2: #ff5a1f;
  --good: #8bd17c; --bad: #ff7474;
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif; }
body { margin: 0; min-height: 100vh; background: var(--bg); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--ink); text-underline-offset: 3px; }
.shell { min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: 196px; border-right: 1px solid var(--line); padding: 28px 16px; background: var(--bg); z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; margin: 0 8px 40px; }
.mark { width: 26px; height: 26px; display: grid; place-items: center; background: var(--brand); color: #111; font-size: .8rem; font-weight: 950; }
.brand h1 { margin: 0; font-size: .9rem; letter-spacing: .14em; }
.brand small, .side-foot { display: none; }
.nav { display: grid; gap: 2px; }
.nav button { border: 0; background: transparent; color: var(--muted); padding: 11px 10px; text-align: left; font-weight: 650; display: flex; gap: 9px; align-items: center; }
.nav button:hover, .nav button.active { color: var(--ink); background: transparent; }
.nav button.active { box-shadow: inset 2px 0 var(--brand); }
.nav .ico { width: 18px; font-size: .85rem; }
.main { margin-left: 196px; padding: 36px 42px 100px; max-width: 1420px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 38px; }
.eyebrow { color: var(--muted); text-transform: uppercase; letter-spacing: .14em; font-size: .68rem; font-weight: 800; }
.topbar h2 { margin: 5px 0 0; font-size: clamp(1.75rem, 4vw, 2.4rem); letter-spacing: -.04em; font-weight: 750; }
.date-chip { color: var(--muted); font-size: .8rem; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.card { background: var(--bg); padding: 22px; min-width: 0; }
.card h3 { margin: 0 0 15px; font-size: .9rem; font-weight: 750; }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.metric { margin-top: 3px; font-size: 1.9rem; font-weight: 750; letter-spacing: -.05em; }
.metric small { font-size: .8rem; color: var(--muted); letter-spacing: 0; font-weight: 500; }
.sub, .muted { color: var(--muted); }
.sub { margin-top: 5px; font-size: .78rem; }
.accent, .good { color: var(--ink); } .bad, .danger { color: var(--bad); }
.progress { height: 2px; margin: 15px 0 11px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--brand); }
.ring { width: auto; aspect-ratio: auto; border-radius: 0; background: transparent !important; display: block; text-align: right; }
.ring::before { display: none; } .ring strong { display: block; font-size: 1.2rem; font-weight: 700; }
.hero-workout { background: var(--bg); position: relative; overflow: hidden; }
.hero-workout::after { display: none; } .hero-workout p { max-width: 700px; font-size: .86rem; }
.btn { border: 1px solid var(--brand); border-radius: 0; background: var(--brand); color: #0a0a0a; padding: 10px 13px; font-weight: 800; }
.btn:hover { filter: brightness(1.12); }
.btn.secondary, .btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.small { padding: 7px 10px; font-size: .78rem; }
.row { display: flex; align-items: center; gap: 9px; } .between { justify-content: space-between; } .wrap { flex-wrap: wrap; } .stack { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; } .field label { color: var(--muted); font-size: .72rem; font-weight: 650; }
.input, select, textarea { width: 100%; background: transparent; border: 1px solid var(--line); border-radius: 0; color: var(--ink); padding: 10px 11px; outline: none; }
.input:focus, select:focus, textarea:focus { border-color: var(--ink); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.exercise { padding: 17px 0; border-top: 1px solid var(--line); } .exercise:first-child { border-top: 0; }
.exercise-name { font-size: .9rem; font-weight: 750; }
.tag { color: var(--muted); border: 1px solid var(--line); padding: 4px 7px; font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; }
.tag.pr { color: var(--brand); border-color: var(--brand); }
.sets { display: grid; grid-template-columns: 32px 1fr 1fr 42px; gap: 7px; align-items: center; margin-top: 8px; }
.setno, .previous { color: var(--muted); font-size: .72rem; } .sets .input { padding: 8px; }
.tick { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 0; color: var(--muted); background: transparent; }
.tick.done { background: var(--brand); border-color: var(--brand); color: #111; }
.meal-tabs { display: flex; gap: 0; overflow: auto; border-bottom: 1px solid var(--line); }
.meal-tabs button { flex: 1 0 auto; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); padding: 10px 12px; }
.meal-tabs button.active { color: var(--ink); border-bottom-color: var(--brand); font-weight: 750; }
.food-result, .meal-item, .recipe { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 13px 0; border-top: 1px solid var(--line); }
.food-result:first-child, .meal-item:first-child { border-top: 0; }
.food-result strong, .meal-item strong { display: block; font-size: .88rem; }
.macro-line { margin-top: 3px; color: var(--muted); font-size: .72rem; }
.macro-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.macro { padding: 12px; border-right: 1px solid var(--line); } .macro:last-child { border-right: 0; }
.macro strong { display: block; font-size: 1rem; } .macro span { color: var(--muted); font-size: .65rem; text-transform: uppercase; }
.searchbox { position: relative; } .searchbox .input { padding-left: 34px; }
.searchbox::before { content: "⌕"; position: absolute; left: 11px; top: 6px; color: var(--muted); font-size: 1.3rem; }
.chart { height: 180px; position: relative; border-bottom: 1px solid var(--line); margin: 16px 4px 4px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .area { display: none; } .chart .dot { fill: var(--bg); stroke: var(--brand); stroke-width: 2; }
.empty { padding: 24px 0; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); }
.history-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); align-items: center; font-size: .82rem; }
.history-row:first-child { border-top: 0; }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.82); }
.modal { width: min(520px,100%); padding: 24px; background: var(--bg); border: 1px solid #555; }
.modal h2 { margin: 0 0 6px; font-size: 1.25rem; } .modal p { margin: 0 0 20px; color: var(--muted); font-size: .83rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
#toast { position: fixed; right: 20px; bottom: 20px; z-index: 100; padding: 10px 13px; background: var(--ink); color: #111; font-size: .8rem; font-weight: 800; transform: translateY(80px); opacity: 0; transition: .2s; }
#toast.show { transform: translateY(0); opacity: 1; }
.mobile-nav { display: none; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.section-head h3 { margin: 0; } .hidden { display: none !important; }
@media (max-width: 1050px) {
  .span-3 { grid-column: span 6; }
  .span-4, .span-5, .span-7, .span-8 { grid-column: span 6; }
}
@media (max-width: 760px) {
  .side { display: none; }
  .main { margin: 0; padding: 25px 14px 86px; }
  .topbar { align-items: flex-start; margin-bottom: 26px; }
  .date-chip { font-size: .72rem; }
  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-12 { grid-column: span 12; }
  .card { padding: 16px; }
  .mobile-nav { display: grid; grid-template-columns: repeat(5,1fr); position: fixed; z-index: 30; inset: auto 0 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
  .mobile-nav button { border: 0; background: transparent; color: var(--muted); padding: 5px 2px; font-size: .6rem; }
  .mobile-nav button span { display: block; margin-bottom: 2px; font-size: 1rem; }
  .mobile-nav button.active { color: var(--brand); }
  .form-grid, .form-grid.three { grid-template-columns: 1fr 1fr; }
  .macro-grid { grid-template-columns: repeat(2,1fr); }
  .macro:nth-child(2) { border-right: 0; } .macro:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .sets { grid-template-columns: 28px 1fr 1fr 38px; }
  .history-row { grid-template-columns: 82px 1fr; } .history-row > :last-child { grid-column: 2; }
}
@media (max-width: 390px) { .form-grid, .form-grid.three { grid-template-columns: 1fr; } }
