/* Cosy kitchen look: cream canvas, warm brown type, soft floating cards, plum + olive + honey accents. */
:root {
  --bg: #f6efe4;
  --bg-glow: #fbe9d4;
  --surface: #fffaf3;
  --ink: #33261f;
  --ink-2: #5c4a3f;
  --muted: #9a8676;
  --line: #ecdfcf;
  --track: #f0e4d4;
  --grape: #6f4a7e;
  --grape-soft: #efe3f0;
  --green: #6e8b4e;
  --green-soft: #e7eedb;
  --amber: #e2a644;
  --danger: #b4513a;
  --shadow: 0 1px 2px rgb(80 50 20 / .05), 0 14px 34px -14px rgb(80 50 20 / .22);
  --radius: 22px;
  --serif: Fraunces, Georgia, "Times New Roman", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1714;
    --bg-glow: #2a1f1a;
    --surface: #262019;
    --ink: #f5ebde;
    --ink-2: #d9c8b6;
    --muted: #a38f7d;
    --line: #3a3027;
    --track: #3a3027;
    --grape: #c9a2d6;
    --grape-soft: #3a2a40;
    --green: #a3bf7f;
    --green-soft: #2f3a24;
    --danger: #e8937c;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 14px 34px -14px rgb(0 0 0 / .7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 85% -10%, var(--bg-glow), transparent 70%) no-repeat, var(--bg);
  color: var(--ink);
  font: 16px/1.55 Figtree, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
h1, h2, h3 { margin: 0; font-weight: 600; }
h1, .recipe-head h2, .option h3, .macro-big b, .stat b, .ring span { font-family: var(--serif); }
button, input, select { font: inherit; color: inherit; }

/* header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.top-inner { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.01em; min-width: 0; }
.logo img { width: 34px; height: 34px; flex: none; }
.logo em { font-style: italic; font-weight: 400; color: var(--grape); }
.logo > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ring-dot { width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--grape); box-shadow: 0 0 0 3px var(--grape-soft); flex: none; }

main { max-width: 1120px; margin: 0 auto; padding: 24px 16px 32px; }

/* type */
.eyebrow {
  display: flex; align-items: center; gap: 8px; margin: 0 0 14px;
  font-size: .78rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2);
}
.eyebrow .ring-dot { width: 10px; height: 10px; border-width: 2px; box-shadow: none; }
h1 { font-size: clamp(2.6rem, 9vw, 4.4rem); line-height: 1.04; letter-spacing: -0.03em; font-weight: 600; }
h1 em { font-style: italic; font-weight: 400; color: var(--grape); }
.h-list { margin-bottom: 20px; }
.lede { color: var(--ink-2); font-size: 1.05rem; max-width: 34ch; margin: 18px 0 24px; }
.muted { color: var(--muted); font-size: .9rem; margin: 0; }
.center { text-align: center; margin-top: 24px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: 999px; border: 0;
  font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .12s ease, background .12s ease;
}
.btn:active { transform: scale(.98); }
.btn.dark { background: var(--ink); color: var(--bg); }
.btn.light { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: .85rem; }
.btn.wide { width: 100%; }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.link { background: none; border: 0; padding: 0; color: var(--ink-2); font-size: .85rem; font-weight: 500; cursor: pointer; }
.badge { min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--amber); color: #3a2508; font-size: .75rem; line-height: 20px; }

input, select {
  width: 100%; min-height: 46px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
}
input:focus, select:focus { outline: 2px solid var(--grape); outline-offset: 1px; }

/* hero */
.hero { display: grid; gap: 28px; margin-bottom: 32px; }
.search { display: flex; gap: 8px; max-width: 520px; }
.search input { box-shadow: var(--shadow); border-color: transparent; }
.hero-widgets { display: grid; gap: 14px; align-content: start; }
@media (min-width: 860px) {
  .hero { grid-template-columns: 1.15fr 1fr; align-items: center; padding: 24px 0; }
  .hero-widgets { padding-left: 24px; }
  .hero-widgets .widget:nth-child(2) { margin-left: -48px; margin-right: 48px; }
}

/* floating widgets */
.widget { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.widget-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; font-size: .95rem; margin-bottom: 12px; }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: .72rem; font-weight: 700; letter-spacing: .06em; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.widget-foot { color: var(--muted); font-size: .82rem; margin: 10px 0 0; }

