:root {
  --bg: #F1EFF8;
  --surface: #FFFFFF;
  --surface-2: #E7E4F2;
  --ink: #221D3B;
  --muted: #6C6689;
  --line: #DCD8EA;
  --good: #12A06B;
  --bad: #D93A48;
  --shadow: rgba(34, 29, 59, .12);
  --a: #3B5BFD;
  --b: #F2508E;
  --me: var(--a);
  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 10px;
  --tabbar: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16132B; --surface: #201C3A; --surface-2: #2B2650; --ink: #F1EEFB; --muted: #A49EC2;
    --line: #342E5A; --shadow: rgba(0, 0, 0, .35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16132B; --surface: #201C3A; --surface-2: #2B2650; --ink: #F1EEFB; --muted: #A49EC2;
  --line: #342E5A; --shadow: rgba(0, 0, 0, .35); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Bricolage Grotesque", system-ui, sans-serif; font-size: 16px; line-height: 1.45;
  font-optical-sizing: auto; -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--me); outline-offset: 2px; border-radius: 6px; }

/* ---------- shell */
.view {
  max-width: 560px; margin: 0 auto;
  padding: calc(var(--safe-t) + 16px) 16px calc(var(--tabbar) + var(--safe-b) + 28px);
}
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 500;
  display: flex; justify-content: center; gap: 2px;
  height: calc(var(--tabbar) + var(--safe-b)); padding: 6px 8px var(--safe-b);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; max-width: 100px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  text-decoration: none; font-size: 12px; font-weight: 600; color: var(--muted); border-radius: var(--r-md);
}
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--ink); }
.tabbar a[aria-current="page"] svg { color: var(--me); }

h1 { font-size: 30px; line-height: 1.1; font-weight: 750; letter-spacing: -.02em; margin: 6px 0 18px; }
h2 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; margin: 28px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; padding: 4px 0; }

.card { background: var(--surface); border-radius: var(--r-lg); padding: 16px; }
.card + .card { margin-top: 12px; }
.stack > * + * { margin-top: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 0;
  background: var(--ink); color: var(--bg); font-weight: 650; font-size: 15px; text-decoration: none;
}
.btn.me { background: var(--me); color: #fff; }
.btn.soft { background: var(--surface-2); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.danger { background: transparent; color: var(--bad); border: 1.5px solid color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface-2); display: grid; place-items: center; font-size: 18px; flex: none; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input, textarea.input, select.input {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--r-md);
  border: 1.5px solid var(--line); background: var(--surface); outline: none; font-size: 16px;
}
.input:focus { border-color: var(--me); }
textarea.input { resize: vertical; min-height: 96px; }

/* ---------- people */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.avatar {
  --size: 44px; width: var(--size); height: var(--size); border-radius: 50%; flex: none;
  background: color-mix(in srgb, var(--c) 18%, var(--surface)); box-shadow: inset 0 0 0 2.5px var(--c);
  display: grid; place-items: center; font-size: calc(var(--size) * .5); position: relative;
}
.avatar .badge {
  position: absolute; right: -4px; bottom: -4px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); display: grid; place-items: center; font-size: 14px; box-shadow: 0 0 0 2px var(--bg);
}
.who { font-weight: 650; color: var(--c); }

/* ---------- home */
.couple { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin: 4px 0 6px; }
.couple .avatar { --size: 58px; }
.together { text-align: center; }
.together b { display: block; font-size: 44px; line-height: 1; font-weight: 800; letter-spacing: -.035em; font-variation-settings: "opsz" 96; }
.together span { font-size: 14px; color: var(--muted); }
.together button { background: none; border: 0; padding: 4px 8px; color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

.stage {
  position: relative; display: grid; grid-template-columns: 132px 1fr; gap: 14px; align-items: center;
  background: var(--surface); border-radius: var(--r-lg); padding: 12px 16px 12px 8px; margin-top: 16px; text-decoration: none;
}
.stage .pet { width: 132px; height: 132px; display: block; }
.stage .name { font-size: 22px; font-weight: 750; letter-spacing: -.01em; line-height: 1.15; }
.meters { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; margin-top: 8px; font-size: 13px; color: var(--muted); }
.meter { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--mc, var(--good)); transition: width .5s; }
.meter.low i { --mc: var(--bad); }

