/* "Laboratorium progresu": dark first, numbers in mono, volt only where there is progress.
   Brand colours are fixed; themes (src/data.js) only change the surface tokens. */

/* ---------- tokens ---------- */

:root {
  /* Brand colours. Never overridden by themes. */
  --volt: #C6FF33;       /* progress, PR, primary button, streak */
  --on-volt: #0D0F12;    /* text on volt is always graphite */
  --warn: #FF7A2F;       /* regress, ego-lifting warning */
  --err: #FF4D5E;        /* error, delete */

  /* Accent and warning as text/icon colours; light mode swaps them (below). */
  --acc: var(--volt);
  --warn-text: var(--warn);

  /* Surfaces: Grafit theme (dark, default). applyTheme() rewrites these. */
  --bg: #0D0F12;         /* grafit: app background */
  --s1: #181B20;         /* stal: cards, panels */
  --s2: #262A31;         /* beton: fields, secondary buttons */
  --line: #262A31;       /* beton: lines, borders */
  --ink: #F2F4F1;        /* kreda: main text */
  --mute: #8B929C;       /* mgła: secondary text, captions */

  --display: Archivo, system-ui, sans-serif;     /* 800, width 125, uppercase */
  --text: Inter, system-ui, sans-serif;          /* 400 / 500 */
  --num: 'JetBrains Mono', ui-monospace, monospace; /* 400 / 500, every number */
  --fs-xl: 28px; --fs-l: 22px; --fs-m: 18px; --fs-s: 15px; --fs-xs: 12px;
  --r-card: 16px; --r-ctl: 14px;

  --motion: 420ms; /* screen transitions, set from config.js */
  --top: 58px;     /* space above screen content (clears the faux status bar) */
  --dock: 22px;    /* space below the tab bar */
}

:root { color-scheme: dark; }
:root[data-mode="light"] {
  color-scheme: light;
  --acc: #4F6B00;        /* olive: volt is only ever a background in light mode */
  --warn-text: #C2410C;
}

/* ---------- base ---------- */

html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
html, body {
  margin: 0; padding: 0; height: 100%; overscroll-behavior: none;
  background: var(--bg); color: var(--ink); font: 400 var(--fs-s)/1.4 var(--text);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; scrollbar-width: none; }
