/* hantel — workshop logbook. Dark, utilitarian, fast to read mid-set. */

:root {
  --bg: #14171f;
  --card: #262b3b;
  --card-raised: #2d3347;
  --line: #363c52;
  --ink: #e8eaf2;
  --muted: #8b91a5;
  --faint: #5c6275;
  --green: #4ade80;
  --green-dim: #22c55e33;
  --orange: #fb923c;
  --orange-dim: #fb923c26;
  --red: #f87171;
  --radius: 22px;
  --radius-s: 12px;
  --display: "Futura", "Avenir Next Condensed", "Arial Narrow", sans-serif;
  --body: "Avenir Next", "Seravek", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: dark; }

body {
  background:
    radial-gradient(1200px 500px at 85% -10%, #1d2333 0%, transparent 60%),
    radial-gradient(900px 400px at -10% 110%, #191e2c 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100vh;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

/* ---- header ---- */

header.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.brand b { color: var(--orange); font-weight: 700; }

.top-date {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--faint);
  margin-left: auto; /* stays right-aligned when the nav wraps on narrow screens */
}

/* ---- cards ---- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
}

.card h2 {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 6px;
}

.session-title {
  font-family: var(--display);
  font-size: 34px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.1;
}

.session-sub { color: var(--muted); margin-top: 4px; font-size: 14px; }

/* ---- exercise card ---- */

.exercise { position: relative; }
.exercise.skipped { opacity: 0.45; }

.ex-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.ex-head-l { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }

.thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  border: 1px solid var(--line);
  transition: width 0.15s ease, height 0.15s ease;
}
.thumb.big { width: 180px; height: 180px; border-color: var(--orange); }

.hero-ex { display: flex; align-items: center; gap: 10px; min-width: 0; }
.thumb-s {
  width: 30px; height: 30px; border-radius: 7px; object-fit: cover;
  background: #fff; border: 1px solid var(--line); flex-shrink: 0;
}

.ex-name {
  font-size: 19px;
  font-weight: 600;
  text-transform: capitalize;
}

.ex-target {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}

.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--orange);
  background: var(--orange-dim);
  border-radius: 6px;
  padding: 1px 7px;
  margin-left: 8px;
  vertical-align: 2px;
}

.skip-btn {
  background: none;
  border: 1px solid var(--line);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 12px;
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
}
.skip-btn:hover { color: var(--ink); border-color: var(--muted); }

/* ---- logged sets ---- */

.sets { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }

