/* Stroke — playful. Flat saturated colour per phase, sticker buttons, a fuzzy mascot (Pom). Single deliberate light look. */
:root {
  --page: #F3ECE0;
  --card: #FFFBF2;
  --ink: #0A1030;
  --muted: #5B6180;
  --lilac: #9BA8FF;
  --orange: #FF7A33;
  --blue: #2DB6FF;
  --pink: #FFB3DA;
  --hot: #FF6FB5;
  --yellow: #FFE14D;
  --lime: #B4EC0B;
  --danger: #D81E3A;
  --display: "Fraunces", "Cooper Black", Georgia, serif;
  --body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--page);
  color: var(--ink);
  font: 500 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: var(--ink); font-weight: 700; }
h1, h2, h3 { font-family: var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- shell ---------- */
.app { max-width: 980px; margin: 0 auto; padding: 14px max(16px, env(safe-area-inset-left, 0px)) 40px; }
.top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.brand { font-family: var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; font-weight: 900; font-size: 1.7rem; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.logo { position: relative; width: 34px; height: 30px; margin-top: 8px; border-radius: 50% 50% 46% 46%; background: #fff; border: 2.5px solid var(--ink); display: inline-block; }
.logo::before, .logo::after { content: ""; position: absolute; top: -17px; width: 10px; height: 20px; border: 2.5px solid var(--ink); border-bottom: 0; border-radius: 50% 50% 0 0; background: linear-gradient(#fff 55%, var(--hot) 55%); }
.logo::before { left: 3px; transform: rotate(-8deg); }
.logo::after { right: 3px; transform: rotate(10deg); }
.logo i { position: absolute; top: 10px; width: 5px; height: 7px; border-radius: 50%; background: var(--ink); }
.logo i:first-child { left: 7px; } .logo i:last-child { right: 7px; }
.tabs { display: flex; gap: 2px; margin: 0 auto 0 6px; flex-wrap: wrap; background: var(--card); border: 2.5px solid var(--ink); border-radius: 999px; padding: 3px; box-shadow: 0 3px 0 var(--ink); }
.tab { background: none; border: 0; padding: 7px 15px; border-radius: 999px; font-weight: 700; }
.tab:hover { background: var(--yellow); }
.tab.on { background: var(--ink); color: var(--card); }
.tools { display: flex; gap: 8px; align-items: center; }
.chip, .icon-btn { background: var(--card); border: 2.5px solid var(--ink); border-radius: 999px; padding: 6px 15px; font-weight: 700; box-shadow: 0 3px 0 var(--ink); transition: transform .08s, box-shadow .08s; }
.chip:active, .icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.chip:hover, .icon-btn:hover { background: var(--yellow); }
.view { display: none; }
.view.on { display: block; }
.card { background: var(--card); border: 2.5px solid var(--ink); border-radius: 26px; padding: 20px; margin-bottom: 16px; box-shadow: 0 4px 0 var(--ink); }
.card h2, dialog h2 { margin: 0 0 12px; font-size: 1.45rem; }
.card h2 small { font-family: var(--body); color: var(--muted); font-weight: 700; font-size: .9rem; margin-left: 6px; }
.note { color: var(--muted); font-size: .94rem; margin: 6px 0; }
.hint { color: var(--muted); font-size: .88rem; text-align: center; margin: 14px 0 0; font-weight: 600; }
.error { color: var(--danger); min-height: 1.4em; margin: 6px 0; font-size: .92rem; font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); background: var(--ink); color: var(--card); padding: 11px 18px; border-radius: 999px; font-weight: 700; opacity: 0; pointer-events: none; transition: .3s; max-width: 90vw; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- buttons ---------- */
.btn { background: var(--card); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 999px; padding: .7em 1.2em; font-weight: 800; box-shadow: 0 4px 0 var(--ink); transition: transform .08s, box-shadow .08s, background .15s; }
.btn:hover { background: var(--yellow); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn.main { background: var(--ink); color: var(--card); }
.btn.main:hover { background: #1b2566; }
.btn.ghost { background: var(--card); }
.btn.danger { color: var(--danger); }
.btn.danger.arm { background: var(--danger); color: #fff; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
:focus-visible { outline: 3px solid var(--hot); outline-offset: 2px; }

/* ---------- the widget: scales with its container (page, fullscreen, floating window) ---------- */
.widget-host { position: relative; height: min(76vh, 680px); min-height: 400px; }
.widget-host:fullscreen, body.pip .widget-host { height: 100vh; min-height: 0; max-height: none; width: 100vw; background: var(--page); }
body.pip { margin: 0; overflow: hidden; background: var(--page); }
.widget {
  --wbg: var(--lilac);
  container: w / size;
  position: relative; overflow: hidden;
  height: 100%; width: 100%;
  display: flex; flex-direction: column; align-items: center;
  padding: 3.4cqmin 4cqmin 4.2cqmin;
  gap: 1.6cqmin;
  background: var(--wbg);
  transition: background .6s;
  border: 3px solid var(--ink); border-radius: 34px; box-shadow: 0 6px 0 var(--ink);
  user-select: none;
}
body.pip .widget, .widget-host:fullscreen .widget { border-radius: 0; border: 0; box-shadow: none; height: 100%; }
body.pip .widget { height: 100vh; width: 100vw; }
.widget[data-phase="warmup"] { --wbg: var(--orange); }
.widget[data-phase="meditation"] { --wbg: var(--blue); }
.widget[data-phase="break"] { --wbg: var(--pink); }
.widget[data-state="paused"] .clock-wrap { opacity: .6; }

.aura { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 14% 18%, #ffffff55, transparent 38%), radial-gradient(circle at 88% 92%, #ffffff40, transparent 42%); }

.pips { position: relative; display: flex; gap: 1.4cqmin; font-size: clamp(9px, 3cqmin, 14px); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; z-index: 1; }
.pips span { padding: .3em .9em; border-radius: 999px; border: 2px solid var(--ink); opacity: .5; transition: .3s; }
.widget[data-phase="warmup"] [data-p="warmup"], .widget[data-phase="meditation"] [data-p="meditation"], .widget[data-phase="break"] [data-p="break"] { opacity: 1; background: var(--card); box-shadow: 0 2px 0 var(--ink); }

.stage { position: relative; flex: 1; width: 100%; min-height: 0; container: st / size; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1cqh; z-index: 1; }
.pom { flex: 0 1 auto; width: min(48cqh, 72cqw); aspect-ratio: 1; cursor: pointer; position: relative; }
.pom .mascot { width: 100%; height: 100%; overflow: visible; display: block; }
.clock-wrap { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; transition: opacity .4s; min-width: 0; }
.phase-label { font-size: clamp(10px, 5cqh, 20px); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; background: var(--card); border: 2px solid var(--ink); border-radius: 999px; padding: .1em .9em; margin-bottom: .3em; }
.clock { font-family: var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; font-weight: 900; font-size: clamp(32px, min(21cqh, 24cqw), 170px); font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1; }
.clock.long { font-size: clamp(26px, min(15cqh, 17cqw), 120px); }
.sub { font-size: clamp(10px, 4.6cqh, 17px); font-weight: 700; margin-top: .5em; min-height: 1.3em; white-space: nowrap; }
.widget .bar { display: none; width: min(70cqw, 360px); height: clamp(9px, 5cqh, 18px); margin-top: .6em; background: var(--card); border: 2.5px solid var(--ink); border-radius: 999px; overflow: hidden; }
.widget.has-target .bar { display: block; }
.widget .bar i { display: block; height: 100%; width: 0; background: var(--yellow); border-right: 2.5px solid var(--ink); border-radius: 999px; transition: width .6s linear; }
.widget .bar i.zero { border-right: 0; }

/* wide stage: Pom on the left, clock on the right */
@container w (min-aspect-ratio: 1/1) {
  .stage { flex-direction: row; gap: 5cqw; }
  .pom { width: min(92cqh, 34cqw); }
  .clock-wrap { align-items: flex-start; text-align: left; }
  .clock { font-size: clamp(32px, min(40cqh, 17cqw), 170px); }
  .clock.long { font-size: clamp(26px, min(28cqh, 12cqw), 120px); }
  .widget .bar { width: min(36cqw, 360px); }
}

.msg { position: relative; z-index: 1; min-height: 2.5em; max-width: 94%; text-align: center; font-weight: 700; font-size: clamp(11px, 3.7cqmin, 17px); opacity: 0; transform: translateY(6px); transition: opacity .5s, transform .5s; display: grid; place-items: center; padding: .4em 1em; border: 2.5px solid var(--ink); border-radius: 18px; background: #fff; }
.msg.show { opacity: 1; transform: none; }

.controls { position: relative; z-index: 1; width: 100%; display: grid; gap: 1.8cqmin; grid-template-columns: 1fr 1fr; grid-template-areas: "bliss bliss" "main main" "pause end"; }
.controls .btn { font-size: clamp(12px, 4cqmin, 19px); padding: .7em .6em; min-height: 2.6em; }
.controls .bliss { grid-area: bliss; font-family: var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; font-weight: 900; font-size: clamp(15px, 6cqmin, 28px); padding: .75em .6em; background: var(--yellow); }
.controls .bliss:hover { background: #fff07a; }
#btnMain { grid-area: main; }
#btnPause { grid-area: pause; }
#btnEnd { grid-area: end; }
#btnSkip { grid-area: skip; }
.widget[data-state="idle"] .controls { grid-template-areas: "main main" "skip skip"; }
.widget[data-state="idle"] .bliss, .widget[data-state="idle"] #btnPause, .widget[data-state="idle"] #btnEnd { display: none; }
.widget:not([data-state="idle"]) #btnSkip { display: none; }

.corner { position: absolute; top: 2.4cqmin; right: 2.4cqmin; z-index: 3; display: flex; gap: 6px; }
.corner .icon-btn { padding: 3px 10px; font-size: clamp(11px, 3.6cqmin, 16px); box-shadow: 0 2px 0 var(--ink); }
canvas.fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; }

@container w (max-height: 640px) {
  .controls { grid-template-areas: "bliss main" "pause end"; gap: 1.2cqmin; }
  .controls .bliss { font-size: clamp(13px, 5cqmin, 21px); padding: .55em .4em; }
  .controls .btn { min-height: 2.2em; padding: .45em .4em; box-shadow: 0 3px 0 var(--ink); }
  .widget[data-state="idle"] .controls { grid-template-areas: "main skip"; }
  .msg { min-height: 1.8em; }
}
@container w (max-height: 340px) { .msg { display: none; } .sub { display: none; } }
@container w (max-height: 260px) { .pips { display: none; } }
@container w (max-width: 460px) {
  .pips { align-self: flex-start; gap: 1cqmin; }
  .pips span { padding: .2em .6em; }
  .corner .icon-btn { padding: 2px 8px; }
}

.popped-note { position: absolute; inset: 0; display: none; place-content: center; text-align: center; gap: 10px; background: var(--card); border: 3px solid var(--ink); border-radius: 34px; font-weight: 700; }
.widget-host.popped .popped-note { display: grid; }

/* ---------- views: standard (default), compact, minimal. JS picks the largest one that fits the window ---------- */
.widget[data-view="compact"] { padding: 2.6cqmin 3cqmin 3cqmin; gap: 1.2cqmin; border-radius: 24px; box-shadow: 0 4px 0 var(--ink); }
.widget[data-view="compact"] .pips, .widget[data-view="compact"] .msg, .widget[data-view="compact"] .sub { display: none; }
.widget[data-view="compact"] .controls { grid-template-columns: 1.5fr 1.4fr 1fr 1fr; grid-template-areas: "bliss main pause end"; gap: 1.2cqmin; }
.widget[data-view="compact"][data-state="idle"] .controls { grid-template-columns: 1fr 1fr; grid-template-areas: "main skip"; }
.widget[data-view="compact"] .controls .btn { font-size: clamp(10px, 4.2cqmin, 15px); min-height: 2.1em; padding: .35em .3em; box-shadow: 0 3px 0 var(--ink); line-height: 1.15; }
.widget[data-view="compact"] .controls .bliss { font-size: clamp(11px, 4.8cqmin, 18px); padding: .35em .3em; }
.widget[data-view="compact"] .phase-label { font-size: clamp(9px, 4cqh, 13px); }

.widget[data-view="minimal"] { padding: 2.2cqmin 2.6cqmin; gap: 1.6cqmin; border-width: 2.5px; border-radius: 18px; box-shadow: 0 3px 0 var(--ink); justify-content: center; }
.widget[data-view="minimal"] .pips, .widget[data-view="minimal"] .pom, .widget[data-view="minimal"] .msg,
.widget[data-view="minimal"] .sub, .widget[data-view="minimal"] .bar, .widget[data-view="minimal"] .aura { display: none; }
.widget[data-view="minimal"] .stage { flex-direction: column; gap: 0; }
.widget[data-view="minimal"] .clock-wrap { align-items: center; text-align: center; }
.widget[data-view="minimal"] .phase-label { font-size: clamp(8px, 12cqh, 12px); padding: 0 .7em; margin-bottom: .15em; }
.widget[data-view="minimal"] .clock { font-size: clamp(20px, min(62cqh, 24cqw), 120px); }
.widget[data-view="minimal"] .clock.long { font-size: clamp(18px, min(48cqh, 17cqw), 90px); }
.widget[data-view="minimal"] .controls { grid-template-columns: repeat(4, 1fr); grid-template-areas: "bliss main pause end"; gap: 1.4cqmin; }
.widget[data-view="minimal"][data-state="idle"] .controls { grid-template-columns: 2fr 1fr; grid-template-areas: "main skip"; }
.widget[data-view="minimal"] .controls .btn { font-size: clamp(11px, 14cqh, 18px); min-height: 0; padding: .35em 0; line-height: 1.1; border-width: 2px; box-shadow: 0 2px 0 var(--ink); }
.widget[data-view="minimal"] .controls .bliss { font-size: clamp(12px, 15cqh, 20px); padding: .3em 0; }
.widget[data-view="minimal"][data-shape="wide"] { flex-direction: row; align-items: center; }
.widget[data-view="minimal"][data-shape="wide"] .stage { flex: 1 1 48%; }
.widget[data-view="minimal"][data-shape="wide"] .controls { flex: 0 0 52%; width: auto; }
.widget[data-view="minimal"][data-shape="wide"] .clock { font-size: clamp(20px, min(62cqh, 31cqw), 120px); }
.widget[data-view="minimal"][data-shape="wide"] .clock.long { font-size: clamp(18px, min(48cqh, 22cqw), 90px); }
.widget[data-view="minimal"] .corner { opacity: 0; top: 1cqmin; right: 1cqmin; transition: opacity .2s; }
.widget[data-view="minimal"]:hover .corner, .widget[data-view="minimal"] .corner:focus-within { opacity: 1; }
.widget[data-view="minimal"] .corner .icon-btn { font-size: 11px; padding: 1px 7px; }

.seg { display: flex; border: 2.5px solid var(--ink); border-radius: 999px; overflow: hidden; flex: none; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 6px 13px; font-weight: 700; font-size: .88rem; }
.seg input:checked + span { background: var(--ink); color: var(--card); }
.seg input:focus-visible + span { outline: 3px solid var(--hot); outline-offset: -3px; }

/* ---------- Pom the bunny ---------- */
.mascot .body { transform-box: fill-box; transform-origin: 50% 100%; }
.mascot .pupil { transition: transform .12s ease-out; }
.mascot .blinky { transform-box: fill-box; transform-origin: center; animation: blink 5s infinite; }
.mascot .earL, .mascot .earR, .mascot .paw { transform-box: fill-box; transition: transform .5s cubic-bezier(.3, 1.5, .5, 1), translate .4s cubic-bezier(.3, 1.5, .5, 1); }
.mascot .earR { transform-origin: 15% 98%; }
.mascot .earL { transform-origin: 78% 98%; }
.mascot .paw { transform-origin: 50% 100%; }

/* body loops */
.mascot[data-mood="idle"] .body, .mascot[data-mood="chill"] .body { animation: float 4.4s ease-in-out infinite; }
.mascot[data-mood="excited"] .body { animation: bounce .6s ease-in-out 4; }
.mascot[data-mood="focus"] .body, .mascot[data-mood="sleepy"] .body { animation: breathe 6s ease-in-out infinite; }
.mascot[data-mood="pleasure"] .body { animation: wiggle .5s ease-in-out 6; }
.mascot[data-mood="tired"] .body { animation: pant 1.1s ease-in-out infinite; }
.mascot[data-mood="wow"] .body { animation: pop .5s ease-out 2; }

/* ears: loops for lively moods, poses for the rest */
.mascot[data-mood="idle"] .earR { animation: sway 5s ease-in-out infinite; }
.mascot[data-mood="idle"] .earL { animation: sway 6s ease-in-out -2s infinite reverse; }
.mascot[data-mood="pleasure"] .earR { animation: earwiggle .32s ease-in-out infinite alternate; }
.mascot[data-mood="pleasure"] .earL { animation: earwiggle .32s ease-in-out -.16s infinite alternate-reverse; }
.mascot[data-mood="excited"] .earR { transform: rotate(5deg) scaleY(1.06); }
.mascot[data-mood="excited"] .earL { transform: rotate(-3deg) scaleY(1.06); }
.mascot[data-mood="wow"] .earR { transform: rotate(3deg) scaleY(1.12); }
.mascot[data-mood="wow"] .earL { transform: rotate(-2deg) scaleY(1.12); }
.mascot[data-mood="focus"] .earR { transform: rotate(4deg); }
.mascot[data-mood="chill"] .earR { transform: rotate(14deg); }
.mascot[data-mood="chill"] .earL { transform: rotate(-6deg); }
.mascot[data-mood="sleepy"] .earR { transform: rotate(28deg) scaleY(.97); }
.mascot[data-mood="sleepy"] .earL { transform: rotate(-12deg); }
.mascot[data-mood="tired"] .earR { transform: rotate(36deg) scaleY(.95); }
.mascot[data-mood="tired"] .earL { transform: rotate(-18deg) scaleY(.96); }

/* paws */
.mascot[data-mood="excited"] .paw, .mascot[data-mood="wow"] .paw { translate: 0 -9px; }
.mascot[data-mood="pleasure"] .pawL { translate: 6px -22px; transform: rotate(-8deg); }
.mascot[data-mood="pleasure"] .pawR { translate: -6px -22px; transform: rotate(8deg); }
.mascot[data-mood="tired"] .paw, .mascot[data-mood="sleepy"] .paw { translate: 0 5px; }

.mascot .pant { transform-box: fill-box; transform-origin: 50% 0; animation: gasp .55s ease-in-out infinite; }
.mascot .sweat path { animation: drip 1.6s ease-in infinite; }
.mascot .sparkles path { animation: twinkle 1s ease-in-out infinite alternate; }
.mascot .sparkles path:nth-child(2) { animation-delay: .3s; } .mascot .sparkles path:nth-child(3) { animation-delay: .6s; }
.mascot .hearts path { animation: rise 1.5s ease-out infinite; }
.mascot .hearts .h2 { animation-delay: .4s; } .mascot .hearts .h3 { animation-delay: .8s; }
.mascot .zzz text { animation: rise 2.4s ease-out infinite; }
.mascot .zzz .z2 { animation-delay: .6s; } .mascot .zzz .z3 { animation-delay: 1.2s; }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.07); } }
@keyframes float { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-2px) scale(1.012, 1.01); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025, 1.03); } }
@keyframes bounce { 0%, 100% { transform: translateY(0) scale(1.04, .96); } 35% { transform: translateY(-7%) scale(.98, 1.04); } 65% { transform: translateY(0) scale(1.04, .96); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0) scale(1); } 25% { transform: rotate(-4deg) scale(1.03); } 75% { transform: rotate(4deg) scale(1.03); } }
@keyframes pant { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.03, .97); } }
@keyframes pop { 0% { transform: scale(.92); } 50% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes gasp { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.7); } }
@keyframes sway { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(3deg); } }
@keyframes earwiggle { from { transform: rotate(-7deg); } to { transform: rotate(9deg); } }
@keyframes drip { 0% { translate: 0 0; opacity: 1; } 80% { translate: 0 14px; opacity: 1; } 100% { translate: 0 18px; opacity: 0; } }
@keyframes twinkle { from { opacity: .35; } to { opacity: 1; } }
@keyframes rise { 0% { translate: 0 6px; opacity: 0; } 20% { opacity: 1; } 100% { translate: 0 -26px; opacity: 0; } }

