/* Spacing: every padding, margin, gap and offset uses the 4px tokens below. */
:root {
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px;
  --safe-x: 16px;          /* horizontal safe area on every screen */
  --safe-top: 52px;        /* status bar + notch */
  --tabbar-h: 96px;        /* 72px bar + 24px home indicator */

  --bg: #F4F2EC;
  --card: #FFFFFF;
  --ink: #1C1B17;
  --muted: #858074;
  --line: #ECE8DF;
  --green: #4FAE55;
  --green-d: #2F8A3B;
  --green-l: #E4F4DF;
  --coin: #F6C445;
  --coral: #EF5F45;
  --coral-l: #FDE7E2;
  --sky-top: #9ED8F0;
  --sky-bot: #D9F1F8;
  --night-top: #1E2350;
  --night-bot: #44508E;
  --ios-gray: #8E8E93;
  --display: 'Google Sans Flex', 'Google Sans', system-ui, sans-serif;
  --ui: 'Google Sans', system-ui, -apple-system, sans-serif;
  --r-sm: 12px; --r-md: 16px; --r-lg: 20px; --r-card: 24px; --r-pill: 999px;
  --shadow: 0 4px 16px rgba(40, 32, 12, .06);
  color-scheme: only light;  /* the design is light-only; opt out of browser auto-dark */
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--ui); color: var(--ink); background: #D9D4C7;
  display: flex; align-items: center; justify-content: center;
  -webkit-font-smoothing: antialiased;
}
svg text { user-select: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

/* ---------- phone frame ---------- */
.phone {
  position: relative; width: 390px; height: 844px; max-height: 100vh;
  background: var(--bg); overflow: hidden; border-radius: 44px;
  box-shadow: 0 24px 64px rgba(30, 24, 8, .28), 0 0 0 12px #1C1B17;
}
@media (max-width: 440px) {
  body { display: block; background: var(--bg); }
  .phone { width: 100%; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; box-shadow: none; }
  /* on a real phone the status bar sits outside the page; only keep the notch inset */
  :root { --safe-top: calc(env(safe-area-inset-top, 0px) + var(--s4)); }
}
.screen { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; display: none; flex-direction: column; scrollbar-width: none; }
.screen::-webkit-scrollbar { display: none; }
.screen.on { display: flex; animation: fadeIn .28s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(var(--s2)); } to { opacity: 1; transform: none; } }
.pad { padding: 0 var(--safe-x); display: flex; flex-direction: column; gap: var(--s6); }
.spacer { height: calc(var(--tabbar-h) + var(--s8)); flex: none; }

