/* Stil enligt designen från Claude Design: grå bas, blått sken, stålblå accent, Instrument Sans */
:root {
  --bg: #33363b;
  --sheet: #3b3e44;
  --text: #e7e9ec;
  --muted: #b3b8be;
  --muted-2: #a4a9b0;
  --line: #9ba0a7;
  --dark: #17181a;
  --accent: #3f74b4;
  --accent-press: #35689f;
  --on-accent: #f0f3f6;
  --soft: rgba(231, 233, 236, 0.07);
  --soft-2: rgba(231, 233, 236, 0.12);
  --red: #c4392c;
  --glow: rgba(120, 158, 210, 0.26);
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Instrument Sans', -apple-system, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; touch-action: manipulation; text-align: inherit; padding: 0; }
button:disabled { cursor: default; }
svg { display: block; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 16px) 24px calc(env(safe-area-inset-bottom) + 32px);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
#app.with-tabs { padding-bottom: calc(env(safe-area-inset-bottom) + 96px); }

/* ---------- Knappar ---------- */
.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 52px; border-radius: 26px;
  font-weight: 500; font-size: 16px;
  transition: transform 140ms cubic-bezier(0.2, 0, 0, 1), background-color 140ms ease;
}
.btn:active { transform: scale(0.985); }
.btn--primary { height: 56px; border-radius: 28px; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 17px; }
.btn--primary:active { background: var(--accent-press); }
.btn--primary:disabled { background: rgba(63, 116, 180, 0.4); color: rgba(240, 243, 246, 0.6); transform: none; }
.btn--soft { background: var(--soft); }
.btn--soft:active { background: var(--soft-2); }
.btn--text { height: 44px; color: var(--muted); font-size: 15px; }
.btn--sm { height: 42px; border-radius: 21px; font-size: 15px; }
.btn--link { color: var(--muted); font-size: 15px; font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.btn--link:active { color: var(--text); }

/* ---------- Idag ---------- */
.head { display: flex; justify-content: space-between; align-items: baseline; padding-top: 10px; }
.head__date { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.head__week { font-size: 15px; color: var(--muted); }

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 18px -6px 0; }
.wk { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0 6px; }
.wk__d { font-size: 12px; font-weight: 500; color: var(--muted-2); }
.wk__n { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; font-weight: 600; transition: background-color 160ms ease; }
.wk__s { font-size: 12px; font-weight: 500; min-height: 17px; }
.wk__m { height: 14px; display: grid; place-items: center; }
.wk--today .wk__n { background: var(--accent); color: var(--on-accent); }
.wk--sel .wk__n { background: rgba(231, 233, 236, 0.16); }
.wk--rest .wk__n, .wk--rest .wk__s { color: var(--muted-2); }
.wk--missed .wk__s { color: var(--muted-2); text-decoration: line-through; }
.mark { width: 7px; height: 7px; border-radius: 50%; }
.mark--done { width: 14px; height: 14px; background: var(--accent); display: grid; place-items: center; }
.mark--done svg { width: 8px; height: 8px; }
.mark--done polyline, .title-check polyline, .list__check polyline { fill: none; stroke: var(--on-accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.mark--dark { background: var(--dark); }
.mark--next { background: var(--text); }
.mark--later { box-shadow: inset 0 0 0 1.3px var(--line); }

.kicker { margin-top: 34px; font-size: 16px; color: var(--muted); }
.title-row { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.title { font-size: 46px; font-weight: 600; line-height: 1.05; letter-spacing: -0.035em; }
.title--muted { color: var(--muted-2); }
.title-check { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; margin-top: 4px; flex: none; }
.title-check svg { width: 15px; height: 15px; }
.title-check polyline { stroke-width: 1.9; }
.title-missed { font-size: 15px; font-weight: 600; color: var(--muted); margin-top: 6px; }
.nextline { margin-top: 18px; font-size: 17px; font-weight: 600; }
.meta { display: flex; gap: 18px; margin-top: 10px; font-size: 15px; color: var(--muted); }
.meta b { font-weight: 600; color: var(--text); }

/* Kroppen */
.bodies { position: relative; height: var(--h); margin-top: 22px; display: flex; justify-content: center; align-items: flex-end; gap: 28px; }
.bodies__side { position: relative; height: var(--h); }
.glow { position: absolute; left: 50%; top: 50%; width: 560px; height: 520px; margin: -230px 0 0 -280px; background: radial-gradient(closest-side, var(--glow), rgba(120, 158, 210, 0.09) 55%, rgba(120, 158, 210, 0)); pointer-events: none; }
.bodies__labels { display: flex; justify-content: center; gap: 116px; margin-top: 10px; font-size: 12px; font-weight: 500; color: var(--muted-2); position: relative; }
.fig .hit { fill: transparent; cursor: pointer; }
.tip { position: absolute; pointer-events: none; z-index: 2; animation: pop 180ms cubic-bezier(0.2, 0, 0, 1); }
.tip__dot { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 3px rgba(23, 24, 26, 0.45); }
.tip__label { position: absolute; bottom: 12px; left: 0; transform: translateX(-50%); white-space: nowrap; background: #1f2125; color: var(--text); font-weight: 600; font-size: 13px; padding: 7px 11px; border-radius: 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); }
@keyframes pop { from { opacity: 0; transform: translateY(4px); } }

.actions { position: relative; display: flex; flex-direction: column; gap: 8px; margin-top: 28px; }

/* Flikar */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  display: flex; justify-content: center; gap: 8px;
  padding: 10px 24px calc(env(safe-area-inset-bottom) + 12px);
  background: linear-gradient(to top, var(--bg) 70%, rgba(51, 54, 59, 0));
}
.tab { height: 40px; padding: 0 20px; border-radius: 20px; font-size: 15px; font-weight: 500; color: var(--muted); }
.tab.is-on { background: rgba(231, 233, 236, 0.14); color: var(--text); font-weight: 600; }

/* ---------- Statistik ---------- */
.stats-head { display: flex; justify-content: space-between; align-items: center; padding-top: 6px; }
.page-title { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; }
.periods { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 16px -24px 0; padding: 0 24px; }
.periods::-webkit-scrollbar { display: none; }
.period { flex: none; height: 36px; padding: 0 14px; border-radius: 18px; color: var(--muted); font-size: 15px; font-weight: 500; }
.period.is-on { background: rgba(231, 233, 236, 0.14); color: var(--text); font-weight: 600; }
.range { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; margin-right: -12px; font-size: 16px; color: var(--muted); }
.range__nav { display: flex; }
.range__nav button { width: 44px; height: 44px; display: grid; place-items: center; }
.range__nav svg { width: 9px; height: 15px; }
.range__nav polyline { fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.range__nav button:disabled polyline { stroke: #5d6167; }

.hero { margin-top: 18px; }
.hero p:first-child { display: flex; align-items: baseline; gap: 10px; }
.hero__n { font-size: 60px; font-weight: 600; line-height: 1; letter-spacing: -0.04em; }
.hero__of { font-size: 20px; font-weight: 500; color: var(--muted); }
.segs { display: flex; gap: 3px; margin: 16px 0 10px; }
.seg { flex: 1; height: 8px; border-radius: 4px; }
.seg--done { background: var(--accent); }
.seg--missed { background: var(--dark); }
.seg--planned { box-shadow: inset 0 0 0 1.3px rgba(155, 160, 167, 0.7); }
.bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin: 16px 0 10px; background: var(--dark); }
.bar span { background: var(--accent); }

.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 36px; }
.trio b { display: block; font-size: 30px; font-weight: 600; letter-spacing: -0.03em; }
.trio span { display: block; font-size: 14px; color: var(--muted); margin-top: 4px; }
.note { margin-top: 10px; font-size: 13px; color: var(--muted-2); }
.h3 { margin-top: 48px; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.sub { margin-top: 6px; font-size: 15px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.mlist { position: relative; display: flex; flex-direction: column; gap: 2px; margin-top: 24px; }
.mrow { display: grid; grid-template-columns: 112px 1fr 40px; align-items: center; gap: 12px; height: 30px; font-size: 15px; }
.mrow__bar { height: 6px; border-radius: 3px; background: var(--red); }
.mrow b { text-align: right; font-weight: 600; }

.calwrap { margin-top: 48px; scroll-margin-top: 24px; }
.cal__head { display: flex; justify-content: space-between; align-items: baseline; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin-top: 24px; }
.cal__head:first-child { margin-top: 0; }
.cal__head .muted { font-size: 15px; font-weight: 400; letter-spacing: 0; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 16px -6px 0; }
.cal__wd { text-align: center; font-size: 12px; font-weight: 500; color: var(--muted-2); padding-bottom: 2px; }
.cal__cell { display: grid; place-items: center; }
.sq { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 15px; font-weight: 600; font-style: normal; color: var(--muted-2); }
.sq--done { background: var(--accent); color: var(--on-accent); }
.sq--missed { background: var(--dark); color: var(--text); }
.sq--planned { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--text); }
.sq--rest { box-shadow: inset 0 0 0 1px rgba(155, 160, 167, 0.35); }
.sq--none { color: #6e7379; }
.sq--today { outline: 2px solid var(--text); outline-offset: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 18px; font-size: 13px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 7px; }
.legend .sq { width: 14px; height: 14px; border-radius: 4px; }

/* ---------- Passkärmen ---------- */
.wtop { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 48px; }
.wtop > :first-child { justify-self: start; }
.wtop > :last-child { justify-self: end; }
.wtop__title { font-size: 17px; font-weight: 600; }
.workout { display: flex; flex-direction: column; gap: 16px; flex: 1; margin-top: 8px; }
.ex { display: flex; flex-direction: column; gap: 8px; }
.ex__name { font-size: 32px; font-weight: 600; line-height: 1.1; letter-spacing: -0.03em; }
.ex__muscles { font-size: 15px; color: var(--muted); }
.pips { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.pip { width: 22px; height: 6px; border-radius: 3px; background: rgba(231, 233, 236, 0.14); }
.pip.is-done { background: var(--accent); }
.pip.is-now { background: var(--text); }
.pips__label { margin-left: 8px; font-size: 14px; color: var(--muted); }
.history { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.history div { display: grid; grid-template-columns: 104px 1fr; gap: 12px; }
.history dt { color: var(--muted); font-size: 15px; }
.history dd { font-weight: 500; }
.formmode { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; color: var(--text); }
.ex__fig { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 190px; }
.ex__fig .bodies { margin-top: 0; gap: 20px; }
.ex__fig .glow { width: 400px; height: 360px; margin: -170px 0 0 -200px; }
.ex__fig .bodies__labels { gap: 72px; }

.weight { display: flex; flex-direction: column; gap: 8px; }
.weight label { color: var(--muted); font-size: 15px; }
.stepper { display: grid; grid-template-columns: 72px 1fr 72px; gap: 8px; }
.stepper button { height: 72px; border-radius: 22px; background: var(--soft); font-size: 30px; font-weight: 500; transition: transform 140ms cubic-bezier(0.2, 0, 0, 1), background-color 140ms ease; }
.stepper button:active { transform: scale(0.95); background: var(--soft-2); }
.stepper input, .stepper output {
  width: 100%; min-width: 0; text-align: center; font: inherit; font-size: 40px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--text); background: transparent; border: 0; border-bottom: 1.5px solid rgba(231, 233, 236, 0.18); border-radius: 0;
  display: flex; align-items: center; justify-content: center;
}
.stepper input:focus { outline: none; border-bottom-color: var(--accent); }
.stepper--sm { grid-template-columns: 52px 1fr 52px; }
.stepper--sm button { height: 52px; border-radius: 26px; font-size: 24px; }
.stepper--sm output { font-size: 24px; }
.hint { color: var(--muted-2); font-size: 13px; }
.btn--done { height: 64px; border-radius: 32px; font-size: 18px; }
.shake { animation: shake 300ms ease; border-bottom-color: var(--accent) !important; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.rest { display: flex; flex-direction: column; gap: 12px; padding-bottom: 4px; }
.rest__bar { height: 4px; background: rgba(231, 233, 236, 0.1); border-radius: 2px; overflow: hidden; }
.rest__bar div { height: 100%; background: var(--accent); transform-origin: left; transition: transform 250ms linear; }
.rest__row { display: flex; align-items: baseline; justify-content: space-between; }
.rest__label { font-size: 15px; color: var(--muted); }
.rest__time { font-size: 48px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.rest__btns { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 8px; }
.rest__msg { font-size: 15px; color: var(--muted); line-height: 1.45; }
.rest__msg strong { color: var(--text); font-weight: 600; }
.rest--done .rest__time, .rest--done .rest__label { color: #8fb3e0; }
.done-all { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }

/* Översikt: liten vilorad */
.rest-mini { font-size: 15px; color: var(--muted); }
.rest-mini span { color: var(--text); font-weight: 600; margin-left: 4px; }

/* Lugn topprad i fokus/logg */
.wtop--quiet { color: var(--muted); }
.wtop__sub { font-size: 15px; font-weight: 500; color: var(--muted); max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wtop__set { font-size: 15px; color: var(--muted); }

/* Runda −/+ */
.round { width: 64px; height: 64px; border-radius: 50%; background: var(--soft); font-size: 28px; font-weight: 400; display: grid; place-items: center; flex: none; transition: transform 140ms cubic-bezier(0.2, 0, 0, 1), background-color 140ms ease; }
.round:active { transform: scale(0.92); background: var(--soft-2); }

/* Fokusläge */
.focus { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 12px 0 8px; animation: calm 260ms ease; }
@keyframes calm { from { opacity: 0; transform: scale(0.985); } }
.focus__mid { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.focus__weight { display: flex; align-items: center; justify-content: center; gap: 18px; transition: opacity 200ms ease; }
.focus__weight.is-dim { opacity: 0.45; }
.focus__kg { display: flex; align-items: baseline; gap: 6px; }
.focus__kg input { width: 150px; background: transparent; border: 0; color: var(--text); font: inherit; font-size: 72px; font-weight: 600; letter-spacing: -0.04em; text-align: right; padding: 0; }
.focus__kg input:focus { outline: none; }
.focus__kg span { font-size: 22px; color: var(--muted); font-weight: 500; }
.focus__hint { font-size: 15px; color: var(--muted); }
.focus__msg { font-size: 15px; color: var(--muted); text-align: center; line-height: 1.45; max-width: 320px; text-wrap: pretty; }
.done-btn {
  width: 132px; height: 132px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
  font-size: 22px; font-weight: 600; letter-spacing: -0.01em; display: grid; place-items: center;
  box-shadow: 0 0 0 10px rgba(63, 116, 180, 0.14), 0 18px 40px rgba(0, 0, 0, 0.25);
  transition: transform 160ms cubic-bezier(0.2, 0, 0, 1), background-color 140ms ease; margin-bottom: 8px;
}
.done-btn:active { transform: scale(0.94); background: var(--accent-press); }

.rest--big { width: 100%; align-items: center; text-align: center; gap: 10px; }
.rest--big .rest__time { font-size: 88px; letter-spacing: -0.05em; }
.rest--big .rest__bar { width: 70%; }
.rest--big .rest__btns { width: 100%; margin-top: 6px; }

/* Loggskärm efter setet */
.log { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding-bottom: 8px; animation: calm 240ms ease; }
.log__rest { font-size: 15px; color: var(--muted); }
.log__rest span { color: var(--text); font-weight: 600; margin-left: 4px; }
.log__label { font-size: 16px; color: var(--muted); margin-top: 12px; }
.log__reps { display: flex; align-items: center; gap: 28px; }
.log__n { font-size: 112px; font-weight: 600; letter-spacing: -0.05em; line-height: 1; min-width: 120px; text-align: center; }
.log__w { font-size: 17px; color: var(--muted); }
.log__q { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; text-align: center; max-width: 320px; margin-bottom: 12px; }
.log__opts { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.log__two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn--xl { height: 64px; border-radius: 32px; font-size: 18px; }

/* Förra passet och viktskillnad i fokusläget */
.focus__prev { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.focus__prev span { font-size: 14px; color: var(--muted); }
.focus__prev b { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.focus__prev small { font-size: 13px; color: var(--muted-2); }
.focus__diff { font-size: 15px; color: var(--muted-2); min-height: 20px; }
.focus__diff.is-up { color: #8fb3e0; font-weight: 600; }
.focus__diff.is-down { color: var(--muted); font-weight: 600; }

/* Repsrad */
.rchips { display: flex; gap: 8px; justify-content: center; }
.rchip { width: 42px; height: 48px; border-radius: 16px; background: var(--soft); font-size: 18px; font-weight: 600; color: var(--muted); text-align: center; transition: transform 140ms cubic-bezier(0.2, 0, 0, 1), background-color 140ms ease; }
.rchip:active { transform: scale(0.92); }
.rchip.is-on { background: var(--text); color: var(--bg); }
.log__w .up { color: #8fb3e0; font-weight: 600; }
.log__w .down { color: var(--text); font-weight: 600; }
.log__ask { font-size: 17px; font-weight: 600; text-align: center; }
.log__chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chip--lg { height: 56px; border-radius: 28px; font-size: 16px; }

/* ---------- Passläge: mörkare, med svart toning och svagt blått ljus uppifrån ---------- */
body.in-workout {
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(120, 158, 210, 0.16), rgba(120, 158, 210, 0) 60%),
    linear-gradient(180deg, #24272b 0%, #1a1b1e 55%, #141517 100%);
  background-attachment: fixed;
}
body.in-workout #app { background: transparent; }
html:has(body.in-workout) { background: #141517; }
.btn--glass { background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.btn--glass:active { background: rgba(255, 255, 255, 0.1); }

/* Hjul */
.wheels { display: flex; gap: 12px; width: 100%; justify-content: center; transition: opacity 200ms ease; }
.wheels.is-dim { opacity: 0.55; }
.wheels__col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.wheels__col--kg { flex: 1.4; max-width: 190px; }
.wheels__col:not(.wheels__col--kg) { flex: 1; max-width: 140px; }
.wheels__unit { font-size: 13px; color: var(--muted-2); }
.wheel {
  position: relative; width: 100%; height: 132px; border-radius: 22px;
  background: rgba(0, 0, 0, 0.32); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.wheel__band { position: absolute; left: 8px; right: 8px; top: 44px; height: 44px; border-radius: 14px; background: rgba(255, 255, 255, 0.07); pointer-events: none; }
.wheel__list {
  position: relative; height: 100%; overflow-y: scroll; scroll-snap-type: y mandatory; scrollbar-width: none;
  padding: 44px 0; overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 34%, #000 66%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 34%, #000 66%, transparent 100%);
}
.wheel__list::-webkit-scrollbar { display: none; }
.wheel__item { height: 44px; display: grid; place-items: center; scroll-snap-align: center; font-size: 20px; font-weight: 500; color: var(--muted-2); cursor: pointer; transition: color 120ms ease, font-size 120ms ease; }
.wheel__item.is-sel { color: var(--text); font-weight: 600; }
.wheel--kg .wheel__item.is-sel { font-size: 30px; letter-spacing: -0.02em; }
.wheel--add .wheel__item { font-size: 15px; }
.wheel--add .wheel__item.is-sel { font-size: 17px; }
.wheel--reps { max-width: 200px; }
.wheel--reps .wheel__item.is-sel { font-size: 34px; letter-spacing: -0.02em; }
.type-kg { width: 100%; height: 132px; border-radius: 22px; border: 0; background: rgba(0, 0, 0, 0.32); color: var(--text); font: inherit; font-size: 44px; font-weight: 600; text-align: center; box-shadow: inset 0 0 0 1.5px var(--accent); }
.type-kg:focus { outline: none; }

/* Anteckningar */
.memo { font-size: 14px; color: #e9d9a8; }
.memo--big { font-size: 15px; padding: 10px 14px; border-radius: 14px; background: rgba(233, 217, 168, 0.08); align-self: flex-start; }
.log__links { display: flex; justify-content: center; gap: 24px; }
#log-note { width: 100%; font: inherit; font-size: 16px; padding: 12px 16px; border-radius: 18px; border: 0; background: rgba(0, 0, 0, 0.32); color: var(--text); resize: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
#log-note:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--accent); }

/* Backa */
.chev { width: 8px; height: 13px; }
.chev polyline { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wtop__title--btn { font-size: 17px; font-weight: 600; padding: 8px 4px; }

/* Pågående pass på startsidan */
.resume { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 14px 18px; margin-bottom: 8px; border-radius: 18px; background: rgba(63, 116, 180, 0.18); box-shadow: inset 0 0 0 1px rgba(63, 116, 180, 0.35); font-size: 15px; }
.resume b { font-weight: 600; }
.resume__go { font-weight: 600; color: #8fb3e0; }

/* Fokus: knappar under hjulen */
.wheels__btn { min-height: 32px; display: inline-flex; align-items: center; gap: 6px; }
.wheels__btn:active { color: var(--text); }
.info { width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; font-style: italic; box-shadow: inset 0 0 0 1.3px currentColor; }
.focus__links { display: flex; gap: 22px; }

/* Loggskärm: förra / nu */
.cmp { display: grid; gap: 6px; width: 100%; max-width: 300px; margin-top: 6px; }
.cmp div { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: baseline; }
.cmp dt { font-size: 14px; color: var(--muted-2); }
.cmp dd { font-size: 17px; font-weight: 600; }
.cmp .up { color: #8fb3e0; font-size: 14px; margin-left: 6px; }
.cmp .down { color: var(--muted); font-size: 14px; margin-left: 6px; }
.memo-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.log__memo { align-self: center; color: #e9d9a8; }
.log__note { font-size: 13px; color: var(--muted-2); text-align: center; }

/* Förslag vid för tungt */
.opt { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; min-height: 68px; padding: 12px 18px; border-radius: 22px; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); text-align: left; transition: transform 140ms cubic-bezier(0.2, 0, 0, 1), background-color 140ms ease; }
.opt:active { transform: scale(0.985); background: rgba(255, 255, 255, 0.1); }
.opt b { display: block; font-size: 16px; font-weight: 600; }
.opt small { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }
.opt em { font-style: normal; font-size: 14px; color: #8fb3e0; font-weight: 600; white-space: nowrap; }

/* Fokus-/vilorubrik: stor pil, tydligt övningsnamn och set */
.wtop--focus { grid-template-columns: 52px 1fr auto; gap: 8px; min-height: 56px; }
.iconbtn { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: var(--text); background: rgba(255, 255, 255, 0.06); }
.iconbtn:active { background: rgba(255, 255, 255, 0.12); }
.iconbtn .chev { width: 11px; height: 18px; }
.iconbtn .chev polyline { stroke-width: 2.2; }
.wtop__ex { font-size: 20px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wtop__setbig { font-size: 17px; font-weight: 600; color: var(--text); white-space: nowrap; }

/* Viloskärm */
.restv { flex: 1; display: flex; flex-direction: column; gap: 22px; padding: 8px 0 8px; animation: calm 240ms ease; }
.restv__timer { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 12px; }
.restv__label { font-size: 16px; color: var(--muted); }
.restv__time { font-size: 96px; font-weight: 600; letter-spacing: -0.05em; line-height: 1; }
.restv__timer .rest__bar { width: 70%; margin-top: 6px; }
.restv__timer.is-done .restv__time { color: #8fb3e0; }
.restv__timer.is-done .restv__label { color: var(--text); font-weight: 600; }
.restv > .btn { margin-top: auto; }
.rinfo { display: flex; flex-direction: column; gap: 16px; padding: 18px; border-radius: 22px; background: rgba(0, 0, 0, 0.28); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); }
.rinfo__row { display: flex; flex-direction: column; gap: 4px; }
.rinfo__row > span { font-size: 14px; color: var(--muted); }
.rinfo__row > b { font-size: 20px; font-weight: 600; }
.rinfo__msg { font-size: 15px; color: var(--muted); line-height: 1.45; border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 14px; }
.rinfo__title { font-size: 18px; font-weight: 600; }
.rinfo__prev { font-size: 14px; color: var(--muted); }
.rinfo__next { font-size: 15px; color: var(--muted); border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 14px; }
.rinfo__next b { color: var(--text); font-weight: 600; }
.rsum { display: flex; flex-direction: column; gap: 8px; }
.rsum__row { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 8px; font-size: 17px; font-weight: 500; }
.rsum__row .muted { font-size: 14px; }
.tr { font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tr--up { color: #8fb3e0; }
.tr--down { color: #d9a0a0; }
.memo-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.memo-chip { font-size: 13px; padding: 4px 10px; border-radius: 12px; background: rgba(233, 217, 168, 0.1); color: #e9d9a8; }

/* Lobby före setet */
.lobby__k { font-size: 34px; font-weight: 600; letter-spacing: -0.03em; }
.lobby__goal { font-size: 15px; color: var(--muted); text-align: center; max-width: 300px; line-height: 1.45; }
.lobby__plan { font-size: 15px; color: var(--muted-2); }
.lobby__plan b { color: var(--text); font-weight: 600; }

/* Loggskärm: vikt, tillägg och reps bredvid varandra */
.log { justify-content: flex-start; padding-top: 8px; }
.log__grid { display: flex; gap: 10px; width: 100%; justify-content: center; }
.log__grid .wheels__col { flex: 1; min-width: 0; max-width: 140px; }
.log__grid .wheels__col--kg { flex: 1.25; max-width: 150px; }
.log__grid .wheel--kg .wheel__item.is-sel { font-size: 26px; }
.log__grid .wheel--reps .wheel__item.is-sel { font-size: 28px; }
.log__tools { display: flex; gap: 22px; justify-content: center; }
.log .cmp { margin-top: 0; }
.log .log__opts { margin-top: auto; }

/* Info-ikon */
svg.info { width: 15px; height: 15px; box-shadow: none; }
svg.info circle:first-child { fill: none; stroke: currentColor; stroke-width: 1.3; }
svg.info line { stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
svg.info .dot { fill: currentColor; stroke: none; }

/* Stor ökning/minskning på viloskärmen */
.delta { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; color: var(--muted); text-align: center; }
.delta--up { color: #8fb3e0; }
.delta--down { color: #d9a0a0; }
.rinfo__row--now b { font-size: 24px; }
.restv__timer.is-done .restv__time { color: var(--text) !important; }

/* Sammanfattning */
.summary { display: flex; flex-direction: column; }
.summary .kicker { margin-top: 16px; }
/* Vikt | reps */
.st { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.vbar { display: inline-block; width: 1.5px; height: 1em; border-radius: 1px; background: rgba(231, 233, 236, 0.35); }
.sets { display: flex; flex-direction: column; gap: 4px; }
.sumsets { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.sumsets div { display: grid; grid-template-columns: 56px 1fr; align-items: center; font-size: 16px; font-weight: 500; }
.sumsets .muted { font-size: 14px; }

.sumlist { list-style: none; padding: 0; display: flex; flex-direction: column; margin-top: 24px; }
.sumlist li { display: flex; flex-direction: column; gap: 3px; padding: 16px 0; }
.sumlist li + li { border-top: 1px solid rgba(231, 233, 236, 0.1); }
.sumlist b { font-weight: 600; font-size: 17px; }
.sumlist small { color: var(--muted); font-size: 14px; }

/* ---------- Sheets ---------- */
#sheet { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
#sheet[hidden] { display: none; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(20, 21, 23, 0.55); animation: fade 200ms ease; }
.sheet__panel {
  position: relative; width: 100%; max-width: 480px; max-height: 90dvh; overflow-y: auto; scrollbar-width: none;
  background: var(--sheet); border-radius: 30px 30px 0 0;
  padding: 10px 24px calc(env(safe-area-inset-bottom) + 32px);
  display: flex; flex-direction: column; gap: 18px;
  animation: up 320ms cubic-bezier(0.32, 0.72, 0, 1);
}
.sheet__grip { width: 38px; height: 5px; border-radius: 3px; background: rgba(231, 233, 236, 0.22); align-self: center; flex: none; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
.sh-title { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; }
.sh-head { display: flex; flex-direction: column; gap: 4px; }
.sh-head .sh-title { font-size: 32px; }
.sh-head__row { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.sh-status { font-weight: 600; color: var(--muted); }
.sh-status.is-done { color: #8fb3e0; }
.sheet__rest { font-size: 15px; color: var(--muted); }
.sheet__rest strong { color: var(--text); }
.opts { display: flex; flex-direction: column; gap: 8px; }
.h4 { font-size: 20px; font-weight: 600; }
.reason { display: flex; flex-direction: column; gap: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 44px; padding: 0 18px; border-radius: 22px; background: rgba(231, 233, 236, 0.08); font-size: 15px; font-weight: 500; transition: background-color 140ms ease; }
.chip.is-on { background: var(--accent); color: var(--on-accent); }
.radios { display: flex; flex-direction: column; gap: 4px; }
.radio { display: flex; gap: 14px; align-items: flex-start; padding: 10px 0; text-align: left; }
.radio__dot { width: 22px; height: 22px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1.5px var(--line); transition: box-shadow 160ms ease; }
.radio.is-on .radio__dot { box-shadow: inset 0 0 0 7px var(--accent); }
.radio b { display: block; font-size: 16px; font-weight: 600; }
.radio small { display: block; font-size: 14px; color: var(--muted); line-height: 1.4; margin-top: 3px; }
.picklist { display: flex; flex-direction: column; gap: 4px; }
.pick { display: flex; justify-content: space-between; align-items: center; height: 56px; }
.pick span { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.pick small { font-size: 14px; color: var(--muted-2); }

.choices { display: flex; flex-direction: column; gap: 8px; }
.choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-height: 58px; padding: 14px 20px; border-radius: 22px; background: rgba(231, 233, 236, 0.08);
  font-weight: 600; text-align: left; transition: transform 140ms cubic-bezier(0.2, 0, 0, 1), background-color 140ms ease;
}
.choice:active { transform: scale(0.985); background: var(--soft-2); }
.choice small { font-weight: 400; color: var(--muted); font-size: 14px; }
.reps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rep { height: 58px; border-radius: 20px; background: rgba(231, 233, 236, 0.08); font-size: 22px; font-weight: 600; color: var(--muted-2); text-align: center; transition: transform 140ms cubic-bezier(0.2, 0, 0, 1), background-color 140ms ease; }
.rep--range { color: var(--text); }
.rep--prev { box-shadow: inset 0 0 0 2px var(--accent); }
.rep:active { transform: scale(0.94); background: var(--accent); color: var(--on-accent); }
.other { display: grid; grid-template-columns: 1fr 88px; gap: 8px; }
.other input, .field input {
  font: inherit; height: 52px; padding: 0 18px; border-radius: 26px; width: 100%;
  background: rgba(23, 24, 26, 0.35); color: var(--text); border: 1px solid transparent; color-scheme: dark;
}
.other input:focus, .field input:focus { outline: none; border-color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { color: var(--muted); font-size: 15px; }
.list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.list__row { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 12px; border-radius: 16px; }
.list__row.is-current { background: rgba(231, 233, 236, 0.08); }
.list__row.is-done .list__name { color: var(--muted-2); }
.list__check { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; }
.list__row.is-done .list__check { background: var(--accent); }
.list__check svg { width: 11px; height: 11px; }
.list__count { color: var(--muted); }
.list small { color: var(--muted-2); }

#toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 84px); transform: translateX(-50%); z-index: 50;
  width: min(432px, calc(100% - 48px)); background: #474a50; color: var(--text); border-radius: 18px; padding: 15px 18px;
  font-size: 15px; font-weight: 500; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3); animation: pop 200ms cubic-bezier(0.2, 0, 0, 1);
}
#toast[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Större text i passet (läsbart på armlängds avstånd) ---------- */
.calc { display: block; margin-top: 8px; font-size: 13px; color: var(--muted-2); line-height: 1.45; }
.focus__prev span { font-size: 17px; }
.focus__prev b { font-size: 30px; }
.focus__prev small, .memo { font-size: 16px; }
.lobby__k { font-size: 38px; }
.lobby__goal { font-size: 17px; }
.lobby__plan { font-size: 17px; }
.wheels__unit { font-size: 15px; }
.wheel__item { font-size: 22px; }
.wheel--add .wheel__item { font-size: 17px; }
.wheel--add .wheel__item.is-sel { font-size: 19px; }
.log__grid .wheel--kg .wheel__item.is-sel { font-size: 30px; }
.log__grid .wheel--reps .wheel__item.is-sel { font-size: 32px; }
.cmp dt { font-size: 15px; }
.cmp dd { font-size: 19px; }
.cmp .up, .cmp .down { font-size: 16px; }
.rinfo__row > span { font-size: 16px; }
.rinfo__row > b { font-size: 22px; }
.rinfo__row--now b { font-size: 26px; }
.rinfo__msg { font-size: 16px; }
.restv__label { font-size: 18px; }
.log__memo, .log__tools .btn--link, .focus__links .btn--link { font-size: 16px; }
.history dt { font-size: 16px; }
.history dd { font-size: 17px; }
.ex__muscles, .pips__label { font-size: 16px; }
.rsum__row { font-size: 19px; grid-template-columns: 60px 1fr auto; }
.rsum__row .muted { font-size: 15px; }
.tr { font-size: 15px; }
.rinfo__title { font-size: 20px; }
.rinfo__next { font-size: 17px; }
.opt--rec { box-shadow: inset 0 0 0 1.5px var(--accent); background: rgba(63, 116, 180, 0.12); }
.rec { display: block; font-style: normal; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; color: #8fb3e0; margin-bottom: 2px; }
.sumtags { display: flex !important; flex-wrap: wrap; gap: 6px; padding-left: 56px; margin-top: -2px; }
.tag { font-size: 13px; padding: 4px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.07); color: var(--muted); }

/* ---------- Hem ---------- */
.home-today .actions { margin-top: 20px; }
.facts { margin-top: 40px; display: flex; flex-direction: column; }
.facts__h { font-size: 15px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.fact { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; font-size: 16px; }
.fact > span { color: var(--muted); min-width: 0; }
.fact > b { font-weight: 600; text-align: right; white-space: nowrap; }
.fact small { display: block; font-size: 13px; font-weight: 500; color: var(--muted-2); margin-top: 2px; }
.facts__empty { font-size: 15px; color: var(--muted-2); padding: 9px 0; }
.home-edit { margin-top: 28px; align-self: center; width: auto; padding: 0 16px; }

/* Startsidan glider in efter hälsningen */
:root { --ease-out: cubic-bezier(0.23, 1, 0.32, 1); }
#app.enter > * { animation: homeIn 620ms var(--ease-out) both; }
#app.enter > :nth-child(2) { animation-delay: 50ms; }
#app.enter > :nth-child(3) { animation-delay: 100ms; }
#app.enter > :nth-child(4) { animation-delay: 150ms; }
#app.enter > :nth-child(5) { animation-delay: 200ms; }
#app.enter > :nth-child(6) { animation-delay: 250ms; }
#app.enter > :nth-child(n+7) { animation-delay: 300ms; }
#app.enter > .tabs { animation-name: fade; animation-delay: 250ms; }
@keyframes homeIn { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Välkomsthälsning ---------- */
#intro {
  position: fixed; inset: 0; z-index: 50; background: var(--bg); overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(env(safe-area-inset-top) + 24px) 32px calc(env(safe-area-inset-bottom) + 40px);
}
#intro[hidden] { display: none; }
#intro.is-out { animation: introOut 460ms var(--ease-out) forwards; pointer-events: none; }
@keyframes introOut { to { opacity: 0; transform: translateY(-10px); } }
.intro__glow {
  position: absolute; left: 50%; top: 44%; width: 560px; height: 560px; margin: -280px 0 0 -280px; pointer-events: none;
  background: radial-gradient(closest-side, var(--glow), rgba(120, 158, 210, 0.08) 55%, rgba(120, 158, 210, 0));
  animation: glowIn 1600ms var(--ease-out) both;
}
@keyframes glowIn { from { opacity: 0; transform: scale(0.9); } }
.hello { position: relative; width: 100%; max-width: 420px; margin: 0 auto; }
.hello__line { font-size: 22px; font-weight: 500; color: var(--muted); }
.hello__name { font-size: 42px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.1; margin-top: 6px; overflow-wrap: anywhere; }
.hello__ask { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; }
.w { display: inline-block; animation: wordIn 760ms var(--ease-out) both; animation-delay: calc(120ms + var(--i) * 70ms); }
.hello__name .w { animation-delay: calc(260ms + var(--i) * 80ms); }
@keyframes wordIn { from { opacity: 0; transform: translateY(10px); filter: blur(8px); } }
.hello--form { display: flex; flex-direction: column; gap: 22px; }
.hello--form > :not(h1) { animation: homeIn 620ms var(--ease-out) both; animation-delay: 300ms; }
.hello--form input { font-size: 17px; }

@media (prefers-reduced-motion: reduce) {
  .w, .intro__glow, #app.enter > *, .hello--form > * { animation-name: fade; animation-duration: 300ms; }
  #intro.is-out { animation-name: fadeOut; }
  @keyframes fadeOut { to { opacity: 0; } }
}
