/* Beast Mode — dark by design: this gets read at 05:45 in a dark room. */
:root {
  --bg: #0d0d0f;
  --surface: #16161a;
  --surface-2: #1e1e24;
  --line: #2a2a32;
  --text: #f2f2f5;
  --muted: #9a9aa8;
  --accent: #ff5c2b;
  --accent-soft: rgba(255, 92, 43, 0.14);
  --gym: #ff5c2b;
  --move: #35c8f0;
  --work: #8b8b9c;
  --deep: #b06bff;
  --food: #ffc44d;
  --rest: #4ade80;
  --radius: 14px;
  --pad: 16px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  overflow-x: hidden;
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}

main, header, footer {
  max-width: 640px;
  margin: 0 auto;
  padding-left: max(var(--pad), env(safe-area-inset-left));
  padding-right: max(var(--pad), env(safe-area-inset-right));
}

/* ---------- header ---------- */
.top {
  padding-top: max(18px, env(safe-area-inset-top));
  padding-bottom: 10px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(var(--bg) 82%, rgba(13, 13, 15, 0));
  backdrop-filter: blur(8px);
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.today-btn {
  flex: none;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.day-label {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.day-label .is-today {
  color: var(--accent);
  font-weight: 700;
}

/* horizontal day picker — scrolls inside itself, never the page */
.days {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
  margin-left: calc(-1 * var(--pad));
  margin-right: calc(-1 * var(--pad));
  padding-left: var(--pad);
  padding-right: var(--pad);
  -webkit-overflow-scrolling: touch;
}

.days::-webkit-scrollbar { display: none; }

.days button {
  flex: none;
  min-width: 48px;
  min-height: 44px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  position: relative;
}

.days button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #14090a;
}

.days button.today-dot::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.days button[aria-pressed="true"].today-dot::after { background: #14090a; }

/* ---------- now card ---------- */
.now-card {
  background: var(--accent-soft);
  border: 1px solid rgba(255, 92, 43, 0.35);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 18px;
}

.now-kicker {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.now-title {
  margin: 4px 0 2px;
  font-size: 1.15rem;
  font-weight: 700;
}

.now-meta {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.now-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.now-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* ---------- banner ---------- */
.banner {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 18px;
  background: var(--surface);
}

.banner strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 2px;
}

.banner span {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- timeline ---------- */
.timeline {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--line);
}

.block {
  position: relative;
  padding: 0 0 16px 30px;
}

.block::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--dot, var(--work));
}

.block-inner {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.block.past { opacity: 0.42; }

.block.now::before {
  border-color: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.block.now .block-inner {
  border-color: var(--accent);
  background: var(--surface-2);
}

.block-time {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--dot, var(--work));
}

.now-tag {
  background: var(--accent);
  color: #14090a;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
}

.block-title {
  margin: 3px 0 0;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.3;
}

.block-note {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

.block ul {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 0.9rem;
  color: var(--muted);
}

.block li { margin-bottom: 2px; }

.block li strong { color: var(--text); font-weight: 600; }

.macro {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 196, 77, 0.13);
  color: var(--food);
  font-size: 0.75rem;
  font-weight: 700;
}

/* ---------- sections ---------- */
h2 {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}

.protein, .rules, .simple {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 18px;
}

.protein ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.92rem;
}

.protein li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.protein li span:last-child {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.protein-total {
  margin: 12px 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--food);
}

.rule-list {
  margin: 0;
  padding-left: 20px;
  font-size: 0.95rem;
}

.rule-list li { margin-bottom: 12px; }
.rule-list li:last-child { margin-bottom: 0; }
.rule-list strong { display: block; }
.rule-list span { color: var(--muted); font-size: 0.88rem; }

.simple-list { margin: 0; }

.simple-list > div {
  display: flex;
  gap: 14px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.simple-list > div:last-child { border-bottom: 0; }

.simple-list dt {
  flex: none;
  width: 92px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.simple-list dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.simple-list .repeat dd { color: var(--accent); }

footer {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  padding-top: 4px;
}

footer p { margin: 0; }

@media (min-width: 560px) {
  h1 { font-size: 1.6rem; }
  body { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