::-webkit-scrollbar { width: 0; height: 0; }
button { margin: 0; font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
input, textarea, select { font-family: inherit; }
h1, h2, h3, p, blockquote { margin: 0; font: inherit; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

@keyframes pop { 0% { transform: scale(.6); opacity: 0 } 60% { transform: scale(1.06); opacity: 1 } 100% { transform: scale(1) } }
@keyframes tick { 0% { transform: scale(.85); opacity: 0 } 70% { transform: scale(1.04); opacity: 1 } 100% { transform: scale(1) } }
@keyframes rise { 0% { transform: translateY(18px); opacity: 0 } 100% { transform: none; opacity: 1 } }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes spark { 0% { transform: translate(0, 0) scale(1); opacity: 1 } 100% { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0 } }
@keyframes pulse { 0%, 100% { opacity: .35 } 50% { opacity: 1 } }
@keyframes pulse-once { 0%, 100% { transform: scale(1) } 45% { transform: scale(1.05) } }
@keyframes shake { 0%, 100% { transform: none } 25% { transform: translateX(-4px) } 75% { transform: translateX(4px) } }

.press:active { transform: scale(.97); }
.pulse { animation: pulse 1.6s infinite; }

/* ---------- type ---------- */

.h1, .h2, .display { font-family: var(--display); font-weight: 800; font-stretch: 125%; text-transform: uppercase; letter-spacing: 0; }
.h1 { font-size: var(--fs-xl); line-height: 1.05; margin-top: 6px; overflow-wrap: anywhere; }
.h2 { font-size: var(--fs-l); line-height: 1.1; }
.display { font-size: var(--fs-s); line-height: 1.2; }
.title { font: 500 var(--fs-m)/1.25 var(--text); }
.eyebrow { font: 500 var(--fs-xs)/1.3 var(--text); color: var(--mute); text-transform: uppercase; letter-spacing: .06em; }
.cap { font: 400 var(--fs-xs)/1.4 var(--text); color: var(--mute); }
.num { font-family: var(--num); font-weight: 500; font-variant-numeric: tabular-nums; }
.n-xl { font: 500 var(--fs-xl)/1 var(--num); }
.n-l { font: 500 var(--fs-l)/1.1 var(--num); }
.n-m { font: 500 var(--fs-m)/1.2 var(--num); }
.n-s { font: 500 var(--fs-s)/1.3 var(--num); }
.n-xs { font: 400 var(--fs-xs)/1.4 var(--num); color: var(--mute); }
.acc { color: var(--acc); }
.mute { color: var(--mute); }
.warn { color: var(--warn-text); }
.danger { color: var(--err); }

/* ---------- layout utilities ---------- */

.grow { flex: 1; min-width: 0; }
.minw0 { min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mt4 { margin-top: 4px; } .mt6 { margin-top: 6px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.tight { gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.screen-head { padding: 6px 2px 0; }
.screen-head.split { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.section { font: 500 var(--fs-m)/1.25 var(--text); margin-top: 6px; }

/* ---------- surfaces ---------- */

.card { padding: 16px; border-radius: var(--r-card); background: var(--s1); border: 1px solid var(--line); }
.card.tight { padding: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card-head.base { align-items: baseline; }

.meter { height: 6px; border-radius: 999px; overflow: hidden; background: var(--s2); }
.meter > i { display: block; height: 100%; border-radius: inherit; background: var(--acc); }
.meter.thin { height: 4px; }
.meter.thick { height: 8px; }
.meter > i.slow { transition: width .6s; }

.dots { display: flex; gap: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 2px; background: var(--s2); }
.dots i.on { background: var(--mute); }

/* ---------- controls ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 16px; border: 0; border-radius: var(--r-ctl);
  font: 500 var(--fs-s)/1.2 var(--text); cursor: pointer; text-align: center;
}
.btn.primary { background: var(--volt); color: var(--on-volt); }
.btn.secondary { background: var(--s2); color: var(--ink); }
.btn.inverse { background: var(--ink); color: var(--bg); }
.btn.danger { background: var(--err); color: var(--on-volt); }
.btn.block { width: 100%; }
.btn.sm { min-height: 40px; padding: 0 12px; font-size: var(--fs-xs); }
.btn.icon { width: 44px; min-height: 44px; padding: 0; }
.btn.icon.sm { width: 40px; min-height: 40px; }
.btn:disabled { opacity: .5; cursor: default; }
.link { border: 0; background: none; padding: 10px 0; font: 500 var(--fs-s)/1.2 var(--text); cursor: pointer; text-align: left; }
.link.danger { color: var(--err); }
.link.mute { color: var(--mute); }
.link:disabled { opacity: .4; cursor: default; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px;
  background: var(--s2); color: var(--ink); font: 500 var(--fs-xs)/1 var(--text); cursor: pointer; white-space: nowrap;
}
.chip.on { background: var(--ink); color: var(--bg); }
.chip.num-chip { font: 500 var(--fs-s)/1 var(--num); justify-content: center; padding: 0; }

/* Progress chip: volt, graphite text, arrow up. Pulses once when it appears. */
.chip-progress {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px;
  background: var(--volt); color: var(--on-volt); font: 500 var(--fs-s)/1.3 var(--text);
  animation: tick .3s ease, pulse-once .7s ease .3s 1;
}

.seg { display: flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--s2); }
.seg button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--mute); font: 500 var(--fs-xs)/1 var(--text); cursor: pointer; }
.seg button.on { background: var(--ink); color: var(--bg); }

.field { width: 100%; border: 1px solid var(--line); background: var(--s2); color: var(--ink); border-radius: var(--r-ctl); outline: none; font: 400 var(--fs-s)/1.4 var(--text); }
.field::placeholder { color: var(--mute); }
.field:focus { border-color: var(--ink); }
.search { height: 48px; padding: 0 14px; margin-top: 12px; }

.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: var(--r-ctl); background: var(--s2); color: var(--ink); cursor: pointer; }

/* ---------- device frame ---------- */

.stage { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 12px; background: var(--bg); }
.device {
  position: relative; width: 390px; max-width: 100%; height: 844px; max-height: calc(100vh - 48px);
  border-radius: 46px; overflow: hidden; overflow: clip; background: var(--bg); color: var(--ink);
  box-shadow: 0 0 0 10px #181B20;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.device input, .device textarea { -webkit-user-select: text; user-select: text; }
.statusbar {
  position: absolute; top: 0; left: 0; right: 0; height: 48px; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; padding: 6px 30px 0;
  font: 500 var(--fs-s)/1 var(--text); pointer-events: none;
}
.statusbar .notch { width: 110px; height: 30px; border-radius: 20px; background: #000; }
.statusbar .net { font: 500 var(--fs-xs)/1 var(--num); }

/* clip, not hidden: a hidden overflow can still be scrolled by focus or scrollIntoView,
   which would shift the screen track sideways. */
.viewport { position: absolute; inset: 0; overflow: hidden; overflow: clip; }
.track { display: flex; width: 500%; height: 100%; transition: transform var(--motion) cubic-bezier(.22,.9,.2,1); }
.screen {
  width: 20%; height: 100%; overflow-y: auto; overscroll-behavior: contain;
  padding: var(--top) 18px calc(106px + var(--dock));
  transition: transform var(--motion) ease, opacity var(--motion) ease;
}
.screen.with-keypad { padding-bottom: 440px; } /* lets the last sets scroll above the keypad */

.quotes-bg {
  position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; opacity: .05;
  font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: 54px; line-height: .95;
  text-transform: uppercase; padding: 60px 10px; word-break: break-word;
}

/* ---------- tab bar ---------- */

.tabbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 40; padding: 8px 14px var(--dock); background: var(--bg); }
.tabbar-inner { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); height: 64px; border-radius: var(--r-card); background: var(--s1); border: 1px solid var(--line); }
.tab-ind { position: absolute; bottom: 7px; left: 0; width: 20%; display: flex; justify-content: center; transition: transform var(--motion) cubic-bezier(.3,1.4,.4,1); pointer-events: none; }
.tab-ind i { display: block; height: 3px; border-radius: 3px; background: var(--ink); transition: width var(--motion) ease; }
.tab { border: 0; padding: 0; background: none; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .35s cubic-bezier(.3,1.8,.4,1), color .25s; }
.tab-pill { min-width: 48px; height: 38px; padding: 0 10px; border-radius: var(--r-ctl); background: var(--ink); color: var(--bg); display: flex; align-items: center; justify-content: center; gap: 5px; font: 500 var(--fs-xs)/1 var(--num); }
.tab-ring { width: 28px; height: 28px; border-radius: 50%; padding: 2px; border: 2px solid transparent; transition: border-color .25s; }
.tab-avatar { width: 100%; height: 100%; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 500 10px/1 var(--text); color: var(--on-volt); }

/* ---------- home ---------- */

.brand { display: flex; align-items: center; gap: 10px; margin-top: 10px; min-width: 0; }
.brand-name { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: min(var(--fs-xl), 7.4vw); } /* fits 360 px phones */
.streak { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--s1); border: 1px solid var(--line); cursor: pointer; flex: none; }
.streak svg { color: var(--acc); }

.quote-text { font: 500 var(--fs-m)/1.35 var(--text); margin-top: 8px; text-wrap: pretty; }

.next-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.next-top > div:first-child { min-width: 0; }
.pill { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; background: var(--s2); font: 500 var(--fs-xs)/1 var(--num); white-space: nowrap; }
.next-actions { display: flex; gap: 8px; margin-top: 16px; }

.cal-label { margin: 12px 0 8px; }
.cal-month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-dow { text-align: center; font: 500 var(--fs-xs)/1 var(--text); color: var(--mute); padding-bottom: 2px; }
.cal-day {
  aspect-ratio: 1; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font: 400 var(--fs-xs)/1 var(--num); background: var(--s2); color: var(--mute); outline-offset: -2px;
}
.cal-day.on { background: var(--volt); color: var(--on-volt); font-weight: 500; }
.cal-day.future { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--mute); opacity: .55; }
.cal-day.blank { background: transparent; }
.cal-day.today { outline: 2px solid var(--ink); }
.cal-year { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; }
.cal-year i { aspect-ratio: 1; border-radius: 1.5px; background: var(--s2); }
.cal-year i.on { background: var(--volt); }
.cal-year i.future { background: transparent; }

button.cal-day { border: 0; cursor: pointer; padding: 0; }
button.cal-day:active { transform: scale(.92); }

/* This week, Monday to Sunday. */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wk-day {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0 9px; border: 0; border-radius: 12px;
  background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); color: var(--mute); cursor: default;
}
.wk-day.on { background: var(--volt); color: var(--on-volt); box-shadow: none; cursor: pointer; }
.wk-day.today { box-shadow: inset 0 0 0 2px var(--ink); }
.wk-day.on.today { box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 4px var(--volt); }
.wk-day.future { opacity: .55; }
.wk-day:disabled { opacity: 1; }
.wk-day.future:disabled { opacity: .55; }
.wk-dow { font: 500 10px/1 var(--text); letter-spacing: .06em; text-transform: uppercase; }
.wk-n { font: 500 var(--fs-s)/1 var(--num); color: var(--ink); }
.wk-day.on .wk-n { color: var(--on-volt); }