.set-pill {
  font-family: var(--mono);
  font-size: 14px;
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid #22c55e55;
  border-radius: 10px;
  padding: 6px 12px;
}
.set-pill.warmup { color: var(--muted); background: #ffffff10; border-color: var(--line); }

.ex-volume {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  margin-top: 6px;
}

/* ---- log row ---- */

.log-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.stepper {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  overflow: hidden;
}

.stepper button {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  width: 46px;
  height: 52px;
  cursor: pointer;
}
.stepper button:hover { color: var(--orange); background: #ffffff08; }

.stepper .val {
  font-family: var(--mono);
  font-size: 20px;
  min-width: 76px;
  text-align: center;
}
.stepper .val small { display: block; font-size: 10px; color: var(--faint); letter-spacing: 0.08em; }
.stepper input.val {
  background: none; border: none; color: var(--ink); height: 52px; width: 76px;
}
.stepper input.val:focus { outline: none; color: var(--orange); }

.log-btn {
  flex: 1;
  min-width: 120px;
  background: var(--orange);
  color: #1a130b;
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-s);
  cursor: pointer;
  height: 54px;
  transition: transform 0.05s ease;
}
.log-btn:hover { filter: brightness(1.08); }
.log-btn:active { transform: scale(0.98); }

@media (max-width: 520px) {
  /* steppers share one line, the log button gets a full-width line of its own */
  .log-row { gap: 8px; }
  .log-row .stepper { flex: 1 1 40%; justify-content: space-between; }
  .stepper .val { min-width: 0; flex: 1; }
  .stepper input.val { width: auto; }
  .log-btn { flex-basis: 100%; }
}

/* ---- hero / start ---- */

.hero { text-align: left; padding: 30px 26px; }

.hero .kicker {
  font-family: var(--mono);
  color: var(--orange);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero-list { margin: 18px 0 22px; }
.hero-list li {
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 15px;
  text-transform: capitalize;
}
.hero-list li:last-child { border-bottom: none; }
.hero-list .t { font-family: var(--mono); color: var(--muted); font-size: 13px; text-align: right; }

.big-btn {
  display: inline-block;
  width: 100%;
  background: var(--green);
  color: #0b1a10;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius-s);
  padding: 17px 24px;
  cursor: pointer;
  transition: transform 0.05s ease;
}
.big-btn:hover { filter: brightness(1.07); }
.big-btn:active { transform: scale(0.99); }
.big-btn.secondary { background: var(--card-raised); color: var(--ink); border: 1px solid var(--line); }

/* ---- footer bar ---- */

.finish-bar { display: flex; gap: 12px; margin-top: 8px; }
.finish-bar .big-btn { flex: 1; }

/* ---- month strip / streak ---- */

.meta-row { display: flex; gap: 18px; }
.meta-row .card { flex: 1; margin-bottom: 0; }

.streak-num {
  font-family: var(--mono);
  font-size: 40px;
  color: var(--green);
  line-height: 1;
}
.streak-label { color: var(--faint); font-size: 12px; margin-top: 6px; letter-spacing: 0.08em; text-transform: uppercase; }

.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 10px; }
.cal .d {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px;
  color: var(--faint);
  border-radius: 8px;
}
.cal .d.logged { background: var(--green-dim); color: var(--green); }
.cal .d.today { outline: 2px solid var(--orange); color: var(--orange); }
.cal .d.blank { visibility: hidden; }

/* ---- login ---- */

.login-wrap {
  max-width: 420px;
  margin: 14vh auto 0;
  padding: 0 20px;
  text-align: center;
}
.login-wrap .brand { font-size: 30px; display: block; margin-bottom: 8px; }
.login-wrap p { color: var(--muted); margin: 12px 0 28px; }
.login-msg { margin-top: 18px; font-family: var(--mono); font-size: 13px; color: var(--muted); min-height: 20px; }
.login-msg.err { color: var(--red); }
.login-msg.ok { color: var(--green); }

/* ---- nav ---- */

.nav { display: flex; align-items: baseline; gap: 6px 18px; flex-wrap: wrap; }
.nav a {
  color: var(--faint);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  padding: 6px 0; /* extend the tap target without changing the look */
}
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--orange); }

/* ---- program editor ---- */

.field {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  padding: 10px 14px;
  width: 100%;
}
.field:focus { outline: 1px solid var(--orange); }
.field.big { font-size: 20px; font-weight: 600; margin: 8px 0 12px; }

.check { color: var(--muted); font-size: 14px; display: flex; gap: 8px; align-items: center; }
.check input { accent-color: var(--green); width: 16px; height: 16px; }

.prog-list li {
  list-style: none;
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 4px;
  border-bottom: 1px dashed var(--line);
  cursor: pointer;
}
.prog-list li:hover .prog-name { color: var(--orange); }
.prog-list .prog-name { font-size: 17px; font-weight: 600; }
.prog-list .t { font-family: var(--mono); font-size: 13px; color: var(--muted); }

.day-head { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.day-head .field { font-size: 17px; font-weight: 600; flex: 1; }

.row-tools { display: flex; gap: 4px; flex-shrink: 0; }
.row-tools button {
  background: none; border: 1px solid var(--line); color: var(--faint);
  border-radius: 7px; width: 30px; height: 30px; cursor: pointer; font-size: 13px;
}
.row-tools button:hover:not(:disabled) { color: var(--ink); border-color: var(--muted); }
.row-tools button:disabled { opacity: 0.3; cursor: default; }

/* Fixed grid so sets/reps/kg/rest line up across every row; bodyweight
   rows keep an empty kg slot instead of collapsing the columns. */
.ex-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto 104px;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.ex-row-name {
  font-size: 15px;
  text-transform: capitalize;
  line-height: 1.35;
  min-width: 0;
}
.ex-row .row-tools { justify-content: flex-end; }

.mini-fields { display: flex; gap: 16px; align-items: center; }
.mini-fields label { display: flex; align-items: center; gap: 5px; }
.mini-fields .fl {
  font-family: var(--mono); font-size: 11px; color: var(--faint);
}
.mini-fields .dash { color: var(--faint); }
.mini-fields input {
  width: 44px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 7px; color: var(--ink); font-family: var(--mono);
  font-size: 14px; padding: 6px 4px; text-align: center;
}
.mini-fields input.kg-in { width: 62px; }
.mini-fields input.reps-in { width: 62px; }
.mini-fields input:focus { outline: 1px solid var(--orange); }
.bw-slot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 62px; height: 33px;
  font-family: var(--mono); font-size: 12px; color: var(--faint);
  border: 1px dashed var(--line); border-radius: 7px;
}

