:root {
  --bg: #F2F2EC; --card: #FFFFFF; --card2: #E8E8E0; --ink: #141412; --mute: #66665F; --line: #DCDCD2;
  --acc: #C6F432; --on-acc: #121410; --acc-ink: #3D5C00;
  --c-styrka: #C6F432; --c-kond: #FF9F2E; --c-rorl: #5AB0FF;
  --work: #C6F432; --rest: #5AB0FF; --prep: #FF9F2E; --danger: #D23A2A;
  --r: 18px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E0E0C; --card: #1A1A17; --card2: #25251F; --ink: #F2F2E9; --mute: #9C9C92; --line: #2C2C27;
    --acc-ink: #C6F432; --danger: #FF6B5A;
  }
}
:root[data-theme="dark"] {
  --bg: #0E0E0C; --card: #1A1A17; --card2: #25251F; --ink: #F2F2E9; --mute: #9C9C92; --line: #2C2C27;
  --acc-ink: #C6F432; --danger: #FF6B5A;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .3s, color .3s;
}
#app {
  max-width: 560px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 20px) 16px calc(env(safe-area-inset-bottom, 0px) + 96px);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-stretch: 72%; font-weight: 850; text-transform: uppercase; letter-spacing: .005em; line-height: .95; margin: 0; }
.grow { flex: 1; min-width: 0; }

/* Rubriker */
.top h1 { font-size: 64px; font-weight: 900; }
.top h1 span { display: inline-block; background: var(--acc); color: var(--on-acc); padding: 0 .12em; margin-left: .08em; transform: rotate(-2deg); }
.top.small h1 { font-size: 48px; }
.sub { color: var(--mute); margin: 10px 0 18px; }
.back { display: inline-block; color: var(--mute); font-weight: 600; margin-bottom: 14px; padding: 4px 0; }

/* Statistik */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 18px; }
.stats > div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.stats b { display: block; font-size: 28px; font-weight: 850; font-stretch: 75%; line-height: 1; font-variant-numeric: tabular-nums; }
.stats span { display: block; color: var(--mute); font-size: 12px; line-height: 1.25; margin-top: 6px; }

/* Chips */
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 16px; padding: 0 16px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 14px; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Passkort */
.cards { display: grid; gap: 12px; }
.card { position: relative; display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 16px 14px 20px; overflow: hidden; transition: transform .15s; }
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--c); }
.card:active { transform: scale(.985); }
.card h2 { font-size: 30px; margin: 10px 0 6px; }
.card p { margin: 0; color: var(--mute); font-size: 15px; }
.card-top { display: flex; align-items: center; gap: 6px; }
.card-top .meta { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.tag { background: var(--c, var(--acc)); color: var(--on-acc); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 6px; }
.tag.home { background: var(--card2); color: var(--ink); }
.tag.plain { background: var(--card2); color: var(--ink); }
.card-foot { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--mute); font-weight: 600; }

/* Pågående pass */
.resume { display: flex; align-items: center; gap: 12px; background: var(--acc); color: var(--on-acc); border-radius: var(--r); padding: 14px 16px; margin-bottom: 14px; }
.resume small { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; opacity: .75; }
.resume b { font-size: 18px; }
.resume .go { margin-left: auto; font-weight: 800; }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--on-acc); animation: pulse 1.4s infinite; flex: none; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }

/* Detaljsidor */
.detail { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 14px; }
.detail h1 { font-size: 44px; margin: 12px 0 10px; }
.detail p { margin: 0; color: var(--mute); }
.facts { display: flex; gap: 24px; margin-top: 16px; }
.facts b { display: block; font-size: 22px; font-stretch: 80%; font-weight: 800; }
.facts span { color: var(--mute); font-size: 13px; }
.summary { margin-top: 12px !important; font-weight: 600; color: var(--ink) !important; font-size: 14px; }

.rows { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.row b { display: block; font-weight: 700; }
.row small { color: var(--mute); font-size: 13px; }
.num { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--card2); font-weight: 800; font-size: 14px; }
.last { font-size: 12px; font-weight: 700; color: var(--acc-ink); white-space: nowrap; }
.chev { color: var(--mute); font-size: 22px; }

.sticky { position: sticky; bottom: calc(env(safe-area-inset-bottom, 0px) + 78px); margin-top: 16px; }

