/* Lift Log — one phone-width column. Sticky header under the status bar, scrolling content, fixed tab bar.
   Set buttons are drawn as bumper plates in the day's plate color (IWF colors: red, blue, yellow, green). */
:root {
  color-scheme: dark;
  --bg: #0F1317;
  --surface: #161B21;
  --surface-2: #1E252D;
  --line: #2B343E;
  --fg: #ECEFF3;
  --muted: #8E99A6;
  --faint: #5C6774;
  --red: #E5484D;   --on-red: #FFFFFF;
  --blue: #3F7DF8;  --on-blue: #FFFFFF;
  --yellow: #F4B630; --on-yellow: #1B1404;
  --green: #2CB46B; --on-green: #04170C;
  --rest: #46515D;  --on-rest: #ECEFF3;
  --good: #2CB46B;
  --warn: #F4B630;
  --bad: #E5484D;
  --shadow: 0 12px 32px rgba(0,0,0,.45);
  --font-display: "Big Shoulders Display", "Arial Narrow", "Helvetica Neue", Impact, sans-serif;
  --font-body: "Barlow", -apple-system, "Segoe UI", system-ui, sans-serif;
  --r: 14px;
  --top: env(safe-area-inset-top, 0px);
  --bot: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font-family: var(--font-body); font-size: 16px; line-height: 1.4; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-user-select: none; user-select: none; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
img { max-width: 100%; }

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

/* header */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); padding-top: var(--top); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; padding-block: 10px 8px; gap: 12px; }
.brand { font-family: var(--font-display); font-weight: 900; font-size: 22px; letter-spacing: .04em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.brand-mark { display: inline-flex; gap: 3px; align-items: center; }
.brand-mark i { display: block; width: 6px; border-radius: 2px; }
.brand-mark i:nth-child(1) { height: 18px; background: var(--red); }
.brand-mark i:nth-child(2) { height: 14px; background: var(--blue); }
.brand-mark i:nth-child(3) { height: 10px; background: var(--yellow); }
.top-right { display: flex; align-items: center; gap: 10px; }
.net { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.net::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.gear { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); }
.gear[aria-pressed="true"] { color: var(--fg); background: var(--surface); }
.gear svg { width: 22px; height: 22px; }

main { padding-bottom: calc(92px + var(--bot)); }
.section { display: grid; gap: 14px; padding-block: 4px 24px; }

/* week strip */
.strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day-pill { display: grid; justify-items: center; gap: 3px; padding: 8px 0 7px; border-radius: 12px; background: var(--surface); border: 1.5px solid transparent; }
.day-pill .dl { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--muted); }
.day-pill .dd { font-family: var(--font-display); font-weight: 800; font-size: 20px; line-height: 1; font-variant-numeric: tabular-nums; }
.day-pill .st { width: 8px; height: 8px; border-radius: 50%; }
.day-pill .st.planned { border: 2px solid var(--p); }
.day-pill .st.partial { background: linear-gradient(90deg, var(--p) 50%, transparent 50%); border: 2px solid var(--p); }
.day-pill .st.done { background: var(--p); }
.day-pill .st.rest { width: 10px; height: 2px; border-radius: 1px; background: var(--faint); margin-block: 3px; }
.day-pill.is-today .dl { color: var(--fg); }
.day-pill.is-sel { border-color: var(--p); background: var(--surface-2); }

/* quick row (weigh-in, cardio) */
.quick { display: flex; gap: 8px; flex-wrap: wrap; }
.qpill { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 10px; border-radius: 999px; background: var(--surface); font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.qpill svg { width: 18px; height: 18px; color: var(--muted); }
.qpill b { color: var(--fg); font-weight: 700; }
.qpill.todo { border: 1.5px dashed var(--line); background: transparent; }
.inline-form { display: flex; gap: 8px; align-items: center; background: var(--surface); border-radius: var(--r); padding: 8px; flex-wrap: wrap; }
.inline-form .inp { flex: 1; min-width: 90px; }
.inline-form .u { color: var(--muted); font-size: 14px; }

/* hero */
.hero { position: relative; overflow: hidden; border-radius: 20px; padding: 18px 18px 16px; background: var(--surface); display: grid; gap: 6px; }
.hero::after { content: ""; position: absolute; right: -58px; top: -70px; width: 160px; height: 160px; border-radius: 50%; border: 22px solid var(--p); opacity: .16; }
.hero::before { content: ""; position: absolute; right: 18px; top: 18px; width: 34px; height: 34px; border-radius: 50%; border: 9px solid var(--p); opacity: .5; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.hero h1 { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: clamp(44px, 13vw, 64px); line-height: .92; text-transform: uppercase; letter-spacing: .01em; text-wrap: balance; max-width: 85%; }
.hero .meta { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--p); border-radius: 3px; transition: width .3s ease; }
.bar-label { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.note { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r); padding: 10px 12px; font-size: 14px; color: var(--muted); }
.note b { color: var(--fg); font-weight: 600; }

.tipline { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; text-align: left; width: 100%; background: var(--surface); border-radius: var(--r); padding: 12px 14px; }
.tipline .ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--fg); }
.tipline .ic svg { width: 16px; height: 16px; }
.tipline .tx { font-size: 14px; min-width: 0; }
.tipline .tx small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.tipline .go { color: var(--muted); font-size: 20px; }