.pings { display: flex; gap: 8px; overflow-x: auto; margin: 12px -16px 0; padding: 2px 16px 6px; scrollbar-width: none; }
.pings::-webkit-scrollbar { display: none; }
.ping {
  flex: none; display: flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 14px 0 10px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14.5px; white-space: nowrap;
}
.ping span { font-size: 20px; }
.ping:active { transform: scale(.96); }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.tile { background: var(--surface); border-radius: var(--r-lg); padding: 14px; text-decoration: none; display: block; min-width: 0; border: 0; text-align: left; width: 100%; }
.tile .big { font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.tile .label { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.tile.wide { grid-column: 1 / -1; }

.mood-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mood-pick button {
  border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r-md); padding: 10px 4px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; color: var(--muted);
}
.mood-pick button span { font-size: 26px; }
.mood-pick button[aria-pressed="true"] { border-color: var(--me); color: var(--ink); background: color-mix(in srgb, var(--me) 10%, var(--surface)); }
.moodline { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.moodline + .moodline { border-top: 1px solid var(--line); }
.moodline .em { font-size: 26px; width: 34px; text-align: center; }

/* ---------- activity feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: baseline; padding: 9px 0; font-size: 15px; }
.feed li + li { border-top: 1px solid var(--line); }
.feed li .dot { transform: translateY(-1px); }
.feed time { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

/* ---------- lists */
.lists { list-style: none; margin: 0; padding: 0; }
.lists a {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border-radius: var(--r-lg);
  text-decoration: none; margin-bottom: 10px;
}
.lists .em { font-size: 26px; width: 34px; text-align: center; }
.lists .t { font-weight: 700; font-size: 17px; }
.lists .count { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.progress { height: 4px; border-radius: 9px; background: var(--surface-2); margin-top: 6px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--good); }

.adder { display: flex; gap: 8px; position: sticky; top: calc(var(--safe-t) + 8px); z-index: 5; margin-bottom: 14px; }
.adder textarea { min-height: 50px; height: 50px; resize: none; padding-top: 13px; border-radius: 16px; box-shadow: 0 4px 18px var(--shadow); }
.adder .btn { min-height: 50px; width: 50px; padding: 0; border-radius: 16px; font-size: 24px; flex: none; }

.items { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--r-lg); overflow: hidden; }
.items:empty { display: none; }
.item { display: flex; align-items: center; gap: 4px; padding: 0 6px 0 4px; min-height: 54px; }
.item + .item { border-top: 1px solid var(--line); }
.check {
  width: 48px; height: 48px; flex: none; border: 0; background: none; display: grid; place-items: center; padding: 0;
}
.check i {
  width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center;
  transition: background .15s, border-color .15s, transform .15s;
}
.item.done .check i { background: var(--c); border-color: var(--c); }
.check i svg { width: 16px; height: 16px; color: #fff; opacity: 0; }
.item.done .check i svg { opacity: 1; }
.check:active i { transform: scale(.88); }
.item .txt { flex: 1; min-width: 0; padding: 8px 0; background: none; border: 0; text-align: left; overflow-wrap: anywhere; }
.item .txt small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.item.done .txt > span { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--muted); }
.donehead { display: flex; align-items: center; justify-content: space-between; margin: 22px 4px 8px; font-weight: 700; color: var(--muted); font-size: 15px; }
.donehead button { background: none; border: 0; color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; padding: 6px; }

.empty { text-align: center; color: var(--muted); padding: 36px 16px; }
.empty .em { font-size: 40px; display: block; margin-bottom: 6px; }

/* ---------- sheet */
.scrim { position: fixed; inset: 0; background: rgba(15, 12, 30, .45); z-index: 900; animation: fade .18s; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 901; max-height: 88vh; overflow: auto;
  max-width: 560px; margin: 0 auto; background: var(--bg); border-radius: 26px 26px 0 0;
  padding: 10px 18px calc(20px + var(--safe-b)); animation: up .22s cubic-bezier(.2, .9, .3, 1);
}
.sheet::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 12px; }
.sheet h3 { font-size: 21px; margin: 4px 0 14px; letter-spacing: -.01em; }
.sheet .actions { display: flex; gap: 10px; margin-top: 16px; }
.sheet .actions .btn { flex: 1; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar) + var(--safe-b) + 14px); transform: translateX(-50%); z-index: 1000;
  background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-weight: 600; font-size: 14.5px;
  box-shadow: 0 8px 30px var(--shadow); max-width: calc(100vw - 32px); animation: up .2s;
}

/* incoming ping */
.incoming { position: fixed; inset: 0; z-index: 950; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 30%, rgba(15, 12, 30, .55)); animation: fade .2s; padding: 24px; }
.incoming .box { background: var(--surface); border-radius: 28px; padding: 28px 24px 20px; text-align: center; max-width: 340px; width: 100%; }
.incoming .em { font-size: 76px; line-height: 1; display: block; animation: beat 1s ease-in-out infinite; }
.incoming p { font-size: 21px; font-weight: 700; margin: 14px 0 4px; letter-spacing: -.01em; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(1); } 45% { transform: scale(1.12); } }

/* ---------- map */
.mapview { position: fixed; inset: 0; bottom: calc(var(--tabbar) + var(--safe-b)); }
#map { position: absolute; inset: 0; background: var(--surface-2); }
.mappanel {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 400; max-width: 536px; margin: 0 auto;
  background: var(--surface); border-radius: var(--r-lg); padding: 12px 14px; box-shadow: 0 10px 40px var(--shadow);
}
.person { display: flex; align-items: center; gap: 12px; padding: 6px 0; width: 100%; background: none; border: 0; text-align: left; }
.person + .person { border-top: 1px solid var(--line); }
.person .avatar { --size: 40px; }
.person b { display: block; font-size: 16px; }
.person .meta { font-size: 13px; color: var(--muted); }
.distance { font-size: 15px; font-weight: 700; text-align: center; padding: 2px 0 8px; }
.mapbtns { display: flex; gap: 8px; margin-top: 10px; }
.mapbtns .btn { flex: 1; min-height: 42px; padding: 0 10px; font-size: 14px; }
.pin {
  width: 44px; height: 44px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg);
  background: var(--c); display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.3); border: 3px solid #fff;
}
.pin span { transform: rotate(45deg); font-size: 21px; }
.leaflet-div-icon { background: none; border: 0; }
.leaflet-container { font-family: inherit; }

/* ---------- pet page */
.petstage {
  position: relative; display: grid; place-items: center; margin: 0 -16px; padding: 8px 0 0;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--pc) 22%, transparent), transparent 75%);
}
.petstage .pet { width: min(260px, 70vw); height: auto; display: block; touch-action: manipulation; cursor: pointer; }
.petname { text-align: center; }
.petname b { font-size: 30px; font-weight: 800; letter-spacing: -.025em; display: block; line-height: 1.1; }
.petname span { color: var(--muted); }
.xp { max-width: 260px; margin: 10px auto 0; font-size: 13px; color: var(--muted); text-align: center; }
.xp .meter { margin-top: 4px; }
.xp .meter i { --mc: var(--me); }
.petmeters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-top: 18px; }
.petmeters div { font-size: 14px; font-weight: 600; }
.petmeters .meter { margin-top: 5px; height: 10px; }
.petactions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 18px; }
.petactions button {
  border: 0; background: var(--surface); border-radius: var(--r-md); padding: 10px 2px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 3px; font-weight: 650; font-size: 13px;
}
.petactions button span { font-size: 28px; line-height: 1.1; }
.petactions button:active { transform: scale(.94); }
.petactions button:disabled { opacity: .4; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatches button { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--line); background: var(--sw); }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ink); }
.species { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.species button { border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r-md); padding: 4px; }
.species button[aria-pressed="true"] { border-color: var(--me); box-shadow: 0 0 0 1.5px var(--me); }
.species svg { width: 100%; height: auto; display: block; }

.particle { position: fixed; pointer-events: none; z-index: 960; font-size: 28px; animation: floatup 1.3s ease-out forwards; }
@keyframes floatup { to { transform: translate(var(--dx), -140px) scale(1.3); opacity: 0; } }

