:root {
  --paper: #faf8f3;
  --card: #ffffff;
  --ink: #343a30;
  --muted: #5f6558;
  --olive: #46533a;
  --line: #dddcd2;
  --orange: #a84c2b;
  --cream: #eee9dd;
  --open: #2f6b3d;
  --upcoming: #8a5a12;
  --serif: "Songti TC", "Noto Serif TC", "PMingLiU", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --radius: 18px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); line-height: 1.7; overflow-x: hidden; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255,255,255,.95), 0 0 0 5px rgba(70,83,58,.55); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
.small { font-size: .875rem; color: var(--muted); }

.topbar { display: flex; justify-content: space-between; align-items: center; max-width: 1120px; margin: 0 auto; padding: 14px 16px; }
.back { color: var(--olive); text-decoration: none; font-weight: 600; }
.beta { font-size: .8rem; background: var(--orange); color: #fff; padding: 2px 10px; border-radius: 99px; letter-spacing: .08em; }

main { max-width: 1120px; margin: 0 auto; padding: 0 16px 64px; }
.hero { background: var(--cream); border-radius: 28px; padding: 32px 24px; margin-bottom: 32px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, #e8c79a 0, transparent 70%); opacity: .6; pointer-events: none; }
.eyebrow { margin: 0; color: var(--orange); font-weight: 700; letter-spacing: .12em; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.35; }
h1 { font-size: clamp(1.7rem, 5vw, 2.6rem); margin: 6px 0 12px; }
.lead { max-width: 640px; margin: 0 0 20px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 16px; border-radius: 99px; border: 1.5px solid var(--olive); background: #fff; color: var(--olive); font-weight: 600; text-decoration: none; cursor: pointer; }
.button.primary { background: var(--olive); color: #fff; }
.button.big { padding: 10px 22px; font-size: 1.05rem; }
.button:hover { filter: brightness(1.05); }
.link-button { background: none; border: 0; padding: 0; color: var(--orange); text-decoration: underline; cursor: pointer; font-weight: 600; }
.text-link { color: var(--orange); font-weight: 600; align-self: center; background: none; border: 0; padding: 4px 0; cursor: pointer; font: inherit; font-weight: 600; text-decoration: underline; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { background: rgba(255,255,255,.75); border-radius: 14px; padding: 10px 14px; display: flex; flex-direction: column; }
.stat-label { font-size: .8rem; color: var(--muted); }
.stat strong { font-size: 1.1rem; }
.badges-stat { grid-column: span 2; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.badge { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #e4e0d4; color: #a29d90; font-size: .95rem; }
.badge.got { background: var(--orange); color: #fff; }

.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 1.5rem; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 36px; padding: 4px 14px; border-radius: 99px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.char-card { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 18px 16px 16px; background: var(--card); border: 1px solid var(--line); border-top: 6px solid var(--c); border-radius: var(--radius); cursor: pointer; transition: transform .2s, box-shadow .2s; }
.char-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(52,58,48,.12); }
.char-card.drawn { animation: drawn .65s ease; }
@keyframes drawn { 0% { transform: rotateY(0) scale(1); } 50% { transform: rotateY(90deg) scale(1.04); } 100% { transform: rotateY(0) scale(1.04); box-shadow: 0 0 0 4px var(--c); } }
.char-top { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; pointer-events: none; }
.card-flag { font-size: .75rem; background: var(--cream); padding: 1px 8px; border-radius: 99px; }
.card-flag.done { background: var(--open); color: #fff; }
.card-flag.me { background: var(--orange); color: #fff; margin-left: auto; }
.char-name { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; }
.char-name small, h2 small { font-family: var(--sans); font-size: .85rem; color: var(--muted); font-weight: 400; margin-left: 6px; }
.char-role { font-weight: 600; color: var(--olive); }
.char-tagline { font-size: .9rem; color: var(--muted); min-height: 3em; }
.char-meter { width: 100%; display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.meter-label { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.meter { flex: 1; height: 8px; background: #ece8dd; border-radius: 99px; overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 99px; transition: width .6s ease; }

.data-note { margin-top: 12px; }
.how { margin-top: 40px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; }
.how h2 { margin-top: 0; }

/* dialogs */
.sheet { border: 0; padding: 0; width: min(1080px, 100vw); max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0 auto; background: var(--paper); color: var(--ink); overflow-y: auto; }
.sheet.narrow { width: min(640px, 100vw); }
.sheet::backdrop { background: rgba(30,30,25,.45); }
@media (min-width: 760px) { .sheet { height: fit-content; max-height: 92dvh; margin: auto; border-radius: 24px; } }
.sheet-bar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; background: rgba(250,248,243,.95); border-bottom: 1px solid var(--line); }
.sheet-bar h2 { margin: 0; font-size: 1.2rem; }
.sheet-bar .close { margin-left: auto; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 1.1rem; }
.day-body { display: grid; gap: 20px; padding: 16px; }
@media (min-width: 860px) { .day-body { grid-template-columns: 300px 1fr; align-items: start; padding: 24px; } .profile { position: sticky; top: 80px; } }
.profile { background: #fff; border: 1px solid var(--line); border-top: 6px solid var(--c); border-radius: var(--radius); padding: 18px; text-align: center; }
.profile .avatar { margin: 0 auto; }
.profile h2 { margin: 6px 0 0; font-size: 1.5rem; }
.profile .role { margin: 2px 0 10px; color: var(--olive); font-weight: 600; }
.profile .story { text-align: left; font-size: .95rem; }
.profile-meter { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.like.on { background: var(--orange); border-color: var(--orange); color: #fff; }

.timeline ol { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline ol::before { content: ""; position: absolute; left: 31px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.scene { position: relative; display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding-bottom: 22px; }
.scene .time { position: relative; z-index: 1; align-self: start; text-align: center; font-size: .78rem; font-weight: 700; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 4px 2px; }
.scene.current .time { border-color: var(--orange); color: var(--orange); }
.scene.done .time { border-color: var(--open); background: var(--open); color: #fff; }
.scene.event .time { border-color: #6b5ca5; color: #6b5ca5; }
.scene h3 { margin: 0 0 4px; font-size: 1.15rem; }
.scene-text { margin: 0 0 8px; }
.locked h3, .locked-text { color: #a29d90; }
.scene.event > div { background: #f1eef8; border-radius: 14px; padding: 10px 14px; }
.need { margin: 0 0 6px; background: #fff6e8; border-left: 4px solid var(--orange); padding: 6px 10px; border-radius: 6px; }
.choose-hint { margin: 8px 0 6px; font-weight: 600; }
.reaction { margin: 0 0 8px; padding: 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; display: inline-block; }
.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }

.product { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.img-fallback { display: grid; place-items: center; width: 100%; height: 100%; font-family: var(--serif); font-size: 2.6rem; color: var(--olive); }
.product-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-body h4 { margin: 0; font-size: 1rem; line-height: 1.4; }
.product-body p { margin: 0; font-size: .88rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.product-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }
.product-actions .button { min-height: 40px; padding: 6px 14px; font-size: .92rem; }
.save { border: 0; background: none; color: var(--orange); cursor: pointer; padding: 6px 2px; min-height: 40px; }
.product.compact { flex-direction: row; max-width: 480px; }
.status { align-self: flex-start; font-size: .75rem; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: #ece8dd; color: var(--muted); }
.status.open { background: #e2efe3; color: var(--open); }
.status.upcoming { background: #f7ead3; color: var(--upcoming); }
.status.closed { background: #eceae4; color: #6f6b62; }
.countdown { font-size: .75rem; color: var(--muted); }
.countdown.soon { color: var(--orange); font-weight: 700; }

.summary { margin: 4px 0 0 76px; background: #fff; border: 2px solid var(--open); border-radius: var(--radius); padding: 16px 18px; }
.summary h3 { margin: 0 0 8px; }
.pill { display: inline-block; background: var(--cream); border-radius: 99px; padding: 1px 10px; margin: 2px 4px 2px 0; font-size: .85rem; }
.summary-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
@media (max-width: 520px) { .summary { margin-left: 0; } .scene { grid-template-columns: 54px 1fr; } .timeline ol::before { left: 26px; } }

.me-body { padding: 16px; display: grid; gap: 12px; }
.empty { color: var(--muted); }
fieldset { border: 1px solid var(--line); border-radius: 14px; margin: 0 0 12px; padding: 10px 14px; }
legend { font-weight: 700; padding: 0 6px; }
.radio { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field input { min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font: inherit; }
.me-card { margin-top: 16px; background: #fff; border: 1px solid var(--line); border-top: 6px solid var(--c); border-radius: var(--radius); padding: 16px; }
.me-card h3 { margin: 0; }
.me-card .role { color: var(--olive); font-weight: 600; margin: 2px 0 8px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 99px; opacity: 0; pointer-events: none; transition: .25s; z-index: 20; width: max-content; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* v2：目標、選擇流程、輪播、建立角色 */
[hidden] { display: none !important; }
.button.ghost { border-color: var(--line); color: var(--ink); background: #fff; font-weight: 500; }
.char-goal { font-size: .88rem; color: var(--ink); background: var(--cream); border-radius: 10px; padding: 4px 10px; margin-top: 2px; }
.char-card.mine { border-style: dashed; }
.card-flag.mine { background: var(--orange); color: #fff; }
.goal-box { text-align: left; background: var(--cream); border-radius: 12px; padding: 8px 12px; margin: 0 0 10px; font-weight: 600; }
.goal-box span { display: block; font-size: .75rem; color: var(--muted); font-weight: 500; letter-spacing: .06em; }
.goal-line { font-weight: 600; margin: 0 0 6px; }
.scene-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.skipped { margin: 0 0 4px; color: var(--muted); font-style: italic; }
.scene.skip .time { border-color: #b9b4a7; background: #ece8dd; color: var(--muted); }
.scene .text-link { background: none; border: 0; padding: 4px 0; cursor: pointer; font-size: .9rem; }
.pack { list-style: none; padding: 0; margin: 6px 0 10px; display: grid; gap: 6px; }
.pack label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 40px; }
.pack input, .chip-pick input, .goal-pick input, .avatar-pick input { accent-color: var(--olive); width: 18px; height: 18px; }

.carousel { position: relative; aspect-ratio: 4 / 3; background: var(--cream); overflow: hidden; max-width: 100%; }
.carousel.big { aspect-ratio: 1 / 1; background: #f1eee6; }
@media (min-width: 640px) { .carousel.big { aspect-ratio: 4 / 3; } }
.carousel.empty { display: grid; }
.track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; height: 100%; margin: 0; scroll-snap-align: center; display: grid; place-items: center; }
.nav { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.85); color: var(--ink); font-size: 1.4rem; line-height: 1; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.nav.prev { left: 8px; } .nav.next { right: 8px; }
.count { position: absolute; right: 8px; bottom: 8px; background: rgba(52,58,48,.75); color: #fff; font-size: .75rem; padding: 1px 8px; border-radius: 99px; }
.product.compact .carousel { width: 120px; flex: none; aspect-ratio: auto; min-height: 100px; }
.product.compact .nav { width: 28px; height: 28px; font-size: 1.1rem; }
@media (max-width: 520px) { .product.compact .carousel { width: 96px; } }
.product-detail { padding: 0 0 16px; }
.detail-copy { padding: 14px 16px 0; display: grid; gap: 8px; }
.detail-copy p { margin: 0; }
.cart-body { padding: 16px; display: grid; gap: 16px; }
.cart-group { margin: 0 0 8px; font-size: 1.05rem; }
.cart-list { display: grid; gap: 10px; }
.reset-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 12px; }
.steps li { font-size: .8rem; padding: 2px 10px; border-radius: 99px; background: #ece8dd; color: var(--muted); }
.steps li.on { background: var(--olive); color: #fff; }
.steps li.done { background: #dfe8d6; color: var(--olive); }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.avatar-pick { display: grid; place-items: center; border: 2px solid transparent; border-radius: 16px; padding: 6px; cursor: pointer; position: relative; }
.avatar-pick input { position: absolute; opacity: 0; }
.avatar-pick:has(input:checked) { border-color: var(--orange); background: #fff6e8; }
.avatar-pick:has(input:focus-visible) { outline: 3px solid var(--orange); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-pick { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 99px; background: #fff; cursor: pointer; }
.chip-pick:has(input:checked) { border-color: var(--olive); background: #eef3e8; }
.goal-list { display: grid; gap: 8px; }
.goal-pick { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; }
.goal-pick:has(input:checked) { border-color: var(--olive); background: #eef3e8; }
.goal-pick span { display: flex; flex-direction: column; }
.goal-pick small { color: var(--muted); }
.wizard-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; }
.wizard-actions .primary { margin-left: auto; }
.form-error { color: var(--orange); min-height: 1.2em; margin: 4px 0 0; font-weight: 600; }
.me-preview { display: flex; gap: 12px; align-items: center; margin-top: 16px; padding: 12px; border: 1px dashed var(--c); border-radius: 14px; background: #fff; }
.me-preview .avatar { flex: none; }

/* v3：入口儀式、推薦卡、語音 */
#me.ritual-mode { background: #2f3a2a; color: #f6f1e4; }
#me.ritual-mode .sheet-bar { background: transparent; border-bottom: 0; }
#me.ritual-mode .sheet-bar h2 { visibility: hidden; }
#me.ritual-mode .button.ghost { background: transparent; color: #f6f1e4; border-color: rgba(246,241,228,.5); }
#me.ritual-mode .button.primary { background: #e9c78f; border-color: #e9c78f; color: #2f3a2a; }
#me.ritual-mode .small { color: #d8d1bf; }
.ritual { text-align: center; padding: 8px 4px 0; display: grid; justify-items: center; gap: 8px; }
.ritual .eyebrow { color: #e9c78f; }
.ritual-title { font-size: clamp(1.6rem, 6vw, 2.3rem); margin: 0; color: #fff8ea; text-wrap: balance; }
.ritual p { max-width: 32em; margin: 0; }
.book { position: relative; width: 140px; height: 100px; margin: 12px 0 8px; perspective: 600px; }
.book .page { position: absolute; top: 0; left: 70px; width: 70px; height: 100px; background: #f6f1e4; border-radius: 0 6px 6px 0; transform-origin: left center; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.book::before { content: ""; position: absolute; top: 0; left: 0; width: 70px; height: 100px; background: #e9dfc8; border-radius: 6px 0 0 6px; }
.book .p1 { animation: flip 2.4s ease-in-out .2s infinite; }
.book .p2 { animation: flip 2.4s ease-in-out .5s infinite; background: #efe6d2; }
.book .p3 { animation: flip 2.4s ease-in-out .8s infinite; background: #e8dcc2; }
@keyframes flip { 0%, 20% { transform: rotateY(0); } 60%, 100% { transform: rotateY(-180deg); } }
.kid-rows { display: grid; gap: 10px; margin-bottom: 10px; }
.kid-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.kid-row .field { margin: 0; flex: 1 1 140px; min-width: 0; }
.field select { min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font: inherit; background: #fff; color: var(--ink); }
.reveal { text-align: center; display: grid; gap: 12px; }
.reveal .eyebrow { margin: 0; }
.reveal-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; perspective: 900px; }
.reveal-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px; background: #fff; border: 1px solid var(--line); border-top: 6px solid var(--c); border-radius: var(--radius); animation: reveal .7s ease both; }
.reveal-card:nth-child(2) { animation-delay: .25s; }
@keyframes reveal { from { transform: rotateY(90deg); opacity: 0; } to { transform: rotateY(0); opacity: 1; } }
.reveal-label { font-size: .8rem; font-weight: 700; color: var(--orange); letter-spacing: .06em; }
.reveal-why { margin: 0; }
.reveal-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.voice-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: center; margin: 4px 0 2px; }
.auto-read { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; }
.listen { margin-left: 6px; vertical-align: middle; font-size: .78rem; font-family: var(--sans); border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 2px 10px; cursor: pointer; color: var(--olive); }
.listen.on, [data-play].on { background: var(--olive); color: #fff; border-color: var(--olive); }
img.avatar.art { border-radius: 22px; object-fit: contain; background: #faf8f3; height: auto; aspect-ratio: 1 / 1; }
.char-card img.avatar.art { width: 100%; max-width: 200px; height: auto; }
.profile img.avatar.art { width: 100%; max-width: 260px; height: auto; margin: 0 auto; display: block; }

/* v4：圖片完整顯示、多選、浮動購物清單 */
.slide { position: relative; overflow: hidden; }
.slide .backdrop { position: absolute; inset: -8%; width: 116%; height: 116%; object-fit: cover; filter: blur(18px) saturate(1.1); opacity: .45; }
.slide .photo { position: relative; width: 100%; height: 100%; object-fit: contain; }
.product.compact .carousel { width: 140px; min-height: 120px; }
@media (max-width: 520px) { .product.compact .carousel { width: 112px; min-height: 104px; } }
.chosen-list { display: grid; gap: 8px; margin-bottom: 4px; }
.product.is-selected { border-color: var(--olive); box-shadow: 0 0 0 2px var(--olive); }
.button.pick { background: #fff; color: var(--olive); }
.button.picked { background: var(--olive); color: #fff; }
.button[disabled] { opacity: .45; cursor: not-allowed; }
.choose-hint .small { margin-left: 8px; font-weight: 400; }
.also-picked { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 0; font-size: .9rem; }
.also-picked .chip { min-height: 32px; font-size: .85rem; }
.cart-fab { position: fixed; z-index: 30; right: max(16px, calc(env(safe-area-inset-right, 0px) + 12px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 18px 0 16px; border: 0; border-radius: 99px; background: var(--orange); color: #fff; font: inherit; font-weight: 700; box-shadow: 0 8px 22px rgba(80,40,20,.3); cursor: pointer; }
.cart-fab .fab-count { min-width: 24px; height: 24px; padding: 0 6px; border-radius: 99px; background: #fff; color: var(--orange); display: inline-grid; place-items: center; font-size: .85rem; }
.cart-fab.bump { animation: bump .45s ease; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.15); } 100% { transform: scale(1); } }
@media (max-width: 400px) { .cart-fab .fab-label { display: none; } }
.toast { bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); }
main { padding-bottom: 96px; }
.timeline { padding-bottom: 72px; }
.product.compact .nav { display: none; }
.product.compact .count { right: 4px; bottom: 4px; font-size: .7rem; }
.avatar-pick img.avatar.art { width: 100%; height: auto; max-width: 112px; }

/* 入口儀式：桌機是置中的小卡、高度跟著內容；手機全螢幕但內容垂直置中 */
#me.ritual-mode .me-body { align-content: center; }
@media (max-width: 759px) { #me.ritual-mode .me-body { min-height: calc(100dvh - 72px); } }
@media (min-width: 760px) {
  #me.ritual-mode { width: min(520px, 92vw); }
  #me.ritual-mode .me-body { padding: 8px 32px 32px; }
  #me.ritual-mode .sheet-bar { padding-bottom: 0; }
}

/* 對話框本身不畫焦點框；用柔和的白色光暈與陰影 */
dialog:focus, dialog:focus-visible { outline: none; }
.sheet { box-shadow: 0 24px 60px rgba(30,30,25,.28); }
#me.ritual-mode { box-shadow: 0 0 0 1px rgba(255,248,234,.12), 0 0 48px rgba(255,248,234,.22), 0 28px 70px rgba(0,0,0,.4); }
#me.ritual-mode:focus-visible { box-shadow: 0 0 0 1px rgba(255,248,234,.2), 0 0 56px rgba(255,248,234,.3), 0 28px 70px rgba(0,0,0,.4); }
/* 關閉鈕：顏色固定，不跟著對話框的字色 */
.sheet-bar .close { color: var(--ink); }
#me.ritual-mode .sheet-bar .close { background: rgba(255,248,234,.08); border-color: rgba(255,248,234,.35); color: #fff8ea; }
#me.ritual-mode .sheet-bar .close:hover { background: rgba(255,248,234,.16); }
#me.ritual-mode :focus-visible { box-shadow: 0 0 0 2px rgba(47,58,42,1), 0 0 0 4px rgba(255,248,234,.85); }
.avatar-pick:has(input:checked) { border-color: var(--olive); background: #eef3e8; box-shadow: 0 0 0 4px rgba(70,83,58,.12); }

/* 身邊的人、日常里的鄰居（GB-028g） */
.people { margin: 14px 0 6px; text-align: left; }
.people h3 { font-size: 15px; margin: 0 0 8px; }
.people ul, .people-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.people-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-top: 12px; }
.person { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border-radius: 14px; background: #fff; border: 1px solid #ece6da; text-align: left; font: inherit; color: inherit; }
button.person { cursor: pointer; }
button.person:hover { border-color: var(--c, #c9876a); }
button.person:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.person img { width: 56px; height: 56px; border-radius: 50%; flex: none; background: #faf8f3; object-fit: cover; }
.person span { display: grid; gap: 2px; min-width: 0; }
.person strong { font-size: 15px; }
.person small { font-size: 13px; color: #6b6257; line-height: 1.4; }
.person small.note { color: #8a8075; }
.neighbors { margin-top: 40px; }
