/* Palette from the PRD (section 3). Pink only for active states and key numbers. */
:root {
  --bg: #050507;
  --card: #10181D;
  --border: #1E2A31;
  --pink: #F25CA8;
  --glow: #FF8FC7;
  --plum: #5A2A45;
  --slate: #3A4651;
  --text: #E6E1F0;
  --muted: #8C94A0;
  --r: 18px;
  --nav: 74px;
  --sb: env(safe-area-inset-bottom, 0px);
  --st: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif; font-size: 15px; line-height: 1.45; min-height: 100vh; overscroll-behavior-y: none; -webkit-font-smoothing: antialiased;
  background: radial-gradient(110% 50% at 50% 110%, rgba(90, 42, 69, .35), transparent 60%), var(--bg); background-attachment: fixed; }
body.locked { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; color: var(--text); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 26px; } h2 { font-size: 19px; } h3 { font-size: 15.5px; }
p { margin: 0; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#view { max-width: 560px; margin: 0 auto; padding: calc(18px + var(--st)) 16px calc(var(--nav) + var(--sb) + 28px); display: flex; flex-direction: column; gap: 14px; }

.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .tiny { font-size: 11.5px; } .center { text-align: center; }
.key { color: var(--pink); }
.tap { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.chev svg { width: 18px; height: 18px; color: var(--muted); }

.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.top-l { min-width: 0; } .top-r { display: flex; gap: 8px; flex: none; }
.moon { width: 28px; height: 28px; border-radius: 50%; box-shadow: inset -6px 3px 0 0 var(--glow); transform: rotate(-20deg); filter: drop-shadow(0 0 8px rgba(255, 143, 199, .45)); }
.back { display: inline-flex; align-items: center; gap: 2px; margin-bottom: 4px; padding: 0; }
.back svg { width: 18px; height: 18px; }

/* cards */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 14px; text-align: left; width: 100%; display: block; }
button.card { cursor: pointer; } button.card:active { transform: scale(.99); }
.card.dashed { background: transparent; border: 1.5px dashed var(--slate); color: var(--muted); text-align: center; padding: 15px; }
.card.sel { border-color: var(--pink); }
.card.row, .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card .row + .row, .card .row + .bar, .card .bar + .row, .card p + .row { margin-top: 10px; }
.card.inner { background: var(--bg); padding: 11px 12px; margin: 8px 0 4px; }
.card.inner svg { width: 18px; height: 18px; color: var(--muted); }
.row-main { flex: 1; display: flex; justify-content: space-between; align-items: center; background: none; border: 0; padding: 0; text-align: left; gap: 8px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.sec-head { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; gap: 10px; }

/* buttons */
.btn { border: 1px solid var(--border); background: var(--card); border-radius: 14px; padding: 12px 16px; font-weight: 600; font-size: 14.5px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--pink); border-color: var(--pink); color: #fff; box-shadow: 0 6px 22px rgba(242, 92, 168, .3); }
.btn:disabled { opacity: .4; box-shadow: none; }
.btn.small { padding: 8px 13px; font-size: 13.5px; border-radius: 12px; }
.btn.block { width: 100%; margin-top: 8px; }
.btn:active { transform: scale(.98); }
.link { background: none; border: 0; color: var(--glow); padding: 8px 0; font-size: 14px; }
.link.muted { color: var(--muted); } .link.danger, .danger { color: #ff7a9c; }
.sheet > .link.danger { display: block; margin: 6px auto 0; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); display: grid; place-items: center; flex: none; padding: 0; }
.icon-btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.icon-btn svg { width: 20px; height: 20px; }
.row-btns { display: flex; gap: 10px; margin-top: 10px; }
.row-btns .btn { flex: 1; }

/* chips & segmented */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
.sheet .chips { margin: 0 -18px; padding: 2px 18px; }
.chips::-webkit-scrollbar { display: none; }
.chip { white-space: nowrap; border: 1px solid var(--slate); background: transparent; border-radius: 999px; padding: 8px 14px; font-size: 13.5px; color: var(--muted); flex: none; }
.chip.on { background: var(--pink); border-color: var(--pink); color: #fff; }
.chip.ghost { border-style: dashed; }
.seg { display: flex; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 10px; padding: 9px 6px; font-size: 13.5px; color: var(--muted); }
.seg button.on { background: var(--plum); color: var(--text); box-shadow: inset 0 0 0 1px rgba(242, 92, 168, .5); }

/* switch */
.switch { position: relative; width: 48px; height: 28px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--slate); transition: .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--text); transition: .2s; }
.switch input:checked + span { background: var(--pink); box-shadow: 0 0 12px rgba(242, 92, 168, .45); }
.switch input:checked + span::after { transform: translateX(20px); background: #fff; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); }
.field input, .select, input[type=time], input[type=url] { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px; font-size: 16px; width: 100%; min-width: 0; }
.field input:focus, .select:focus, input[type=time]:focus { outline: none; border-color: var(--pink); }
.select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.with-unit { position: relative; } .with-unit span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }
.search { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 0 12px; }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { flex: 1; background: none; border: 0; padding: 12px 0; font-size: 16px; outline: none; min-width: 0; }
.hold-in { display: flex; gap: 8px; } .hold-in input { flex: 1; }
.sw-btn { width: 44px; flex: none; border-radius: 12px; border: 1px solid var(--slate); background: var(--bg); display: grid; place-items: center; color: var(--glow); padding: 0; }
.sw-btn svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.sw-btn.run { background: var(--plum); border-color: var(--pink); }
.bar { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.bar > div { height: 100%; background: var(--pink); border-radius: 99px; box-shadow: 0 0 10px var(--pink); transition: width .4s; }
.tag { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; padding: 3px 9px; border-radius: 99px; background: var(--pink); color: #fff; white-space: nowrap; }
.sheet > .tag { align-self: flex-start; }
.set-in input::placeholder { color: var(--slate); }
.tag.soft { background: var(--plum); color: var(--glow); }
.tag.dim { background: var(--border); color: var(--muted); }

.empty { text-align: center; color: var(--muted); padding: 30px 10px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.empty.small { padding: 16px; }
.blossom { width: 26px; height: 26px; stroke: none; fill: var(--pink); }
.blossom .core { fill: var(--glow); }
.blossom.big { width: 60px; height: 60px; filter: drop-shadow(0 0 14px rgba(242, 92, 168, .55)); }
.blossom.huge { width: 96px; height: 96px; filter: drop-shadow(0 0 22px rgba(242, 92, 168, .7)); }
.blossom.dim { fill: var(--slate); filter: none; } .blossom.dim .core { fill: var(--bg); }

/* nav */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: space-around; align-items: flex-end; padding: 8px 6px calc(8px + var(--sb)); background: rgba(5, 5, 7, .86); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--border); height: calc(var(--nav) + var(--sb)); }
.nav-btn { flex: 1; max-width: 100px; background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: var(--muted); padding: 4px 0; white-space: nowrap; }
.nav-btn .ni svg { width: 24px; height: 24px; display: block; }
.nav-btn.active { color: var(--pink); }
.nav-btn.center .ni { width: 56px; height: 56px; margin-top: -26px; border-radius: 50%; display: grid; place-items: center; background: var(--pink); color: #fff; box-shadow: 0 0 24px rgba(242, 92, 168, .6), 0 0 0 5px var(--bg); }
.nav-btn.center .ni svg { width: 26px; height: 26px; }
.nav-btn.center:not(.active) .ni { background: var(--plum); color: var(--glow); box-shadow: 0 0 16px rgba(242, 92, 168, .35), 0 0 0 5px var(--bg); }

/* workout */
.streak-card { display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; align-items: center; }
.streak-main { display: flex; align-items: center; gap: 12px; }
.streak-num { font-size: 30px; font-weight: 700; line-height: 1; }
.flame { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--bg); color: var(--slate); }
.flame svg { width: 22px; height: 22px; }
.flame.on { color: var(--pink); filter: drop-shadow(0 0 8px rgba(242, 92, 168, .6)); }
.streak-best { text-align: right; display: flex; flex-direction: column; }
.streak-best b { font-size: 20px; }
.week { grid-column: 1 / -1; display: flex; justify-content: space-between; }
.wk { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; color: var(--muted); border: 1px solid transparent; }
.wk.sch { border-color: var(--slate); color: var(--text); }
.wk.today { border-color: var(--pink); color: var(--pink); }
.ex { display: flex; align-items: center; gap: 8px; padding: 10px 6px 10px 4px; }
.grip { background: none; border: 0; color: var(--slate); padding: 8px 4px; touch-action: none; cursor: grab; }
.grip svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.ex-body { flex: 1; min-width: 0; cursor: pointer; }
.ex-body p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.ex-body b { color: var(--text); font-weight: 600; }
.drag-item.dragging { position: relative; z-index: 5; box-shadow: 0 12px 30px rgba(0, 0, 0, .6); border-color: var(--pink); transition: none; }
.drag-item { transition: transform .15s; }
.fab-space { height: 76px; }
.fab { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav) + var(--sb) + 14px); width: min(528px, calc(100% - 32px)); z-index: 5; padding: 15px; font-size: 16px; border-radius: 16px; }
.fab:active { transform: translateX(-50%) scale(.98); }