.search { width: 100%; font: inherit; background: var(--card); border: 1px solid var(--line); color: var(--ink); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.search:focus { outline: 2px solid var(--acc); outline-offset: 1px; }

.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 12px; }
.box h3 { font-size: 20px; margin-bottom: 10px; }
.tips { margin: 0; padding-left: 20px; }
.tips li { margin: 4px 0; }
.tips li::marker { color: var(--acc-ink); }
.big-num { font-size: 34px; font-weight: 850; font-stretch: 75%; margin: 0; }
.hist { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.hist:first-of-type { border-top: 0; }
.hist span:first-child { font-weight: 600; }
.hist span:last-child { color: var(--mute); text-align: right; }
.link { display: block; padding: 6px 0; font-weight: 700; color: var(--acc-ink); }
.empty { color: var(--mute); text-align: center; padding: 30px 10px; }

/* Knappar */
.btn { display: block; width: 100%; border: 0; border-radius: 16px; background: var(--acc); color: var(--on-acc); padding: 16px; font-weight: 850; font-stretch: 85%; text-transform: uppercase; letter-spacing: .03em; text-align: center; font-size: 18px; transition: transform .1s; }
.btn:active { transform: scale(.98); }
.btn.big { padding: 19px; font-size: 20px; }
.btn.alt { background: var(--ink); color: var(--bg); }
.btn.soft { background: var(--card2); color: var(--ink); font-size: 16px; padding: 14px; }
.ghost { background: none; border: 0; color: var(--mute); font-weight: 600; padding: 10px 4px; text-decoration: underline; text-underline-offset: 3px; }
.ghost.danger { color: var(--danger); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 12px; }

/* Körläge */
body.running .nav { display: none; }
body.running #app { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); }
.run { display: flex; flex-direction: column; min-height: calc(100dvh - 60px); }
.run-top { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.icon { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--card2); font-size: 16px; flex: none; }
.bar { flex: 1; height: 8px; background: var(--card2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--acc); border-radius: 99px; transition: width .4s; }
.kicker { text-transform: uppercase; letter-spacing: .08em; font-weight: 700; font-size: 13px; color: var(--mute); margin: 0 0 8px; }
.ex-name { font-size: clamp(40px, 12vw, 60px); margin: 0 0 10px; overflow-wrap: anywhere; }
.setno { font-size: 20px; margin: 0; }
.setno b { font-size: 28px; font-weight: 900; }
.target { color: var(--mute); font-size: 16px; }
.hint { color: var(--mute); margin: 6px 0 0; font-size: 15px; }
.bigtime { font-size: clamp(72px, 24vw, 120px); font-weight: 850; font-stretch: 70%; line-height: 1; font-variant-numeric: tabular-nums; text-align: center; margin: 20px 0; }
.bigtime.huge { font-size: clamp(110px, 40vw, 200px); margin: 8px 0 12px; }
.inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 22px 0 16px; }
.run > .stepper { margin-bottom: 14px; }
.stepper { display: block; }
.stepper > span { display: block; font-size: 13px; font-weight: 700; color: var(--mute); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.stepper > div { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.stepper button { width: 48px; border: 0; background: var(--card2); font-size: 22px; font-weight: 700; }
.stepper input { flex: 1; min-width: 0; width: 100%; border: 0; background: none; color: var(--ink); text-align: center; font: inherit; font-size: 26px; font-weight: 800; padding: 10px 0; font-variant-numeric: tabular-nums; }
.stepper input:focus { outline: none; background: var(--card2); }
.tech { margin-top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.tech summary { font-weight: 700; cursor: pointer; }
.tech p { color: var(--mute); margin: 10px 0 8px; }
.upnext { color: var(--mute); margin: 14px 0 0; }
.run-foot { display: flex; justify-content: space-between; margin-top: auto; padding-top: 18px; }
.next { text-align: center; font-size: 18px; margin: 4px 0 0; }
.run .next b { font-weight: 800; }

.ring { position: relative; width: min(72vw, 280px); aspect-ratio: 1; margin: 10px auto 18px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; }
.ring .trk { stroke: var(--card2); }
.ring #arc { stroke: var(--rest); stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.ring .bigtime { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; font-size: clamp(64px, 20vw, 96px); }

/* Intervallfaser färgar hela skärmen */
body[data-phase="work"] { background: var(--work); color: var(--on-acc); }
body[data-phase="rest"] { background: var(--rest); color: var(--on-acc); }
body[data-phase="prep"] { background: var(--prep); color: var(--on-acc); }
body[data-phase] .kicker, body[data-phase] .hint, body[data-phase] .ghost, body[data-phase] .setno { color: inherit; opacity: .8; }
body[data-phase] .icon, body[data-phase] .btn.soft, body[data-phase] .bar { background: rgba(0, 0, 0, .12); color: inherit; }
body[data-phase] .bar i { background: var(--on-acc); }
.ivl { text-align: center; }
.ivl .kicker.phase { font-size: 22px; font-weight: 900; font-stretch: 75%; letter-spacing: .1em; opacity: 1; margin-top: 10px; }

/* Klart */
.done { text-align: center; padding: 30px 0 8px; }
.done h1 { font-size: 60px; }
.medal { font-size: 64px; line-height: 1; margin-bottom: 12px; animation: pop .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { from { transform: scale(0); } }
.done .stats { margin-top: 18px; }

/* Logg */
.logitem { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; margin-bottom: 8px; }
.logitem summary { display: flex; align-items: center; gap: 12px; padding: 12px 0; list-style: none; cursor: pointer; }
.logitem summary::-webkit-details-marker { display: none; }
.logitem summary b { display: block; }
.logitem summary small { color: var(--mute); font-size: 13px; }
.logitem[open] .chev { transform: rotate(90deg); }
.logitem .ghost { margin: 4px 0 8px; }

/* Timer */
.timerbox { padding: 6px 16px 12px; margin-bottom: 16px; }
.trow { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.trow > span { font-weight: 700; font-size: 18px; }
.trow > div { display: flex; align-items: center; gap: 12px; }
.trow b { min-width: 72px; text-align: center; font-size: 28px; font-weight: 850; font-stretch: 75%; font-variant-numeric: tabular-nums; }
.trow button { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--card2); font-size: 22px; font-weight: 700; }

/* Bottenmeny */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center; gap: 4px;
  padding: 8px 8px calc(env(safe-area-inset-bottom, 0px) + 8px);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.nav a { flex: 1; max-width: 130px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; color: var(--mute); padding: 6px 0; border-radius: 12px; }
.nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.nav a.on { color: var(--ink); }
.nav a.on svg { stroke: var(--acc-ink); }

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

/* Streckfigurer */
.fig { display: block; width: 100%; height: auto; overflow: hidden; }
.figcard .fig { max-height: 250px; }
.fig .body { fill: none; stroke: currentColor; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.fig .body.far { opacity: .38; }
.fig .head { fill: currentColor; stroke: none; }
.fig .floor { stroke: var(--line); stroke-width: 2; stroke-linecap: round; }
.fig .eq { fill: none; stroke: var(--mute); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.fig .eq.thin { stroke-width: 2; }
.fig .cable { stroke: var(--mute); stroke-width: 1.3; stroke-dasharray: 3 2; }
.fig .plate { fill: var(--card); stroke: var(--mute); stroke-width: 3; }
.fig .hub { fill: var(--mute); }
.fig .w { fill: var(--mute); stroke: none; }
.fig .box { fill: var(--card2); stroke: var(--line); stroke-width: 1; }
body[data-phase] .fig .floor, body[data-phase] .fig .eq, body[data-phase] .fig .cable { stroke: currentColor; opacity: .45; }
body[data-phase] .fig .w, body[data-phase] .fig .hub { fill: currentColor; opacity: .5; }

/* Muskelgrupper */
.sect { font-size: 22px; margin: 22px 0 10px; }
.groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.groups.mini { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.gtile { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px 12px; transition: transform .15s; }
.gtile:active { transform: scale(.97); }
.gtile .fig { margin: 0 0 6px; height: 64px; }
.groups.mini .gtile .fig { height: 40px; }
.gtile b { font-stretch: 75%; font-weight: 850; text-transform: uppercase; font-size: 20px; line-height: 1; }
.gtile small { color: var(--mute); font-size: 13px; margin-top: 4px; }
.groups.mini .gtile { padding: 6px 6px 8px; border-radius: 12px; align-items: center; text-align: center; }
.groups.mini .gtile b { font-size: 14px; }
.ghead { display: grid; grid-template-columns: 44% 1fr; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px 12px 8px; }
.ghead h1 { font-size: 44px; }
.ghead p { color: var(--mute); margin: 8px 0 0; font-size: 15px; }
.exrow { padding: 6px 12px 6px 6px; }
.thumb { width: 74px; height: 54px; flex: none; display: grid; place-items: center; background: var(--card2); border-radius: 10px; padding: 2px 4px; }
.thumb .fig { max-height: 50px; }
.thumb .fig .floor { stroke: var(--mute); opacity: .3; }

/* Övningsanimation */
.figcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px 4px; margin-bottom: 12px; }
.howto { margin: 0; }
.runfig { max-width: 300px; width: 78%; margin: 10px auto 0; }
.runfig.small { max-width: 220px; width: 60%; margin: 0 auto 6px; }

/* Konto & feedback */
.form { display: grid; gap: 14px; }
.form .chips { margin: 0; padding: 0; }
.form label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--mute); text-transform: uppercase; letter-spacing: .05em; }
.form input:not([type=checkbox]), .form textarea { font: inherit; font-size: 16px; text-transform: none; letter-spacing: 0; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; width: 100%; resize: vertical; }
.form input:focus, .form textarea:focus { outline: 2px solid var(--acc); outline-offset: 1px; }
.form label.check { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 14px; }
.form code { background: var(--card2); padding: 1px 6px; border-radius: 6px; color: var(--ink); }
.err { color: var(--danger); margin: 0; font-weight: 600; }
.ok { color: var(--acc-ink); margin: 0; font-weight: 700; }
.fbitem { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; }
.fbitem.st-ny { border-left-color: var(--c-kond); }
.fbitem.st-pågår { border-left-color: var(--c-rorl); }
.fbitem.st-klar { border-left-color: var(--acc); }
.fbhead { display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; }
.fbhead .status { color: var(--mute); }
.fbitem p { margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.fbitem small { color: var(--mute); font-size: 12px; }
.reply { margin-top: 8px; padding: 8px 10px; background: var(--card2); border-radius: 10px; font-size: 14px; white-space: pre-wrap; }

/* Underkategorier i flöde */
.flow { display: flex; align-items: center; gap: 6px; overflow-x: auto; margin: 14px -16px 0; padding: 0 16px 4px; scrollbar-width: none; }
.flow::-webkit-scrollbar { display: none; }
.flow a { flex: none; display: flex; align-items: center; gap: 7px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px 6px 6px; font-weight: 700; font-size: 14px; }
.flow a span, .subnum { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--acc); color: var(--on-acc); font-size: 13px; font-weight: 800; font-stretch: 100%; }
.flow a small { color: var(--mute); font-weight: 600; }
.flow i { color: var(--mute); font-style: normal; flex: none; }
.subsec { scroll-margin-top: 16px; }
.subsec .sect { display: flex; align-items: center; gap: 10px; }
.subnum { width: 28px; height: 28px; font-size: 15px; }
.gtile small + small { margin-top: 2px; }

/* Förslag från förra passet */
.lastbox { margin: 12px 0 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.lastbox > span { font-size: 12px; font-weight: 700; color: var(--mute); text-transform: uppercase; letter-spacing: .05em; }
.lastsets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.lastsets b { font-size: 14px; font-weight: 600; background: var(--card2); border-radius: 8px; padding: 3px 8px; font-variant-numeric: tabular-nums; }
.lastsets b.cur { background: var(--acc); color: var(--on-acc); font-weight: 800; }
.sugg { margin-top: 8px; width: 100%; text-align: left; border: 1px dashed var(--acc-ink); background: none; border-radius: 10px; padding: 8px 10px; font-weight: 700; font-size: 14px; color: var(--acc-ink); }

/* Logg-flikar */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--card2); border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.seg a { text-align: center; padding: 9px 4px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--mute); }
.seg a.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.link.inline { display: inline; padding: 0; }
.sub.small, .empty.small { font-size: 14px; }

/* Kalender */
.cal { padding: 12px; }
.calhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; text-align: center; }
.calhead b { display: block; font-size: 20px; font-stretch: 80%; font-weight: 850; text-transform: capitalize; }
.calhead small { color: var(--mute); font-size: 13px; }
.calgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calgrid.wk span { text-align: center; font-size: 12px; font-weight: 700; color: var(--mute); padding-bottom: 2px; }
.day { aspect-ratio: 1; border: 0; background: none; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-variant-numeric: tabular-nums; font-size: 15px; padding: 0; }
.day.has { background: var(--card2); font-weight: 800; }
.day.today span { outline: 2px solid var(--acc-ink); outline-offset: 2px; border-radius: 6px; padding: 0 3px; }
.day.sel { background: var(--ink); color: var(--bg); }
.day em { display: flex; gap: 2px; height: 6px; }
.day em i, .callegend i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.callegend { display: flex; gap: 14px; justify-content: center; margin-top: 10px; font-size: 12px; color: var(--mute); }
.callegend span { display: flex; align-items: center; gap: 5px; }

/* Framsteg */
.prow { gap: 10px; }
.spark { width: 80px; height: 28px; flex: none; }
.spark polyline { fill: none; stroke: var(--acc-ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: var(--acc-ink); }
.chg { min-width: 58px; text-align: right; font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--mute); }
.chg.up { color: var(--acc-ink); }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--mute); font-size: 11px; font-family: inherit; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke: var(--acc-ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--acc-ink); stroke: var(--card); stroke-width: 2; }
.chart .cross { stroke: var(--mute); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hot { fill: var(--acc-ink); stroke: var(--card); stroke-width: 2; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .tip { position: absolute; transform: translate(-50%, calc(-100% - 12px)); background: var(--ink); color: var(--bg); border-radius: 10px; padding: 6px 10px; font-size: 12px; white-space: nowrap; pointer-events: none; text-align: center; }
.chart .tip b { display: block; font-size: 15px; }
.prbox { border-color: var(--acc-ink); }
.prbox .hist span:last-child { color: var(--ink); font-weight: 700; }
.hist span:first-child { flex: none; }
.hist span:last-child { min-width: 0; overflow-wrap: anywhere; }

/* Egna pass */
.newcard { display: grid; gap: 6px; border-style: dashed; border-width: 2px; background: none; text-align: center; padding: 20px 16px; }
.newcard::before { display: none; }
.newcard b { font-size: 20px; font-stretch: 80%; font-weight: 850; text-transform: uppercase; color: var(--acc-ink); }
.newcard small { color: var(--mute); }
.passtools { display: flex; gap: 8px; margin-top: 14px; }
.passtools .btn { flex: 1; font-size: 15px; padding: 12px; }
.seg.two { grid-template-columns: 1fr 1fr; margin: 0; }
.seg button { border: 0; background: none; text-align: center; padding: 9px 4px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--mute); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.ivlset .trow:last-child { border-bottom: 0; }
.ivlset .trow > span { font-size: 16px; }
.ivlset .trow b { font-size: 22px; min-width: 64px; }
.blist { display: grid; gap: 8px; }
.brow { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px; }
.brow .grow > b { display: block; margin: 2px 0 6px; }
.brow .grow > small { color: var(--mute); }
.bctl { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mini { display: inline-flex; align-items: center; background: var(--card2); border-radius: 10px; }
.mini button { width: 30px; height: 34px; border: 0; background: none; font-size: 18px; font-weight: 700; }
.mini em { font-style: normal; font-weight: 800; min-width: 34px; text-align: center; line-height: 1.05; font-variant-numeric: tabular-nums; }
.mini em small { display: block; font-size: 10px; font-weight: 600; color: var(--mute); }
.repin { display: inline-flex; align-items: center; background: var(--card2); border-radius: 10px; height: 34px; overflow: hidden; }
.repin input { width: 52px; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 800; text-align: center; padding: 0 2px; }
.repin select { border: 0; background: none; color: var(--mute); font: inherit; font-size: 13px; font-weight: 600; padding: 0 4px 0 0; }
.bmove { display: flex; flex-direction: column; gap: 2px; }
.bmove button { width: 30px; height: 26px; border: 0; border-radius: 8px; background: var(--card2); font-size: 13px; }
.bmove button:disabled { opacity: .3; }
.addex { margin-top: 10px; }
.bfoot { position: sticky; bottom: calc(env(safe-area-inset-bottom, 0px) + 74px); display: flex; align-items: center; gap: 12px; margin-top: 16px; background: var(--ink); color: var(--bg); border-radius: 16px; padding: 10px 10px 10px 16px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.bfoot #best { flex: 1; }
.bfoot #best b { display: block; font-size: 22px; font-stretch: 80%; font-weight: 850; }
.bfoot #best small { opacity: .75; font-size: 13px; }
.bfoot .btn { width: auto; padding: 12px 18px; font-size: 16px; }
body.noscroll { overflow: hidden; }
.picker { position: fixed; inset: 0; z-index: 30; background: var(--bg); display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 0; max-width: 560px; margin: 0 auto; }
.pickhead { display: flex; gap: 8px; margin-bottom: 10px; }
.pickhead input { flex: 1; font: inherit; font-size: 16px; background: var(--card); border: 1px solid var(--line); color: var(--ink); border-radius: 12px; padding: 10px 12px; }
.pickhead .btn { width: auto; padding: 10px 18px; font-size: 16px; }
.picker .chips { margin-bottom: 6px; }
.pickinfo { margin: 0 0 8px; font-size: 13px; color: var(--mute); font-weight: 600; }
.picklist { flex: 1; overflow-y: auto; display: grid; gap: 6px; align-content: start; padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 20px); }
.pick { width: 100%; text-align: left; font: inherit; color: inherit; }
.pick .plus { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--card2); font-weight: 800; font-size: 16px; }
.pick.added .plus { background: var(--acc); color: var(--on-acc); font-size: 13px; }

/* Logga in-ruta i stället för statistik */
.logincard { display: flex; align-items: center; gap: 12px; background: var(--card); border: 2px solid var(--acc-ink); border-radius: var(--r); padding: 14px 16px; margin-bottom: 18px; }
.logincard b { display: block; font-size: 20px; font-stretch: 80%; font-weight: 850; text-transform: uppercase; }
.logincard small { color: var(--mute); font-size: 14px; }
.logincard .go { font-size: 22px; font-weight: 800; color: var(--acc-ink); }

/* Lägg till i eget pass */
.addto { padding: 0; overflow: hidden; }
.addto summary { padding: 14px 16px; font-weight: 800; cursor: pointer; list-style: none; color: var(--acc-ink); }
.addto summary::-webkit-details-marker { display: none; }
.addlist { display: grid; gap: 6px; padding: 0 12px 12px; }
.addlist .row { width: 100%; text-align: left; font: inherit; color: inherit; background: var(--bg); }
.addlist .plus { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--acc); color: var(--on-acc); font-weight: 800; }
.addlist .row.added { border-color: var(--acc-ink); }
.addlist .newrow { border-style: dashed; }

/* Missat pass */
.two-in { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rows > button.row { width: 100%; text-align: left; font: inherit; color: inherit; }
.retro h3 { font-size: 20px; margin-bottom: 8px; }
.rset { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.rset > span { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--card2); font-size: 12px; font-weight: 800; }
.rset label { display: flex; align-items: center; gap: 6px; background: var(--card2); border-radius: 10px; padding: 0 10px 0 4px; }
.rset input { width: 64px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 18px; font-weight: 800; text-align: center; padding: 8px 0; }
.rset small { color: var(--mute); font-size: 12px; font-weight: 600; }
.rbtns { display: flex; gap: 12px; }
#logg-add, .cal + .btn { margin-top: 4px; }

/* Brink Hero */
.nav a { max-width: 110px; font-size: 11px; }
.herobanner { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, #2a1d4a, #14121f); color: #fff; border-radius: var(--r); padding: 12px 16px; margin: 0 0 4px; }
.herobanner b { display: block; font-stretch: 80%; font-weight: 850; text-transform: uppercase; font-size: 18px; }
.herobanner small { opacity: .8; font-size: 13px; }
.hb-boss { font-size: 34px; animation: bob 2.4s ease-in-out infinite; }
.herobanner .go { font-size: 24px; }
.away { background: var(--card2); border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; font-size: 14px; }
.arena { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 6px; background: linear-gradient(180deg, #221a3d 0%, #3b2a5e 70%, #1b1530 70%); border-radius: var(--r); padding: 18px 12px 12px; min-height: 190px; overflow: hidden; color: #f2f2e9; }
.arena .hero { position: relative; color: #C6F432; }
.arena .hero .fig .floor, .arena .hero .fig .eq { stroke: rgba(255,255,255,.45); }
.arena .hero .fig .plate { fill: #221a3d; stroke: rgba(255,255,255,.6); }
.arena .hero.tier2 { color: #5AB0FF; filter: drop-shadow(0 0 6px rgba(90,176,255,.6)); }
.arena .hero.tier3 { color: #FFD23F; filter: drop-shadow(0 0 10px rgba(255,210,63,.7)); }
.arena .lvl { position: absolute; top: -6px; left: 0; background: #C6F432; color: #121410; font-weight: 800; font-size: 12px; border-radius: 8px; padding: 2px 7px; }
.arena .vs { font-size: 22px; padding-bottom: 40px; animation: pulse 1.2s infinite; }
.boss { display: grid; place-items: center; }
.bemoji { font-size: 84px; line-height: 1; animation: bob 2.4s ease-in-out infinite; filter: drop-shadow(0 6px 0 rgba(0,0,0,.35)); }
.boss.hit .bemoji { animation: shake .35s; }
@keyframes bob { 50% { transform: translateY(-8px); } }
@keyframes shake { 20% { transform: translateX(-8px) rotate(-6deg); } 40% { transform: translateX(8px) rotate(6deg); } 60% { transform: translateX(-5px); } 80% { transform: translateX(4px); } }
#floats { position: absolute; inset: 0; pointer-events: none; }
.float { position: absolute; top: 40%; font-weight: 800; font-size: 14px; color: #ffd6d6; animation: rise 1.6s ease-out forwards; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.float.big { font-size: 28px; color: #FF6B5A; font-stretch: 75%; }
@keyframes rise { to { transform: translateY(-70px); opacity: 0; } }
.bossbox { margin-top: 12px; }
.bossname { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.bossname b { font-size: 22px; font-stretch: 80%; font-weight: 850; text-transform: uppercase; }
.hpbar, .xpbar { height: 12px; background: var(--card2); border-radius: 99px; overflow: hidden; }
.hpbar i { display: block; height: 100%; background: linear-gradient(90deg, #D23A2A, #FF6B5A); border-radius: 99px; transition: width .5s; }
.xpbar i { display: block; height: 100%; background: var(--acc); border-radius: 99px; }
.hpnum { display: flex; justify-content: space-between; font-size: 13px; color: var(--mute); margin: 6px 0 8px; font-variant-numeric: tabular-nums; }
.hpnum b { color: var(--ink); }
.attack { margin-top: 10px; animation: glow 1.6s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 6px rgba(198,244,50,.35); } }
.herohead { display: flex; justify-content: space-between; align-items: end; margin-bottom: 6px; }
.herohead b { font-size: 26px; font-stretch: 75%; font-weight: 900; text-transform: uppercase; display: block; line-height: 1; }
.herohead small { color: var(--mute); }
.herohead > span { font-size: 13px; color: var(--mute); font-variant-numeric: tabular-nums; }
.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 6px; }
.stat { background: var(--card2); border-radius: 12px; padding: 8px 10px; }
.stat span { font-size: 13px; font-weight: 700; color: var(--mute); }
.stat b { display: block; font-size: 26px; font-stretch: 75%; font-weight: 900; line-height: 1.1; }
.sbar { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.sbar i { display: block; height: 100%; border-radius: 99px; }
.stat small { display: block; margin-top: 4px; font-size: 11px; color: var(--acc-ink); font-weight: 700; }
.trophies { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.trophies span { font-size: 28px; text-align: center; filter: grayscale(1) opacity(.25); }
.trophies span.won { filter: none; }
.killpop { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(0,0,0,.55); padding: 16px; }
.killpop > div { background: var(--card); border-radius: 22px; padding: 22px; text-align: center; max-width: 320px; width: 100%; animation: pop .4s cubic-bezier(.3, 1.6, .5, 1); }
.killpop span { font-size: 72px; display: block; filter: grayscale(.2); }
.killpop b { display: block; font-size: 26px; font-stretch: 75%; font-weight: 900; text-transform: uppercase; margin: 6px 0; }
.killpop small { display: block; color: var(--acc-ink); font-weight: 700; margin-bottom: 14px; }
.attackcta { margin-bottom: 10px; }
.arena .hero .fig { height: 150px; }