.tile { text-align: left; padding: 16px; border-radius: var(--r-card); background: var(--s1); border: 1px solid var(--line); cursor: pointer; display: flex; flex-direction: column; gap: 10px; color: var(--ink); }
.tile .unit { font: 400 var(--fs-xs)/1 var(--text); color: var(--mute); }

/* ---------- body ---------- */

.figure-card { position: relative; border-radius: var(--r-card); background: var(--s1); border: 1px solid var(--line); padding: 16px 0 14px; overflow: hidden; }
.overall { position: absolute; top: 14px; left: 14px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.overall-rank { display: flex; align-items: center; gap: 8px; animation: pop .45s ease; }
.overall-rank .name { font: 500 var(--fs-m)/1.1 var(--text); }
.bw { position: absolute; top: 14px; right: 14px; text-align: right; z-index: 2; border: 0; padding: 0; background: none; color: var(--ink); cursor: pointer; }
.callout-dot { width: 14px; height: 14px; border-radius: 50%; margin: 0 6px; flex: none; }
.rec-line { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: var(--r-ctl); background: var(--s2); }
.rec-line > i { width: 10px; height: 10px; border-radius: 50%; margin-top: 3px; flex: none; }
.ex-row-btns { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
/* Muscle map (src/ui/MuscleFigure.js): muscles in rank colours, growing with rank. */
/* No `perspective` on the box itself: it would put the label into the figure's 3D
   space, where phones (Safari) draw the turning figure over it. The turn gets
   its perspective in its own transform, and the label stays flat on top. */
.mfig { position: relative; height: 368px; margin-top: 58px; }
.mfig-turn { width: 210px; height: 368px; margin: 0 auto; transition: transform .5s cubic-bezier(.3,1.3,.4,1); }
.mfig-svg { display: block; overflow: visible; }
.mfig-muscle { cursor: pointer; transition: opacity .25s, fill .3s; }
.mfig-off { pointer-events: none; }
.mfig-fade { transition: opacity .25s; }
/* Rank label of the selected muscle, centred just above it. */
.callout {
  position: absolute; z-index: 5; left: 50%; transform: translate3d(-50%, 0, 0);
  display: flex; align-items: center; gap: 10px; white-space: nowrap;
  padding: 7px 7px 7px 12px; border: 1px solid transparent; border-radius: 14px;
  background: rgb(38 42 49 / .94); box-shadow: 0 6px 18px rgb(0 0 0 / .35);
  text-align: left; cursor: pointer; animation: fade .2s ease; transition: top .25s ease, border-color .25s;
}
.callout-text { display: flex; flex-direction: column; gap: 3px; }
.callout-name { font: 500 var(--fs-xs)/1.2 var(--text); color: #F2F4F1; }
.callout-rank { font-family: var(--display); font-weight: 800; font-stretch: 125%; text-transform: uppercase; font-size: var(--fs-xs); line-height: 1.1; }
.tier-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px; padding: 10px 14px 0; }
.tier-legend > div { display: flex; align-items: center; gap: 5px; font: 400 var(--fs-xs)/1.2 var(--text); color: var(--mute); }
.tier-legend i { width: 8px; height: 8px; border-radius: 2px; }
.hint { text-align: center; padding: 0 20px; }

.muscle-card { animation: rise .3s ease; }
.mc-head { display: flex; align-items: flex-start; gap: 12px; }
.mc-tier { font: 500 var(--fs-s)/1.3 var(--text); margin-top: 4px; }
.ex-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.ex-swatch { width: 6px; height: 34px; border-radius: 3px; flex: none; }

.legend { margin-top: 14px; }
.legend .meter { margin-top: 6px; }

/* ---------- workout ---------- */

.plan { display: flex; align-items: center; gap: 12px; padding: 14px 12px 14px 16px; border-radius: var(--r-card); background: var(--s1); border: 1px solid var(--line); }
.plan-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag { font: 500 10px/1 var(--text); letter-spacing: .06em; text-transform: uppercase; color: var(--mute); padding: 4px 8px; border-radius: 999px; background: var(--s2); }
.tool { text-align: left; padding: 16px; border-radius: var(--r-card); background: var(--s1); border: 1px solid var(--line); cursor: pointer; display: flex; flex-direction: column; gap: 6px; color: var(--ink); }
.hist { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.hist-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 2px 0; border: 0; background: none; color: var(--ink); text-align: left; cursor: pointer; }
.hist-date { width: 44px; text-align: center; flex: none; }

.live { display: flex; align-items: center; gap: 6px; font: 500 var(--fs-xs)/1.3 var(--text); letter-spacing: .06em; color: var(--mute); white-space: nowrap; }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.stat { padding: 12px; border-radius: var(--r-card); background: var(--s1); border: 1px solid var(--line); }

.rest { position: relative; overflow: hidden; display: flex; align-items: center; gap: 8px; padding: 10px 10px 12px 16px; border-radius: var(--r-card); background: var(--s1); border: 1px solid var(--line); animation: rise .3s ease; }
.rest-bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--ink); transition: width 1s linear; }