/* session */
#session { position: fixed; inset: 0; z-index: 20; background: var(--bg); display: flex; flex-direction: column; }
.s-top { display: flex; align-items: center; gap: 12px; padding: calc(12px + var(--st)) 16px 12px; max-width: 560px; width: 100%; margin: 0 auto; }
.s-title { flex: 1; text-align: center; min-width: 0; }
.s-title .eyebrow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.elapsed { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.s-progress { height: 3px; background: var(--border); max-width: 560px; width: 100%; margin: 0 auto; }
.s-progress div { height: 100%; background: var(--pink); transition: width .3s; }
.s-body { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; max-width: 560px; width: 100%; margin: 0 auto; }
.s-ex-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.s-ex-menu { display: flex; margin: -8px -8px 0 0; }
.s-opts { display: flex; gap: 14px; align-items: center; margin: 10px 0 6px; flex-wrap: wrap; }
.opt { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.opt .switch { transform: scale(.85); }
.kg { width: 70px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 6px 8px; font-size: 16px; text-align: center; }
.set-row { display: grid; grid-template-columns: 30px 1fr 74px 46px; align-items: center; gap: 8px; padding: 5px 0; }
.set-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--slate); font-size: 13px; color: var(--muted); }
.set-in { display: flex; gap: 6px; }
.set-in input { flex: 1; min-width: 0; width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 11px; padding: 10px; font-size: 17px; text-align: center; font-variant-numeric: tabular-nums; }
.set-in input:focus { outline: none; border-color: var(--pink); }
.set-in .sw-btn { width: 40px; }
.last { font-size: 11.5px; color: var(--muted); opacity: .75; text-align: center; }
.check { width: 46px; height: 42px; border-radius: 12px; border: 1px solid var(--slate); background: var(--bg); display: grid; place-items: center; color: var(--muted); padding: 0; }
.check svg { width: 20px; height: 20px; }
.set-row.done .check { background: var(--pink); border-color: var(--pink); color: #fff; box-shadow: 0 0 12px rgba(242, 92, 168, .45); }
.set-row.done .set-n { border-color: var(--pink); color: var(--pink); }
.set-row.done input { color: var(--muted); }
.s-ex-actions { display: flex; gap: 18px; margin-top: 2px; }
.restbar { position: absolute; left: 12px; right: 12px; bottom: calc(12px + var(--sb)); max-width: 536px; margin: 0 auto; background: var(--card); border: 1px solid var(--pink); border-radius: 18px; overflow: hidden; box-shadow: 0 10px 40px rgba(0, 0, 0, .7), 0 0 24px rgba(242, 92, 168, .25); }
.rest-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--plum); opacity: .55; transition: width .5s linear; }
.rest-in { position: relative; display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; gap: 8px; }
.rest-in .row-btns { margin: 0; gap: 6px; }
.rest-in .btn.small { padding: 8px 10px; }
.rest-time { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--pink); }

