/* Black and yellow. Yellow only marks the next thing to act on; everything else is ink and grey. */
:root {
  --bg: #141414;
  --surface: #1f1f1f;
  --raised: #262626;
  --line: #2e2e2e;
  --line-strong: #4a4a46;
  --ink: #f2f2ee;
  --muted: #9a9a94;
  --accent: #ffd400;
  --on-accent: #141414;
  --danger: #ff6b5b;
  --good: #3d9a5f;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --cond: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --radius: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 var(--body);
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap {
  max-width: 720px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Top bar */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 900 22px/1 var(--display); letter-spacing: .02em; text-transform: uppercase; }
/* Logo: the jintsu head in black on a yellow tile, with GYM in yellow and TSU in ink, like the jintsu wordmark. */
.logo-head { display: block; height: 32px; width: 32px; flex: none; }
.wordmark { white-space: nowrap; }
.wm-gym { color: var(--accent); }
.wm-tsu { color: var(--ink); }
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 32px 0 8px; font: 900 44px/1 var(--display); letter-spacing: .02em; text-transform: uppercase; }
.login-logo .logo-head { height: 120px; width: 120px; }

/* Bottom nav (phone first) */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabs-in { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 720px; margin: 0 auto; }
.tabs a { min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-decoration: none; color: var(--muted); font: 600 14px var(--cond); letter-spacing: .06em; text-transform: uppercase; }
.tabs a::before { content: ""; width: 20px; height: 4px; border-radius: 2px; background: transparent; }
.tabs a[aria-current="page"] { color: var(--ink); }
.tabs a[aria-current="page"]::before { background: var(--accent); }

