/* Unavoidable Gym */
:root {
  --bg: #0b0d10;
  --bg-2: #101317;
  --card: #15191e;
  --card-2: #1b2027;
  --line: #242a32;
  --line-2: #2f3640;
  --text: #eef1f4;
  --muted: #8d97a3;
  --dim: #5d6672;
  --accent: #c8f031;
  --accent-ink: #0b0d10;
  --good: #3ddc84;
  --warn: #ffb547;
  --bad: #ff5d6c;
  --p: #4fb7ff;
  --c: #ffb547;
  --f: #ff6fae;
  --radius: 16px;
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
#app { max-width: 560px; margin: 0 auto; padding: calc(var(--safe-t) + 14px) 16px calc(var(--nav-h) + var(--safe-b) + 96px); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.topbar h1, .h1 { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1; letter-spacing: .3px; text-transform: uppercase; margin: 0; }
.eyebrow { font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.section { margin: 26px 0 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.section h2 { font-family: var(--display); font-weight: 700; font-size: 21px; text-transform: uppercase; letter-spacing: .4px; margin: 0; }
.section a, .section button.link { font-size: 13px; font-weight: 600; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 10px; }
.card.tight { padding: 12px 14px; }
.stack > * + * { margin-top: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

/* ---------- Bottom nav ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: rgba(11, 13, 16, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.nav-inner { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); height: var(--nav-h); }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--dim); font-size: 11px; font-weight: 600; letter-spacing: .3px; position: relative; }
.nav a svg { width: 24px; height: 24px; }
.nav a.on { color: var(--text); }
.nav a.on svg { color: var(--accent); }
.nav a .badge-dot { position: absolute; top: 10px; right: calc(50% - 18px); width: 8px; height: 8px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 3px var(--bg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--card-2); color: var(--text); font-weight: 700; font-size: 15px; white-space: nowrap;
  transition: transform .08s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.danger { background: transparent; color: var(--bad); border-color: #4a2329; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.big { min-height: 56px; font-size: 17px; border-radius: 14px; }
.btn:disabled { opacity: .5; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); display: inline-flex; align-items: center; justify-content: center; color: var(--muted); flex: none; }
.icon-btn svg { width: 20px; height: 20px; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; }

/* ---------- Forms ---------- */
label.f { display: block; font-size: 12px; font-weight: 600; letter-spacing: .4px; color: var(--muted); margin: 14px 0 6px; text-transform: uppercase; }
.input, select.input, textarea.input {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; font-size: 16px; color: var(--text);
  outline: none; -webkit-appearance: none; appearance: none;
}
textarea.input { min-height: 84px; resize: vertical; }
select.input { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--dim); }
.seg { display: flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; min-height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 700; font-size: 13px; }
.seg button.on { background: var(--card-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.toggle { position: relative; width: 50px; height: 30px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: var(--line-2); border-radius: 30px; transition: .2s; }
.toggle span::after { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(20px); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent; outline: 2px solid transparent; }
.swatch.on { border-color: var(--bg); outline-color: var(--text); }

/* ---------- Login ---------- */
.login { min-height: calc(100dvh - 60px); display: flex; flex-direction: column; justify-content: center; }
.brandmark { font-family: var(--display); font-weight: 800; font-size: 54px; line-height: .9; text-transform: uppercase; letter-spacing: .5px; }
.brandmark em { font-style: normal; color: var(--accent); }
.err { background: #2b1216; border: 1px solid #5c2129; color: #ffb3bb; padding: 11px 14px; border-radius: 12px; font-size: 14px; margin-top: 12px; }

/* ---------- Home ---------- */
.today { position: relative; overflow: hidden; border-radius: 20px; padding: 20px; background: var(--card); border: 1px solid var(--line); }
.today::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--tc, var(--accent)); }
.today .big { font-family: var(--display); font-weight: 800; font-size: 46px; line-height: .95; text-transform: uppercase; margin: 6px 0 4px; }
.today .focus { color: var(--muted); margin-bottom: 16px; }
.today .exlist { font-size: 13px; color: var(--muted); margin: -6px 0 16px; }
.week { display: grid; grid-template-columns: 74px repeat(7, 1fr); gap: 6px; align-items: center; }
.week .wd { text-align: center; font-size: 11px; color: var(--dim); font-weight: 700; }
.week .wd.today-col { color: var(--text); }
.week .who { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week .cell { height: 26px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); }
.week .cell.done { background: var(--uc); border-color: transparent; }
.week .cell.plan { border: 1px dashed var(--line-2); }
.macro-mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.mm .v { font-family: var(--display); font-size: 24px; font-weight: 700; line-height: 1; }
.mm .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-top: 4px; }
.bar { height: 6px; background: var(--bg-2); border-radius: 6px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--bc, var(--accent)); border-radius: 6px; max-width: 100%; }
.bar.over i { background: var(--warn); }

.feed-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); }
.feed-item + .feed-item { margin-top: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: 19px; color: var(--accent-ink); background: var(--uc, var(--accent)); }
.feed-item .t { font-weight: 700; }
.feed-item .s { font-size: 13px; color: var(--muted); }
.stats-inline { display: flex; gap: 14px; margin-top: 6px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.stats-inline b { color: var(--text); font-weight: 700; }

.banner { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--radius); background: linear-gradient(120deg, #1d2410, #15191e 70%); border: 1px solid #3a4a17; margin-bottom: 14px; }

/* ---------- Train / templates ---------- */
.tpl { position: relative; padding: 16px 16px 16px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tpl + .tpl { margin-top: 10px; }
.tpl::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--tc, var(--accent)); }
.tpl .name { font-family: var(--display); font-weight: 800; font-size: 28px; text-transform: uppercase; line-height: 1; }
.tpl .meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.tpl .exs { font-size: 13px; color: var(--dim); margin-top: 8px; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .3px; }
.tag.today-tag { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* ---------- Workout logger ---------- */
.wo-head { position: sticky; top: 0; z-index: 30; margin: calc(-1 * (var(--safe-t) + 14px)) -16px 14px; padding: calc(var(--safe-t) + 10px) 16px 10px; background: rgba(11, 13, 16, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.wo-head .clock { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1; }
.wo-name { background: transparent; border: 0; padding: 0; font-family: var(--display); font-weight: 800; font-size: 30px; text-transform: uppercase; width: 100%; outline: none; }
.progress-strip { height: 4px; background: var(--bg-2); border-radius: 4px; overflow: hidden; margin-top: 10px; }
.progress-strip i { display: block; height: 100%; background: var(--accent); transition: width .3s ease; }

.ex { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 12px 12px; margin-top: 12px; }
.ex.complete { border-color: #2d3f12; }
.ex-head { display: flex; align-items: flex-start; gap: 10px; padding: 0 4px; }
.ex-title { font-weight: 800; font-size: 17px; line-height: 1.2; }
.ex-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.ex-sub .rival { color: var(--rc, var(--muted)); }
.sets { margin-top: 12px; }
.set-row { display: grid; grid-template-columns: 34px 1fr 1fr 1fr 48px; gap: 6px; align-items: center; padding: 4px 0; border-radius: 10px; }
.set-row.head { font-size: 10px; font-weight: 700; color: var(--dim); letter-spacing: .8px; text-transform: uppercase; padding: 0 0 2px; }
.set-row.head > div { text-align: center; }
.set-no { height: 40px; border-radius: 10px; border: 0; background: transparent; font-weight: 800; color: var(--muted); font-size: 14px; }
.set-no.w { color: var(--warn); }
.prev { background: none; border: 0; padding: 0; height: 40px; width: 100%; text-align: center; font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-row input { width: 100%; height: 42px; text-align: center; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; font-size: 17px; font-weight: 700; outline: none; font-variant-numeric: tabular-nums; padding: 0 4px; }
.set-row input:focus { border-color: var(--accent); }
.set-row input::placeholder { color: var(--dim); font-weight: 600; }
.tick { width: 48px; height: 42px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); display: flex; align-items: center; justify-content: center; color: var(--dim); }
.tick svg { width: 22px; height: 22px; }
.set-row.done { background: rgba(200, 240, 49, .07); }
.set-row.done input { background: transparent; border-color: transparent; color: var(--text); }
.set-row.done .tick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ex-actions { display: flex; gap: 8px; margin-top: 10px; }
.ex-actions .btn { flex: 1; min-height: 40px; font-size: 13px; }

.rest-pill {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--safe-b) + 12px); z-index: 45;
  width: min(528px, calc(100% - 32px)); display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px;
  background: #1f2610; border: 1px solid #44561a; border-radius: 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}
.rest-pill .time { font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1; min-width: 70px; }
.rest-pill .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; font-weight: 700; }
.rest-pill .ring { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); border-radius: 0 3px 3px 16px; transition: width .25s linear; }
.rest-pill .btn.sm { padding: 0 10px; min-width: 40px; }
.rest-pill.is-paused { background: #2a2210; border-color: #5a4614; }
.rest-pill.is-paused .ring { background: var(--warn); }
.clock.paused { color: var(--warn); }
.icon-btn.on { background: var(--warn); border-color: var(--warn); color: var(--accent-ink); }
.paused-banner { background: linear-gradient(120deg, #2a2210, #15191e 70%); border-color: #5a4614; margin-bottom: 14px; }
.set-row.timing { box-shadow: inset 0 0 0 1.5px var(--accent); }
.sw-row { margin-top: 10px; }
.sw-row + .ex-actions { margin-top: 8px; }
.rest-pill.done-flash { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.rest-pill.done-flash .lbl { color: var(--accent-ink); }

.feel { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.feel button { min-height: 52px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted); font-weight: 700; font-size: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.feel button b { font-family: var(--display); font-size: 22px; color: var(--text); line-height: 1; }
.feel button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.feel button.on b { color: var(--accent-ink); }

.summary-big { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.stat .v { font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1; }
.stat .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-top: 4px; }
.pr { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; background: #1f2610; border: 1px solid #3a4a17; }
.pr + .pr { margin-top: 8px; }
.pr .medal { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-family: var(--display); font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }

/* ---------- Food ---------- */
.datebar { display: flex; align-items: center; gap: 8px; }
.datebar .d { flex: 1; text-align: center; font-weight: 700; }
.ring-wrap { display: flex; gap: 18px; align-items: center; }
.ring-wrap svg { flex: none; }
.ring-num { font-family: var(--display); font-weight: 800; font-size: 30px; }
.macros { flex: 1; min-width: 0; }
.macro + .macro { margin-top: 10px; }
.macro .top { display: flex; justify-content: space-between; font-size: 13px; }
.macro .top b { font-weight: 700; }
.meal { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 12px; overflow: hidden; }
.meal-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px; }
.meal-head h3 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 20px; text-transform: uppercase; flex: 1; }
.meal-head .k { font-size: 13px; color: var(--muted); font-weight: 600; }
.entry { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line); width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0; }
.entry .n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry .m { font-size: 12px; color: var(--muted); }
.entry .kc { font-weight: 700; white-space: nowrap; }
.meal-foot { display: flex; gap: 8px; padding: 10px 14px 14px; }
.meal-foot .btn { flex: 1; min-height: 40px; font-size: 13px; }
.food-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; background: none; border-top: 0; border-left: 0; border-right: 0; }
.food-row .n { font-weight: 600; }
.food-row .m { font-size: 12px; color: var(--muted); }
.macro-line { display: flex; gap: 10px; font-size: 12px; color: var(--muted); }
.macro-line .pp { color: var(--p); } .macro-line .cc { color: var(--c); } .macro-line .ff { color: var(--f); }
.calc { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; margin-top: 14px; }
.calc .v { font-family: var(--display); font-size: 26px; font-weight: 800; line-height: 1; }
.calc .l { font-size: 11px; color: var(--muted); text-transform: uppercase; margin-top: 3px; }
#scanner { width: 100%; border-radius: 14px; overflow: hidden; background: #000; min-height: 260px; }
#scanner video { border-radius: 14px; }
.readonly-note { font-size: 13px; color: var(--muted); padding: 10px 14px; border: 1px dashed var(--line-2); border-radius: 12px; margin-bottom: 12px; }

/* ---------- Progress ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--dim); font-size: 10px; font-family: var(--body); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.empty { text-align: center; color: var(--muted); padding: 26px 12px; font-size: 14px; }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.kv { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }

/* ---------- Settings ---------- */
.list-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; text-align: left; font-weight: 600; color: var(--text); }
.list-btn + .list-btn { margin-top: 8px; }
.list-btn .chev { margin-left: auto; color: var(--dim); }
.sched { display: grid; grid-template-columns: 54px 1fr; gap: 8px 10px; align-items: center; }
.sched .d { font-weight: 700; font-size: 14px; }
.tpl-ex { display: grid; grid-template-columns: 1fr 54px 64px 60px 32px; gap: 6px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tpl-ex .nm { font-weight: 600; font-size: 14px; line-height: 1.2; }
.tpl-ex input { width: 100%; height: 38px; text-align: center; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; font-weight: 700; outline: none; font-size: 15px; }
.tpl-ex .mv { display: flex; flex-direction: column; }
.tpl-ex .mv button { height: 19px; background: none; border: 0; color: var(--dim); padding: 0; line-height: 1; }
.tpl-ex-head { font-size: 10px; color: var(--dim); font-weight: 700; letter-spacing: .8px; text-transform: uppercase; border-bottom: 0; padding-bottom: 0; }

/* ---------- Sheet ---------- */
.sheet-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 60; opacity: 0; transition: opacity .2s; }
.sheet-back.on { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-width: 560px; margin: 0 auto;
  background: var(--bg-2); border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0;
  max-height: calc(100dvh - var(--safe-t) - 24px); display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
.sheet.on { transform: translateY(0); }
.sheet-grab { width: 40px; height: 5px; border-radius: 5px; background: var(--line-2); margin: 10px auto 2px; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 8px 16px 10px; flex: none; }
.sheet-head h3 { margin: 0; flex: 1; font-family: var(--display); font-weight: 800; font-size: 24px; text-transform: uppercase; line-height: 1.05; }
.sheet-body { padding: 0 16px calc(var(--safe-b) + 20px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet .input { background: var(--card); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; top: calc(var(--safe-t) + 12px); transform: translate(-50%, -140%); z-index: 80; background: var(--text); color: var(--bg); font-weight: 700; padding: 11px 16px; border-radius: 12px; font-size: 14px; transition: transform .25s ease; max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.toast.on { transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); color: #fff; }

.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.sync.pending i { background: var(--warn); }
.sync.offline i { background: var(--bad); }

.loading { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 600px) {
  #app { padding-top: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- v1.2: one-tap logging, pad, pin mode, people, changelog ---------- */
.log-row { display: flex; gap: 8px; margin-top: 10px; }
.log-btn { flex: 1; min-height: 52px; justify-content: flex-start; gap: 10px; padding: 0 16px; font-size: 15px; }
.log-btn b { font-family: var(--display); font-size: 20px; font-weight: 800; letter-spacing: .2px; }
.pad-btn { width: 60px; min-height: 52px; padding: 0; font-size: 24px; font-weight: 800; }
.unit-tg { background: var(--card-2); border: 1px solid var(--line-2); border-radius: 6px; color: var(--accent); font: inherit; font-size: 10px; font-weight: 800; letter-spacing: .6px; padding: 2px 6px; text-transform: uppercase; }
.hint { display: flex; align-items: center; gap: 6px; margin: 10px 4px 0; padding: 8px 10px; border-radius: 10px; background: #1f2610; border: 1px solid #3a4a17; color: var(--accent); font-size: 12px; font-weight: 600; }
.pad-field { margin-top: 16px; }
.pad-lbl { font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.pad-ctl { display: grid; grid-template-columns: 76px 1fr 76px; gap: 10px; }
.pad-pm { height: 72px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--card-2); color: var(--text); font-size: 34px; font-weight: 700; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.pad-pm:active { background: var(--accent); color: var(--accent-ink); }
.pad-val { width: 100%; height: 72px; text-align: center; background: var(--card); border: 1px solid var(--line-2); border-radius: 16px; font-family: var(--display); font-size: 44px; font-weight: 800; color: var(--text); outline: none; }
.pad-val:focus { border-color: var(--accent); }
.pad-chips { margin-top: 8px; }
.pad-chips .chip { min-width: 44px; justify-content: center; }
.sheet .btn.big { margin-top: 20px; }
.cl { border-left: 3px solid var(--line-2); padding: 2px 0 2px 14px; margin-bottom: 20px; }
.cl.latest { border-color: var(--accent); }
.cl-v { font-family: var(--display); font-size: 22px; font-weight: 800; }
.cl-t { font-weight: 700; margin: 2px 0 6px; }
.cl ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.cl ul b { color: var(--text); }
