/* A.F.R.A ♥ theme: simple and calm, like Instagram's light and dark modes.
   Black/white surfaces, grey secondary text, one blue accent, your own messages in blue. Loaded last. */
:root {
  color-scheme: light dark;            /* native controls (dropdowns, scrollbars, date pickers) follow the theme */
  --bg: #ffffff; --panel: #ffffff; --sheet: #ffffff; --field: #efefef; --hover: #f5f5f5;
  --ink: #000000; --muted: #737373; --line: #dbdbdb;
  --accent: #0095f6; --accent-press: #1877f2; --on-accent: #ffffff;
  --mine: #3797f0; --mine-ink: #ffffff; --theirs: #efefef; --theirs-ink: #000000;
  --love: #ff3040; --ok: #1cd14f; --shadow: none;
  --navy: var(--accent); --gold: var(--accent);   /* older names, kept so nothing is left unstyled */
  --serif: var(--sans);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --panel: #000000; --sheet: #262626; --field: #262626; --hover: #121212;
    --ink: #f5f5f5; --muted: #a8a8a8; --line: #262626;
    --theirs: #262626; --theirs-ink: #f5f5f5;
  }
}
html, body, #app { background: var(--bg); color: var(--ink); }

/* headers: plain, like the rest of the page */
.top { background: var(--bg); color: var(--ink); border-bottom: 1px solid var(--line); }
.top h1 { font: 700 22px var(--sans); }
.top .who b { font: 600 16px var(--sans); }
.top .who small, .top .greet { color: var(--muted); }
.top .who small.live { color: var(--ok); }
.top .icon { color: var(--ink); }
.top .icon:hover, .top .icon:active { background: var(--hover); }

/* fields, dropdowns and small buttons all match */
input, select, textarea { color: var(--ink); }
.inp, .list-tools input, .searchbar input, .compose textarea, select.inp {
  background: var(--field); border: 1px solid transparent; color: var(--ink); border-radius: 10px; }