/* history */
.streak-mini { display: flex; justify-content: space-around; text-align: center; }
.streak-mini > div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.streak-mini b { font-size: 22px; } .streak-mini .flame { width: 28px; height: 28px; background: none; }
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; }
.cal-grid.wd { font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.cal-grid .cd { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; font-size: 12.5px; color: var(--muted); background: rgba(58, 70, 81, .2); }
.cal-grid .cd.l1 { background: var(--plum); color: var(--text); }
.cal-grid .cd.l2 { background: #8a3466; color: #fff; }
.cal-grid .cd.l3 { background: var(--pink); color: #fff; box-shadow: 0 0 10px rgba(242, 92, 168, .5); }
.cal-grid .cd.miss { box-shadow: inset 0 0 0 1px var(--slate); }
.cal-grid .cd.today { outline: 1.5px solid var(--glow); outline-offset: -1.5px; }
.fail-dot { position: absolute; right: 4px; top: 4px; width: 6px; height: 6px; border-radius: 50%; background: #ff7a9c; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg i { width: 10px; height: 10px; border-radius: 3px; background: var(--pink); }
.lg.b i { background: none; border-top: 2px dashed var(--glow); border-radius: 0; height: 0; width: 14px; }
.lg.miss i { background: none; box-shadow: inset 0 0 0 1px var(--slate); }
.lg.fail i { background: #ff7a9c; border-radius: 50%; width: 7px; height: 7px; }
.stat-row { display: flex; justify-content: space-around; gap: 6px; }
.stat-row > * { display: flex; flex-direction: column; align-items: center; text-align: center; background: none; border: 0; padding: 0; flex: 1; }
.stat-row b { font-size: 19px; font-weight: 600; }
.stat-row span { font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; }
.stat-row span svg { width: 11px; height: 11px; }
.chart-wrap { margin: 12px 0; }
.chart { width: 100%; height: 150px; display: block; overflow: visible; }
.chart .cl { stroke: var(--pink); stroke-width: 2; fill: none; vector-effect: non-scaling-stroke; }
.chart .cl.b { stroke: var(--glow); stroke-dasharray: 5 4; opacity: .8; }
.chart path:not(.cl) { stroke: none; }
.chart .cd { fill: var(--pink); stroke: none; } .chart .cd.b { fill: var(--glow); }
.chart-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }
.chart-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 30px 10px; border: 1px dashed var(--border); border-radius: 12px; }
.sess-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 4px; }
.sess-meta { display: flex; flex-direction: column; align-items: flex-end; font-size: 12.5px; white-space: nowrap; }
.att { border-left: 3px solid var(--pink); }
.att.fail { border-left-color: var(--slate); }
.pr-grid { display: flex; flex-direction: column; gap: 10px; }
.pr-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.pr-cell { background: var(--bg); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; }
.pr-val { font-size: 24px; font-weight: 700; } .pr-val small { font-size: 12px; color: var(--muted); font-weight: 400; }
.set-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.set-pills span { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 5px 10px; font-weight: 600; }
.set-pills span.pr-pill { border-color: var(--pink); color: var(--pink); }
.set-pills small { color: var(--muted); font-weight: 400; margin-right: 5px; font-size: 11px; }
.set-pills em { font-style: normal; font-size: 10.5px; color: var(--glow); margin-left: 5px; font-weight: 400; }

/* skill tree */
.tree { position: relative; margin: 4px -8px 0; }
.tree-lines { position: absolute; inset: 0; overflow: visible; }
.tree-lines line { stroke: var(--slate); stroke-width: 1.6; stroke-dasharray: 3 6; }
.tree-lines line.lit { stroke: var(--pink); stroke-dasharray: none; filter: drop-shadow(0 0 4px var(--pink)); }
.tree-tag { position: absolute; left: 10px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.node { position: absolute; transform: translate(-50%, -30px); background: none; border: 0; padding: 0; width: 112px; display: flex; flex-direction: column; align-items: center; z-index: 1; }
.node-dot { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; position: relative; background: conic-gradient(var(--pink) calc(var(--p) * 1turn), var(--border) 0); }
.node-dot::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--card); }
.node-in { position: relative; z-index: 1; display: grid; place-items: center; font-size: 12px; }
.node-in svg { width: 22px; height: 22px; }
.node.big .node-dot { width: 68px; height: 68px; }
.node.current .node-in, .node.progress .node-in { color: var(--glow); }
.node.locked .node-dot { background: var(--border); }
.node.locked .node-in { color: var(--slate); }
.node.locked .node-label { color: var(--muted); }
.node.ready .node-dot { animation: pulse 2s ease-in-out infinite; background: conic-gradient(var(--pink) calc(var(--p) * 1turn), var(--plum) 0); }
.node.ready .node-in { color: var(--pink); font-weight: 700; }
.node.done .node-dot { background: radial-gradient(circle at 40% 35%, var(--glow), var(--pink) 70%); box-shadow: 0 0 22px rgba(242, 92, 168, .6); }
.node.done .node-dot::after { display: none; }
.node.done .node-in { color: #fff; }
.node-label { margin-top: 6px; font-size: 12px; line-height: 1.2; text-align: center; background: rgba(5, 5, 7, .82); padding: 2px 6px; border-radius: 6px; }
.lv-dots { display: flex; gap: 4px; margin-top: 5px; }
.lv-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--slate); }
.lv-dots i.o { background: none; box-shadow: inset 0 0 0 1.5px var(--pink); }
.lv-dots i.a { background: var(--plum); box-shadow: inset 0 0 0 1.5px var(--pink); }
.lv-dots i.m { background: var(--pink); box-shadow: 0 0 6px var(--pink); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(242, 92, 168, .5); } 50% { box-shadow: 0 0 0 9px rgba(242, 92, 168, 0); } }
.req-list { display: flex; flex-wrap: wrap; gap: 8px; }
.req { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--slate); background: transparent; border-radius: 99px; padding: 7px 12px; font-size: 13px; color: var(--muted); }
.req svg { width: 14px; height: 14px; }
.req.ok { border-color: var(--pink); color: var(--text); background: var(--plum); }
.chal.ok, .lvl.ok { border-color: rgba(242, 92, 168, .45); }
.lvl.open { border-color: var(--pink); box-shadow: 0 0 18px rgba(242, 92, 168, .18); }
.lvl h3 { margin-top: 1px; } .lvl p { margin-top: 6px; }
.edit-card { display: flex; flex-direction: column; gap: 10px; }
.edit-card > .row .grip { margin-left: -6px; }
.edit-card > .row b { flex: 1; }