.ex-card { padding: 14px; }
.ex-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ex-sub { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.set-grid { display: grid; grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, .8fr) 44px; gap: 6px; align-items: center; }
.set-labels { margin-top: 12px; padding-bottom: 6px; font: 500 10px/1 var(--text); letter-spacing: .06em; color: var(--mute); }
.set-row { padding: 6px 0; border-top: 1px solid var(--line); transition: opacity .2s; }
.set-row.done { opacity: .62; }
.set-row.pair { border-top-style: dashed; } /* right side of the same set */
.set-n.warm-n { color: var(--warn-text); font-weight: 500; }
.set-warm { font: 400 10px/1.2 var(--text); color: var(--mute); text-align: center; }
.ex-hint { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: var(--s2); font: 400 var(--fs-xs)/1.35 var(--text); color: var(--ink); }
.ex-hint.up { color: var(--acc); }
.ex-hint svg { flex: none; }
.ex-note { display: block; width: 100%; margin-top: 8px; padding: 0 0 0 10px; border: 0; border-left: 2px solid var(--line); background: none; color: var(--mute); font: 400 var(--fs-xs)/1.4 var(--text); text-align: left; cursor: pointer; white-space: pre-wrap; }
.tag.warn-tag { color: var(--warn-text); border: 0; cursor: pointer; }
.set-n, .set-prev { font: 400 var(--fs-xs)/1.2 var(--num); color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-f { height: 44px; min-width: 0; padding: 0 2px; border-radius: var(--r-ctl); border: 0; background: var(--s2); color: var(--ink); font: 500 var(--fs-s)/1 var(--num); cursor: pointer; }
.set-f.progress { color: var(--acc); }
.set-f.editing { box-shadow: inset 0 0 0 2px var(--ink); }
.set-done { height: 44px; border-radius: var(--r-ctl); border: 0; background: var(--s2); color: var(--mute); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.set-done.done { color: var(--acc); }
.set-actions { display: flex; gap: 8px; margin-top: 10px; }

/* ---------- progress ---------- */

.kpi { padding: 12px; border-radius: var(--r-card); background: var(--s1); border: 1px solid var(--line); min-width: 0; }
.trend-up { color: var(--acc); }
.trend-down { color: var(--warn-text); }
.bars { display: flex; align-items: flex-end; gap: 5px; height: 124px; margin-top: 14px; }
.bar-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.bar-t { font: 400 10px/1 var(--num); color: var(--mute); }
.bar { width: 100%; border-radius: 4px; background: var(--s2); transition: height .6s cubic-bezier(.3,1.2,.4,1); }
.bar.current { background: var(--ink); }
.bars-axis { display: flex; justify-content: space-between; margin-top: 6px; }
.chips { display: flex; gap: 6px; overflow-x: auto; margin: 12px -16px 0; padding: 0 16px 2px; }
.ex-stats { display: flex; gap: 18px; margin-top: 16px; }
.chart { position: relative; height: 130px; margin-top: 14px; }
.chart svg { display: block; overflow: visible; }
.chart-area { fill: var(--acc); opacity: .1; }
.chart-line { fill: none; stroke: var(--acc); stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.chart-max { position: absolute; left: 0; top: 0; }
.chart-min { position: absolute; left: 0; bottom: 0; }
.sess-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font: 400 var(--fs-xs)/1.3 var(--num); }
.ms-row { display: grid; grid-template-columns: 100px 1fr 36px; align-items: center; gap: 8px; margin-top: 10px; }
.cmp-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); margin-top: 6px; }
.cmp-d { min-width: 54px; text-align: right; }