.inp:focus, .list-tools input:focus, .searchbar input:focus, .compose textarea:focus { border-color: var(--muted); box-shadow: none; outline: none; }
.compose textarea { border-radius: 22px; }
select.inp { appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
select option { background: var(--sheet); color: var(--ink); }
.sbtn, a.sbtn { background: var(--field); color: var(--ink); border: 0; border-radius: 8px; padding: 8px 14px; font: 600 14px var(--sans);
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; cursor: pointer; }
.sbtn:hover, a.sbtn:hover { filter: brightness(.95); }
@media (prefers-color-scheme: dark) { .sbtn:hover, a.sbtn:hover { filter: brightness(1.25); } }
.big-btn, .big-btn.gold { background: var(--accent); color: var(--on-accent); border-radius: 10px; font-weight: 600; }
.big-btn:hover { background: var(--accent-press); }
.big-btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.link { color: var(--accent); text-decoration: none; font-weight: 600; }
.chips button { background: var(--field); border: 0; color: var(--ink); font-weight: 600; }
.chips button.on { background: var(--ink); color: var(--bg); }
.pill.gold { background: var(--accent); color: var(--on-accent); }
.code { background: var(--field); border: 0; }
.note { background: var(--field); border: 0; }
.note.warn { background: var(--field); border-left: 3px solid var(--accent); }
.banner { background: var(--field); color: var(--ink); border-bottom: 1px solid var(--line); }
.banner button { background: var(--accent); }
.toast { background: #262626; color: #fff; }

/* chat list */
.conv { border-bottom: 0; }
.conv:hover { background: var(--hover); }
.conv.on { background: var(--field); }
@keyframes bump { 30% { background: var(--field); } }
.conv .row1 b { font-weight: 600; }
.av-wrap.on::after { border-color: var(--bg); }
.fab { background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }

/* messages: yours in blue, theirs in grey, no shadows */
.bub { background: var(--theirs); color: var(--theirs-ink); box-shadow: none; border-radius: 22px 22px 22px 6px; }
.mine .bub { background: var(--mine); color: var(--mine-ink); border-radius: 22px 22px 6px 22px; }
.mine .bub .quote { color: rgba(255, 255, 255, .85); border-left-color: rgba(255, 255, 255, .7); background: rgba(255, 255, 255, .12); }
.mine .bub a.file small { color: rgba(255, 255, 255, .8); }
.bub.deleted { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.day { background: transparent; box-shadow: none; color: var(--muted); font-weight: 600; }
.flash .bub { outline: 3px solid var(--accent); }
.typing-bub { background: var(--theirs); box-shadow: none; }
.cbtn.send { background: transparent; color: var(--accent); font-size: 22px; }
.cbtn.send[data-mode="send"] { background: var(--accent); color: var(--on-accent); font-size: 18px; }
.quick { border-top: 0; background: var(--bg); }
.quick button { background: var(--field); border: 0; color: var(--ink); }
@keyframes sentFly { 50% { transform: translateY(-8px) scale(1.1); background: var(--accent); color: var(--on-accent); } }
.reply-bar, .compose, .searchbar { background: var(--bg); border-top-color: var(--line); }
.reply-bar div { border-left-color: var(--accent); }

/* sheets and pages */
.sheet-bg { background: rgba(0, 0, 0, .5); }
.sheet { background: var(--sheet); }
.sheet .grab { background: var(--muted); opacity: .5; }
.sheet h3, .setup h1 { font: 700 18px var(--sans); }
.setup h1 { font-size: 26px; }
.menu .rx button.on { background: var(--field); }
.menu > button:hover, .item:hover { background: var(--hover); }
.tlist button { background: var(--field); border: 0; color: var(--ink); }
.tlist button:active { background: var(--line); }
.urow { border-bottom-color: var(--line); }
.page { background: var(--bg); }
.page .tabs { background: var(--bg); border-bottom-color: var(--line); }
.stat { background: var(--field); border: 0; }
.stat b { font: 700 26px var(--sans); }
.dl { background: var(--bg); border: 1px solid var(--line); }
.dl:hover { box-shadow: none; background: var(--hover); transform: none; }
.dl .row { gap: 8px; flex-wrap: nowrap; }
.dl select.inp { min-width: 0; }
.banner-in { background: var(--sheet); color: var(--ink); }

.big-btn.danger { background: #ed4956 !important; color: #fff !important; }

#pwgate { position: fixed; inset: 0; z-index: 9000; background: var(--bg); color: var(--ink); display: flex; overflow-y: auto; }
.pwrules { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.pwrules .ok { color: var(--ok); }
.devcard { display: flex; flex-direction: column; gap: 3px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.devcard small { color: var(--muted); }
.devcard details { font-size: 12px; color: var(--muted); } .devcard code { word-break: break-all; font-size: 11px; }

/* chat themes: a background behind the messages and coloured bubbles (set per chat, see themeSheet in app.js) */
.themed .mine .bub { background: var(--mine-bg); color: var(--mine-ink); }
.themed .mine .bub .quote { color: inherit; opacity: .85; border-left-color: currentColor; background: rgba(127, 127, 127, .18); }
.themed .mine .bub a.file small, .themed .mine .bub a { color: inherit; }
.log.styled .meta, .log.styled .empty { color: rgba(0, 0, 0, .62); }
.log.styled.on-dark .meta, .log.styled.on-dark .empty { color: rgba(255, 255, 255, .88); text-shadow: 0 1px 2px rgba(0, 0, 0, .45); }
.log.styled .day, .log.styled .older { background: rgba(255, 255, 255, .78); color: #333; border: 0; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.log.styled.on-dark .day, .log.styled.on-dark .older { background: rgba(0, 0, 0, .45); color: #fff; }
.log.styled .bub.deleted { background: rgba(127, 127, 127, .22); }
.seg { display: flex; background: var(--field); border-radius: 10px; padding: 3px; gap: 3px; margin-top: 10px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 8px; padding: 8px; font: 600 14px var(--sans); color: var(--muted); }
.seg button.on { background: var(--bg); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.tprev { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); flex: none; }
.tprev .log { height: 140px; flex: none; justify-content: center; overflow: hidden; }
.tprev .msg { animation: none; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 10px 8px; margin-top: 12px; }
.sw { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; color: var(--ink); font-size: 12px; }
.sw i { width: 58px; height: 58px; border-radius: 16px; border: 1px solid var(--line); display: grid; place-items: center; font-style: normal; font-size: 22px; background: var(--field); }
.sw i.bubsw { border-radius: 20px 20px 6px 20px; font: 600 16px var(--sans); border: 0; }
.sw.on i { outline: 3px solid var(--accent); outline-offset: 2px; }
.row.colors { margin-top: 12px; gap: 16px; font-size: 14px; }
.row.colors input[type=color] { width: 44px; height: 32px; border: 0; padding: 0; background: none; vertical-align: middle; }

/* profile photo cropper */
.crop { position: relative; width: min(320px, 80vw); aspect-ratio: 1; margin: 6px auto 0; touch-action: none; cursor: grab; overflow: hidden; border-radius: 12px; background: #000; flex: none; }
.crop canvas { display: block; }
.crop-ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0, 0, 0, .55); pointer-events: none; outline: 1px solid rgba(255, 255, 255, .6); outline-offset: -1px; }

/* media: videos, round video notes, attach menu, caption preview, recorder */
.bub.bare, .themed .mine .bub.bare { background: transparent !important; padding: 0; box-shadow: none; }
.vnote { position: relative; width: min(210px, 56vw); aspect-ratio: 1; border-radius: 50%; overflow: hidden; cursor: pointer; background: #000; }
.vnote video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vnote svg, .vrec-circle svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.vnote circle, .vrec-circle circle { fill: none; stroke: #fff; stroke-width: 2.5; stroke-dasharray: 301.6; stroke-dashoffset: 301.6; transition: stroke-dashoffset .2s linear; }
.vn-play { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); background: rgba(0,0,0,.55); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 999px; pointer-events: none; }
.vnote.playing .vn-play { display: none; }
.attach { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 6px 0 4px; }
.attach > * { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; font-size: 12px; color: var(--ink); cursor: pointer; text-align: center; padding: 4px 0; }
.attach i { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; font-style: normal; }
.mprev { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.mprev img, .mprev video { height: min(46dvh, 360px); max-width: 82vw; border-radius: 12px; object-fit: contain; background: var(--field); flex: none; }
.mprev > :only-child { margin: 0 auto; }
.caprow { display: flex; gap: 8px; align-items: flex-end; }
.caprow textarea { flex: 1; resize: none; }
.vrec { position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.88); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; color: #fff; }
.vrec-circle { position: relative; width: min(78vw, 360px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #111; }
.vrec-circle video { width: 100%; height: 100%; object-fit: cover; }
.vrec-circle video.mirror { transform: scaleX(-1); }
.vrec-circle circle { stroke: #ff3b5c; stroke-width: 3; }
.vrec-time { font: 600 15px var(--sans); min-height: 20px; }
.vrec-btns { display: flex; gap: 28px; align-items: center; }
.vrec-btns button { width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255,255,255,.16); color: #fff; font-size: 22px; }
.vrec-btns button:disabled { opacity: .3; }
.vrec-btns .go { width: 74px; height: 74px; background: #fff; position: relative; }
.vrec-btns .go::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #ff3b5c; transition: all .2s; }
.vrec.on .go::after { inset: 23px; border-radius: 6px; }

/* contact info page */
.av.xl { width: 112px; height: 112px; font-size: 42px; }
.ihead { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 6px 0 14px; }
.iname { font: 700 22px var(--sans); margin-top: 8px; }
.isub { color: var(--muted); font-size: 14px; }
.ibio { margin-top: 6px; font-size: 15px; max-width: 420px; }
.iacts { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; }
.iacts button { flex: 1; max-width: 120px; border: 0; background: var(--field); border-radius: 12px; padding: 10px 6px; font: 600 13px var(--sans); color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.iacts i { font-style: normal; font-size: 20px; }
.page.info .itabs { padding: 0 0 10px; border: 0; background: transparent; }
.mgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.mgrid button { position: relative; aspect-ratio: 1; border: 0; padding: 0; background: var(--field); overflow: hidden; border-radius: 4px; }
.mgrid button.round { border-radius: 50%; }
.mgrid img, .mgrid video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mgrid span { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 999px; }
.lrow { display: flex; gap: 12px; align-items: center; padding: 10px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; text-decoration: none; width: 100%; text-align: left; font: inherit; }
.lrow i { font-style: normal; width: 42px; height: 42px; flex: none; border-radius: 10px; background: var(--field); display: grid; place-items: center; font-size: 20px; }
.lrow span { min-width: 0; flex: 1; }
.lrow b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .who, #chatAv { cursor: pointer; }
.conv .row2 i.muted { font-style: normal; font-size: 12px; margin-left: auto; opacity: .7; }
.badge.quiet { background: var(--muted); }
/* videos in the chat: a thumbnail with a play button and the length, like WhatsApp */
.bub .vid { position: relative; display: block; width: min(250px, 58vw); border-radius: 12px; overflow: hidden; margin: 2px 0 4px; background: #111; cursor: pointer; aspect-ratio: 4 / 5; max-height: 340px; }
.bub .vid > img, .bub .vid > video { display: block; width: 100%; height: 100%; object-fit: cover; margin: 0; border-radius: 0; max-height: none; }
.bub .vid::after { content: ""; position: absolute; inset: auto 0 0 0; height: 44px; background: linear-gradient(transparent, rgba(0,0,0,.55)); pointer-events: none; }
.vid-play { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; display: grid; place-items: center; font-size: 20px; padding-left: 4px; box-sizing: border-box; backdrop-filter: blur(4px); }
.vid-len { position: absolute; left: 8px; bottom: 6px; z-index: 1; color: #fff; font: 600 12px var(--sans); text-shadow: 0 1px 2px rgba(0,0,0,.6); }
/* full screen viewer */
.viewer.mv { display: block; background: #000; touch-action: none; user-select: none; -webkit-user-select: none; animation: mvIn .16s ease-out; }
.viewer.mv.closing { opacity: 0; transition: opacity .18s; }
@keyframes mvIn { from { opacity: 0; } }
.mv-stage { position: absolute; inset: 0; display: grid; place-items: center; transition: transform .2s; }
.mv-stage img, .mv-stage video { width: 100vw; height: 100dvh; object-fit: contain; background: transparent; grid-area: 1 / 1; }
.mv-top, .mv-bot { position: absolute; left: 0; right: 0; z-index: 2; color: #fff; transition: opacity .25s; }
.mv-top { top: 0; display: flex; align-items: center; gap: 6px; padding: calc(env(safe-area-inset-top) + 6px) 8px 18px; background: linear-gradient(rgba(0,0,0,.6), transparent); }
.mv-bot { bottom: 0; padding: 20px 12px calc(env(safe-area-inset-bottom) + 10px); background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.viewer.mv.bare .mv-top, .viewer.mv.bare .mv-bot, .viewer.mv.bare .mv-nav { opacity: 0; pointer-events: none; }
.mv-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.mv-who b { font-size: 16px; }
.mv-who small { opacity: .75; font-size: 12px; }
.mv-b { background: none; border: 0; color: #fff; font-size: 22px; min-width: 40px; height: 40px; border-radius: 50%; cursor: pointer; text-decoration: none; display: grid; place-items: center; }
.mv-b:hover { background: rgba(255,255,255,.12); }
.mv-cap { text-align: center; font-size: 15px; margin: 0 auto 8px; max-width: 640px; white-space: pre-wrap; }
.mv-bar { display: flex; align-items: center; gap: 8px; max-width: 760px; margin: 0 auto; font: 600 12px var(--sans); font-variant-numeric: tabular-nums; }
.mv-bar .mv-b { font-size: 16px; min-width: 34px; height: 34px; }
.mv-bar input { flex: 1; min-width: 0; accent-color: #fff; cursor: pointer; }
.mv-big { grid-area: 1 / 1; z-index: 2; width: 72px; height: 72px; border-radius: 50%; border: 0; background: rgba(0,0,0,.5); color: #fff; font-size: 28px; padding-left: 5px; cursor: pointer; backdrop-filter: blur(6px); }
.mv-big[hidden] { display: none; }
.mv-count { text-align: center; font-size: 12px; opacity: .7; margin-top: 6px; }
.mv-nav { position: absolute; top: 50%; z-index: 2; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 26px; cursor: pointer; transition: opacity .25s; }
.mv-nav.l { left: 10px; }
.mv-nav.r { right: 10px; }
@media (hover: none) { .mv-nav { display: none; } }

/* reactions, like WhatsApp: one pill under the bubble; tap it to see who, tap yours to take it back */
.reacts { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 1px; margin: -8px 10px 2px; padding: 2px 7px; min-height: 24px;
  border-radius: 999px; background: var(--sheet); border: 2px solid var(--bg); color: var(--ink, inherit); font: inherit; font-size: 14px; line-height: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12); cursor: pointer; transition: transform .15s var(--spring); -webkit-tap-highlight-color: transparent; }
.reacts:active { transform: scale(.9); }
.reacts span { display: inline-block; }
.reacts b { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.reacts.pop { animation: rxIn .42s var(--spring) var(--rxd, 0s) both; }
.reacts.pop span:last-of-type { animation: rxEmoji .5s var(--spring) var(--rxd, 0s) both; }
.reacts.out { animation: rxOut .2s ease-in var(--rxd, 0s) both; pointer-events: none; }
.reacts span.out { animation: rxSpanOut .2s ease-in var(--rxd, 0s) both; }
@keyframes rxIn { from { transform: scale(.2); opacity: 0; } }
@keyframes rxEmoji { 0% { transform: scale(.3); } 55% { transform: scale(1.45); } }
@keyframes rxOut { 30% { transform: scale(1.12); } to { transform: scale(0); opacity: 0; } }
@keyframes rxSpanOut { to { transform: scale(0); opacity: 0; width: 0; } }
.menu .rx button { animation: rxIn .34s var(--spring) both; transition: transform .15s var(--spring); }
.menu .rx button:active { transform: scale(1.3); }
.menu .rx button.on { box-shadow: inset 0 0 0 2px var(--line); }
/* who reacted */
.rxs-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 10px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.rxs-tabs button { border: 0; background: none; color: inherit; font: inherit; font-size: 15px; padding: 6px 12px; border-radius: 999px; white-space: nowrap; transition: background .2s; }
.rxs-tabs button small { color: var(--muted); font-size: 12px; }
.rxs-tabs button.on { background: var(--field); font-weight: 600; }
.rxs-list { max-height: 50vh; overflow-y: auto; padding: 4px 0; }
.rxs-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 4px; border: 0; background: none; color: inherit; font: inherit; text-align: left;
  border-radius: 12px; animation: fadeUp .3s var(--ease) both; cursor: default; }
.rxs-row span { flex: 1; min-width: 0; }
.rxs-row b { display: block; font-size: 15px; }
.rxs-row small { display: block; font-size: 12px; color: var(--muted); }
.rxs-row i { font-style: normal; font-size: 24px; }
.rxs-row.me { cursor: pointer; }
.rxs-row.me:active { background: var(--field); }
.rxs-row.gone { transition: transform .16s ease-in, opacity .16s; transform: translateX(40px); opacity: 0; }
/* the Assistant */
.av.bot { background: linear-gradient(135deg, #7c5cff, #ff5fa2) !important; color: #fff; }
.arow { transition: transform .22s ease-in, opacity .22s, max-height .22s; max-height: 120px; }
.arow.gone { transform: translateX(60px); opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; }
.arow .ax { border: 0; background: none; color: var(--muted); font-size: 16px; width: 34px; height: 34px; border-radius: 50%; flex: none; }
.arow .ax:active { background: var(--field); }
.arow b { white-space: normal !important; }
.acheck { width: 26px; height: 26px; flex: none; margin: 0 8px; border-radius: 50%; border: 2px solid var(--muted); background: none; color: #fff;
  font-size: 14px; font-weight: 700; display: grid; place-items: center; transition: background .2s, border-color .2s, transform .25s var(--spring); }
.arow.done .acheck { background: #34c759; border-color: #34c759; transform: scale(1.08); }
.arow.done b { text-decoration: line-through; color: var(--muted); }
.alist { display: flex; justify-content: space-between; align-items: baseline; margin: 16px 4px 2px; font-size: 13px; letter-spacing: .02em; color: var(--muted); }
.alist small { font-weight: 400; }

/* ---- v15: pins, glass composer, dice, photo switch, wallpaper preview, heart notes, hold-to-record */
.conv { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.conv .row1 .pin { font-style: normal; font-size: 12px; margin-right: auto; flex: none; }
.top .dedi-heart { color: #e5484d; font-size: 22px; transition: transform .2s var(--spring); }
.top .dedi-heart:hover, .top .dedi-heart:focus-visible { animation: beat 1s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 20% { transform: scale(1.25); } 40% { transform: scale(1); } 60% { transform: scale(1.18); } }
.swrow { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 4px 2px 12px; }
.swrow span { display: flex; flex-direction: column; min-width: 0; }
.swrow small { color: var(--muted); font-size: 12px; margin-top: 2px; }
.swtog { appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 28px; border-radius: 14px; background: var(--field); position: relative; border: 0; transition: background .25s; cursor: pointer; }
.swtog::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); transition: transform .3s var(--spring); }
.swtog:checked { background: var(--accent); }
.swtog:checked::after { transform: translateX(18px); }

/* glass composer: floats over the chat so messages blur beneath it */
.pane-chat { position: relative; }
.dock { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; flex-direction: column;
  background: rgba(255, 255, 255, .62); -webkit-backdrop-filter: blur(24px) saturate(1.9); backdrop-filter: blur(24px) saturate(1.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 -1px 0 rgba(0, 0, 0, .05), 0 -10px 30px rgba(0, 0, 0, .05); }
@media (prefers-color-scheme: dark) { .dock { background: rgba(18, 18, 20, .6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 -10px 30px rgba(0, 0, 0, .3); } }
.dock .quick, .dock .reply-bar, .dock .compose { background: transparent; border: 0; }
.dock .compose { gap: 6px; padding: 6px 10px calc(8px + env(safe-area-inset-bottom)); align-items: flex-end; }
.dock .compose .pill { flex: 1; min-width: 0; display: flex; align-items: flex-end; border-radius: 23px; background: rgba(127, 127, 127, .16);
  border: 1px solid rgba(255, 255, 255, .28); transition: border-color .2s, box-shadow .25s, background .2s; }
.dock .compose .pill:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(127, 127, 127, .18); background: rgba(127, 127, 127, .1); }
.dock .compose .pill textarea, .dock .compose .pill textarea:focus { border: 0; background: transparent; box-shadow: none; border-radius: 22px; padding: 10px 4px 10px 15px; flex: 1; min-width: 0; font-size: max(16px, calc(16px * var(--fsk, 1))); }
.dock .compose .pill .cbtn { width: 38px; height: 40px; font-size: 21px; border-radius: 50%; }
.dock .compose .plus { color: var(--ink); transition: transform .3s var(--spring), background .15s; }
.dock .compose .plus:active { transform: rotate(90deg) scale(.9); }
.dock .compose .cam { color: var(--ink); width: 42px; overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  transition: width .32s var(--spring), margin .32s var(--spring), opacity .18s, transform .35s var(--spring); }
.dock .compose .cam.pop { animation: chipPop .35s var(--spring); }
.dock .compose .cam.hold { transform: scale(1.35); color: #ff3b5c; }
.dock .compose.typed .cam { width: 0; margin-left: -6px; opacity: 0; transform: scale(.2) rotate(-70deg); pointer-events: none; }
.dock .compose .send { transition: background .2s, color .2s, transform .3s var(--spring); }
.dock .compose .send[data-mode="send"] { transform: scale(1.04); }

/* suggestions + dice */
.quick .dice { padding: 3px 10px; font-size: 20px; }
.quick .dice.roll { animation: diceRoll .5s var(--ease); }
.quick .dice.settle { animation: diceLand .4s var(--spring); }
@keyframes diceRoll { 0% { transform: rotate(0) translateY(0); } 20% { transform: rotate(120deg) translateY(-9px) scale(1.2); } 45% { transform: rotate(260deg) translateY(0) scale(1.05); }
  60% { transform: rotate(330deg) translateY(-5px); } 80% { transform: rotate(520deg) translateY(0); } 100% { transform: rotate(720deg); } }
@keyframes diceLand { from { transform: rotate(-25deg) scale(.7); } }
.quick button { transition: transform .25s var(--spring), opacity .2s, background-color .15s; }
.quick.rolling button:not(.dice) { opacity: .25; transform: scale(.9); }
.quick.shuf button:not(.dice) { animation: chipPop .42s var(--spring) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes chipPop { from { transform: scale(.4) translateY(8px); opacity: 0; } }

/* wallpaper preview */
.wpv { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; color: #fff; animation: fade .2s ease both; }
.wpv.closing { opacity: 0; transition: opacity .18s ease; }
.wpv-bg, .wpv-dim { position: absolute; inset: 0; }
.wpv-bg { background-size: cover; background-position: center; background-color: #111; }
.wpv-dim { background: #000; transition: opacity .15s; }
.wpv-top { position: relative; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
  background: linear-gradient(rgba(0, 0, 0, .45), transparent); }
.wpv-top > * { flex: 1; }
.wpv-top b { text-align: center; font-size: 16px; }
.wpv-b { flex: 0 0 auto !important; background: none; border: 0; color: #fff; font-size: 16px; padding: 8px 4px; }
.wpv-log { position: relative; flex: 1; justify-content: flex-end; overflow: hidden; padding-bottom: 12px; background: none !important; animation: fadeUp .4s var(--ease) .1s both; }
.wpv-bot { position: relative; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0, 0, 0, .55)); display: flex; flex-direction: column; gap: 12px; animation: fadeUp .4s var(--ease) .15s both; }
.wpv-bot label { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.wpv-bot input { flex: 1; }
.wpv-btns { display: flex; gap: 10px; }
.wpv-btns .big-btn { flex: 1; }
.wpv-btns .sbtn { color: #fff; background: rgba(255, 255, 255, .18); border: 0; border-radius: 12px; padding: 0 18px; }

/* heart notes */
.hn { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; animation: fade .2s ease both; }
.hn.closing { opacity: 0; transition: opacity .2s ease; }
.hn-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.hn-box { position: relative; width: min(94vw, 460px); display: flex; flex-direction: column; align-items: center; gap: 10px; animation: fadeUp .4s var(--spring) both; }
.hn-close { position: absolute; right: 0; top: -8px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .2); color: #fff; font-size: 16px; z-index: 2; }
.hn-head { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #fff; }
.hn-head img { width: 54px; height: 54px; border-radius: 14px; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.hn-head h2 { margin: 0; font: 700 20px var(--lookfont, system-ui, sans-serif); }
.hn-track { display: flex; gap: 12px; width: 100%; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px 9%; box-sizing: border-box; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.hn-track::-webkit-scrollbar { display: none; }
.hn-card { flex: 0 0 100%; scroll-snap-align: center; box-sizing: border-box; background: var(--sheet, #fff); color: var(--ink); border-radius: 24px; padding: 26px 22px 20px; min-height: 230px; display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35); transform: scale(.92); opacity: .65; transition: transform .35s var(--spring), opacity .25s; }
.hn-card.on { transform: scale(1); opacity: 1; }
.hn-card p { margin: 0; font-size: calc(17px * var(--fsk, 1)); line-height: 1.5; }
.hn-card .sig { align-self: flex-end; color: #e5484d; font-weight: 600; margin-top: 14px; }
.hn-foot { display: flex; align-items: center; gap: 14px; color: #fff; font-size: 14px; }
.hn-nav { width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .2); color: #fff; font-size: 22px; }
.hn-tip { color: rgba(255, 255, 255, .75); }

/* hold-to-record video note */
.vrec-hint { display: none; width: min(78vw, 360px); justify-content: space-between; align-items: flex-end; font-size: 13px; color: rgba(255, 255, 255, .8); }
.vrec.hold:not(.locked) .vrec-hint { display: flex; }
.vrec.hold:not(.locked) .vrec-btns { visibility: hidden; }
.vrec.cancelling .vrec-circle { opacity: .45; transform: translateX(-24px) scale(.94); }
.vrec.cancelling .vrec-time { color: #ff6b6b; }
.vrec-circle { transition: transform .25s var(--spring), opacity .2s; }
.vrec.locked .vrec-time::before { content: "🔒 "; }

/* ===== v18: Liquid Glass bars, touch-first feel, review screens ===== */
:root {
  --glass-bg: rgba(255, 255, 255, .58); --glass-edge: rgba(255, 255, 255, .8); --glass-line: rgba(0, 0, 0, .06);
  --glass-shadow: 0 8px 28px rgba(0, 0, 0, .12), 0 1px 3px rgba(0, 0, 0, .06);
}
@media (prefers-color-scheme: dark) {
  :root { --glass-bg: rgba(30, 30, 34, .52); --glass-edge: rgba(255, 255, 255, .16); --glass-line: rgba(255, 255, 255, .08); --glass-shadow: 0 8px 28px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .4); }
}
.pane-chat > .top, .pane-chat > .searchbar, .lscroll > .top, .dock .compose .plus, .dock .compose .pill, .dock .compose .rcap, .dock .reply-bar, .dock .vrev {
  background: var(--glass-bg); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  border: 0; box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line), var(--glass-shadow); }

/* header floats over the messages */
.pane-chat > .top { position: absolute; z-index: 6; top: calc(env(safe-area-inset-top, 0px) + 6px); left: 10px; right: 10px; min-height: 56px; padding: 6px 8px; border-radius: 28px; }
.pane-chat > .searchbar { position: absolute; z-index: 5; top: calc(env(safe-area-inset-top, 0px) + 70px); left: 10px; right: 10px; padding: 6px 8px; border-radius: 22px; align-items: center; }
.pane-chat > .searchbar[hidden], .pane-chat > .home[hidden] { display: none !important; }
.pane-chat > .searchbar input { background: rgba(127, 127, 127, .16); border-radius: 16px; }
.pane-chat > .log { padding-top: calc(env(safe-area-inset-top, 0px) + 80px); }
.pane-chat.is-pet > .log { padding-top: 10px; }
.pane-chat > .home { padding-top: calc(env(safe-area-inset-top, 0px) + 74px); }
.pane-chat > .top .who { min-width: 0; cursor: pointer; }

/* the chat list top bar */
.lscroll { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; }
.lscroll > .top { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 6px); z-index: 6; flex: none; margin: calc(env(safe-area-inset-top, 0px) + 6px) 10px 6px; min-height: 56px; padding: 6px 12px; border-radius: 28px; }
.lscroll .convs { flex: none; overflow: visible; }
.fab { z-index: 7; }

/* composer: separate glass capsules */
.dock { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; pointer-events: none; }
.dock > * { pointer-events: auto; }
.dock .typing-line { pointer-events: none; }
.dock .compose { align-items: flex-end; gap: 8px; padding: 4px 10px calc(8px + env(safe-area-inset-bottom, 0px)); }
.dock .compose .plus { width: 46px; height: 46px; border-radius: 50%; flex: none; }
.dock .compose .pill { border-radius: 24px; min-height: 46px; }
.dock .compose .pill:focus-within { background: var(--glass-bg); border: 0; box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 1.5px var(--accent), var(--glass-shadow); }
.dock .compose .rcap { display: flex; align-items: center; flex: none; border-radius: 24px; min-height: 46px; padding: 0 2px; }
.dock .compose .rcap .cbtn { height: 46px; }
.dock .compose.typed .rcap { padding: 0; }
.dock .compose .send[data-mode="send"] { width: 42px; height: 42px; margin: 2px; }
.dock .reply-bar { margin: 0 10px 6px; padding: 8px 12px; border-radius: 20px; }
.dock .quick { padding: 6px 10px 6px; }
.dock .quick button { background: var(--glass-bg); -webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%); box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line); }
.dock.reviewing .compose, .dock.reviewing .quick { display: none; }
.dock .vrev { display: flex; align-items: center; gap: 4px; margin: 4px 10px calc(8px + env(safe-area-inset-bottom, 0px)); padding: 3px 6px; border-radius: 28px; min-height: 52px; }
.vrev .cbtn { width: 44px; height: 44px; }
.vrev .vplay { color: var(--accent); font-size: 18px; }
.vrev .send { background: var(--accent); color: var(--on-accent); font-size: 18px; }
.vwave { flex: 1; height: 40px; display: flex; align-items: center; gap: 2px; touch-action: none; cursor: pointer; min-width: 0; }
.vwave i { flex: 1; min-width: 2px; border-radius: 2px; background: var(--muted); opacity: .5; transition: background .1s; }
.vwave i.on { background: var(--accent); opacity: 1; }
.vdur { font: 600 13px var(--sans); font-variant-numeric: tabular-nums; min-width: 38px; text-align: center; color: var(--muted); }

/* full-screen look at photos / videos before sending */
.mpv { position: fixed; inset: 0; z-index: 36; background: rgba(0, 0, 0, .95); color: #fff; display: flex; flex-direction: column; animation: mpvIn .25s var(--ease); }
.mpv.closing { opacity: 0; transition: opacity .18s; }
@keyframes mpvIn { from { opacity: 0; transform: scale(.98); } }
.mpv-top { display: flex; align-items: center; justify-content: space-between; padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 6px; }
.mpv-top span { width: 70px; }
.mpv-b { min-width: 70px; min-height: 44px; border: 0; background: transparent; color: #fff; font: 500 17px var(--sans); text-align: left; }
.mpv-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 8px; }
.mpv-stage img, .mpv-stage video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; }
.mpv-strip { display: flex; gap: 8px; overflow-x: auto; padding: 12px 14px 8px; scrollbar-width: none; }
.mpv-strip::-webkit-scrollbar { display: none; }
.mpv-th, .mpv-add { position: relative; flex: none; width: 56px; height: 56px; border-radius: 10px; border: 2px solid transparent; }
.mpv-th.on { border-color: #fff; }
.mpv-th img, .mpv-th video { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; display: block; }
.mpv-x { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .5); background: rgba(0, 0, 0, .75); color: #fff; font-size: 11px; line-height: 1; }
.mpv-x::after { content: ""; position: absolute; inset: -12px; }
.mpv-add { display: grid; place-items: center; border: 2px dashed rgba(255, 255, 255, .4); font-size: 24px; cursor: pointer; }
.mpv-bar { display: flex; align-items: flex-end; gap: 8px; padding: 6px 12px calc(10px + env(safe-area-inset-bottom, 0px)); }
.mpv-cap { flex: 1; resize: none; border: 0; outline: none; background: rgba(255, 255, 255, .14); color: #fff; border-radius: 24px; padding: 12px 16px; font: 16px/1.3 var(--sans); max-height: 120px; }
.mpv-cap::placeholder { color: rgba(255, 255, 255, .55); }
.mpv-send { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 20px; }
.vrec.vrw .vrec-btns { visibility: visible; }
.vrec.vrw .vrec-circle { cursor: pointer; }
.vrec.vrw .vrec-circle video { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.vrec.vrw .rsend { background: var(--accent); }

/* info page rows */
.irows { margin: 0 0 14px; border-radius: 14px; background: var(--field); overflow: hidden; }
.irow { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 14px; border: 0; background: transparent; color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.irow + .irow { border-top: 1px solid var(--line); }
.irow i { font-style: normal; font-size: 22px; width: 28px; text-align: center; flex: none; }
.irow span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.irow b { font: 600 15px var(--sans); }
.irow small { color: var(--muted); font-size: 12px; margin-top: 1px; }
.irow em { font-style: normal; color: var(--muted); font-size: 24px; flex: none; }
.irow:active { background: var(--hover); transform: none; }

/* edge swipe back (phone): the list waits underneath and slides in */
#app { position: relative; }
@media (max-width: 759px) {
  #app.peek .pane-list { display: flex !important; position: absolute; inset: 0; z-index: 1; transform: translateX(calc(-18% * (1 - var(--p, 0)))); }
  #app.peek .pane-list::after { content: ""; position: absolute; inset: 0; z-index: 30; background: #000; opacity: calc(.28 * (1 - var(--p, 0))); pointer-events: none; }
  #app.peek .pane-chat { position: relative; z-index: 2; background: var(--bg); box-shadow: -10px 0 30px rgba(0, 0, 0, .22); }
  #app.peek.settle .pane-list { transition: transform .26s var(--ease); }
  #app.peek.settle .pane-list::after { transition: opacity .26s; }
}
#app.noanim .pane-list, #app.noanim .pane-chat { animation: none !important; }
.page { overscroll-behavior-x: none; }

/* touch: no double-tap zoom, no grey flash, 44 px targets, springy press */
html { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button, a, label, select, summary, input, [role="button"], .conv { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
@media (pointer: coarse) {
  .cbtn, .top .icon { min-width: 44px; min-height: 44px; }
  .dock .compose .pill .cbtn { min-width: 38px; position: relative; }
  .dock .compose .pill .cbtn::after { content: ""; position: absolute; inset: -4px -3px; }
  .chips button, .sbtn, .quick button, .tlist button { min-height: 44px; }
  .quick button.emo { min-width: 44px; }
}
@media (prefers-reduced-motion: no-preference) {
  button, .conv, .irow, .sbtn { transition: transform .35s var(--spring), background .15s; }
  button:active, .conv:active, .sbtn:active, .chips button:active { transform: scale(.95); }
  .dock .compose .send:active { transform: scale(.9); }
  .irow:active { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mpv, #app.peek.settle .pane-list, #app.peek.settle .pane-list::after { animation: none; transition: none; }
  .sheet { animation: none; }
}
/* people who asked for less transparency get solid bars */
@media (prefers-reduced-transparency: reduce) {
  .pane-chat > .top, .pane-chat > .searchbar, .lscroll > .top, .dock .compose .plus, .dock .compose .pill, .dock .compose .rcap, .dock .reply-bar, .dock .vrev, .dock .quick button {
    background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 0 0 1px var(--line); }
  .dock .compose .pill:focus-within { background: var(--bg); }
}

/* ===== v19: floating tab bar, Home (pet room) and Settings ===== */
.convs { padding-bottom: 170px; }
.fab { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
#tabbar { position: fixed; z-index: 14; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); width: min(340px, calc(100vw - 32px)); height: 64px; padding: 5px; border-radius: 32px;
  display: grid; grid-template-columns: repeat(3, 1fr); transform: translateX(-50%); transition: transform .5s var(--spring), opacity .25s;
  background: var(--glass-bg); -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%);
  box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line), var(--glass-shadow); }
.tb-bub { position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc((100% - 10px) / 3); border-radius: 27px; pointer-events: none;
  background: color-mix(in srgb, var(--accent) 16%, transparent); box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px color-mix(in srgb, var(--accent) 30%, transparent);
  transform: translateX(calc(var(--ti, 0) * 100%)); transition: transform .55s var(--spring); }
#tabbar button { position: relative; z-index: 1; background: none; border: 0; border-radius: 27px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--muted); font: 600 11px var(--sans); }
#tabbar button.on { color: var(--accent); }
#tabbar .ti { font-size: 22px; line-height: 1; transition: transform .5s var(--spring); }
#tabbar button.on .ti { transform: translateY(-1px) scale(1.14); }
.tbadge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ff3b30; color: #fff; font: 700 11px/18px var(--sans); text-align: center; animation: pop .35s var(--spring); }
[data-tab="home"] .tbadge { background: #ff5d8f; min-width: 16px; height: 16px; font-size: 10px; line-height: 16px; padding: 0 3px; }
.tabpage { position: fixed; inset: 0; z-index: 12; display: none; flex-direction: column; background: var(--bg); }
.tabpage.on { display: flex; animation: fade .25s ease both; }
.tp-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; width: 100%; max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 12px) 12px calc(100px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 759px) {
  #app[data-view="chat"] ~ #tabbar { transform: translate(-50%, 170%); }
  #app[data-view="chat"] ~ .tabpage { display: none !important; }
}
@media (min-width: 760px) {
  #tabbar { left: calc(max(0px, (100vw - 1200px) / 2) + 170px); width: 300px; }
  .tabpage { right: auto; left: max(0px, calc((100vw - 1200px) / 2)); width: 340px; background: var(--panel); border-right: 1px solid var(--line); }
}
body:has(.page:not(.closing)) #tabbar { transform: translate(-50%, 170%); }

/* Settings: iOS grouped list */
.st-title { font: 700 30px var(--serif); margin: 4px 4px 10px; }
.st-prof { display: flex; align-items: center; gap: 14px; padding: 6px 4px 4px; }
.st-prof b { display: block; font: 600 19px var(--serif); } .st-prof small { color: var(--muted); }
.st-av { position: relative; cursor: pointer; } .st-av i { position: absolute; right: -2px; bottom: -2px; font-style: normal; font-size: 13px; background: var(--accent); color: var(--on-accent); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.st h5 { margin: 20px 14px 6px; font: 600 12px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sbox { background: var(--field); border-radius: 16px; overflow: hidden; }
.sbox.pad { padding: 12px 14px; }
.sbox > * + * { border-top: .5px solid var(--line); }
.srow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: none; text-align: left; font-size: 16px; color: inherit; }
.srow > span:first-child { flex: none; min-width: 64px; color: var(--muted); }
.srow input { flex: 1; min-width: 0; border: 0; background: none; font-size: 16px; color: inherit; text-align: right; outline: none; }
.srow.nav > i { font-style: normal; font-size: 20px; width: 26px; text-align: center; }
.srow.nav > span { flex: 1; min-width: 0; color: inherit; } .srow.nav b { display: block; font-weight: 500; } .srow.nav small { display: block; color: var(--muted); font-size: 12px; }
.srow.nav u { text-decoration: none; color: var(--muted); font-size: 22px; }
.srow.act { color: var(--accent); font-weight: 600; justify-content: center; } .srow.act.danger { color: #ff3b30; }
.sbox .swrow { padding: 12px 14px; }
.sbox.about { display: grid; gap: 3px; } .sbox.about small { color: var(--muted); }
.nprev { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 18px; background: var(--glass-bg); box-shadow: 0 0 0 .5px var(--glass-line), var(--glass-shadow); }
.nprev > div:nth-child(2) { flex: 1; min-width: 0; } .nprev b { display: block; font-size: 14px; } .nprev span { display: block; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; } .nprev small { color: var(--muted); font-size: 11px; align-self: flex-start; }
.np-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-size: 20px; flex: none; }
.nrow { padding: 8px 2px; border-top: .5px solid var(--line); } .nrow b { display: block; font-size: 14px; } .nrow span { display: block; font-size: 13px; overflow-wrap: anywhere; } .nrow small { color: var(--muted); font-size: 11px; }

/* Home: a cosy room */
.hm-head { display: flex; align-items: center; gap: 8px; margin: 2px 0 10px; }
.hm-head h1 { flex: 1; margin: 0 4px; font: 700 26px var(--serif); } .hm-head h1 small { display: block; font: 500 12px var(--sans); color: var(--muted); }
.hm-sw { flex: 1; display: flex; gap: 6px; overflow-x: auto; } .hm-sw button { flex: none; border: 0; border-radius: 999px; padding: 6px 12px; background: var(--field); font-size: 14px; display: flex; gap: 6px; align-items: center; } .hm-sw button.on { background: var(--accent); color: var(--on-accent); }
.hm-coin { position: relative; border: 0; border-radius: 999px; padding: 7px 13px; background: var(--glass-bg); box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line); font-size: 15px; color: #ff4d79; font-weight: 700; }
.hm-coin b { color: inherit; } .hm-coin.pop { animation: pop .45s var(--spring); }
.hm-i { font-size: 20px; }
.hm-gain { position: absolute; right: 4px; top: -4px; color: #ff4d79; font: 700 14px var(--sans); pointer-events: none; animation: hmGain 1.4s var(--ease) both; }
@keyframes hmGain { from { opacity: 0; transform: translateY(8px) scale(.6); } 20% { opacity: 1; transform: translateY(-6px) scale(1.2); } to { opacity: 0; transform: translateY(-34px); } }
.hm-room { --u: min(calc((100vw - 24px) / 100), 5px); position: relative; aspect-ratio: 1 / .88; border-radius: 28px; overflow: hidden; user-select: none; -webkit-user-select: none;
  --w1: #ffe9ef; --w2: #ffd9e4; --f1: #e8b98a; --f2: #d9a574; --s1: #bfe3ff; --s2: #e6f5ff; --rug: #fff3c4; --rug2: #ffe08a;
  background: linear-gradient(var(--w1), var(--w2)); box-shadow: 0 10px 30px rgba(0, 0, 0, .12), 0 0 0 .5px var(--glass-line); }
@supports (width: 1cqw) { .hm-room { container-type: inline-size; --u: 1cqw; } }
.hm-room[data-tod="morning"] { --w1: #fff0e0; --w2: #ffe0c9; --s1: #ffd9b0; --s2: #fff3d6; }
.hm-room[data-tod="evening"] { --w1: #ffd8c9; --w2: #f3b9c4; --s1: #ff9a8b; --s2: #ffd29e; --f1: #d79a76; --f2: #c4875f; }
.hm-room[data-tod="night"] { --w1: #4a4a7a; --w2: #3c3a68; --s1: #151a3d; --s2: #2a2f66; --f1: #7b5a4a; --f2: #6a4c3f; --rug: #c9b6e8; --rug2: #a994d6; }
.rm-dim { position: absolute; inset: 0; pointer-events: none; background: rgba(8, 10, 40, 0); transition: background 1s; }
.hm-room[data-tod="night"] .rm-dim { background: rgba(8, 10, 40, .28); } .hm-room[data-tod="evening"] .rm-dim { background: rgba(255, 120, 60, .08); }
@media (prefers-color-scheme: dark) { .hm-room:not([data-tod="night"]) .rm-dim { background: rgba(8, 10, 40, .12); } }
.rm-win { position: absolute; left: 9%; top: 9%; width: 34%; height: 36%; border-radius: calc(var(--u) * 6) calc(var(--u) * 6) calc(var(--u) * 2) calc(var(--u) * 2); border: calc(var(--u) * 1.6) solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); background: linear-gradient(var(--s1), var(--s2)); overflow: hidden; }
.rm-win::before, .rm-win::after { content: ""; position: absolute; background: #fff; } .rm-win::before { left: 50%; top: 0; bottom: 0; width: calc(var(--u) * 1.2); transform: translateX(-50%); } .rm-win::after { top: 55%; left: 0; right: 0; height: calc(var(--u) * 1.2); }
.rm-sky { position: absolute; right: 12%; top: 8%; font-size: calc(var(--u) * 11); line-height: 1; animation: rmFloat 6s ease-in-out infinite; }
.rm-cloud { position: absolute; top: 40%; left: -30%; font-size: calc(var(--u) * 8); opacity: .9; animation: rmCloud 28s linear infinite; }
.rm-st { position: absolute; color: #fff7c2; font-size: calc(var(--u) * 3.5); animation: rmTw 2.4s ease-in-out infinite; } .rm-st.a { left: 14%; top: 16%; } .rm-st.b { left: 34%; top: 52%; animation-delay: .7s; } .rm-st.c { left: 70%; top: 60%; animation-delay: 1.3s; }
@keyframes rmFloat { 50% { transform: translateY(calc(var(--u) * -1.2)); } } @keyframes rmCloud { to { transform: translateX(520%); } } @keyframes rmTw { 50% { opacity: .25; transform: scale(.7); } }
.rm-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 36%; background: repeating-linear-gradient(90deg, rgba(0,0,0,.07) 0 1px, transparent 1px calc(var(--u) * 14)), linear-gradient(var(--f1), var(--f2)); box-shadow: inset 0 calc(var(--u) * 1) 0 rgba(255,255,255,.35); }
.rm-rug { position: absolute; left: 50%; bottom: 7%; width: 62%; height: 19%; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse, var(--rug2) 0 38%, var(--rug) 40% 78%, rgba(255,255,255,.55) 80% 84%, var(--rug) 86%); box-shadow: 0 3px 8px rgba(0,0,0,.15); }
.rm-plant { position: absolute; right: 3%; bottom: 25%; font-size: calc(var(--u) * 20); filter: drop-shadow(0 3px 2px rgba(0,0,0,.18)); }
.rm-bowl { position: absolute; right: 12%; bottom: 9%; font-size: calc(var(--u) * 8); } .rm-toy { position: absolute; left: 10%; bottom: 10%; font-size: calc(var(--u) * 8); }
.rm-it { position: absolute; line-height: 1; filter: drop-shadow(0 3px 2px rgba(0,0,0,.2)); animation: rmIn .6s var(--spring) both; }
.rm-it.s-wall { right: 8%; top: 12%; font-size: calc(var(--u) * 17); } .rm-it.s-window { left: 17%; top: 33%; font-size: calc(var(--u) * 10); transform-origin: top; animation: rmSway 4s ease-in-out infinite; }
.rm-it.s-floor_l { left: 3%; bottom: 25%; font-size: calc(var(--u) * 22); } .rm-it.s-floor_r { right: 3%; bottom: 25%; font-size: calc(var(--u) * 22); }
@keyframes rmIn { from { transform: scale(0) rotate(-20deg); } } @keyframes rmSway { 50% { transform: rotate(5deg); } }
.rm-pet { position: absolute; left: 50%; bottom: 12%; width: calc(var(--u) * 38); height: calc(var(--u) * 38); transform: translateX(-50%); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rm-scale { position: absolute; inset: 0; transform: scale(var(--sc, 1)); transform-origin: 50% 100%; transition: transform .8s var(--spring); }
.rm-lot, .pet-fb { position: absolute; inset: 0; display: grid; place-items: center; } .rm-lot svg { width: 100% !important; height: 100% !important; }
.pet-fb { font-size: calc(var(--u) * 26); animation: rmBob 2.4s ease-in-out infinite; }
.rm-egg { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--u) * 26); transform-origin: 50% 90%; animation: rmWob 2.6s ease-in-out infinite; }
@keyframes rmWob { 0%, 60%, 100% { transform: rotate(0); } 68% { transform: rotate(-9deg); } 76% { transform: rotate(8deg); } 84% { transform: rotate(-5deg); } } @keyframes rmBob { 50% { transform: translateY(calc(var(--u) * -1)); } }
.rm-shadow { position: absolute; left: 22%; right: 22%; bottom: -2%; height: 8%; border-radius: 50%; background: rgba(0,0,0,.18); filter: blur(3px); }
.rm-pet.hop .rm-scale { animation: rmHop .55s var(--spring); } .rm-pet.grew .rm-scale { animation: rmGrow 1.2s var(--spring); }
@keyframes rmHop { 40% { transform: scale(var(--sc, 1)) translateY(calc(var(--u) * -6)) scaleY(1.08); } } @keyframes rmGrow { 30% { transform: scale(calc(var(--sc, 1) * 1.3)) rotate(-6deg); } 60% { transform: scale(calc(var(--sc, 1) * .92)) rotate(5deg); } }
.rm-wear { position: absolute; left: 50%; line-height: 1; font-size: calc(var(--u) * 12); transform: translateX(-50%); filter: drop-shadow(0 2px 1px rgba(0,0,0,.2)); pointer-events: none; }
.rm-wear.w-head { top: 3%; } .rm-wear.w-face { top: 32%; font-size: calc(var(--u) * 13); } .rm-wear.w-neck { top: 58%; font-size: calc(var(--u) * 11); }
.rm-zzz { position: absolute; left: 60%; bottom: 46%; font-size: calc(var(--u) * 8); animation: rmFloat 2.2s ease-in-out infinite; }
.rm-bub { position: absolute; left: 56%; bottom: 52%; width: calc(var(--u) * 15); height: calc(var(--u) * 15); animation: rmIn .4s var(--spring) both; pointer-events: none; }
.hm-card { margin-top: 10px; padding: 12px 14px; border-radius: 20px; background: var(--glass-bg); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line), var(--glass-shadow); }
.hm-card h4 { margin: 0 0 8px; font: 600 14px var(--sans); display: flex; align-items: center; gap: 8px; } .hm-card h4 .sbtn { margin-left: auto; }
.hm-card small, .hm-hint { color: var(--muted); font-size: 12px; } .hm-hint { display: block; margin: 6px 0 0; }
.gr-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; } .gr-top span { color: var(--muted); font-size: 12px; }
.gr-bar { height: 10px; border-radius: 6px; background: var(--field); overflow: hidden; margin: 8px 0 6px; } .gr-bar em { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #7ad39a, #36b37e); transition: width .8s var(--ease); }
.hm-acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; } .hm-acts.three { grid-template-columns: repeat(3, 1fr); }
.hm-acts button { border: 0; border-radius: 18px; padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--glass-bg); box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line), var(--glass-shadow); font-size: 12px; font-weight: 600; color: inherit; transition: transform .3s var(--spring), opacity .2s; }
.hm-acts button i { font-style: normal; font-size: 24px; } .hm-acts button small { color: var(--muted); font-size: 10px; font-weight: 500; } .hm-acts button:disabled { opacity: .5; } .hm-acts button:active { transform: scale(.92); }
.hm-talk { width: 100%; margin-top: 10px; border: 0; border-radius: 18px; padding: 14px; background: var(--accent); color: var(--on-accent); font: 600 16px var(--sans); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent); }
.hm-streak { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .hm-streak b { font-size: 20px; } .hm-streak span { color: var(--muted); font-size: 13px; flex: 1; }
.hm-streak em { font-style: normal; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #ffe4ee; color: #d6336c; } .hm-streak em.one { background: var(--field); color: var(--muted); }
.hm .pbar + .pbar { margin-top: 8px; }
.hm .hqrow { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; } .hm .hqrow i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 12px; flex: none; }
.hm .hqrow.done i { background: #30a46c; border-color: #30a46c; color: #fff; } .hm .hqrow.done span { color: var(--muted); text-decoration: line-through; } .hm .hqrow span { flex: 1; } .hm .hqrow small { flex: none; }
.alrow { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-top: .5px solid var(--line); } .alrow:first-of-type { border-top: 0; }
.al-t { flex: 1; min-width: 0; } .al-t b { display: block; font-size: 14px; font-weight: 500; } .al-t small { color: var(--muted); }
.al-img { display: block; margin-top: 6px; width: 100%; max-height: 220px; object-fit: cover; border-radius: 14px; }
.al-add { cursor: pointer; font-size: 20px; padding: 2px 6px; }
.hm-credit { text-align: center; font-size: 11px; color: var(--muted); margin: 14px 0 0; }
.hm-empty { text-align: center; padding: 26px 8px; } .hm-empty h2 { font: 700 24px var(--serif); margin: 6px 0; } .hm-empty p { color: var(--muted); margin: 0 0 14px; }
.hm-egg { font-size: 84px; display: inline-block; animation: rmWob 2.6s ease-in-out infinite; }
.hm-empty .pi-yes, .hm-wait .pi-yes { border: 0; border-radius: 16px; padding: 12px 20px; background: var(--accent); color: var(--on-accent); font: 600 16px var(--sans); }
.hm-empty .pi-yes.wide { width: 100%; max-width: 320px; }
.hm-wait { margin: 10px auto; max-width: 340px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.hm-pick { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 340px; margin: 8px auto 0; padding: 10px 14px; border: 0; border-radius: 18px; background: var(--glass-bg); box-shadow: 0 0 0 .5px var(--glass-line), var(--glass-shadow); font-size: 16px; text-align: left; color: inherit; } .hm-pick span { flex: 1; } .hm-pick i { font-style: normal; font-size: 22px; }
.chlist { display: grid; gap: 8px; margin-top: 10px; } .chlist button { display: flex; align-items: center; gap: 12px; text-align: left; border: 0; border-radius: 16px; padding: 10px 12px; background: var(--field); font-size: 15px; color: inherit; }
.chlist button:disabled { opacity: .5; } .chlist i { font-style: normal; font-size: 26px; } .chlist span { flex: 1; } .chlist b { display: block; font-weight: 600; } .chlist small { color: var(--muted); font-size: 12px; } .chlist em { font-style: normal; color: var(--muted); font-size: 13px; }
.shop-head { display: flex; align-items: center; justify-content: space-between; } .shop-head h3 { margin: 4px 0; }
.shop-tabs { margin-top: 6px; }
.shop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-height: 50vh; overflow-y: auto; padding-bottom: 8px; }
.shop-it { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; border-radius: 18px; padding: 10px 4px; background: var(--field); font-size: 12px; color: inherit; transition: transform .3s var(--spring); }
.shop-it i { font-style: normal; font-size: 30px; } .shop-it b { font-weight: 600; } .shop-it small { color: var(--muted); font-size: 10px; } .shop-it em { font-style: normal; margin-top: 3px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 600; }
.shop-it.poor { opacity: .6; } .shop-it.poor em { background: var(--line); color: var(--muted); } .shop-it.own em { background: #30a46c; color: #fff; }
@media (prefers-reduced-motion: reduce) { .tb-bub, #tabbar, #tabbar .ti, .rm-scale, .rm-egg, .hm-egg, .rm-sky, .rm-cloud, .rm-st, .rm-it, .pet-fb { animation: none !important; transition: none !important; } }
@keyframes pop { 0% { transform: scale(.4); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* ===== v20: profile photo viewer + nicknames ===== */
.av[data-av] { cursor: zoom-in; }
.avv { position: fixed; inset: 0; z-index: 400; background: rgba(0,0,0,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; touch-action: none; user-select: none; -webkit-user-select: none; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.avv-pic { border-radius: 50%; overflow: hidden; flex: none; will-change: transform; display: flex; align-items: center; justify-content: center; background: #222; box-shadow: 0 20px 60px rgba(0,0,0,.5); touch-action: none; }
.avv-pic img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.avv-ini { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #fff; font: 700 clamp(64px, 22vw, 140px) var(--sans); }
.avv-cap { text-align: center; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 20px; }
.avv-cap b { font: 700 24px var(--sans); }
.avv-cap small { color: rgba(255,255,255,.65); font-size: 14px; }
.avv-cap em { font-style: normal; color: rgba(255,255,255,.55); font-size: 14px; margin-top: 2px; }
.avv-ch { margin-top: 12px; min-height: 44px; display: inline-flex; align-items: center; padding: 0 22px; border-radius: 999px; background: rgba(255,255,255,.16); color: #fff; font-weight: 600; cursor: pointer; transition: transform .2s var(--spring, cubic-bezier(.2,1.1,.3,1)); }
.avv-ch:active { transform: scale(.94); }
.avv-x { position: absolute; top: calc(env(safe-area-inset-top) + 10px); right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.16); color: #fff; font-size: 18px; cursor: pointer; }
.isub.real { font-weight: 600; color: var(--ink); opacity: .75; }
.nickfor { margin: 10px 16px 0; padding: 10px 14px; border-radius: 14px; background: var(--field); color: var(--ink); font-size: 14px; text-align: center; animation: pop .5s cubic-bezier(.2,1.2,.3,1); }
.nickchips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chipn { min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--field); color: var(--ink); font: 600 15px var(--sans); cursor: pointer; animation: pop .45s cubic-bezier(.2,1.2,.3,1) both; }
.chipn:active { transform: scale(.92); }
.nickbtns { display: flex; gap: 10px; }
.nksave, .nkrm { flex: 1; min-height: 48px; border: 0; border-radius: 12px; font: 600 16px var(--sans); cursor: pointer; }
.nksave { background: var(--accent); color: var(--on-accent); }
.nkrm { background: var(--field); color: #e5484d; }
@media (prefers-reduced-motion: reduce) { .nickfor, .chipn { animation: none; } }

/* ===== v21: jump to newest, update banner ===== */
.jump { position: absolute; right: 12px; bottom: calc(var(--dockh, 64px) + 12px); z-index: 5; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  background: rgba(255, 255, 255, .72); -webkit-backdrop-filter: blur(20px) saturate(1.8); backdrop-filter: blur(20px) saturate(1.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 0 0 .5px rgba(0, 0, 0, .1), 0 6px 18px rgba(0, 0, 0, .18);
  opacity: 0; transform: scale(.4) translateY(14px); pointer-events: none; transition: opacity .2s ease, transform .38s var(--spring); }
@media (prefers-color-scheme: dark) { .jump { background: rgba(44, 44, 48, .7); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 0 0 .5px rgba(255, 255, 255, .12), 0 6px 18px rgba(0, 0, 0, .5); } }
.jump.show { opacity: 1; transform: none; pointer-events: auto; }
.jump.show:active { transform: scale(.88); transition-duration: .1s; }
.jump svg { width: 26px; height: 26px; }
.jump .jbadge { position: absolute; top: -7px; right: -3px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; box-sizing: border-box;
  background: #25d366; color: #fff; font: 700 12px/22px var(--sans, system-ui); text-align: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
  transform: scale(0); transition: transform .35s var(--spring); }
.jump .jbadge.on { transform: scale(1); }
.upd-banner { background: rgba(255, 255, 255, .78); -webkit-backdrop-filter: blur(22px) saturate(1.8); backdrop-filter: blur(22px) saturate(1.8); border: .5px solid var(--line); -webkit-tap-highlight-color: transparent; }
@media (prefers-color-scheme: dark) { .upd-banner { background: rgba(38, 38, 42, .78); } }
.upd-banner .upd-ico { font-size: 22px; }
.upd-banner:active { filter: brightness(.95); }
.nrefresh { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 10px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.nrefresh input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
@media (prefers-reduced-motion: reduce) { .jump, .jump .jbadge { transition: opacity .15s; } }

/* ===== v21: the pet's lines are thought clouds ===== */
.msg.petsay { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: end; max-width: 86%; }
.msg.petsay .psav { grid-column: 1; grid-row: 1; width: 30px; height: 30px; display: grid; place-items: center; font-size: 20px; line-height: 1; border-radius: 50%;
  background: rgba(255, 170, 70, .18); align-self: end; margin-bottom: 2px; }
.msg.petsay .bub, .msg.petsay:not(.mine) .bub, .pane-chat.is-pet .msg.petsay:not(.mine) .bub { grid-column: 2; grid-row: 1; position: relative; border-radius: 20px; padding: 7px 13px;
  background: rgba(255, 190, 110, .16); color: var(--ink); font-size: .93em; border: 1px dashed rgba(200, 130, 50, .4); box-shadow: none;
  -webkit-backdrop-filter: blur(14px) saturate(1.6); backdrop-filter: blur(14px) saturate(1.6); }
@media (prefers-color-scheme: dark) { .msg.petsay .bub, .msg.petsay:not(.mine) .bub, .pane-chat.is-pet .msg.petsay:not(.mine) .bub { background: rgba(255, 190, 110, .12); border-color: rgba(255, 190, 110, .32); color: #f5e8d6; } }
.msg.petsay .bub::before, .msg.petsay .bub::after { content: ""; position: absolute; border-radius: 50%; background: inherit; border: inherit; box-sizing: border-box; }
.msg.petsay .bub::before { width: 9px; height: 9px; left: -9px; bottom: 5px; }
.msg.petsay .bub::after { width: 5px; height: 5px; left: -15px; bottom: 0; }
.msg.petsay .meta { grid-column: 2; }
.msg.petsay .reacts { grid-column: 2; }
.msg.petsay.pop { transform-origin: 0 100%; animation: psPop .42s var(--spring) both; }
@keyframes psPop { from { opacity: 0; transform: scale(.55) translate(-14px, 8px); } }

.rm-think { position: absolute; left: 50%; bottom: calc(12% + var(--u) * 40); z-index: 3; max-width: 72%; padding: 7px 12px; border-radius: 18px; cursor: pointer; -webkit-tap-highlight-color: transparent;
  font: 600 13px/1.3 var(--sans, system-ui); color: #3b2a14; background: rgba(255, 255, 255, .82); -webkit-backdrop-filter: blur(14px) saturate(1.6); backdrop-filter: blur(14px) saturate(1.6);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .16); transform: translateX(-50%); animation: thkIn .42s var(--spring) both; transition: opacity .4s ease; }
.rm-think.again { animation: none; }
.rm-think.out { opacity: 0; pointer-events: none; }
.rm-think:active { filter: brightness(.95); }
.rm-think::before, .rm-think::after { content: ""; position: absolute; left: 50%; border-radius: 50%; background: inherit; box-shadow: 0 2px 6px rgba(0, 0, 0, .14); }
.rm-think::before { width: 9px; height: 9px; bottom: -11px; margin-left: -2px; }
.rm-think::after { width: 5px; height: 5px; bottom: -19px; margin-left: -6px; }
.rm-think .tx { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; text-overflow: ellipsis; overflow-wrap: anywhere; }
.rm-think.swap .tx { animation: thkTx .3s ease both; }
.rm-think .tt { display: flex; gap: 5px; padding: 3px 2px; }
.rm-think .tt i { width: 7px; height: 7px; border-radius: 50%; background: #b98a55; animation: thkDot 1.2s ease-in-out infinite both; opacity: 0; }
.rm-think .tt i:nth-child(2) { animation-delay: .2s; } .rm-think .tt i:nth-child(3) { animation-delay: .4s; }
@keyframes thkIn { from { opacity: 0; transform: translateX(-50%) scale(.5); } }
@keyframes thkTx { from { opacity: 0; } }
@keyframes thkDot { 0% { opacity: 0; transform: translateY(2px); } 30%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@media (prefers-color-scheme: dark) { .rm-think { background: rgba(48, 40, 34, .85); color: #f5e8d6; } .rm-think .tt i { background: #e0b887; } }
@media (prefers-reduced-motion: reduce) { .msg.petsay.pop, .rm-think, .rm-think .tt i, .rm-think.swap .tx { animation: none; } .rm-think .tt i { opacity: 1; } }

/* ===== v21: admin AI usage ===== */
.aicards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.aicard { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; border-radius: 18px; min-width: 0; background: rgba(127, 127, 127, .1); border: .5px solid var(--line);
  -webkit-backdrop-filter: blur(16px) saturate(1.6); backdrop-filter: blur(16px) saturate(1.6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.aicard small { color: var(--muted); font-size: 12px; }
.aicard b { font: 700 20px/1.2 var(--sans, system-ui); }
.aicard span { color: var(--muted); font-size: 11px; line-height: 1.3; }
.aichart { padding: 12px; border-radius: 18px; background: rgba(127, 127, 127, .08); border: .5px solid var(--line); }
.aichart h4 { margin: 0 0 6px; } .aichart small { color: var(--muted); font-size: 11px; }
.aichart svg { width: 100%; height: auto; display: block; }
.aichart rect { fill: var(--accent); opacity: .45; } .aichart rect.now { opacity: 1; }
.aichart text { fill: var(--muted); font-size: 8px; }
.aisplit { display: flex; flex-direction: column; gap: 12px; }
.aisplit > div { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; }
.aisplit i { grid-column: 1 / -1; grid-row: 2; height: 8px; border-radius: 4px; background: rgba(127, 127, 127, .18); overflow: hidden; }
.aisplit em { display: block; height: 100%; border-radius: 4px; background: var(--accent); transition: width .5s var(--spring); }
.aisplit small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }

/* ---- v22: for two (today's question, moods, our dates, on this day, celebration) */
.pc-stack { display: flex; flex-direction: column; }
.pc-dq h4 { margin-bottom: 4px; } .dq-streak { margin-left: auto; font-size: 13px; color: #d6336c; background: #ffe4ee; padding: 2px 9px; border-radius: 999px; } .pc-dq h4 .dq-streak + .sbtn { margin-left: 4px; }
.dq-q { margin: 4px 0 10px; font: 600 17px/1.35 var(--sans); }
.pc-dq textarea { width: 100%; box-sizing: border-box; min-height: 64px; border: 0; border-radius: 14px; padding: 10px 12px; background: var(--field); color: var(--ink); font: 16px/1.4 var(--sans); resize: none; }
.dq-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; } .dq-foot small { flex: 1; margin: 0; } .dq-foot .pi-yes { min-height: 44px; padding: 0 22px; flex: none; }
.dq-foot .sbtn { min-height: 40px; } .dq-lock { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin-bottom: 8px; padding: 10px 12px; border-radius: 14px; background: var(--field); font-weight: 600; } .dq-lock span { color: var(--muted); font-weight: 400; font-size: 13px; }
.dq-pair { display: grid; gap: 8px; } .dq-a { padding: 9px 12px; border-radius: 16px; background: var(--field); } .dq-a small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; } .dq-a p { margin: 2px 0 0; font-size: 15px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.dq-a.mine { background: color-mix(in srgb, var(--accent) 14%, var(--field)); } .dq-a.lock p { color: var(--muted); }
.dq-pair.just .dq-a.theirs { animation: dqReveal .9s cubic-bezier(.2, 1.2, .3, 1) both; } .dq-pair.just .dq-a.mine { animation: dqReveal .7s cubic-bezier(.2, 1.2, .3, 1) both; }
@keyframes dqReveal { 0% { opacity: 0; transform: scale(.7) rotateX(70deg); filter: blur(8px); } 60% { opacity: 1; transform: scale(1.04); filter: blur(0); } 100% { transform: none; } }
.pc-dq.done { box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 1.5px color-mix(in srgb, #ff7aa8 50%, transparent), var(--glass-shadow); }
.mrow { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 4px 2px; border: 0; background: transparent; color: var(--ink); font: inherit; text-align: left; }
.mrow + .mrow { border-top: 1px solid var(--glass-line); } .mrow i { font-style: normal; font-size: 28px; width: 34px; text-align: center; flex: none; } .mrow span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mrow b { font: 600 15px var(--sans); } .mrow small { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; } .mrow em { font-style: normal; color: var(--muted); font-size: 22px; } button.mrow { cursor: pointer; border-radius: 12px; } button.mrow:active { background: var(--field); transform: scale(.985); }
.moodgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; } .moodgrid button { min-height: 72px; border: 0; border-radius: 16px; background: var(--field); color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: 12px var(--sans); cursor: pointer; transition: transform .25s cubic-bezier(.2, 1.2, .3, 1), background .2s; }
.moodgrid button i { font-style: normal; font-size: 28px; } .moodgrid button:active { transform: scale(.92); } .moodgrid button.on { background: var(--accent); color: var(--on-accent); transform: scale(1.05); }
.pc-dates { display: block; width: 100%; text-align: left; border: 0; color: var(--ink); font: inherit; cursor: pointer; transition: transform .2s cubic-bezier(.2, 1.2, .3, 1); } .pc-dates:active { transform: scale(.985); }
.pd-row { display: flex; gap: 12px; } .pd-row > div { flex: 1; text-align: center; padding: 4px 0; } .pd-row > div + div { border-left: 1px solid var(--glass-line); } .pd-row b { display: block; font: 800 30px/1.1 var(--sans); } .pd-row small { color: var(--muted); font-size: 12px; }
.pd-up { display: block; font-style: normal; text-align: center; margin-top: 6px; font-size: 13px; color: var(--muted); }
.pc-dates.empty { display: flex; align-items: center; gap: 12px; } .pc-dates.empty i { font-style: normal; font-size: 26px; } .pc-dates.empty span { flex: 1; display: flex; flex-direction: column; } .pc-dates.empty b { font-size: 15px; } .pc-dates.empty small { color: var(--muted); font-size: 12px; } .pc-dates.empty em { font-style: normal; color: var(--muted); font-size: 22px; }
.pc-otd h4 small { font-weight: 400; } .pc-new { margin-left: auto; font-size: 11px; background: #ff5a7e; color: #fff; padding: 2px 8px; border-radius: 999px; }
.otd-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); } .otd-it { position: relative; min-height: 76px; border: 0; border-radius: 14px; background: var(--field); color: var(--ink); text-align: left; padding: 9px 10px; overflow: hidden; font: inherit; cursor: pointer; transition: transform .2s cubic-bezier(.2, 1.2, .3, 1); }
.otd-it:active { transform: scale(.96); } .otd-it p { margin: 0; font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; } .otd-it small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.otd-it.img { padding: 0; aspect-ratio: 1; } .otd-it.img img { width: 100%; height: 100%; object-fit: cover; display: block; } .otd-it.img small { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 14px 8px 5px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.dts { display: grid; gap: 10px; margin-top: 8px; } .dts label { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; font-weight: 600; font-size: 15px; } .dts input[type=date] { min-height: 44px; border: 0; border-radius: 12px; padding: 0 10px; background: var(--field); color: var(--ink); font: 16px var(--sans); max-width: 170px; }
.dts .dts-chk { justify-content: flex-start; } .dts-chk input { width: 26px; height: 26px; flex: none; accent-color: var(--accent); } .dts-chk span { display: flex; flex-direction: column; } .dts-chk small { color: var(--muted); font-weight: 400; font-size: 12px; }
.dq-past { max-height: 60dvh; overflow-y: auto; display: grid; gap: 12px; padding-bottom: 4px; } .dq-sum { margin: 0; font-weight: 700; color: #d6336c; } .dq-pi { display: grid; gap: 6px; } .dq-pi > small { color: var(--muted); font-size: 12px; } .dq-pi > b { font-size: 15px; } .dq-miss { margin: 0; color: var(--muted); font-size: 13px; }
.cel { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(10, 12, 24, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: celFade .3s ease both; overflow: hidden; } .cel.out { animation: celFade .3s ease reverse both; }
.cel-fx { position: absolute; inset: 0; pointer-events: none; } .cel-fx span { position: absolute; top: -40px; left: var(--x); font-size: var(--sz); animation: celFall var(--du) var(--dl) ease-in infinite; }
@keyframes celFade { from { opacity: 0; } } @keyframes celFall { to { transform: translateY(112dvh) rotate(var(--r)); } }
.cel-card { position: relative; width: min(86vw, 340px); padding: 26px 22px 20px; border-radius: 28px; text-align: center; background: var(--panel, #fff); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); animation: celPop .6s cubic-bezier(.2, 1.3, .3, 1) both; }
.cel-card h2 { margin: 6px 0 4px; font: 800 22px/1.2 var(--sans); } .cel-card p { margin: 0 0 16px; color: var(--muted); } .cel-em { font-size: 64px; line-height: 1.1; animation: celBounce 1.4s ease-in-out .5s infinite; }
@keyframes celPop { from { opacity: 0; transform: scale(.5) translateY(30px); } } @keyframes celBounce { 50% { transform: translateY(-8px) scale(1.12) rotate(-6deg); } }
.info-mood { display: block; margin-top: 2px; color: var(--muted); font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .cel-fx span, .cel-em, .dq-pair.just .dq-a { animation: none !important; } .cel-fx span { top: 20%; } }

/* ---------------------------------------------------------------- v23 Touches: the Us screen, replay, chips */
.hap-switch { position: fixed; left: -80px; top: -80px; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden; }
.page.us { background: radial-gradient(120% 70% at 50% 18%, color-mix(in srgb, var(--accent) 16%, var(--bg)) 0%, var(--bg) 70%); z-index: 40; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.us-top { display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 10px 6px; }
.us-top .icon { background: var(--glass-bg); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); border: 0; color: var(--ink); width: 40px; height: 40px; border-radius: 50%; font-size: 22px; box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line); }
.us-who { min-width: 0; flex: 1; text-align: center; padding-right: 40px; }
.us-who b { display: block; font: 600 17px var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.us-who small { color: var(--muted); font-size: 12px; }
.us-stage { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; overflow: hidden; touch-action: none; }
.us-aura { position: absolute; left: 50%; top: 46%; width: min(86vw, 420px); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, #ff5c8a 34%, transparent), transparent); filter: blur(10px); opacity: .55; transition: opacity .6s, transform .8s var(--spring); pointer-events: none; }
.us-stage.lean .us-aura { opacity: .95; transform: translate(-50%, -50%) scale(1.12); }
.us-blob { --bc: #7c5cff; --px: 50%; --py: 50%; position: relative; display: grid; place-items: center; overflow: hidden; color: #fff; font: 700 clamp(34px, 12vw, 56px) var(--sans);
  background: radial-gradient(120% 120% at 30% 20%, color-mix(in srgb, var(--bc) 70%, #fff) 0%, var(--bc) 60%);
  box-shadow: inset 0 3px 10px rgba(255, 255, 255, .55), inset 0 -10px 24px rgba(0, 0, 0, .22), 0 14px 34px color-mix(in srgb, var(--bc) 45%, transparent), 0 0 0 .5px var(--glass-line);
  border-radius: 54% 46% 52% 48% / 50% 54% 46% 50%; transform-origin: var(--px) var(--py); touch-action: none; -webkit-tap-highlight-color: transparent; }
.us-blob img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.us-blob::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(160deg, rgba(255, 255, 255, .5), transparent 38%); pointer-events: none; }
.us-blob.them { width: min(58vw, 250px); height: min(58vw, 250px); cursor: pointer; z-index: 2; }
.us-blob.me { width: min(30vw, 130px); height: min(30vw, 130px); margin-top: -26px; margin-left: 40%; z-index: 3; }
.us-blob.tr-blob { width: min(52vw, 220px); height: min(52vw, 220px); }
.us-stage .us-blob.them, .us-stage .us-blob.me { transition: transform .9s var(--spring), margin .9s var(--spring); }
.us-stage.lean .us-blob.them { transform: translateX(-6%) rotate(-3deg); }
.us-stage.lean .us-blob.me { margin-left: 18%; transform: rotate(4deg); }
@keyframes usWob { 0% { transform: scale(1); } 22% { transform: scale(.88, 1.08); } 52% { transform: scale(1.07, .93); } 100% { transform: scale(1); } }
@keyframes usPunch { 0% { transform: scale(1) rotate(0); } 20% { transform: scale(.78, 1.12) rotate(-9deg); } 55% { transform: scale(1.08, .94) rotate(5deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes usSend { 0% { transform: translateY(0) scale(1); } 35% { transform: translateY(-22px) scale(1.08); } 100% { transform: translateY(0) scale(1); } }
@keyframes usBreath { 0%, 100% { scale: 1; } 50% { scale: 1.035; } }
.us-blob.them { animation: usBreath 4.2s ease-in-out infinite; }
.us-blob.me { animation: usBreath 4.2s ease-in-out infinite -2s; }
.us-blob.wob { animation: usWob .62s var(--spring); }
.us-blob.punched { animation: usPunch .5s var(--spring); }
.us-blob.send { animation: usSend .55s var(--spring); }
.us-count { position: absolute; left: 50%; top: 4%; transform: translateX(-50%); padding: 6px 16px; border-radius: 999px; font: 800 clamp(26px, 8vw, 38px) var(--sans); color: var(--ink); background: var(--glass-bg);
  -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line), var(--glass-shadow); z-index: 6; pointer-events: none; font-variant-numeric: tabular-nums; }
.us-count[data-s="4"], .us-count[data-s="5"] { color: #ff3b5c; }
.us-count.bump { animation: usBump .3s var(--spring); }
.us-count.gone { animation: usGone .5s ease-in both; }
@keyframes usBump { 0% { transform: translateX(-50%) scale(1); } 40% { transform: translateX(-50%) scale(1.22); } 100% { transform: translateX(-50%) scale(1); } }
@keyframes usGone { to { transform: translateX(-50%) translateY(-60px) scale(.7); opacity: 0; } }
.us-say { position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%); max-width: 90%; text-align: center; padding: 8px 16px; border-radius: 18px; font: 600 15px var(--sans); background: var(--glass-bg);
  -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line), var(--glass-shadow); opacity: 0; pointer-events: none; z-index: 6; }
.us-say.show { animation: usSay 2.8s var(--spring) both; }
@keyframes usSay { 0% { opacity: 0; transform: translateX(-50%) translateY(14px) scale(.9); } 12%, 80% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } 100% { opacity: 0; transform: translateX(-50%) translateY(-8px); } }
.us-hold { position: absolute; left: 0; right: 0; bottom: 3%; text-align: center; color: var(--muted); font-size: 13px; pointer-events: none; padding: 0 20px; }
.us-sendrow { height: 0; position: relative; z-index: 7; display: flex; justify-content: center; }
.us-send { position: absolute; bottom: 6px; padding: 9px 22px; border: 0; border-radius: 999px; font: 700 15px var(--sans); color: var(--on-accent, #fff); background: var(--accent); box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 45%, transparent); animation: usBump .35s var(--spring); }
.us-send[hidden], .us-count[hidden], .us-say[hidden] { display: none; }
.us-dock { padding: 8px 0 calc(10px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.us-ring, .us-buzz { display: flex; gap: 8px; overflow-x: auto; padding: 4px 14px 6px; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.us-ring::-webkit-scrollbar, .us-buzz::-webkit-scrollbar { display: none; }
.us-act { flex: none; scroll-snap-align: center; width: 66px; padding: 8px 0 6px; border: 0; border-radius: 22px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink);
  background: var(--glass-bg); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line); transition: transform .35s var(--spring), box-shadow .2s, background .2s; }
.us-act i { font-style: normal; font-size: 28px; line-height: 1.15; }
.us-act span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.us-act.on { transform: translateY(-4px) scale(1.06); background: color-mix(in srgb, var(--accent) 22%, var(--glass-bg)); box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 1.5px var(--accent), 0 8px 18px color-mix(in srgb, var(--accent) 30%, transparent); }
.us-act.on span { color: var(--ink); font-weight: 600; }
.us-sep { flex: none; align-self: center; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); writing-mode: vertical-rl; transform: rotate(180deg); padding: 0 2px; }
.us-chip { flex: none; scroll-snap-align: start; padding: 9px 15px; border: 0; border-radius: 999px; font: 600 14px var(--sans); color: var(--ink); white-space: nowrap; display: flex; align-items: center; gap: 6px; min-height: 40px;
  background: var(--glass-bg); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line); }
.us-chip i { font-style: normal; font-size: 17px; }
.us-chip.zap { animation: usZap .45s var(--spring); }
@keyframes usZap { 0% { transform: scale(1); } 30% { transform: scale(.9); } 60% { transform: scale(1.1); } 100% { transform: scale(1); } }
.us-fx { position: absolute; width: 96px; height: 96px; margin: -48px 0 0 -48px; pointer-events: none; z-index: 5; scale: var(--s, 1); animation: usRise 1.8s ease-out both; }
.us-fx svg { width: 100% !important; height: 100% !important; }
.us-fx .pet-fb { font-size: 54px; }
@keyframes usRise { 0% { transform: translate(0, 10px); opacity: 0; } 12% { opacity: 1; } 100% { transform: translate(var(--dx, 0), -70px); opacity: 0; } }
.us-splat { position: absolute; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 46% 54% 40% 60% / 55% 40% 60% 45%; background: radial-gradient(circle at 40% 35%, #ff6b5c, #d92d20 70%); opacity: .85; rotate: var(--r, 0deg); pointer-events: none; z-index: 4; animation: usSplat 3.2s ease-out both; }
@keyframes usSplat { 0% { transform: scale(.2); opacity: 0; } 8% { transform: scale(1.2); opacity: .9; } 16% { transform: scale(1); } 80% { opacity: .8; } 100% { opacity: 0; transform: translateY(14px) scale(1.05); } }
.us-coin { position: absolute; right: 12%; top: 18%; font: 700 16px var(--sans); color: #b8860b; z-index: 7; pointer-events: none; animation: usRise 1.4s ease-out both; }
.us-stage.incoming .us-blob.them { animation: usLungeIn 2.4s var(--spring); }
@keyframes usLungeIn { 0% { transform: scale(1); } 15% { transform: translate(14%, 8%) scale(1.1) rotate(5deg); } 60% { transform: translate(8%, 4%) scale(1.06) rotate(-3deg); } 100% { transform: scale(1); } }

/* the full-screen replay */
.tr-ov { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: color-mix(in srgb, var(--bg) 55%, transparent); -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%); animation: trIn .35s ease both; }
.tr-ov.closing { animation: trOut .22s ease both; }
@keyframes trIn { from { opacity: 0; } }
@keyframes trOut { to { opacity: 0; } }
.tr-card { width: min(92vw, 400px); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 18px 18px; border-radius: 30px; text-align: center; background: var(--glass-bg);
  box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line), var(--glass-shadow); }
.tr-stage { position: relative; width: 100%; height: min(60vw, 260px); display: grid; place-items: center; }
.tr-stage .tr-blob { animation: trFly .9s var(--spring) both; }
@keyframes trFly { 0% { transform: translateX(-130%) rotate(-25deg) scale(.6); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; opacity: 1; } }
.tr-word { position: absolute; right: 6%; top: 4%; font-size: 52px; animation: usRise 2.4s ease-out both; }
.tr-line { margin: 4px 0 0; font: 700 20px/1.25 var(--sans); }
.tr-sub { color: var(--muted); }
.tr-btns { display: flex; gap: 10px; align-items: center; margin-top: 10px; width: 100%; }
.tr-btns .big-btn { flex: 1; padding: 13px; }
.tr-ov.str2 .tr-card { animation: trShake2 .5s .5s both; }
.tr-ov.str3 .tr-card { animation: trShake3 .7s .5s both; }
.tr-ov.str4 .tr-card { animation: trShake4 .9s .5s both; }
.tr-ov.str5 .tr-card { animation: trShake5 1.2s .5s both; }
@keyframes trShake2 { 20%, 60% { transform: translateX(-2px); } 40%, 80% { transform: translateX(2px); } }
@keyframes trShake3 { 15%, 55% { transform: translate(-4px, 1px) rotate(-.6deg); } 35%, 75% { transform: translate(4px, -1px) rotate(.6deg); } }
@keyframes trShake4 { 10%, 50%, 90% { transform: translate(-7px, 2px) rotate(-1deg); } 30%, 70% { transform: translate(7px, -2px) rotate(1deg); } }
@keyframes trShake5 { 8%, 40%, 72% { transform: translate(-11px, 3px) rotate(-1.6deg); } 24%, 56%, 88% { transform: translate(11px, -3px) rotate(1.6deg); } }

/* in the chat: a small centered chip */
.tchip-row { align-self: center; display: flex; flex-direction: column; align-items: center; gap: 3px; margin: 6px 0; max-width: 90%; }
.tchip-row.pop { animation: usZap .5s var(--spring); }
.tchip { border: 0; padding: 8px 16px; border-radius: 999px; font: 600 15px var(--sans); color: var(--ink); display: flex; align-items: center; gap: 6px; min-height: 40px;
  background: var(--glass-bg); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line), var(--glass-shadow); }
.tchip i { font-style: normal; font-size: 19px; }
.tchip em { font-style: normal; color: var(--muted); font-weight: 500; }
.tchip-row.mine .tchip { background: color-mix(in srgb, var(--accent) 16%, var(--glass-bg)); }
.tchip-row > small { color: var(--muted); font-size: 11.5px; }
.tback { border: 0; background: none; padding: 4px 2px; font: 600 11.5px var(--sans); color: var(--accent); }

/* Home card, settings, admin */
.pc-us { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; text-align: left; color: var(--ink); }
.pc-us b { display: block; font: 600 15px var(--sans); }
.pc-us em { margin-left: auto; font-style: normal; color: var(--muted); font-size: 22px; }
.pcus-blobs { position: relative; width: 62px; height: 40px; flex: none; }
.pcus-blobs .us-blob { position: absolute; width: 40px; height: 40px; font-size: 15px; animation: usBreath 4s ease-in-out infinite; }
.pcus-blobs .us-blob + .us-blob { left: 22px; animation-delay: -2s; }
.tseg { display: flex; gap: 4px; padding: 4px; margin: 10px; border-radius: 12px; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.tseg button { flex: 1; border: 0; padding: 9px 0; border-radius: 9px; background: transparent; color: var(--ink); font: 600 14px var(--sans); transition: background .2s, box-shadow .2s; }
.tseg button.on { background: var(--bg); box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
#sTouch .hint { display: block; margin: 0 14px 8px; }
.tpq { display: flex; gap: 14px; padding: 0 14px 12px; }
.tpq label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.tpq input { font: 600 15px var(--sans); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--bg); color: var(--ink); }
.storm { margin-top: 18px; padding-top: 4px; border-top: 1px solid var(--line); }
.storm h4 { margin: 14px 0 6px; }
.storm-row { display: flex; gap: 10px; margin: 8px 0; }
.storm-row label { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.storm-out { margin-top: 10px; font-size: 14px; }
.storm-out ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.storm .sbtn { margin-top: 4px; }
@keyframes usFade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .us-blob, .us-blob.them, .us-blob.me, .us-aura, .us-splat, .tr-stage .tr-blob, .tr-ov .tr-card, .us-count, .us-say.show, .us-send, .tchip-row.pop, .pcus-blobs .us-blob, .us-blob.wob, .us-blob.punched, .us-blob.send, .us-stage.incoming .us-blob.them { animation: none !important; }
  .us-stage .us-blob.them, .us-stage .us-blob.me, .us-act { transition: none; }
  .us-say.show { opacity: 1; }
  .us-fx, .tr-word { animation: usFade 1.4s linear both !important; }
  .us-stage.lean .us-blob.them, .us-stage.lean .us-blob.me { transform: none; }
}
/* pet chat: the owners' own lines carry their name, so they never read as the pet */
.msg .msg-who { font-size: 12px; font-weight: 600; color: var(--muted); margin: 6px 0 2px 12px; }

/* ===== v24: live touch (Us), pinned messages, photo editor ===== */
.us-come { display: block; margin: 4px auto 0; min-height: 30px; padding: 4px 14px; border: 0; border-radius: 999px; font: 600 13px var(--sans); color: var(--ink); background: var(--glass-bg); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line); transition: transform .25s var(--spring), opacity .2s; }
.us-come:active { transform: scale(.94); }
.us-come[hidden] { display: none; }
.us-come:disabled { opacity: .6; }
.us-eyes { position: absolute; left: 50%; top: 40%; z-index: 1; display: flex; gap: 16%; width: 46%; justify-content: center; transform: translateX(-50%); pointer-events: none; }
.us-eyes b { width: 16%; aspect-ratio: 1; min-width: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, .35), inset -2px -3px 0 rgba(0, 0, 0, .75); transform: scaleY(.12); opacity: .75; transition: transform .45s var(--spring), opacity .3s; }
.page.us.awake .us-eyes b { transform: scaleY(1); opacity: 1; animation: usBlink 5s ease-in-out infinite; }
.page.us.awake .us-eyes b + b { animation-delay: .02s; }
@keyframes usBlink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
.page.us.awake .us-stage .us-blob.them { transform: translateX(-9%) rotate(-5deg) scale(1.03); }
.page.us.awake .us-stage .us-blob.me { margin-left: 8%; transform: rotate(5deg); }
.us-stage.hug .us-blob.them { transform: translate(-6%, 3%) scale(1.07) rotate(-4deg) !important; }
.us-stage.hug .us-blob.me { margin-left: 2% !important; transform: translate(-12%, -16%) scale(1.14) rotate(7deg) !important; }
.us-dot { position: absolute; z-index: 6; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; pointer-events: none; opacity: 0; transform: scale(.4); transition: opacity .18s, transform .25s var(--spring); }
.us-dot.on { opacity: 1; transform: scale(1); }
.us-dot.theirs { background: radial-gradient(closest-side, #fff 0 24%, color-mix(in srgb, #ff5c8a 70%, transparent) 46%, transparent 100%); box-shadow: 0 0 22px 6px color-mix(in srgb, #ff5c8a 55%, transparent); }
.us-dot.mine { background: radial-gradient(closest-side, #fff 0 24%, color-mix(in srgb, var(--accent) 70%, transparent) 46%, transparent 100%); box-shadow: 0 0 22px 6px color-mix(in srgb, var(--accent) 50%, transparent); }
.us-blob.beat { animation: usBeat .7s ease-out; }
@keyframes usBeat { 0% { transform: scale(1); } 14% { transform: scale(1.08); } 28% { transform: scale(.99); } 42% { transform: scale(1.05); } 100% { transform: scale(1); } }
.us-heart { position: absolute; z-index: 8; font-size: 24px; pointer-events: none; opacity: 0; animation: usHeart 1.5s var(--ease) both; }
@keyframes usHeart { 0% { opacity: 0; transform: translate(0, 0) scale(.4); } 18% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.2); } }

/* pinned messages */
.pinbar { display: flex; align-items: stretch; gap: 2px; min-height: 42px; padding: 3px 4px 3px 6px; border-radius: 20px; background: var(--glass-bg); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line), var(--glass-shadow); color: var(--ink); }
.pinbar[hidden] { display: none !important; }
.pane-chat > .pinbar { position: absolute; z-index: 4; top: calc(env(safe-area-inset-top, 0px) + 70px); left: 10px; right: 10px; }
.pane-chat.is-pet > .pinbar { position: relative; top: auto; left: auto; right: auto; margin: 4px 10px 0; }
.pane-chat.has-pins:not(.is-pet) > .log { padding-top: calc(env(safe-area-inset-top, 0px) + 80px + 48px); }
.pin-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; background: none; color: inherit; text-align: left; padding: 2px 8px; border-radius: 16px; font: inherit; transition: transform .2s var(--spring), background-color .15s; }
.pin-main:active { transform: scale(.98); background: var(--hover); }
.pin-main i { font-style: normal; font-size: 16px; }
.pin-txt { min-width: 0; display: flex; flex-direction: column; animation: pinSwap .3s var(--spring) both; }
.pin-txt b { font: 600 12px var(--sans); color: var(--accent); }
.pin-txt span { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes pinSwap { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pin-all { flex: none; min-width: 44px; border: 0; background: none; color: var(--accent); font: 600 13px var(--sans); border-radius: 16px; }
.pin-all:active { background: var(--hover); }
.pinlist { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow-y: auto; padding-bottom: 6px; }
.pinrow { display: flex; align-items: center; gap: 8px; }
.pinjump { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; gap: 2px; border: 0; background: var(--field); color: var(--ink); border-radius: 14px; padding: 9px 12px; font: inherit; }
.pinjump b { font: 600 12px var(--sans); color: var(--muted); }
.pinjump span { font-size: 14px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pinx { flex: none; min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--love); font: 600 14px var(--sans); border-radius: 12px; }

/* photo editor */
.pe { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; background: #0b0b0d; color: #fff; animation: peIn .32s var(--spring) both; touch-action: none; user-select: none; -webkit-user-select: none; }
.pe.closing { opacity: 0; transform: scale(.98); transition: opacity .18s, transform .18s; }
@keyframes peIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.pe-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px; }
.pe-top b { flex: 1; text-align: center; font: 600 16px var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pe-b { min-width: 72px; min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .14); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); color: #fff; font: 500 16px var(--sans); }
.pe-b.pe-ok { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.pe-b:disabled { opacity: .5; }
.pe-b:active { transform: scale(.95); }
.pe-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; cursor: grab; }
.pe-stage canvas { position: absolute; left: 0; top: 0; display: block; }
.pe-fr { pointer-events: none; }
.pe-bot { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); background: rgba(30, 30, 34, .6); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); }
.pe-presets { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.pe-presets button { min-height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #fff; font: 500 14px var(--sans); transition: transform .25s var(--spring), background-color .15s; }
.pe-presets button.on { background: #fff; color: #000; }
.pe-presets button:active { transform: scale(.94); }
.pe-tools { display: flex; justify-content: space-around; }
.pe-tools button { flex: 1; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none; color: #fff; font: 500 12px var(--sans); border-radius: 14px; }
.pe-tools button i { font-style: normal; font-size: 22px; line-height: 1; }
.pe-tools button.on { color: var(--accent); }
.pe-tools button:active { transform: scale(.92); }
.pe-tune { display: flex; gap: 14px; }
.pe-tune[hidden] { display: none; }
.pe-tune label { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: rgba(255, 255, 255, .75); min-width: 0; }
.pe-tune input { width: 100%; }
.mpv-edit { text-align: right; }
@media (prefers-reduced-motion: reduce) {
  .page.us.awake .us-eyes b, .us-blob.beat, .us-heart, .pe, .pin-txt { animation: none !important; }
  .us-heart { opacity: 1; transition: opacity 1.4s; }
  .us-dot, .us-eyes b, .pe-presets button, .pin-main, .us-come { transition: none; }
  .page.us.awake .us-stage .us-blob.them, .page.us.awake .us-stage .us-blob.me, .us-stage.hug .us-blob.them, .us-stage.hug .us-blob.me { transform: none !important; }
}

/* ===== v25: question cards ===== */
.page.cards { z-index: 50; display: flex; flex-direction: column; background: radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--accent) 14%, var(--bg)) 0%, var(--bg) 70%); }
.kc-top { display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 10px 6px; font: 700 18px var(--sans); }
.kc-top .icon { background: var(--glass-bg); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); border: 0; color: var(--ink); width: 40px; height: 40px; border-radius: 50%; font-size: 19px; box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line); }
.kc-top #kcBack { font-size: 24px; }
.kc-sp { flex: 1; }
.kc-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 16px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; -webkit-overflow-scrolling: touch; }
.kc-note { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 18px; background: var(--glass-bg); box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line); }
.kc-note small { color: var(--muted); font-size: 12.5px; }
.kc-note.ask { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
.kc-date { display: flex; gap: 8px; align-items: center; }
.kc-date input { flex: 1; min-width: 0; font-size: 16px; padding: 9px 10px; border-radius: 12px; border: 0; background: var(--field); color: var(--ink); }
/* the fanned deck */
.kc-fan { display: flex; gap: 0; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; padding: 26px 22px 18px; margin: 0 -16px; -webkit-overflow-scrolling: touch; scrollbar-width: none; flex: none; }
.kc-fan::-webkit-scrollbar { display: none; }
.kc-deck { flex: 0 0 136px; height: 188px; margin-left: -20px; scroll-snap-align: center; border: 0; border-radius: 22px; padding: 14px 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; color: var(--ink);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 16%, var(--glass-bg)), var(--glass-bg)); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line), var(--glass-shadow); transform: translateY(calc(var(--i) % 2 * 6px)) rotate(calc((var(--i) - 3) * 2deg)); transform-origin: 50% 120%;
  transition: transform .4s var(--spring), filter .2s; -webkit-tap-highlight-color: transparent; }
.kc-deck:first-child { margin-left: 0; }
.kc-deck i { font-style: normal; font-size: 38px; line-height: 1.1; }
.kc-deck b { font: 700 15px var(--sans); }
.kc-deck small { color: var(--muted); font-size: 11.5px; line-height: 1.25; flex: 1; overflow: hidden; }
.kc-deck em { font-style: normal; font: 600 11.5px var(--sans); color: var(--accent); }
.kc-deck.on { transform: translateY(-12px) rotate(0) scale(1.05); z-index: 2; box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 2px var(--accent), var(--glass-shadow); }
.kc-deck.locked { filter: grayscale(1) opacity(.62); }
.kc-deck.locked em { color: var(--muted); }
.kc-mode { padding-bottom: 0; }
.kc-draw { align-self: stretch; min-height: 48px; font-size: 16px; }
.kc-draw:disabled { opacity: .5; }
.kc-score { margin: 0; text-align: center; color: var(--muted); font: 600 13px var(--sans); }
/* the card that flips over */
.kc-flip { position: relative; align-self: center; width: min(100%, 320px); perspective: 900px; margin: 6px 0 2px; flex: none; }
.kc-flip::before { content: ""; display: block; padding-top: 58%; }
.kc-side { position: absolute; inset: 0; border-radius: 26px; padding: 20px; display: flex; flex-direction: column; justify-content: center; gap: 8px; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .8s var(--spring);
  box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line), var(--glass-shadow); }
.kc-side.back { align-items: center; text-align: center; background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 38%, var(--bg)), color-mix(in srgb, var(--accent) 14%, var(--bg))); transform: rotateY(0); }
.kc-side.back i { font-style: normal; font-size: 56px; }
.kc-side.back small { color: var(--ink); opacity: .7; font-weight: 600; }
.kc-side.front { background: var(--glass-bg); -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%); transform: rotateY(-180deg); overflow: hidden; }
.kc-side.front small { color: var(--muted); font: 600 12.5px var(--sans); }
.kc-side.front p { margin: 0; font: 600 19px/1.35 var(--sans); overflow-wrap: anywhere; }
.kc-flip.flipped .kc-side.back { transform: rotateY(180deg); }
.kc-flip.flipped .kc-side.front { transform: rotateY(0); }
.kc-body textarea { width: 100%; box-sizing: border-box; font: 16px/1.4 var(--sans); padding: 12px 14px; border-radius: 18px; border: 0; background: var(--field); color: var(--ink); resize: none; flex: none; }
.kc-act { display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
.kc-act .pi-yes { min-width: 120px; min-height: 44px; }
.kc-act .sbtn { min-height: 44px; padding: 0 16px; }
.kc-wait { margin: 2px 0; text-align: center; color: var(--muted); font: 600 14px var(--sans); }
.kc-wait.ok { color: var(--accent); }
.kc-mine { margin: 0; }
.kc-pair { grid-template-columns: 1fr 1fr; }
.kc-pair.one { grid-template-columns: 1fr; }
.kc-pair .dq-a { min-width: 0; }
.kc-verdict { margin: 4px 0 0; text-align: center; font: 700 16px var(--sans); }
.kc-rate { display: flex; gap: 14px; justify-content: center; }
.kc-r { width: 72px; height: 72px; border-radius: 50%; border: 0; font-size: 32px; background: var(--glass-bg); box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line), var(--glass-shadow); transition: transform .3s var(--spring); }
.kc-r:active { transform: scale(.88); }
.kc-qhead { text-align: center; }
.kc-qhead small { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.kc-qhead p { margin: 4px 0 0; font: 700 18px/1.35 var(--sans); overflow-wrap: anywhere; }
.kc-qhead.big { margin: 0 0 10px; text-align: left; }
.kc-gain { text-align: center; }
/* archive */
.ka { display: flex; flex-direction: column; gap: 6px; max-height: 62vh; overflow-y: auto; overflow-x: hidden; }
.ka-g h4 { margin: 12px 0 6px; font: 700 15px var(--sans); }
.ka-g h4 small { color: var(--muted); font-weight: 600; }
.ka-i { width: 100%; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; text-align: left; border: 0; padding: 11px 13px; border-radius: 14px; background: var(--field); color: var(--ink); margin-bottom: 4px; }
.ka-i b { font: 600 14.5px/1.35 var(--sans); overflow-wrap: anywhere; }
.ka-i small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.ka-i.open { background: color-mix(in srgb, var(--accent) 12%, var(--field)); }
.ka-a { margin: 0 0 8px; }
.ka-a[hidden] { display: none; }
.ka-more { align-self: center; margin: 8px 0; }
/* chat chip + entry tiles */
.kchip { max-width: 100%; text-align: left; align-items: flex-start; }
.kchip span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.kchip-row > small { text-align: center; }
.pc-cards { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; text-align: left; color: var(--ink); }
.pc-cards > i { font-style: normal; font-size: 28px; }
.pc-cards b { display: block; font: 600 15px var(--sans); }
.pc-cards em { margin-left: auto; font-style: normal; color: var(--muted); font-size: 22px; }
.us-cardsb { margin-left: auto; border: 0; min-height: 40px; padding: 0 14px; border-radius: 999px; font: 600 14px var(--sans); color: var(--ink); background: var(--glass-bg); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .kc-side, .kc-deck, .kc-r { transition: none !important; }
  .kc-deck.on { transform: translateY(-8px) scale(1.03); }
}
.us-top .us-who { padding-right: 0; }
.us-cardsb { flex: none; margin-left: 0; padding: 0 12px; font-size: 13px; }

/* ---- v26: time capsule letters */
.page.letters, .page.lcompose, .page.lread { z-index: 52; display: flex; flex-direction: column; background: radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, #ffb36b 16%, var(--bg)) 0%, var(--bg) 70%); }
.page.lcompose { z-index: 54; } .page.lread { z-index: 56; }
.toast { z-index: 95; } .viewer.mv { z-index: 66; }  /* above the full-screen pages, which sit at 50+ */
.lp-tabs { display: flex; gap: 6px; padding: 4px 16px 8px; }
.lp-tabs button { flex: 1; min-height: 40px; border: 0; border-radius: 999px; padding: 0 8px; font: 600 14px var(--sans); color: var(--ink); background: var(--field); white-space: nowrap; }
.lp-tabs button.on { background: var(--accent); color: var(--on-accent); }
.lp-tabs em { font-style: normal; font-size: 12px; opacity: .75; margin-left: 2px; }
.lp-i { display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; text-align: left; border: 0; padding: 12px 14px; border-radius: 18px; color: var(--ink); background: var(--glass-bg); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line), var(--glass-shadow); flex: none; }
.lp-i > i { font-style: normal; font-size: 28px; flex: none; }
.lp-i > span { flex: 1; min-width: 0; }
.lp-i b, .lp-i small, .lp-i em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-i b { font: 600 15px var(--sans); } .lp-i small { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.lp-i em { font-style: italic; color: var(--muted); font-size: 13px; margin-top: 3px; }
.lp-i u { text-decoration: none; color: var(--muted); font-size: 12px; flex: none; }
.lc-sec { display: flex; flex-direction: column; gap: 6px; flex: none; } .lc-sec > small { color: var(--muted); font-size: 12.5px; font-weight: 600; padding-left: 4px; }
.lc-to, .lc-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.lc-to button, .lc-picks button { border: 0; min-height: 40px; padding: 0 14px; border-radius: 999px; font: 600 14px var(--sans); color: var(--ink); background: var(--field); }
.lc-to button.on, .lc-picks button.on { background: var(--accent); color: var(--on-accent); }
.lc-to.fixed button:not(.on) { display: none; }
.lc-picks button:disabled { opacity: .35; }
#lcAt { width: 100%; box-sizing: border-box; min-height: 44px; border: 0; border-radius: 14px; padding: 0 12px; font: 16px var(--sans); color: var(--ink); background: var(--field); }
.lc-photos { display: flex; flex-wrap: wrap; gap: 8px; flex: none; }
.lc-ph { position: relative; width: 72px; height: 72px; border-radius: 14px; overflow: hidden; } .lc-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lc-ph button { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; font-size: 16px; line-height: 1; padding: 0; }
.lc-add { width: 72px; height: 72px; border: 0; border-radius: 14px; background: var(--field); color: var(--ink); font-size: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.lc-add small { font-size: 11px; color: var(--muted); }
.lr-act { display: flex; gap: 6px; } .lr-act .sbtn { min-height: 36px; padding: 0 12px; font-size: 13px; }
.lr-paper { position: relative; padding: 24px 22px 18px; border-radius: 20px; color: #3a2e24; font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif; flex: none;
  background: linear-gradient(160deg, rgba(255, 253, 246, .9), rgba(255, 245, 226, .78)); -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 .5px rgba(120, 90, 50, .18), 0 10px 30px rgba(90, 60, 20, .14); animation: lrIn .5s var(--spring) both; }
.lr-from { display: block; color: #8a7358; font: 600 12.5px var(--sans); margin-bottom: 12px; letter-spacing: .2px; }
.lr-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 17.5px; line-height: 1.7; }
.lr-photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 16px; } .lr-photos.n1 { grid-template-columns: 1fr; }
.lr-photos button { border: 0; padding: 0; border-radius: 12px; overflow: hidden; aspect-ratio: 1; background: rgba(0, 0, 0, .06); } .lr-photos.n1 button { aspect-ratio: 4 / 3; }
.lr-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lr-paper footer { margin-top: 18px; padding-top: 12px; border-top: 1px dashed rgba(120, 90, 50, .3); color: #8a7358; font: 12.5px/1.45 var(--sans); text-align: center; }
.lr-sealed { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding-top: 28px; }
.lr-sealed h3 { margin: 18px 0 0; font: 700 21px var(--sans); } .lr-sealed p { margin: 0; color: var(--muted); font-size: 16px; } .lr-sealed p b { color: var(--ink); }
.lr-count { font: 700 30px var(--sans); color: var(--accent); font-variant-numeric: tabular-nums; margin: 6px 0 2px; }
/* the envelope: pure CSS, no images */
.env { position: relative; width: 220px; height: 150px; margin: 0 auto; perspective: 800px; filter: drop-shadow(0 10px 18px rgba(90, 60, 20, .22)); }
.env i { position: absolute; display: block; }
.env-back { inset: 0; border-radius: 10px; background: #e9c9a8; }
.env-paper { left: 14px; right: 14px; top: 10px; height: 124px; border-radius: 6px; background: #fffdf6; z-index: 2; animation: envPaper 1.1s .85s cubic-bezier(.3, .8, .3, 1) both; }
.env-front { inset: 0; border-radius: 10px; z-index: 3; background: linear-gradient(180deg, #f4d8bb, #ecc9a4); clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%); }
.env-flap { left: 0; right: 0; top: 0; height: 82px; z-index: 4; transform-origin: 50% 0; background: linear-gradient(180deg, #efcfaa, #e3b88c); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.env-wax { position: absolute; left: 50%; top: 54%; z-index: 5; transform: translate(-50%, -50%); font-size: 26px; text-shadow: 0 2px 6px rgba(120, 30, 40, .35); }
.env-stage .env-flap { animation: envFlap .9s .25s cubic-bezier(.5, 0, .3, 1) both; }
.env-stage .env-wax { animation: envWax .4s .1s ease both; }
.env-stage { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; background: radial-gradient(120% 60% at 50% 30%, color-mix(in srgb, #ffb36b 20%, var(--bg)) 0%, var(--bg) 75%); transition: opacity .4s ease; }
.env-stage small { color: var(--muted); font: 600 14px var(--sans); animation: lrIn .6s .3s both; }
.env-stage .env { transform: scale(1.25); animation: envIn .5s var(--spring) both; }
.env-stage.out { opacity: 0; pointer-events: none; }
.cpchip i { filter: drop-shadow(0 2px 4px rgba(200, 80, 60, .3)); }
.cpchip { background: color-mix(in srgb, #ffb36b 22%, var(--glass-bg)); }
@keyframes envFlap { 0% { transform: rotateX(0); z-index: 4; } 49% { z-index: 4; } 50% { z-index: 1; } 100% { transform: rotateX(178deg); z-index: 1; } }
@keyframes envPaper { from { transform: translateY(0); } to { transform: translateY(-62px); } }
@keyframes envWax { to { opacity: 0; transform: translate(-50%, -50%) scale(.4); } }
@keyframes envIn { from { opacity: 0; transform: scale(.85) translateY(18px); } }
@keyframes lrIn { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-color-scheme: dark) {
  .page.letters, .page.lcompose, .page.lread, .env-stage { background: radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, #ff9a4d 12%, var(--bg)) 0%, var(--bg) 70%); }
  .lr-paper { color: #f1e6d4; background: linear-gradient(160deg, rgba(70, 58, 46, .78), rgba(46, 38, 30, .72)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 0 0 .5px rgba(255, 225, 180, .14), 0 10px 30px rgba(0, 0, 0, .4); }
  .lr-from, .lr-paper footer { color: #bfa88a; } .lr-paper footer { border-top-color: rgba(255, 225, 180, .2); }
  .lr-photos button { background: rgba(255, 255, 255, .08); }
}
@media (prefers-reduced-motion: reduce) {
  .env-stage { display: none; }
  .lr-paper, .env-paper, .env-flap, .env-wax, .env-stage small { animation: none !important; }
}
.page.letters .hint { text-align: center; padding: 28px 12px; }

/* ---- v27: play (couple games) */
.us-tools { display: flex; gap: 6px; flex: none; }
.us-tools .us-cardsb { position: relative; min-width: 40px; padding: 0 12px; }
.us-tools .us-cardsb .t { display: none; }
@media (min-width: 480px) { .us-tools .us-cardsb .t { display: inline; } }
.pg-dot { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: #fff; font: 700 11px/18px var(--sans); text-align: center; box-sizing: border-box; }
.pg-dot[hidden] { display: none; }
.sheet-bg.pgz { z-index: 70; }
.page.play { z-index: 58; display: flex; flex-direction: column; background: radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--accent) 14%, var(--bg)) 0%, var(--bg) 70%); }
.page.play .kc-top .icon[hidden] { display: none; }
.pg-body { gap: 14px; }
.pg-pig { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 18px; background: var(--glass-bg); box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line); font-size: 14px; }
.pg-pig i { font-style: normal; font-size: 24px; }
.pg-pig span { flex: 1; min-width: 0; }
.pg-pig small { color: var(--muted); font-weight: 600; }
.pg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pg-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 132px; padding: 14px; text-align: left; border: 0; border-radius: 22px; color: var(--ink); background: var(--glass-bg); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line), var(--glass-shadow); transition: transform .15s ease; }
.pg-card:active { transform: scale(.97); }
.pg-card > i { font-style: normal; font-size: 30px; }
.pg-card b { font: 700 15px/1.2 var(--sans); }
.pg-card small { color: var(--muted); font-size: 12.5px; line-height: 1.3; flex: 1; }
.pg-card em { font-style: normal; font: 700 12px var(--sans); padding: 4px 10px; border-radius: 999px; background: var(--field); color: var(--muted); }
.pg-card em.turn { background: var(--accent); color: #fff; }
.pg-card.mine { box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 1.5px var(--accent), var(--glass-shadow); }
.pg-h { margin: 6px 4px 0; font: 700 13px var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pg-recs { display: flex; flex-direction: column; gap: 8px; }
.pg-rec { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; border: 0; border-radius: 18px; color: var(--ink); text-align: left; background: var(--glass-bg); box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line); }
.pg-rec > i { font-style: normal; font-size: 22px; }
.pg-rec span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pg-rec b { font: 600 14px var(--sans); }
.pg-rec small, .pg-rec em { color: var(--muted); font-size: 12.5px; font-style: normal; }
.pg-btn, .pg-ghost { border: 0; min-height: 48px; padding: 0 22px; border-radius: 999px; font: 700 15px var(--sans); cursor: pointer; }
.pg-btn { background: var(--accent); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.pg-btn.alt { background: color-mix(in srgb, var(--accent) 80%, #6a5cff); }
.pg-btn.danger { background: #e5484d; }
.pg-btn:disabled { opacity: .45; box-shadow: none; }
.pg-ghost { background: var(--glass-bg); color: var(--ink); box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line); }
.sheet .pg-btn, .sheet .pg-ghost { width: 100%; margin-top: 10px; }
.pg-act { display: flex; flex-direction: column; gap: 8px; }
.pg-stat { margin: 0; text-align: center; font: 600 15px var(--sans); min-height: 22px; }
.pg-hint { margin: 0; text-align: center; color: var(--muted); font-size: 12.5px; }
.pg-score { display: flex; justify-content: center; gap: 8px; }
.pg-score span { padding: 6px 12px; border-radius: 999px; background: var(--glass-bg); box-shadow: 0 0 0 .5px var(--glass-line); font-size: 13px; color: var(--muted); }
.pg-score b { color: var(--ink); margin-left: 4px; }
.pg-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: min(100%, 340px); margin: 0 auto; }
.pg-cell { aspect-ratio: 1; border: 0; border-radius: 20px; font-size: clamp(34px, 12vw, 52px); color: var(--ink); background: var(--glass-bg); box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line); display: flex; align-items: center; justify-content: center; padding: 0; }
.pg-cell:not(:empty) { animation: pgPop .25s ease both; }
.pg-cell:disabled { opacity: 1; }
.pg-cell:not(:disabled):active { transform: scale(.94); }
.pg-cell.last { box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 2px color-mix(in srgb, var(--accent) 60%, transparent); }
.pg-cell.win { background: color-mix(in srgb, var(--accent) 28%, var(--glass-bg)); box-shadow: 0 0 0 2px var(--accent); }
@keyframes pgPop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.pg-res { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px; border-radius: 20px; text-align: center; background: color-mix(in srgb, var(--accent) 14%, var(--glass-bg)); box-shadow: 0 0 0 .5px var(--glass-line); }
.pg-res b { font: 700 19px var(--sans); }
.pg-res span, .pg-coin { color: var(--muted); font-size: 13px; }
.pg-prog { height: 6px; border-radius: 3px; background: var(--field); overflow: hidden; }
.pg-prog i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s ease; }
.pg-q { font: 700 22px/1.25 var(--sans); text-align: center; padding: 14px 6px 4px; }
.pg-opts { display: flex; gap: 10px; }
.pg-opts.col { flex-direction: column; }
.pg-opts > * { flex: 1; }
.pg-opt { min-height: 64px; padding: 10px 14px; border: 0; border-radius: 20px; font: 600 16px/1.25 var(--sans); color: var(--ink); background: var(--glass-bg); box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 .5px var(--glass-line), var(--glass-shadow); }
.pg-opt:active, .pg-opt.on { background: color-mix(in srgb, var(--accent) 30%, var(--glass-bg)); }
.pg-wait { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px; text-align: center; color: var(--muted); }
.pg-wait i { font-style: normal; font-size: 38px; }
.pg-wait b { color: var(--ink); font-size: 17px; }
.pg-rs { display: flex; flex-direction: column; gap: 8px; }
.pg-r { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 16px; background: var(--glass-bg); box-shadow: 0 0 0 .5px var(--glass-line); font-size: 13.5px; }
.pg-r b { font-size: 14px; }
.pg-r span { color: var(--muted); }
.pg-r.same { background: color-mix(in srgb, var(--accent) 12%, var(--glass-bg)); }
.pg-r i { position: absolute; top: 8px; right: 12px; font-style: normal; }
.pg-qb { display: flex; flex-direction: column; gap: 6px; padding: 10px; margin-top: 10px; border-radius: 16px; background: var(--field); }
.pg-qh { display: flex; align-items: center; justify-content: space-between; }
.pg-mini { border: 0; min-height: 32px; padding: 0 12px; border-radius: 999px; font: 600 12.5px var(--sans); color: var(--ink); background: var(--glass-bg); }
.pg-qb input, .pg-field, .pg-in input { width: 100%; box-sizing: border-box; min-height: 44px; font: 16px var(--sans); padding: 0 14px; border-radius: 14px; border: 0; background: var(--field); color: var(--ink); }
.pg-qb input { background: var(--bg); }
.pg-pickl { display: flex; flex-direction: column; gap: 6px; }
.pg-pickl button { border: 0; min-height: 44px; padding: 8px 12px; border-radius: 12px; text-align: left; font: 14px var(--sans); color: var(--ink); background: var(--field); }
.pg-secret { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-radius: 16px; background: var(--glass-bg); box-shadow: 0 0 0 .5px var(--glass-line); font-size: 14px; }
.pg-secret small { color: var(--muted); font-weight: 600; flex: none; }
.pg-log { display: flex; flex-direction: column; gap: 6px; max-height: 38dvh; overflow-y: auto; }
.pg-b { max-width: 82%; padding: 8px 12px; border-radius: 16px; font-size: 14.5px; }
.pg-b.q { align-self: flex-start; background: var(--glass-bg); box-shadow: 0 0 0 .5px var(--glass-line); }
.pg-b.a { align-self: flex-end; background: var(--accent); color: #fff; }
.pg-wr { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--muted); align-items: center; }
.pg-wr span { padding: 4px 10px; border-radius: 999px; background: var(--field); color: var(--ink); }
.pg-in { display: flex; gap: 8px; }
.pg-in input { flex: 1; min-width: 0; }
.pg-in .pg-btn { padding: 0 16px; flex: none; }
.pg-cvw { width: 100%; max-width: 440px; aspect-ratio: 1; margin: 0 auto; border-radius: 22px; background: #fffdf8; box-shadow: inset 0 0 0 .5px var(--glass-line), var(--glass-shadow); overflow: hidden; flex: none; }
.pg-cvw canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.pg-cvw canvas.can { cursor: crosshair; }
.pg-tools { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }
.pg-sw, .pg-sz { display: flex; gap: 6px; padding: 4px; border-radius: 999px; background: var(--glass-bg); box-shadow: 0 0 0 .5px var(--glass-line); }
.pg-sw button, .pg-sz button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; display: flex; align-items: center; justify-content: center; font-size: 18px; padding: 0; }
.pg-sw button[style] { background: radial-gradient(circle, var(--c) 0 11px, transparent 12px); }
.pg-sw button.on, .pg-sz button.on { box-shadow: 0 0 0 2px var(--accent); }
.pg-sz i { display: block; width: var(--s); height: var(--s); border-radius: 50%; background: var(--ink); }
@media (prefers-reduced-motion: reduce) {
  .pg-cell, .pg-card, .pg-prog i { animation: none !important; transition: none !important; }
}