.prep { display: flex; align-items: center; gap: 18px; }
.ring {
  --p: .5;
  width: 92px; height: 92px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background:
    radial-gradient(closest-side, var(--surface) 80%, transparent 81%),
    conic-gradient(var(--green) calc(var(--p) * 360deg), var(--track) 0);
  transition: --p .3s;
}
.ring span { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.03em; }
.prep-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex: 1; }
.prep-inputs label { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; color: var(--muted); }
.prep-inputs input { color: var(--ink); min-height: 40px; background: var(--bg); border-color: transparent; font-size: 1rem; font-weight: 600; }

.bars { display: grid; gap: 9px; }
.bar { display: grid; grid-template-columns: 74px 1fr 64px; align-items: center; gap: 12px; font-size: .88rem; }
.bar .label { color: var(--ink-2); }
.bar .val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.bar .track { height: 6px; border-radius: 99px; background: var(--track); overflow: hidden; }
.bar .fill { height: 100%; border-radius: 99px; background: var(--ink); transition: width .4s ease; }
.fill.green { background: var(--green); }
.fill.amber { background: var(--amber); }
.fill.ink { background: var(--grape); }
.fill.grey { background: var(--muted); }

/* status */
.status { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); margin-bottom: 20px; }
.status.error { color: var(--danger); }
.spinner { width: 16px; height: 16px; flex: none; border: 2px solid var(--track); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* options */
.options { display: grid; gap: 14px; margin-bottom: 24px; }
@media (min-width: 700px) { .options { grid-template-columns: 1fr 1fr; } }
.option { text-align: left; border: 0; cursor: pointer; width: 100%; padding: 20px; transition: transform .15s ease; }
.option:hover { transform: translateY(-2px); }
.option:focus-visible { outline: 2px solid var(--ink); }
.option h3 { font-size: 1.2rem; letter-spacing: -0.02em; margin: 6px 0 8px; }
.option p { margin: 0 0 14px; color: var(--ink-2); font-size: .95rem; }
.option .cta { font-weight: 600; font-size: .9rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .75rem; font-weight: 500; padding: 3px 10px; border-radius: 99px; background: var(--bg); color: var(--ink-2); }
.chip.green { background: var(--green-soft); color: #4f6a33; }
@media (prefers-color-scheme: dark) { .chip.green { color: var(--green); } }

/* recipe */
.back { margin-bottom: 18px; }
#recipe, #gym-draft { scroll-margin-top: 140px; }
.recipe-head h2 { font-size: clamp(2rem, 7vw, 3.2rem); line-height: 1.05; letter-spacing: -0.04em; margin-bottom: 18px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { padding: 14px; }
.stat b { display: block; font-size: 1.6rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .8rem; }
.recipe-grid { display: grid; gap: 14px; }
@media (min-width: 860px) { .recipe-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.macro-big { display: flex; align-items: baseline; gap: 6px; margin-bottom: 14px; }
.macro-big b { font-size: 2.2rem; font-weight: 600; letter-spacing: -0.04em; }
.macro-big span { color: var(--muted); font-size: .9rem; }
.split { display: flex; height: 10px; border-radius: 99px; overflow: hidden; margin: 14px 0 6px; background: var(--track); }
.split div { height: 100%; }
.split-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.split-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.tips ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: .95rem; }
.tips li { margin-bottom: 6px; }
.tips p { margin: 0 0 10px; color: var(--ink-2); font-size: .95rem; }

.ing { list-style: none; margin: 0; padding: 0; }
.ing li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--line); }
.ing li:first-child { border-top: 0; }
.ing input[type=checkbox], .item input[type=checkbox] { width: 22px; height: 22px; min-height: 0; margin-top: 1px; flex: none; accent-color: var(--ink); }
.ing .main { flex: 1; min-width: 0; }
.ing .name { font-weight: 600; }
.ing .use { font-size: .82rem; color: var(--muted); }
.ing .buy { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sticky-add { position: sticky; bottom: calc(16px + env(safe-area-inset-bottom)); margin-top: 14px; box-shadow: 0 12px 28px -8px rgb(80 50 20 / .35); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--ink-2); }
.steps li:first-child { border-top: 0; }
.steps li::before { content: counter(step, decimal-leading-zero); font-weight: 600; color: var(--muted); font-size: .85rem; padding-top: 2px; font-variant-numeric: tabular-nums; }
.span-2 { grid-column: 1 / -1; }

/* saved */
.saved { margin-top: 36px; }
.saved ul { list-style: none; padding: 0; margin: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.saved li { display: flex; align-items: center; gap: 8px; padding-left: 18px; border-top: 1px solid var(--line); }
.saved li:first-child { border-top: 0; }
.saved button.open { flex: 1; text-align: left; background: none; border: 0; padding: 14px 0; cursor: pointer; font-weight: 600; }
.saved small { color: var(--muted); display: block; font-weight: 400; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; min-width: 44px; min-height: 44px; font-size: 1.25rem; flex: none; }

/* list */
.list-store, .add { margin-bottom: 14px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--bg); padding: 4px; border-radius: 999px; }
.seg button { border: 0; background: none; border-radius: 999px; min-height: 40px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button[aria-checked=true] { background: var(--surface); color: var(--ink); box-shadow: 0 2px 6px rgb(80 50 20 / .12); }
.store-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.add .row { display: flex; gap: 8px; margin-top: 8px; }
.add select { max-width: 120px; }
.add input, .add select { background: var(--bg); border-color: transparent; }
.toolbar { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 22px; padding: 4px 16px 10px; scrollbar-width: none; }
.toolbar .btn { flex: none; min-height: 40px; padding: 0 14px; font-size: .88rem; }

.aisle { margin-bottom: 18px; }
.aisle h3 { display: flex; justify-content: space-between; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); margin: 0 0 8px 4px; }
.aisle h3 span { color: var(--muted); }
.items { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 4px 10px 16px; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item .main { flex: 1; min-width: 0; }
.item .name { font-weight: 600; overflow-wrap: anywhere; }
.item .sub { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .82rem; color: var(--muted); margin-top: 2px; }
.item .qty { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.item .other { color: var(--muted); }
.item.done .name, .item.done .qty { text-decoration: line-through; color: var(--muted); }
.item a.go { flex: none; min-height: 36px; padding: 0 12px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--grape); color: var(--bg); text-decoration: none; font-weight: 600; font-size: .82rem; }
.item.done a.go { opacity: .3; }

/* main section tabs, in the header */
.tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  background: var(--track); padding: 4px; border-radius: 999px; min-width: 360px;
}
.tabs button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; background: none; border-radius: 999px; min-height: 46px; padding: 0 18px;
  font-size: 1rem; font-weight: 600; color: var(--ink-2); cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.tabs button:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.tabs button.active { background: var(--ink); color: var(--bg); box-shadow: 0 6px 16px -8px rgb(50 30 15 / .6); }
.tabs svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs .badge { margin-left: -2px; }
@media (max-width: 640px) {
  .top-inner { flex-wrap: wrap; padding-bottom: 10px; }
  .tabs { order: 3; width: 100%; min-width: 0; }
  .tabs button { padding: 0 8px; font-size: .95rem; min-height: 48px; }
}

.list-progress { display: flex; align-items: center; gap: 10px; margin: -6px 0 18px; }
.list-progress .track { flex: 1; max-width: 320px; height: 6px; background: var(--track); border-radius: 99px; overflow: hidden; }
#progress { height: 100%; width: 0; background: var(--grape); transition: width .4s ease; }
.list-progress .pct { font-weight: 600; font-variant-numeric: tabular-nums; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 999px; z-index: 20;
  max-width: calc(100% - 32px); text-align: center; font-size: .92rem; font-weight: 500;
}

[hidden] { display: none !important; }

/* ---------- gym ---------- */
.fill.grape { background: var(--grape); }
.chip.grape { background: var(--grape-soft); color: var(--grape); }
.small { font-size: .8rem; }
.subtabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 18px; padding: 4px 16px 8px; scrollbar-width: none; }
.subtabs button {
  flex: none; border: 0; background: var(--surface); box-shadow: var(--shadow); border-radius: 999px;
  min-height: 40px; padding: 0 16px; font-weight: 600; font-size: .9rem; color: var(--ink-2); cursor: pointer;
}
.subtabs button[aria-selected=true] { background: var(--ink); color: var(--bg); }
.gym-pane > * + * { margin-top: 14px; }
.gym-grid { display: grid; gap: 14px; }
@media (min-width: 860px) { .gym-grid { grid-template-columns: 1fr 1fr; align-items: start; } }