/* ---------- profile ---------- */

.profile-head { display: flex; align-items: center; gap: 14px; padding: 8px 2px 0; }
.avatar-fig { display: flex; align-items: center; justify-content: center; width: 104px; height: 96px; border-radius: var(--r-card); background: var(--s1); border: 2px solid; overflow: hidden; flex: none; }
.mini-fig { display: flex; gap: 2px; }
.mini-fig .mfig-svg { overflow: visible; }
.level-card { display: block; width: 100%; text-align: left; color: var(--ink); cursor: pointer; font: inherit; }
.swatch.none { box-shadow: inset 0 0 0 2px var(--line); background-image: linear-gradient(135deg, transparent 46%, var(--mute) 46% 54%, transparent 54%) !important; }
.theme.locked .theme-preview, .theme.locked .t { opacity: .55; }
.theme-foot .p svg { vertical-align: -1px; }
.file-btn { cursor: pointer; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.name-input { width: 100%; padding: 0; border: 0; outline: 0; background: none; color: var(--ink); font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: var(--fs-l); line-height: 1.15; text-transform: uppercase; }
.tier-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; font: 500 var(--fs-s)/1.2 var(--text); }

.badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 8px; margin-top: 14px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer; color: var(--ink); }
.badge-tile { width: 52px; height: 52px; border-radius: var(--r-ctl); background: var(--s2); display: flex; align-items: center; justify-content: center; font: 500 var(--fs-s)/1 var(--num); color: var(--mute); }
.badge.ok .badge-tile { color: var(--acc); box-shadow: inset 0 0 0 1px var(--acc); }
.badge-name { font: 400 var(--fs-xs)/1.25 var(--text); text-align: center; color: var(--mute); }
.badge.ok .badge-name { color: var(--ink); }

.av-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.av-opts { display: flex; gap: 8px; }
.swatch { width: 36px; height: 36px; padding: 0; border-radius: 12px; border: 2px solid transparent; cursor: pointer; }
.swatch.on { border-color: var(--ink); }

.themes { display: flex; gap: 10px; overflow-x: auto; margin: 14px -16px 0; padding: 0 16px 4px; }
.theme { flex: none; width: 108px; padding: 0; border-radius: var(--r-card); border: 2px solid; cursor: pointer; overflow: hidden; text-align: left; }
.theme-preview { height: 62px; padding: 10px; display: flex; flex-direction: column; justify-content: space-between; }
.theme-acc { width: 34px; height: 8px; border-radius: 4px; background: var(--volt); }
.theme-tiles { display: flex; gap: 4px; }
.theme-tiles i { flex: 1; height: 18px; border-radius: 6px; }
.theme-foot { padding: 8px 10px; }
.theme-foot .t { font: 500 var(--fs-xs)/1.2 var(--text); }
.theme-foot .p { font: 400 10px/1.2 var(--num); margin-top: 3px; opacity: .75; }

.card.settings { padding: 4px 16px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; color: var(--ink); }
.setting.toggle { cursor: pointer; }
.card.settings > .setting:last-child { border-bottom: 0; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper .v { min-width: 56px; text-align: center; }
.switch { width: 48px; height: 28px; border-radius: 999px; padding: 3px; background: var(--s2); transition: background .25s; flex: none; }
.switch i { display: block; width: 22px; height: 22px; border-radius: 50%; background: var(--mute); transition: transform .3s cubic-bezier(.3,1.5,.4,1), background .25s; }
.switch.on { background: var(--ink); }
.switch.on i { transform: translateX(20px); background: var(--bg); }
.footer-note { text-align: center; padding: 0 10px; }

/* ---------- toast ---------- */

.toast-wrap { position: absolute; top: calc(var(--top) - 4px); left: 16px; right: 16px; z-index: 80; display: flex; justify-content: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-ctl); background: var(--s1); color: var(--ink); border: 1px solid var(--line); font: 500 var(--fs-s)/1.35 var(--text); animation: tick .3s ease; }
.toast.err { background: var(--err); color: var(--on-volt); border-color: var(--err); }

/* ---------- keypad ---------- */