/* Type */
h1, h2, h3 { font-family: var(--display); font-weight: 900; text-transform: uppercase; line-height: .95; margin: 0; }
h1 { font-size: 36px; }
h2 { font-size: 26px; }
h3 { font-size: 20px; }
.eyebrow { font: 600 14px var(--cond); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.page-head { display: flex; flex-direction: column; gap: 6px; padding: 24px 0 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: var(--raised); color: var(--ink); cursor: pointer; text-decoration: none;
  font: 700 17px var(--cond); letter-spacing: .04em; text-transform: uppercase;
}
.btn:hover { color: var(--ink); border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.primary:hover { color: var(--on-accent); filter: brightness(1.05); }
.btn.block { width: 100%; }
.btn.sm { min-height: 40px; font-size: 15px; padding: 0 12px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
form.inline { display: inline; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.card.hero { border-color: var(--accent); }
.card a.cover { text-decoration: none; }
.chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: var(--raised); font: 600 14px var(--cond); letter-spacing: .03em; color: var(--ink); }
.chip.accent { background: var(--accent); color: var(--on-accent); }

/* Flash messages */
.flash { margin-top: 16px; padding: 12px 14px; border-radius: var(--radius); background: var(--raised); border: 1px solid var(--line-strong); }
.flash.error { border-color: var(--danger); }

/* Forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font: 600 14px var(--cond); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.field input, .field select {
  min-height: 48px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--raised); color: var(--ink); font: 16px var(--body);
}
.field input[type="file"] { padding: 10px 12px; }
.field .help { font-size: 14px; color: var(--muted); }
.field .errors, .errorlist { color: var(--danger); font-size: 14px; margin: 0; padding: 0; list-style: none; }

/* Week picker */
.seg { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.seg a {
  flex: 1 0 auto; min-height: 44px; min-width: 64px; padding: 6px 10px; border-radius: 10px;
  border: 1px solid var(--line-strong); text-decoration: none; text-align: center;
  display: flex; flex-direction: column; justify-content: center; line-height: 1.1;
  font: 700 15px var(--cond); text-transform: uppercase; letter-spacing: .04em;
}
.seg a small { font-weight: 500; color: var(--muted); letter-spacing: 0; text-transform: none; }
.seg a[aria-current="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.seg a[aria-current="true"] small { color: var(--on-accent); }

/* Program days */
.day { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.day-head { padding: 14px 16px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ex { list-style: none; margin: 0; padding: 0; }
.ex li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 10px 16px; border-top: 1px solid var(--line); }
.ex .n { font: 900 18px var(--display); color: var(--muted); }
.ex .n.main { color: var(--accent); }
.ex .name { font-weight: 600; }
.ex .note { font-size: 14px; color: var(--muted); margin-top: 2px; }
.ex .dose { font: 600 16px var(--cond); white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.ex .dose small { display: block; font-weight: 500; color: var(--muted); }
.ex li.skipped .name, .ex li.skipped .dose { color: var(--muted); text-decoration: line-through; }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.foot { padding: 32px 0 16px; color: var(--muted); font-size: 14px; }

/* Exercise picker sheet */
html.pk-open, html.pk-open body { overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pk {
  position: fixed; inset: 0; z-index: 20; background: var(--bg); display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px); max-width: 720px; margin: 0 auto;
}
.pk-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 6px; }
.pk-head button { width: 44px; height: 44px; flex: none; display: grid; place-items: center; background: none; border: 0; color: var(--ink); cursor: pointer; }
.pk-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pk-title h2 { font-size: 24px; }
.pk-search { padding: 4px 16px 10px; display: block; }
.pk-search input { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--raised); color: var(--ink); font: 16px var(--body); }
.pk-body { flex: 1; overflow-y: auto; padding: 4px 16px calc(24px + env(safe-area-inset-bottom, 0px)); -webkit-overflow-scrolling: touch; }
.pk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pk-chip {
  min-height: 64px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); text-align: left; cursor: pointer; display: flex; flex-direction: column; justify-content: center; gap: 2px;
}
.pk-chip b { font: 700 18px var(--cond); text-transform: uppercase; letter-spacing: .03em; }
.pk-chip small { color: var(--muted); font-size: 13px; }
.pk-chip:active, .pk-list button:active { background: var(--raised); }
.pk-list { list-style: none; margin: 0; padding: 0; }
.pk-list li + li { border-top: 1px solid var(--line); }
.pk-list button { width: 100%; min-height: 52px; padding: 8px 4px; background: none; border: 0; color: var(--ink); text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; font: inherit; }
.pk-name { font-weight: 600; }
.pk-tags { font-size: 13px; color: var(--muted); }
.pk-more { font-size: 14px; }
.pk-new { margin-top: 16px; }

/* Program builder */
.ed { gap: 0; }
.ed > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-height: 32px; }
.ed > summary::-webkit-details-marker { display: none; }
.ed[open] > summary { margin-bottom: 12px; }
.wk { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 12px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.wk legend { font: 700 15px var(--cond); text-transform: uppercase; letter-spacing: .06em; padding: 0 6px; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid3 input { width: 100%; }
.field textarea, .field select, .day-edit select {
  min-height: 48px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--raised); color: var(--ink); font: 16px var(--body);
}
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .35; cursor: default; }
.day-edit { display: flex; gap: 8px; align-items: center; padding: 12px 12px 8px; }
.day-name { flex: 1; min-width: 0; min-height: 48px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--raised); color: var(--ink); font: 900 22px var(--display); text-transform: uppercase; }
.ed-ex li { display: block; padding: 0; }
.ed-ex summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 12px 16px; min-height: 48px; }
.ed-ex summary::-webkit-details-marker { display: none; }
.ed-ex details[open] summary { background: var(--raised); }
.ed-ex details > form, .ed-ex .ed-tools { padding: 12px 16px; }
.ed-ex .ed-tools { padding-top: 0; }
.ed-empty { padding: 12px 16px; border-top: 1px solid var(--line); }
.day-tools { padding: 10px 12px 14px; border-top: 1px solid var(--line); }

/* Paste import */
.field textarea { width: 100%; font: 15px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.pv-day { border-top: 1px solid var(--line); padding-top: 10px; }
.pv-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pv-list li { display: flex; flex-direction: column; gap: 1px; }
.pv-name { font-weight: 600; }
.pv-typed { font-weight: 400; font-size: 14px; }
.pv-dose { font: 16px var(--cond); color: #cfcfc9; }
.pv-problems { border: 1px solid var(--danger); border-radius: 12px; padding: 10px 12px; }
.pv-problems ul { margin: 6px 0 0; padding-left: 18px; color: #cfcfc9; }
.pv-example { margin: 10px 0; padding: 12px; border-radius: 10px; background: var(--raised); white-space: pre-wrap; font-size: 14px; }

/* Goals and events */
.small { font-size: 14px; }
.grow { flex: 1; min-width: 0; }
.plain { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.goal-strip {
  display: flex; flex-direction: column; gap: 6px; margin: 4px 0 16px; padding: 14px 16px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); border-left: 0; text-decoration: none; color: var(--ink);
  box-shadow: inset 0 3px 0 var(--accent);
}
.goal-strip.empty { box-shadow: none; border-style: dashed; }
.goal-strip.empty b { font-weight: 600; }
.gs-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.gs-title-row b { font: 900 22px var(--display); text-transform: uppercase; line-height: 1; }
.cd { font: 700 17px var(--cond); color: var(--accent); letter-spacing: .02em; }
.bar { display: block; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.goal-card { text-decoration: none; color: var(--ink); }
.goal-card h2 { font-size: 24px; }
.countdown { display: flex; flex-direction: column; gap: 4px; }
.countdown b { font: 900 34px var(--display); text-transform: uppercase; color: var(--accent); line-height: 1; }
.prog-block { display: flex; flex-direction: column; gap: 8px; }
.note-card { margin-bottom: 12px; padding: 12px 14px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line-strong); font-size: 15px; line-height: 1.45; }
.note-card.good { border-color: #3d9a5f; margin: 0; }
.filters { display: flex; gap: 8px; margin-bottom: 8px; }
.filters select { flex: 1; min-width: 0; min-height: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--raised); color: var(--ink); font: 15px var(--body); }
.ev-month h2 { font-size: 22px; margin: 18px 0 8px; }
.ev-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ev-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); min-height: 60px; }
.ev-row.mine { border-color: var(--accent); }
.ev-date { flex: 0 0 44px; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.ev-date b { font: 900 26px var(--display); }
.ev-date small { font: 600 12px var(--cond); text-transform: uppercase; color: var(--muted); letter-spacing: .06em; }
.ev-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ev-name { font-weight: 700; }
.ev-meta { font-size: 14px; color: var(--muted); }
.ev-side small { color: var(--muted); font-size: 13px; white-space: nowrap; }
.pick-btn { justify-content: flex-start; text-transform: none; font: 600 16px var(--body); letter-spacing: 0; }
select.grow, .card select { min-height: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--raised); color: var(--ink); font: 15px var(--body); }
.card + .card, .note-card + .card { margin-top: 12px; }
.stack > .card + .card { margin-top: 0; }

/* A goal's road: blocks in order down to the goal */
.road { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; }
.road li { display: flex; gap: 12px; position: relative; padding: 0 0 14px; }
.road li::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: var(--line-strong); }
.road li:last-child::before { display: none; }
.road-dot { flex: none; width: 14px; height: 14px; margin-top: 3px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--bg); position: relative; z-index: 1; }
.road-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.road-body small { color: var(--muted); font-size: 14px; }
.road-past { opacity: .6; }
.road-past .road-dot { background: var(--good); border-color: var(--good); }
.road-now .road-dot { background: var(--accent); border-color: var(--accent); }
.road-now .now { color: var(--accent); }
.road-goal .road-dot { border-radius: 3px; transform: rotate(45deg); border-color: var(--accent); }
.road-goal b { font: 900 18px var(--display); text-transform: uppercase; }