/* body */
.profile .stat-row { margin-bottom: 4px; }
.meas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.meas { padding: 10px 12px; }
.meas-val { font-size: 20px; font-weight: 600; }
.delta { font-size: 11.5px; color: var(--muted); }
.banner { display: flex; align-items: center; gap: 12px; border-color: var(--pink); flex-wrap: wrap; }
.banner > svg { width: 22px; height: 22px; color: var(--pink); flex: none; }
.banner > div:nth-child(2) { flex: 1; min-width: 150px; }
.banner-btns { display: flex; gap: 8px; }
.cmp table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13.5px; }
.cmp th { font-size: 11px; color: var(--muted); font-weight: 500; text-align: right; padding: 4px; }
.cmp td { padding: 7px 4px; text-align: right; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.cmp td:first-child, .cmp th:first-child { text-align: left; }

/* badges */
.featured { display: flex; align-items: center; gap: 16px; background: radial-gradient(120% 140% at 0% 50%, rgba(90, 42, 69, .6), transparent 65%), var(--card); }
.featured h2 { margin: 2px 0 4px; }
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 8px; }
.badge { background: none; border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.b-name { font-size: 12px; line-height: 1.2; margin-top: 4px; }
.b-sub { font-size: 11px; color: var(--muted); }
.badge.on .b-sub { color: var(--pink); }
.emblem { width: 76px; height: 76px; border-radius: 50%; padding: 3px; background: conic-gradient(var(--slate) calc(var(--p) * 1turn), var(--border) 0); flex: none; }
.emblem.big { width: 104px; height: 104px; }
.em-in { width: 100%; height: 100%; border-radius: 50%; background: var(--card); display: grid; place-items: center; position: relative; overflow: hidden; }
.em-in img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) brightness(.55); }
.badge-def { width: 58%; height: 58%; stroke: none; fill: var(--slate); }
.badge-def .ring { fill: none; stroke: var(--slate); stroke-width: 1.2; }
.badge-def .core { fill: var(--card); }
.em-lock { position: absolute; right: 8%; bottom: 8%; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); border: 1px solid var(--slate); display: grid; place-items: center; color: var(--muted); }
.em-lock svg { width: 12px; height: 12px; }
.emblem.on { background: conic-gradient(from 200deg, var(--glow), var(--pink), var(--glow)); box-shadow: 0 0 22px rgba(242, 92, 168, .5); }
.emblem.on .em-in img { filter: none; }
.emblem.on .badge-def { fill: var(--pink); filter: drop-shadow(0 0 5px var(--pink)); }
.emblem.on .badge-def .ring { stroke: var(--glow); }
.img-pick { display: flex; align-items: center; gap: 16px; }
.img-pick label.btn { cursor: pointer; }