.keypad {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 45;
  padding: 14px 14px calc(24px + env(safe-area-inset-bottom, 0px));
  background: var(--s1); border-top: 1px solid var(--line); border-radius: var(--r-card) var(--r-card) 0 0;
  animation: rise .25s ease;
}
.kp-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 4px 12px; }
.kp-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kp-key { height: 52px; border: 0; border-radius: var(--r-ctl); background: var(--s2); color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.kp-key.num { font: 500 var(--fs-l)/1 var(--num); }
.kp-key.fn { font: 500 var(--fs-xs)/1.2 var(--text); padding: 0 4px; }
.kp-key.fn.n { font: 500 var(--fs-s)/1 var(--num); }
.kp-key.hi { background: var(--ink); color: var(--bg); font: 500 var(--fs-s)/1 var(--text); }
.kp-key:disabled { cursor: default; }
.kp-key:active:not(:disabled) { transform: scale(.95); }
.keypad .btn.primary { margin-top: 8px; min-height: 52px; }

/* ---------- bottom sheet ---------- */

.sheet-backdrop { position: absolute; inset: 0; z-index: 50; background: rgb(0 0 0 / .6); animation: fade .2s ease; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 51; max-height: 86%;
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  padding: 10px 18px calc(28px + env(safe-area-inset-bottom, 0px));
  background: var(--bg); border-top: 1px solid var(--line); border-radius: var(--r-card) var(--r-card) 0 0;
  animation: rise .3s cubic-bezier(.2,.9,.3,1);
}
.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.actions { display: flex; gap: 8px; }

.pick-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 2px; border: 0; border-bottom: 1px solid var(--line); background: none; cursor: pointer; text-align: left; color: var(--ink); }
.pick-row .plus { color: var(--mute); }

.sm-stat { padding: 12px; border-radius: var(--r-card); background: var(--s1); border: 1px solid var(--line); }
.sm-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }

.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; align-items: center; }
.wheel-box { position: relative; height: 220px; border-radius: var(--r-card); background: var(--s1); border: 1px solid var(--line); overflow: hidden; }
.wheel-band { position: absolute; left: 8px; right: 8px; top: 87px; height: 44px; border-radius: 12px; background: var(--s2); pointer-events: none; }
.wheel { position: relative; height: 218px; overflow-y: auto; scroll-snap-type: y mandatory; padding: 87px 0; }
.wheel:focus-visible { outline-offset: -2px; }
.wheel-item { height: 44px; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; font: 400 var(--fs-xs)/1 var(--num); color: var(--mute); transition: font-size .15s, color .15s; }
.wheel-item.near { font-size: var(--fs-s); }
.wheel-item.on { font-size: var(--fs-l); font-weight: 500; color: var(--ink); }
.wheel-unit { position: absolute; right: 12px; top: 100px; pointer-events: none; }
.reps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.reps .chip { min-height: 38px; }

.path { display: flex; flex-direction: column; gap: 16px; padding: 22px 0 6px; }
.path-row { display: flex; align-items: center; gap: 14px; }
.path-row.alt { flex-direction: row-reverse; }
.path-text { flex: 1; text-align: left; }
.path-row.alt .path-text { text-align: right; }
.node { width: 64px; height: 64px; flex: none; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--s1); color: var(--mute); cursor: default; display: flex; align-items: center; justify-content: center; font: 500 var(--fs-m)/1 var(--num); }
.node.next { background: var(--ink); color: var(--bg); border-color: var(--ink); cursor: pointer; }
.node.done { color: var(--acc); cursor: pointer; }

.lesson-head { display: flex; align-items: center; gap: 10px; }
.lesson-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--s1); overflow: hidden; }
.lesson-bar i { display: block; height: 100%; border-radius: inherit; background: var(--acc); transition: width .4s; }
.question { font: 500 var(--fs-l)/1.25 var(--text); margin-top: 24px; text-wrap: pretty; }
.answers { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.answer { min-height: 54px; padding: 12px 16px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--s1); color: var(--ink); font: 400 var(--fs-s)/1.35 var(--text); text-align: left; cursor: pointer; }
.answer.correct { border-color: var(--acc); color: var(--acc); box-shadow: inset 0 0 0 1px var(--acc); }
.answer.wrong { border-color: var(--err); box-shadow: inset 0 0 0 1px var(--err); animation: shake .3s ease; }
.feedback { margin-top: 16px; padding: 14px 16px; border-radius: var(--r-card); background: var(--s1); border: 1px solid var(--line); animation: rise .25s ease; }
.lesson-end { text-align: center; padding: 30px 0 10px; animation: pop .45s ease; }

.choice-row { display: flex; gap: 6px; margin-top: 8px; }
.choice-row .chip { flex: 1; justify-content: center; min-height: 44px; padding: 0 8px; }
.field-label { margin-top: 16px; }

.paste-text { height: 160px; margin-top: 12px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
.paste-select { height: 44px; padding: 0 10px; font: 400 var(--fs-xs)/1 var(--text); min-width: 0; }
.paste-select.missing { border-color: var(--err); }
.imp-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px; gap: 6px; margin-top: 12px; }
.imp-raw { grid-column: 1 / -1; }
.plan-name { height: 48px; padding: 0 14px; font: 500 var(--fs-m)/1.2 var(--text); }
.seg.block { display: flex; }
.seg.block button { flex: 1; min-height: 40px; }

/* ---------- rank badge & reveal ---------- */

