:root {
  --bg: #0d0e11;
  --surface: #16181d;
  --surface-2: #1e2128;
  --line: #2a2e37;
  --text: #f3f2ee;
  --muted: #8b909a;
  --heat: #ff5b35;
  --heat-soft: rgba(255, 91, 53, 0.16);
  --reel: #2fd3a6;
  --ig: #e1306c;
  --tt: #69c9d0;
  --warn: #f5b83d;
  --radius: 14px;
  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); -webkit-font-smoothing: antialiased; }
body { padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
a { color: inherit; }
.wrap { max-width: 980px; margin: 0 auto; padding: 20px 16px 64px; }
.eyebrow { font-family: var(--display); font-weight: 800; letter-spacing: .14em; font-size: 12px; text-transform: uppercase; color: var(--heat); }
h1, h2, h3 { font-family: var(--display); margin: 0; }
h2 { font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 36px 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* Hero */
.hero { display: grid; gap: 14px; margin-top: 10px; }
.hero .daynum { font-family: var(--display); font-weight: 900; font-size: clamp(64px, 18vw, 132px); line-height: .86; letter-spacing: -.03em; font-stretch: 85%; }
.hero .daynum span { color: var(--muted); font-size: .38em; letter-spacing: 0; font-weight: 700; }
.progress { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, #ff8a3d, var(--heat)); border-radius: 99px; transition: width .6s; }
.today-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.today-pill.ok { border-color: var(--heat); background: var(--heat-soft); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.on { background: var(--heat); }
.dot.reel { background: var(--reel); }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 22px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi b { display: block; font-family: var(--display); font-size: 30px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }
.kpi .delta { color: var(--reel); font-size: 13px; font-weight: 600; margin-left: 4px; }
.kpis.bench { margin-top: 0; }
button.kpi { text-align: left; color: inherit; font: inherit; cursor: pointer; }
button.kpi.sel { border-color: var(--heat); background: var(--heat-soft); }

/* 100 grid */
.grid100 { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.cell { aspect-ratio: 1; border-radius: 9px; border: 1px solid var(--line); background: transparent; color: var(--muted);
  font-family: var(--display); font-weight: 700; font-size: clamp(11px, 2.6vw, 16px); position: relative; cursor: pointer; padding: 0;
  display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.cell.future { opacity: .45; cursor: default; }
.cell.done { background: var(--heat); border-color: var(--heat); color: #1a0d08; }
.cell.today { border: 2px solid var(--text); color: var(--text); }
.cell.missed { background: var(--surface); color: #4c5059; text-decoration: line-through; }
.cell.done.is-today { outline: 2px solid var(--text); outline-offset: 2px; }
.cell .r { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--reel); }
.cell.done .r { background: #0d3b2f; }
/* Workout + Reel: orange square with a green corner (replaces the Reel dot) */
.cell.full { background: linear-gradient(135deg, var(--heat) 70%, var(--reel) 70%); }
.cell.full .r { display: none; }
.legend .full-swatch { background: linear-gradient(135deg, var(--heat) 60%, var(--reel) 60%); }
.cell .ph { position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); width: 10px; height: 2px; border-radius: 2px; background: currentColor; opacity: .55; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Cards & charts */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card h3 { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.card-note { margin: -6px 0 10px; font-size: 12px; }
.chart { position: relative; height: 220px; }
.empty { color: var(--muted); font-size: 14px; padding: 30px 0; text-align: center; }

/* Photos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.photos figure { margin: 0; position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos figcaption { position: absolute; left: 6px; bottom: 6px; font-size: 11px; font-weight: 700; background: rgba(0,0,0,.6); padding: 2px 6px; border-radius: 6px; }

/* Sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet-bg.open { display: flex; }
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 20px 20px 0 0; width: 100%; max-width: 560px; max-height: 85vh; overflow: auto; padding: 20px 18px calc(24px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 20px; } }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; margin: 14px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* Forms */
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 18px 0 8px; }
input[type=text], input[type=number], input[type=date], input[type=url], input[type=password], textarea, select {
  width: 100%; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; font-size: 16px; font-family: inherit; }
input:focus, textarea:focus { outline: 2px solid var(--heat); outline-offset: 1px; }
textarea { min-height: 80px; resize: vertical; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface-2); color: var(--text); padding: 9px 13px; border-radius: 99px; font-size: 14px; cursor: pointer; font-family: inherit; }
.chip.on { background: var(--heat); border-color: var(--heat); color: #1a0d08; font-weight: 700; }
.seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.seg button { padding: 11px 0; font-size: 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; }
.seg button.on { background: var(--heat-soft); border-color: var(--heat); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn { appearance: none; border: 0; background: var(--heat); color: #1a0d08; font-weight: 800; font-family: var(--display);
  letter-spacing: .04em; text-transform: uppercase; font-size: 15px; padding: 14px 18px; border-radius: 12px; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); text-transform: none; font-family: var(--body); font-weight: 600; letter-spacing: 0; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; }
.toggle { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text); font-weight: 500; margin: 14px 0; cursor: pointer; }
.toggle input { width: 22px; height: 22px; accent-color: var(--heat); }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 11px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 20; max-width: 90vw; }
.toast.show { opacity: 1; }
.status-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.status-row:last-child { border-bottom: 0; }
.badge { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.badge.ok { background: rgba(47,211,166,.15); color: var(--reel); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 12px; }
.thumbs figure { margin: 0; position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .acts { position: absolute; inset: auto 4px 4px 4px; display: flex; gap: 4px; }
.thumbs .acts button { flex: 1; font-size: 11px; padding: 4px; border-radius: 6px; border: 0; background: rgba(0,0,0,.7); color: #fff; cursor: pointer; }
footer { margin-top: 48px; color: var(--muted); font-size: 13px; display: flex; gap: 16px; flex-wrap: wrap; }