/* ---------- history / badges / settings ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { border: 2.5px solid var(--ink); border-radius: 22px; padding: 14px 16px; box-shadow: 0 4px 0 var(--ink); background: var(--yellow); }
.stat:nth-child(5n+2) { background: var(--pink); } .stat:nth-child(5n+3) { background: var(--blue); } .stat:nth-child(5n+4) { background: var(--lime); } .stat:nth-child(5n) { background: var(--orange); }
.stat b { display: block; font-family: var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; font-weight: 900; font-size: 1.75rem; line-height: 1.15; }
.stat span { font-size: .85rem; font-weight: 700; }
.list { display: flex; flex-direction: column; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-top: 2px dashed #0a103030; }
.item:first-child { border-top: 0; }
.item .when { font-weight: 800; }
.item .meta { color: var(--muted); font-size: .88rem; grid-column: 1; font-weight: 600; }
.item .del { grid-row: 1 / span 2; grid-column: 2; background: none; border: 0; color: var(--muted); padding: 6px 10px; border-radius: 8px; font-weight: 800; }
.item .del:hover { color: var(--danger); }
.empty { color: var(--muted); padding: 10px 0; font-weight: 600; }
.tag { display: inline-block; padding: 0 .6em; border-radius: 999px; font-size: .75rem; background: var(--lime); border: 2px solid var(--ink); margin-left: 8px; font-weight: 800; }
#chart svg { width: 100%; height: 170px; display: block; }
#chart .bar { fill: var(--blue); stroke: var(--ink); stroke-width: 1.6; }
#chart .bar.hit { fill: var(--lime); }
#chart .tl { stroke: var(--ink); stroke-dasharray: 3 3; stroke-width: 1.4; }
#chart .axis { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .78rem; font-weight: 700; margin-top: 6px; flex-wrap: wrap; }

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.badge { border: 2.5px dashed #0a103055; border-radius: 22px; padding: 14px 12px; text-align: center; background: transparent; }
.badge .ico { font-size: 2.3rem; filter: grayscale(1) opacity(.35); transition: .3s; }
.badge.got { border: 2.5px solid var(--ink); box-shadow: 0 4px 0 var(--ink); background: var(--yellow); }
.badge.got:nth-child(5n+2) { background: var(--pink); } .badge.got:nth-child(5n+3) { background: var(--blue); } .badge.got:nth-child(5n+4) { background: var(--lime); } .badge.got:nth-child(5n) { background: var(--orange); }
.badge.got .ico { filter: none; }
.badge b { display: block; font-weight: 800; margin-top: 4px; font-size: .95rem; }
.badge span { display: block; font-size: .78rem; margin-top: 2px; font-weight: 600; color: var(--muted); }
.badge.got span { color: var(--ink); }
.badge .bar { height: 8px; background: var(--card); border: 2px solid var(--ink); border-radius: 999px; margin-top: 8px; overflow: hidden; }
.badge .bar i { display: block; height: 100%; background: var(--hot); }

.row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-top: 2px dashed #0a103030; cursor: pointer; font-weight: 700; }
.row:first-of-type { border-top: 0; }
.row small { display: block; color: var(--muted); font-size: .82rem; font-weight: 600; }
input[type="checkbox"] { width: 26px; height: 26px; accent-color: var(--ink); flex: none; }

/* ---------- dialogs ---------- */
dialog { background: var(--card); color: var(--ink); border: 3px solid var(--ink); border-radius: 30px; padding: 24px; width: min(440px, 92vw); box-shadow: 0 8px 0 var(--ink); }
dialog::backdrop { background: #0a1030aa; backdrop-filter: blur(3px); }
.field { display: block; margin: 12px 0; font-size: .9rem; font-weight: 700; }
.field input { display: block; width: 100%; margin-top: 5px; padding: 12px 16px; background: #fff; border: 2.5px solid var(--ink); border-radius: 999px; }
.field input:focus { outline: 3px solid var(--hot); outline-offset: 1px; }
.links { font-size: .88rem; color: var(--muted); margin: 14px 0 0; }
#sumDlg { overflow: hidden; text-align: center; background: var(--yellow); }
#sumDlg .sum { position: relative; z-index: 1; }
.sum-pom { width: 150px; margin: -4px auto 0; cursor: default; }
.sum h2 { font-size: 2rem; font-weight: 900; line-height: 1.05; }
.sum-msg { font-weight: 700; margin: 0 0 14px; }
.sum-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.sum-grid div { background: var(--card); border: 2.5px solid var(--ink); border-radius: 18px; padding: 10px; box-shadow: 0 3px 0 var(--ink); }
.sum-grid b { display: block; font-family: var(--display); font-weight: 900; font-size: 1.3rem; }
.sum-grid span { font-size: .8rem; font-weight: 700; color: var(--muted); }
.sum-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 10px 0; }
.sum-badge { background: var(--hot); border: 2.5px solid var(--ink); border-radius: 18px; padding: 10px 14px; box-shadow: 0 3px 0 var(--ink); animation: pop .7s cubic-bezier(.2, 1.4, .4, 1) both; }
.sum-badge .ico { font-size: 2rem; display: block; }
.sum-badge b { font-size: .85rem; font-weight: 800; }

@media (max-width: 620px) {
  .app { padding: 10px max(16px, env(safe-area-inset-left, 0px)) 30px; }
  .tabs { order: 3; width: 100%; margin: 0; justify-content: space-between; }
  .tools { margin-left: auto; }
  .widget-host { height: calc(100svh - 160px); min-height: 400px; }
}
@media (prefers-reduced-motion: reduce) {
  .mascot *, .sum-badge { animation: none !important; }
}

/* ---------- desktop app (Electron) ---------- */
[data-desktop] #btnPop, [data-desktop] #btnAccount, [data-desktop] #accountCard, [data-desktop] .hint { display: none !important; }
.icon-btn.on { background: var(--yellow); }
body.floatmode { overflow: hidden; }
body.floatmode .top, body.floatmode .hint { display: none; }
body.floatmode .app { padding: 0; max-width: none; }
body.floatmode .view { display: none !important; }
body.floatmode #view-timer { display: block !important; }
body.floatmode .widget-host { height: 100vh; min-height: 0; max-height: none; width: 100vw; }
body.floatmode .widget { border-radius: 0; border: 0; box-shadow: none; }