.reveal {
  position: absolute; inset: 0; z-index: 90; background: rgb(13 15 18 / .96);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden; color: #F2F4F1; text-align: center;
}
.reveal .eyebrow, .reveal .cap { color: #8B929C; }
.reveal-fx { position: absolute; inset: 0; pointer-events: none; }
.particle { position: absolute; }
.reveal-badge { display: flex; flex-direction: column; align-items: center; margin: 22px 0 6px; }
.reveal-tier { margin-top: 22px; }
.reveal-sub { margin-top: 10px; padding: 0 40px; color: #8B929C; }
.reveal-close { position: absolute; bottom: calc(40px + env(safe-area-inset-bottom, 0px)); color: #8B929C; }

/* ---------- sign-in, first launch ---------- */

.splash { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; animation: fade .4s ease; }
.page {
  position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: var(--top) 18px calc(28px + env(safe-area-inset-bottom, 0px));
}
.auth-screen {
  position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 12px;
  padding: calc(var(--top) + 24px) 22px calc(24px + env(safe-area-inset-bottom, 0px));
}
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; margin-bottom: 18px; }
.auth-brand .h1 { margin-top: 6px; }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form .field { height: 50px; padding: 0 14px; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.divider { display: flex; align-items: center; gap: 12px; margin: 4px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.motto { margin-top: auto; padding-top: 18px; text-align: center; }
label.eyebrow { display: block; }
.page input.field { height: 48px; padding: 0 14px; }
.field.num { font: 500 var(--fs-m)/1 var(--num); }

/* ---------- plans ---------- */

.weekly { display: flex; flex-wrap: wrap; gap: 6px; }
.weekly .pill { font: 400 var(--fs-xs)/1 var(--text); gap: 6px; }
.weekly .pill b { font: 500 var(--fs-xs)/1 var(--num); }
.pill.warn { color: var(--warn-text); }
.preview-session { padding: 12px 0; border-top: 1px solid var(--line); margin-top: 12px; }
.preview-ex { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.pe-n { font: 400 var(--fs-xs)/1.35 var(--text); color: var(--ink); }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--s2); color: var(--ink);
  text-align: left; cursor: pointer;
}
.opt.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.opt-t { display: block; font: 500 var(--fs-s)/1.25 var(--text); }
.opt-c { display: block; margin-top: 2px; font: 400 var(--fs-xs)/1.3 var(--text); color: var(--mute); }
.opt.on .opt-c { color: inherit; opacity: .7; }
.opt .tag { flex: none; }
.opt.on .tag { background: var(--bg); color: var(--ink); }
.screen-chips { margin: 0 -18px; padding: 0 18px 2px; }
.ex-rates { font: 400 var(--fs-xs)/1.4 var(--num); color: var(--mute); }
.plan-session { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); margin-top: 12px; }
.tag.on { background: var(--ink); color: var(--bg); }
.chip:disabled { opacity: .4; cursor: default; }
.sheet-chips { margin: 12px -18px 0; padding: 0 18px 2px; }

/* ---------- sheets: exercise menu, how-to, saved workout, plan editor ---------- */

.menu { display: flex; flex-direction: column; border-radius: var(--r-card); background: var(--s1); border: 1px solid var(--line); overflow: hidden; }
.menu-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: 500 var(--fs-s)/1.3 var(--text); text-align: left; cursor: pointer; }
.menu-row:last-child { border-bottom: 0; }
.menu-row > svg:last-child { color: var(--mute); }
.d-block { display: block; }
.note-text { min-height: 76px; padding: 10px 12px; resize: vertical; line-height: 1.4; }
.icon-btn.sm { width: 36px; height: 36px; }
.icon-btn:disabled { opacity: .35; cursor: default; }

.howto-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.howto-photos figure { margin: 0; }
.howto-photos img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; background: #fff; }
.howto-photos figcaption { margin-top: 4px; text-align: center; }
.howto-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; font: 400 var(--fs-s)/1.45 var(--text); }
.howto-steps li::marker { font: 500 var(--fs-xs)/1 var(--num); color: var(--acc); }
.howto-steps.en { font-size: var(--fs-xs); color: var(--mute); }

.sess-ex { padding: 12px 0; border-bottom: 1px solid var(--line); }
.sess-set { margin-top: 4px; color: var(--ink); }

.pe-session { padding: 12px; }
.pe-name { height: 40px; padding: 0 12px; font: 500 var(--fs-s)/1 var(--text); max-width: 230px; }
.pe-row { padding: 10px 0; border-top: 1px solid var(--line); margin-top: 10px; }
.pe-top { display: flex; align-items: flex-start; gap: 6px; }
.pe-ctrl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.pe-select { width: auto; height: 36px; padding: 0 8px; font: 400 var(--fs-xs)/1 var(--text); }
.mini-step { display: flex; align-items: center; height: 36px; border-radius: var(--r-ctl); background: var(--s2); }
.mini-step button { width: 32px; height: 36px; border: 0; background: none; color: var(--ink); font: 500 var(--fs-m)/1 var(--num); cursor: pointer; }
.mini-step span { min-width: 54px; text-align: center; font-size: var(--fs-xs); }
.pe-ctrl .chip { min-height: 36px; }

.quest { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.quest-check { width: 28px; height: 28px; flex: none; border-radius: 9px; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--on-volt); }
.quest.done .quest-check { background: var(--volt); border-color: var(--volt); animation: tick .3s ease; }

.xp-box { padding: 14px 16px; border-radius: var(--r-card); background: var(--s1); border: 1px solid var(--line); }
.reveal-share { position: absolute; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); background: #262A31; color: #F2F4F1; }