@media (max-width: 860px) {
  .ex-row { grid-template-columns: 30px minmax(0, 1fr) auto; }
  /* keep the tools on the name line; the fields drop to a full-width second line */
  .ex-row .row-tools { grid-row: 1; grid-column: 3; }
  .ex-row .mini-fields { grid-row: 2; grid-column: 1 / -1; flex-wrap: wrap; row-gap: 8px; padding-left: 42px; }
}

@media (max-width: 520px) {
  .ex-row .mini-fields { padding-left: 0; gap: 10px; row-gap: 8px; }
  .row-tools button { width: 36px; height: 36px; }
}

.ex-search { position: relative; margin-top: 12px; }
.suggest {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 10;
  background: var(--card-raised); border: 1px solid var(--line);
  border-radius: var(--radius-s); margin-top: 6px; overflow: hidden;
  box-shadow: 0 12px 30px #00000066;
}
.sg {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; cursor: pointer; text-transform: capitalize;
}
.sg:hover { background: #ffffff0d; }
.sg .t { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--faint); }

.big-btn.danger { background: none; border: 1px solid var(--red); color: var(--red); }

/* ---- history ---- */

.hist-list li {
  list-style: none;
  display: flex; align-items: center; gap: 14px;
  padding: 11px 2px;
  border-bottom: 1px dashed var(--line);
}
.hist-list .h-date { font-family: var(--mono); font-size: 13px; color: var(--faint); flex-shrink: 0; }
.hist-list .h-name { font-weight: 600; flex: 1; }
.hist-list .t { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ---- exercise browser (catalogue) ---- */

.wrap.wide { max-width: 1100px; }

.cat-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px 20px; flex-wrap: wrap;
  margin: 4px 0 20px;
}
.cat-kicker {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.26em;
  text-transform: uppercase; color: var(--orange); margin-bottom: 7px;
}
.cat-title {
  font-family: var(--display); font-weight: 700;
  font-size: 40px; letter-spacing: 0.05em; text-transform: uppercase;
  line-height: 0.95;
}
.cat-total { text-align: right; }
.cat-total .n { font-family: var(--mono); font-size: 30px; line-height: 1; color: var(--ink); }
.cat-total .l {
  font-family: var(--mono); font-size: 10px; color: var(--faint);
  letter-spacing: 0.2em; text-transform: uppercase; margin-top: 5px;
}