/* ---------- type ---------- */
.display { font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1; letter-spacing: -.02em; }
.display--md { font-size: 28px; line-height: 1.08; }
.display--sm { font-size: 20px; line-height: 1.2; }
.eyebrow { font-weight: 800; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--green-d); }
.eyebrow--light { color: rgba(255, 255, 255, .8); }
.label { font-size: 12px; font-weight: 700; color: var(--muted); }
.muted { color: var(--muted); font-size: 14px; line-height: 1.5; }
.small { font-size: 12px; }
.money { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -.01em; }
.money--xl { font-size: 36px; line-height: 1; }
.money--lg { font-size: 24px; }
.money--coral { color: var(--coral); }
.risk { color: var(--coral); font-weight: 700; font-size: 12px; }
.gain { color: var(--green-d); font-weight: 700; font-size: 12px; }
.section-title { font-size: 16px; font-weight: 800; margin-bottom: calc(var(--s3) * -1); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: 56px; padding: 0 var(--s6); border-radius: var(--r-pill); font-weight: 800; font-size: 16px;
  transition: transform .12s ease, opacity .12s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn span { font-size: 20px; line-height: 0; }
.btn--dark { background: var(--ink); color: #fff; }
.btn--green { background: var(--green); color: #fff; }
.btn--ghost { background: #EAE6DC; }
.btn--light { background: #fff; color: var(--ink); }
.btn--glass { background: rgba(255, 255, 255, .16); color: #fff; }
.btn--sm { height: 40px; padding: 0 var(--s4); font-size: 14px; }
.btn--block { width: 100%; }
.btn-row { display: flex; gap: var(--s3); }
.btn-row .btn { flex: 1; padding: 0 var(--s3); white-space: nowrap; }
.icon-btn { width: 40px; height: 40px; border-radius: var(--r-pill); display: grid; place-items: center; font-size: 16px; background: #fff; box-shadow: var(--shadow); position: relative; }
/* glyph size is fixed, never inherited from font-size: one 20px icon in a 40px circle everywhere */
.icon-btn > .ei { width: 20px; height: 20px; vertical-align: 0; }
.icon-btn--glass { background: rgba(255, 255, 255, .7); backdrop-filter: blur(8px); box-shadow: none; }
.icon-btn .dot { position: absolute; top: var(--s2); right: var(--s2); width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--coral); }
.chip-btn { display: inline-flex; align-items: center; gap: var(--s1); height: 40px; padding: 0 var(--s4); border-radius: var(--r-pill); background: #fff; font-weight: 700; font-size: 14px; white-space: nowrap; box-shadow: var(--shadow); }
.chip-btn--float { position: absolute; z-index: 2; right: var(--s4); bottom: var(--s4); }
.chip-btn--tl { right: auto; bottom: auto; left: var(--s4); top: var(--s4); }
.coin-chip { display: inline-flex; align-items: center; gap: var(--s1); height: 40px; padding: 0 var(--s3) 0 var(--s2); border-radius: var(--r-pill); background: rgba(255, 255, 255, .85); font-weight: 800; font-size: 15px; backdrop-filter: blur(8px); }
.coin-chip--flat { background: #fff; box-shadow: var(--shadow); }
.coin { font-size: 16px; }

/* ---------- top bar (shared component: README "Komponen: Top Nav Bar") ----------
   Anatomy: <header class="topbar">[leading][.topbar__title][trailing]</header>
   - leading/trailing: .icon-btn (back = ‹, 40px circle, 20px glyph), .chip-btn (text action, 40px),
     or an empty <span></span> to keep the title centred. Never size glyphs per screen.
   - title: always 800 18px var(--display); never resize it per screen.
   - variants: default (centred title, sub-pages) · --left (tab roots, left-aligned title)
     · --light (on dark scenes, pair with .icon-btn--glass/--dark) · .topbar-group (topbar + sticky search)
     · .lb-top (logbook.js: transparent over a hero, same 40px/20px buttons). */
.topbar { display: grid; grid-template-columns: 1fr minmax(0, max-content) 1fr; align-items: center; gap: var(--s2); padding: var(--safe-top) var(--safe-x) var(--s4); flex: none; position: sticky; top: 0; z-index: 6; transition: background .2s, box-shadow .2s; }
/* Sticky topbar is global: every .topbar in a .screen pins to the top. app.js toggles .scrolled on
   any scrolling .screen, which gives the bar its frosted background. A wrapper holding the topbar
   (.audit, .lb-root) must be flex: none, or it shrinks to one screen height and the bar scrolls away. */
.screen.scrolled .topbar { background: rgba(244, 242, 236, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--line); }
.screen--lock.scrolled .topbar { background: rgba(43, 47, 99, .82); box-shadow: 0 1px 0 rgba(255, 255, 255, .12); }
.topbar > :first-child { justify-self: start; }
.topbar > :last-child { justify-self: end; }
.topbar > span:empty { width: 40px; height: 40px; }
/* one title style for every bar (also .lb-top__title): 18px display, ellipsis when it runs out of room */
.topbar__title { text-align: center; font: 800 18px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar--left { grid-template-columns: minmax(0, 1fr) auto; }
.topbar--left .topbar__title { text-align: left; }
.topbar--light { color: #fff; }
/* Variant: topbar + search that stay pinned together (Daftar Teman). The group is the sticky,
   frosting element; the inner .topbar goes static and transparent so the two read as one bar.
   <div class="topbar-group"><header class="topbar">…</header>
     <div class="topbar-group__search"><label class="search-field">🔍<input type="search"></label></div></div> */
.topbar-group { position: sticky; top: 0; z-index: 6; flex: none; background: var(--bg); transition: background .2s, box-shadow .2s; }
.topbar-group .topbar { position: static; padding-bottom: var(--s2); }
.screen.scrolled .topbar-group .topbar { background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.topbar-group__search { padding: 0 var(--safe-x) var(--s3); }
.screen.scrolled .topbar-group { background: rgba(244, 242, 236, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--line); }
.search-field { display: flex; align-items: center; gap: var(--s2); height: 44px; padding: 0 var(--s3); background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); color: var(--muted); transition: border-color .15s, box-shadow .15s; }
.search-field > .ei { width: 20px; height: 20px; vertical-align: 0; }
.search-field:focus-within { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(28, 27, 23, .08); }
.search-field input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: 14px var(--ui); color: var(--ink); }
.search-field input::placeholder { color: var(--muted); }
.footer-cta { position: sticky; z-index: 2; bottom: 0; margin-top: auto; padding: var(--s6) var(--safe-x) var(--s8); background: linear-gradient(transparent, var(--bg) var(--s6)); }
.footer-cta .btn { width: 100%; }

/* ---------- pets & stages ---------- */
.pet-svg { display: block; overflow: visible; touch-action: none; }
.pet-shadow { fill: rgba(30, 24, 8, .14); }
.stage { position: relative; display: grid; place-items: center; flex: none; }
.stage .pet-svg { width: 260px; height: 232px; }
.stage--plain { margin: var(--s4) 0; }
.stage--room {
  height: 264px; margin: 0 var(--safe-x); border-radius: var(--r-card); overflow: hidden;
  background: radial-gradient(120px 20px at 50% 88%, rgba(0, 0, 0, .1), transparent 70%), linear-gradient(#FCE7D4 0 70%, #E9C9A6 70% 100%);
}
.stage--room::before { content: ''; position: absolute; left: var(--s6); top: var(--s8); width: 56px; height: 64px; border-radius: var(--s2); background: linear-gradient(90deg, #BFE4F5 48%, #fff 48% 52%, #BFE4F5 52%); box-shadow: 0 0 0 4px #fff; }
.stage--room::after { content: ''; position: absolute; right: var(--s6); top: 120px; width: 48px; height: 48px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 17V8' fill='none' stroke='%232F8A3B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M16 17c0-5-3-9-8.5-10 0 5.5 3 9.5 8.5 10z' fill='%234FAE55'/%3E%3Cpath d='M16 15c0-6 3-10.5 9-11.5 0 6-3 10.5-9 11.5z' fill='%237FD47F'/%3E%3Cpath d='M8 19h16l-2 9H10z' fill='%23FF7A45'/%3E%3Crect x='6.5' y='16' width='19' height='4' rx='1.6' fill='%23E25A26'/%3E%3C/svg%3E") center / contain no-repeat; }
.stage--room .pet-svg { width: 240px; height: 232px; margin-top: var(--s6); position: relative; z-index: 1; }
.stage--short { height: 240px; }
/* wardrobe: "Ubah badan" takes the top-left corner, so the window moves right and the plant left */
.stage--short::before { left: auto; right: var(--s6); }
.stage--short::after { right: auto; left: var(--s6); }
.stage--short .pet-svg { height: 220px; margin-top: var(--s2); }
/* short phones (375×667): a smaller Lemari stage leaves room for a full grid row above the cart bar */
@media (max-height: 700px) {
  .stage--short { height: 176px; }
  .stage--short .pet-svg { height: 168px; margin-top: 0; }
}
.pet-svg--avatar { width: 64px; height: 56px; flex: none; }

/* ---------- speech ---------- */
.speech { position: relative; background: #fff; border-radius: var(--r-lg); padding: var(--s3) var(--s4); font-size: 14px; line-height: 1.45; box-shadow: var(--shadow); }
.bubble-row { display: flex; gap: var(--s3); align-items: center; }
.bubble-row .speech::before { content: ''; position: absolute; left: calc(var(--s1) * -1); top: 50%; width: 12px; height: 12px; background: #fff; transform: translate(-25%, -50%) rotate(45deg); border-radius: 2px; }
.speech--float { position: absolute; z-index: 4; left: 50%; top: 104px; transform: translateX(-50%); max-width: 256px; text-align: center; font-weight: 700; animation: pop .25s ease; }
.speech--float::after { content: ''; position: absolute; left: 50%; bottom: calc(var(--s1) * -1); width: 12px; height: 12px; background: #fff; transform: translate(-50%, 25%) rotate(45deg); border-radius: 2px; }
/* coach tip next to a spotlighted control (spotlight() in app.js); arrow sits at --arrow-x */
.speech--tip { position: absolute; z-index: 35; max-width: 280px; font-weight: 700; pointer-events: none; animation: tipIn .25s ease; }
.speech--tip::after { content: ''; position: absolute; left: var(--arrow-x, 50%); bottom: calc(var(--s1) * -1); width: 12px; height: 12px; background: #fff; transform: translate(-50%, 25%) rotate(45deg); border-radius: 2px; }
.speech--tip.speech--below::after { bottom: auto; top: calc(var(--s1) * -1); transform: translate(-50%, -25%) rotate(45deg); }
@keyframes tipIn { from { opacity: 0; transform: translateY(var(--s1)) scale(.96); } }
/* the control a coach tip points at: a coin-gold ring that pulses a few times */
.spot { outline: 3px solid var(--coin); outline-offset: 3px; animation: spotPulse 1s ease-in-out 3; position: relative; z-index: 1; }
@keyframes spotPulse { 50% { outline-offset: 7px; outline-color: rgba(246, 196, 69, .45); } }
@keyframes pop { from { transform: translateX(-50%) scale(.8); opacity: 0; } }

/* ---------- welcome ---------- */
.welcome { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; text-align: center; padding: calc(var(--safe-top) + var(--s6)) var(--safe-x) 0; gap: var(--s4); position: relative; }
.welcome > :not(.paws) { position: relative; z-index: 1; }
.welcome .stage--plain { margin: 0; }
.welcome .stage .pet-svg { height: 192px; }
.fact { margin: 0; width: 100%; display: flex; flex-direction: column; gap: var(--s2); text-align: left; }
.fact__row { display: flex; gap: var(--s4); align-items: center; background: #EAE6DC; border-radius: var(--r-lg); padding: var(--s4); font-size: 13px; line-height: 1.45; }
.fact__row b { font-family: var(--display); font-size: 28px; flex: none; }
.fact figcaption { font-size: 11px; line-height: 1.4; padding: 0 var(--s1); }
.fact figcaption a { color: var(--muted); text-decoration: none; }
.how { list-style: none; margin: 0; padding: var(--s1) var(--s4); width: 100%; background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow); text-align: left; }
.how li { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.how li:last-child { border: 0; }
.how li > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.how b { font-size: 14px; }
.how small { font-size: 12px; color: var(--muted); line-height: 1.4; }
.how__ic { width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center; font-size: 20px; flex: none; }
.welcome .display { max-width: 320px; }
.paws span { position: absolute; font-size: 40px; opacity: .14; }
.paws span:first-child { left: var(--s8); top: 200px; transform: rotate(-20deg); }
.paws span:last-child { right: var(--s10); top: 420px; transform: rotate(18deg); }

/* ---------- creator ---------- */
/* topbar, pet preview and the CTA stay put; only the editor below the preview scrolls */
.screen[data-screen="create"] { overflow: hidden; }
.creator { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding: var(--s6) var(--safe-x) var(--s4); display: flex; flex-direction: column; gap: var(--s4); }
.creator::-webkit-scrollbar { display: none; }
.creator > * { flex: none; }
/* body-part chips pin under the preview while swatches / parts scroll beneath them */
.creator .tabs { position: sticky; top: calc(var(--s6) * -1); z-index: 1; background: var(--bg); padding-block: var(--s2); margin-block: calc(var(--s2) * -1); }
.name-field { display: flex; align-items: center; gap: var(--s3); background: #fff; border-radius: var(--r-md); padding: 0 var(--s4); height: 56px; box-shadow: var(--shadow); }
.name-field span { font-size: 12px; font-weight: 800; color: var(--muted); }
.name-field input { flex: 1; min-width: 0; border: 0; outline: 0; font: 800 18px var(--display); background: none; color: var(--ink); }
.tabs { display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--safe-x) * -1); padding: 0 var(--safe-x); flex: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; height: 36px; padding: 0 var(--s4); border-radius: var(--r-pill); background: #EAE6DC; font-weight: 700; font-size: 13px; }
.tabs button.on { background: var(--ink); color: #fff; }
.swatches { display: flex; gap: var(--s3); flex-wrap: wrap; }
.swatches:empty { display: none; }
.swatches p { width: 100%; font-size: 12px; font-weight: 800; color: var(--muted); margin-top: var(--s2); }
.swatches p:first-child { margin-top: 0; }
.swatch { width: 36px; height: 36px; border-radius: var(--r-pill); box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .08); }
.swatch.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); }
.part-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); }
.part-grid:empty { display: none; }
.part { aspect-ratio: 1; border-radius: var(--r-md); background: #fff; display: grid; place-items: center; padding: var(--s3); box-shadow: var(--shadow); }
.part svg { width: 100%; height: 100%; }
.part.on { box-shadow: 0 0 0 3px var(--ink); }

/* ---------- onboarding progress ---------- */
.onb-title { display: flex; flex-direction: column; align-items: center; gap: var(--s2); }
.onb-steps { display: flex; gap: var(--s1); }
.onb-steps i { width: 24px; height: 4px; border-radius: var(--r-pill); background: #DDD8CC; }
.onb-steps[data-step="1"] i:nth-child(-n+1), .onb-steps[data-step="2"] i:nth-child(-n+2), .onb-steps[data-step="3"] i { background: var(--ink); }

/* ---------- connect ---------- */
.onb-head { display: flex; flex-direction: column; gap: var(--s2); }
.senses-card { display: flex; flex-direction: column; gap: var(--s4); background: #EAE6DC; border-radius: var(--r-card); padding: var(--s4); }
.senses-card .speech { flex: 1; transition: background .2s; }
.senses { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); }
.sense { display: flex; flex-direction: column; align-items: center; gap: var(--s1); padding: var(--s3) var(--s1); border-radius: var(--r-md); background: rgba(255, 255, 255, .5); color: var(--muted); transition: background .2s, transform .2s; }
.sense i { font-style: normal; font-size: 24px; line-height: 1; filter: grayscale(1); opacity: .5; transition: filter .2s, opacity .2s; }
.sense b { font-size: 13px; color: var(--ink); }
.sense small { font-size: 11px; font-weight: 700; }
.sense.on { background: #fff; color: var(--green-d); box-shadow: var(--shadow); }
.sense.on i { filter: none; opacity: 1; }
.conn-groups { display: flex; flex-direction: column; gap: var(--s5); }
.conn-groups .set-label { margin: 0 0 calc(var(--s3) * -1); }
.conn-groups .int-row { padding: var(--s4); }
.conn-cta { height: 32px; display: inline-flex; align-items: center; padding: 0 var(--s3); border-radius: var(--r-pill); background: #E6EEFB; color: #2569C2; font-size: 13px; font-weight: 700; white-space: nowrap; }
.conn-ok { font-size: 13px; font-weight: 700; color: var(--green-d); white-space: nowrap; }
.switch { appearance: none; width: 48px; height: 28px; border-radius: var(--r-pill); background: #DDD8CC; position: relative; transition: background .2s; flex: none; cursor: pointer; margin: 0; }
.switch::after { content: ''; position: absolute; top: var(--s1); left: var(--s1); width: 20px; height: 20px; border-radius: var(--r-pill); background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(20px); }
.secure { font-size: 12px; color: var(--muted); line-height: 1.5; padding: 0 var(--s1); }

/* ---------- audit ---------- */
.scan-loading { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s5); padding: 0 var(--s8); text-align: center; }
.scan-loading .pet-svg { width: 240px; height: 220px; }
.progress { width: 100%; height: 8px; border-radius: var(--r-pill); background: #E6E1D6; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; border-radius: var(--r-pill); background: var(--ink); transition: width .5s ease; }
.progress--green i { background: var(--green); }
.progress--coral i { background: var(--coral); }
.progress--coin i { background: var(--coin); }
.audit { display: flex; flex-direction: column; min-height: 100%; flex: none; }
.reveal { background: var(--ink); color: #fff; border-radius: var(--r-card); padding: var(--s6) var(--s5); display: flex; flex-direction: column; gap: var(--s3); }
.reveal em { font-style: normal; color: #FF9B86; }
.reveal p:last-child { color: rgba(255, 255, 255, .75); font-size: 14px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.compare__col { background: #fff; border-radius: var(--r-card); padding: var(--s4) var(--s3) var(--s5); display: flex; flex-direction: column; align-items: center; gap: var(--s2); box-shadow: var(--shadow); }
.compare__col .pet-svg { width: 132px; height: 120px; }
.compare__col small { color: var(--muted); font-size: 12px; }
.tag { font-size: 12px; font-weight: 800; padding: var(--s1) var(--s3); border-radius: var(--r-pill); }
.tag--green { background: var(--green-l); color: var(--green-d); }
.tag--coral { background: var(--coral-l); color: var(--coral); }
.tag--muted { background: var(--line); color: var(--muted); }
.bar { width: 48px; height: 96px; background: #F1EEE6; border-radius: var(--r-sm); display: flex; align-items: flex-end; overflow: hidden; margin: var(--s1) 0; }
.bar i { display: block; width: 100%; background: var(--green); border-radius: var(--r-sm); }
.bar--coral i { background: var(--coral); }
.breakdown { list-style: none; margin: 0; padding: var(--s1) var(--s5); background: #fff; border-radius: var(--r-card); box-shadow: var(--shadow); }
.breakdown li { display: flex; justify-content: space-between; padding: var(--s4) 0; font-size: 14px; border-bottom: 1px solid var(--line); }
.breakdown li:last-child { border: 0; }
.breakdown b { color: var(--coral); }

/* ---------- home world ---------- */
.world { position: relative; height: 456px; flex: none; overflow: hidden; user-select: none; -webkit-user-select: none; }
.scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene .sky-top { stop-color: var(--day, var(--sky-top)); transition: stop-color .8s; }
.scene .sky-bot { stop-color: var(--day, var(--sky-bot)); transition: stop-color .8s; }
.scene .far circle { fill: #8CCB84; }
.scene .trunk { fill: #8C5A3C; }
.scene .canopy { fill: #3E9A4A; }
.scene .canopy--pink { fill: #F4B6C8; }
.scene .fruit { fill: #EF5F45; }
.scene .fence rect { fill: #F5EBDD; }
.scene .grass { fill: var(--green); }
.scene .bush circle { fill: #3A8F45; }
.scene .night-only { display: none; }
.scene .sky-cut { fill: var(--night-top); }
.world.night .scene .sky-top { stop-color: var(--night-top); }
.world.night .scene .sky-bot { stop-color: var(--night-bot); }
.world.night .scene .day-only { display: none; }
.world.night .scene .night-only { display: inline; }
.world.night .scene .far circle, .world.night .scene .canopy { fill: #2D5A4A; }
.world.night .scene .canopy--pink { fill: #6C5A86; }
.world.night .scene .grass, .world.night .scene .bush circle { fill: #2E6A45; }
.world.night .scene .fence rect { fill: #9A9CC2; }
.world.night .world__hud { color: #fff; }
.world.night .pet-shadow { fill: rgba(0, 0, 20, .3); }
.world__hud { position: absolute; z-index: 3; top: var(--safe-top); left: var(--safe-x); right: var(--safe-x); display: flex; justify-content: space-between; align-items: flex-start; transition: color .6s; }
.hud-right { display: flex; gap: var(--s2); }
.pet-svg--world { position: absolute; z-index: 2; left: 50%; bottom: 104px; width: 292px; height: 224px; transform: translateX(-50%); cursor: grab; }
.dock { position: absolute; z-index: 3; left: var(--safe-x); right: var(--safe-x); bottom: var(--s10); display: flex; justify-content: space-between; gap: var(--s2); }
.dock button { flex: 1; height: 60px; border-radius: var(--r-lg); background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); font-size: 11px; font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s1); box-shadow: var(--shadow); transition: transform .12s; }
.dock button span { font-size: 20px; line-height: 1; }
.dock button:active { transform: scale(.94); }
.dock button.on { background: var(--ink); color: #fff; }

/* ---------- home sheet ---------- */
.sheet { position: relative; z-index: 4; margin-top: calc(var(--s6) * -1); background: var(--bg); border-radius: 28px 28px 0 0; padding: var(--s6) var(--safe-x) 0; display: flex; flex-direction: column; gap: var(--s4); }
.mood-line { display: flex; gap: var(--s3); align-items: center; font-size: 13px; font-weight: 600; line-height: 1.45; background: #fff; border-radius: var(--r-lg); padding: var(--s4); box-shadow: var(--shadow); }
.mood-line b { font-weight: 800; }
.mood-line .ei { width: 32px; height: 32px; vertical-align: 0; }
.card { background: var(--card); border-radius: var(--r-card); padding: var(--s5); box-shadow: var(--shadow); }
.card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s4); }
.card__head h3 { font-size: 16px; font-weight: 800; }
.jar { display: grid; grid-template-columns: 1fr 80px; gap: var(--s4); }
.jar__text { display: flex; flex-direction: column; gap: var(--s2); }
.jar__vis svg { width: 80px; height: 96px; }
.jar__goal { grid-column: 1 / -1; display: flex; flex-direction: column; gap: var(--s2); }
.jar__goal small { font-size: 12px; color: var(--muted); font-weight: 600; }
.jar__more { grid-column: 1 / -1; }
.jar-sum { display: flex; flex-direction: column; gap: var(--s2); background: #fff; border-radius: var(--r-md); padding: var(--s4); box-shadow: var(--shadow); }
.jar-sum__row { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); }
.jar-sum__row .money { display: inline-flex; align-items: center; gap: var(--s1); }
.jar-sum small { font-size: 12px; color: var(--muted); line-height: 1.45; }
.jar-src { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.jar-src li { display: flex; align-items: center; gap: var(--s3); background: #fff; border-radius: var(--r-md); padding: var(--s3) var(--s4); box-shadow: var(--shadow); }
.jar-src .ic { font-size: 22px; width: 28px; text-align: center; }
.jar-src .tx { flex: 1; display: flex; flex-direction: column; gap: var(--s1); min-width: 0; }
.jar-src .tx b { font-size: 13px; }
.jar-src .tx small { font-size: 11px; color: var(--muted); }
.jar-src .amt { font-size: 14px; color: var(--green-d); white-space: nowrap; }
.triad { display: flex; flex-direction: column; }
.triad .card__head { margin-bottom: var(--s1); }
.stat { display: flex; gap: var(--s4); align-items: center; padding: var(--s4) 0; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; transition: transform .12s ease, opacity .12s ease; }
.stat:active { transform: scale(.98); opacity: .8; }
.stat:focus-visible { outline: 2px solid var(--green); border-radius: var(--r-sm); }
.stat:last-child { border: 0; padding-bottom: 0; }
.stat__ic { width: 44px; height: 44px; border-radius: var(--r-sm); display: grid; place-items: center; font-size: 20px; flex: none; }
.stat__body { flex: 1; display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.stat__body small { line-height: 1.35; transition: color .2s ease; }
.stat__row { display: flex; justify-content: space-between; align-items: baseline; }
.stat__v { font-family: var(--display); font-weight: 800; font-size: 20px; line-height: 1; }
.stat__v small { font-size: 12px; color: var(--muted); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: var(--s4); align-items: center; padding: var(--s4) 0; border-bottom: 1px solid var(--line); animation: fadeIn .3s ease; }
.feed li:first-child { padding-top: 0; }
.feed li:last-child { border: 0; padding-bottom: 0; }
.feed .ic { width: 44px; height: 44px; border-radius: var(--r-sm); display: grid; place-items: center; font-size: 20px; flex: none; background: #F3F0E8; }
.feed .tx { flex: 1; font-size: 14px; line-height: 1.4; font-weight: 600; }
.feed .tx small { display: block; color: var(--muted); font-size: 12px; margin-top: var(--s1); font-weight: 500; }
.feed .amt { font-weight: 800; font-size: 13px; white-space: nowrap; }

/* ---------- tab bar (gamified) ---------- */
.tabbar {
  position: absolute; z-index: 20; left: 0; right: 0; bottom: 0; height: var(--tabbar-h);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: start; padding: var(--s3) var(--s1) var(--s6);
  background: #fff; border-radius: var(--r-card) var(--r-card) 0 0;
  box-shadow: 0 -4px 0 #EDE9E0, 0 -8px 24px rgba(30, 24, 8, .08);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: var(--s1); color: #A39E92; font-size: 11px; font-weight: 700; }
.tab__icon {
  position: relative; width: 52px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center;
  border: 2px solid transparent; transition: background .2s, border-color .2s, box-shadow .2s, transform .2s;
}
.tab__icon svg { width: 28px; height: 28px; filter: saturate(.5) opacity(.7); transition: filter .2s, transform .2s; }
.tab.on { color: var(--tc-d); }
.tab.on .tab__icon { background: var(--tc-l); border-color: var(--tc); box-shadow: 0 4px 0 var(--tc); transform: translateY(-4px); animation: tabPop .45s cubic-bezier(.3, 1.6, .5, 1); }
.tab.on .tab__icon svg { filter: none; transform: scale(1.12); }
.tab:active .tab__icon { transform: scale(.9); }
@keyframes tabPop { 0% { transform: translateY(0) scale(.8); } 60% { transform: translateY(-8px) scale(1.1); } 100% { transform: translateY(-4px) scale(1); } }
.badge {
  position: absolute; top: calc(var(--s2) * -1); right: calc(var(--s1) * -1); min-width: 20px; height: 20px; padding: 0 var(--s1);
  border-radius: var(--r-pill); display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 700;
  border: 2px solid #fff; animation: wiggle 2.4s ease-in-out infinite;
}
.badge--alert { background: var(--coral); color: #fff; }
.badge--coin { background: var(--coin); color: #6B4A00; right: calc(var(--s3) * -1); }
.badge--coin b { font-weight: 700; }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-12deg); } 90% { transform: rotate(10deg); } 95% { transform: rotate(-6deg); } }
.phone[data-tabbar="off"] .tabbar { display: none; }

/* ---------- scanner: full-bleed camera, result opens in #modal ---------- */
.screen--cam { background: #000; color: #fff; overflow: hidden; }
.cam { position: absolute; inset: 0; }
.cam__feed { position: absolute; inset: 0; background: #000; }
.cam__demo, .cam__demo img, .vf-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam__demo.missing { background: radial-gradient(circle at 50% 42%, #4A3B2E, #15120F 75%); }
.missing > img { visibility: hidden; }
.ph-tag { display: none; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: max-content; max-width: 90%; padding: var(--s1) var(--s2); border-radius: var(--r-sm); border: 1px dashed rgba(255, 255, 255, .6); color: rgba(255, 255, 255, .8); font-size: 11px; font-weight: 700; text-align: center; }
.missing > .ph-tag { display: block; }
.cam__demo .ph-tag { top: 74%; }
#vf-shot.fit { object-fit: contain; }
.cam__top { position: absolute; left: 0; right: 0; top: 0; background: linear-gradient(rgba(0, 0, 0, .55), transparent); }
.cam__guide { position: absolute; z-index: 2; left: var(--safe-x); right: var(--safe-x); top: calc(var(--safe-top) + 56px); display: flex; flex-direction: column; align-items: center; gap: var(--s2); text-align: center; transition: opacity .2s; }
.cam__hint { font-size: 15px; font-weight: 800; text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }
.cam__kinds { display: flex; gap: var(--s2); }
.cam__kinds span { display: inline-flex; align-items: center; gap: var(--s1); height: 32px; padding: 0 var(--s3); border-radius: var(--r-pill); background: rgba(0, 0, 0, .45); backdrop-filter: blur(8px); font-size: 13px; font-weight: 700; }
.cam__kinds .ei { width: 18px; height: 18px; }
.cam__box { position: absolute; z-index: 1; left: 50%; top: 52%; width: 280px; height: 280px; transform: translate(-50%, -50%); pointer-events: none; }
.cam__box > i { position: absolute; width: 36px; height: 36px; border: 4px solid #fff; filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .4)); }
.cam__box > i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 16px 0 0 0; }
.cam__box > i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 16px 0 0; }
.cam__box > i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 16px; }
.cam__box > i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 16px 0; }
.scanline { position: absolute; left: var(--s3); right: var(--s3); height: 2px; background: var(--green); box-shadow: 0 0 16px 4px rgba(79, 174, 85, .6); animation: scan 2.2s ease-in-out infinite; opacity: .7; }
@keyframes scan { 0%, 100% { top: 16px; } 50% { top: 262px; } }
.cam__feed.frozen ~ .cam__box .scanline { animation-duration: .7s; opacity: 1; }
.cam__feed.frozen ~ .cam__guide { opacity: 0; }
@keyframes flash { to { opacity: 0; } }
.cam__feed.flash::after { content: ''; position: absolute; z-index: 4; inset: 0; background: #fff; animation: flash .35s ease-out forwards; pointer-events: none; }
.vf-reading { position: absolute; z-index: 3; left: 50%; top: calc(52% + 160px); transform: translateX(-50%); display: flex; align-items: center; gap: var(--s2); height: 36px; padding: 0 var(--s4); border-radius: var(--r-pill); background: rgba(0, 0, 0, .6); font-size: 13px; font-weight: 700; white-space: nowrap; backdrop-filter: blur(6px); }
.vf-reading[hidden] { display: none; }
.vf-reading .spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .3); border-top-color: #fff; animation: rot .7s linear infinite; }
.cam__bar { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: var(--s12) var(--safe-x) var(--s8); display: flex; flex-direction: column; align-items: center; gap: var(--s4); background: linear-gradient(transparent, rgba(0, 0, 0, .7) 40%); }
.cam__row { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 0 var(--s6); }
.cam__gal { position: relative; width: 48px; height: 48px; border-radius: var(--r-sm); overflow: hidden; border: 2px solid #fff; background: #2A2620; flex: none; }
.cam__gal img { width: 100%; height: 100%; object-fit: cover; }
.cam__gal--ghost { visibility: hidden; }
.shutter { width: 72px; height: 72px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px #000, 0 0 0 8px rgba(255, 255, 255, .85); transition: transform .15s; display: grid; place-items: center; }
.shutter:active { transform: scale(.9); }
.shutter.again::before { content: ''; width: 24px; height: 24px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' color='%231C1B17'%3E%3Cpath d='M25 16a9 9 0 1 1-2.6-6.4M23 4.5V10h-5.5' fill='none' stroke='currentColor' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.shutter:disabled { opacity: .5; }
.vf-modes { display: flex; gap: var(--s2); font-size: 13px; font-weight: 700; }
.vf-modes button { height: 32px; padding: 0 var(--s4); border-radius: var(--r-pill); color: rgba(255, 255, 255, .6); transition: color .2s, background .2s; }
.vf-modes button.on { color: #FFD60A; background: rgba(255, 255, 255, .14); }

/* simulated iOS permission alert + photo picker (system font and iOS colours on purpose) */
.ios-dim { position: absolute; z-index: 20; inset: 0; background: rgba(0, 0, 0, .4); display: grid; place-items: center; animation: fadeIn .2s ease; font-family: -apple-system, 'SF Pro Text', system-ui, sans-serif; }
.ios-dim[hidden] { display: none; }
.ios-alert { width: 272px; border-radius: 14px; background: rgba(242, 242, 247, .94); backdrop-filter: blur(20px); color: #000; text-align: center; overflow: hidden; animation: iosPop .25s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes iosPop { from { transform: scale(1.12); opacity: 0; } }
.ios-alert__body { padding: var(--s5) var(--s4) var(--s4); display: flex; flex-direction: column; gap: var(--s1); }
.ios-alert__body b { font-size: 17px; font-weight: 600; line-height: 1.3; }
.ios-alert__body p { font-size: 13px; line-height: 1.35; }
.ios-alert button { display: block; width: 100%; height: 44px; border-top: .5px solid rgba(60, 60, 67, .3); color: #007AFF; font: inherit; font-size: 17px; }
.ios-alert button:active { background: rgba(0, 0, 0, .06); }
.ios-dim--sheet { place-items: end stretch; }
.ios-picker { height: calc(100% - var(--safe-top)); background: #fff; color: #000; border-radius: 12px 12px 0 0; display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4) 0 var(--s6); overflow-y: auto; animation: up .3s cubic-bezier(.2, .9, .3, 1); }
.ios-picker__bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 var(--safe-x); }
.ios-picker__bar button { justify-self: start; color: #007AFF; font: inherit; font-size: 17px; }
.ios-seg { display: flex; padding: 2px; border-radius: 9px; background: rgba(118, 118, 128, .12); font-size: 13px; font-weight: 600; }
.ios-seg span { padding: var(--s1) var(--s5); border-radius: 7px; }
.ios-seg .on { background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .12); }
.ios-search { margin: 0 var(--safe-x); height: 36px; border-radius: 10px; background: rgba(118, 118, 128, .12); color: rgba(60, 60, 67, .6); display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s2); font-size: 17px; }
.ios-search svg { width: 16px; height: 16px; flex: none; }
.ios-limited { margin: 0 var(--safe-x); font-size: 13px; color: rgba(60, 60, 67, .7); }
.ios-limited b { color: #007AFF; font-weight: 400; }
.ios-sec { padding: 0 var(--safe-x); font-size: 20px; font-weight: 700; }
.ios-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.ios-grid button { position: relative; aspect-ratio: 1; background: #E5E5EA; overflow: hidden; }
.ios-grid button.missing { background: #3A3A3C; }
.ios-grid img { width: 100%; height: 100%; object-fit: cover; }
.ios-grid button:active { opacity: .7; }
.ios-more { align-self: center; margin-top: var(--s2); color: #007AFF; font: inherit; font-size: 15px; }

/* result sheet */
.scan-head { display: flex; gap: var(--s4); align-items: center; }
.scan-head .label { margin-bottom: var(--s1); }
.grade { width: 56px; height: 56px; border-radius: var(--r-md); display: grid; place-items: center; font: 800 32px var(--display); color: #fff; flex: none; transition: background .3s; }
.grade--d { background: var(--coral); }
.grade--a { background: #2F8A3B; }
.grade--b { background: #8BC34A; }
.grade--c { background: #F6A623; }
.sc-items { display: flex; flex-direction: column; gap: var(--s3); }
.sc-items__head { display: flex; align-items: center; gap: var(--s3); }
.sc-items__th { width: 40px; height: 40px; border-radius: var(--r-sm); background: #2A2620 center / cover; flex: none; }
.sc-items__head b { display: block; font-size: 15px; }
.sc-items__head small { font-size: 12px; color: var(--muted); font-weight: 600; }
.sc-item { display: flex; align-items: center; gap: var(--s3); font-size: 14px; }
.sc-item__ic { width: 40px; height: 40px; border-radius: var(--r-sm); background: #F3F0E8; display: grid; place-items: center; font-size: 22px; flex: none; }
.sc-item__ic .ei { width: 24px; height: 24px; }
.sc-item__tx { flex: 1; min-width: 0; }
.sc-item__tx b { display: block; font-weight: 700; }
.sc-item__tx small, .sc-item__v small { font-size: 12px; color: var(--muted); font-weight: 600; }
.sc-item__v { text-align: right; font-weight: 800; white-space: nowrap; }
.sc-item__v small { display: block; }
.sc-items__list { display: flex; flex-direction: column; gap: var(--s3); }
.sc-items__note { font-size: 12px; color: var(--muted); font-weight: 600; }
/* a row changed by a picked swap */
.sc-item--swap { margin: calc(-1 * var(--s2)); padding: var(--s2); border-radius: var(--r-md); background: var(--green-l); animation: sc-swap-in .4s ease; }
.sc-item--swap .sc-item__ic { background: #fff; }
.sc-item--swap .sc-item__tx small, .sc-item--swap .sc-item__v { color: var(--green-d); }
.sc-item--gone .sc-item__tx b, .sc-item--gone .sc-item__v { color: var(--muted); text-decoration: line-through; }
.sc-item s, .sc-total s { color: var(--muted); font-weight: 600; }
@keyframes sc-swap-in { from { background: #fff; } }
.sc-total { display: flex; justify-content: space-between; padding-top: var(--s3); border-top: 1px dashed #D8D3C7; font-size: 14px; font-weight: 800; }
.sc-total small { color: var(--muted); font-weight: 700; }
/* the Makan calorie card, in context: today so far (solid) + what this scan adds (striped) */
.sc-add { font-size: 12px; font-weight: 800; padding: var(--s1) var(--s3); border-radius: var(--r-pill); background: #FFF1D6; color: #A86A00; white-space: nowrap; }
.sc-add.over { background: var(--coral-l); color: var(--coral); }
.sc-bar { display: flex; }
.sc-bar i { border-radius: 0; }
.sc-bar i:first-child { border-radius: var(--r-pill) 0 0 var(--r-pill); }
.sc-bar i.add { background: repeating-linear-gradient(-45deg, currentColor 0 4px, transparent 4px 8px); opacity: .6; }
.sc-bar.progress--coin { color: var(--coin); }
.sc-bar.progress--green { color: var(--green); }
.sc-bar.progress--coral { color: var(--coral); }
.sc-bar.sc-bar--amber { color: #F6A623; }
.sc-bar.sc-bar--amber i:not(.add) { background: #F6A623; }
.lb-macro b em { font-style: normal; color: #A86A00; }
.lb-macro.over b em { color: var(--coral); }
.sc-day__note { font-size: 13px; color: var(--muted); font-weight: 600; line-height: 1.4; }
.sc-day__note b { color: var(--ink); }
.sc-day__note b.risk { color: var(--coral); }
/* recommended swaps: tick what to change and the card above follows */
.sc-rec { display: flex; flex-direction: column; gap: var(--s3); }
.sc-rec__head { display: flex; align-items: center; gap: var(--s3); }
.sc-rec__head .pet-svg, .sc-ok .pet-svg { width: 64px; height: 56px; flex: none; }
.sc-rec__head b { display: block; font-size: 15px; }
.sc-rec__head small { font-size: 12px; color: var(--muted); font-weight: 600; }
.sc-swap { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r-md); background: #fff; box-shadow: var(--shadow); text-align: left; border: 2px solid transparent; transition: border-color .2s, background .2s; }
.sc-swap.on { border-color: var(--green); background: var(--green-l); }
.sc-swap .chk { width: 24px; height: 24px; margin-top: 2px; border-radius: var(--r-pill); border: 2px solid #D8D3C7; display: grid; place-items: center; flex: none; }
.sc-swap.on .chk { background: var(--green); border-color: var(--green); }
.sc-swap.on .chk::before { content: ''; width: 12px; height: 12px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M7 16.5l6 6L25 10' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.sc-swap__tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s1); }
.sc-swap__tx b { font-size: 14px; }
.sc-pick { font-style: normal; font-size: 11px; font-weight: 800; padding: 2px var(--s2); margin-left: var(--s1); border-radius: var(--r-pill); background: var(--ink); color: #fff; white-space: nowrap; vertical-align: 1px; }
.sc-swap__tx small { font-size: 12px; color: var(--muted); line-height: 1.4; }
.sc-tags { display: flex; flex-wrap: wrap; gap: var(--s1); }
.sc-tags span { font-size: 11px; font-weight: 800; padding: 2px var(--s2); border-radius: var(--r-pill); background: var(--green-l); color: var(--green-d); }
.sc-swap.on .sc-tags span { background: #fff; }
.sc-ok { display: flex; gap: var(--s3); align-items: center; background: var(--green-l); border-radius: var(--r-lg); padding: var(--s4); }
.sc-ok b { display: block; font-size: 15px; }
.sc-ok small { font-size: 12px; color: var(--green-d); font-weight: 700; }
.sc-cta { position: sticky; bottom: calc(var(--s10) * -1); margin: 0 calc(var(--safe-x) * -1) calc(var(--s10) * -1); padding: var(--s3) var(--safe-x) var(--s8); background: linear-gradient(transparent, var(--bg) var(--s4)); display: flex; flex-direction: column; gap: var(--s2); }
.sc-cta p { text-align: center; font-size: 12px; font-weight: 700; color: var(--green-d); }
.sc-cta .btn { font-size: 15px; }
.scan-decided { text-align: center; font-size: 14px; font-weight: 700; padding: var(--s3); border-radius: var(--r-md); background: #EAE6DC; }

/* ---------- plan ---------- */
.plan-hero { display: flex; align-items: center; gap: var(--s2); }
.plan-hero .pet-svg { width: 148px; height: 140px; flex: none; }
.impact__row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
.impact__row div { display: flex; flex-direction: column; gap: var(--s1); min-width: 0; }
.impact__row small { font-size: 11px; color: var(--muted); font-weight: 700; }
.chal-title { display: flex; flex-direction: column; gap: var(--s4); }
.chal-title small { font-size: 12px; font-weight: 600; }
.commits, .wk-list { display: flex; flex-direction: column; gap: var(--s3); }
.chal { display: flex; flex-direction: column; gap: var(--s3); background: #fff; border-radius: var(--r-lg); padding: var(--s4); box-shadow: var(--shadow); transition: box-shadow .15s; }
.chal.on { box-shadow: 0 0 0 2px var(--green), var(--shadow); }
.chal.is-done { box-shadow: 0 0 0 2px var(--coin), var(--shadow); }
.chal__head { display: flex; gap: var(--s3); align-items: center; width: 100%; text-align: left; }
.chal__head .ic { width: 44px; height: 44px; border-radius: var(--r-sm); background: #F3F0E8; display: grid; place-items: center; font-size: 20px; flex: none; }
.chal__head .tx { flex: 1; display: flex; flex-direction: column; gap: var(--s1); min-width: 0; }
.chal__head .tx b { font-size: 14px; line-height: 1.4; }
.chal__head .tx small { font-size: 12px; color: var(--green-d); font-weight: 700; }
.chal__head .chk { width: 28px; height: 28px; border-radius: var(--r-pill); border: 2px solid #D8D3C7; display: grid; place-items: center; flex: none; color: #fff; font-size: 14px; }
.chal.on .chk { background: var(--green); border-color: var(--green); }
.chal .seg button { font-size: 11px; }
.chal__foot, .chal__meta { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.chal__meta b { font-size: 13px; }
.chal__tag { font-size: 11px; font-weight: 700; color: var(--muted); }
.chal__tag.auto { color: var(--green-d); }
.coin-pill { display: inline-flex; align-items: center; gap: var(--s1); flex: none; padding: var(--s1) var(--s2); border-radius: var(--r-pill); background: #FFF3D1; color: #6B4A00; font-size: 12px; font-weight: 800; white-space: nowrap; }
.coin-pill .cur, .chal__foot .cur { width: 16px; height: 16px; }
.chal__days { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--s1); }
.chal__days span { display: flex; flex-direction: column; align-items: center; gap: var(--s1); font-size: 11px; font-weight: 700; color: var(--muted); }
.chal__days i { width: 28px; height: 28px; border-radius: var(--r-pill); background: #F3F0E8; display: grid; place-items: center; font-style: normal; font-size: 12px; color: #fff; }
.chal__days i.hit { background: var(--green); }
.chal__days i.miss { background: #EEEAE1; }
.chal__days i.today { box-shadow: 0 0 0 2px var(--ink); }
.chal__note { font-size: 12px; font-weight: 600; color: var(--muted); }
.chal__note.bad { color: var(--coral); }
.wk-bar { display: block; height: 4px; margin-top: var(--s1); }
.wk-empty { padding: var(--s4); }
.wk-talk .speech { flex: 1; font-size: 13px; }
.wk-sec { display: flex; flex-direction: column; gap: var(--s3); }
.wk-sec .set-label { margin: 0; }
.wk-sec .fr-board-more-btn { margin-top: 0; }
.wk-log { display: flex; flex-direction: column; gap: var(--s4); }
.wk-log .wk-sec { gap: var(--s2); }
.wk-log__day { font-size: 13px; font-weight: 800; }
.wk-log .set-group { box-shadow: none; border: 1px solid var(--line); }
.wk-log .int-row__body b { font-size: 14px; }
.wk-log__time { flex: none; font-size: 12px; font-weight: 700; color: var(--muted); }
.impact { background: var(--ink); color: #fff; }
.impact .label, .impact small { color: rgba(255, 255, 255, .6) !important; }
.impact__row { margin-top: var(--s3); }
.impact .money { color: var(--coin); }

/* ---------- wardrobe ---------- */
/* topbar, preview and category tabs stay put; only the item grid scrolls */
.screen[data-screen="wardrobe"] { overflow: hidden; }
.ward { flex: 1; min-height: 0; padding: var(--s6) var(--safe-x) 0; display: flex; flex-direction: column; gap: var(--s3); }
.ward-grid {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; align-content: start;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4) var(--s3);
  margin: 0 calc(var(--safe-x) * -1); padding: var(--s2) var(--safe-x) calc(var(--tabbar-h) + 104px);
}
.ward-grid::-webkit-scrollbar { display: none; }
.ward-item { position: relative; aspect-ratio: 1; border-radius: var(--r-lg); background: #fff; display: grid; place-items: center; padding: var(--s4); box-shadow: var(--shadow); }
.ward-item > svg:first-child { width: 100%; height: 100%; }
.ward-item .price {
  position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%);
  font-size: 13px; font-weight: 800; line-height: 1.2;
  background: var(--coin); border-radius: var(--r-pill);
  padding: 3px 10px; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
}
.ward-item .price .cur { width: 15px; height: 15px; }
.ward-item .price.owned { background: var(--green-l); color: var(--green-d); }
.ward-item.on { box-shadow: 0 0 0 3px var(--ink); }
.ward-item__preview {
  position: absolute; top: var(--s2); left: var(--s2);
  width: 22px; height: 22px; border-radius: var(--r-pill);
  background: var(--ink); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 2px 6px rgba(28, 27, 23, .25);
  pointer-events: none; z-index: 2;
  animation: wardPop .18s cubic-bezier(.2, 1.3, .4, 1);
}
.ward-item__preview .ei, .ward-item__preview svg { width: 14px; height: 14px; color: #fff; }
@keyframes wardPop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ward-item.worn::after { content: ''; position: absolute; top: var(--s2); right: var(--s2); width: 20px; height: 20px; border-radius: var(--r-pill); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' color='%23fff'%3E%3Cpath d='M7 16.5l6 6L25 10' fill='none' stroke='currentColor' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat, var(--green); z-index: 2; }
.ward-bar { position: absolute; z-index: 21; left: var(--safe-x); right: var(--safe-x); bottom: calc(var(--tabbar-h) + var(--s3)); display: flex; align-items: center; justify-content: space-between; gap: var(--s3); background: #fff; border-radius: var(--r-lg); padding: var(--s3) var(--s3) var(--s3) var(--s4); box-shadow: 0 8px 24px rgba(30, 24, 8, .16); animation: fadeIn .2s ease; }
.ward-bar__info { flex: 1; display: flex; flex-direction: column; gap: var(--s1); min-width: 0; text-align: left; }
.ward-bar b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ward-bar small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ward-bar__undo { flex: none; font-size: 18px; background: #EAE6DC; box-shadow: none; }
/* saved outfits: two columns of mini pets wearing the template */
.ward-grid--outfits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.outfit { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: var(--s1); padding: var(--s2) var(--s3) var(--s3); border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow); cursor: pointer; }
.outfit.on { box-shadow: 0 0 0 3px var(--ink); }
.outfit .pet-svg { width: 100%; height: 132px; }
.outfit__row { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-width: 0; }
.outfit__row b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.outfit__row small { flex: none; font-size: 11px; font-weight: 700; color: var(--muted); }
.outfit__row small.gain { color: var(--green-d); }
.outfit__more { position: absolute; top: var(--s2); right: var(--s2); width: 32px; height: 32px; border-radius: var(--r-pill); background: #F4F2EC; font-size: 18px; font-weight: 800; line-height: 1; }
.outfit--new { justify-content: center; align-items: center; text-align: center; min-height: 180px; background: none; box-shadow: inset 0 0 0 2px #D9D4C8; }
.outfit--new span { font-size: 28px; font-weight: 800; color: var(--muted); }
.outfit--new b { font-size: 14px; }
.outfit--new small { font-size: 12px; color: var(--muted); }
.outfit-hint { grid-column: 1 / -1; text-align: center; padding: 0 var(--s4); }
/* cart sheet */
.cart-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.cart-row:last-child { border: 0; }
.cart-row__th { flex: none; width: 48px; height: 48px; border-radius: var(--r-sm); background: #F4F2EC; display: grid; place-items: center; padding: var(--s1); }
.cart-row__th svg { width: 100%; height: 100%; }
.cart-row .price-chip { flex: none; font-size: 12px; font-weight: 800; }
.cart-row__x { flex: none; width: 32px; height: 32px; border-radius: var(--r-pill); background: #F4F2EC; color: var(--muted); font-weight: 800; }

/* ---------- nudges ---------- */
.screen--lock { background: linear-gradient(160deg, #2B2F63, #6B4D8C 60%, #E0907A); color: #fff; }
.lock-time { text-align: center; display: flex; flex-direction: column; gap: var(--s1); }
.lock-time b { font: 700 72px/1 var(--display); letter-spacing: -.03em; }
.lock-time small { font-size: 15px; opacity: .8; font-weight: 600; }
.nudge-tabs { display: flex; gap: var(--s1); padding: var(--s1); border-radius: var(--r-pill); background: rgba(255, 255, 255, .14); }
.nudge-tabs button { flex: 1; height: 36px; border-radius: var(--r-pill); font-size: 12px; font-weight: 800; color: rgba(255, 255, 255, .7); }
.nudge-tabs button.on { background: #fff; color: var(--ink); }
.nudge-stack { display: flex; flex-direction: column; gap: var(--s3); padding-bottom: calc(var(--tabbar-h) + var(--s8)); }
.widget { border-radius: 28px; padding: var(--s5); display: flex; flex-direction: column; gap: var(--s4); background: rgba(255, 255, 255, .16); backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, .2); animation: fadeIn .3s ease; }
.widget .label { color: rgba(255, 255, 255, .7); }
.widget b { display: block; font-size: 17px; line-height: 1.3; margin: var(--s1) 0; }
.widget small { font-size: 13px; line-height: 1.5; opacity: .85; }
.widget .pet-svg--widget { width: 100%; height: 120px; }
.widget--morning { background: rgba(255, 236, 200, .22); }
.qris-head { display: flex; gap: var(--s3); align-items: center; }
.qris-logo { width: 48px; height: 48px; border-radius: var(--r-sm); background: #fff; color: #D6232A; font-weight: 900; font-size: 13px; display: grid; place-items: center; flex: none; }
.qris-chips { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.qris-chips button { height: 48px; border-radius: var(--r-md); background: rgba(255, 255, 255, .92); color: var(--ink); font-weight: 800; font-size: 14px; }
.qris-chips button.on { background: var(--green); color: #fff; }
.qris-chips button:disabled { opacity: .45; }
.qris-pet { display: flex; gap: var(--s3); align-items: center; }

/* ---------- modal / toast / confetti ---------- */
.backdrop { position: absolute; inset: 0; z-index: 30; background: rgba(20, 16, 8, .36); animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { position: absolute; z-index: 31; left: 0; right: 0; bottom: 0; background: var(--bg); border-radius: 28px 28px 0 0; padding: var(--s3) var(--safe-x) var(--s10); display: flex; flex-direction: column; gap: var(--s2); animation: up .45s cubic-bezier(.32, .72, 0, 1); }
@keyframes up { from { transform: translateY(100%); } }
.modal.is-dragging { user-select: none; -webkit-user-select: none; will-change: transform; }
.modal .grabber { cursor: grab; }
.modal.is-dragging .grabber { cursor: grabbing; }
.sheet-ghost { pointer-events: none; }
.grabber { width: 40px; height: 4px; border-radius: var(--r-pill); background: #D6D0C3; margin: 0 auto var(--s3); }
.food-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin-top: var(--s3); }
.food { background: #fff; border-radius: var(--r-lg); padding: var(--s4) var(--s2); display: flex; flex-direction: column; align-items: center; gap: var(--s1); box-shadow: var(--shadow); }
.food span { font-size: 36px; }
.food b { font-size: 13px; }
.food small { font-size: 11px; font-weight: 700; }
.toast { position: absolute; z-index: 40; left: var(--safe-x); right: var(--safe-x); top: var(--safe-top); background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: var(--s3) var(--s4); font-size: 14px; font-weight: 700; line-height: 1.4; display: flex; gap: var(--s2); align-items: center; animation: drop .3s ease; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
@keyframes drop { from { transform: translateY(calc(var(--s4) * -1)); opacity: 0; } }
.confetti { position: absolute; inset: 0; z-index: 35; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: calc(var(--s4) * -1); width: 8px; height: 12px; border-radius: 2px; animation: fall 1.6s ease-in forwards; }
/* screenshot mode: freeze CSS motion so captures are crisp */
.no-anim *, .no-anim *::before, .no-anim *::after { animation: none !important; transition: none !important; }
@keyframes fall { to { transform: translateY(900px) rotate(540deg); opacity: .6; } }

/* ---------- integration tiles & settings ---------- */
.itile { display: inline-grid; place-items: center; flex: none; border-radius: var(--r-sm); background: var(--b); color: var(--f); font-weight: 700; font-size: 15px; letter-spacing: -.02em; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.set-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: var(--s2) 0 calc(var(--s3) * -1); }
.set-group { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
#int-list { display: flex; flex-direction: column; gap: var(--s6); }
#int-list .set-label { margin: 0 0 calc(var(--s3) * -1); }
#store-body { display: flex; flex-direction: column; gap: var(--s6); }
#store-body .set-label { margin: 0 0 calc(var(--s3) * -1); }
.int-row { display: flex; align-items: center; gap: var(--s3); width: 100%; padding: var(--s3) var(--s4); text-align: left; border-bottom: 1px solid var(--line); }
.int-row:last-child { border: 0; }
.int-row__body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.int-row__body b { font-size: 15px; font-weight: 700; }
.int-row__body small { font-size: 12px; color: var(--muted); line-height: 1.4; }
.int-row__body small.gain { color: var(--green-d); }
.int-cta { font-size: 13px; font-weight: 700; color: #2569C2; white-space: nowrap; }
.chev { font-size: 24px; color: #C9C4B8; }
.profile { display: flex; align-items: center; gap: var(--s3); padding: var(--s4); }
.profile > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.profile b { font-size: 17px; }
.profile small { font-size: 12px; color: var(--muted); }
.set-intro { display: flex; flex-direction: column; gap: var(--s2); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4); border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.toggle-row:last-child { border: 0; }
.int-head { display: flex; gap: var(--s4); align-items: center; margin-bottom: var(--s2); }
.int-head small { display: block; margin-top: var(--s1); font-size: 12px; }
.kv { display: flex; justify-content: space-between; gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.kv span { color: var(--muted); }
.kv b { text-align: right; }
.sync-box { display: flex; flex-direction: column; gap: var(--s2); font-size: 12px; color: var(--muted); }
.btn--danger { background: var(--coral-l); color: var(--coral); }
.steps { margin: 0; padding-left: var(--s5); display: flex; flex-direction: column; gap: var(--s3); font-size: 14px; line-height: 1.45; }
.steps small { display: block; color: var(--muted); font-size: 12px; }
.key-field { display: flex; align-items: center; gap: var(--s2); background: #fff; border-radius: var(--r-md); padding: var(--s2) var(--s2) var(--s2) var(--s4); box-shadow: var(--shadow); }
.key-field span { font-size: 12px; font-weight: 700; color: var(--muted); }
.key-field input { flex: 1; min-width: 0; border: 0; outline: 0; font: 600 14px ui-monospace, monospace; background: none; }
.key-field button { height: 36px; padding: 0 var(--s3); border-radius: var(--r-sm); background: var(--ink); color: #fff; font-weight: 700; font-size: 13px; }
.key-msg { font-size: 13px; color: var(--muted); min-height: 20px; }
.bridge { display: flex; align-items: center; justify-content: center; gap: var(--s3); padding: var(--s4) 0; font-size: 20px; color: var(--muted); }
.spin { display: inline-block; width: 28px; height: 28px; border-radius: 99px; border: 3px solid rgba(0, 0, 0, .12); border-top-color: currentColor; animation: rot .8s linear infinite; }
.spin--light { width: 16px; height: 16px; border-width: 2px; border-color: rgba(255, 255, 255, .3); border-top-color: #fff; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- modal as tracking sheet ---------- */
.modal { max-height: 88%; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; gap: var(--s4); padding-bottom: calc(var(--s10) + env(safe-area-inset-bottom, 0px)); scrollbar-width: none; }
.modal::-webkit-scrollbar { display: none; }
.modal .grabber { margin-bottom: 0; flex: none; }
.modal .set-label { margin: var(--s2) 0 calc(var(--s2) * -1); }
.tr-head { display: flex; gap: var(--s3); align-items: center; }
.tr-head small { display: block; margin-top: var(--s1); font-size: 13px; }
/* intro sheet: the pet introduces an input page on its first visit (introOnce in app.js) */
.intro-art { position: relative; flex: none; height: 240px; border-radius: var(--r-lg); overflow: hidden; }
.intro-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
/* the pet stands where it does on the page's own hero (.lb-pet) */
.intro-art .pet-svg { inset: auto auto 24px 50%; width: 220px; height: 170px; transform: translateX(-50%); }
.intro-art--bed .pet-svg { bottom: 56px; transform: translateX(calc(-50% + 14px)) scaleX(-1); }
/* live preview step: the real app in a ?demo frame, panned and scaled by introLive; a finger ring marks each tap */
.intro-art--live { background: var(--bg); }
.intro-art--live::after { content: ''; position: absolute; inset: 0; z-index: 2; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(28, 27, 23, .1); pointer-events: none; }
.intro-art--live svg { display: none; }
.intro-demo { position: absolute; left: 0; top: 0; width: 390px; height: 844px; border: 0; transform-origin: 0 0; pointer-events: none; opacity: 0; transition: transform .7s cubic-bezier(.32, .72, 0, 1), opacity .3s ease; }
.intro-demo.on { opacity: 1; }
.intro-tap { position: absolute; z-index: 1; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: var(--r-pill); background: rgba(28, 27, 23, .28); border: 3px solid #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); pointer-events: none; opacity: 0; transform: scale(1.4); transition: opacity .2s ease, transform .2s ease; }
.intro-tap.on { opacity: 1; transform: scale(1); }
.intro-tap.press { transform: scale(.8); }
.intro-dots { display: flex; justify-content: center; gap: var(--s2); margin-top: var(--s1); }
.intro-dots i { width: 8px; height: 8px; border-radius: var(--r-pill); background: #D6D0C3; transition: width .2s ease, background .2s ease; }
.intro-dots i.on { width: 24px; background: var(--ink); }
.intro-title { text-align: center; margin-top: var(--s2); }
.intro-sub { text-align: center; font-size: 15px; line-height: 1.4; max-width: 300px; margin: 0 auto var(--s2); }
.intro-later { align-self: center; padding: var(--s2) var(--s4); }
@media (max-height: 700px) { .intro-art { height: 200px; } .intro-art .pet-svg { width: 190px; height: 146px; } }
.tr-ic { width: 48px; height: 48px; border-radius: var(--r-md); display: grid; place-items: center; font-size: 24px; flex: none; }
.src-row { display: flex; align-items: center; gap: var(--s3); width: 100%; text-align: left; background: #EEF3FF; border-radius: var(--r-md); padding: var(--s3); }
.src-row > span:not(.itile):not(.int-cta):not(.tr-mini) { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.src-row b { font-size: 13px; }
.src-row small { font-size: 12px; color: var(--muted); }
.src-row--on { background: var(--green-l); }
.src-row--on .itile + .itile { margin-left: calc(var(--s3) * -1); box-shadow: 0 0 0 2px var(--green-l); }
.src-row--plain { background: #F3F0E8; }
.tr-mini { font-size: 20px; width: 28px; text-align: center; flex: none; }
.seg { display: flex; gap: var(--s1); padding: var(--s1); background: #EAE6DC; border-radius: var(--r-pill); }
.seg button { flex: 1; height: 36px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.search { display: flex; align-items: center; gap: var(--s2); height: 48px; padding: 0 var(--s4); background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow); }
.search input { flex: 1; border: 0; outline: 0; font: 500 15px var(--ui); background: none; }
.food-list { display: flex; flex-direction: column; gap: var(--s2); max-height: 248px; overflow-y: auto; scrollbar-width: none; padding: var(--s1); margin: calc(var(--s1) * -1); }
.food-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s3); background: #fff; border-radius: var(--r-md); text-align: left; box-shadow: var(--shadow); }
.food-row.on { box-shadow: 0 0 0 2px var(--ink); }
.food-row .fe { font-size: 24px; width: 32px; text-align: center; }
.food-row .tx { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.food-row b { font-size: 14px; }
.food-row small { font-size: 12px; color: var(--muted); }
.grade-chip { width: 28px; height: 28px; border-radius: var(--s2); display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 14px; }
.g-A { background: #2F8A3B; } .g-B { background: #8BC34A; } .g-C { background: #F6A623; } .g-D { background: var(--coral); }
.tr-sum { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); background: #fff; border-radius: var(--r-md); padding: var(--s3) var(--s4); box-shadow: var(--shadow); }
.tr-sum__v { display: flex; flex-direction: column; gap: 2px; text-align: right; margin-left: auto; }
.tr-sum__v b { font: 700 20px var(--display); }
.tr-sum__v small { font-size: 12px; color: var(--muted); }
.stepper { display: flex; align-items: center; gap: var(--s2); }
.stepper button { width: 36px; height: 36px; border-radius: var(--r-pill); background: #EAE6DC; font-size: 20px; font-weight: 700; }
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper b { font: 700 20px var(--display); min-width: 32px; text-align: center; }
/* tap the number to type a custom value (stepperType in app.js); dashed underline hints it's editable */
.stepper[id] b { cursor: text; text-decoration: underline dashed var(--line); text-underline-offset: 4px; }
.stepper__in { width: 8ch; font: inherit; text-align: center; color: inherit; background: none; border: 0; border-bottom: 2px solid currentColor; padding: 0; outline: none; }
.stepper span { font-size: 12px; color: var(--muted); }
.stepper--wide { background: #fff; border-radius: var(--r-md); padding: var(--s2); box-shadow: var(--shadow); justify-content: space-between; }
.log-list { list-style: none; margin: 0; padding: 0 var(--s4); background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow); }
.log-list li { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.log-list li:last-child { border: 0; }
.log-list .ic { font-size: 20px; width: 28px; text-align: center; }
.log-list .tx { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.log-list .tx b { font-size: 13px; }
.log-list .tx small { font-size: 11px; color: var(--muted); }
.log-list .meta { display: flex; flex-direction: column; align-items: flex-end; gap: var(--s1); }
.log-list .meta small { font-size: 11px; color: var(--muted); }
.src { font-size: 10px; font-weight: 700; padding: 2px var(--s2); border-radius: var(--r-pill); background: var(--b); color: var(--f); white-space: nowrap; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.src--manual { background: #F3F0E8; color: var(--muted); }
.tub-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.tub { min-width: 0; aspect-ratio: 4 / 3; background: #fff; border-radius: var(--r-md); padding: var(--s2); box-shadow: var(--shadow); }
.tub svg { width: 100%; height: 100%; }
.tub.on { box-shadow: 0 0 0 3px var(--ink); }
.tip { font-size: 13px; line-height: 1.45; background: #E8E6FF; border-radius: var(--r-md); padding: var(--s3); }
.wo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
.wo { background: #fff; border-radius: var(--r-md); padding: var(--s3) var(--s2); display: flex; flex-direction: column; align-items: center; gap: var(--s1); box-shadow: var(--shadow); }
.wo span { font-size: 28px; }
.wo b { font-size: 12px; }
.wo.on { box-shadow: 0 0 0 3px var(--green); background: var(--green-l); }
.sleep-card { background: #1E2350; color: #fff; border-radius: var(--r-lg); padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.sleep-card__top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; opacity: .85; }
.sleep-card__main { display: flex; align-items: baseline; justify-content: space-between; }
.sleep-card__main b { font: 700 32px var(--display); }
.sleep-card__main span { font-size: 13px; opacity: .8; }
.sleep-card small.risk { color: #FF9B86; }
.stages { display: flex; height: 12px; border-radius: 99px; overflow: hidden; gap: 2px; }
.stage-legend { display: flex; gap: var(--s3); font-size: 11px; opacity: .8; }
.stage-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: var(--s1); }
.sleep-now { background: #1E2350; color: #fff; border-radius: var(--r-lg); padding: var(--s4); display: flex; flex-direction: column; gap: var(--s1); }
.sleep-now small { opacity: .75; font-size: 13px; }
.time-row { display: flex; align-items: center; gap: var(--s3); }
.time-row label { flex: 1; display: flex; flex-direction: column; gap: var(--s1); background: #fff; border-radius: var(--r-md); padding: var(--s3) var(--s4); box-shadow: var(--shadow); }
.time-row label span { font-size: 11px; font-weight: 700; color: var(--muted); }
.time-row input { border: 0; outline: 0; font: 700 20px var(--display); background: none; }

/* ---------- live session HUD ---------- */
.session { position: absolute; z-index: 21; left: var(--safe-x); right: var(--safe-x); bottom: calc(var(--tabbar-h) + var(--s4)); display: flex; align-items: center; gap: var(--s3); background: rgba(28, 27, 23, .88); color: #fff; border-radius: var(--r-lg); padding: var(--s3); backdrop-filter: blur(8px); animation: up .3s ease; }
.phone:not([data-view="home"]):not([data-view="olahraga"]):not([data-view="logdetail"]) .session { display: none; }
.phone[data-tabbar="off"] .session { bottom: var(--s4); }
/* while the bar is up, the screens that show it get room for it at the bottom, so nothing hides under it */
.phone[data-session="on"]:is([data-view="home"], [data-view="olahraga"], [data-view="logdetail"]) .screen.on::after { content: ''; display: block; flex: none; height: calc(64px + var(--s4)); }
.ses-ic { font-size: 24px; width: 40px; height: 40px; border-radius: var(--r-sm); background: rgba(255, 255, 255, .12); display: grid; place-items: center; }
.ses-tx { flex: 1; display: flex; flex-direction: column; gap: 2px; position: relative; padding-bottom: var(--s2); }
.ses-tx b { font-size: 14px; }
.ses-tx small { font-size: 12px; opacity: .75; font-variant-numeric: tabular-nums; }
.ses-tx i { position: absolute; left: 0; bottom: 0; height: 4px; border-radius: 99px; background: var(--green); transition: width .4s; }
.session button { height: 36px; padding: 0 var(--s4); border-radius: var(--r-pill); background: #fff; color: var(--ink); font-weight: 700; font-size: 13px; }

/* ---------- connect flows (simulated) ---------- */
.flow { position: absolute; inset: 0; z-index: 50; display: flex; flex-direction: column; background: rgba(0, 0, 0, .4); animation: fadeIn .2s ease; }
.flow > div { flex: 1; display: flex; flex-direction: column; margin-top: var(--s12); background: #fff; border-radius: var(--r-lg) var(--r-lg) 0 0; overflow: hidden; animation: up .32s cubic-bezier(.2, .9, .3, 1); }
.flow--dialog { justify-content: center; }
.flow--dialog > div { flex: none; margin: 0; background: none; animation: none; }
.demo-tag { text-align: center; font-size: 11px; color: var(--muted); padding: var(--s2) var(--s4) var(--s6); }
.demo-tag--dark { color: rgba(0, 0, 0, .4); }
.flow--hevy .demo-tag--dark { color: rgba(255, 255, 255, .4); }
.flow-wait { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s4); min-height: 240px; color: var(--muted); font-size: 14px; }
.sv-bar { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; height: 48px; padding: 0 var(--s3); background: #F2F2F7; border-bottom: .5px solid rgba(0, 0, 0, .15); font-size: 13px; }
.sv-bar button { color: #007AFF; font-size: 16px; text-align: left; }
.sv-bar span:nth-child(2) { text-align: center; font-weight: 600; }
.sv-ic { text-align: right; color: #007AFF; }
.sv-page { flex: 1; overflow-y: auto; padding: var(--s6) var(--s5); display: flex; flex-direction: column; gap: var(--s4); }
.sv-brand { display: flex; align-items: center; justify-content: center; gap: var(--s3); font-size: 20px; }
.sv-brand b { font-size: 22px; }
.sv-link { color: var(--muted); }
.sv-page h3 { font-size: 20px; text-align: center; line-height: 1.3; }
.sv-field { display: flex; flex-direction: column; gap: var(--s1); font-size: 12px; font-weight: 600; color: var(--muted); }
.sv-field input { height: 48px; border-radius: var(--s2); border: 1px solid #D0D0D6; padding: 0 var(--s3); font: 500 15px var(--ui); color: var(--ink); }
.sv-btn { height: 48px; border-radius: var(--s2); background: var(--b); color: var(--f); font-weight: 700; font-size: 15px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.sv-btn:disabled { opacity: .4; cursor: default; }
.sv-btn--ghost { background: #F2F2F7; color: var(--ink); }
.sv-btn--g { background: #1A73E8; color: #fff; }
.sv-fine { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.5; }
.sv-acct { text-align: center; font-size: 13px; color: var(--muted); }
.sv-scopes { display: flex; flex-direction: column; border: 1px solid #E5E5EA; border-radius: var(--r-sm); }
.sv-scopes label { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3); font-size: 14px; border-bottom: 1px solid #E5E5EA; line-height: 1.4; }
.sv-scopes label:last-child { border: 0; }
.sv-scopes input { width: 20px; height: 20px; flex: none; margin: 0; }
.sv-actions { display: flex; gap: var(--s2); }
.sv-actions .sv-btn { flex: 1; }
.g-page { flex: 1; overflow-y: auto; padding: var(--s8) var(--s6); display: flex; flex-direction: column; gap: var(--s3); text-align: center; }
.g-logo { font-size: 24px; letter-spacing: -.02em; }
.g-page h3 { font-size: 22px; font-weight: 500; line-height: 1.3; }
.g-page p { font-size: 15px; color: #3C4043; }
.g-acct { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid #E8EAED; text-align: left; }
.g-acct b { display: block; font-size: 14px; font-weight: 500; }
.g-acct small { font-size: 12px; color: #5F6368; }
.g-av { width: 32px; height: 32px; border-radius: 99px; background: #7B61FF; color: #fff; display: grid; place-items: center; font-weight: 600; flex: none; }
.g-av--add { background: none; color: #5F6368; border: 1px solid #DADCE0; }
.g-chip { align-self: center; border: 1px solid #DADCE0; border-radius: 99px; padding: var(--s1) var(--s3); font-size: 13px !important; }
.g-sub { text-align: left; font-weight: 500; }
.g-scope { display: flex; gap: var(--s3); align-items: center; text-align: left; font-size: 14px; padding: var(--s2) 0; border-bottom: 1px solid #E8EAED; }
.g-trust { text-align: left; display: flex; flex-direction: column; gap: var(--s1); font-size: 14px; }
.g-trust small { color: #5F6368; font-size: 12px; line-height: 1.5; }
.flow--hevy > div { background: #0F1115; color: #fff; }
.hv-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 56px; padding: 0 var(--s4); }
.hv-top button { color: #4C8DFF; text-align: left; font-size: 15px; }
.hv-card { margin: var(--s4); padding: var(--s5); border-radius: var(--r-md); background: #1A1D24; display: flex; flex-direction: column; gap: var(--s3); }
.hv-label { font-size: 11px; letter-spacing: .1em; color: #8A90A0; }
.hv-key { font: 600 16px ui-monospace, monospace; word-break: break-all; }
.hv-copy { height: 44px; border-radius: var(--s2); background: #1F5EFF; color: #fff; font-weight: 700; }
.hv-note { margin: 0 var(--s4); font-size: 13px; color: #8A90A0; line-height: 1.5; }
.flow--sheet > div { background: #F2F2F7; }
.hk-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 56px; padding: 0 var(--s4); font-size: 16px; }
.hk-nav button { color: #007AFF; text-align: left; font-size: 16px; }
.hk-nav button:last-child { text-align: right; font-weight: 600; }
.hk-nav button:disabled { color: #C7C7CC; }
.hk-body { flex: 1; overflow-y: auto; padding: 0 var(--s4) var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.hk-icons { display: flex; align-items: center; justify-content: center; gap: var(--s3); padding: var(--s3) 0; }
.hk-plus { font-size: 24px; color: #8E8E93; }
.hk-lead { text-align: center; font-size: 15px; line-height: 1.45; }
.hk-all { color: #007AFF; font-size: 16px; text-align: left; padding: var(--s3) var(--s4); background: #fff; border-radius: var(--s3); }
.hk-sec { font-size: 12px; color: #6D6D72; padding: 0 var(--s4); margin-top: var(--s2); }
.hk-list { background: #fff; border-radius: var(--s3); }
.hk-row { display: flex; align-items: center; justify-content: space-between; padding: var(--s2) var(--s4); min-height: 48px; border-bottom: .5px solid #E5E5EA; font-size: 16px; }
.hk-row:last-child { border: 0; }
.hk-foot { font-size: 12px; color: #6D6D72; padding: 0 var(--s4); line-height: 1.5; }
.switch--ios:checked { background: #34C759; }
.hc-top { display: flex; align-items: center; gap: var(--s4); height: 56px; padding: 0 var(--s4); font-size: 18px; }
.hc-body { flex: 1; overflow-y: auto; padding: var(--s4) var(--s6); display: flex; flex-direction: column; gap: var(--s3); }
.hc-body h3 { font-size: 22px; font-weight: 500; line-height: 1.3; }
.hc-body > p { font-size: 14px; color: #5F6368; }
.hc-row { display: flex; align-items: center; justify-content: space-between; padding: var(--s3) 0; font-size: 16px; }
.hc-row--all { border-bottom: 1px solid #E0E0E0; font-weight: 500; }
.hc-fine { font-size: 12px; color: #5F6368; }
.hc-actions { display: flex; justify-content: flex-end; gap: var(--s2); padding: var(--s3) var(--s6); }
.hc-actions button { height: 40px; padding: 0 var(--s5); border-radius: 99px; color: #1A73E8; font-weight: 600; }
.hc-actions button:last-child { background: #1A73E8; color: #fff; }
.hc-actions button:disabled { background: #E0E0E0; color: #9E9E9E; }
.perm { padding: 0 var(--s8); }
.perm-card { background: #F3EDF7; border-radius: 28px; padding: var(--s6); display: flex; flex-direction: column; gap: var(--s4); }
.perm-card h3 { font-size: 22px; font-weight: 500; line-height: 1.3; }
.perm-card p { font-size: 14px; color: #49454F; line-height: 1.5; }
.perm-actions { display: flex; justify-content: flex-end; gap: var(--s2); }
.perm-actions button { height: 40px; padding: 0 var(--s4); color: #6750A4; font-weight: 600; font-size: 14px; }
.flow--dialog .demo-tag { color: #fff; }

/* ---------- sheet children keep their size (no flex squashing) ---------- */
.modal > * { flex-shrink: 0; }
/* primary actions get breathing room from the content above */
.modal > .btn, .modal > .btn-row { margin-top: var(--s2); }
.modal > .btn + .set-label, .modal > .btn-row + .set-label { margin-top: var(--s4); }

/* ---------- scenes ---------- */
.scene .veil { fill: #141A45; opacity: 0; transition: opacity .8s; pointer-events: none; }
.world.night .scene .veil { opacity: .5; }
.world.night .scene .win rect, .world.night .scene .bulbs circle { filter: drop-shadow(0 0 4px #FFE28A); }
.petals circle, .snow circle { animation: drift 6s linear infinite; }
@keyframes drift { from { transform: translate(0, 0); } to { transform: translate(-40px, 440px); } }
.wave { animation: waves 3s ease-in-out infinite alternate; }
@keyframes waves { to { transform: translateX(-24px); } }
.scene-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.scene-card { background: #fff; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); text-align: left; }
.scene-card svg.scene { position: static; display: block; width: 100%; height: 112px; }
.scene-card__row { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); padding: var(--s3); }
.scene-card__row b { font-size: 13px; }
.scene-card__row small { font-size: 11px; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 2px; }
.scene-card.on { box-shadow: 0 0 0 3px var(--green), var(--shadow); }

/* ---------- currency ---------- */
.ei { display: inline-block; width: 1.2em; height: 1.2em; vertical-align: -.25em; flex: none; overflow: visible; }
.cur { display: inline-block; width: 18px; height: 18px; vertical-align: -4px; flex: none; overflow: visible; }
.cur--lg { width: 28px; height: 28px; }
.cur--xl { width: 44px; height: 44px; }
.coin-chip { gap: var(--s2); padding: 0 var(--s2); font-weight: 700; font-variant-numeric: tabular-nums; }
.coin-chip .cur { width: 20px; height: 20px; vertical-align: 0; }
.plus-ic { width: 20px; height: 20px; flex: none; }
.plus-ic circle { fill: var(--green); }
.plus-ic path { stroke: #fff; stroke-width: 2.2; stroke-linecap: round; fill: none; }
.hud-right { flex-direction: column; align-items: flex-end; gap: var(--s2); }
.hud-row { display: flex; gap: var(--s2); }
.world__hud > div:first-child { min-width: 0; }
.world__hud h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.hud-cur { display: flex; gap: var(--s1); }
.hud-cur .coin-chip { height: 36px; padding: 0 var(--s3) 0 var(--s2); }
.price { display: inline-flex; align-items: center; gap: 2px; }
.price .cur, .price-chip .cur { width: 14px; height: 14px; }
.price--dia { background: #D7EBFF !important; color: #1A5DB8; }
.price-chip { padding: 2px var(--s2); border-radius: 99px; background: var(--coin); color: #6B4A00 !important; }
.ward-bar { z-index: 22; }
.ward-bar .btn .cur { width: 18px; height: 18px; }
.mclaim .cur, .toast .cur, .speech .cur, .feed .cur { width: 16px; height: 16px; vertical-align: -3px; }
/* gold coin on yellow background: white disc gives the coin clean contrast */
.mclaim:not(:disabled) .cur,
.price-chip:not(.price--dia) .cur,
.ward-item .price:not(.price--dia):not(.owned) .cur,
.fr-wear .price:not(.price--dia):not(.owned) .cur {
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(107, 74, 0, .22);
}

/* ---------- missions ---------- */
.missions-card .card__head { margin-bottom: var(--s2); }
.mission { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.mission:last-child { border: 0; padding-bottom: 0; }
.mission .ic { width: 40px; height: 40px; border-radius: var(--r-sm); background: #F3F0E8; display: grid; place-items: center; font-size: 20px; flex: none; }
.mission .tx { flex: 1; display: flex; flex-direction: column; gap: var(--s1); min-width: 0; }
.mission .tx b { font-size: 14px; }
.mission .tx small { font-size: 11px; color: var(--muted); font-weight: 600; }
.mbar { height: 6px; border-radius: 99px; background: #EEEAE1; overflow: hidden; }
.mbar i { display: block; height: 100%; background: var(--coin); border-radius: 99px; }
.mclaim { display: inline-flex; align-items: center; gap: var(--s1); height: 36px; padding: 0 var(--s3); border-radius: 99px; background: var(--coin); color: #6B4A00; font-weight: 700; font-size: 13px; box-shadow: 0 3px 0 #D99A1B; }
.mclaim:disabled { background: #EEEAE1; color: #A39E92; box-shadow: none; }
.mission[data-mis] { cursor: pointer; -webkit-tap-highlight-color: transparent; transition: opacity .12s; }
.mission[data-mis]:active { opacity: .6; }
/* open mission: reward as plain text + chevron (the row itself is the shortcut), no disabled-looking pill */
.mgo { display: inline-flex; align-items: center; gap: var(--s1); flex: none; font-size: 13px; font-weight: 700; color: #8A6A1E; white-space: nowrap; }
.mgo .cur { width: 16px; height: 16px; }
.mgo i { font-style: normal; font-size: 20px; line-height: 1; color: var(--muted); margin-left: 2px; }
.mclaim:not(:disabled) { animation: wiggle 2.4s ease-in-out infinite; }
.mclaimed { width: 36px; height: 36px; border-radius: 99px; background: var(--green-l); color: var(--green-d); display: grid; place-items: center; font-weight: 700; }
.mission.is-claimed .tx b { color: var(--muted); }

/* ---------- store ---------- */
.balances { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.bal { display: flex; align-items: center; gap: var(--s3); border-radius: var(--r-lg); padding: var(--s4); }
.bal--gold { background: #FFF3D1; }
.bal--dia { background: #E3F0FF; }
.bal small { font-size: 12px; font-weight: 700; color: var(--muted); }
.bal b { display: block; font: 700 24px var(--display); }
.need-note { display: flex; align-items: center; gap: var(--s3); background: var(--green-l); border-radius: var(--r-lg); padding: var(--s3) var(--s4); margin-bottom: var(--s4); }
.need-note b { display: block; font-size: 14px; }
.need-note small { font-size: 12px; color: var(--green-d); font-weight: 700; }
.pack--rec { box-shadow: 0 0 0 3px var(--green), var(--shadow); animation: recPulse 1.1s ease-in-out 3; }
.pack__tag--rec { background: var(--green); }
.int-row--ready { animation: readyFlash 1.1s ease-in-out 3; }
.int-row--ready .int-cta { color: var(--green-d); }
@keyframes recPulse { 50% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(79, 174, 85, .35), var(--shadow); } }
@keyframes readyFlash { 50% { background: var(--green-l); } }
.pack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
.pack { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--s1); background: #fff; border-radius: var(--r-lg); padding: var(--s4) var(--s2) var(--s3); box-shadow: var(--shadow); }
.pack__art { width: 56px; height: 56px; }
.pack b { font: 700 20px var(--display); }
.pack small { font-size: 11px; font-weight: 700; }
.pack__price { margin-top: var(--s2); width: 100%; height: 32px; border-radius: 99px; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.pack__tag { position: absolute; top: calc(var(--s2) * -1); left: 50%; transform: translateX(-50%); background: var(--coral); color: #fff; font-size: 10px; font-weight: 700; padding: 2px var(--s2); border-radius: 99px; white-space: nowrap; }
.tx-ic { width: 36px; height: 36px; border-radius: var(--r-sm); background: #F3F0E8; display: grid; place-items: center; font-size: 18px; flex: none; }
.tx-row .int-row__body b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-amt { display: inline-flex; align-items: center; gap: var(--s1); font-weight: 800; font-size: 14px; white-space: nowrap; }
.tx-amt.in { color: var(--green-d); }
.tx-amt.out { color: var(--coral); }
.tx-amt .cur { width: 16px; height: 16px; }
.plus-card { background: linear-gradient(150deg, #1C1B17, #3A2F5B); color: #fff; border-radius: var(--r-card); padding: var(--s6) var(--s5); display: flex; flex-direction: column; gap: var(--s4); }
.plus-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s3); font-size: 14px; }
.plus-card li { display: flex; gap: var(--s2); align-items: center; }
.plus-card small { text-align: center; font-size: 12px; opacity: .7; }
.store-legal { text-align: center; }

/* ---------- simulated App Store purchase ---------- */
.flow--iap { justify-content: flex-end; }
.flow--iap > div { flex: none; margin: 0; border-radius: var(--r-card) var(--r-card) 0 0; background: #F2F2F7; padding: var(--s4) var(--s4) 0; gap: var(--s4); }
.iap-top { display: flex; justify-content: space-between; align-items: center; }
.iap-top b { font-size: 17px; }
.iap-top button { width: 32px; height: 32px; border-radius: 99px; background: #E5E5EA; color: #8E8E93; font-weight: 700; }
.iap-item { display: flex; gap: var(--s3); align-items: center; background: #fff; border-radius: var(--s3); padding: var(--s3); }
.iap-item b { display: block; font-size: 16px; }
.iap-item small { display: block; font-size: 12px; color: #8E8E93; }
.iap-rows { background: #fff; border-radius: var(--s3); }
.iap-rows div { display: flex; justify-content: space-between; align-items: center; padding: var(--s3); border-bottom: .5px solid #E5E5EA; font-size: 14px; }
.iap-rows div:last-child { border: 0; }
.iap-rows span { font-size: 11px; color: #8E8E93; letter-spacing: .04em; }
#iap-pay { color: #007AFF; cursor: pointer; }
.iap-methods { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.iap-methods button { height: 40px; border-radius: var(--s3); background: #fff; font-size: 13px; font-weight: 600; }
.iap-confirm { min-height: 64px; display: grid; place-items: center; }
.iap-btn { width: 100%; height: 52px; border-radius: 99px; background: #007AFF; color: #fff; font-size: 17px; font-weight: 600; }
.faceid { display: flex; flex-direction: column; align-items: center; gap: var(--s1); color: #007AFF; font-size: 13px; }
.faceid__glyph { font-size: 36px; line-height: 1; animation: rot 1.1s linear infinite; }
.faceid--ok { color: #34C759; }
.faceid--ok .faceid__glyph { animation: pop .3s ease; }

/* ---------- all activity ---------- */
.link-btn { font-size: 13px; font-weight: 700; color: var(--green-d); white-space: nowrap; }
.act-pad { gap: var(--s4); }
.act-export { font-size: 16px; }
.fchips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.fchips--scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(var(--safe-x) * -1); padding: var(--s1) var(--safe-x); scrollbar-width: none; }
.fchips--scroll::-webkit-scrollbar { display: none; }
.fchips--dow .fchip { flex: 1; padding: 0; justify-content: center; }
.fchip { display: inline-flex; align-items: center; gap: var(--s1); flex: none; height: 36px; padding: 0 var(--s4); border-radius: var(--r-pill); background: #fff; font-weight: 700; font-size: 13px; white-space: nowrap; box-shadow: var(--shadow); transition: background .12s, color .12s; }
.fchip small { font-weight: 600; opacity: .6; font-size: 11px; }
.fchip.on { background: var(--ink); color: #fff; }
.act-custom { display: flex; align-items: flex-end; gap: var(--s2); padding: var(--s3) var(--s4); }
.act-custom label { flex: 1; display: flex; flex-direction: column; gap: var(--s1); min-width: 0; }
.act-custom small { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.act-custom input { height: 40px; width: 100%; padding: 0 var(--s2); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); font: 600 14px var(--ui); color: var(--ink); }
.act-custom__sep { padding-bottom: var(--s3); color: var(--muted); font-weight: 700; }
.act-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.act-tile { background: #fff; border-radius: var(--r-md); padding: var(--s3); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: var(--s1); min-width: 0; }
.act-tile small { font-size: 11px; font-weight: 700; color: var(--muted); }
.act-tile b { font-family: var(--display); font-size: 16px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-tile b.gain, .act-tile b.risk { font-size: 16px; }
.act-chart { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4); }
.act-readout { display: flex; flex-direction: column; gap: var(--s1); }
.act-readout b { font-family: var(--display); font-size: 24px; font-weight: 800; letter-spacing: -.01em; }
.act-readout b small { font-size: 13px; color: var(--muted); font-weight: 700; margin-left: 2px; }
.act-readout > small { font-size: 12px; color: var(--muted); font-weight: 600; }
.act-svg { width: 100%; height: auto; display: block; overflow: visible; }
.act-svg .bar rect:not(.hit) { fill: var(--green); transition: opacity .15s; }
.act-svg .bar--bad rect:not(.hit) { fill: var(--coral); }
.act-svg .bar--empty rect:not(.hit) { fill: var(--line); }
.act-svg .bar.dim rect:not(.hit) { opacity: .3; }
.act-svg .bar.on rect:not(.hit) { stroke: var(--ink); stroke-width: 2; }
.act-svg .hit { fill: transparent; cursor: pointer; }
.act-svg text { font: 600 10px var(--ui); fill: var(--muted); }
.act-svg .target { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 4 4; opacity: .5; }
.act-svg .target-l { font-size: 10px; font-weight: 700; fill: var(--ink); opacity: .6; }
.act-svg .zero { stroke: var(--line); stroke-width: 1; }
.act-hint { font-size: 11px; text-align: center; }
.act-insight { display: flex; gap: var(--s3); align-items: flex-start; background: #FFF6DB; border-radius: var(--r-md); padding: var(--s3) var(--s4); font-size: 13px; line-height: 1.5; }
.act-insight .risk, .act-insight .gain { font-size: 13px; }
.act-insight small { display: block; color: var(--muted); font-size: 11px; margin-top: var(--s1); }
.act-tools { display: flex; gap: var(--s2); }
.act-tools .search { flex: 1; min-width: 0; height: 44px; }
.act-tools .search input { min-width: 0; font-size: 14px; }
.act-filter-btn { height: 44px; }
.fbadge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 var(--s1); border-radius: var(--r-pill); background: var(--coral); color: #fff; font-size: 11px; margin-left: var(--s1); }
.act-active { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: calc(var(--s2) * -1); }
.apill { display: inline-flex; align-items: center; gap: var(--s1); height: 28px; padding: 0 var(--s3); border-radius: var(--r-pill); background: var(--green-l); color: var(--green-d); font-size: 12px; font-weight: 700; }
.apill span { font-size: 10px; }
.apill--reset { background: none; color: var(--coral); }
.act-list { display: flex; flex-direction: column; gap: var(--s4); }
.act-group { display: flex; flex-direction: column; gap: var(--s2); }
.act-group header { display: flex; justify-content: space-between; align-items: baseline; padding: 0 var(--s1); }
.act-group header b { font-size: 13px; font-weight: 800; }
.act-group .feed.card { padding: var(--s4); }
.act-group .feed li { align-items: flex-start; }
.act-tags { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s2); }
.act-tags small { margin: 0 !important; }
.act-meta { display: flex; flex-direction: column; align-items: flex-end; gap: var(--s1); flex: none; }
.act-meta small { font-size: 11px; color: var(--muted); font-weight: 600; }
.act-empty { display: flex; flex-direction: column; align-items: center; gap: var(--s2); text-align: center; padding: var(--s8) var(--s4); background: #fff; border-radius: var(--r-card); box-shadow: var(--shadow); }
.act-empty > span { font-size: 32px; }
.act-empty small { color: var(--muted); font-size: 13px; }
.act-empty .btn { margin-top: var(--s2); }
.spacer--short { height: var(--s8); }
.act-sheet { display: flex; flex-direction: column; gap: var(--s4); }
.act-sheet__head { display: flex; justify-content: space-between; align-items: center; }
.act-sheet .set-label { margin: var(--s2) 0 calc(var(--s2) * -1); }
.act-sheet .fchip { box-shadow: none; background: #fff; border: 1px solid var(--line); }
.act-sheet .fchip.on { background: var(--ink); border-color: var(--ink); }
.act-sheet .btn { margin-top: var(--s2); }

/* ---------- friends ---------- */
.fr-pad { gap: var(--s5); }
.fr-pad .set-label { margin: 0 0 var(--s2); }
.fr-seg { margin-bottom: var(--s3); }
.fr-row { gap: var(--s2); }
.fr-row--me { background: #FFF6E5; }
.fr-rank { width: 24px; flex: none; text-align: center; font: 800 15px var(--display); color: var(--muted); }
.fr-rank.r1 { color: #D9A300; } .fr-rank.r2 { color: #9A9A9A; } .fr-rank.r3 { color: #C07A3E; }
.fr-board-more-btn { height: 42px; font-size: 13px; font-weight: 700; border-radius: var(--r-md); margin-top: var(--s3); }
.fr-av {
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  overflow: hidden;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}
svg.fr-av { display: block; }
.fr-av .pet-svg { width: 100%; height: 100%; display: block; }
.fr-pet { font-size: 12px; font-weight: 600; color: var(--muted); }
.fr-val { font-weight: 800; font-size: 13px; white-space: nowrap; }
.fr-feed-row .int-row__body small { white-space: normal; }
.fr-cheer { flex: none; height: 32px; padding: 0 var(--s3); border-radius: var(--r-pill); background: #FFE7F0; font-size: 13px; font-weight: 700; color: #C23A7A; white-space: nowrap; }
.fr-cheer.on { background: #F3F0E8; color: var(--muted); }
.fr-chal { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4); }
.fr-chal__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); }
.fr-chal__head small { font-size: 12px; color: var(--muted); }
.fr-vs { display: flex; flex-direction: column; gap: var(--s2); }
.fr-vs span { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: var(--s2); font-size: 12px; }
.fr-vs i { height: 10px; border-radius: 99px; background: #F3F0E8; position: relative; overflow: hidden; }
.fr-vs i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--green); border-radius: 99px; }
.fr-vs span + span i::after { background: #F58AB8; }
.fr-vs small { font-weight: 700; font-variant-numeric: tabular-nums; }
.fr-stage { position: relative; height: 300px; margin: 0 var(--safe-x); border-radius: var(--r-card); overflow: hidden; flex: none; }
.fr-stage__pet { position: absolute; left: 50%; bottom: 40px; width: 260px; height: 200px; transform: translateX(-50%); }
.fr-stage__tag { position: absolute; left: var(--s3); top: var(--s3); display: flex; flex-direction: column; background: rgba(255, 255, 255, .9); border-radius: var(--r-md); padding: var(--s2) var(--s3); }
.fr-stage__tag b { font-size: 15px; }
.fr-stage__tag small { font-size: 12px; color: var(--muted); }
.fr-code { display: flex; flex-direction: column; align-items: center; gap: var(--s2); background: #fff; border-radius: var(--r-lg); padding: var(--s4); box-shadow: var(--shadow); }
.fr-code small { font-size: 12px; color: var(--muted); font-weight: 700; }
.fr-code b { font: 800 26px var(--display); letter-spacing: .06em; }

.set-sound .set-label { margin: 0 0 var(--s2); }

.missions-card .card__head { align-items: flex-start; }
.missions-card .card__head small { display: block; margin-top: 2px; }

/* semantic alerts: tinted box, no icon */
.alert { font-size: 13px; line-height: 1.45; border-radius: var(--r-md); padding: var(--s3) var(--s4); border: 1px solid transparent; }
.alert--info { background: #EAF2FD; border-color: #CFE0F8; color: #1D4F91; }

.spacer--sm { height: var(--s8); }
.btn--xs { height: 32px; padding: 0 var(--s3); font-size: 12px; border-radius: var(--r-pill); gap: var(--s1); flex: none; }
.btn--xs .cur { width: 14px; height: 14px; }
.fr-status { font-size: 14px; font-style: italic; margin-top: var(--s4); }
.fr-stage__elus { position: absolute; right: var(--s3); bottom: var(--s3); z-index: 2; height: 36px; }
#fr-visit-pet { cursor: pointer; }
.fr-heart { position: absolute; z-index: 3; bottom: 120px; color: #EF5F45; font-size: 22px; pointer-events: none; animation: frHeart 1.4s ease-out forwards; }
@keyframes frHeart { from { transform: translateY(0) scale(.6); opacity: 1; } to { transform: translateY(-110px) scale(1.2); opacity: 0; } }

/* two stats in one card, BitePal style: small grey label, big number, grey unit */
.fr-duo { display: grid; grid-template-columns: 1fr 1fr; padding: var(--s4) 0; }
.fr-duo > div { display: flex; flex-direction: column; gap: 2px; padding: 0 var(--s5); }
.fr-duo > div + div { border-left: 1px solid var(--line); }
.fr-duo small { font-size: 12px; color: var(--muted); font-weight: 700; }
.fr-duo b { font: 800 32px var(--display); line-height: 1.1; }
.fr-duo b span, .fr-legend b span { font-size: 15px; color: #B8B3A7; margin-left: var(--s1); font-weight: 700; }
.fr-duo em { font-style: normal; font-size: 12px; color: var(--muted); line-height: 1.35; }

/* comparison bar chart: legend with totals, dashed grid with right-hand axis, dotted target line */
.fr-chart { display: flex; flex-direction: column; gap: var(--s3); }
.fr-chart__label { font-size: 13px; color: var(--muted); font-weight: 700; }
.fr-chart__note { font-size: 12px; color: var(--muted); }
.fr-legend { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.fr-legend small { display: flex; align-items: center; gap: var(--s1); font-size: 12px; color: var(--muted); font-weight: 700; }
.fr-legend b { font: 800 28px var(--display); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot--friend, .b-friend { background: #F58AB8; }
.dot--me, .b-me { background: var(--green); }
.fr-plot { position: relative; height: 150px; padding-right: 36px; margin-top: var(--s2); }
.fr-grid { position: absolute; inset: 0 0 20px 0; }
.fr-grid span { position: absolute; left: 0; right: 0; border-top: 1px dashed #E3DFD5; }
.fr-grid em { position: absolute; right: 0; top: -8px; font-style: normal; font-size: 10px; color: #B8B3A7; }
.fr-grid .fr-target { border-top: 2px dotted #8A8578; }
.fr-grid .fr-target em { color: var(--ink); font-weight: 700; }
.fr-cols { position: absolute; inset: 0 36px 0 0; display: grid; grid-template-columns: repeat(7, 1fr); }
.fr-cols > div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.fr-pair { display: flex; align-items: flex-end; gap: 3px; height: calc(100% - 20px); }
.fr-pair i { width: 9px; min-height: 3px; border-radius: 5px 5px 2px 2px; }
.fr-cols small { height: 20px; line-height: 20px; font-size: 11px; color: var(--muted); font-weight: 700; }
.fr-cols small.on { color: var(--ink); }

.fr-sessions { display: flex; flex-direction: column; }
.fr-sessions > div { display: flex; justify-content: space-between; align-items: baseline; padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.fr-sessions > div:last-child { border: 0; }
.fr-sessions b { font-size: 14px; }
.fr-sessions small { font-size: 12px; color: var(--muted); }
.fr-wear { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.fr-wear button { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--s1); background: #F7F5F0; border-radius: var(--r-md); padding: var(--s2) var(--s2) var(--s4); }
.fr-wear svg, .fr-wear__na { width: 100%; height: 56px; }
.fr-wear small { font-size: 10px; color: var(--muted); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.fr-wear .price { position: absolute; left: 50%; bottom: calc(var(--s2) * -1); transform: translateX(-50%); font-size: 11px; font-weight: 800; background: var(--coin); border-radius: var(--r-pill); padding: 2px var(--s2); white-space: nowrap; display: inline-flex; align-items: center; gap: 2px; }
.fr-wear .price .cur { width: 12px; height: 12px; }
.fr-wear .price.owned { background: var(--green-l); color: var(--green-d); }
.fr-wear .price.price--dia { background: #DCEBFF; color: #1A5DB8; }
.fr-item { display: flex; align-items: center; gap: var(--s4); }
.fr-item svg { width: 88px; height: 88px; flex: none; background: #F7F5F0; border-radius: var(--r-md); padding: var(--s2); }
.ch-opt .ch-cmp { color: var(--ink); font-weight: 700; margin-top: 2px; }
.ch-radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #D8D3C7; flex: none; }
.ch-opt.on { background: var(--green-l); }
.ch-opt.on .ch-radio { border: 7px solid var(--green); }

/* notifications */
.nf-groups { display: flex; flex-direction: column; gap: var(--s5); }
.nf-row { gap: var(--s3); }
.nf-row--new { background: #FFF9EC; }
.nf-row .int-row__body b { font-size: 14px; }
.nf-acts { display: flex; gap: var(--s1); flex: none; }
.nf-state { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 2px; }
.nf-state .cur { width: 14px; height: 14px; }
.nf-empty { padding: var(--s6); text-align: center; }

.src--scan { background: var(--green-l); color: var(--green-d); }

/* ---------- activity log pages (logbook.js) ---------- */
.lb-root { display: flex; flex-direction: column; min-height: 100%; flex: none; }
.lb-hero { position: relative; height: 320px; flex: none; overflow: hidden; user-select: none; -webkit-user-select: none; }
.lb-hero--short { height: 252px; }
.lb-root[data-sport="gym"] .lb-hero,
.lb-hero--wo-gym { background: #1E272C; }
.lb-root[data-sport="futsal"] .lb-hero,
.lb-hero--wo-futsal { background: #152238; }
.lb-root[data-kind="tidur"] .lb-hero,
.lb-hero--tidur { background: #1B1F4B; }
.lb-scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.lb-foreground { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
.lb-top { --top-h: calc(var(--safe-top) + 52px); position: sticky; top: 0; z-index: 6; height: var(--top-h); margin-bottom: calc(var(--top-h) * -1); padding: var(--safe-top) var(--safe-x) var(--s3); display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; transition: background .2s, box-shadow .2s; }
.lb-top__title { text-align: center; font: 800 18px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-top--tidur .lb-top__title { color: #fff; }
.lb-root[data-sport="futsal"] .lb-top__title,
.lb-root[data-sport="gym"] .lb-top__title,
.lb-root:has(.lb-hero--wo-futsal) .lb-top__title,
.lb-root:has(.lb-hero--wo-gym) .lb-top__title { color: #fff; }
.lb-root.scrolled .lb-top { background: rgba(244, 242, 236, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--line); }
.lb-root.scrolled .lb-top__title,
.lb-root.scrolled .lb-top--tidur .lb-top__title,
.lb-root.scrolled[data-sport="futsal"] .lb-top__title,
.lb-root.scrolled[data-sport="gym"] .lb-top__title,
.lb-root.scrolled:has(.lb-hero--wo-futsal) .lb-top__title,
.lb-root.scrolled:has(.lb-hero--wo-gym) .lb-top__title { color: var(--ink); }
.lb-root.scrolled .lb-top .icon-btn--glass { background: #fff; box-shadow: var(--shadow); }
.lb-pet { position: absolute; z-index: 2; left: 50%; bottom: 40px; width: 220px; height: 170px; transform: translateX(-50%); cursor: pointer; }
.lb-hero--wo-sepeda .lb-pet { transform: translateX(calc(-50% - 44px)); }
.lb-hero--short .lb-pet { bottom: 34px; width: 190px; height: 146px; }
.lb-hero--tidur .lb-pet { bottom: 66px; }
.lb-hero--tidur.lb-hero--short .lb-pet { bottom: 56px; }
.lb-hero--tidur .pet-shadow { opacity: 0; }
/* the sleep clip lies head-right; mirror it so the head rests on the pillow */
.lb-hero--tidur .lb-pet { transform: translateX(calc(-50% + 14px)) scaleX(-1); }
.lb-say { top: calc(var(--safe-top) + 52px); }
.lb-zzz text { animation: zzz 3s ease-in-out infinite; transform-box: fill-box; }
.lb-zzz text:nth-child(2) { animation-delay: .5s; }
.lb-zzz text:nth-child(3) { animation-delay: 1s; }
@keyframes zzz { 0%, 100% { opacity: .2; transform: translateY(4px); } 50% { opacity: 1; transform: translateY(-4px); } }
.lb-twinkle circle { animation: twinkle 2.4s ease-in-out infinite; }
.lb-twinkle circle:nth-child(odd) { animation-delay: 1.2s; }
@keyframes twinkle { 50% { opacity: .25; } }
.lb-steam path { animation: steam 2.6s ease-in-out infinite; }
.lb-steam path + path { animation-delay: .8s; }
@keyframes steam { 0% { opacity: 0; transform: translateY(6px); } 50% { opacity: .8; } 100% { opacity: 0; transform: translateY(-10px); } }
.lb-run-clouds { animation: lbRunClouds 26s linear infinite; }
.lb-run-track { animation: lbRunTrack 5.4s linear infinite; }
.lb-walk-clouds { animation: lbWalkClouds 32s linear infinite; }
.lb-walk-track { animation: lbWalkTrack 8.5s linear infinite; }
.lb-bike-track { animation: lbBikeTrack 3.2s linear infinite; }

.lb-gym-spot polygon { animation: gymSpot 3s ease-in-out infinite alternate; }
.lb-fut-ball-prop { pointer-events: auto; cursor: pointer; }
.lb-fut-ball-prop .lb-fut-ball { transform-box: fill-box; transform-origin: center; }
.lb-fut-ball-prop .lb-fut-ball-shadow { transform-box: fill-box; transform-origin: center; }
.lb-fut-ball-prop.is-kicking .lb-fut-ball { animation: futBallKick 1.73s cubic-bezier(.22, .61, .36, 1) forwards; }
.lb-fut-ball-prop.is-kicking .lb-fut-ball-shadow { animation: futBallShadowKick 1.73s cubic-bezier(.22, .61, .36, 1) forwards; }
.lb-jump-rope path { animation: ropeJump 0.77s ease-in-out infinite; transform-origin: 195px 220px; }

.lb-hero--stationary .lb-run-track,
.lb-hero--stationary .lb-run-clouds,
.lb-hero--stationary .lb-walk-track,
.lb-hero--stationary .lb-walk-clouds,
.lb-hero--stationary .lb-bike-track { animation: none !important; }

@keyframes lbRunClouds { from { transform: translateX(0); } to { transform: translateX(-780px); } }
@keyframes lbRunTrack { from { transform: translateX(0); } to { transform: translateX(-780px); } }
@keyframes lbWalkClouds { from { transform: translateX(0); } to { transform: translateX(-780px); } }
@keyframes lbWalkTrack { from { transform: translateX(0); } to { transform: translateX(-780px); } }
@keyframes lbBikeTrack { from { transform: translateX(0); } to { transform: translateX(-780px); } }
@keyframes gymSpot { 0% { opacity: 0.06; } 100% { opacity: 0.18; } }
@keyframes futBallKick {
  0%, 64% { transform: translate(0, 0) rotate(0deg); }
  66% { transform: translate(4px, -3px) rotate(25deg); }
  73% { transform: translate(26px, -20px) rotate(115deg); }
  81% { transform: translate(38px, 0px) rotate(210deg); }
  89% { transform: translate(22px, -6px) rotate(290deg); }
  96% { transform: translate(4px, 0px) rotate(350deg); }
  100% { transform: translate(0, 0) rotate(360deg); }
}
@keyframes futBallShadowKick {
  0%, 64% { transform: translate(0, 0) scale(1); opacity: .55; }
  66% { transform: translate(4px, 0) scale(0.95); opacity: .52; }
  73% { transform: translate(26px, 0) scale(0.65); opacity: .2; }
  81% { transform: translate(38px, 0) scale(1); opacity: .55; }
  89% { transform: translate(22px, 0) scale(0.85); opacity: .4; }
  96% { transform: translate(4px, 0) scale(0.98); opacity: .52; }
  100% { transform: translate(0, 0) scale(1); opacity: .55; }
}
@keyframes ropeJump { 0%, 100% { transform: scaleY(1); opacity: .95; } 50% { transform: scaleY(-0.35); opacity: .35; } }

/* Live workout session banner on Olahraga page */
.lb-live-banner { background: #E4F4DF; border: 1.5px solid #57B367; padding: var(--s3) var(--s4); box-shadow: 0 4px 12px rgba(87, 179, 103, .15); }
.lb-live-banner__row { display: flex; align-items: center; gap: var(--s3); }
.lb-live-dot { width: 10px; height: 10px; border-radius: 50%; background: #2E7D32; animation: livePulse 1.2s infinite; flex: none; }
.lb-live-banner__tx { display: flex; flex-direction: column; gap: 2px; }
.lb-live-banner__tx b { font-size: 13px; color: #1B5E20; }
.lb-live-banner__tx small { font-size: 11px; color: #2E7D32; opacity: .85; }
@keyframes livePulse { 0% { transform: scale(.9); opacity: .6; } 50% { transform: scale(1.3); opacity: 1; } 100% { transform: scale(.9); opacity: .6; } }

/* Sport selector chips bar */
.lb-sports-bar { display: flex; gap: var(--s2); overflow-x: auto; padding-bottom: var(--s1); margin-top: calc(var(--s2) * -1); margin-bottom: calc(var(--s2) * -1); -webkit-overflow-scrolling: touch; }
.lb-sports-bar::-webkit-scrollbar { display: none; }
.lb-sport-chip { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 var(--s3); border-radius: var(--r-pill); background: #fff; border: 1.5px solid var(--line); font-size: 12px; font-weight: 700; color: var(--ink); white-space: nowrap; flex: none; transition: all .15s ease; cursor: pointer; }
.lb-sport-chip.on { background: #1C1B17; color: #fff; border-color: #1C1B17; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.lb-sport-chip__ic { font-size: 14px; }

.lb-body { position: relative; z-index: 4; margin-top: calc(var(--s6) * -1); background: var(--bg); border-radius: 28px 28px 0 0; padding: var(--s5) var(--safe-x) 0; display: flex; flex-direction: column; gap: var(--s4); flex: 1; }
.lb-empty { text-align: center; padding: var(--s6) 0; }

/* source chips: how the entry got here */
.lb-chip { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 var(--s2); border-radius: var(--r-pill); font-size: 11px; font-weight: 800; white-space: nowrap; flex: none; }
.lb-chip .lb-chip__ic { width: 13px; height: 13px; }
.lb-chip--auto { background: #E3EEFF; color: #2457C5; }
.lb-chip--manual { background: #F1ECE2; color: #7A6F5A; }
.lb-chip--scan { background: var(--green-l); color: var(--green-d); }
.lb-legend { display: flex; flex-direction: column; gap: var(--s2); font-size: 12px; color: var(--muted); padding: var(--s2) var(--s1) 0; }
.lb-legend > span { display: flex; align-items: center; gap: var(--s2); }
.lb-filters { flex-wrap: nowrap; gap: 6px; }
.lb-filters .fchip { padding: 0 var(--s3); }
.lb-filters .fchip small { margin-left: var(--s1); font-size: 11px; font-weight: 800; opacity: .55; }

/* summaries */
.lb-sum { display: flex; flex-direction: column; gap: var(--s3); }
.lb-sum__head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s3); }
.lb-sum__head .label { margin-bottom: var(--s1); }
.lb-of { font: 700 14px var(--ui); color: var(--muted); letter-spacing: 0; }
.lb-left { font-size: 12px; font-weight: 800; padding: var(--s1) var(--s3); border-radius: var(--r-pill); background: #F3F0E8; white-space: nowrap; }
.lb-macros { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3) var(--s4); margin-top: var(--s1); }
.lb-macro { display: grid; grid-template-columns: 1fr auto; gap: var(--s1); font-size: 12px; font-weight: 700; color: var(--muted); }
.lb-macro b { color: var(--ink); font-size: 13px; }
.lb-macro b small { color: var(--muted); font-weight: 600; }
.lb-macro .progress { grid-column: 1 / -1; height: 6px; }
.lb-macro .progress:not([class*="--"]) i { background: #F6A623; }
.lb-macro.over b { color: var(--coral); }
.lb-stats3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.lb-stats3 div { display: flex; flex-direction: column; }
.lb-stats3 b { font: 800 24px var(--display); }
.lb-stats3 small { font-size: 12px; color: var(--muted); font-weight: 700; }
.lb-bars { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--s2); height: 112px; padding-bottom: 18px; }
.lb-bars > div { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.lb-bars i { width: 100%; max-width: 28px; min-height: 4px; border-radius: 8px 8px 4px 4px; background: #D8E9D2; }
.lb-bars .hit i { background: var(--green); }
.lb-bars small { position: absolute; bottom: -18px; font-size: 11px; font-weight: 700; color: var(--muted); }
.lb-bars::before { content: ""; position: absolute; left: 0; right: 0; bottom: calc(18px + (100% - 18px) * var(--goal)); border-top: 2px dashed rgba(28, 27, 23, .25); }
.lb-bars__goal { position: absolute; right: 0; bottom: calc(22px + (100% - 18px) * var(--goal)); font-size: 10px; font-weight: 800; color: var(--muted); }
.lb-sum--night { background: #1E2350; color: #fff; }
.lb-sum--night .label, .lb-sum--night .lb-bars small, .lb-sum--night .lb-bars__goal { color: rgba(255, 255, 255, .65); }
.lb-sum--night .lb-left { background: rgba(255, 255, 255, .12); }
.lb-bars--night i { background: #4A5296; }
.lb-bars--night .hit i { background: #A38BD6; }
.lb-bars--night::before { border-color: rgba(255, 255, 255, .3); }

/* week strip (Makan) */
.lb-cal { display: flex; justify-content: space-between; align-items: center; margin-bottom: calc(var(--s2) * -1); }
.lb-cal__month { font-size: 15px; font-weight: 800; }
.lb-cal span { display: flex; gap: var(--s2); }
.lb-cal__nav { width: 32px; height: 32px; border-radius: var(--r-pill); background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; transition: opacity .15s; }
.lb-cal__nav .ei { width: 18px; height: 18px; }
.lb-cal__nav--next .ei { transform: scaleX(-1); }
.lb-cal__nav:disabled { opacity: .35; box-shadow: none; cursor: default; }
.lb-weeks { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.lb-weeks::-webkit-scrollbar { display: none; }
.lb-weeks.dragging { scroll-snap-type: none; cursor: grabbing; }
.lb-weeks .lb-week { flex: 0 0 100%; scroll-snap-align: start; }
.lb-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--s1); }
.lb-week button:disabled { opacity: .35; cursor: default; }
.lb-week button.today:not(.on) b { color: var(--coral); }
.lb-week button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--s2) 0; border-radius: var(--r-md); }
.lb-week small { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.lb-week b { font: 800 16px var(--display); }
.lb-week i { width: 20px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--coin) calc(var(--p) * 100%), #E6E1D6 0); }
.lb-week button.on { background: var(--ink); color: #fff; }
.lb-week button.on small { color: rgba(255, 255, 255, .7); }

/* add actions */
.lb-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
/* icon on the left, title + subtitle as one block centered against it, so cards of unequal copy still line up */
.lb-act { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: var(--s2); row-gap: 2px; align-content: center; align-items: start; text-align: left; background: #fff; border-radius: var(--r-lg); padding: var(--s3); box-shadow: var(--shadow); transition: transform .12s; }
.lb-act:active { transform: scale(.97); }
.lb-act__ic { grid-row: 1 / 3; align-self: center; width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center; font-size: 20px; }
.lb-act b { font-size: 14px; line-height: 1.25; align-self: end; }
.lb-act small { font-size: 11px; color: var(--muted); line-height: 1.3; }

/* meals */
.lb-meal { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
.lb-meal__head { display: flex; justify-content: space-between; align-items: center; }
.lb-meal__head h3 { font-size: 16px; font-weight: 800; }
.lb-meal__head small { font-size: 12px; }
.lb-plus { width: 36px; height: 36px; border-radius: var(--r-pill); background: #F3F0E8; display: grid; place-items: center; font-size: 16px; }
.lb-rows { list-style: none; margin: 0; padding: 0; }
.lb-rows li + li { border-top: 1px solid var(--line); }
.lb-rows button { width: 100%; display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; text-align: left; }
.lb-food { width: 44px; height: 44px; flex: none; border-radius: var(--r-md); background: #FFF4E4; display: grid; place-items: center; font-size: 24px; }
.lb-rows__tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lb-rows__tx b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-rows__tx small { font-size: 12px; color: var(--muted); }
.lb-rows__meta { display: flex; flex-direction: column; align-items: flex-end; gap: var(--s1); }
.lb-rows__meta > b { font: 800 15px var(--display); }
.lb-rows__meta > b small { font: 600 11px var(--ui); color: var(--muted); }

/* workouts */
.lb-day { display: flex; flex-direction: column; gap: var(--s2); }
.lb-day__head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 var(--s1); }
.lb-day__head h3 { font-size: 15px; font-weight: 800; }
.lb-day__head small { font-size: 12px; color: var(--muted); font-weight: 700; }
.lb-wo { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s4); text-align: left; width: 100%; }
.lb-wo__ic { width: 44px; height: 44px; flex: none; border-radius: var(--r-md); display: grid; place-items: center; font-size: 24px; background: var(--green-l); }
.lb-wo__ic--gym { background: #F1EAFF; }
.lb-wo__ic--lari, .lb-wo__ic--sepeda { background: #FFEDE3; }
.lb-wo__ic--futsal { background: #E3F1FF; }
.lb-wo__ic--tali { background: #FFF4D6; }
.lb-wo__tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lb-wo__tx b { font-size: 15px; }
.lb-wo__tx small { font-size: 12px; color: var(--muted); }
.lb-wo__stats { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); margin-top: var(--s1); font-size: 12px; font-weight: 800; }

/* sleep */
.lb-nights { display: flex; flex-direction: column; gap: var(--s3); }
.lb-night { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s4); text-align: left; width: 100%; }
.lb-night__top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 800; color: var(--muted); }
.lb-night__main { display: flex; align-items: baseline; gap: var(--s3); }
.lb-night__main b { font: 800 24px var(--display); }
.lb-night__main span { font-size: 13px; color: var(--muted); flex: 1; }
.lb-night__main em { font-style: normal; font-size: 12px; font-weight: 800; padding: 2px var(--s2); border-radius: var(--r-pill); }
.lb-night__main em.ok { background: var(--green-l); color: var(--green-d); }
.lb-night__main em.low { background: var(--coral-l); color: var(--coral); }
.lb-stagebar { display: flex; height: 10px; border-radius: var(--r-pill); overflow: hidden; gap: 1px; }
.lb-stagebar--none { height: 20px; align-items: center; justify-content: center; border: 1.5px dashed #D8D2C4; font-size: 11px; color: var(--muted); font-weight: 700; }

/* detail pages */
.lb-dhead { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s3); }
.lb-dhead h2 { margin-bottom: var(--s1); }
.lb-dhead small { font-size: 13px; }
.lb-dhead .lb-chip { margin-top: var(--s1); }
.lb-dsum { display: flex; justify-content: space-between; align-items: center; }
.lb-grade { display: flex; flex-direction: column; align-items: center; gap: var(--s1); font-size: 11px; font-weight: 700; color: var(--muted); }
.lb-grade .grade-chip { width: 48px; height: 48px; font-size: 24px; border-radius: var(--r-md); }
.lb-split { display: flex; height: 12px; border-radius: var(--r-pill); overflow: hidden; gap: 2px; }
.lb-macro3 { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: var(--s4); }
.lb-macro3 div { display: flex; flex-direction: column; gap: 2px; }
.lb-macro3 span { font-size: 12px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: var(--s1); }
.lb-macro3 span i { width: 8px; height: 8px; border-radius: 2px; }
.lb-macro3 b { font: 800 18px var(--display); }
.lb-macro3 small { font-size: 11px; color: var(--muted); }
.lb-sugar { display: grid; grid-template-columns: 1fr auto; align-items: center; margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line); font-size: 13px; font-weight: 700; }
.lb-sugar small { grid-column: 1 / -1; font-size: 11px; color: var(--muted); }
.lb-sugar.over b { color: var(--coral); }
.lb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.lb-grid .card { padding: var(--s3) var(--s4); display: flex; flex-direction: column; gap: 2px; border-radius: var(--r-lg); }
.lb-grid small { font-size: 12px; color: var(--muted); font-weight: 700; }
.lb-grid b { font: 800 20px var(--display); }
.lb-ex { padding: var(--s4); }
.lb-ex__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--s2); }
.lb-ex__head b { font-size: 15px; }
.lb-ex__head small { font-size: 12px; color: var(--muted); font-weight: 700; }
.lb-sets { width: 100%; border-collapse: collapse; font-size: 13px; }
.lb-sets th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: var(--s1) 0; }
.lb-sets td { padding: 6px 0; border-top: 1px solid var(--line); font-weight: 700; }
.lb-setno { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: var(--r-pill); background: #F3F0E8; font-size: 12px; }
.lb-splits { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s4); }
.lb-splits div { display: grid; grid-template-columns: 48px 1fr 44px; align-items: center; gap: var(--s3); font-size: 12px; font-weight: 700; }
.lb-splits i { height: 8px; border-radius: var(--r-pill); background: #FF7A45; }
.lb-splits b { text-align: right; }
.lb-goal { font-size: 14px; font-weight: 800; padding: var(--s3) var(--s4); border-radius: var(--r-md); }
.lb-goal.ok { background: var(--green-l); color: var(--green-d); }
.lb-goal.low { background: var(--coral-l); color: var(--coral); }
.lb-hypno { width: 100%; height: auto; overflow: visible; }
.lb-hypno text { font-size: 10px; font-weight: 700; fill: var(--muted); font-family: var(--ui); }
.lb-hypno line { stroke: var(--line); stroke-dasharray: 3 3; }
.lb-stages { display: flex; flex-direction: column; gap: var(--s3); }
.lb-stages > div { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--s3); align-items: baseline; }
.lb-stages span { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: var(--s2); }
.lb-stages span i { width: 10px; height: 10px; border-radius: 3px; }
.lb-stages b { font: 800 15px var(--display); }
.lb-stages small { grid-column: 1 / -1; font-size: 11px; }
.lb-stages .progress { grid-column: 1 / -1; height: 6px; }
.lb-src { display: flex; align-items: center; gap: var(--s3); background: #fff; border-radius: var(--r-md); padding: var(--s3); box-shadow: var(--shadow); }
.lb-src > span:last-child { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.lb-src b { font-size: 14px; }
.lb-src small { font-size: 12px; color: var(--muted); line-height: 1.4; }
.lb-src__ic { width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center; font-size: 18px; background: #F3F0E8; flex: none; }
.lb-src--scan .lb-src__ic { background: var(--green-l); }

/* manual workout: optional exercises */
.wo-moves { display: flex; flex-direction: column; gap: var(--s3); }
.wo-moves .fchip { height: 32px; padding: 0 var(--s3); font-size: 12px; }
.ex-list { display: flex; flex-direction: column; gap: var(--s2); }
.ex-row { display: grid; grid-template-columns: 1fr repeat(3, 52px) 28px; gap: var(--s2); align-items: center; background: #fff; border-radius: var(--r-md); padding: var(--s2) var(--s3); box-shadow: var(--shadow); }
.ex-row b { font-size: 13px; }
.ex-row label { display: flex; flex-direction: column; align-items: center; }
.ex-row input { width: 100%; height: 32px; border: 0; border-radius: var(--s2); background: #F3F0E8; text-align: center; font: 700 14px var(--ui); }
.ex-row small { font-size: 10px; color: var(--muted); }
.ex-row button { font-size: 14px; color: var(--muted); }
.icon-btn--dark { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: none; }

/* Daftar Teman Container & Grid */
.fr-sec-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s2);
}
.fr-sec-head .set-label {
  margin: 0;
}
.fr-count-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: #EFECE4;
  padding: 2px 10px;
  border-radius: 99px;
}
.fr-grid-card {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: var(--s3);
}
.fr-photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.fr-grid-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s ease;
  user-select: none;
}
.fr-grid-item:active {
  transform: scale(0.94);
}
.fr-grid-thumb {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.fr-grid-thumb .pet-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.fr-grid-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}
.fr-grid-thumb--more {
  background: #F4F0E8;
  border: 1.5px dashed #D6D0C2;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.fr-grid-more-num {
  font: 800 17px var(--display);
  color: var(--ink);
  line-height: 1;
}
.fr-view-all-btn {
  height: 44px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--r-md);
  margin-top: 2px;
}

/* Detail Friends List Screen */
.fr-list-pad {
  padding-top: var(--s2);
  gap: var(--s4);
}
.topbar__sub {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  justify-self: end;
  white-space: nowrap;
}
.fr-full-list {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}
.fr-list-item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  background: #fff;
  border: 0;
  width: 100%;
  text-align: left;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.15s ease;
}
.fr-list-item:last-child {
  border-bottom: 0;
}
.fr-list-item:active {
  background: #FAF8F5;
}
.fr-av--list {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  flex: none;
}
.fr-list-item__title {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.fr-list-item__title b {
  font-size: 15px;
  color: var(--ink);
}
.fr-list-item__username {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.fr-list-item__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.fr-online-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: #CCC7BC;
}
.fr-online-dot--on {
  background: var(--green, #22C55E);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}
.fr-list-item__pet {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 2px;
}

/* ---------- Dompet (wallet.js) ---------- */
.wl-pad { gap: var(--s4); }
.wl-month { display: flex; align-items: center; justify-content: space-between; }
.wl-month b { font: 800 16px var(--display); }
.wl-month .icon-btn:disabled { opacity: .35; }
.wl-hero { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.wl-hero .money--xl, .wl-amt { font-size: clamp(26px, 8vw, 36px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wl-hero > small { font-size: 12px; font-weight: 700; }
.wl-io { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.wl-io > div { min-width: 0; }
.wl-io small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }
.wl-io b { display: block; font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-stack { display: flex; gap: 2px; height: 12px; border-radius: var(--r-pill); overflow: hidden; margin-top: var(--s2); }
.wl-stack i { min-width: 3px; }
.wl-cats { display: flex; flex-direction: column; gap: 2px; margin: 0 calc(var(--s2) * -1); }
.wl-cat { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: var(--s3); padding: var(--s2); border-radius: var(--r-sm); text-align: left; min-width: 0; transition: background .12s; }
.wl-cat.on { background: #F3F0E8; box-shadow: inset 0 0 0 2px var(--ink); }
.wl-cat__ic, .wl-ic { width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center; font-size: 18px; flex: none; }
.wl-cat__tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s1); }
.wl-cat__bar { height: 6px; border-radius: var(--r-pill); background: #F0ECE3; overflow: hidden; }
.wl-cat__bar i { display: block; height: 100%; border-radius: var(--r-pill); }
.wl-cat__tx b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-cat__tx small { font-size: 11px; color: var(--muted); font-weight: 700; }
.wl-cat__v { font-size: 13px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }

/* sits at the bottom of .wl-hero, under the category list */
.wl-health { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); padding-top: var(--s4); margin-top: var(--s2); border-top: 1px solid var(--line); }
.wl-h { border-radius: var(--r-md); padding: var(--s3); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wl-h small { font-size: 11px; font-weight: 800; }
.wl-h b { font: 800 15px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-h span { font-size: 11px; line-height: 1.35; opacity: .75; }
.wl-h--good { background: var(--green-l); color: var(--green-d); }
.wl-h--bad { background: var(--coral-l); color: #B53B25; }
.wl-h--inv { background: #E3F0FF; color: #2569C2; }

.wl-ai-card { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s5) var(--s4) var(--s4); }
.wl-ai-card__head { display: flex; align-items: center; gap: var(--s3); }
.wl-ai-card__head .pet-svg { width: 56px; height: 52px; }
.wl-ai-card__head .label { margin-bottom: 2px; }
.wl-ai-card__head b { font-size: 15px; font-weight: 800; }
.wl-spark { width: 14px; height: 14px; vertical-align: -2px; }
.wl-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.wl-lines li { display: flex; gap: var(--s3); align-items: flex-start; font-size: 13px; line-height: 1.45; padding: var(--s3); border-radius: var(--r-md); background: #F7F5F0; }
.wl-lines li > span:first-child { font-size: 20px; line-height: 1; }
.wl-lines li.wl-line--bad { background: #FFF3F0; }
.wl-lines li.wl-line--good { background: #F0F9EE; }

.wl-todo { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s1); border: 2px dashed #F2C9BE; box-shadow: none; }
.wl-todo .card__head { margin-bottom: var(--s1); }
.wl-todo__row, .wl-row { width: 100%; display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; text-align: left; }
.wl-todo__row + .wl-todo__row { border-top: 1px solid var(--line); }
.wl-row__tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wl-row__tx b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-row__tx small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-todo__amt { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.wl-todo__amt b { font-size: 14px; }
.wl-ask { font-size: 12px; font-weight: 800; color: #B53B25; }
.wl-row { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.wl-row:last-child { border: 0; }
.wl-row__end { align-self: flex-start; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding-top: 1px; }
.wl-row__amt { font-size: 14px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wl-row__tags { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s1); }
.wl-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 var(--s2); border-radius: var(--r-pill); font-size: 11px; font-weight: 800; white-space: nowrap; }
.wl-tag--bad { background: var(--coral-l); color: #B53B25; }
.wl-tag--good, .wl-tag--ok { background: var(--green-l); color: var(--green-d); }
.wl-tag--check { background: #FFF4D6; color: #9A6A00; }
.wl-tag--fin { background: #E3F0FF; color: #2569C2; }
.wl-tag--ask { background: var(--ink); color: #fff; }
.wl-adds { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.wl-adds .lb-act { min-height: 68px; }
.wl-catchips { margin-top: calc(var(--s3) * -1); scroll-margin-top: 120px; }
.wl-catchips .fchip { height: 32px; font-size: 12px; }
.wl-day { display: flex; flex-direction: column; gap: var(--s2); }

/* detail & capture sheets */
.wl-flash { background: var(--green-l); color: var(--green-d); border-radius: var(--r-md); padding: var(--s3); font-size: 13px; font-weight: 700; }
.wl-amt { margin: calc(var(--s2) * -1) 0 0; }
.wl-ai { display: flex; gap: var(--s3); align-items: flex-start; background: linear-gradient(135deg, #F4EEFF, #EAF4FF); border-radius: var(--r-lg); padding: var(--s3) var(--s4); }
.wl-ai__ic { font-size: 20px; line-height: 1; padding-top: 2px; }
.wl-ai > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wl-ai small { font-size: 11px; font-weight: 800; color: #7547CF; }
.wl-ai b { font-size: 15px; font-weight: 800; }
.wl-ai p { margin: 0; font-size: 12px; line-height: 1.45; color: #5D5749; }
.wl-ai__edit { height: 32px; font-size: 12px; padding: 0 var(--s3); }
.wl-catpick { display: flex; flex-wrap: wrap; gap: var(--s2); }
.wl-catpick .fchip { height: 34px; padding: 0 var(--s3); font-size: 12px; }
.wl-rule { background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow); font-size: 13px; }
.wl-items .wl-item { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.wl-items .wl-item:last-child { border: 0; }
.wl-item__ic { font-size: 20px; width: 28px; text-align: center; flex: none; }
.wl-item .int-row__body b { font-size: 14px; }
.wl-items__empty { padding: var(--s4); margin: 0; }
.wl-additem { display: grid; grid-template-columns: 1fr 96px auto; gap: var(--s2); align-items: center; }
.wl-additem input { height: 40px; border: 0; border-radius: var(--r-sm); background: #fff; box-shadow: var(--shadow); padding: 0 var(--s3); font: 600 14px var(--ui); min-width: 0; }
.wl-additem__hint { display: block; margin-top: calc(var(--s2) * -1); }
.wl-meal { display: flex; align-items: center; gap: var(--s3); width: 100%; text-align: left; background: #fff; border-radius: var(--r-md); padding: var(--s3); box-shadow: var(--shadow); font-size: 20px; }
.wl-meal--cand { background: #EEF3FF; box-shadow: none; }
.wl-thumb { width: 96px; border-radius: var(--r-md); align-self: flex-start; box-shadow: var(--shadow); }
.wl-note input { font: 600 15px var(--ui); }
.wl-mail { background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow); padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); font-size: 12px; }
.wl-mail__head b { display: block; font-size: 14px; }
.wl-mail__head small { color: var(--muted); }
.wl-mail table { border-collapse: collapse; width: 100%; }
.wl-mail td { padding: 5px var(--s2); vertical-align: top; word-break: break-word; }
.wl-mail td:first-child { color: var(--muted); width: 42%; }
.wl-mail tr.read td { background: var(--green-l); }
.wl-mail tr.read td:last-child { font-weight: 800; color: var(--green-d); }
.wl-mail tr.skip td:last-child i { color: #B9B2A3; }
.wl-mail__foot { color: var(--muted); line-height: 1.45; }
.wl-mail__lock { width: 14px; height: 14px; }
.wl-amtin { display: flex; align-items: baseline; gap: var(--s2); background: #fff; border-radius: var(--r-lg); padding: var(--s3) var(--s4); box-shadow: var(--shadow); }
.wl-amtin span { font: 800 22px var(--display); color: var(--muted); }
.wl-amtin input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: 800 clamp(24px, 7vw, 32px) var(--display); color: var(--ink); }
.wl-drop { display: flex; flex-direction: column; align-items: center; gap: var(--s1); padding: var(--s6) var(--s4); border: 2px dashed #D6D0C3; border-radius: var(--r-lg); background: #fff; }
.wl-drop > span { font-size: 36px; }
.wl-drop small { font-size: 12px; color: var(--muted); }
.wl-reading img { width: 96px; border-radius: var(--r-md); }
.wl-reading b { color: var(--ink); }
.wl-review { display: flex; gap: var(--s4); align-items: center; }
.wl-review img, .wl-review__ph { width: 84px; height: 112px; border-radius: var(--r-md); object-fit: cover; flex: none; box-shadow: var(--shadow); }
.wl-review__ph { display: grid; place-items: center; font-size: 36px; background: #fff; }
.wl-review h3 { margin: 2px 0; }
.wl-review .money { margin: 0; }
.wl-steps:not(.wl-steps--in) li > b { display: block; }
.wl-steps .btn { margin-top: var(--s2); }
.wl-steps--in { padding: 0 var(--s4) var(--s3) calc(var(--s4) + var(--s5)); font-size: 13px; }
.wl-steps code, .wl-fwd code { font-size: 11px; background: #F3F0E8; padding: 1px 4px; border-radius: 4px; word-break: break-all; }
.wl-opt { border: 0; }
.wl-opt .int-row__body b { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.wl-fwd { display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s4) var(--s3); }
.wl-fwd code { flex: 1; font-size: 13px; padding: var(--s2) var(--s3); }

/* iOS "Add Shortcut" sheet */
.wl-sc { background: #F2F2F7; }
.wl-sc__nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: var(--s4); font-size: 16px; }
.wl-sc__nav button { justify-self: start; color: #007AFF; font-size: 16px; }
.wl-sc__card { margin: var(--s4); background: #fff; border-radius: var(--r-lg); padding: var(--s5); display: flex; flex-direction: column; align-items: center; gap: var(--s2); }
.wl-sc__tile { width: 64px; height: 64px; border-radius: 16px; background: linear-gradient(135deg, #A47CF3, #3D8FD6); display: grid; place-items: center; font-size: 32px; }
.wl-sc__card > b { font-size: 18px; }
.wl-sc__card > small { color: var(--ios-gray); align-self: flex-start; margin-top: var(--s2); }
.wl-sc__card ol { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: var(--s2); }
.wl-sc__card li { display: flex; align-items: center; gap: var(--s3); background: #F2F2F7; border-radius: var(--r-sm); padding: var(--s3); font-weight: 700; font-size: 14px; }
.wl-sc__card li small { color: var(--ios-gray); font-weight: 500; }
.wl-sc__ic { width: 28px; height: 28px; border-radius: 7px; background: #fff; display: grid; place-items: center; font-size: 16px; }
.wl-sc__ic--w { background: var(--ink); color: #fff; font-size: 13px; font-weight: 800; }
.wl-sc__add { margin: 0 var(--s4); height: 50px; border-radius: 14px; background: #007AFF; color: #fff; font-size: 16px; font-weight: 700; }

/* Back Tap simulation */
.flow--bt { background: rgba(20, 18, 14, .97); }
.flow--bt > div { margin: 0; background: none; border-radius: 0; animation: none; }
.wl-bt { flex: 1; display: flex; flex-direction: column; align-items: center; gap: var(--s4); padding: var(--safe-top) var(--safe-x) 0; color: #fff; overflow-y: auto; }
.wl-bt__phone { position: relative; width: 220px; height: 300px; border-radius: 32px; background: #fff; border: 6px solid #2B2724; overflow: hidden; flex: none; }
.wl-bt__pay { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s1); color: var(--ink); background: linear-gradient(#E9F7EC, #fff 55%); padding: var(--s4); text-align: center; }
.wl-bt__pay > small { font-size: 11px; color: var(--muted); }
.wl-bt__ok { width: 48px; height: 48px; border-radius: 99px; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 26px; margin: var(--s1) 0; }
.wl-bt__pay b { font: 800 26px var(--display); }
.wl-bt__pay p { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.wl-bt__btn { margin-top: var(--s3); width: 100%; height: 36px; border-radius: var(--r-pill); background: var(--green); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.wl-bt__flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.wl-bt__thumb { position: absolute; left: 10px; bottom: 10px; width: 0; height: 0; border-radius: 6px; border: 2px solid #fff; background: linear-gradient(#E9F7EC, #fff); box-shadow: 0 4px 12px rgba(0, 0, 0, .3); opacity: 0; pointer-events: none; }
.wl-bt__phone.shot .wl-bt__flash { animation: btFlash .45s ease; }
.wl-bt__phone.shot .wl-bt__thumb { animation: btThumb 1.4s ease forwards; }
@keyframes btFlash { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
@keyframes btThumb { 0% { opacity: 0; width: 196px; height: 276px; left: 6px; bottom: 6px; } 25% { opacity: 1; } 60% { width: 54px; height: 76px; left: 10px; bottom: 10px; opacity: 1; } 100% { width: 54px; height: 76px; left: -70px; bottom: 10px; opacity: 0; } }
.wl-bt__banner { position: absolute; top: 10px; left: 8px; right: 8px; display: flex; gap: var(--s2); align-items: center; text-align: left; background: rgba(245, 245, 245, .96); color: var(--ink); border-radius: 18px; padding: var(--s2) var(--s3); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); animation: drop .4s cubic-bezier(.2, 1.3, .4, 1); }
.wl-bt__banner[hidden] { display: none; }
.wl-bt__banner > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.wl-bt__banner small { font-size: 10px; color: var(--muted); }
.wl-bt__banner b { font-size: 12px; line-height: 1.3; }
.wl-bt__app { width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.wl-bt__hint { margin: 0; text-align: center; font-size: 14px; line-height: 1.5; min-height: 42px; }
.wl-bt__back { width: 220px; height: 120px; border-radius: 28px; background: linear-gradient(135deg, #3B3632, #26221F); border: 2px solid #4A443F; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2); color: rgba(255, 255, 255, .7); position: relative; flex: none; }
.wl-bt__back.hit { animation: btHit .25s ease; }
@keyframes btHit { 50% { transform: scale(.96); box-shadow: 0 0 0 10px rgba(164, 124, 243, .35); } }
.wl-bt__cam { position: absolute; top: 12px; left: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 5px; border-radius: 12px; background: #1B1816; }
.wl-bt__cam i { width: 13px; height: 13px; border-radius: 99px; background: radial-gradient(circle at 40% 40%, #5C6A80, #0F1013 70%); }
.wl-bt__dots { display: flex; gap: var(--s2); }
.wl-bt__dots i { width: 14px; height: 14px; border-radius: 99px; border: 2px solid rgba(255, 255, 255, .5); transition: background .12s; }
.wl-bt__dots i.on { background: #A47CF3; border-color: #A47CF3; }
.wl-bt__back small { font-size: 12px; font-weight: 700; }
.flow--bt .demo-tag { color: rgba(255, 255, 255, .45); }

.fr-list-item--discover {
  cursor: default;
}
.fr-list-item--discover:active {
  background: #fff;
}
.fr-add-friend-btn {
  flex: none;
  font-weight: 700;
  padding: 0 var(--s3);
  height: 32px;
  border-radius: var(--r-pill);
  font-size: 13px;
}
.fr-sheet-results {
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: var(--s2);
}

/* wake-up scene change (app.js sceneWipe): a dark panel follows the pet out the right edge, then uncovers the morning */
.scene-wipe { position: absolute; inset: 0; z-index: 5; background: var(--night-top, #1C1B17); animation: wipeIn .36s cubic-bezier(.6, 0, .4, 1) forwards; pointer-events: none; }
.scene-wipe.out { animation: wipeOut .36s .12s cubic-bezier(.6, 0, .4, 1) forwards; }
@keyframes wipeIn { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes wipeOut { from { transform: none; } to { transform: translateX(100%); } }

/* asleep: the home world shows the Tidur page bedroom (app.js setBedroom). Same art and pet size as
   .lb-hero--tidur, lifted so the bed clears the dock; the wall and floor colors fill above and below. */
.bedroom { position: absolute; inset: 0; z-index: 1; display: none; background: linear-gradient(#1B1F4B 50%, #2A2F63 50%); }
.bedroom svg { position: absolute; left: 0; bottom: 88px; width: 100%; height: 320px; }
.world.in-bed .bedroom { display: block; }
.world.in-bed .pet-svg--world { width: 220px; height: 170px; bottom: 154px; transform: translateX(calc(-50% + 14px)) scaleX(-1); }
/* waking: hops off the bed to the floor in front of it before walking out */
.world.in-bed.off-bed .pet-svg--world { bottom: 104px; transform: translateX(calc(-50% + 14px)); transition: bottom .5s cubic-bezier(.5, -.6, .6, 1); }
.world.in-bed .pet-shadow { opacity: 0; }
.world.off-bed .pet-shadow { opacity: 1; }
.world.off-bed .bedroom .lb-zzz { display: none; }

/* ---------- daily login streak (recap.js) ---------- */
.streak-chip { position: relative; display: inline-flex; align-items: center; gap: var(--s1); margin-top: var(--s2); height: 32px; padding: 0 var(--s3) 0 var(--s2); border-radius: var(--r-pill); background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); color: var(--ink); box-shadow: var(--shadow); font-size: 12px; font-weight: 700; transition: transform .12s; }
.streak-chip:active { transform: scale(.94); }
.streak-chip b { font-family: var(--display); font-size: 16px; font-weight: 800; }
.streak-chip__ic { width: 20px; height: 20px; vertical-align: 0; }
.streak-chip--open .streak-chip__ic { animation: flicker 1.2s ease-in-out infinite; transform-origin: 50% 90%; }
.streak-chip__gift { position: absolute; top: calc(var(--s2) * -1); right: calc(var(--s2) * -1); width: 20px; height: 20px; display: grid; place-items: center; animation: nudge 1.6s ease-in-out infinite; }
.streak-chip__gift .ei { width: 20px; height: 20px; vertical-align: 0; }
@keyframes flicker { 50% { transform: scale(1.12, .92) rotate(-4deg); } }
@keyframes nudge { 0%, 70%, 100% { transform: rotate(0); } 78% { transform: rotate(-14deg); } 86% { transform: rotate(12deg); } 94% { transform: rotate(-6deg); } }

.streak-pad { padding-bottom: var(--s10); gap: var(--s4); }
.streak-hero { position: relative; overflow: hidden; isolation: isolate; display: grid; grid-template-columns: 1fr 132px; align-items: end; gap: var(--s2); min-height: 192px; padding: var(--s5); border-radius: var(--r-card); color: #fff; background: #1B1450; box-shadow: 0 8px 24px rgba(74, 35, 128, .3); }
/* twilight campfire backdrop (recap.js STREAK_SCENE); a soft dark wash behind the copy keeps it readable */
.streak-hero__scene { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
.streak-hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(90% 80% at 0% 40%, rgba(20, 12, 56, .55), transparent 70%); pointer-events: none; }
.streak-hero__text { text-shadow: 0 1px 8px rgba(20, 12, 56, .45); }
.streak-hero__stars circle:nth-child(odd) { animation: twinkle 2.4s ease-in-out infinite; }
.streak-hero__stars circle:nth-child(3n) { animation: twinkle 3.2s ease-in-out infinite -1s; }
.streak-hero__fire { transform-box: fill-box; transform-origin: 50% 100%; animation: campfire 1.1s ease-in-out infinite; }
.streak-hero__glow { transform-box: fill-box; transform-origin: center; animation: glowPulse 2.2s ease-in-out infinite; }
.streak-hero__sparks circle { transform-box: fill-box; animation: spark 1.8s ease-out infinite; }
.streak-hero__sparks circle:nth-child(2) { animation-delay: -.6s; }
.streak-hero__sparks circle:nth-child(3) { animation-delay: -1.2s; }
@keyframes campfire { 33% { transform: scale(1.06, .94) skewX(-3deg); } 66% { transform: scale(.96, 1.06) skewX(3deg); } }
@keyframes glowPulse { 50% { opacity: .75; transform: scale(.94); } }
@keyframes spark { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translate(4px, -40px); } }
.streak-hero__num { display: flex; align-items: center; gap: var(--s1); }
.streak-hero__num .ei { width: 44px; height: 44px; vertical-align: 0; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .12)); }
.streak-hero__num b { font-family: var(--display); font-weight: 800; font-size: 64px; line-height: 1; letter-spacing: -.03em; }
.streak-hero__sub { margin-top: var(--s2); font-size: 13px; font-weight: 600; line-height: 1.45; opacity: .92; }
.streak-hero__pet { width: 160px; height: 124px; margin: 0 calc(var(--s5) * -1) calc(var(--s3) * -1) calc(var(--s6) * -1); }

.daily { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); }
.daily__tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--s1); padding: var(--s2) var(--s1); border-radius: var(--r-md); background: #F6F3EC; text-align: center; }
.daily__tile small { font-size: 11px; font-weight: 700; color: var(--muted); }
.daily__tile b { font-family: var(--display); font-size: 14px; font-weight: 800; }
.daily__art { width: 32px; height: 32px; vertical-align: 0; }
.daily__tile--big { grid-column: span 2; background: linear-gradient(135deg, #EFE6FF, #FFE2F0); }
.daily__tile--big .daily__art { width: 40px; height: 40px; }
.daily__tile--done { opacity: .5; }
.daily__tile--today { background: #FFF1D6; box-shadow: inset 0 0 0 2px var(--coin); animation: glow 1.6s ease-in-out infinite; }
.daily__tile--today small { color: #B86A00; }
/* sits on the tile's corner so it never covers the "Hari N" label, even at 375px */
.daily__check { position: absolute; top: calc(var(--s2) * -1); right: calc(var(--s2) * -1); width: 20px; height: 20px; border-radius: var(--r-pill); background: var(--green); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }
.daily__check .ei { width: 12px; height: 12px; vertical-align: 0; }
@keyframes glow { 50% { box-shadow: inset 0 0 0 2px var(--coin), 0 0 0 4px rgba(246, 196, 69, .25); } }
.daily__cta { margin-top: var(--s4); }
.daily__cta[disabled] { color: var(--muted); }
.progress--fire i { background: linear-gradient(90deg, #FFC93C, #FF7A45); }
.miles { list-style: none; margin: var(--s4) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s3); }
.miles li { display: flex; align-items: center; gap: var(--s3); }
.miles__badge { position: relative; width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: var(--r-sm); background: #F1EEE6; filter: grayscale(1); opacity: .6; }
.miles__badge .ei { width: 32px; height: 32px; vertical-align: 0; }
.miles__badge b { position: absolute; bottom: 4px; font-family: var(--display); font-size: 11px; font-weight: 800; color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
.miles li.got .miles__badge, .miles li.next .miles__badge { filter: none; opacity: 1; background: #FFF1D6; }
.miles__tx { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.miles__tx small { font-size: 12px; color: var(--muted); font-weight: 600; }
.miles__st { font-size: 12px; font-weight: 800; color: var(--muted); display: inline-flex; align-items: center; gap: var(--s1); }
.miles li.got .miles__st { color: var(--green-d); }
.miles li.next .miles__st { color: #B86A00; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--s1); text-align: center; }
.cal > b { font-size: 11px; color: var(--muted); padding-bottom: var(--s1); }
.cal__d { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: var(--r-sm); font-size: 12px; font-weight: 700; }
.cal__d .ei { position: absolute; inset: 4px; width: auto; height: auto; opacity: .9; }
.cal__d i { position: relative; font-style: normal; }
.cal__d--lit { color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.cal__d--today { box-shadow: inset 0 0 0 2px var(--ink); }
.cal__d--future { color: #C9C3B6; }
.streak-shield { display: flex; gap: var(--s3); align-items: center; padding: var(--s4); border-radius: var(--r-lg); background: #EAF6FF; }
.streak-shield__ic { width: 40px; height: 40px; vertical-align: 0; }
.streak-shield p { display: flex; flex-direction: column; gap: var(--s1); font-size: 14px; }
.streak-shield small { font-size: 12px; line-height: 1.45; color: #4D6A80; font-weight: 600; }

/* ---------- weekly recap card on Beranda ---------- */
.recap-card { position: relative; overflow: hidden; display: flex; align-items: stretch; min-height: 140px; padding: var(--s5); border-radius: var(--r-card); text-align: left; color: #fff; background: linear-gradient(135deg, #5B2EE0 0%, #A447D6 55%, #FF6FA8 100%); box-shadow: 0 8px 24px rgba(91, 46, 224, .3); transition: transform .12s; }
.recap-card:active { transform: scale(.98); }
.recap-card__decor { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; pointer-events: none; }
.recap-card__text { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); width: 62%; }
.recap-card__eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #FFE45C; }
.recap-card__title { font-family: var(--display); font-size: 18px; font-weight: 800; line-height: 1.2; }
.recap-card__cta { margin-top: auto; display: inline-flex; align-items: center; gap: var(--s1); height: 32px; padding: 0 var(--s3); border-radius: var(--r-pill); background: #FFE45C; color: var(--ink); font-size: 13px; font-weight: 800; }
.recap-card__cta .ei { width: 14px; height: 14px; vertical-align: 0; }
.recap-card__pet { position: absolute; z-index: 1; right: calc(var(--s8) * -1); bottom: calc(var(--s3) * -1); width: 200px; height: 154px; pointer-events: none; }
.recap-card__new { position: absolute; z-index: 2; top: var(--s3); right: var(--s3); padding: 2px var(--s2); border-radius: var(--r-pill); background: #FFE45C; color: var(--ink); font-size: 11px; font-weight: 800; animation: nudge 2s ease-in-out infinite; }

/* ---------- weekly recap story ---------- */
.screen--story { background: #000; overflow: hidden; }
.story { position: absolute; inset: 0; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.story__top { position: absolute; z-index: 5; top: calc(var(--safe-top) - var(--s4)); left: var(--s2); right: var(--s2); display: flex; flex-direction: column; gap: var(--s3); pointer-events: none; }
.story__bars { display: flex; gap: var(--s1); }
.story__bars span { flex: 1; height: 4px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .35); overflow: hidden; }
.story__bars i { display: block; height: 100%; width: 0; background: #fff; border-radius: inherit; }
.story__bars span.done i { width: 100%; }
.story__bars span.run i { animation: storyBar var(--dur, 6s) linear forwards; }
.story.paused .story__bars span.run i { animation-play-state: paused; }
@keyframes storyBar { to { width: 100%; } }
.story__head { display: flex; justify-content: space-between; align-items: center; padding: 0 var(--s2); color: #fff; }
.story__brand { display: inline-flex; align-items: center; gap: var(--s2); font-size: 13px; font-weight: 800; text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.story__brand img { border-radius: 6px; }
.story__close { pointer-events: auto; width: 40px; height: 40px; border-radius: var(--r-pill); display: grid; place-items: center; color: #fff; font-size: 16px; background: rgba(0, 0, 0, .18); }
.story[data-theme="day"] .story__head, .story[data-theme="kitchen"] .story__head, .story[data-theme="gold"] .story__head { color: var(--ink); }
.story[data-theme="day"] .story__bars span, .story[data-theme="kitchen"] .story__bars span, .story[data-theme="gold"] .story__bars span { background: rgba(28, 27, 23, .18); }
.story[data-theme="day"] .story__bars i, .story[data-theme="kitchen"] .story__bars i, .story[data-theme="gold"] .story__bars i { background: var(--ink); }
.story[data-theme="day"] .story__close, .story[data-theme="kitchen"] .story__close, .story[data-theme="gold"] .story__close { color: var(--ink); background: rgba(255, 255, 255, .45); }

.slide { --slide-bg: #5B2EE0; position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--slide-bg); color: #fff; opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s; }
.slide.on { opacity: 1; visibility: visible; }
.slide--day { color: #0E2F4D; }
.slide--kitchen { color: #4A2A12; }
.slide--night { --slide-bg: #1B1F4B; color: #fff; }
.slide--gym { color: #fff; }
.slide--gold { --slide-bg: #FFC93C; color: #3D2600; }
.slide--sunset { --slide-bg: #FF6A4D; color: #fff; }
/* scene slides: the scene sits at the bottom; above it the slide is painted in the scene's top color
   (--slide-bg, set per slide) and .slide__fade melts that color into the scene so copy stays readable */
.slide__scene { position: absolute; left: 0; right: 0; bottom: 0; overflow: hidden; }
.slide__scene > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.slide__fade { position: absolute; left: 0; right: 0; top: -1px; height: 40%; background: linear-gradient(var(--slide-bg), transparent); pointer-events: none; }
/* every slide but the outro: the slide color sits solid behind the copy and fades out lower down,
   so rays, sparkles and icons only show around the pet */
.slide__veil { position: absolute; left: 0; right: 0; top: 0; height: 72%; background: linear-gradient(var(--slide-bg) 75%, transparent); pointer-events: none; }
.slide--scene .slide__veil { height: 52%; background: linear-gradient(var(--slide-bg) 70%, transparent); }
.slide__pet--scene { z-index: 2; transform: translateX(-50%); }
.slide__pet--flip .story__pet { transform: scaleX(-1); }
.slide__pet--flip .pet-shadow { opacity: 0; }
.slide--outro { --slide-bg: #1C1B17; background: radial-gradient(120% 80% at 50% 0%, #5B2EE0, #1C1B17 70%); color: #fff; }
.slide__decor { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.slide__decor .fl { transform-box: fill-box; transform-origin: center; animation: floaty 6s ease-in-out infinite; }
.slide__decor .fl--1 { animation-duration: 7.5s; animation-delay: -2s; }
.slide__decor .fl--2 { animation-duration: 5s; animation-delay: -4s; }
.slide__decor .spin { transform-origin: 195px 600px; animation: rot 60s linear infinite; }
@keyframes floaty { 50% { transform: translateY(-12px) rotate(8deg); } }
.slide__body { position: relative; z-index: 3; display: flex; flex-direction: column; gap: var(--s3); padding: calc(var(--safe-top) + var(--s16)) var(--s6) 0; }
.slide__pet { position: absolute; z-index: 1; left: 50%; bottom: var(--s6); width: 320px; height: 246px; transform: translateX(-50%); pointer-events: none; }
.slide__pet--sm { left: auto; right: calc(var(--s4) * -1); bottom: var(--s2); width: 200px; height: 154px; transform: none; }
.slide__pet .story__pet { width: 100%; height: 100%; }
.slide .pop { opacity: 0; }
.slide.on .pop { animation: storyPop .6s cubic-bezier(.2, 1.4, .4, 1) both; animation-delay: calc(var(--i) * 140ms + 100ms); }
@keyframes storyPop { from { opacity: 0; transform: translateY(24px) scale(.94); } to { opacity: 1; transform: none; } }

.sl-eyebrow { font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.sl-title { font-family: var(--display); font-size: 36px; font-weight: 800; line-height: 1.04; letter-spacing: -.02em; }
.sl-title--center { text-align: center; }
.sl-text { font-size: 17px; font-weight: 700; line-height: 1.4; }
.sl-text--sm { font-size: 14px; }
.sl-big { font-family: var(--display); font-size: 72px; font-weight: 800; line-height: .95; letter-spacing: -.04em; }
.sl-unit { font-size: 28px; letter-spacing: -.01em; }
.sl-chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.sl-chip { display: inline-flex; align-items: center; gap: var(--s1); padding: var(--s2) var(--s3); border-radius: var(--r-pill); background: rgba(255, 255, 255, .55); color: inherit; font-size: 13px; font-weight: 800; }
.slide--night .sl-chip, .slide--sunset .sl-chip, .slide--gym .sl-chip { background: rgba(255, 255, 255, .18); }
.sl-bars { display: flex; align-items: flex-end; gap: var(--s2); height: 96px; margin: var(--s2) 0; }
.sl-bars span { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: var(--s1); }
.sl-bars i { width: 100%; border-radius: var(--s2); background: #B9A6FF; transform-origin: bottom; }
.slide.on .sl-bars i { animation: grow .8s cubic-bezier(.2, 1.2, .4, 1) both; animation-delay: .7s; }
.sl-bars .low i { background: #FF8FA3; }
.sl-bars small { font-size: 11px; font-weight: 700; opacity: .8; }
@keyframes grow { from { transform: scaleY(0); } }
.sl-list, .sl-todo { list-style: none; margin: var(--s2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.sl-list__row { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-md); background: rgba(255, 255, 255, .6); font-size: 16px; font-weight: 800; }
/* the gym pet flips up behind the list, so rows frost what's behind them to keep the copy readable */
.slide--gym .sl-list__row { background: rgba(28, 27, 23, .45); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.sl-list__ic, .sl-todo__ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: var(--r-sm); background: #fff; }
.sl-list__ic .ei, .sl-todo__ic .ei { width: 28px; height: 28px; vertical-align: 0; }
.sl-todo__row { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3); border-radius: var(--r-md); background: rgba(255, 255, 255, .7); }
.sl-todo__row > span:last-child { display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.sl-todo__row small { font-size: 12px; line-height: 1.4; font-weight: 600; opacity: .8; }
.sl-persona { display: flex; flex-direction: column; gap: var(--s2); font-family: var(--display); font-size: 44px; font-weight: 800; line-height: 1; letter-spacing: -.03em; color: #FFE45C; text-shadow: 0 3px 0 rgba(120, 20, 40, .25); }
/* the persona icon sits on a white tile so it shows up on any slide color (the runner is orange on orange otherwise) */
.sl-persona__ic { align-self: flex-start; width: 80px; height: 80px; display: grid; place-items: center; border-radius: var(--r-lg); background: #fff; box-shadow: 0 4px 0 rgba(120, 20, 40, .25); animation: floaty 3s ease-in-out infinite; }
.sl-persona .ei { width: 56px; height: 56px; vertical-align: 0; }
.slide--outro .slide__body { align-items: center; padding-top: calc(var(--safe-top) + var(--s12)); gap: var(--s3); }
.sl-card { font-size: min(9.2px, calc((min(100dvh, 844px) - 360px) / 53.4)); }
.sl-card .wrap-card { transform: rotate(-2deg); box-shadow: 0 16px 40px rgba(0, 0, 0, .45); }
.sl-actions { display: flex; gap: var(--s2); width: 100%; }
.sl-actions .btn { flex: 1; height: 48px; padding: 0 var(--s3); font-size: 14px; white-space: nowrap; }
.sl-actions .ei, .sl-ig .ei { width: 18px; height: 18px; vertical-align: 0; }
.sl-ig { color: #fff; background: linear-gradient(45deg, #FEC564 0%, #F9475E 45%, #C13584 75%, #833AB4 100%); }
.sl-replay { width: 100%; height: 52px; margin-top: var(--s3); font-size: 14px; color: #fff; background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.sl-replay .ei { width: 18px; height: 18px; vertical-align: 0; }

/* the shareable recap card: em-based, 30em x 53.33em (9:16), scaled by the parent's font-size */
.wrap-card { position: relative; overflow: hidden; width: 30em; height: 53.33em; padding: 2.8em 2.4em; border-radius: 2.4em; display: flex; flex-direction: column; align-items: center; text-align: center; color: #fff; background: linear-gradient(160deg, #5B2EE0 0%, #A447D6 55%, #FF6FA8 100%); }
.wrap-card__decor { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .6; }
.wrap-card > :not(.wrap-card__decor) { position: relative; }
.wrap-card__eyebrow { font-size: 1.15em; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #FFE45C; }
.wrap-card__title { margin-top: .4em; font-family: var(--display); font-size: 3em; font-weight: 800; line-height: 1.02; letter-spacing: -.02em; }
.wrap-card__pet { width: 26em; height: 20em; margin: .4em 0 -.6em; flex: none; }
.wrap-card__persona { padding: .5em 1.2em; border-radius: 99em; background: #FFE45C; color: var(--ink); font-family: var(--display); font-size: 1.6em; font-weight: 800; }
.wrap-card__persona .ei { width: 1.3em; height: 1.3em; }
.wrap-card__grid { width: 100%; margin-top: 1.4em; display: grid; grid-template-columns: 1fr 1fr; gap: .8em; }
.wrap-card__grid div { display: flex; flex-direction: column; gap: .3em; padding: 1em .6em; border-radius: 1.4em; background: rgba(255, 255, 255, .18); }
.wrap-card__grid small { font-size: 1.05em; font-weight: 700; opacity: .85; }
.wrap-card__grid b { font-family: var(--display); font-size: 2em; font-weight: 800; letter-spacing: -.02em; }
.wrap-card__foot { margin-top: auto; display: inline-flex; align-items: center; gap: .5em; font-size: 1.1em; font-weight: 800; opacity: .9; }
.wrap-card__foot img { width: 1.4em; height: 1.4em; border-radius: .3em; }

/* video export + share sheet */
.vid { display: flex; gap: var(--s4); align-items: center; margin: var(--s2) 0 var(--s4); }
.vid__thumb { position: relative; font-size: 3.2px; flex: none; }
.vid__play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }
.vid__play .ei { width: 32px; height: 32px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .4)); }
.vid__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s2); }
.vid__info b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vid__step { font-size: 12px; font-weight: 700; color: var(--muted); }
.vid__step.gain { color: var(--green-d); }
.share-head { display: flex; gap: var(--s3); align-items: center; padding-bottom: var(--s4); border-bottom: 1px solid var(--line); }
.share-head__thumb { font-size: 2px; flex: none; }
.share-head > div:last-child { display: flex; flex-direction: column; gap: var(--s1); font-size: 14px; }
.share-apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); padding: var(--s4) 0 var(--s2); }
.share-apps button { display: flex; flex-direction: column; align-items: center; gap: var(--s2); font-size: 12px; font-weight: 700; }
.share-app { width: 60px; height: 60px; border-radius: var(--r-md); display: grid; place-items: center; }
.share-app svg { width: 36px; height: 36px; }
.share-app--ig { background: linear-gradient(45deg, #FEC564 0%, #F9475E 45%, #C13584 75%, #833AB4 100%); }
.share-app--wa { background: #25D366; }
.share-app--link { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.share-app--more { background: #C9C3B6; }
.share-note { text-align: center; }

/* simulated Instagram story composer */
.igs { position: absolute; inset: 0; z-index: 33; background: #000; color: #fff; animation: fadeIn .25s ease; }
/* recap.js sizes the canvas to the largest 9:16 box that fits above the bottom bar */
/* canvas starts under the ✕/tool row; the card sits a bit smaller on an IG-style backdrop so the
   link sticker's default spot (below the card) covers none of the numbers */
.igs__canvas { position: absolute; top: calc(var(--safe-top) + 40px + var(--s2)); left: 50%; transform: translateX(-50%); border-radius: var(--r-md); overflow: hidden; background: linear-gradient(160deg, #2E1A73 0%, #5A2380 55%, #8A2C66 100%); }
.igs__canvas .wrap-card { position: absolute; top: 1.2em; left: 50%; transform: translateX(-50%); font-size: .86em; }
.igs__sticker { position: absolute; left: 50%; top: 90.5%; transform: translateX(-50%) rotate(-3deg); display: inline-flex; align-items: center; gap: var(--s1); padding: .6em .9em; border-radius: var(--r-sm); background: #fff; color: #3D8FD6; font-size: 1.15em; font-weight: 800; white-space: nowrap; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); cursor: grab; touch-action: none; }
.igs.posted .igs__sticker { pointer-events: none; }
.igs__tools { position: absolute; z-index: 2; top: var(--safe-top); left: var(--s4); right: var(--s4); display: flex; justify-content: space-between; align-items: flex-start; }
.igs__x { width: 40px; height: 40px; border-radius: var(--r-pill); display: grid; place-items: center; color: #fff; font-size: 16px; background: rgba(0, 0, 0, .3); }
.igs__tool-row { display: flex; gap: var(--s2); }
.igs__tool-row span { width: 40px; height: 40px; border-radius: var(--r-pill); display: grid; place-items: center; background: rgba(0, 0, 0, .3); font-size: 16px; font-weight: 800; }
.igs.posted .igs__tools { justify-content: flex-end; }
.igs__bottom { position: absolute; left: var(--s4); right: var(--s4); bottom: var(--s4); display: flex; gap: var(--s2); align-items: center; }
.igs__dest { flex: 1; height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); border-radius: var(--r-pill); background: #262626; color: #fff; font-size: 13px; font-weight: 700; }
.igs__send { width: 48px; height: 48px; flex: none; border-radius: var(--r-pill); background: #fff; color: #000; font-size: 24px; font-weight: 800; }
.igs.posting .igs__dest, .igs.posting .igs__send { pointer-events: none; }
.igs .spin { width: 16px; height: 16px; border-width: 2px; border-color: rgba(255, 255, 255, .3); border-top-color: #fff; }
.igs__av { width: 32px; height: 32px; flex: none; border-radius: var(--r-pill); padding: 2px; background: linear-gradient(45deg, #FEC564, #F9475E, #C13584); display: grid; place-items: center; overflow: hidden; }
.igs__av svg { width: 100%; height: 100%; border-radius: var(--r-pill); background: #F4F2EC; }
.igs__av--sm { width: 24px; height: 24px; }
.igs__star { width: 24px; height: 24px; border-radius: var(--r-pill); background: #1DB954; display: grid; place-items: center; font-size: 12px; }
.igs__viewbar { position: absolute; top: calc(var(--safe-top) - var(--s3)); left: var(--s4); right: var(--s4); height: 4px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .35); overflow: hidden; }
.igs__viewbar i { display: block; height: 100%; width: 0; background: #fff; animation: storyBar 15s linear forwards; }
.igs__who { position: absolute; top: var(--safe-top); left: var(--s4); height: 40px; display: flex; align-items: center; gap: var(--s2); font-size: 13px; text-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.igs__who small { opacity: .8; }
.igs__posted { position: absolute; left: var(--s4); right: var(--s4); bottom: var(--s4); display: flex; flex-direction: column; align-items: center; gap: var(--s1); }
.igs__seen { display: inline-flex; align-items: center; gap: var(--s2); font-size: 14px; font-weight: 800; }
.igs__seen .ei { width: 18px; height: 18px; vertical-align: 0; }
.igs__reacts { position: absolute; inset: 0; pointer-events: none; }
.igs__react { position: absolute; bottom: var(--s4); display: flex; flex-direction: column; align-items: center; animation: reactUp 2.6s ease-out forwards; }
.igs__react b { font-size: 32px; line-height: 1; }
.igs__react b .ei { width: 36px; height: 36px; }
.igs__react small { padding: 2px var(--s2); border-radius: var(--r-pill); background: rgba(0, 0, 0, .45); font-size: 11px; font-weight: 700; }
@keyframes reactUp { from { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; transform: translateY(-24px) scale(1.1); } to { transform: translateY(-260px) scale(1); opacity: 0; } }

/* ---------- desktop touch emulation (touch-emu.js) ----------
   mouse + hover devices only: inside the phone the cursor becomes a finger dot (like DevTools device mode)
   and click-drag scrolls. No text selection on drag, a finger can't do that either. */
.touch-emu .phone, .touch-emu .phone * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='12' cy='12' r='10' fill='rgba(128,128,128,.45)' stroke='rgba(255,255,255,.9)' stroke-width='1.5'/%3E%3C/svg%3E") 12 12, default !important;
}
.touch-emu .phone { user-select: none; -webkit-user-select: none; }
.touch-emu .phone :is(input, textarea, [contenteditable="true"]) { user-select: text; -webkit-user-select: text; }