/* sheet */
.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .62); z-index: 30; opacity: 0; pointer-events: none; transition: opacity .25s; }
.backdrop.open { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; max-width: 560px; margin: 0 auto; max-height: 90vh; overflow-y: auto; background: var(--card); border: 1px solid var(--border); border-bottom: 0; border-radius: 24px 24px 0 0; padding: 8px 18px calc(22px + var(--sb)); transform: translateY(105%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; gap: 12px; }
.sheet.open { transform: none; }
.sheet .card { background: var(--bg); }
.sheet .card.inner { background: var(--card); }
.sheet .field input, .sheet .select, .sheet input[type=time] { background-color: var(--card); }
.sheet .edit-card .field input, .sheet .edit-card .select { background-color: var(--card); }
.sheet .seg { background: var(--card); }
.grab { width: 40px; height: 4px; border-radius: 4px; background: var(--slate); margin: 4px auto 6px; flex: none; }
.sheet-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 2px; background: none; border: 0; color: var(--muted); padding: 0; font-size: 13.5px; }
.sheet-back svg { width: 16px; height: 16px; }
.sheet h3 { margin-top: 4px; }
.done-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 6px 0; }
.done-head .stat-row { width: 100%; margin-top: 8px; }
.nrow { align-items: flex-start; padding-top: 12px; border-top: 1px solid var(--border); }
.nrow > div { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.nrow input[type=time] { max-width: 140px; padding: 7px 10px; }
.nrow .grid2 input, .nrow .grid2 select { max-width: none; padding: 7px 10px; }
.card > .nrow:first-of-type { margin-top: 12px; }
input[type=time], input[type=date] { color-scheme: dark; }

/* celebration */
.celebrate { position: fixed; inset: 0; z-index: 60; background: radial-gradient(circle at 50% 40%, rgba(90, 42, 69, .9), rgba(5, 5, 7, .97) 70%); display: none; align-items: center; justify-content: center; padding: 24px; overflow: hidden; }
.celebrate.open { display: flex; animation: fadein .3s; }
.cel-card { position: relative; z-index: 1; max-width: 360px; width: 100%; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; animation: pop .45s cubic-bezier(.2, 1.4, .4, 1); }
.cel-icon svg { width: 96px; height: 96px; }
.cel-icon > svg:not(.blossom) { color: var(--pink); filter: drop-shadow(0 0 20px rgba(242, 92, 168, .8)); stroke-width: 1.4; }
.cel-img { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 4px var(--pink), 0 0 40px rgba(242, 92, 168, .7); }
.cel-card h1 { font-size: 28px; }
.cel-big { font-size: 48px; font-weight: 800; color: var(--pink); text-shadow: 0 0 24px rgba(242, 92, 168, .6); }
.cel-card .btn { margin-top: 18px; }
.petals i { position: absolute; top: -20px; width: 12px; height: 9px; background: var(--glow); border-radius: 80% 0 80% 0; opacity: .75; animation: fall linear infinite; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg) translateX(40px); } }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
@keyframes fadein { from { opacity: 0; } }

/* toast */
.toast { position: fixed; left: 50%; top: calc(14px + var(--st)); transform: translate(-50%, -200%); visibility: hidden; z-index: 70; background: var(--card); border: 1px solid var(--pink); padding: 10px 18px; border-radius: 14px; font-size: 14px; transition: transform .3s, visibility .3s; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 8px 30px rgba(0, 0, 0, .6); }
.toast.show { transform: translate(-50%, 0); visibility: visible; }

@media (max-width: 360px) {
  .badge-grid { grid-template-columns: repeat(2, 1fr); }
  .set-row { grid-template-columns: 28px 1fr 58px 42px; }
  .nav-btn { font-size: 9.5px; }
}