.body-map { display: block; width: 100%; max-width: 320px; margin: 0 auto; }
.body-map.sm { max-width: 240px; }
.bm-skin { fill: var(--track); }
.bm-muscle { fill: color-mix(in srgb, var(--grape) var(--v), var(--line)); stroke: var(--surface); stroke-width: 1; transition: fill .3s; }
.bm-label { font-size: 9px; fill: var(--muted); font-family: Figtree, sans-serif; }

.draft .entry { border-top: 1px solid var(--line); padding: 14px 0 10px; }
.draft .entry:first-of-type { border-top: 0; padding-top: 4px; }
.entry-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.entry-title { flex: 1; min-width: 0; display: grid; gap: 5px; }
.set-row { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.set-n { width: 44px; flex: none; font-size: .8rem; color: var(--muted); font-weight: 600; }
.set-row input { width: 74px; min-height: 42px; padding: 0 10px; background: var(--bg); border-color: transparent; text-align: center; font-weight: 600; }
.set-row .icon-btn { margin-left: auto; }
.unit { font-size: .8rem; color: var(--muted); }
.add-set { margin: 4px 0 0 50px; }
.add-ex { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.add-ex select, .add-ex input { flex: 1 1 180px; background: var(--bg); border-color: transparent; }
.draft-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.date-in { width: auto; min-height: 36px; padding: 0 10px; font-size: .85rem; background: var(--bg); border-color: transparent; }

.history { list-style: none; margin: 0; padding: 0; }
.history > li { border-top: 1px solid var(--line); }
.history > li:first-child { border-top: 0; }
.history summary { padding: 12px 0; cursor: pointer; list-style: none; }
.history summary::-webkit-details-marker { display: none; }
.history-entries { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; font-size: .9rem; }
.history-entries li { display: flex; justify-content: space-between; gap: 12px; }
.danger-link { color: var(--danger); margin-bottom: 10px; }

.part-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pill { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; min-height: 36px; padding: 0 14px; font-size: .85rem; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.pill.on { background: var(--grape); border-color: var(--grape); color: #fff; }
.hint { margin: 12px 0 0; font-size: .9rem; color: var(--ink-2); }
.scheme { font-weight: 600; margin: 0 0 12px; }
.plan-list { margin: 0 0 14px; padding: 0; list-style: none; counter-reset: step; }
.plan-list li { counter-increment: step; display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.plan-list li:first-child { border-top: 0; }
.plan-list li::before { content: counter(step, decimal-leading-zero); color: var(--muted); font-weight: 600; font-size: .85rem; width: 22px; flex: none; }
.plan-list .main { flex: 1; min-width: 0; display: grid; gap: 5px; }

.chart { width: 100%; height: auto; display: block; margin: 6px 0; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-label { font-size: 9px; fill: var(--muted); font-family: Figtree, sans-serif; }
.ch-goal { fill: var(--green); font-weight: 600; }
.ch-target { stroke: var(--green); stroke-width: 1.5; stroke-dasharray: 4 4; }
.ch-area { fill: color-mix(in srgb, var(--grape) 14%, transparent); }
.ch-line { fill: none; stroke: var(--grape); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.ch-dot { fill: var(--surface); stroke: var(--grape); stroke-width: 2; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.mini-stats b { display: block; font-family: var(--serif); font-size: 1.5rem; font-weight: 600; line-height: 1.1; }
.mini-stats span { font-size: .78rem; color: var(--muted); }
.mini-stats .up { color: var(--green); }
.mini-stats .down { color: var(--danger); }
.small-select { width: auto; min-height: 34px; padding: 0 10px; font-size: .85rem; background: var(--bg); border-color: transparent; max-width: 60%; }

.goal-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.goal-form input { flex: 1 1 120px; background: var(--bg); border-color: transparent; }
.goal-form .btn { flex: none; }
.inline-label { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); flex: 1 1 220px; }
.inline-label input { max-width: 80px; }
.goal-line { margin: 10px 0 4px; font-weight: 600; }
.label-sm { font-size: .8rem; color: var(--muted); margin: 10px 0 0; }
.weighins { list-style: none; padding: 0; margin: 12px 0 0; }
.weighins li { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line); font-size: .9rem; }
.weighins li span:nth-child(2) { margin-left: auto; font-weight: 600; }

dialog#howto {
  border: 0; border-radius: var(--radius); padding: 0; width: min(520px, calc(100% - 24px)); max-height: 88vh;
  background: var(--surface); color: var(--ink); box-shadow: 0 30px 60px -20px rgb(40 20 10 / .5);
}
dialog#howto::backdrop { background: rgb(40 25 15 / .45); backdrop-filter: blur(3px); }
.howto { padding: 18px 20px 20px; display: grid; gap: 14px; }
.howto-head { display: flex; justify-content: space-between; gap: 12px; }
.howto-head h2 { font-family: var(--serif); font-size: 1.7rem; letter-spacing: -0.02em; }
.howto-head .eyebrow { margin-bottom: 6px; }
.howto .tips { background: var(--grape-soft); border-radius: 14px; padding: 12px 14px; }
.howto .tips p { margin: 0; }
.inline-label input { color: var(--ink); }
.bar { grid-template-columns: 74px 1fr minmax(56px, auto); }
@media (max-width: 420px) {
  .set-row { gap: 4px; }
  .set-n { width: 38px; }
  .set-row input { width: 58px; padding: 0 6px; }
  .add-set { margin-left: 42px; }
}

/* gym people */
.gym-top { margin-bottom: 14px; }
.gym-person-actions { display: inline-flex; gap: 14px; }
.gym-person-actions .danger-link { margin: 0; }
.people { display: flex; flex-wrap: wrap; gap: 8px; }
.person {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 5px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink);
  font-weight: 600; cursor: pointer;
}
.person .avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grape-soft); color: var(--grape); font-family: var(--serif); font-weight: 600;
}
.person.on { background: var(--grape); border-color: var(--grape); color: #fff; }
.person.on .avatar { background: rgb(255 255 255 / .22); color: #fff; }
.person.add { border-style: dashed; color: var(--ink-2); background: transparent; }
.person.add .avatar { background: var(--track); color: var(--ink-2); }

/* ---------- PIN lock ---------- */
.lock-btn {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); display: grid; place-items: center; cursor: pointer;
  margin-right: auto;
}
.lock-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 640px) { .lock-btn { margin-right: 0; margin-left: auto; } }

body.locked > :not(.lock) { visibility: hidden; }
.lock {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(900px 500px at 80% -10%, var(--bg-glow), transparent 70%), var(--bg);
  overflow-y: auto;
}
.lock-card {
  width: min(360px, 100%); background: var(--surface); border-radius: 28px; box-shadow: var(--shadow);
  padding: 28px 24px 22px; display: grid; justify-items: center; gap: 10px; text-align: center;
}
.lock-logo { width: 56px; height: 56px; }
.lock-title { font-family: var(--serif); font-size: 1.5rem; letter-spacing: -0.02em; }
.lock-title em { font-style: italic; font-weight: 400; color: var(--grape); }
.lock-sub { margin: 0; color: var(--ink-2); }
.pin-dots { display: flex; gap: 12px; margin: 10px 0 2px; min-height: 16px; }
.pin-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--grape); transition: background .15s; }
.pin-dots span.on { background: var(--grape); }
.pin-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.lock-error { min-height: 1.3em; margin: 0; color: var(--danger); font-size: .9rem; font-weight: 500; }
.keypad { display: grid; grid-template-columns: repeat(3, 72px); gap: 12px; margin-top: 4px; }
.key {
  width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--bg); color: var(--ink);
  font-family: var(--serif); font-size: 1.6rem; font-weight: 600; cursor: pointer; transition: transform .08s, background .15s;
}
.key:active { transform: scale(.94); background: var(--grape-soft); }
.key-del { font-family: inherit; font-size: 1.3rem; color: var(--ink-2); background: transparent; }
.key-go { background: var(--grape); color: #fff; font-family: inherit; font-size: 1.5rem; }
.key-go:disabled { opacity: .35; cursor: default; }
.lock-remember { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: .88rem; color: var(--ink-2); cursor: pointer; }
.lock-remember input { width: 18px; height: 18px; min-height: 0; accent-color: var(--grape); }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