/* toolbar */
.browse-controls { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.browse-controls #q {
  flex: 2; min-width: 200px;
  padding-left: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235c6275' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 14px center;
}
.field.sel {
  flex: 1; min-width: 150px; width: auto;
  appearance: none; -webkit-appearance: none;
  font-family: var(--mono); font-size: 13px; color: var(--muted);
  padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235c6275' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.field.sel:hover { border-color: var(--muted); }
.field.sel.on { color: var(--orange); border-color: #fb923c66; }

.result-line {
  display: flex; align-items: baseline; gap: 14px;
  font-family: var(--mono); font-size: 12px; color: var(--faint);
  margin: 0 2px 16px;
  min-height: 18px;
}
.result-line .clear-btn {
  background: none; border: none; cursor: pointer;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  text-decoration: underline; text-underline-offset: 3px; padding: 0;
}
.result-line .clear-btn:hover { color: var(--orange); }

/* grid */
.ex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.ex-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  overflow: hidden;
  cursor: pointer;
  animation: card-in 0.35s ease backwards;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.ex-card:hover, .ex-card:focus-visible {
  transform: translateY(-3px);
  border-color: #fb923c88;
  box-shadow: 0 10px 26px #0000004d;
  outline: none;
}
.ex-card:hover .ex-card-name { color: var(--orange); }

/* the specimen plate: line drawings ship on white, so frame the white
   deliberately instead of letting it bleed to the card edge */
.plate {
  position: relative;
  margin: 9px 9px 0;
  aspect-ratio: 1;
  background: #fff;
  border-radius: 9px;
  box-shadow: inset 0 0 0 1px #00000014, inset 0 -14px 24px -18px #00000038;
  overflow: hidden;
}
.plate img {
  width: 100%; height: 100%;
  object-fit: contain; padding: 7%;
  display: block;
  transition: transform 0.25s ease;
}
.ex-card:hover .plate img { transform: scale(1.05); }
.plate-id {
  position: absolute; top: 7px; left: 9px;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em;
  color: #00000038;
}
.plate-tags { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
.plate-tags i {
  font-style: normal;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.04em;
  color: #7c3a0e; background: #fb923c2e;
  border: 1px solid #fb923c59;
  border-radius: 5px; padding: 1px 6px;
}
.plate.empty {
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--faint); font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.1em;
}

.ex-card-body { padding: 10px 13px 13px; }
.ex-card-kicker {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--orange);
  margin-bottom: 4px;
}
.ex-card-name {
  font-size: 14px; font-weight: 600; text-transform: capitalize;
  line-height: 1.32;
  transition: color 0.12s ease;
}
.ex-card-meta { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-top: 5px; }

/* load-more sentinel */
.load-status {
  text-align: center;
  font-family: var(--mono); font-size: 12px; color: var(--faint);
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 18px 0 6px;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}
.empty-state .big { font-family: var(--display); font-size: 22px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.empty-state p { font-family: var(--mono); font-size: 12px; color: var(--faint); }

/* ---- detail modal ---- */

.modal {
  position: fixed; inset: 0; z-index: 50;
  background: #0c0e14cc;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.modal-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 900px; width: 100%; max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modal-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
  box-shadow: 0 30px 80px #00000080;
}
.modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  background: var(--card-raised); border: 1px solid var(--line); color: var(--muted);
  border-radius: 9px; width: 34px; height: 34px; cursor: pointer; font-size: 14px;
}
.modal-close:hover { color: var(--ink); border-color: var(--muted); }
.modal-close:focus-visible { outline: 2px solid #fb923c88; outline-offset: 2px; }
.modal-card:focus { outline: none; }

.detail { display: grid; grid-template-columns: 322px minmax(0, 1fr); }

/* spec-sheet sidebar */
.detail-side {
  background: #1e2331;
  border-right: 1px solid var(--line);
  border-radius: var(--radius) 0 0 var(--radius);
  padding: 22px;
  min-height: 100%;
}
.detail-side .plate { margin: 0; }
.detail-side .plate img { padding: 5%; }
.freeze-btn {
  position: absolute; bottom: 8px; right: 8px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: #f5f0e8; background: #10131bd9;
  border: none; border-radius: 6px; padding: 4px 9px; cursor: pointer;
}
.freeze-btn:hover { background: #10131b; color: var(--orange); }

.facts { margin-top: 18px; }
.fact {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.fact:last-child { border-bottom: none; }
.fact .fl {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--faint); flex-shrink: 0;
}
.fact .fv { color: var(--ink); text-align: right; text-transform: capitalize; }
.fact .fv small { display: block; font-size: 11px; color: var(--muted); text-transform: none; margin-top: 1px; }

.ladder { margin-top: 20px; }
.ladder-rungs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.rung {
  font-family: var(--mono); font-size: 11.5px;
  color: var(--ink); background: #ffffff0a;
  border: 1px solid var(--line); border-radius: 6px;
  padding: 3px 7px;
}
.rung.max { color: var(--orange); border-color: #fb923c59; background: var(--orange-dim); }

/* detail body */
.detail-body { padding: 24px 28px 26px; min-width: 0; }
.detail-kicker {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--orange);
  margin-bottom: 8px; padding-right: 40px;
}
.detail-name {
  font-size: 26px; font-weight: 700; text-transform: capitalize;
  line-height: 1.15; letter-spacing: -0.01em;
  padding-right: 34px;
}

.sec-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--faint);
  margin: 22px 0 10px;
  display: flex; align-items: center; gap: 10px;
}
.sec-label::after { content: ""; flex: 1; border-top: 1px dashed var(--line); }

.muscles { display: flex; flex-wrap: wrap; gap: 6px; }
.m-chip {
  font-family: var(--mono); font-size: 12px; text-transform: capitalize;
  color: var(--muted); background: #ffffff0d;
  border: 1px solid var(--line);
  border-radius: 7px; padding: 4px 11px;
}
.m-chip.primary {
  color: var(--orange); background: var(--orange-dim); border-color: #fb923c59;
}
.m-chip.primary small {
  font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase;
  color: #fb923c99; margin-left: 7px;
}

.flag-notes { margin-top: 14px; display: grid; gap: 6px; }
.flag-note {
  display: flex; gap: 9px; align-items: baseline;
  font-size: 13px; color: var(--muted);
}
.flag-note .badge { margin-left: 0; flex-shrink: 0; vertical-align: baseline; }

.steps { list-style: none; margin-top: 2px; counter-reset: step; }
.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 4px;
  padding: 8px 0;
  font-size: 14px; line-height: 1.55; color: var(--ink);
}
.steps li + li { border-top: 1px dashed #363c5266; }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--mono); font-size: 11px; color: var(--orange);
  padding-top: 4px;
}