.pet .pet-body-g { transform-origin: 100px 184px; animation: breathe 3.2s ease-in-out infinite; }
.pet-sleep .pet-body-g { animation-duration: 5s; }
.pet .pet-eyes { transform-origin: 100px 112px; animation: blink 5s infinite; }
.pet-z text { animation: zfloat 3s ease-in-out infinite; }
.pet-z text:nth-child(2) { animation-delay: .5s; }
.pet-z text:nth-child(3) { animation-delay: 1s; }
.pet.hop .pet-body-g { animation: hop .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes breathe { 50% { transform: scale(1.025, .975); } }
@keyframes blink { 0%, 95%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
@keyframes zfloat { 50% { transform: translateY(-4px); opacity: .5; } }
@keyframes hop { 0% { transform: scale(1.1, .88); } 40% { transform: translateY(-26px) scale(.94, 1.06); } 70% { transform: scale(1.06, .94); } 100% { transform: none; } }

/* ---------- notes */
.notes { columns: 2; column-gap: 12px; }
.note {
  break-inside: avoid; margin-bottom: 12px; padding: 14px 14px 10px; border-radius: 18px 18px 18px 6px;
  background: color-mix(in srgb, var(--c) 14%, var(--surface)); border: 1.5px solid color-mix(in srgb, var(--c) 30%, transparent);
  white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15.5px;
}
.note footer { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; color: var(--muted); white-space: normal; }
.note footer button { background: none; border: 0; padding: 4px; font-size: 15px; margin-left: auto; color: var(--muted); }
.note footer button + button { margin-left: 0; }
.note.pinned { box-shadow: 0 0 0 2px var(--c); }

/* ---------- countdowns */
.cd { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border-radius: var(--r-lg); margin-bottom: 10px; }
.cd .em { font-size: 30px; }
.cd .n { text-align: right; line-height: 1; }
.cd .n b { font-size: 30px; font-weight: 800; letter-spacing: -.03em; display: block; }
.cd .n span { font-size: 12.5px; color: var(--muted); }
.cd.today { box-shadow: 0 0 0 2.5px var(--me); }

/* ---------- jar */
.jar {
  background: var(--surface); border-radius: var(--r-lg); padding: 22px 18px; text-align: center;
}
.jar .pick { font-size: 22px; font-weight: 750; letter-spacing: -.01em; min-height: 62px; display: grid; place-items: center; margin: 4px 0 14px; }
.jar .pick.shuffle { animation: shake .45s; }
@keyframes shake { 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }

.menu { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--r-lg); overflow: hidden; }
.menu a, .menu button { display: flex; align-items: center; gap: 14px; padding: 15px 16px; text-decoration: none; width: 100%; border: 0; background: none; text-align: left; font-size: 16px; }
.menu li + li { border-top: 1px solid var(--line); }
.menu .em { font-size: 22px; width: 28px; text-align: center; }
.menu .sub { margin-left: auto; color: var(--muted); font-size: 14px; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login form { width: 100%; max-width: 360px; }
.login .mark { width: 88px; height: 88px; margin: 0 auto 10px; display: block; }
.login h1 { text-align: center; margin-bottom: 4px; }
.login p { text-align: center; color: var(--muted); margin: 0 0 24px; }
.err { color: var(--bad); font-weight: 600; font-size: 14.5px; margin: -4px 0 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* =================================================================== batch 2 */
.tabbar a { position: relative; }
.tabbar a.has-badge::after { content: ""; position: absolute; top: 6px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--surface); }
.linkish { background: none; border: 0; padding: 6px 0; color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

/* segmented control */
.seg { display: flex; gap: 4px; background: var(--surface-2); border-radius: 999px; padding: 4px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 999px; min-height: 36px; padding: 0 12px; font-weight: 650; font-size: 14px; color: var(--muted); white-space: nowrap; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px var(--shadow); }
.seg.scroll { overflow-x: auto; scrollbar-width: none; }
.seg.scroll::-webkit-scrollbar { display: none; }
.mappanel .seg { margin-bottom: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 11px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.chip[aria-pressed="true"] { border-color: var(--me); color: var(--ink); background: color-mix(in srgb, var(--me) 12%, var(--surface)); }
.chip.static { padding: 3px 9px; font-size: 12.5px; display: inline-block; }
.chips.small { margin-top: 4px; gap: 4px; }

/* home: moment + question cards */
.moment-cta {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 16px; padding: 14px; border: 0; text-align: left;
  border-radius: var(--r-lg); text-decoration: none; color: var(--ink);
  background: color-mix(in srgb, var(--c, var(--me)) 14%, var(--surface)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c, var(--me)) 45%, transparent);
}
.moment-cta .btn { min-height: 38px; padding: 0 16px; pointer-events: none; }
.ring { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; flex: none;
  background: var(--surface); box-shadow: 0 0 0 3px var(--c, var(--me)); }
.qcard { display: block; margin-top: 12px; padding: 14px 16px; background: var(--surface); border-radius: var(--r-lg); text-decoration: none; }
.q { font-size: 20px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; margin: 4px 0 8px; }
.small-q { font-size: 16.5px; }
.art { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface-2); display: grid; place-items: center; font-size: 22px; }
.art.sm { width: 40px; height: 40px; border-radius: 8px; font-size: 18px; }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; vertical-align: middle; }
.eq i { width: 3px; background: var(--c, var(--good)); border-radius: 2px; animation: eq 1s ease-in-out infinite; height: 40%; }
.eq i:nth-child(2) { animation-delay: .25s; } .eq i:nth-child(3) { animation-delay: .5s; }
@keyframes eq { 50% { height: 100%; } }

/* moments */
.moment-today { display: flex; gap: 12px; align-items: center; }
.snapbtns { margin-top: 14px; }
.snapbtns .btn { min-height: 54px; font-size: 16px; }
.snap-in { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border: 0; text-align: left; background: var(--surface); border-radius: var(--r-lg); margin-bottom: 10px; box-shadow: inset 0 0 0 2px var(--c); }

.camera { position: fixed; inset: 0; z-index: 980; background: #000; color: #fff; }
.camera video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.camera video.mirror { transform: scaleX(-1); }
.cam-top { position: absolute; top: calc(var(--safe-t) + 12px); left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; }
.cam-x { width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(0,0,0,.45); color: #fff; font-size: 18px; flex: none; }
.cam-pill { border: 0; border-radius: 999px; padding: 10px 16px; background: rgba(0,0,0,.45); color: #fff; font-weight: 650; font-size: 14px; }
.cam-pill[aria-pressed="true"] { background: #fff; color: #111; }
.cam-bottom { position: absolute; left: 0; right: 0; bottom: calc(var(--safe-b) + 26px); display: flex; justify-content: space-around; align-items: center; }
.shutter { width: 78px; height: 78px; border-radius: 50%; border: 5px solid #fff; background: rgba(255,255,255,.25); }
.shutter:active { background: #fff; transform: scale(.94); }
.cam-round { width: 54px; height: 54px; border-radius: 50%; border: 0; background: rgba(0,0,0,.45); color: #fff; font-size: 20px; font-weight: 800; }
.cam-send:not(:disabled) { background: var(--me); }
.cam-send:disabled { opacity: .4; }
.cam-strip { position: absolute; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 122px); display: flex; gap: 8px; overflow-x: auto; }
.thumb { position: relative; flex: none; }
.thumb img { width: 58px; height: 76px; object-fit: cover; border-radius: 10px; border: 2px solid #fff; display: block; }
.thumb button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: #111; color: #fff; font-size: 11px; }
.flash { position: absolute; inset: 0; background: #fff; animation: flash .3s forwards; pointer-events: none; }
@keyframes flash { to { opacity: 0; } }
.compose-grid { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px; }
.compose-grid img { height: 160px; border-radius: 12px; flex: none; }

.viewer { position: fixed; inset: 0; z-index: 985; background: #000; color: #fff; display: grid; place-items: center; }
.viewer > img { max-width: 100%; max-height: 100%; object-fit: contain; }
.v-loading { color: #ccc; font-weight: 600; }
.v-bars { position: absolute; top: calc(var(--safe-t) + 8px); left: 10px; right: 10px; display: flex; gap: 4px; z-index: 2; }
.v-bars i { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.35); }
.v-bars i.on { background: #fff; }
.v-head { position: absolute; top: calc(var(--safe-t) + 20px); left: 12px; right: 12px; display: flex; align-items: center; gap: 10px; z-index: 2; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.v-nav { position: absolute; top: 90px; bottom: 90px; width: 40%; border: 0; background: none; z-index: 1; }
.v-nav.prev { left: 0; } .v-nav.next { right: 0; width: 60%; }
.v-cap { position: absolute; left: 16px; right: 16px; bottom: calc(var(--safe-b) + 54px); text-align: center; font-size: 18px; font-weight: 650; text-shadow: 0 1px 6px rgba(0,0,0,.8); }
.v-hint { position: absolute; bottom: calc(var(--safe-b) + 18px); left: 0; right: 0; text-align: center; font-size: 13px; color: rgba(255,255,255,.7); }

/* places */
.spot { width: 38px; height: 38px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 0 0 3px var(--c), 0 3px 10px rgba(0,0,0,.3); position: relative; }
.spot span { font-size: 19px; }
.spot.want { background: rgba(255,255,255,.85); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--c), 0 3px 10px rgba(0,0,0,.3); opacity: .85; }
.spot b { position: absolute; right: -6px; top: -6px; min-width: 18px; height: 18px; border-radius: 9px; background: #222; color: #fff; font-size: 11px; display: grid; place-items: center; padding: 0 4px; }
.place-stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; padding: 4px 0; }
.place-stats b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.place-stats span { font-size: 12.5px; color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.badge-pill { background: var(--surface-2); border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 650; }
.badge-pill.good { background: color-mix(in srgb, var(--good) 16%, var(--surface)); color: var(--good); }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 14px; }
.photo-grid button { padding: 0; border: 0; background: var(--surface-2); border-radius: 10px; overflow: hidden; aspect-ratio: 1; position: relative; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv { position: absolute; right: 4px; bottom: 4px; font-size: 14px; background: #fff; border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; }
.lightbox { position: fixed; inset: 0; z-index: 990; background: rgba(0,0,0,.92); display: grid; place-items: center; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; pointer-events: none; }
.lightbox .cam-x { position: absolute; top: calc(var(--safe-t) + 12px); right: 12px; pointer-events: none; }
.sheet .actions .btn input { display: none; }
.sheet label.btn { cursor: pointer; }

/* questions */
.qtoday .q { font-size: 23px; margin-bottom: 14px; }
.answer { background: color-mix(in srgb, var(--c) 12%, var(--surface)); border-radius: 16px 16px 16px 5px; padding: 10px 14px; margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.answer.pending { --c: var(--line); color: var(--muted); font-style: italic; }
.qpast { margin-top: 10px; }

/* mood log */
.mood-list { list-style: none; margin: 0; padding: 4px 16px; }
.mood-entry { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; }
.mood-entry + .mood-entry { border-top: 1px solid var(--line); }
.mood-entry .em { font-size: 24px; line-height: 1.2; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; }
.cal > b { font-size: 12px; color: var(--muted); font-weight: 650; }
.cal-day { position: relative; aspect-ratio: 1; border: 0; padding: 0; border-radius: 10px; background: var(--surface-2); overflow: hidden; display: flex; }
.cal-day i { flex: 1; opacity: .9; }
.cal-day span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--ink); text-shadow: 0 0 3px var(--surface); }
.cal-day.today { box-shadow: 0 0 0 2px var(--ink); }
.cal-day:disabled { opacity: .35; }
.score { min-width: 40px; text-align: center; padding: 3px 8px; border-radius: 999px; color: #fff; font-weight: 800; font-size: 14px; }

/* wardrobe */
.wd-preview { width: min(240px, 64vw); margin: 4px auto 0; }
.wd-preview svg { width: 100%; height: auto; display: block; }
.wd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wd-item { border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r-md); padding: 6px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px; font-weight: 650; position: relative; }
.wd-item svg { width: 100%; height: auto; }
.wd-item[aria-pressed="true"] { border-color: var(--me); box-shadow: 0 0 0 1.5px var(--me); }
.wd-item:disabled { opacity: .55; }
.wd-item em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.custom-color { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#f55, #fc4, #5c5, #4cf, #a5f, #f55); box-shadow: 0 0 0 1.5px var(--line); position: relative; cursor: pointer; font-size: 16px; }
.custom-color input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.pet .pet-halo { animation: halo 3s ease-in-out infinite; }
@keyframes halo { 50% { transform: translateY(-3px); } }
.stage .pet.has-room, .petstage .pet.has-room { border-radius: 22px; }

/* music */
.np-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.np { background: var(--surface); border-radius: var(--r-lg); padding: 14px; text-decoration: none; display: flex; flex-direction: column; gap: 2px; min-width: 0; box-shadow: inset 0 0 0 2px transparent; }
.np.live { box-shadow: inset 0 0 0 2px var(--c); }
.np .art { width: 100%; height: auto; aspect-ratio: 1; border-radius: 12px; margin-bottom: 8px; font-size: 40px; }
.np .who { font-size: 13px; }
.np-t { font-size: 16px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.music-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; text-align: center; }
.music-stats div { background: var(--surface); border-radius: var(--r-md); padding: 10px 6px; min-width: 0; }
.music-stats b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.music-stats span { font-size: 12px; color: var(--muted); }
.toplist { list-style: none; margin: 0; padding: 4px 14px; }
.toplist li { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.toplist li + li { border-top: 1px solid var(--line); }
.toplist a { text-decoration: none; }
.toplist .rank { width: 20px; text-align: right; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.toplist .n { font-weight: 800; font-variant-numeric: tabular-nums; }
.toplist .bar { height: 4px; background: var(--surface-2); border-radius: 4px; margin-top: 5px; overflow: hidden; }
.toplist .bar i { display: block; height: 100%; background: var(--me); border-radius: inherit; }
.artist-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.artist-chips .chip { font-size: 14px; padding: 6px 12px; }
.steps { padding-left: 20px; margin: 0 0 16px; }
.steps li { margin-bottom: 8px; }
.card.warn { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--bad) 50%, transparent); }
code { font-size: .92em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }

/* =================================================================== batch 3: pet life + rarity */
.pet .pet-gray { filter: grayscale(.75) brightness(.95); }
.pet .pet-eyes { transform: translateX(var(--look, 0)); transition: transform .4s; animation: none; }
.pet .pet-eyes ellipse { animation: blink 5s infinite; transform-box: fill-box; transform-origin: center; }
.pet-cloud { animation: cloud 4s ease-in-out infinite; }
.pet-cloud .drop { animation: rain 1.1s linear infinite; }
.pet-cloud .d2 { animation-delay: .35s; } .pet-cloud .d3 { animation-delay: .7s; }
@keyframes cloud { 50% { transform: translateX(6px); } }
@keyframes rain { from { transform: translateY(-4px); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(14px); opacity: 0; } }
.pet-sparkles path, .pet-legend path { transform-box: fill-box; transform-origin: center; animation: twinkle 1.8s ease-in-out infinite; }
.pet-sparkles .sp2 { animation-delay: .6s; } .pet-sparkles .sp3 { animation-delay: 1.2s; }
@keyframes twinkle { 0%, 100% { transform: scale(.3); opacity: 0; } 50% { transform: scale(1); opacity: 1; } }
.pet-sweat { animation: sweat 2s ease-in infinite; }
@keyframes sweat { 0% { transform: translateY(0); opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(12px); opacity: 0; } }
.pet.giggle .pet-body-g { animation: giggle .5s; }
@keyframes giggle { 25% { transform: rotate(-6deg); } 50% { transform: rotate(5deg); } 75% { transform: rotate(-3deg); } }
.pet-wander { transition: transform 1.6s cubic-bezier(.45, .05, .35, 1); }
.petstage { padding-top: 54px; }
.bubble {
  position: absolute; top: 4px; left: 50%; transform: translateX(-50%); max-width: 84%; z-index: 2;
  background: var(--surface); color: var(--ink); border-radius: 18px; padding: 8px 14px; font-weight: 650; font-size: 15px;
  box-shadow: 0 4px 16px var(--shadow); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -7px; margin-left: -7px; border: 7px solid transparent; border-top-color: var(--surface); border-bottom: 0; }
.bubble.pop { animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { from { transform: translateX(-50%) scale(.7); opacity: 0; } }
.state-pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-weight: 700; font-size: 14px; background: var(--surface-2); }
.s-thriving, .s-joy { background: color-mix(in srgb, var(--good) 18%, var(--surface)); color: var(--good); }
.s-unwell, .s-neglected { background: color-mix(in srgb, var(--bad) 15%, var(--surface)); color: var(--bad); }
.s-hungry, .s-tired, .s-dirty, .s-sad { background: color-mix(in srgb, #F08A24 18%, var(--surface)); color: #C2410C; }
.petmeters .health i { --mc: #E5484D; }
.petmeters .meter.health:not(.low) i { --mc: #F2789B; }
.petactions button em { font-style: normal; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.petactions button.cooling span { filter: grayscale(1); opacity: .6; }

/* wardrobe rarity */
.wd-item { overflow: hidden; isolation: isolate; }
.wd-item .rarity { position: absolute; top: 5px; left: 6px; font-size: 10px; font-weight: 800; letter-spacing: .02em; padding: 1px 6px; border-radius: 6px; color: #fff; z-index: 2; text-transform: capitalize; }
.r-rare { border-color: #5B8CFF; box-shadow: 0 0 0 1px #5B8CFF33, 0 4px 14px #5B8CFF22; }
.r-rare .rarity { background: #3B6BFD; }
.r-epic { border-color: transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, #B06BFF, #F2508E, #B06BFF) border-box; box-shadow: 0 4px 18px #B06BFF33; }
.r-epic .rarity { background: linear-gradient(90deg, #8B5CF6, #D946EF); }
.r-legendary { border-color: transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, conic-gradient(from var(--ang, 0deg), #FFD84D, #FF9F43, #FFF3B0, #FFD84D) border-box; box-shadow: 0 4px 22px #FFC83D55; animation: spinborder 3s linear infinite; }
.r-legendary .rarity { background: linear-gradient(90deg, #F5A524, #F7C948); color: #3D2A00; }
@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes spinborder { to { --ang: 360deg; } }
.wd-item[aria-pressed="true"] { outline: 3px solid var(--me); outline-offset: 2px; }
.wd-item.locked { opacity: 1; cursor: default; }
.wd-item.locked .pet-item, .wd-item.locked .has-room > defs + g, .wd-item.locked svg > g[clip-path] { filter: brightness(0); opacity: .55; }
.wd-item.locked .pet-body-g > :not(.pet-item) { opacity: .45; }
.wd-item.locked::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.55) 50%, transparent 65%); transform: translateX(-100%); animation: shimmer 2.8s ease-in-out infinite; pointer-events: none; }
.wd-item.r-epic.locked::after, .wd-item.r-legendary.locked::after { animation-duration: 1.9s; }
@keyframes shimmer { 60%, 100% { transform: translateX(100%); } }
.lockbar { display: block; width: 76%; height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 3px; }
.lockbar i { display: block; height: 100%; background: currentColor; color: var(--me); border-radius: inherit; }
.r-epic .lockbar i { background: linear-gradient(90deg, #8B5CF6, #D946EF); }
.r-legendary .lockbar i { background: linear-gradient(90deg, #F5A524, #F7C948); }

/* level-up modal */
.levelup { position: fixed; inset: 0; z-index: 970; display: grid; place-items: center; background: rgba(15, 12, 30, .6); padding: 20px; animation: fade .2s; }
.levelup .box { position: relative; background: var(--surface); border-radius: 28px; padding: 26px 20px 18px; width: 100%; max-width: 380px; text-align: center; overflow: hidden; }
.levelup .lv { font-size: 46px; font-weight: 800; letter-spacing: -.03em; line-height: 1; background: linear-gradient(90deg, #F5A524, #F2508E, #8B5CF6); -webkit-background-clip: text; background-clip: text; color: transparent; animation: pop .5s cubic-bezier(.3, 1.6, .5, 1); }
.levelup p { margin: 8px 0 12px; font-weight: 600; }
.unlocks { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.unlocks .wd-item { width: 30%; }
.confetti i { position: absolute; top: -12px; left: var(--x); width: 8px; height: 12px; background: var(--c); border-radius: 2px; animation: confetti 2.4s var(--d) ease-in forwards; }
@keyframes confetti { to { transform: translateY(520px) rotate(720deg); opacity: 0; } }

/* =================================================================== calendar */
.cal-nav { margin: 4px 0 10px; }
.lanes-head { display: grid; grid-template-columns: 52px 1fr 1fr; gap: 8px; font-size: 13px; padding: 0 2px 6px; position: sticky; top: 0; background: var(--bg); z-index: 3; }
.wday { display: grid; grid-template-columns: 52px 1fr; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.wday.past { opacity: .55; }
.wdate { border: 0; background: none; padding: 4px 0; display: flex; flex-direction: column; align-items: center; border-radius: 12px; color: var(--muted); align-self: start; }
.wdate b { font-size: 12px; font-weight: 700; text-transform: capitalize; }
.wdate span { font-size: 22px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.wday.today .wdate { background: var(--me); color: #fff; }
.wday.today .wdate span { color: #fff; }
.wbody { min-width: 0; min-height: 44px; }
.lanes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lane { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.shared { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.ev {
  display: block; width: 100%; text-align: left; border: 0; border-radius: 10px; padding: 6px 9px 6px 11px; min-width: 0;
  background: color-mix(in srgb, var(--c) 14%, var(--surface)); box-shadow: inset 3px 0 0 var(--c); font-size: 13.5px; line-height: 1.25;
}
.ev.both { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 16%, var(--surface)), color-mix(in srgb, var(--c2) 16%, var(--surface))); box-shadow: inset 3px 0 0 var(--c), inset -3px 0 0 var(--c2); }
.ev-t { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-time { display: block; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ev-off { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 12%, var(--surface)) 0 8px, color-mix(in srgb, var(--c) 20%, var(--surface)) 8px 16px); }
.free { font-size: 12.5px; color: var(--good); font-weight: 650; margin-top: 4px; }
.mgrid, .sgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; }
.mgrid > b, .sgrid > b { font-size: 12px; color: var(--muted); font-weight: 650; }
.mcell { aspect-ratio: .85; border: 0; border-radius: 10px; background: var(--surface-2); padding: 4px 3px; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.mcell span { font-size: 13px; font-weight: 700; }
.mcell.today { box-shadow: 0 0 0 2px var(--me); }
.mcell .bars { display: flex; flex-direction: column; gap: 2px; width: 100%; }
.mcell .bars i, .legend i { display: block; height: 5px; border-radius: 3px; background: var(--c); }
.mcell .bars i.both, .legend i.both { background: linear-gradient(90deg, var(--c), var(--c2)); }
.legend { display: flex; gap: 14px; justify-content: center; margin-top: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 16px; }
.day-list { display: flex; flex-direction: column; gap: 8px; }
.scell { aspect-ratio: 1; border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; font-weight: 700; font-size: 14px; position: relative; padding: 0; }
.scell.has::after { content: ""; position: absolute; bottom: 4px; left: 50%; margin-left: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.scell.on { background: var(--me); border-color: var(--me); color: #fff; }
.scell.on::after { background: #fff; }
.chip.tpl .muted { font-weight: 500; }
.cal-who { display: flex; align-items: baseline; gap: 8px; padding: 3px 0; }
.cal-day-sum + .cal-day-sum { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.sheet form .row input[type="time"] { min-width: 0; flex: 1; }
.sheet form .row .btn { flex: none; }

/* =================================================================== batch 4: pet game loop */
.pet .pet-ghost { opacity: .55; filter: grayscale(1); }
.pet .pet-weak { filter: saturate(.55); animation: weak 2.4s ease-in-out infinite; transform-origin: 100px 184px; }
@keyframes weak { 50% { transform: scale(.98, .96); } }
.stage-baby .pet-wander { transform-origin: 50% 100%; }
.stage-baby .pet { width: min(190px, 52vw) !important; }
.stage-young .pet { width: min(225px, 60vw) !important; }
.petstage.is-night { background: radial-gradient(closest-side, rgba(60, 50, 140, .28), transparent 75%); }
.petstage.dead { padding-top: 10px; }
.statuses { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.status { border: 0; border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 13.5px; }
.status.good { background: color-mix(in srgb, var(--good) 16%, var(--surface)); color: var(--good); }
.status.bad { background: color-mix(in srgb, var(--bad) 13%, var(--surface)); color: var(--bad); animation: none; }
.xpbar i { --mc: var(--me); }
.goals { margin-top: 16px; }
.goals ul { list-style: none; margin: 10px 0; padding: 0; }
.goals li { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.goals li + li { border-top: 1px solid var(--line); }
.goals .gk { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 15px; flex: none; }
.goals li.ok .gk { background: var(--good); color: #fff; font-weight: 800; }
.goals li.ok .grow { color: var(--muted); text-decoration: line-through; }
.goals.done { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--good) 50%, transparent); }
.good-text { color: var(--good); font-weight: 700; }
.cud { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 14px; margin-left: 3px; background: var(--surface-2); opacity: .45; filter: grayscale(1); }
.cud.on { opacity: 1; filter: none; box-shadow: 0 0 0 2px var(--c); background: var(--surface); }
.memorial { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grave { background: var(--surface); border-radius: var(--r-md); padding: 8px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.grave svg { width: 80%; height: auto; }

/* mini-game */
.game { position: fixed; inset: 0; z-index: 980; background: var(--bg); display: flex; flex-direction: column; }
.g-top { display: flex; align-items: center; justify-content: space-between; padding: calc(var(--safe-t) + 12px) 16px 8px; font-variant-numeric: tabular-nums; }
.g-top b { font-size: 34px; font-weight: 800; }
.g-top span { font-size: 20px; font-weight: 700; color: var(--muted); }
.g-top .cam-x { background: var(--surface-2); color: var(--ink); }
.g-arena { position: relative; flex: 1; margin: 0 12px; border-radius: 24px; background: color-mix(in srgb, var(--me) 8%, var(--surface)); overflow: hidden; touch-action: manipulation; }
.g-intro { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 24px; }
.g-intro b { font-size: 24px; }
.g-intro span { color: var(--muted); }
.g-yarn { position: absolute; width: 68px; height: 68px; border: 0; background: none; font-size: 52px; line-height: 1; padding: 0; transition: left .12s, top .12s; }
.g-yarn:active { transform: scale(.85); }
.g-pet { height: 150px; display: grid; place-items: center; padding-bottom: calc(var(--safe-b) + 10px); }
.g-pet svg { height: 140px; width: auto; }

/* =================================================================== calendar v2 (Apple-style) */
.tabbar { gap: 0; padding-left: 4px; padding-right: 4px; }
.tabbar a { font-size: 11px; letter-spacing: -.01em; }
.tabbar a svg { width: 23px; height: 23px; }
.view.wide { padding-left: 12px; padding-right: 12px; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.round { width: 36px; padding: 0; font-size: 20px; }
.iconbtn.sm { width: 32px; height: 32px; font-size: 16px; background: none; color: var(--muted); }
.cal-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 10px; }
.cal-title { display: flex; align-items: center; gap: 2px; min-width: 0; }
.cal-title h1 { margin: 0; font-size: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-title h1 span { color: var(--muted); font-weight: 600; font-size: 20px; }
.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.seg.sm button { min-height: 32px; padding: 0 10px; font-size: 13px; }
.pchip { border: 0; border-radius: 999px; padding: 6px 10px; font-size: 13px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.pchip.on { background: color-mix(in srgb, var(--c) 16%, var(--surface)); color: var(--c); box-shadow: inset 0 0 0 1.5px var(--c); }
.pchip.tool { padding: 6px 9px; }

/* month */
.mhead, .mgrid2 { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.mhead b { font-size: 12px; color: var(--muted); font-weight: 650; padding-bottom: 4px; }
.mgrid2 { row-gap: 2px; }
.mday { border: 0; background: none; padding: 4px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; border-top: 1px solid var(--line); }
.mday span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; font-weight: 600; }
.mday.today span { color: #E5484D; font-weight: 800; }
.mday.sel span { background: var(--ink); color: var(--bg); }
.mday.today.sel span { background: #E5484D; color: #fff; }
.mday .dots { display: flex; gap: 3px; height: 6px; }
.mday .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.mday .dots i.both { background: linear-gradient(90deg, var(--c) 50%, var(--c2) 50%); }
.agenda-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 18px 4px 8px; }
.agenda { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; }
.arow { display: flex; align-items: stretch; gap: 10px; width: 100%; padding: 11px 14px; border: 0; background: none; text-align: left; }
.arow + .arow { border-top: 1px solid var(--line); }
.arow .at { width: 46px; flex: none; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.35; }
.arow .at span { color: var(--muted); font-weight: 500; }
.arow i { width: 4px; border-radius: 4px; background: var(--c); flex: none; }
.arow i.both { background: linear-gradient(var(--c), var(--c2)); }
.arow .grow > b { display: block; }
.arow .grow > span { display: block; }
.agenda-empty { width: 100%; border: 1.5px dashed var(--line); background: none; border-radius: var(--r-lg); padding: 22px; color: var(--muted); font-weight: 600; }

/* time grids */
.tgrid-wrap { height: calc(100dvh - var(--tabbar) - var(--safe-b) - 250px); min-height: 320px; overflow-y: auto; border-radius: var(--r-lg); background: var(--surface); overscroll-behavior: contain; }
.tgrid { position: relative; display: grid; grid-template-columns: 44px repeat(var(--cols, 1), 1fr); }
.tgrid.wk { --cols: 7; }
.tgrid.day { --cols: 1; }
.thours { position: relative; border-right: 1px solid var(--line); }
.thours span { position: absolute; right: 6px; transform: translateY(-50%); font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tcol { position: relative; background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 52px); }
.tgrid.wk .tcol + .tcol { border-left: 1px solid var(--line); }
.tblock {
  position: absolute; border: 0; border-radius: 7px; padding: 3px 5px; text-align: left; overflow: hidden; z-index: 1;
  background: color-mix(in srgb, var(--c) 22%, var(--surface)); box-shadow: inset 3px 0 0 var(--c); font-size: 11.5px; line-height: 1.2;
}
.tblock.both { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 22%, var(--surface)), color-mix(in srgb, var(--c2) 22%, var(--surface))); }
.tblock b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tblock span { display: block; color: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.tgrid.day .tblock { font-size: 13px; padding: 4px 7px; }
.tblock.ev-off { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 14%, var(--surface)) 0 7px, color-mix(in srgb, var(--c) 24%, var(--surface)) 7px 14px); }
.tnow { position: absolute; left: -4px; right: 0; height: 2px; background: #E5484D; z-index: 2; pointer-events: none; }
.tnow::before { content: ""; position: absolute; left: -2px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #E5484D; }
.tlane { position: absolute; top: 0; bottom: 0; width: 50%; }
.tlane + .tlane { left: 50%; border-left: 1px dashed var(--line); }
.tshared { position: absolute; inset: 0; pointer-events: none; }
.tshared .tblock { pointer-events: auto; }
.lane-names { display: grid; grid-template-columns: 44px 1fr 1fr; text-align: center; font-size: 13px; padding: 2px 0 6px; }
.lane-names b { color: var(--c); }
.wk-head { display: grid; grid-template-columns: 44px repeat(7, 1fr); text-align: center; margin-bottom: 6px; }
.wk-head button, .strip button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 2px 0; }
.wk-head small, .strip small { font-size: 11px; color: var(--muted); font-weight: 650; }
.wk-head b, .strip b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; }
.wk-head .today b, .strip .today b { color: #E5484D; }
.wk-head .sel b, .strip .sel b { background: var(--ink); color: var(--bg); }
.wk-head .today.sel b, .strip .today.sel b { background: #E5484D; color: #fff; }
.wk-all { display: grid; grid-template-columns: 44px repeat(7, 1fr); gap: 2px; margin-bottom: 6px; align-items: start; }
.wk-all > span { font-size: 10px; color: var(--muted); padding-top: 6px; }
.wk-all .ev { padding: 3px 4px; font-size: 10.5px; }
.strip { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 8px; }
.strip i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); }
.day-all { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.tgrid.wk .tblock { box-shadow: inset 3px 0 0 var(--c), 0 0 0 1px var(--surface); }
.synced { background: var(--surface-2); border-radius: var(--r-md); padding: 10px 12px; }
.src-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.src-row .iconbtn { width: 34px; height: 34px; font-size: 15px; }
details.how { background: var(--surface); border-radius: var(--r-md); padding: 10px 14px; }
details.how summary { font-weight: 650; cursor: pointer; }
details.how p { margin: 8px 0 0; }
.ev-t small { font-size: .8em; opacity: .7; }
.pchip.em { width: 36px; height: 36px; padding: 0; font-size: 17px; display: grid; place-items: center; }
.pchip.em:not(.on) { filter: grayscale(1); opacity: .5; }
.pchip.tool { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; }
.cal-title h1 { font-size: 24px; }
.cal-title h1 span { font-size: 17px; }
.cal-bar { flex-wrap: nowrap; }
.auto-cta { display: block; width: 100%; margin-top: 10px; text-align: left; border: 0; border-radius: var(--r-md); padding: 10px 12px;
  background: color-mix(in srgb, var(--me) 12%, var(--surface)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--me) 40%, transparent); }
.auto-cta b { display: block; font-size: 14.5px; }
.auto-cta span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
/* iOS only fires taps on elements it considers clickable */
[data-act] { cursor: pointer; }
.sheet-x { position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--muted); font-size: 15px; display: grid; place-items: center; z-index: 2; }
.sheet h3 { padding-right: 40px; }
.sheet > .spread:first-of-type { padding-right: 42px; }

/* =================================================================== batch 5: mood check-in, watchlist, together list */
.rate { display: flex; align-items: center; gap: 12px; }
.rate input[type="range"] { flex: 1; accent-color: var(--me); height: 28px; }
.rate-n { min-width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 20px; font-weight: 800; transition: background .2s; }
.rate-scale { display: flex; justify-content: space-between; margin-top: 2px; }
.score.sm { min-width: 0; padding: 1px 7px; font-size: 12px; margin-left: 4px; vertical-align: 1px; }
.mood-entry .why { margin-top: 4px; white-space: pre-wrap; }
.helpbox { margin-top: 8px; padding: 8px 10px; border-radius: 12px; background: color-mix(in srgb, var(--c) 10%, var(--surface)); }
.helpbox .btn { margin-top: 8px; }
.helpcard { margin-top: 16px; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 45%, transparent); }

.tonight { width: 100%; border: 0; border-radius: var(--r-lg); padding: 14px; font-weight: 750; font-size: 16px; color: #fff; background: linear-gradient(120deg, var(--a, #3B5BFD), var(--b, #F2508E)); margin-top: 4px; }
.poster-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 10px; }
.poster-card { border: 0; background: none; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.poster { position: relative; aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden; background: linear-gradient(160deg, var(--surface-2), var(--line)); margin-bottom: 4px; box-shadow: 0 4px 14px var(--shadow); }
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; position: relative; z-index: 1; }
.poster .ptitle { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; text-align: center; font-weight: 700; font-size: 13px; color: var(--muted); }
.both-tag { position: absolute; z-index: 2; left: 6px; bottom: 6px; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.poster-card b { font-size: 13.5px; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.poster-card .stars, .rating-row .stars { color: #F5A524; font-size: 13px; letter-spacing: 1px; }
.wants { display: flex; gap: 3px; }
.wants i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; box-shadow: 0 0 0 2px var(--c); background: var(--surface); }
.wresults { list-style: none; margin: 0; padding: 0; }
.wresults li { display: flex; gap: 12px; align-items: center; padding: 8px 0; }
.wresults li + li { border-top: 1px solid var(--line); }
.wresults img { width: 48px; height: 72px; object-fit: cover; border-radius: 8px; background: var(--surface-2); flex: none; }
.clamp2 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-top: 2px; color: var(--muted); }
.clamp5 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; }
.witem { display: flex; gap: 14px; padding-right: 40px; }
.wposter { width: 96px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 12px; background: var(--surface-2); flex: none; box-shadow: 0 6px 18px var(--shadow); }
.wantrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.wantp { font-size: 13px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.wantp.on { background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: var(--c); font-weight: 700; }
.rating-row { background: var(--surface); border-radius: var(--r-md); padding: 10px 12px; margin-bottom: 8px; }
.rating-row .who { margin-right: 8px; }
.starpick button { border: 0; background: none; font-size: 26px; padding: 0 2px; color: var(--line); line-height: 1; }
.starpick button.on { color: #F5A524; }
.pick-card { text-align: center; padding-top: 8px; }
.pick-card img { width: 150px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 14px; margin-top: 10px; box-shadow: 0 10px 30px var(--shadow); animation: pop .4s cubic-bezier(.3, 1.6, .5, 1); }

.bk-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--r-lg); overflow: hidden; }
.bk { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.bk + .bk { border-top: 1px solid var(--line); }
.bk .em { font-size: 24px; width: 30px; text-align: center; flex: none; }
.bk-body { border: 0; background: none; text-align: left; padding: 2px 0; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bk-check { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); background: none; flex: none; display: grid; place-items: center; font-weight: 800; color: #fff; padding: 0; }
.bk-check.on { background: var(--good); border-color: var(--good); }
.bk.done b { color: var(--muted); }