/* exercises */
.ex-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ex { background: var(--surface); border-radius: var(--r); padding: 14px 14px 12px; display: grid; gap: 10px; }
.ex.is-done { box-shadow: inset 3px 0 0 var(--p); }
.ex-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ex-name { font-weight: 700; font-size: 17px; line-height: 1.2; min-width: 0; }
.ex-last { font-size: 13px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.bump { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; min-height: 28px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.load { flex: none; display: inline-flex; align-items: baseline; gap: 4px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.load .w, .load .r { font-family: var(--font-display); font-weight: 800; font-size: 20px; line-height: 1; }
.load .u { font-size: 12px; color: var(--muted); font-weight: 600; }
.load .x { color: var(--muted); font-size: 14px; }
.sets { display: flex; flex-wrap: wrap; gap: 10px; }
.plate { position: relative; width: 48px; height: 48px; border-radius: 50%; border: 3px solid var(--line); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 19px; color: var(--muted); transition: transform .12s ease, background-color .15s ease, border-color .15s ease; }
.plate::after { content: ""; position: absolute; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--line); background: var(--bg); bottom: 5px; opacity: .9; }
.plate .n { transform: translateY(-3px); }
.plate.done { background: var(--p); border-color: var(--p); color: var(--on-p); }
.plate.done::after { border-color: color-mix(in srgb, var(--on-p) 45%, transparent); background: color-mix(in srgb, var(--p) 70%, #000); }
.plate:active { transform: scale(.92); }
.adjust { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 2px; }
.stepper { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; background: var(--surface-2); border-radius: 12px; overflow: hidden; }
.stepper button { height: 44px; font-size: 22px; font-weight: 600; color: var(--fg); }
.stepper button:active { background: var(--line); }
.stepper .val { text-align: center; display: grid; line-height: 1.1; }
.stepper input { width: 100%; text-align: center; background: transparent; border: 0; font-family: var(--font-display); font-weight: 800; font-size: 22px; padding: 0; font-variant-numeric: tabular-nums; }
.stepper small { font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.adjust-hint { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 20px; border-radius: 14px; font-weight: 700; font-size: 16px; letter-spacing: .01em; }
.btn[disabled] { opacity: .5; }
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-plate { background: var(--p); color: var(--on-p); }
.btn-ghost { background: var(--surface-2); color: var(--fg); }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn-link { min-height: 36px; padding: 0 4px; color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.btn-link.more { justify-self: center; margin-top: -4px; }
.btn-wide { width: 100%; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: center; }

.summary { background: var(--surface); border-radius: 20px; padding: 18px; display: grid; gap: 14px; text-align: center; }
.summary h2 { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: 34px; text-transform: uppercase; letter-spacing: .02em; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface-2); border-radius: 12px; padding: 10px 6px; display: grid; gap: 2px; text-align: center; }
.stat b { font-family: var(--font-display); font-weight: 800; font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; font-weight: 600; }

.empty { background: var(--surface); border-radius: 20px; padding: 22px 18px; display: grid; gap: 12px; }
.empty h2 { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: 34px; text-transform: uppercase; line-height: .95; }
.empty p { margin: 0; color: var(--muted); }
.pick { display: grid; gap: 8px; }
.pick button { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); text-align: left; }
.pick .chip { width: 12px; height: 12px; border-radius: 50%; background: var(--p); flex: none; }
.pick .lbl { flex: 1; font-weight: 600; }
.pick .sub { color: var(--muted); font-size: 13px; }

/* plan editor */
.h2 { margin: 6px 0 0; font-family: var(--font-display); font-weight: 900; font-size: 34px; text-transform: uppercase; letter-spacing: .02em; line-height: 1; }
.lede { margin: 0; color: var(--muted); font-size: 14px; }
.days { display: grid; gap: 8px; }
.dayrow { background: var(--surface); border-radius: var(--r); overflow: hidden; }
.dayrow-head { width: 100%; display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; text-align: left; }
.dchip { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--p); color: var(--on-p); font-family: var(--font-display); font-weight: 900; font-size: 16px; letter-spacing: .04em; }
.dchip.rest { background: transparent; border: 2px dashed var(--rest); color: var(--muted); }
.dname { font-weight: 700; font-size: 17px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.dsum { font-size: 13px; color: var(--muted); }
.chev { width: 20px; height: 20px; color: var(--muted); transition: transform .2s ease; }
.dayrow.open .chev { transform: rotate(180deg); }
.day-edit { padding: 14px; display: grid; gap: 12px; border-top: 1px solid var(--line); }
.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.field .hint { font-size: 13px; color: var(--muted); letter-spacing: 0; text-transform: none; font-weight: 400; }
.inp { width: 100%; min-width: 0; height: 44px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg); font-size: 16px; }
.inp:focus { outline: none; border-color: var(--blue); }
.inp.num { text-align: center; padding: 0 4px; font-variant-numeric: tabular-nums; }
select.inp { appearance: none; -webkit-appearance: none; padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch { width: 50px; height: 30px; border-radius: 15px; background: var(--line); position: relative; flex: none; transition: background .2s ease; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--fg); transition: transform .2s ease; }
.switch[aria-checked="true"] { background: var(--p, var(--green)); }
.switch[aria-checked="true"]::after { transform: translateX(20px); background: var(--on-p, var(--on-green)); }
.ex-edits { display: grid; gap: 8px; }
.ex-edit { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 8px; align-items: end; padding: 10px; border-radius: 12px; background: var(--bg); }
.ex-edit .inp { background: var(--surface); }
.ex-edit .ex-nm { grid-column: 1 / -1; font-weight: 600; }
.mini { display: grid; gap: 3px; min-width: 0; }
.mini > span { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); text-align: center; }
.ex-tools { display: flex; gap: 6px; padding-bottom: 7px; }
.icon-btn { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); background: var(--surface-2); }
.icon-btn:active { background: var(--line); }
.icon-btn svg { width: 16px; height: 16px; }
.add-btn { border: 1.5px dashed var(--line); border-radius: 12px; min-height: 44px; font-weight: 600; color: var(--muted); }
.card { background: var(--surface); border-radius: var(--r); padding: 14px; display: grid; gap: 14px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { min-height: 38px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; padding: 0 4px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.sec-title { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 8px 0 -4px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sec-title .btn-link { letter-spacing: 0; text-transform: none; min-height: 24px; }
.fine { font-size: 12px; color: var(--muted); margin: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* coach */
.checkin { gap: 12px; }
.ck { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 4px 12px; align-items: center; }
.ck .k { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ck .v { font-variant-numeric: tabular-nums; font-size: 15px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ck .v b { font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.ck .bar { grid-column: 2; margin-top: 0; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.good { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.tag.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.notes { display: grid; gap: 8px; }
.ncard { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; background: var(--surface); border-radius: var(--r); padding: 14px; }
.ncard .ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.ncard .ic svg { width: 16px; height: 16px; }
.ncard.good .ic { color: var(--good); background: color-mix(in srgb, var(--good) 15%, transparent); }
.ncard.warn .ic { color: var(--warn); background: color-mix(in srgb, var(--warn) 15%, transparent); }
.ncard.up .ic { color: var(--blue); background: color-mix(in srgb, var(--blue) 16%, transparent); }
.ncard b { display: block; font-size: 15px; margin-bottom: 2px; }
.ncard p { margin: 0; font-size: 14px; color: var(--muted); }
.ncard .act { margin-top: 10px; }
.ai-out { font-size: 15px; line-height: 1.5; display: grid; gap: 8px; }
.ai-out p { margin: 0; }
.ai-out ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.ai-out h4 { margin: 4px 0 0; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ai-wait { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.ai-wait::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--fg); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.chat { display: grid; gap: 10px; }
.bubble { padding: 10px 12px; border-radius: 14px; font-size: 15px; line-height: 1.45; max-width: 92%; }
.bubble.me { justify-self: end; background: var(--blue); color: var(--on-blue); border-bottom-right-radius: 4px; }
.bubble.co { justify-self: start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.ask { display: flex; gap: 8px; }
.ask .inp { flex: 1; }
.err { color: var(--bad); font-size: 14px; margin: 0; }
.lift-goal { display: grid; grid-template-columns: minmax(0, 1fr) 84px 30px; gap: 8px; align-items: center; }

/* progress */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { background: var(--surface); border-radius: var(--r); padding: 12px; display: grid; gap: 4px; }
.tile b { font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.tile b small { font-size: 18px; color: var(--muted); }
.tile span { font-size: 11px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.list { background: var(--surface); border-radius: var(--r); overflow: hidden; }
.lift { display: grid; grid-template-columns: minmax(0, 1fr) 96px auto; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.lift:first-child { border-top: 0; }
.lift .nm { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lift .sub { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lift .val { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lift .val b { font-family: var(--font-display); font-weight: 800; font-size: 22px; }
.lift .val small { color: var(--muted); font-size: 12px; margin-left: 2px; }
.delta { font-size: 12px; font-weight: 600; color: var(--muted); }
.delta.up { color: var(--good); }
.spark { width: 96px; height: 30px; display: block; overflow: visible; }
.spark .ln { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark .ar { fill: var(--blue); opacity: .12; }
.spark .pt { fill: var(--fg); stroke: var(--surface); stroke-width: 2; }
.spark .hit { fill: transparent; }
.rowi { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); text-align: left; width: 100%; }
.rowi:first-child { border-top: 0; }
.rowi .chip { width: 12px; height: 12px; border-radius: 50%; background: var(--p); }
.rowi .t { font-weight: 600; display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowi .d { font-size: 13px; color: var(--muted); }
.rowi .v { text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sess-body { padding: 0 14px 14px 38px; display: grid; gap: 6px; font-size: 14px; }
.sess-body div { display: flex; justify-content: space-between; gap: 12px; }
.sess-body span:last-child { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* weight chart */
.wchart { position: relative; }
.wchart svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.wchart .grid { stroke: var(--line); stroke-width: 1; }
.wchart .axis { fill: var(--muted); font: 600 10px var(--font-body); font-variant-numeric: tabular-nums; }
.wchart .dot { fill: var(--muted); opacity: .75; }
.wchart .avg { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wchart .end { fill: var(--blue); stroke: var(--surface); stroke-width: 2; }
.wchart .goal { stroke: var(--fg); stroke-width: 1.5; stroke-dasharray: 5 5; opacity: .55; }
.wchart .goal-lb { fill: var(--fg); font: 700 10px var(--font-body); opacity: .75; }
.wchart .xh { stroke: var(--muted); stroke-width: 1; }
.wtip { position: absolute; top: -6px; transform: translate(-50%, -100%); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 9px; font-size: 12px; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow); font-variant-numeric: tabular-nums; }
.wtip b { font-size: 14px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; }
.lg-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.lg-line { width: 16px; height: 2px; background: var(--blue); border-radius: 1px; }
.lg-dash { width: 16px; height: 0; border-top: 2px dashed var(--fg); opacity: .55; }
.wnow { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.wnow b { font-family: var(--font-display); font-weight: 800; font-size: 36px; line-height: 1; font-variant-numeric: tabular-nums; }
.wnow span { color: var(--muted); font-size: 14px; }

/* tab bar */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: var(--bot); }
.tabs .wrap { display: grid; grid-template-columns: repeat(4, 1fr); }
.tab { display: grid; justify-items: center; gap: 2px; padding: 9px 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--fg); }
.tab[aria-current="page"] svg { color: var(--red); }

/* rest timer */
.restbar { position: fixed; z-index: 7; left: 50%; transform: translateX(-50%); bottom: calc(74px + var(--bot)); display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border-radius: 999px; background: var(--fg); color: var(--bg); box-shadow: var(--shadow); }
.restbar svg { width: 34px; height: 34px; transform: rotate(-90deg); flex: none; }
.restbar .trk { fill: none; stroke: color-mix(in srgb, var(--bg) 25%, transparent); stroke-width: 4; }
.restbar .prg { fill: none; stroke: var(--bg); stroke-width: 4; stroke-linecap: round; }
.restbar .tm { font-family: var(--font-display); font-weight: 800; font-size: 24px; min-width: 56px; font-variant-numeric: tabular-nums; }
.restbar .lb { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .7; }
.restbar button { min-height: 36px; padding: 0 12px; border-radius: 999px; font-weight: 700; font-size: 14px; background: color-mix(in srgb, var(--bg) 14%, transparent); }
.restbar.go { background: var(--green); color: var(--on-green); }
.toast { position: fixed; z-index: 8; left: 50%; transform: translateX(-50%); bottom: calc(132px + var(--bot)); background: var(--surface-2); color: var(--fg); border: 1px solid var(--line); padding: 10px 14px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow); width: max-content; max-width: calc(100% - 32px); display: flex; gap: 12px; align-items: center; }
.toast button { font-weight: 700; color: var(--blue); }

.install { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; font-size: 14px; }
.install img { width: 40px; height: 40px; border-radius: 10px; }
.install b { display: block; }
.install span { color: var(--muted); }
.code-box { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px; word-break: break-all; -webkit-user-select: all; user-select: all; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.steps b { color: var(--fg); }
.loading { padding: 40px 0; text-align: center; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