.lang-row { display: flex; flex-wrap: wrap; gap: 2px; margin-left: auto; }
.lang-row button {
  background: none; border: none; cursor: pointer;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.05em;
  color: var(--faint); padding: 2px 5px; border-radius: 5px;
}
.lang-row button:hover { color: var(--ink); }
.lang-row button.on { color: var(--orange); background: var(--orange-dim); }

/* related strip */
.related-row {
  display: flex; gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
}
.rel-card {
  flex: 0 0 96px; cursor: pointer; background: none; border: none;
  padding: 0; text-align: left; font-family: var(--body);
}
.rel-card .rel-plate {
  width: 96px; height: 96px;
  background: #fff; border-radius: 9px;
  box-shadow: inset 0 0 0 1px #00000014;
  overflow: hidden;
  transition: box-shadow 0.12s ease, transform 0.12s ease;
}
.rel-card .rel-plate img { width: 100%; height: 100%; object-fit: contain; padding: 6%; display: block; }
.rel-card:hover .rel-plate { box-shadow: 0 0 0 2px var(--orange); transform: translateY(-2px); }
.rel-card .rel-name {
  font-size: 11px; line-height: 1.3; color: var(--muted);
  text-transform: capitalize; margin-top: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rel-card:hover .rel-name { color: var(--ink); }

.attr { font-family: var(--mono); font-size: 10px; color: var(--faint); margin-top: 20px; }
.attr a { color: var(--faint); text-underline-offset: 2px; }
.attr a:hover { color: var(--muted); }

@media (max-width: 680px) {
  .modal { padding: 12px; }
  .modal-card { max-height: 92vh; }
  .detail { grid-template-columns: 1fr; }
  .detail-side {
    border-right: none; border-bottom: 1px solid var(--line);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 16px 16px 18px;
  }
  .detail-side .plate { max-width: 260px; margin: 0 auto; }
  .detail-body { padding: 20px 18px 22px; }
  .detail-name { font-size: 22px; }
  .modal-close { width: 40px; height: 40px; }
  .cat-title { font-size: 32px; }
  .cat-total { display: flex; align-items: baseline; gap: 8px; text-align: left; }
  .cat-total .n { font-size: 18px; }
  .cat-total .l { margin-top: 0; }
}

@media (max-width: 520px) {
  .ex-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .plate { margin: 7px 7px 0; }
  .ex-card-body { padding: 8px 10px 11px; }
  .ex-card-name { font-size: 13px; }
}

/* ---- exercise detail links ---- */

.ex-link { color: inherit; text-decoration: none; }
.ex-link:hover { color: var(--orange); }

/* ---- misc ---- */

.muted { color: var(--muted); }
.hidden { display: none !important; }

.bw-inline {
  display: flex; gap: 8px; align-items: center;
  font-size: 14px; color: var(--muted);
}
.bw-inline input {
  width: 70px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; color: var(--ink); font-family: var(--mono);
  padding: 6px 8px; font-size: 14px; text-align: right;
}
.bw-inline input:focus { outline: 1px solid var(--orange); }

@media (max-width: 560px) {
  .meta-row { flex-direction: column; }
  .session-title { font-size: 26px; }
}