/* Plans */
h2.sec { font-size: 22px; margin: 20px 0 10px; }
.plan-blocks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.plan-blocks .card + .card { margin-top: 0; }
.pb-head { display: flex; align-items: center; gap: 12px; }
.pb-n { flex: 0 0 34px; height: 34px; border-radius: 8px; background: var(--raised); display: grid; place-items: center; font: 900 20px var(--display); }
.pb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pb-main a { text-decoration: none; }
.pb-label input { flex: 1; min-width: 0; min-height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--raised); color: var(--ink); font: 15px var(--body); }
.field input[type="radio"] { width: 20px; height: 20px; accent-color: var(--accent); }
.field ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.field ul label { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font: 600 16px var(--body); color: var(--ink); min-height: 40px; }
.empty-card { gap: 4px; }

/* Folding days, done marks, exercise details */
details.day > summary { list-style: none; cursor: pointer; }
details.day > summary::-webkit-details-marker { display: none; }
.day-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fold { width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: 0 4px 4px 6px; transition: transform .2s; }
details.day[open] .fold { transform: rotate(-135deg); margin-bottom: -4px; }
details.day.done { border-color: color-mix(in srgb, var(--good) 55%, var(--line)); box-shadow: inset 3px 0 0 var(--good); }
details.day.done h2 { color: #cfcfc9; }
.done-tag { font: 600 14px var(--cond); letter-spacing: .04em; text-transform: uppercase; color: #6fcf8f; margin: 0; }
.done-tag.big { font-size: 16px; }
.ex li { display: block; padding: 0; }
.exd > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 10px 16px; }
.exd > summary::-webkit-details-marker { display: none; }
.exd > summary .name { font-weight: 600; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.exd > summary .note { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }
.exd[open] > summary { background: var(--raised); }
.exd-body { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--raised); }
.exd-imgs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.exd-imgs img { width: 100%; height: auto; border-radius: 8px; background: #fff; }
.exd-cue { margin: 0; }
.exd-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: #cfcfc9; font-size: 15px; }
.ex li.skipped .name, .ex li.skipped .dose { color: var(--muted); text-decoration: line-through; }
.sum-sets { display: flex; flex-wrap: wrap; gap: 6px; }
.sum-sets .chip { font-size: 16px; padding: 4px 10px; }

/* Today: done and up next */
.done-line { margin: 0; color: var(--good); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.up-next { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; text-decoration: none; color: inherit; }
.up-next b { font-size: 1.15rem; text-transform: uppercase; }