.bw-input { height: 48px; padding: 0 14px; }
.log-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.measure-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.measure-field { display: flex; flex-direction: column; gap: 6px; }
.measure-field .field { height: 44px; padding: 0 12px; }
.photo-full { display: block; width: 100%; max-height: 60vh; object-fit: contain; border-radius: var(--r-card); background: #000; }
.btn.danger-text { color: var(--err); }

.rec-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 0; border: 0; border-top: 1px solid var(--line); background: none; color: var(--ink); text-align: left; cursor: pointer; }
.card > .rec-row:first-of-type { margin-top: 8px; }
.rec-e1 { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.chart.small { height: 100px; margin-top: 10px; }

.photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.photo-add, .photo-thumb {
  position: relative; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; border: 0; padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.photo-add { background: var(--s2); color: var(--ink); }
.photo-thumb { background: var(--s2); }
.photo-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-thumb span { position: absolute; left: 4px; bottom: 4px; padding: 2px 4px; border-radius: 4px; background: rgb(0 0 0 / .55); color: #F2F4F1; }

.empty { padding: 4px 0; animation: fade .3s ease; }

/* Lists animate in gently. */
.sheet .sm-row, .sheet .quest, .sheet .rec-row { animation: rise .3s ease both; }

/* ---------- Premium wallpaper: photo behind the interface, glass surfaces ---------- */

.wall { position: absolute; inset: 0; z-index: 0; pointer-events: none; background: center / cover no-repeat; animation: fade .4s ease; }
.wall::after { content: ''; position: absolute; inset: 0; background: var(--wall-dim); transition: background .3s; }
:root[data-wall] :is(.card, .tile, .kpi, .stat, .figure-card, .tool, .rest, .streak, .xp-box, .sm-stat, .wk-day:not(.on)) {
  -webkit-backdrop-filter: blur(14px) saturate(1.15); backdrop-filter: blur(14px) saturate(1.15);
}
:root[data-wall] :is(.tabbar, .sheet, .keypad, .over-page, .toast:not(.err)) {
  background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(1.2); backdrop-filter: blur(22px) saturate(1.2);
}
/* Text that sits right on the photo gets a soft shadow so it stays readable. */
:root[data-wall][data-mode="dark"] :is(.screen-head, .section, .hint, .screen > .stack > .cap) { text-shadow: 0 1px 14px rgb(0 0 0 / .55); }
:root[data-wall][data-mode="light"] :is(.screen-head, .section, .hint, .screen > .stack > .cap) { text-shadow: 0 1px 14px rgb(255 255 255 / .7); }

.wall-tile { position: relative; }
.wall-preview { display: flex; align-items: center; justify-content: center; color: #F2F4F1; background: linear-gradient(135deg, #3A1C71, #D76D77 55%, #FFAF7B); }
.wall-controls { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- admin ---------- */

.admin-entry { display: block; width: 100%; text-align: left; color: var(--ink); cursor: pointer; font: inherit; box-shadow: inset 0 0 0 1px var(--acc); }
.uid-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: var(--r-ctl); background: var(--s2); }
.uid { margin-top: 4px; word-break: break-all; -webkit-user-select: text; user-select: text; color: var(--ink); }
.over-page {
  position: absolute; inset: 0; z-index: 60; overflow-y: auto; overscroll-behavior: contain; background: var(--bg);
  padding: var(--top) 18px calc(28px + env(safe-area-inset-bottom, 0px)); animation: rise .25s ease;
}
.user-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.user-name { font: 500 var(--fs-s)/1.3 var(--text); }
.user-roles { display: flex; flex-direction: column; gap: 6px; flex: none; }
.user-roles .chip { min-width: 92px; justify-content: center; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* "Zasady SBL" survey */
.choice-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.choice-wrap .chip { min-height: 38px; white-space: normal; text-align: left; line-height: 1.25; padding: 8px 14px; }
.survey-extra { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }

/* ---------- plan rating ---------- */

.rate-back { padding-top: 0; }
.muscle-pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.muscle-pick .pe-select { max-width: 62%; }
.en-name { font-style: italic; }
.tool.tool-wide { flex-direction: row; align-items: center; gap: 12px; width: 100%; }
.tool.tool-wide > svg { color: var(--mute); }
.score-card { padding: 18px 16px; }
.score-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.score-big { font: 500 72px/0.95 var(--num); letter-spacing: -0.02em; }
.score-of { font: 500 var(--fs-m)/1 var(--num); color: var(--mute); }
.score-delta { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.score-delta .chip-progress { padding: 6px 12px; font: 500 var(--fs-s)/1 var(--num); }
.score-line { font: 500 var(--fs-m)/1.35 var(--text); text-wrap: pretty; }
.fix-item { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.card > h2 + .fix-item { margin-top: 10px; }
.fix-n { width: 28px; height: 28px; flex: none; border-radius: 9px; background: var(--s2); display: flex; align-items: center; justify-content: center; font: 500 var(--fs-s)/1 var(--num); }
.fix-title { font: 500 var(--fs-s)/1.3 var(--text); }
.change-row { padding: 9px 0; border-top: 1px solid var(--line); font: 400 var(--fs-xs)/1.4 var(--text); }
.card > h2 + .change-row { margin-top: 10px; }
.cat-row { padding: 12px 0; border-top: 1px solid var(--line); }
.card > h2 + .cat-row { margin-top: 10px; }
.meter.ink > i { background: var(--ink); }
.rate-ms { width: 100%; border: 0; background: none; color: var(--ink); padding: 0; font: inherit; text-align: left; cursor: pointer; }

/* ---------- phones: full screen instead of the device frame ---------- */

@media (max-width: 520px) {
  .stage { padding: 0; }
  .device {
    width: 100%; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; box-shadow: none;
    --top: calc(env(safe-area-inset-top, 0px) + 14px);
    --dock: calc(env(safe-area-inset-bottom, 0px) + 10px);
  }
  .statusbar { display: none; }
}

/* iOS zooms into inputs smaller than 16px. */
@media (pointer: coarse) {
  .field, .search, .paste-text, .paste-select { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
