:root {
  --night: #141230;
  --night2: #1f1b4a;
  --sun: #ffd35c;
  --sun2: #ff9f43;
  --pink: #ff9db8;
  --mint: #8fd3ff;
  --paper: #fff8ef;
  --ink: #2b2140;
  --muted: #a9a2c8; /* 暗い背景で 4.5:1 以上 */
  --line: rgba(255, 255, 255, .12);
  --glow: 0 0 18px rgba(255, 211, 92, .55);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--night); color: #f4efff; font-family: "Zen Maru Gothic", system-ui, sans-serif; line-height: 1.6; overflow-x: hidden; }
canvas { image-rendering: pixelated; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- トップ ---------- */
.landing { position: fixed; inset: 0; overflow: hidden; background:
  radial-gradient(ellipse at 50% 120%, rgba(255, 211, 92, .25), transparent 60%),
  radial-gradient(circle at 20% 10%, #2c2670, transparent 50%), var(--night); }
.landing::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 3px); pointer-events: none; z-index: 3; }
.landing::after { content: ""; position: absolute; inset: auto 0 0; height: 40%; background:
  linear-gradient(transparent, rgba(143, 211, 255, .06)), repeating-linear-gradient(90deg, rgba(143, 211, 255, .08) 0 1px, transparent 1px 48px); transform: perspective(300px) rotateX(55deg); transform-origin: bottom; pointer-events: none; }
.rain { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; touch-action: manipulation; }
.hud { position: absolute; top: 14px; z-index: 4; font-family: "Press Start 2P", monospace; font-size: 9px; color: var(--mint); letter-spacing: .1em; opacity: .8; }
.hud-tl { left: 16px; } .hud-tr { right: 16px; }
.hud b { color: var(--sun); }
.hud.sound { background: rgba(0, 0, 0, .25); border: 1px solid rgba(143, 211, 255, .4); border-radius: 3px; padding: .35rem .5rem; cursor: pointer; opacity: 1; }
.hud.sound.off { color: var(--muted); border-color: var(--line); }
.bar-right { display: flex; gap: .5rem; align-items: center; }
.btn.icon.mute { width: 2.6rem; padding: .35rem; font-size: 1rem; }
.hero { position: absolute; inset: 0; z-index: 4; display: grid; place-content: center; justify-items: center; text-align: center; padding: 0 16px; pointer-events: none; }
.hero > * { pointer-events: auto; }
.hero-kicker { font-family: "Press Start 2P", monospace; font-size: 10px; color: var(--mint); letter-spacing: .3em; margin: 0 0 1rem; animation: blink 1.6s steps(2) infinite; }
.logo { margin: 0; font-family: "DotGothic16", monospace; font-weight: 400; font-size: clamp(2.6rem, 11vw, 5.4rem); line-height: 1.15; color: var(--sun); text-shadow: 4px 4px 0 #b34d6e, 0 0 30px rgba(255, 211, 92, .5); }
.logo span { display: inline-block; opacity: 0; transform: translateY(-60px); }
.landing.go .logo span { animation: drop .55s cubic-bezier(.3, 1.6, .5, 1) forwards; }
.logo span:nth-of-type(1) { animation-delay: .2s; } .logo span:nth-of-type(2) { animation-delay: .3s; } .logo span:nth-of-type(3) { animation-delay: .4s; }
.logo span:nth-of-type(4) { animation-delay: .5s; } .logo span:nth-of-type(5) { animation-delay: .6s; } .logo span:nth-of-type(6) { animation-delay: .9s; }
.logo span:nth-of-type(7) { animation-delay: 1s; } .logo span:nth-of-type(8) { animation-delay: 1.1s; }
.hero-sub { min-height: 1.6em; margin: 1.2rem 0 1.6rem; font-size: 1.05rem; color: #fff; }
.btn-start { font-family: "DotGothic16", monospace; font-size: 1.3rem; color: var(--ink); background: var(--sun); border: 0; padding: .7rem 2.2rem; border-radius: 4px; box-shadow: 0 6px 0 #b9842b, var(--glow); opacity: 0; }
.landing.go .btn-start { animation: pop .5s 2.6s cubic-bezier(.3, 1.6, .5, 1) forwards, pulse 1.8s 3.2s ease-in-out infinite; }
.btn-start:active { transform: translateY(4px); box-shadow: 0 2px 0 #b9842b; }
.hint { margin-top: .8rem; font-size: .8rem; color: var(--muted); opacity: 0; }
.landing.go .hint { animation: fade .6s 3.4s forwards; }
.landing:not(.go) .hero-kicker { opacity: 0; }
.tap-start { position: absolute; inset: 0; z-index: 5; display: grid; place-content: center; gap: .6rem; background: rgba(10, 8, 30, .35); border: 0; color: var(--sun); font-family: "Press Start 2P", monospace; font-size: clamp(14px, 3.4vw, 22px); letter-spacing: .12em; cursor: pointer; text-shadow: 3px 3px 0 #b34d6e; }
.tap-start span { animation: blink 1s steps(2) infinite; }
.tap-start small { font-family: "DotGothic16", monospace; font-size: .8rem; color: var(--mint); letter-spacing: .2em; text-shadow: none; }
.bubble-float { position: fixed; z-index: 6; transform: translate(-50%, -130%); background: #fff; color: var(--ink); font-family: "DotGothic16", monospace; padding: .25rem .6rem; border-radius: 4px; box-shadow: 3px 3px 0 #b34d6e; animation: bubble .9s ease forwards; pointer-events: none; white-space: nowrap; }
.landing.leave { animation: zoomOut .7s ease forwards; }

@keyframes drop { to { opacity: 1; transform: none; } }
.logo.called { animation: call .7s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes call { 35% { transform: scale(1.12) rotate(-2deg); text-shadow: 4px 4px 0 #b34d6e, 0 0 50px rgba(255, 211, 92, .95); } 70% { transform: scale(.97) rotate(1deg); } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { box-shadow: 0 6px 0 #b9842b, 0 0 34px rgba(255, 211, 92, .9); } }
@keyframes blink { 50% { opacity: .3; } }
@keyframes fade { to { opacity: 1; } }
@keyframes bubble { 0% { opacity: 0; transform: translate(-50%, -100%) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -140%) scale(1.05); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -170%); } }
@keyframes zoomOut { to { opacity: 0; transform: scale(1.15); filter: blur(4px); } }
.ch { display: inline-block; opacity: 0; transform: translateY(8px); animation: chIn .35s cubic-bezier(.3, 1.6, .5, 1) forwards; }
@keyframes chIn { to { opacity: 1; transform: none; } }

/* ---------- 本体 ---------- */
.app { max-width: 920px; margin: 0 auto; padding: 12px 16px 48px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; animation: appIn .6s ease; }
@keyframes appIn { from { opacity: 0; transform: translateY(14px); } }
.bar { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; }
.brand { display: flex; gap: .5rem; align-items: center; font-family: "DotGothic16", monospace; font-size: 1.2rem; color: var(--sun); }
.brand canvas { width: 30px; height: 30px; }
.brand h1 { margin: 0; font: inherit; }
.meter { font-family: "DotGothic16", monospace; font-size: 1.2rem; background: var(--night2); border: 2px solid var(--line); padding: .15rem .8rem; border-radius: 4px; }
.meter b { color: var(--sun); }
.meter.bump { animation: bump .5s ease; } @keyframes bump { 40% { transform: scale(1.25); } }

.room-card, .timeline-card, .roadmap-card, .places-card { background: var(--night2); border: 2px solid var(--line); border-radius: 8px; padding: 14px; box-shadow: 0 0 0 4px rgba(0, 0, 0, .25); }
.room-head { display: flex; gap: .6rem; align-items: center; margin-bottom: .6rem; flex-wrap: wrap; }
.stage-badge { font-family: "Press Start 2P", monospace; font-size: 11px; background: var(--sun); color: var(--ink); padding: .35rem .5rem; border-radius: 3px; }
.stage-note { color: #d8d0f0; font-size: .9rem; }
.room-wrap { border: 4px solid #0d0b22; border-radius: 4px; background: #0d0b22; overflow: hidden; }
.room { display: block; width: 100%; height: auto; }
.room-stage { position: relative; }
/* お部屋の物の吹き出しラベル（タップのじゃまをしない） */
.room-labels { position: absolute; inset: 0; pointer-events: none; }
/* きょうの絵（ログインボーナス）：お部屋の床に置かれるプレゼント */
.bonus-gift { position: absolute; left: 3%; bottom: 7%; display: grid; justify-items: center; gap: 2px; padding: 4px 6px; border: 2px solid #0d0b22; border-radius: 6px; background: #fff4dc; color: #3a2733; font-size: 1.5rem; line-height: 1; cursor: pointer; animation: bonus-hop 1.6s ease-in-out infinite; box-shadow: 0 3px 0 #b34d6e; }
.bonus-gift span { font: .62rem "DotGothic16", monospace; }
@keyframes bonus-hop { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(-6px); } 90% { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .bonus-gift { animation: none; } }
.bonus-img { width: 100%; height: auto; border-radius: 6px; image-rendering: auto; background: #efe4d0; aspect-ratio: 960 / 716; }
.bonus-when { margin: 0; color: #6e5f56; font-size: .85rem; }
.bonus-note { margin: 0; background: #fff1d6; border-radius: 6px; padding: .5rem .7rem; }
.rl { position: absolute; transform: translate(-50%, 9px); padding: 2px 7px; border: 2px solid #3a2733; border-radius: 6px; background: #eaf3ff; color: #2a2a4a; font: 12px/1.3 "DotGothic16", monospace; white-space: nowrap; box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.rl::before { content: ""; position: absolute; left: 50%; top: -7px; margin-left: -5px; border: 5px solid transparent; border-top: 0; border-bottom: 6px solid #3a2733; }
.rl::after { content: ""; position: absolute; left: 50%; top: -4px; margin-left: -3px; border: 3px solid transparent; border-top: 0; border-bottom: 4px solid #eaf3ff; }
.rl.above { transform: translate(-50%, calc(-100% - 9px)); }
.rl.above::before { top: auto; bottom: -7px; border: 5px solid transparent; border-bottom: 0; border-top: 6px solid #3a2733; }
.rl.above::after { top: auto; bottom: -4px; border: 3px solid transparent; border-bottom: 0; border-top: 4px solid #eaf3ff; }
.rl.locked { color: #6b6785; background: #dcdbe8; }
.progress { display: flex; gap: .7rem; align-items: center; margin: .7rem 0 .2rem; font-size: .85rem; color: #d8d0f0; }
.progress-bar { flex: 1; height: 10px; background: #0d0b22; border: 2px solid var(--line); border-radius: 2px; overflow: hidden; }
.progress-bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--sun) 0 6px, var(--sun2) 6px 12px); transition: width .8s cubic-bezier(.3, 1.4, .5, 1); }
.actions { display: flex; gap: .6rem; margin-top: .8rem; flex-wrap: wrap; }
.btn { border: 0; border-radius: 4px; padding: .55rem 1rem; font-family: "DotGothic16", monospace; font-size: 1rem; color: var(--ink); background: #e9e3ff; box-shadow: 0 4px 0 #9e95c4; transition: transform .1s; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #9e95c4; }
.btn.big { flex: 1; padding: .8rem 1rem; font-size: 1.1rem; }
.btn.sun { background: var(--sun); box-shadow: 0 4px 0 #b9842b; }
.btn.withdraw { background: var(--pink); box-shadow: 0 4px 0 #b34d6e; }
.btn.icon { width: 3.2rem; font-size: 1.3rem; }
.btn.icon.locked { filter: grayscale(1); opacity: .45; }
.btn.icon.on { background: var(--mint); box-shadow: 0 4px 0 #4f8fb8; }
.btn.ghost { background: transparent; color: #d8d0f0; box-shadow: none; border: 2px solid var(--line); }
.btn:disabled { opacity: .5; cursor: wait; }

h2 { font-family: "DotGothic16", monospace; font-weight: 400; font-size: 1.1rem; margin: 0 0 .7rem; color: var(--sun); }
h2 small { color: var(--muted); font-family: "Zen Maru Gothic", sans-serif; font-size: .75rem; margin-left: .4rem; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.timeline li { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: .8rem; align-items: start; background: rgba(255, 255, 255, .04); border-radius: 6px; padding: .6rem; animation: appIn .5s ease both; }
.timeline .tl-img { width: 72px; height: 72px; object-fit: cover; border-radius: 4px; background: #0d0b22; image-rendering: auto; }
.timeline .tl-noimg { width: 72px; height: 72px; display: grid; place-items: center; font-size: 2rem; background: #0d0b22; border-radius: 4px; }
.timeline time { font-family: "DotGothic16", monospace; color: var(--muted); font-size: .8rem; }
.timeline p { margin: .1rem 0 .2rem; overflow-wrap: anywhere; }
.tl-tags span { font-size: .75rem; background: rgba(255, 211, 92, .15); color: var(--sun); padding: 0 .4rem; border-radius: 3px; margin-right: .3rem; }
.empty { color: var(--muted); font-size: .9rem; }

.roadmap { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: .7rem; }
.roadmap li { position: relative; border: 2px solid var(--line); border-radius: 6px; padding: .7rem; background: rgba(255, 255, 255, .03); overflow: hidden; min-height: 112px; }
.roadmap li.now { border-color: var(--sun); box-shadow: var(--glow); }
.roadmap li.locked { opacity: .65; }
.roadmap b { font-family: "Press Start 2P", monospace; font-size: 11px; color: var(--sun); }
.roadmap p { margin: .4rem 0 0; font-size: .82rem; color: #d8d0f0; }
.roadmap .need { position: absolute; top: .6rem; right: .6rem; font-family: "DotGothic16", monospace; font-size: .8rem; color: var(--muted); }
.roadmap .girl { position: absolute; right: -10px; bottom: -14px; width: 92px; height: 92px; border-radius: 50%; object-fit: cover; image-rendering: auto; border: 3px solid var(--pink); }
.roadmap li.locked .girl { filter: blur(3px) grayscale(.4); }
.foot { color: var(--muted); font-size: .78rem; text-align: center; }
.link { background: none; border: 0; color: var(--mint); text-decoration: underline; margin-left: .4rem; }


.howto { margin: .4rem 0 .8rem; padding-left: 1.3rem; color: #d8d0f0; font-size: .9rem; }
.howto a { color: var(--mint); }
.file-btn { display: inline-block; cursor: pointer; }
.small { font-size: .78rem; }
.muted { color: var(--muted); }
.places-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; font-family: "DotGothic16", monospace; }
.places-map { height: 300px; border: 4px solid #0d0b22; border-radius: 4px; overflow: hidden; }
.places-btns { display: flex; gap: .5rem; flex-wrap: wrap; }
.check-badge { position: fixed; left: 12px; bottom: 12px; z-index: 70; font-family: "DotGothic16", monospace; font-size: .8rem; background: var(--mint); color: var(--ink); padding: .2rem .6rem; border-radius: 3px; }
.map-wrap { position: relative; }
.places-map.big { height: min(460px, 70vh); transition: height .4s ease; }
.pig-strip { display: block; width: 100%; height: auto; aspect-ratio: 240 / 90; background: linear-gradient(#1a1740, #0d0b22); border: 4px solid #0d0b22; border-top: 0; border-radius: 0 0 4px 4px; }
.replay-hud { position: absolute; right: 10px; top: 10px; z-index: 500; pointer-events: none; background: rgba(20, 18, 48, .78); border: 2px solid var(--sun); border-radius: 6px; padding: .5rem .8rem; min-width: 150px; }
.rp-year { font-family: "Press Start 2P", monospace; font-size: 22px; color: var(--sun); text-shadow: 3px 3px 0 #b34d6e; }
.rp-year.tick { animation: bump .35s ease; }
.rp-count { font-family: "DotGothic16", monospace; color: #fff; margin-top: .3rem; }
.rp-count b { font-size: 1.4rem; color: var(--sun); }
.rp-caption { font-size: .8rem; color: #d8d0f0; margin-top: .2rem; max-width: 220px; }
.replay-end { position: absolute; inset: 0; z-index: 600; display: grid; place-content: center; justify-items: center; text-align: center; gap: .3rem; background: rgba(20, 18, 48, .82); animation: fade .6s ease; padding: 16px; }
.rp-big { margin: 0; font-family: "DotGothic16", monospace; font-size: clamp(1.4rem, 5vw, 2.2rem); color: var(--sun); text-shadow: 3px 3px 0 #b34d6e; animation: pop .6s cubic-bezier(.3, 1.6, .5, 1); }
.rp-sub { margin: 0; color: #fff; }
.rp-next { margin: .2rem 0 .6rem; color: var(--mint); font-family: "DotGothic16", monospace; }
.star-pop { animation: starpop .5s cubic-bezier(.3, 1.8, .5, 1); transform-origin: center; transform-box: fill-box; }
@keyframes starpop { 0% { transform: scale(0); } 70% { transform: scale(1.8); } 100% { transform: scale(1); } }
.near-say { font-family: "DotGothic16", monospace; color: var(--sun); min-height: 1.4em; margin: .7rem 0 .3rem; }
.near-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.near-list li { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; background: rgba(255, 255, 255, .04); border-radius: 6px; padding: .45rem .6rem; }
.near-list span { color: var(--muted); font-size: .85rem; }
.near-list a { margin-left: auto; color: var(--mint); font-size: .85rem; }

.today-hero { display: flex; gap: .9rem; align-items: center; margin-bottom: .7rem; }
.today-hero canvas { width: 56px; height: 56px; animation: hop 1.2s ease-in-out infinite; }
.today-kicker { margin: 0; color: var(--muted); font-family: "DotGothic16", monospace; }
.today-name { margin: 0; font-family: "DotGothic16", monospace; font-size: clamp(1.6rem, 6vw, 2.4rem); color: var(--sun); text-shadow: 3px 3px 0 #b34d6e; line-height: 1.2; }
.today-name.pop { animation: drop .6s cubic-bezier(.3, 1.6, .5, 1); }
.today-name.spin { opacity: .75; filter: blur(.4px); }
/* 休日ガチャの当たり：ミニ雑誌 */
.mag { margin: 12px 0; padding: 14px 16px 16px; background: #fffaf0; color: #3a2a2a; border: 3px solid #fff; border-radius: 6px; box-shadow: 4px 4px 0 #b34d6e; font-family: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif; }
.mag-top { display: flex; justify-content: space-between; gap: 8px; font: 700 .68rem/1 "DotGothic16", monospace; letter-spacing: .12em; color: #b34d6e; border-bottom: 2px solid #3a2a2a; padding-bottom: 6px; }
.mag-catch { margin: 12px 0 10px; font-size: clamp(1.3rem, 4.6vw, 1.8rem); font-weight: 900; line-height: 1.35; background: linear-gradient(transparent 62%, #ffd9e4 62%); display: inline; }
.mag-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 12px 0; border-top: 1px solid #3a2a2a; border-bottom: 1px solid #3a2a2a; }
.mag-stats > div { padding: 8px 6px; text-align: center; }
.mag-stats > div + div { border-left: 1px dotted #3a2a2a; }
.mag-stats small { display: block; font: .62rem/1.2 "DotGothic16", monospace; letter-spacing: .1em; color: #8a6a6a; }
.mag-stats b { display: block; margin-top: 2px; font-size: clamp(.95rem, 3.4vw, 1.25rem); line-height: 1.3; }
.mag-body { column-count: 2; column-gap: 18px; column-rule: 1px solid #e6d5c5; font-size: .88rem; line-height: 1.85; text-align: justify; }
.mag-body p { margin: 0; }
.mag-body p:first-child::first-letter { float: left; margin: 2px 6px 0 0; font-size: 2.6em; line-height: .9; font-weight: 900; color: #b34d6e; }
.mag-photos { display: grid; grid-template-columns: 9fr 8fr; gap: 8px; margin: 14px 0; align-items: start; } /* 横長2枚(3:2)を重ねた高さ ≒ 縦長1枚(2:3)の高さ */
.mag-photos figure { margin: 0; position: relative; overflow: hidden; border: 3px solid #fff; box-shadow: 2px 2px 0 #d9c3b0; opacity: 0; transform: translateY(14px) rotate(-1deg) scale(.96); animation: photo-in .5s cubic-bezier(.3, 1.5, .5, 1) forwards; }
.mag-photos figure:nth-child(1), .mag-photos figure:nth-child(2) { aspect-ratio: 3 / 2; }
.mag-photos figure:nth-child(1) { grid-row: 1 / 2; }
.mag-photos figure:nth-child(2) { grid-row: 2 / 3; animation-delay: .25s; transform: translateY(14px) rotate(1deg) scale(.96); }
.mag-photos figure:nth-child(3) { grid-column: 2; grid-row: 1 / 3; animation-delay: .5s; align-self: stretch; }
.mag-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mag-photos figcaption { position: absolute; left: 0; bottom: 0; padding: 2px 8px; background: rgba(255, 250, 240, .9); font: .62rem/1.6 "DotGothic16", monospace; color: #3a2a2a; }
.mag-quote { margin: 4px 0 0; padding: 8px 0 0 30px; position: relative; border-top: 2px solid #3a2a2a; font-size: 1.05rem; font-weight: 900; line-height: 1.6; color: #b34d6e; }
.mag-quote::before { content: "“"; position: absolute; left: 0; top: -2px; font-size: 3rem; line-height: 1; color: #ffb3c9; }
@keyframes photo-in { to { opacity: 1; transform: none; } }
@media (max-width: 560px) { .mag-body { column-count: 1; } }
@media (prefers-reduced-motion: reduce) { .mag-photos figure { animation: none; opacity: 1; transform: none; } }
.today-info { margin: .2rem 0 0; color: #d8d0f0; font-size: .92rem; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.dest-pin { font-size: 30px; line-height: 1; filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, .5)); animation: hop 1s ease-in-out infinite; }

.borrow { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; padding: 16px; background: rgba(8, 6, 24, .8); animation: fade .4s ease; }
.borrow.out { animation: fadeOut .4s ease forwards; }
.borrow-card { width: min(760px, 100%); background: var(--night2); border: 2px solid var(--sun); border-radius: 8px; padding: 12px; box-shadow: 6px 6px 0 #b34d6e; display: grid; gap: .6rem; }
.borrow-title { margin: 0; font-family: "DotGothic16", monospace; color: var(--sun); text-align: center; }
.borrow-map { height: min(380px, 52vh); border: 4px solid #0d0b22; border-radius: 4px; overflow: hidden; }
.borrow-skip { justify-self: end; font-size: .8rem; }

.quick { margin-top: .8rem; background: rgba(255, 255, 255, .04); border: 2px solid var(--line); border-radius: 8px; padding: .7rem; display: grid; gap: .5rem; }
.quick-head { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.quick-slot { font-family: "DotGothic16", monospace; background: var(--mint); color: var(--ink); padding: .05rem .5rem; border-radius: 3px; }
.quick-say { color: #f4efff; font-size: .92rem; }
.quick-done { display: flex; gap: .4rem; margin: .45rem 0 .1rem; }
.quick-done .qd { position: relative; display: inline-flex; align-items: center; gap: .2rem; padding: .1rem .5rem; border-radius: 999px; border: 1.5px dashed rgba(255,255,255,.35); color: rgba(244,239,255,.6); font-size: .85rem; filter: grayscale(.8); }
.quick-done .qd small { font-size: .72rem; }
.quick-done .qd.on { border-style: solid; border-color: var(--sun); background: rgba(255,210,90,.18); color: #fff6d8; filter: none; }
.quick-done .qd i { font-style: normal; color: var(--sun); font-weight: 700; }
.quick-done.pop .qd.on { animation: qd-pop .5s ease; }
@keyframes qd-pop { 40% { transform: scale(1.18); } }
@media (prefers-reduced-motion: reduce) { .quick-done.pop .qd.on { animation: none; } }
.quick-main { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.quick-all { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: .4rem; }
.qbtn { display: grid; justify-items: center; gap: .1rem; border: 2px solid var(--line); background: var(--night); color: #f4efff; border-radius: 8px; padding: .45rem .3rem; cursor: pointer; transition: transform .12s, border-color .2s; }
.qbtn span { font-size: 1.4rem; line-height: 1.2; }
.qbtn small { font-family: "DotGothic16", monospace; font-size: .78rem; }
.qbtn.big { padding: .7rem .3rem; } .qbtn.big span { font-size: 2rem; }
.qbtn:hover { border-color: var(--sun); } .qbtn:active { transform: scale(.94); }
.qbtn.glow { border-color: var(--sun); box-shadow: 0 0 0 3px rgba(255, 211, 92, .35), 0 0 22px rgba(255, 211, 92, .6); animation: pulse 1.2s ease-in-out infinite; }
.quick-more { justify-self: start; font-size: .8rem; }
.quick-ask { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; font-size: .9rem; color: var(--sun); }
.mini-link { background: none; border: 0; color: var(--mint); text-decoration: underline; font-size: .82rem; cursor: pointer; }
body.demo { padding-bottom: 170px; }
.demo-hud { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 45; width: min(640px, calc(100vw - 24px)); background: rgba(20, 18, 48, .95); border: 2px solid var(--sun); border-radius: 8px; padding: .7rem .9rem; box-shadow: 6px 6px 0 #b34d6e; display: grid; gap: .4rem; }
.demo-top { display: flex; gap: .8rem; align-items: baseline; justify-content: space-between; flex-wrap: wrap; font-family: "DotGothic16", monospace; }
.demo-top b { color: var(--sun); }
.demo-when { color: var(--mint); }
.demo-say { margin: 0; min-height: 1.6em; }
.demo-btns { display: flex; gap: .5rem; flex-wrap: wrap; }
.demo-banner { position: fixed; top: 30%; left: 50%; transform: translate(-50%, -50%); z-index: 46; font-family: "DotGothic16", monospace; font-size: clamp(2rem, 9vw, 4rem); color: var(--sun); text-shadow: 4px 4px 0 #b34d6e; pointer-events: none; opacity: 0; }
.demo-banner.show { animation: banner 1.3s ease forwards; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.8); } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%); } }


/* ---------- モーダル ---------- */
.dlg { border: 0; padding: 0; background: transparent; color: inherit; max-width: min(520px, calc(100vw - 24px)); width: 100%; }
.dlg::backdrop { background: rgba(8, 6, 24, .72); backdrop-filter: blur(2px); }
.dlg[open] { animation: dlgIn .45s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes dlgIn { from { opacity: 0; transform: translateY(30px) scale(.94); } }
.dlg-body { background: var(--paper); color: var(--ink); border-radius: 8px; padding: 1.1rem; display: grid; gap: .8rem; box-shadow: 6px 6px 0 #b34d6e; }
.dlg-title { color: var(--ink); text-align: center; margin: 0; }
.photo-drop { display: grid; place-items: center; min-height: 150px; border: 3px dashed #d9c9b0; border-radius: 6px; cursor: pointer; overflow: hidden; background: #fff; }
.photo-drop img { width: 100%; max-height: 260px; object-fit: cover; }
.photo-drop { position: relative; }
.photo-drop.chip-pic::after { content: "📷 タップで写真にかえられるよ"; position: absolute; right: 6px; bottom: 6px; padding: 3px 8px; border-radius: 999px; background: rgba(255, 248, 239, .92); color: #6e5f56; font-size: .72rem; }
#photo-hint { color: #8a7a70; }
.dlg textarea { width: 100%; border: 2px solid #e6d8c2; border-radius: 6px; padding: .6rem .7rem; font: inherit; color: var(--ink); background: #fff; resize: vertical; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag { border: 2px solid #e6d8c2; background: #fff; color: var(--ink); border-radius: 999px; padding: .15rem .7rem; font-size: .9rem; }
.tag.on { background: var(--sun); border-color: #e2a92b; animation: bump .35s ease; }
.dlg-actions { display: flex; justify-content: flex-end; gap: .6rem; }
.dlg .btn.ghost { color: #6e5f56; border-color: #e6d8c2; }
.memory .dlg-body { text-align: center; }
.mem-date { font-family: "DotGothic16", monospace; color: #b34d6e; margin: 0; }
.memory img { width: 100%; max-height: 340px; object-fit: cover; border-radius: 6px; animation: develop 1.4s ease; }
@keyframes develop { from { filter: brightness(2.2) blur(6px); } }
.mem-text { font-size: 1.1rem; margin: 0; }
.mem-talk { display: flex; gap: .6rem; align-items: center; text-align: left; background: #fff1d6; border-radius: 6px; padding: .5rem .7rem; }
.mem-talk canvas, .guide-card canvas { width: 40px; height: 40px; flex: none; }
.mem-talk p { margin: 0; }

/* ---------- 案内（オンボーディング） ---------- */
.guide { position: fixed; inset: 0; z-index: 50; display: grid; align-items: end; justify-items: center; padding: 16px; background: rgba(8, 6, 24, .55); animation: fade .3s ease; }
.guide.spot { background: transparent; pointer-events: none; }
.guide-card { position: relative; pointer-events: auto; width: min(560px, 100%); background: var(--paper); color: var(--ink); border-radius: 8px; padding: 1rem; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .3rem .8rem; box-shadow: 6px 6px 0 #b34d6e; animation: dlgIn .45s cubic-bezier(.3, 1.5, .5, 1); margin-bottom: 8vh; }
.guide-card canvas { width: 56px; height: 56px; animation: hop 1.2s ease-in-out infinite; }
@keyframes hop { 50% { transform: translateY(-5px); } }
.guide-text { margin: 0; font-size: 1.05rem; min-height: 3.2em; align-self: center; }
.guide-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
.spot-ring { position: fixed; z-index: 49; border-radius: 8px; box-shadow: 0 0 0 9999px rgba(8, 6, 24, .62); pointer-events: auto; cursor: default; /* 光っているところの上にかぶせて、押せないようにする（吹き出しのボタンで進む） */ transition: all .45s cubic-bezier(.3, 1.2, .5, 1); }
.spot-ring::after { content: ""; position: absolute; inset: -6px; border-radius: 12px; border: 3px solid var(--sun); animation: ring 1.3s ease-out infinite; }
@keyframes ring { from { opacity: 1; transform: scale(.97); } to { opacity: 0; transform: scale(1.06); } }
.cursor { position: fixed; z-index: 60; width: 28px; height: 28px; pointer-events: none; transition: left .7s cubic-bezier(.3, .9, .3, 1), top .7s cubic-bezier(.3, .9, .3, 1); filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, .5)); }

/* 引っ越しのお祝い */
.party { position: fixed; inset: 0; z-index: 60; display: grid; place-content: center; text-align: center; background: rgba(8, 6, 24, .8); animation: fade .3s ease; }
.party h3 { font-family: "DotGothic16", monospace; font-weight: 400; font-size: clamp(1.6rem, 6vw, 2.6rem); color: var(--sun); margin: 0; text-shadow: 3px 3px 0 #b34d6e; animation: pop .6s cubic-bezier(.3, 1.6, .5, 1); }
.party p { color: #fff; margin: .6rem 0 1.2rem; }
.confetti { position: fixed; width: 6px; height: 6px; z-index: 61; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

@media (max-width: 560px) { .actions .btn.big { flex-basis: 40%; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; scroll-behavior: auto !important; }
  .confetti { display: none; } /* 紙ふぶきは出さない */
}

/* ---------- 左の空きスペース：カレンダーとスケジュール（広い画面だけ） ---------- */
.side { display: none; }
@media (min-width: 1440px) {
  .side { --sw: min(300px, calc(50vw - 460px - 32px)); display: grid; gap: 14px; position: fixed; top: 72px; width: var(--sw); left: calc(50vw - 460px - var(--sw) - 16px); max-height: calc(100vh - 88px); overflow: auto; padding: 2px 6px 8px 2px; scrollbar-width: none; font-family: "Zen Maru Gothic", system-ui, sans-serif; }
  .side::-webkit-scrollbar { display: none; }
}
.side-card { background: var(--paper); color: var(--ink); border: 3px solid #fff; border-radius: 10px; box-shadow: 4px 4px 0 #b34d6e; padding: 10px 12px 12px; }
.side-card header { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.side-card h2, .side-card h3 { margin: 0; white-space: nowrap; font-size: .95rem; letter-spacing: .04em; }
.side-card h2 { color: inherit; font: 700 .95rem "Zen Maru Gothic", sans-serif; } /* 全体の h2（黄色・ドット文字）ではなく、h3 だったときと同じ見た目に */
.side-card header small { font: .7rem/1 "DotGothic16", monospace; color: #b34d6e; }
.cal header button { width: 26px; height: 26px; border: 0; border-radius: 50%; background: #ffe3ec; color: #b34d6e; font-weight: 900; line-height: 1; }
.cal header button:hover { background: #ffc9da; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px 0; text-align: center; font-size: .78rem; }
.cal-grid span { font: .68rem/1.8 "DotGothic16", monospace; color: #8a6a8a; }
.cal-grid .sun { color: #e0587f; }
.cal-grid .sat { color: #4a8fd0; }
.cal-grid b { position: relative; display: grid; place-items: center; height: 30px; font-weight: 700; border-radius: 50%; }
.cal-grid b.sun { color: #e0587f; }
.cal-grid b.sat { color: #4a8fd0; }
.cal-grid b.today { background: var(--pink); color: #fff; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--pink); }
.cal-grid b.got::after { content: "☀"; position: absolute; right: -1px; top: -3px; font-size: .62rem; color: #f0a020; }
.cal-note { margin: 8px 0 0; font-size: .72rem; color: #8a6a8a; text-align: center; }
.tl ol { list-style: none; margin: 0; padding: 0; position: relative; }
.tl ol::before { content: ""; position: absolute; left: 52px; top: 10px; bottom: 10px; border-left: 2px dotted #e6b8c8; }
.tl li { display: grid; grid-template-columns: 38px 28px minmax(0, 1fr); gap: 0 4px; align-items: start; padding: 5px 0; }
.tl time { font: .74rem/1.8 "DotGothic16", monospace; color: #8a6a8a; text-align: right; }
.tl .dot { position: relative; z-index: 1; width: 14px; height: 14px; margin: 5px auto 0; border-radius: 50%; background: #ffd9e4; border: 2px solid #fff; box-shadow: 0 0 0 1px #e6b8c8; font-size: 1.1rem; }
.tl li div b { display: block; font-size: .85rem; line-height: 1.5; }
.tl li div small { display: block; font-size: .85rem; letter-spacing: .15em; opacity: .85; }
.tl li div em { display: block; margin-top: 4px; padding: 5px 8px; border-radius: 8px 8px 8px 2px; background: #fff0b8; font-style: normal; font-size: .74rem; line-height: 1.5; }
.tl li.now .dot { width: 26px; height: 26px; margin: 0 0 0 -6px; background: var(--sun); display: grid; place-items: center; line-height: 1; animation: nowhop 1.4s ease-in-out infinite; }
.tl li.now div b { color: #b34d6e; }
@keyframes nowhop { 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .tl li.now .dot { animation: none; } }
.tl-tabs { display: flex; gap: 6px; margin: 0 0 8px; }
.tl-tabs button { flex: 1; padding: 4px 0; border: 2px solid #ffd9e4; border-radius: 999px; background: #fff; color: #b34d6e; font: 700 .78rem/1.4 "Zen Maru Gothic", sans-serif; }
.tl-tabs button.on { background: var(--pink); border-color: var(--pink); color: #fff; }
.tl time small { display: block; font-size: .62rem; color: #b8a0b0; line-height: 1.2; }
.tl li.next .dot { background: #fff; border-color: var(--pink); }
.tl .nx { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--pink); color: #fff; font: .62rem/1.6 "DotGothic16", monospace; vertical-align: middle; }
.tl li.empty { display: block; padding: 8px 0; font-size: .74rem; color: #8a6a8a; text-align: center; }

/* ---------- ぽちっとタイムライン（モーダル） ---------- */
.tlm { max-width: min(780px, calc(100vw - 20px)); }
.tlm-body { background: #1b1840; color: #f4efff; border: 3px solid #fff; border-radius: 12px; box-shadow: 6px 6px 0 #b34d6e; padding: 12px 14px 14px; display: grid; gap: 8px; }
.tlm-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tlm-head h2 { margin: 0; flex: 1; min-width: 0; font-family: "DotGothic16", monospace; font-size: 1.15rem; color: var(--sun); text-shadow: 2px 2px 0 #b34d6e; }
.tlm .days { display: flex; gap: 6px; }
.tlm .days button { padding: 3px 14px; border-radius: 999px; border: 2px solid rgba(255, 255, 255, .2); background: transparent; color: #f4efff; font: inherit; font-size: .82rem; }
.tlm .days button.on { background: var(--pink); border-color: var(--pink); color: #2b2140; font-weight: 700; }
.tlm-help, .tlm-note { margin: 0; font-size: .78rem; color: #cfc6ea; }
.tlm-note { color: #8d84a8; font-size: .72rem; }
.tlm-scroll { height: min(64vh, 640px); overflow-y: auto; border-radius: 10px; border: 2px solid rgba(255, 255, 255, .13); background: rgba(255, 255, 255, .04); }
.tlm-grid { position: relative; cursor: crosshair; user-select: none; }
.tlm .hour { position: relative; height: var(--h, 64px); border-top: 1px solid rgba(255, 255, 255, .13); }
.tlm .hour:first-child { border-top: 0; }
.tlm .hour span { position: absolute; left: 8px; top: -9px; padding: 0 4px; background: #1b1840; font: .72rem/1.2 "DotGothic16", monospace; color: #8d84a8; }
.tlm .hour:first-child span { top: 4px; }
.tlm .hour::after { content: ""; position: absolute; left: 62px; right: 0; top: 50%; border-top: 1px dotted rgba(255, 255, 255, .07); }
.tlm .ghost { position: absolute; left: 62px; right: 0; height: 0; border-top: 2px dashed var(--pink); pointer-events: none; opacity: 0; transition: opacity .1s; z-index: 1; }
.tlm .ghost i { position: absolute; right: 8px; top: -22px; padding: 1px 8px; border-radius: 999px; background: var(--pink); color: #2b2140; font: .72rem/1.6 "DotGothic16", monospace; font-style: normal; }
.tlm-grid:hover .ghost { opacity: .9; }
.tlm-grid.dragging .ghost, .tlm-grid.dragging .legs { opacity: 0; }
.tlm .nowline { position: absolute; left: 54px; right: 0; border-top: 2px solid #ff5d73; pointer-events: none; z-index: 2; }
.tlm .nowline::before { content: ""; position: absolute; left: -6px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: #ff5d73; }
.tlm .pin { position: absolute; left: 66px; right: 10px; z-index: 3; animation: pinDrop .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pinDrop { from { transform: translateY(-14px); opacity: 0; } }
.tlm .pin.lift { z-index: 6; animation: none; }
.tlm .pin.lift .card { transform: scale(1.02) rotate(-.6deg); box-shadow: 6px 8px 0 #b34d6e; }
.tlm .card { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 104px) auto auto; gap: 6px; align-items: center; padding: 4px 8px; background: var(--paper); color: var(--ink); border-radius: 8px; box-shadow: 3px 3px 0 #b34d6e; transition: transform .1s; }
.tlm .grip { display: inline-flex; align-items: center; gap: 4px; cursor: grab; touch-action: none; padding: 2px 4px; border-radius: 6px; background: #ffe3ec; }
.tlm .grip:active { cursor: grabbing; }
.tlm .grip i { font-style: normal; font-size: 1rem; line-height: 1; }
.tlm .grip time { font: 700 .76rem/1 "DotGothic16", monospace; color: #b34d6e; white-space: nowrap; }
.tlm .card input { min-width: 0; width: 100%; border: 0; border-bottom: 1px dashed #d9c3b0; background: transparent; font: inherit; font-size: .85rem; color: var(--ink); padding: 2px 0; }
.tlm .card input.place { color: #4a8fd0; }
.tlm .card input:focus { outline: 0; border-bottom-color: #b34d6e; }
.tlm .card button { border: 0; background: transparent; color: #b34d6e; font-size: 1rem; cursor: pointer; line-height: 1; }
.tlm .legs { position: absolute; inset: 0; pointer-events: none; z-index: 4; transition: opacity .1s; }
.tlm .leg { position: absolute; right: 12px; width: 190px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px; pointer-events: auto; }
.tlm .leg::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 3px dotted var(--mint); opacity: .45; z-index: -1; }
.tlm .gap { padding: 1px 9px; border-radius: 999px; background: #2b2760; color: #e8e2ff; font-size: .7rem; border: 1px solid rgba(255, 255, 255, .2); white-space: nowrap; }
.tlm .gap b { color: var(--sun); }
.tlm .res { padding: 4px 9px; border-radius: 8px; background: #e7f6ff; color: #12304a; font-size: .7rem; line-height: 1.45; text-align: center; box-shadow: 2px 2px 0 #3a6f94; max-width: 100%; }
.tlm .res b { font-size: .8rem; }
.tlm .res.ok { background: #e4ffe9; box-shadow: 2px 2px 0 #3d8a52; }
.tlm .res.tight { background: #fff3c9; box-shadow: 2px 2px 0 #b8902b; }
.tlm .res.ng { background: #ffe1e1; box-shadow: 2px 2px 0 #c0505a; }
.tlm .res small { display: block; color: #5b6a78; font-size: .62rem; }
.tlm .res button { margin-top: 1px; border: 0; background: transparent; color: #3a6f94; font-size: .64rem; text-decoration: underline; cursor: pointer; }
@media (max-width: 560px) { .tlm .leg { width: 150px; } .tlm .card { grid-template-columns: auto minmax(0, 1fr) auto; } .tlm .card input.place { grid-column: 2; grid-row: 2; } }
/* 左サイドバーの「ひらく」ボタン */
.tl-open { padding: 2px 10px; border: 2px solid #ffd9e4; border-radius: 999px; background: #fff; color: #b34d6e; font: 700 .72rem/1.5 "Zen Maru Gothic", sans-serif; cursor: pointer; }
.tl-open:hover { background: #ffe3ec; }
.tlm-home { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .8rem; }
.tlm-home label { display: flex; align-items: center; gap: 6px; }
.tlm-home input { width: 9.5em; padding: 3px 8px; border: 2px solid rgba(255, 255, 255, .2); border-radius: 999px; background: #120f2c; color: #f4efff; font: inherit; }
.tlm-home input:focus { outline: 0; border-color: var(--pink); }
.tlm-home .btn { padding: 2px 12px; font-size: .78rem; }
.tlm-home small { color: #8fd3ff; }
.tlm-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tlm-foot .tlm-note { flex: 1; min-width: 0; }
.tlm-trip { flex: none; padding: 2px 10px; border: 1px dashed rgba(255, 255, 255, .25); border-radius: 999px; background: transparent; color: #a79fc4; font: .7rem/1.6 "Zen Maru Gothic", sans-serif; cursor: pointer; opacity: .75; transition: opacity .15s, color .15s; }
.tlm-trip:hover { opacity: 1; color: var(--sun); border-color: var(--sun); }
.tlm-trip:disabled { cursor: wait; }
.tlm-tripmsg { margin: 0; padding: 6px 10px; border-radius: 8px; background: #2b2760; font-size: .78rem; color: #f4efff; }
.tlm-tripmsg b { color: var(--sun); }
.tlm-tripmsg button { margin-left: 4px; padding: 0 8px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 999px; background: transparent; color: var(--mint); font: inherit; cursor: pointer; }
.tlm-dates { display: flex; align-items: center; gap: 6px; }
.tlm-dates button { min-width: 30px; padding: 2px 10px; border: 2px solid rgba(255, 255, 255, .2); border-radius: 999px; background: transparent; color: #f4efff; font: inherit; font-size: .85rem; cursor: pointer; }
.tlm-dates button:hover { border-color: var(--pink); }
.tlm-dates input { padding: 2px 10px; border: 2px solid rgba(255, 255, 255, .2); border-radius: 999px; background: #120f2c; color: #f4efff; font: inherit; font-size: .85rem; }
.tlm-dateinfo { margin: 0; font-size: .76rem; color: #8fd3ff; }
.tlm-dateinfo button { margin-left: 6px; padding: 0 10px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 999px; background: transparent; color: var(--sun); font: inherit; cursor: pointer; }
.cal-grid b[data-day] { cursor: pointer; }
.cal-grid b[data-day]:hover { background: #ffe3ec; }
.cal-grid b.today:hover { background: var(--pink); }
.cal-grid b.pick { outline: 2px solid #b34d6e; outline-offset: -2px; }
.cal-grid b.plan::before { content: ""; position: absolute; left: 50%; bottom: 1px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: #4a8fd0; }
.cal-grid b.today.plan::before { background: #fff; }
.tl-src { margin: -2px 0 6px; font-size: .7rem; color: #8a6a8a; }
.tl-src.own { color: #4a8fd0; font-weight: 700; }

.tlm .span { position: absolute; left: 56px; width: 7px; border-radius: 4px; background: linear-gradient(#ffb3c9, #ff9db8); opacity: .8; z-index: 2; }
.tlm .endgrip { position: absolute; left: -12px; bottom: -9px; padding: 0 7px; border-radius: 999px; background: var(--pink); color: #2b2140; font: 700 .64rem/1.7 "DotGothic16", monospace; font-style: normal; cursor: ns-resize; touch-action: none; box-shadow: 1px 1px 0 #b34d6e; white-space: nowrap; }
.tlm .card .endbtn { padding: 1px 6px; border: 1px solid #e6b8c8; border-radius: 999px; font: 700 .64rem/1.5 "Zen Maru Gothic", sans-serif; color: #b34d6e; }
@media (max-width: 560px) { .tlm .card { grid-template-columns: auto minmax(0, 1fr) auto auto; } }
.tlm-head .btn:disabled { opacity: .35; cursor: default; }

/* ---------- 針をなおすモーダル ---------- */
.pinm { max-width: min(460px, calc(100vw - 20px)); }
.pinm-body { background: var(--paper); color: var(--ink); border-radius: 10px; padding: 14px 16px; display: grid; gap: 10px; box-shadow: 6px 6px 0 #b34d6e; }
.pinm-body h3 { margin: 0; text-align: center; }
.pinm-body label { display: grid; gap: 2px; font-size: .82rem; font-weight: 700; }
.pinm-body input[type="text"], .pinm-body input:not([type]), .pinm-body input[list] { padding: 6px 10px; border: 2px solid #e6d8c2; border-radius: 8px; font: inherit; color: var(--ink); background: #fff; }
.pinm-time small { display: block; font-size: .72rem; font-weight: 700; color: #b34d6e; }
.stepper { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.stepper input[type="time"] { padding: 4px 8px; border: 2px solid #e6d8c2; border-radius: 8px; font: 700 1.1rem "DotGothic16", monospace; color: var(--ink); background: #fff; }
.stepper button { padding: 3px 8px; border: 2px solid #ffd9e4; border-radius: 999px; background: #fff; color: #b34d6e; font: 700 .76rem/1.4 "Zen Maru Gothic", sans-serif; cursor: pointer; }
.stepper button:hover { background: #ffe3ec; }
.stepper button.ghost { border-color: #e6d8c2; color: #8a7a70; }
.pinm-body label.chk { display: flex; align-items: center; gap: 6px; font-weight: 500; font-size: .76rem; color: #6b5d70; }
.pinm-info { margin: 0; text-align: center; font-size: .82rem; color: #4a8fd0; font-weight: 700; }
.pinm-info.ng { color: #c0505a; }
.pinm-body .dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }
/* 時間・針をクリックできるとわかるように */
.tlm .grip { transition: background .1s; }
.tlm .grip:hover { background: #ffc9da; }
.tlm-head .btn.icon { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; font-size: 1rem; }

/* ---------- カフェ：喫茶 月明かり ＋ ポジティブの街 ---------- */
.cafe-card { background: rgba(255, 255, 255, .05); border: 2px solid var(--line); border-radius: 12px; padding: 14px 16px 16px; }
.cafe-card h2 { margin: 0 0 10px; font-size: 1.1rem; }
.cafe-card h2 small { font-size: .75rem; color: var(--muted); font-weight: 500; margin-left: 6px; }
.cafe-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 720px) { .cafe-grid { grid-template-columns: 1fr; } }
.cafe-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.cafe-tabs button { padding: 3px 16px; border-radius: 999px; border: 2px solid var(--line); background: transparent; color: #f4efff; font: inherit; font-size: .82rem; }
.cafe-tabs button.on { background: var(--sun); border-color: var(--sun); color: #2b2140; font-weight: 700; }
.cafe-stage { position: relative; width: 100%; border-radius: 10px; overflow: hidden; border: 3px solid #fff; box-shadow: 4px 4px 0 #b34d6e; background-size: cover; background-position: center; }
.cafe-stage.out { aspect-ratio: 4 / 3; background-color: #1b2a4a; background-image: linear-gradient(#1b2a4a 0 55%, #5a4a6a 80%, #c58b5a); }
.cafe-stage.in { aspect-ratio: 16 / 9; background-color: #3a2a22; background-image: linear-gradient(90deg, #cdbfa6 0 52%, #5a3d2a 52%); }
.cafe-stage.has-art > [class^="ph-"] { display: none; }
.cafe-caption { margin: 8px 2px 0; font-size: .8rem; color: #cfc6ea; }
/* 仮の絵（絵が納品されたら、自動で消える） */
.ph-moon { position: absolute; right: 12%; top: 10%; width: 16%; aspect-ratio: 1; border-radius: 50%; background: #ffe9a8; box-shadow: 0 0 40px 12px rgba(255, 233, 168, .45); }
.ph-shop { position: absolute; left: 12%; bottom: 14%; width: 56%; height: 52%; background: #2c2a44; border-radius: 6px 6px 0 0; box-shadow: inset 0 -6px 0 #1b1a30; }
.ph-shop::before { content: ""; position: absolute; left: -4%; right: -4%; top: -14%; height: 18%; background: #3a3560; clip-path: polygon(8% 100%, 50% 0, 92% 100%); }
.ph-sign { position: absolute; left: 50%; top: 6%; transform: translateX(-50%); padding: 2px 12px; border-radius: 999px; background: #fff4dc; color: #2c2a44; font: 700 clamp(.6rem, 2vw, .85rem)/1.6 "Zen Maru Gothic", sans-serif; white-space: nowrap; }
.ph-door { position: absolute; left: 14%; bottom: 0; width: 24%; height: 58%; background: #ffd35c; opacity: .85; border-radius: 3px 3px 0 0; }
.ph-win { position: absolute; right: 12%; top: 34%; width: 30%; height: 30%; background: #ffd35c; opacity: .75; border-radius: 4px; }
.ph-ground { position: absolute; left: 0; right: 0; bottom: 0; height: 14%; background: #4a3a38; }
.cafe-enter { position: absolute; left: 14%; bottom: 18%; padding: 4px 12px; border: 2px solid #fff; border-radius: 999px; background: rgba(27, 26, 48, .8); color: #fff4dc; font: 700 .8rem/1.5 "Zen Maru Gothic", sans-serif; cursor: pointer; }
.cafe-enter:hover { background: var(--sun); color: #2b2140; }
.ph-counter { position: absolute; right: 2%; bottom: 0; width: 44%; height: 38%; background: #6b4a30; border-radius: 6px 6px 0 0; box-shadow: inset 0 6px 0 #8a5a3a; }
.ph-lamp { position: absolute; top: 0; width: 7%; aspect-ratio: 1; border-radius: 0 0 50% 50%; background: #ffd35c; box-shadow: 0 6px 24px 8px rgba(255, 211, 92, .5); }
.ph-lamp.l1 { right: 20%; height: 14%; } .ph-lamp.l2 { right: 36%; height: 9%; }
.frame { position: absolute; padding: 3%; border: 0; background: #7a4f2e; box-shadow: 0 0 0 2px #9a6a3e inset, 2px 3px 0 rgba(0, 0, 0, .35), 0 -10px 22px 2px rgba(255, 211, 92, .35); cursor: zoom-in; }
.frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame:hover { transform: scale(1.03); }
.cafe-right h3 { margin: 0 0 6px; font-size: .95rem; }
.town { position: relative; width: 100%; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 3px solid #fff; box-shadow: 4px 4px 0 #b34d6e; background: #2a3a55 center / cover; }
.town.has-art .town-ph { display: none; }
.town-ph { position: absolute; inset: 0; width: 100%; height: 100%; }
.lot { position: absolute; width: 12%; aspect-ratio: 1; transform: translate(-50%, -50%); border: 2px dashed rgba(255, 244, 220, .65); border-radius: 6px; background: rgba(255, 244, 220, .12); color: #fff; font-size: 1rem; cursor: pointer; padding: 0; }
.lot.shop { border: 2px solid var(--sun); background: rgba(255, 211, 92, .3); }
.lot.on { box-shadow: 0 0 0 3px var(--pink); }
.lot:hover { background: rgba(255, 244, 220, .3); }
.town-say { margin: 8px 2px 0; font-size: .8rem; color: #cfc6ea; min-height: 3em; }
.cafe-zoom { max-width: min(900px, calc(100vw - 20px)); }
.cafe-zoom figure { margin: 0; background: #1b1840; border: 3px solid #fff; border-radius: 10px; padding: 8px; }
.cafe-zoom img { width: 100%; max-height: 80vh; object-fit: contain; display: block; border-radius: 6px; }
.cafe-zoom figcaption { text-align: center; padding: 6px; color: #f4efff; font-size: .9rem; }

/* 絵が入ったときの調整（納品された絵に合わせて） */
.cafe-stage.has-art .cafe-enter { left: 30.5%; top: 36%; bottom: auto; width: 19%; height: 41%; padding: 0; border: 0; border-radius: 6px; background: transparent; font-size: 0; animation: doorGlow 2.4s ease-in-out infinite; }
.cafe-stage.has-art .cafe-enter::after { content: "🚪 中に入る"; position: absolute; left: 50%; top: -30px; transform: translateX(-50%); padding: 2px 12px; border-radius: 999px; background: rgba(27, 26, 48, .85); border: 2px solid #fff; color: #fff4dc; font: 700 .78rem/1.5 "Zen Maru Gothic", sans-serif; white-space: nowrap; opacity: 0; transition: opacity .15s; pointer-events: none; }
.cafe-stage.has-art .cafe-enter:hover::after, .cafe-stage.has-art .cafe-enter:focus-visible::after { opacity: 1; }
.cafe-stage.has-art .cafe-enter:hover { background: rgba(255, 211, 92, .16); box-shadow: 0 0 0 3px rgba(255, 211, 92, .8); }
@keyframes doorGlow { 50% { box-shadow: 0 0 0 3px rgba(255, 211, 92, .5), 0 0 22px 6px rgba(255, 211, 92, .35); } }
.cafe-stage.in.has-art .frame { box-shadow: 0 0 0 2px #9a6a3e inset, 2px 4px 0 rgba(0, 0, 0, .4), 0 8px 18px rgba(0, 0, 0, .35); }
.town.has-art .lot { width: 14%; border: 0; background: transparent; border-radius: 50%; font-size: 0; }
.town.has-art .lot:hover { background: rgba(255, 244, 220, .18); box-shadow: 0 0 0 2px rgba(255, 244, 220, .65); }
.town.has-art .lot.shop::after { content: "🌙"; position: absolute; left: 50%; top: -14%; transform: translateX(-50%); font-size: 1.3rem; filter: drop-shadow(0 0 6px rgba(255, 211, 92, .9)); animation: moonBob 2.2s ease-in-out infinite; }
.town.has-art .lot.on { box-shadow: 0 0 0 3px var(--pink); }
@keyframes moonBob { 50% { transform: translate(-50%, -4px); } }
@media (prefers-reduced-motion: reduce) { .cafe-stage.has-art .cafe-enter, .town.has-art .lot.shop::after { animation: none; } }

/* ---------- 右の空きスペース：ポジティブの街（地図だけ）。左のカレンダーと左右対称 ---------- */
.town-side { max-width: 920px; margin: 0 auto 48px; padding: 0 16px; }
@media (min-width: 1440px) {
  .town-side { --sw: min(300px, calc(50vw - 460px - 32px)); position: fixed; top: 72px; width: var(--sw); left: calc(50vw + 460px + 16px); margin: 0; padding: 2px 2px 8px 6px; max-height: calc(100vh - 88px); overflow: auto; scrollbar-width: none; z-index: 5; }
  .town-side::-webkit-scrollbar { display: none; }
}
.town-card { padding-bottom: 10px; }
.town-card .town { box-shadow: none; border-width: 2px; }
.town-card .town-say { color: #6b5b7a; }
/* 営業中のお店：3秒かけてゆっくり明滅。準備中はうすく */
.lot.shop.open { animation: shopGlow 3s ease-in-out infinite; }
.lot.shop.closed { opacity: .45; filter: grayscale(.8); }
.town.has-art .lot.shop.open { background: radial-gradient(circle, rgba(255, 222, 120, .55), rgba(255, 211, 92, 0) 70%); }
@keyframes shopGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 211, 92, 0); } 50% { box-shadow: 0 0 18px 10px rgba(255, 211, 92, .7); } }
.town.has-art .lot.shop.closed::after { filter: grayscale(1); animation: none; }
/* お店の窓（外観 → ドアで内装） */
.shop-dlg { max-width: min(760px, calc(100vw - 20px)); }
.shop-body { background: var(--night2); border: 2px solid var(--sun); border-radius: 10px; padding: 12px 14px 14px; box-shadow: 6px 6px 0 #b34d6e; display: grid; gap: 8px; }
.shop-head { display: flex; align-items: center; gap: 8px; }
.shop-head div { display: grid; flex: 1; }
.shop-head b { font-family: "DotGothic16", monospace; color: var(--sun); font-size: 1.15rem; }
.shop-head small { color: var(--muted); }
.shop-x { padding: .2rem .7rem; }
.shop-body .cafe-tabs { margin-bottom: 0; }

/* 街の地図を少しズーム（中の絵と区画をいっしょに拡大） */
.town-inner { position: absolute; inset: 0; background: center / cover no-repeat; }
.town.has-art { background-image: none !important; }
/* 白猫：ぴょこぴょこ跳ねて、ときどき「にゃ」 */
.town-cat { position: absolute; width: 3.6%; height: 0; padding: 0 0 3.6%; -webkit-appearance: none; appearance: none; /* 正方形：iPhone の Safari は button の aspect-ratio を守らず、縦にのびる。高さは幅と同じ % の padding で */ transform: translate(-50%, -85%); border: 0; background: none; cursor: pointer; z-index: 2; animation: catHop 2.6s ease-in-out infinite; }
.town-cat img { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .45)) drop-shadow(0 0 4px rgba(255, 255, 255, .6)); }
.town-cat .cat-say { position: absolute; left: 70%; top: -70%; padding: 0 4px; border-radius: 4px; background: #fff; color: #2b2140; font: 700 6px/1.6 "DotGothic16", monospace; white-space: nowrap; opacity: 0; animation: catSay 2.6s ease-in-out infinite; }
@keyframes catHop {
  0%, 18%, 100% { transform: translate(-50%, -50%); }
  6% { transform: translate(-50%, -95%) scaleY(1.05); }
  12% { transform: translate(-50%, -50%) scaleY(.9); }
  45% { transform: translate(-90%, -50%); }
  51% { transform: translate(-90%, -95%); }
  57% { transform: translate(-90%, -50%) scaleY(.9); }
  80% { transform: translate(-50%, -50%); }
}
@keyframes catSay { 0%, 4%, 22%, 100% { opacity: 0; } 8%, 18% { opacity: 1; } }

/* ---------- スタンプ帳 ---------- */
.stamp-card { background: var(--night2); border: 2px solid var(--line); border-radius: 8px; padding: 14px; box-shadow: 0 0 0 4px rgba(0, 0, 0, .25); }
.stamp-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .6rem; }
.stamp-tabs button { border: 2px solid var(--line); background: transparent; color: #f4efff; border-radius: 999px; padding: .2rem .8rem; font-size: 1rem; cursor: pointer; }
.stamp-tabs button small { font-family: "DotGothic16", monospace; font-size: .75rem; color: var(--muted); }
.stamp-tabs button.on { background: var(--sun); border-color: var(--sun); color: var(--ink); } .stamp-tabs button.on small { color: var(--ink); }
.stamp-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .4rem; font-family: "DotGothic16", monospace; }
.stamp-head b { color: var(--sun); } .stamp-head span { color: var(--mint); }
.stamp-page { position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: 10px; border: 3px solid #fff; box-shadow: 4px 4px 0 #b34d6e; overflow: hidden; }
/* かわいい柄 */
.pat-gingham { background-color: #fff3f6; background-image: linear-gradient(90deg, rgba(255, 157, 184, .35) 50%, transparent 50%), linear-gradient(rgba(255, 157, 184, .35) 50%, transparent 50%); background-size: 28px 28px; }
.pat-sky { background-color: #e8f6ff; background-image: radial-gradient(circle at 20% 30%, #fff 0 10px, transparent 11px), radial-gradient(circle at 70% 60%, #fff 0 14px, transparent 15px), radial-gradient(#cfe8ff 2px, transparent 3px); background-size: 160px 110px, 220px 150px, 18px 18px; }
.pat-stripe { background-color: #fff8ec; background-image: repeating-linear-gradient(45deg, rgba(201, 130, 47, .14) 0 12px, transparent 12px 24px); }
.pat-sakura { background-color: #fff5f8; background-image: radial-gradient(circle, #ffc2d4 0 4px, transparent 5px), radial-gradient(circle, #ffe0ea 0 3px, transparent 4px); background-size: 46px 46px, 30px 30px; background-position: 0 0, 15px 20px; }
.stamp-path { position: absolute; inset: 0; width: 100%; height: 100%; }
.stamp-path path { fill: none; stroke: #b34d6e; stroke-width: .9; stroke-dasharray: 2.2 1.6; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-width: 3; }
.spoint { position: absolute; width: 13%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 3px dashed #b34d6e; background: rgba(255, 255, 255, .85); color: #2b2140; cursor: pointer; padding: 0; display: grid; place-items: center; }
.spoint > b { font-size: clamp(1rem, 3.2vw, 1.8rem); filter: grayscale(.6); opacity: .7; }
.spoint small { position: absolute; top: 102%; left: 50%; transform: translateX(-50%); white-space: nowrap; font: 700 clamp(.6rem, 1.6vw, .75rem)/1.3 "DotGothic16", monospace; color: #6b3a4e; background: rgba(255, 255, 255, .85); padding: 0 .3rem; border-radius: 4px; text-align: center; }
.spoint:hover { transform: translate(-50%, -50%) scale(1.06); }
.spoint.done { border: 0; background: none; }
.stamp-ink { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; overflow: hidden; border: 4px double #d9466e; box-shadow: 0 0 0 2px #fff, 2px 3px 0 rgba(0, 0, 0, .25); background: #ffe5ec; transform: rotate(var(--rot)); }
.stamp-ink img { width: 100%; height: 100%; object-fit: cover; filter: sepia(.25) saturate(1.2); }
.stamp-ink b { font-size: clamp(1rem, 3.2vw, 1.8rem); }
.spoint.pon .stamp-ink { animation: pon .55s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pon { 0% { transform: rotate(var(--rot)) scale(2.2); opacity: 0; } 60% { transform: rotate(var(--rot)) scale(.9); opacity: 1; } 100% { transform: rotate(var(--rot)) scale(1); } }
.spoint.wiggle .stamp-ink { animation: wig .45s ease; }
@keyframes wig { 25% { transform: rotate(calc(var(--rot) - 8deg)); } 75% { transform: rotate(calc(var(--rot) + 8deg)); } }
.stamp-ribbon { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-6deg); font: 700 clamp(1.2rem, 4vw, 2rem)/1.4 "DotGothic16", monospace; color: #fff; background: #d9466e; padding: .2rem 1.2rem; border-radius: 6px; box-shadow: 3px 3px 0 #7a2840; animation: pop .6s cubic-bezier(.3, 1.6, .5, 1); }

/* ---------- ポジティブポイント交換 ---------- */
.shop-card { background: var(--night2); border: 2px solid var(--line); border-radius: 8px; padding: 14px; box-shadow: 0 0 0 4px rgba(0, 0, 0, .25); }
.points-line { margin: 0 0 .6rem; font-family: "DotGothic16", monospace; }
.points-line b { color: var(--sun); font-size: 1.5rem; }
.shop-items { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: .5rem; }
.shop-items li { display: flex; gap: .6rem; align-items: center; background: rgba(255, 255, 255, .05); border: 2px solid var(--line); border-radius: 8px; padding: .5rem .6rem; }
.shop-items li.has { border-color: rgba(127, 207, 138, .6); }
.shop-items div { display: grid; flex: 1; min-width: 0; } .shop-items small { color: var(--muted); font-size: .78rem; }
.si-icon { font-size: 1.6rem; }
.shop-items .btn { padding: .35rem .7rem; font-size: .9rem; white-space: nowrap; }
.room { cursor: pointer; }
.frame-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; max-height: 60vh; overflow: auto; }
.frame-list button { border: 2px solid #e6d8c2; background: #fff; border-radius: 6px; padding: 4px; cursor: pointer; display: grid; gap: 2px; }
.frame-list button:hover { border-color: #e2a92b; }
.frame-list img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }
.frame-list small { font-size: .7rem; color: #6b5b7a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Webクリップ掲示板 ---------- */
.clip-card { background: var(--night2); border: 2px solid var(--line); border-radius: 8px; padding: 14px; box-shadow: 0 0 0 4px rgba(0, 0, 0, .25); }
.clip-form { display: flex; gap: .5rem; }
.clip-form input { flex: 1; min-width: 0; border: 2px solid var(--line); border-radius: 6px; padding: .55rem .7rem; font: inherit; background: var(--night); color: #f4efff; }
.clip-msg { margin: .4rem 0; min-height: 1.4em; color: var(--sun); font-size: .9rem; }
.clip-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .3rem; font-family: "DotGothic16", monospace; color: var(--mint); }
.clip-board { max-width: 100%; height: 460px; overflow: auto; touch-action: none; overscroll-behavior: contain; background: #b8916b; border: 3px solid #fff; border-radius: 10px; box-shadow: 4px 4px 0 #b34d6e; cursor: grab; }
.clip-canvas { position: relative; width: 1600px; height: 1000px; background-color: #c9a27a; background-image: radial-gradient(rgba(90, 60, 30, .25) 1px, transparent 1.5px), radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1.5px); background-size: 9px 9px, 13px 13px; background-position: 0 0, 4px 6px; }
.clip-empty { position: absolute; left: 40px; top: 30px; color: #3a2733; font-weight: 700; }
.clip-island { position: absolute; transform: translateX(-50%); font: 700 1.05rem/1.4 "DotGothic16", monospace; color: #3a2733; background: var(--c); padding: .1rem .9rem; border-radius: 999px; box-shadow: 2px 2px 0 rgba(0, 0, 0, .25); white-space: nowrap; opacity: .92; }
.clip { position: absolute; width: 190px; height: 160px; display: grid; grid-template-rows: auto 1fr auto; gap: 3px; padding: 8px 8px 6px; background: #fffdf6; color: #2b2140; text-decoration: none; border-radius: 4px; border-top: 6px solid var(--c); box-shadow: 2px 4px 0 rgba(0, 0, 0, .25), 0 8px 18px rgba(0, 0, 0, .18); transform: rotate(var(--rot)); transition: transform .15s; overflow: hidden; }
.clip:hover { transform: rotate(0) scale(1.06); z-index: 3; }
.clip img { width: 100%; height: 72px; object-fit: cover; border-radius: 3px; }
.clip-emoji { font-size: 2.6rem; text-align: center; line-height: 72px; height: 72px; }
.clip strong { font-size: .8rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clip small { font-size: .7rem; color: #6b5b7a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clip-pin { position: absolute; top: -4px; left: 50%; transform: translateX(-50%); font-size: 1rem; filter: drop-shadow(1px 2px 0 rgba(0, 0, 0, .3)); }
.clip-del { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(43, 33, 64, .55); color: #fff; font-size: .8rem; cursor: pointer; opacity: 0; transition: opacity .15s; }
.clip:hover .clip-del { opacity: 1; }
.clip.new { animation: clipIn .7s cubic-bezier(.3, 1.6, .5, 1); box-shadow: 0 0 0 4px var(--sun), 2px 4px 0 rgba(0, 0, 0, .25); }
@keyframes clipIn { from { transform: rotate(var(--rot)) scale(.3) translateY(-60px); opacity: 0; } }
.side-card header button, .side-card header a { white-space: nowrap; flex-shrink: 0; }

/* ---- 見守り係まもりん：おまもり帳（ゲームの装備画面ふう） ---- */
.guard-btn img, .guard-mini { width: 26px; height: 26px; vertical-align: middle; object-fit: contain; }
.guard-dlg { max-width: min(720px, calc(100vw - 20px)); }
.guard-win { background: #1b1f3a; color: #f4f1ff; border: 4px double #fff; border-radius: 6px; box-shadow: 0 0 0 4px #1b1f3a, 6px 6px 0 4px #b34d6e; padding: 16px; font-family: "DotGothic16", monospace; }
.guard-top { display: flex; gap: 14px; align-items: center; }
.guard-top img { width: 112px; height: 112px; flex-shrink: 0; animation: owlBob 2.4s ease-in-out infinite; object-fit: contain; }
@keyframes owlBob { 50% { transform: translateY(-4px); } }
.guard-top h2 { margin: 0; font-size: 1.15rem; color: #ffd35c; letter-spacing: .06em; }
.guard-role { margin: 2px 0 6px; font-size: .72rem; color: #a9b4e8; }
.guard-say { margin: 0; padding: 8px 10px; background: #fff; color: #2a2440; border-radius: 4px; font-size: .82rem; line-height: 1.5; position: relative; }
.guard-say::before { content: ""; position: absolute; left: -8px; top: 12px; border: 4px solid transparent; border-right: 4px solid #fff; border-width: 6px 8px 6px 0; }
.guard-gauge { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; font-size: .8rem; }
.guard-gauge i { flex: 1; height: 12px; background: #0e1026; border: 2px solid #fff; position: relative; }
.guard-gauge i::after { content: ""; position: absolute; inset: 0; width: var(--v); background: repeating-linear-gradient(90deg, #7fcf8a 0 8px, #5fb36c 8px 10px); transition: width .3s; }
.guard-hint { font-size: .7rem; color: #a9b4e8; margin: 6px 0 10px; }
.guard-charms { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.charm { position: relative; background: #262b52; border: 2px solid #5a64a8; border-radius: 4px; transition: transform .1s, border-color .1s, opacity .2s; }
.charm-main { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; width: 100%; text-align: left; padding: 10px 10px 26px; background: none; color: inherit; border: 0; font: inherit; cursor: pointer; }
.charm-main:disabled { cursor: default; }
.charm:hover, .charm:focus-within { border-color: #ffd35c; }
.charm-main:focus-visible { outline: none; }
.charm:hover::before, .charm:focus-within::before { content: "▶"; position: absolute; left: -14px; top: 12px; color: #ffd35c; font-size: .8rem; }
.charm.pop { animation: charmPop .35s ease; }
@keyframes charmPop { 30% { transform: scale(1.06) rotate(-2deg); } 60% { transform: scale(.98) rotate(1deg); } }
.charm-icon { grid-row: span 2; font-size: 1.6rem; line-height: 1; transform-origin: top center; }
.charm-icon img { width: 34px; height: 42px; object-fit: contain; display: block; }
.charm.pop .charm-icon { animation: charmSwing .6s ease; }
@keyframes charmSwing { 25% { transform: rotate(14deg); } 60% { transform: rotate(-10deg); } }
.charm-name { font-size: .84rem; color: #ffd35c; }
.charm-what { font-size: .68rem; color: #c3c9f0; }
.charm-lv { grid-column: 1 / -1; display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.charm-lv i { width: 14px; height: 10px; background: #0e1026; border: 1px solid #8a93d6; }
.charm-lv i.on { background: #ff9db8; border-color: #fff; }
.charm-lv em { font-style: normal; font-size: .74rem; margin-left: 6px; }
.charm-now { grid-column: 1 / -1; font-size: .72rem; color: #fff; }
.charm.soon { border-style: dashed; }
.charm.off { opacity: .5; filter: grayscale(.7); }
.charm.off:hover { opacity: .7; }
.charm-on { position: absolute; right: 8px; bottom: 8px; z-index: 1; display: inline-flex; align-items: center; gap: 4px; font-size: .7rem; color: #fff; cursor: pointer; user-select: none; }
.charm-on input { position: absolute; opacity: 0; width: 0; height: 0; }
.charm-on .box { width: 16px; height: 16px; background: #0e1026; border: 2px solid #fff; box-shadow: 2px 2px 0 #b34d6e; position: relative; }
.charm-on input:checked + .box { background: #7fcf8a; }
.charm-on input:checked + .box::after { content: ""; position: absolute; left: 3px; top: 0; width: 4px; height: 8px; border: solid #1b1f3a; border-width: 0 3px 3px 0; transform: rotate(40deg); }
.charm-on input:focus-visible + .box { outline: 2px solid #ffd35c; outline-offset: 2px; }
.charm.off .charm-on { filter: none; }
.charm-tag { display: inline-block; margin-left: 6px; vertical-align: 1px; font-size: .6rem; padding: 1px 5px; background: #3a3f6e; color: #c3c9f0; border-radius: 3px; }
.guard-log { margin-top: 14px; border-top: 2px dashed #5a64a8; padding-top: 10px; }
.guard-log h3 { margin: 0 0 4px; font-size: .9rem; }
.guard-ai { margin: 0 0 6px; font-size: .72rem; color: #a9b4e8; }
.guard-log ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 160px; overflow: auto; }
.guard-log li { font-size: .74rem; line-height: 1.45; padding: 4px 8px; background: #262b52; border-left: 3px solid #8fd3ff; }
.guard-log li.stop { border-left-color: #ff9db8; }
.guard-log li.empty { border-left-color: #5a64a8; color: #a9b4e8; }
.guard-log time { color: #a9b4e8; margin-right: 8px; }
.guard-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.guard-ask { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.guard-ask .btn { padding: 4px 12px; font-size: .8rem; }

/* 街の白猫：納品のシート（1コマ128px、1行目がぴょこぴょこ4コマ） */
.town-cat .cat-sheet { display: none; position: absolute; inset: 0; background: url("assets/room/town-cat-sheet.png") 0 0 / 400% 400% no-repeat; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .45)) drop-shadow(0 0 3px rgba(255, 255, 255, .7)); }
.town-cat.has-sheet .cat-sheet { display: block; }
.town-cat.has-sheet img { visibility: hidden; }
.town-cat.has-sheet { animation: none; }
@keyframes catSheetHop { 0% { background-position: 0 0; } 25% { background-position: 33.333% 0; } 50% { background-position: 66.666% 0; } 75% { background-position: 100% 0; } }

/* スポット地図のタブ */
.map-tabs { display: flex; gap: 6px; margin: 4px 0 10px; flex-wrap: wrap; }
.map-tab { padding: 6px 14px; border-radius: 999px; border: 2px solid #5a64a8; background: #262b52; color: #d8d0f0; font: inherit; font-size: .85rem; cursor: pointer; }
.map-tab.on { background: #ffd35c; border-color: #fff; color: #3a2733; font-weight: 700; box-shadow: 0 3px 0 #b88a1c; }
.spot-check { display: flex; align-items: center; gap: 6px; font-size: .85rem; margin-top: 8px; cursor: pointer; }
.spot-check small { color: #8a7a70; font-size: .7rem; }
.spot-note { margin: 4px 0 0; font-size: .75rem; color: #5a8a5a; min-height: 1em; }

/* クリップ掲示板の拡大縮小 */
.clip-sizer { position: relative; }
.clip-canvas { transform-origin: 0 0; }
.clip-zoom { display: flex; align-items: center; gap: 6px; margin: 4px 0 6px; flex-wrap: wrap; }
.clip-zoom .btn { padding: 2px 12px; font-size: .9rem; min-width: 36px; }
.clip-zoom span { min-width: 3.2em; text-align: center; font: .8rem "DotGothic16", monospace; color: #d8d0f0; }
.clip-zoom small { color: #a9a2c8; font-size: .7rem; }

/* ワンボタン記録 */
.log-row { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; padding-top: .4rem; border-top: 1px dashed var(--line); }
.log-label { font: .8rem "DotGothic16", monospace; color: #d8d0f0; margin-right: .2rem; }
.lbtn { display: inline-flex; align-items: center; gap: .3rem; border: 2px solid var(--line); background: var(--night); color: #f4efff; border-radius: 999px; padding: .3rem .8rem; cursor: pointer; font: inherit; }
.lbtn span { font-size: 1.15rem; line-height: 1; }
.lbtn small { font-family: "DotGothic16", monospace; font-size: .8rem; }
.lbtn:active { transform: scale(.95); }
.lbtn.sleeping { background: #2c3e6b; border-color: #ffd35c; animation: sleepGlow 2.4s ease-in-out infinite; }
@keyframes sleepGlow { 50% { box-shadow: 0 0 10px rgba(255, 211, 92, .55); } }
.log-msg { margin: 0 0 6px; font-size: .8rem; color: #8a5a7a; min-height: 1.2em; }
.log-preview { display: block; width: 100%; max-height: 200px; object-fit: contain; background: #f3e9da; border-radius: 6px; }
.log-field { display: grid; gap: 2px; font-size: .8rem; margin-top: 8px; }
.log-field small { color: #8a7a70; font-size: .7rem; }
.log-field input { font: inherit; font-size: 1rem; padding: 6px 8px; border: 2px solid #e6d8c2; border-radius: 6px; background: #fff; color: var(--ink); } /* iPhone のダークモードで黒くならないように */
.log-receipt { margin-top: 8px; padding: 8px 10px; background: #fff; border: 1px dashed #c9b79c; border-radius: 6px; font-size: .8rem; }
.log-receipt small { display: block; color: #8a7a70; font-size: .7rem; }
.log-receipt table { width: 100%; border-collapse: collapse; margin: 4px 0; }
.log-receipt td { padding: 2px 0; border-bottom: 1px dotted #e6d8c2; }
.log-receipt td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.log-receipt tr.total td { font-weight: 700; border-bottom: 0; }
#log-foods { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
#log-foods .tag { font-size: .75rem; padding: 2px 10px; }

/* アカウント */

.guide-skip { position: absolute; right: 10px; top: -34px; padding: 4px 12px; border: 2px solid #fff; border-radius: 999px; background: rgba(27, 31, 58, .85); color: #fff; font: .8rem "DotGothic16", monospace; cursor: pointer; }

/* 飾った写真の編集 */
.pe-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 88px; gap: 10px; align-items: start; }
.pe-view { position: relative; overflow: hidden; border: 6px solid #8d6a4c; border-radius: 4px; background: #e8dcc8; cursor: grab; touch-action: none; }
.pe-view img { position: absolute; max-width: none; user-select: none; pointer-events: none; }
.pe-pix { margin: 0; text-align: center; }
.pe-pix canvas { width: 78px; height: 60px; image-rendering: pixelated; border: 4px solid #8d6a4c; background: #e8dcc8; }
.pe-pix figcaption { font-size: .7rem; color: #8a7a70; }


/* ちょこっと案内（機能ごとの吹き出し） */
.tip { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 4px 8px; align-items: center; margin: 10px 0 6px; padding: 8px 10px; background: var(--paper); color: var(--ink); border-radius: 10px; box-shadow: 3px 3px 0 #b34d6e; font-size: .85rem; line-height: 1.55; z-index: 3; }
.tip::before { content: ""; position: absolute; left: 22px; top: -8px; border: 8px solid transparent; border-top: 0; border-bottom-color: var(--paper); }
.tip img { width: 32px; height: 32px; image-rendering: pixelated; }
.tip p { margin: 0; }
.tip-btns { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.tip-btns small { color: #8a7a70; font-size: .7rem; margin-right: auto; }
.tip-go { padding: 4px 14px; border: 0; border-radius: 999px; background: var(--sun); color: var(--ink); font: inherit; font-weight: 700; box-shadow: 0 2px 0 #b88a1c; cursor: pointer; }
.tip-x { width: 28px; height: 28px; border: 0; border-radius: 50%; background: #efe4d0; color: #6b5b4a; font-size: 1rem; cursor: pointer; }
.tip.pop { animation: tipPop .35s cubic-bezier(.3, 1.5, .5, 1); }
.tip.out { animation: tipOut .25s ease forwards; }
@keyframes tipPop { from { transform: scale(.85) translateY(-6px); opacity: 0; } }
@keyframes tipOut { to { transform: scale(.9); opacity: 0; } }

/* お部屋をためす（だれでも） */
.try-room { margin-top: 12px; padding: 10px 12px; border: 2px dashed var(--line); border-radius: 8px; display: grid; gap: 6px; }
.try-room small { color: #a9a2c8; font-size: .75rem; }
.try-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.try-btns .btn { padding: 8px 14px; min-height: 40px; }
.try-decor { display: flex; align-items: center; gap: 6px; font-size: .85rem; min-height: 36px; }

/* スマホ：ヘッダーを1行に、広いお部屋は横にスクロールして見る */
@media (max-width: 600px) {
  .bar { gap: 6px; }
  .brand { font-size: 1rem; white-space: nowrap; min-width: 0; }
  .brand h1 { overflow: hidden; text-overflow: ellipsis; }
  .bar-right { gap: .3rem; flex-shrink: 0; }
  .btn.icon, .btn.icon.mute { width: 2.4rem; height: 2.4rem; padding: 0; font-size: 1.05rem; }
  .guard-btn img { width: 22px; height: 22px; }
  .meter { font-size: 1rem; padding: .1rem .5rem; }
  .room-wrap { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
  .room-stage { min-width: var(--minw, 0px); }
  .btn.big { font-size: 1rem; padding: .7rem .6rem; white-space: nowrap; }
}
@media (max-width: 380px) { .brand h1 { display: none; } }
.room-hint { margin: 4px 0 0; font-size: .75rem; color: #c3c9f0; text-align: center; animation: hintNudge 2.4s ease-in-out infinite; }
@keyframes hintNudge { 50% { transform: translateX(6px); } }

/* みんなの街：お店を建てる */
.build-dlg { max-width: min(560px, calc(100vw - 16px)); }
.build-dlg form { min-width: 0; overflow-x: hidden; } /* 長い名前のボタンや文で、右にはみ出さないように */
.build-dlg form > * { min-width: 0; max-width: 100%; }
.bd-label { margin: 10px 0 4px; font-size: .8rem; }
.bd-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.bd-opts.staff { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bd-opt { display: grid; justify-items: center; gap: 2px; padding: 6px; border: 2px solid #e6d8c2; border-radius: 8px; background: #fff; cursor: pointer; font: inherit; color: inherit; min-height: 44px; }
.bd-opt img { width: 100%; height: 84px; object-fit: contain; }
.bd-opt small { font-size: .7rem; }
.bd-opt.on { border-color: #e0a52b; background: #fff6d6; box-shadow: 0 0 0 2px #ffd35c; }
.bd-hours { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bd-photos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
.bd-photos figure { position: relative; margin: 0; aspect-ratio: 4 / 3; border: 3px solid #8d6a4c; border-radius: 3px; overflow: hidden; }
.bd-photos img { width: 100%; height: 100%; object-fit: cover; }
.bd-photos button { position: absolute; right: 2px; top: 2px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer; }
.bd-photos p { grid-column: 1 / -1; margin: 0; }
.bd-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; max-height: 240px; overflow: auto; margin-top: 6px; }
.bd-pick button { border: 2px solid #e6d8c2; border-radius: 6px; background: #fff; padding: 3px; cursor: pointer; font: inherit; }
.bd-pick img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.bd-pick small { font-size: .65rem; }
.bd-guard { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-items: center; margin-top: 10px; padding: 8px; background: #f3efff; border-radius: 8px; }
.bd-guard img { width: 56px; height: 56px; object-fit: contain; }
.bd-guard p { margin: 0; font-size: .8rem; }
/* 街の地図の、みんなのお店 */
.lot.user-shop { width: 15%; height: auto; aspect-ratio: 1; background: none; border: 0; padding: 0; transform: translate(-50%, -70%); z-index: 1; }
.lot.user-shop img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); }
.lot.user-shop.open img { animation: shopGlowImg 3s ease-in-out infinite; }
.lot.user-shop.closed img { filter: grayscale(.6) brightness(.7); }
@keyframes shopGlowImg { 50% { filter: drop-shadow(0 0 6px rgba(255, 211, 92, .9)) brightness(1.15); } }
.lot.user-shop .shop-tag { position: absolute; left: 50%; bottom: -2px; transform: translateX(-50%); white-space: nowrap; font: 700 5px/1.4 "DotGothic16", monospace; background: rgba(255, 255, 255, .9); color: #2b2140; padding: 0 3px; border-radius: 3px; }
.lot.mine .shop-tag { background: #ffd35c; }
/* みんなのお店の外観・内装 */
.us-out { position: absolute; inset: 0; background: linear-gradient(#2c3e6b, #7a4a9a 55%, #ff9a6b); display: grid; place-items: center; }
.us-out .us-bld { width: 62%; max-width: 360px; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .5)); }
.us-out .us-sign { position: absolute; top: 8%; left: 50%; transform: translateX(-50%); padding: 4px 12px; background: #3a2733; color: #ffd35c; border: 2px solid #ffd35c; border-radius: 6px; font: 700 .95rem "DotGothic16", monospace; white-space: nowrap; }
.us-staff { position: absolute; right: 6%; bottom: 4%; height: 46%; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .45)); }
.cafe-stage.in .us-staff { height: 52%; right: 4%; bottom: 0; }
.us-edit { margin-top: 6px; padding: 4px 12px; font-size: .8rem; }

/* メニュー選び・注文 */
.bd-menus { display: flex; flex-wrap: wrap; gap: 6px; }
.bd-menu { max-width: 100%; color: #3a2733; padding: 6px 10px; border: 2px solid #e6d8c2; border-radius: 999px; background: #fff; font: inherit; font-size: .8rem; cursor: pointer; min-height: 36px; }
.bd-menu.on { border-color: #e0a52b; background: #fff6d6; }
.order-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.order-menu b { grid-column: 1 / -1; }
.order-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px; padding: 8px 10px; min-height: 44px; border: 2px solid #5a64a8; border-radius: 8px; background: #262b52; color: #fff; font: inherit; font-size: .85rem; text-align: left; cursor: pointer; }
.order-item span { font-size: 1.3rem; }
.order-item small { color: #c3c9f0; }
.order-wait { margin: 8px 0 0; }
.order-chip { position: fixed; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 60; padding: 10px 14px; border: 2px solid #fff; border-radius: 999px; background: #1b1f3a; color: #fff; font: .9rem "DotGothic16", monospace; box-shadow: 0 4px 0 #b34d6e; cursor: pointer; }
.order-chip.ready { background: #ffd35c; color: #3a2733; animation: chipBounce 1.2s ease-in-out infinite; }
@keyframes chipBounce { 50% { transform: translateY(-4px); } }
.order-dlg { max-width: min(420px, calc(100vw - 20px)); }
.order-top { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: center; }
.order-top img { width: 96px; height: 128px; object-fit: contain; }
.order-top p { margin: 0; font-size: .95rem; line-height: 1.6; }
.order-card { display: grid; justify-items: center; gap: 2px; margin: 10px 0; padding: 14px; background: linear-gradient(#fff4dc, #f3d9b5); border-radius: 10px; }
.order-card span { font-size: 3.5rem; line-height: 1; }
.order-card small { color: #8a7a70; }

/* お店の曲 */
.music-btn { width: 100%; margin-top: 8px; min-height: 44px; }
.music-btn.on { background: var(--mint); }
/* とどいた曲（お店の中） */
.song-gift { display: grid; gap: 6px; margin-top: 10px; padding: 8px 10px; border-radius: 6px; background: #fff1d6; color: #3a2733; }
.song-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.song-list .mini-link { text-align: left; }
/* はじめての案内：お店の窓の中の、ひなたんの帯 */
.tour-note { display: grid; gap: 8px; margin-top: 8px; padding: 10px 12px; border: 2px solid #b34d6e; border-radius: 6px; background: #fffaf0; color: #3a2733; white-space: pre-line; line-height: 1.6; }
.town-cat.left .cat-sheet { transform: scaleX(-1); } /* 左へ歩くときは反転 */
.town-cat .cat-say { font-size: 4px; }

/* ひなたんの朝会 */
.chorei-open { display: grid; width: 100%; margin-top: .8rem; padding: .7rem; text-align: center; }
.chorei-open small { font-size: .7rem; font-weight: 400; }
.chorei-dlg { max-width: min(640px, calc(100vw - 12px)); max-height: calc(100dvh - 16px); }
.ch-body { background: #1b1f3a; color: #f4f1ff; border: 4px double #fff; border-radius: 8px; padding: 12px; display: grid; gap: 8px; }
.ch-head { display: flex; justify-content: space-between; align-items: center; font-family: "DotGothic16", monospace; color: #ffd35c; }
.ch-status { margin: 0; font-size: .8rem; color: #c3c9f0; }
.ch-line { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.ch-k { position: relative; margin: 0; display: grid; justify-items: center; align-content: start; gap: 2px; padding: 4px; background: #262b52; border-radius: 8px; min-height: 150px; }
.ch-k img { width: 100%; height: 74px; object-fit: contain; transition: transform .2s; }
.ch-k figcaption { font: .62rem "DotGothic16", monospace; color: #ffd35c; white-space: nowrap; }
.ch-say { margin: 0; font-size: .62rem; line-height: 1.4; color: #fff; text-align: left; min-height: 2.8em; }
.ch-k.busy img { animation: chBusy .6s ease-in-out infinite alternate; }
.ch-k.busy:nth-child(2n) img { animation-delay: .3s; }
@keyframes chBusy { to { transform: translateY(-5px) rotate(-3deg); } }
.ch-k.talk { outline: 2px solid #ffd35c; }
.ch-k.talk img { transform: translateY(-6px) scale(1.05); }
.ch-k.done { background: #2e3566; }
.ch-mood > div { display: flex; gap: 8px; justify-content: center; }
.ch-mood .btn { min-width: 30%; min-height: 48px; font-size: 1rem; }
.ch-gauge { display: grid; gap: 4px; }
.ch-gauge:empty { display: none; }
.ch-gauge span { display: grid; grid-template-columns: 3.5em 1fr 2em; align-items: center; gap: 6px; font-size: .75rem; }
.ch-gauge i { height: 8px; background: #0e1026; border: 1px solid #fff; position: relative; }
.ch-gauge i::after { content: ""; position: absolute; inset: 0; width: var(--v); background: var(--c); }
.ch-greet { margin: 0; font-size: .9rem; }
.ch-greet:empty { display: none; }
.ch-props { display: grid; gap: 8px; }
.ch-p { position: relative; padding: 10px 12px; background: #fff4dc; color: #3a2733; border-radius: 8px; box-shadow: 3px 3px 0 #b34d6e; display: grid; gap: 4px; }
.ch-p h4 { margin: 0; font-size: 1rem; padding-right: 110px; }
.ch-p p { margin: 0; font-size: .8rem; }
.ch-p.skip { opacity: .5; }
.ch-who { display: flex; gap: 2px; }
.ch-who img { width: 26px; height: 32px; object-fit: contain; }
.ch-stamps { position: absolute; right: 8px; top: 6px; display: flex; gap: 4px; }
.hanko { display: grid; place-items: center; width: 54px; height: 54px; border: 3px solid #d0342c; border-radius: 50%; color: #d0342c; font: 700 .58rem "DotGothic16", monospace; white-space: nowrap; letter-spacing: -.05em; transform: rotate(-12deg); background: rgba(255, 255, 255, .5); }
.hanko.me { border-radius: 8px; font-size: .9rem; }
.hanko.ng { border-color: #555; color: #555; font-size: 1.4rem; }
.hanko.pon { animation: hankoPon .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes hankoPon { from { transform: scale(2.4) rotate(-12deg); opacity: 0; } 60% { opacity: 1; } }
.ch-why-stop { color: #8a5a7a; }
.ch-ok { min-height: 44px; }
.ch-trace { list-style: none; margin: 0; padding: 8px; background: #0e1026; border-radius: 6px; display: grid; gap: 4px; font-size: .7rem; }
.ch-trace li { display: flex; align-items: center; gap: 6px; word-break: break-all; }
.ch-trace img { width: 20px; height: 24px; object-fit: contain; }
.ch-trace code { color: #8fd3ff; }

/* 朝会：整列とステージ（ひとりずつ前に出て話す） */
.ch-line { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ch-k { min-height: 0; padding: 4px 2px 2px; transition: opacity .3s, transform .3s; }
.ch-k img { height: 84px; }
.ch-k.out { opacity: .15; transform: translateY(8px) scale(.9); }
.ch-k.done::after { content: "✔"; position: absolute; right: 4px; top: 2px; color: #7fcf8a; font-size: .8rem; }
.ch-stage { display: grid; grid-template-columns: 38% 1fr; align-items: end; gap: 8px; min-height: 180px; padding: 8px; background: radial-gradient(ellipse at 30% 100%, rgba(255, 211, 92, .25), transparent 60%), #232850; border-radius: 10px; cursor: pointer; }
.ch-stage.enter .ch-st-img { animation: chEnter .45s cubic-bezier(.3, 1.4, .5, 1); }
.ch-stage.enter .ch-bubble { animation: chBubble .35s .15s ease both; }
@keyframes chEnter { from { transform: translateX(60%) scale(.7); opacity: 0; } }
@keyframes chBubble { from { transform: scale(.8); opacity: 0; } }
.ch-st-img { width: 100%; max-height: 190px; object-fit: contain; }
.ch-st-img.hinatan { width: 72px; height: 72px; image-rendering: pixelated; justify-self: center; align-self: center; }
.ch-bubble { position: relative; align-self: center; padding: 10px 12px; background: #fff4dc; color: #3a2733; border-radius: 12px; font-size: .85rem; line-height: 1.6; }
.ch-bubble::before { content: ""; position: absolute; left: -9px; bottom: 24px; border: 9px solid transparent; border-left: 0; border-right-color: #fff4dc; }
.ch-bubble b { display: block; font-size: .7rem; color: #b34d6e; }
.ch-bubble p { margin: 0; }
.ch-p.approved { box-shadow: 3px 3px 0 #e0a52b, 0 0 0 2px #ffd35c; }
.ch-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ch-go { min-height: 44px; }
.ch-end { width: 100%; min-height: 44px; }
.ch-say { display: none; }

/* クリップ：iPhone の共有から */
.clip-share { margin: 4px 0 8px; font-size: .8rem; }
.clip-share summary { cursor: pointer; color: #8fd3ff; min-height: 32px; display: flex; align-items: center; }
.clip-share ol { margin: 6px 0; padding-left: 1.3em; display: grid; gap: 6px; line-height: 1.6; }
.clip-share code { word-break: break-all; background: #0e1026; padding: 1px 4px; border-radius: 3px; color: #ffd35c; }

/* 下のタブ：家の中の場所 */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: #fff8ef; border-top: 3px solid #b34d6e; padding-bottom: env(safe-area-inset-bottom); }
.tabbar button { display: grid; justify-items: center; gap: 1px; padding: 6px 0 7px; border: 0; background: none; color: #3a2733; font: .68rem "DotGothic16", monospace; cursor: pointer; min-height: 52px; }
.tabbar button span { font-size: 1.35rem; line-height: 1.1; }
.tabbar button.on { background: #ffe9b8; color: #9a3556; }
.tabbar button.locked { opacity: .4; }
.tabbar button.locked span::after { content: "🔒"; font-size: .7rem; position: relative; left: -2px; top: -8px; }
body:has(.tabbar:not([hidden])) .app { padding-bottom: 90px; }
body:has(.tabbar:not([hidden])) .order-chip { bottom: calc(70px + env(safe-area-inset-bottom)); }
/* タブごとに見せるセクション */
body[data-tab="home"] .app > [data-tab]:not([data-tab="home"]),
body[data-tab="out"] .app > [data-tab]:not([data-tab="out"]),
body[data-tab="log"] .app > [data-tab]:not([data-tab="log"]),
body[data-tab="town"] .app > [data-tab]:not([data-tab="town"]),
body[data-tab="guard"] .app > [data-tab]:not([data-tab="guard"]),
body[data-tab="invite"] .app > [data-tab]:not([data-tab="invite"]),
body[data-tab="data"] .app > [data-tab]:not([data-tab="data"]) { display: none; }
@media (max-width: 1439px) {
  body[data-tab]:not([data-tab="town"]) .town-side { display: none; }
  body[data-tab="town"] .town-side { display: block; margin-top: 8px; }
}
body[data-tab="town"] .app > .foot, body[data-tab="invite"] .app > .foot { display: none; }
/* まもりん（設定）のページ */
.me-card { display: grid; gap: 10px; }
.me-btns { display: grid; gap: 8px; }
.me-btn { display: flex; align-items: center; gap: 8px; justify-content: flex-start; min-height: 48px; text-align: left; }
.me-btn img { width: 28px; height: 28px; object-fit: contain; }
.me-links { font-size: .8rem; }
.tab-toast { position: fixed; left: 50%; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 40; /* ひなたんの吹き出し（.guide は 50）の下に */ width: min(92vw, 420px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 10px 14px; background: #1b1f3a; color: #fff; border: 2px solid #ffd35c; border-radius: 10px; font-size: .82rem; line-height: 1.5; transition: opacity .25s, transform .25s; }
.tab-toast.show { opacity: 1; transform: translate(-50%, 0); }
body:has(.tabbar:not([hidden])) .check-badge { bottom: calc(64px + env(safe-area-inset-bottom)); pointer-events: none; opacity: .85; }
body[data-tab="town"] .app { padding-bottom: 8px; } body[data-tab="town"] .town-side { padding-bottom: 90px; }

/* ---- スマホの点検（タップの的は 40px 以上、文字は 11px 以上）---- */
.btn.icon, .btn.icon.mute { min-width: 40px; min-height: 40px; }
.link, .mini-link { min-height: 40px; display: inline-flex; align-items: center; padding: 0 .3rem; cursor: pointer; }
.lbtn { min-height: 40px; }
.shop-items .btn { min-height: 40px; min-width: 44px; }
.map-tab, .stamp-tabs button { min-height: 40px; }
.clip-zoom .btn { min-height: 40px; min-width: 40px; }
.clip-share summary { min-height: 40px; }
.shop-x { min-width: 40px; min-height: 40px; }
.cafe-tabs button { min-height: 40px; }
.cafe-enter, .us-edit { min-height: 40px; }
.cafe-stage.has-art .cafe-enter { min-height: 0; } /* 絵のドアの上に重ねるボタンは、ドアの大きさのまま */
.bd-menu { min-height: 40px; }
.tlm-head > button, .tlm-head .btn.icon { min-width: 40px; width: 40px; height: 40px; }
.tlm-head .days button, .tlm-head [data-k] { min-height: 40px; }
.tlm-dates button, .tlm-dates input { min-height: 40px; }
.tlm-dates button { min-width: 40px; }
.tlm-home input, .tlm-home .btn, .tlm-trip, .tlm-tripmsg button { min-height: 40px; }
.town-cat::before { content: ""; position: absolute; inset: -12px -10px; } /* 小さい白猫も、指で押せる広さに */
.tabbar button { font-size: .72rem; }
.ch-k figcaption, .spoint small, .charm-what, .charm-tag, .bd-pick small { font-size: max(11px, .69rem); }
.spoint small { font-size: max(11px, clamp(.6rem, 1.6vw, .75rem)); }
.bd-menu { max-width: 100%; color: #3a2733; } /* 白いボタンに白い文字で読めなかった */
#ch-mood .btn { white-space: nowrap; padding-inline: .3rem; font-size: .92rem; }

/* ---- アクセシビリティ（#6）---- */
/* 明るい紙のダイアログの中の、うす文字は 4.5:1 以上に */
.dlg-body .muted, .dlg-body small, .dlg-body .log-field small { color: #6e5f56; }
.dlg-body .tag small, .dlg-body .btn small { color: inherit; }
/* キーボードで動かすときの枠 */
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.dlg-body :focus-visible, .tabbar :focus-visible { outline-color: #b34d6e; }
.tabbar button:focus-visible { outline-offset: -3px; }
.room-wrap:focus-visible, .clip-board:focus-visible, .tlm-scroll:focus-visible { outline-offset: -3px; }
.roadmap li.locked .need { color: #fff; } /* うすくしたカードの中でも読める色に */
.check-badge { color: #2b2140; }

/* ---- ポジティブ睡眠：ひつじちゃん ---- */
.sheep-box { display: flex; align-items: center; gap: .6rem; width: 100%; margin-top: .3rem; }
#sheep { width: 48px; height: 48px; image-rendering: pixelated; flex: none; }
#sheep-say { margin: 0; font-size: .82rem; line-height: 1.5; color: #f4efff; }
.sheep-box.joy #sheep { animation: sheepJoy .7s ease-in-out 3; }
@keyframes sheepJoy { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-10px) rotate(-6deg); } 60% { transform: translateY(0) rotate(5deg); } }
.nap-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0; }
.nap-chips .btn { min-height: 44px; }
@media (prefers-reduced-motion: reduce) { .sheep-box.joy #sheep { animation: none; } }
/* 左のスケジュール：やったこと（ごはん・おやつ・ねた）は、予定とは別の見た目 */
.tl li.done .dot { font-size: .8rem; line-height: 1; }
.tl li.done div b { color: #4f8a5b; }
.tl li.done div small { letter-spacing: 0; font-size: .72rem; opacity: .8; }

/* ---- 元気をもらう：おすそわけ（もらう → ためる） ---- */
.mem-actions { flex-wrap: wrap; justify-content: center; }
.mem-actions #mem-keep { order: -1; flex-basis: 100%; min-height: 48px; font-size: 1.05rem; }
.mem-actions .btn { min-height: 40px; }
.mem-actions .mem-x { order: 9; flex-basis: 100%; background: none; border: 0; padding: 4px; font: inherit; font-size: .8rem; color: var(--muted, #8a7f8f); text-decoration: underline; cursor: pointer; }

/* ---- ひとことは、えらぶだけ（打たなくてもOK） ---- */
.say-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.say-chip { min-height: 40px; padding: 0 12px; border: 2px solid var(--line); border-radius: 999px; background: transparent; color: #f4efff; font: inherit; font-size: .88rem; cursor: pointer; }
.say-chip[aria-pressed="true"] { background: var(--sun); border-color: var(--sun); color: #2b2140; font-weight: 700; }
.dlg .say-chip { color: #3a2733; background: #fff; border-color: #e6d8c2; }
.dlg .say-chip[aria-pressed="true"] { background: #fff6d6; border-color: #e0a52b; }
.quick-say-pick { flex-direction: column; align-items: stretch; gap: .5rem; padding: .6rem; border: 2px dashed var(--sun); border-radius: 8px; }
.quick-ask-btns { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.quick-ask-btns .btn { min-height: 44px; }
/* ちょきんの窓：ひとことの候補は点線（タグと見分ける）。ボタンが折り返さないように */
.dlg .say-chips .say-chip { border-style: dashed; }
#deposit-dlg .dlg-actions { flex-wrap: wrap; }
#deposit-dlg .dlg-actions .btn { white-space: nowrap; flex: 1 1 auto; }
#deposit-ok { order: -1; flex-basis: 100%; min-height: 48px; }
/* 朝会：提案のもとになった、ためた楽しい */
.ch-from { margin: 4px 0 0; padding: 3px 8px; display: inline-block; border-radius: 999px; background: #fff6d6; color: #6b4a1a; font-size: .8rem; }
.ch-p .mini-link { color: #2a6280; } /* 紙色のカードの上でも読める色に */

/* ---- はじめての1日（タブの上に、進みぐあいと次にやること） ---- */
.fd-bar { position: fixed; left: 0; right: 0; bottom: calc(62px + env(safe-area-inset-bottom)); z-index: 54; margin: 0 auto; max-width: 560px; padding: 8px 12px 10px; background: #fff8ef; color: #3a2733; border-top: 3px solid #ffd35c; border-radius: 12px 12px 0 0; box-shadow: 0 -6px 18px rgba(0, 0, 0, .35); }
.fd-top { display: flex; align-items: center; gap: 8px; }
.fd-top b { font: 700 .82rem "DotGothic16", monospace; color: #9a3556; white-space: nowrap; }
.fd-dots { display: flex; flex: 1; justify-content: space-around; gap: 2px; margin: 0; padding: 0; list-style: none; }
.fd-dots li { display: grid; justify-items: center; font-size: 1.05rem; opacity: .45; filter: grayscale(.7); }
.fd-dots li small { font-size: 11px; color: #6e5f56; }
.fd-dots li.done { opacity: 1; filter: none; }
.fd-dots li.done small { color: #3a7a4a; }
.fd-dots li.now { opacity: 1; filter: none; transform: scale(1.12); }
.fd-dots li.now small { color: #9a3556; font-weight: 700; }
.fd-ask { display: grid; gap: 8px; }
.fd-ask p { margin: 0; font-weight: 700; }
.fd-ask-btns { display: flex; gap: 8px; justify-content: flex-end; }
.fd-x { min-width: 40px; min-height: 40px; border: 0; background: none; color: #6e5f56; font-size: 1.2rem; cursor: pointer; }
.fd-next { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.fd-next p { flex: 1; margin: 0; font-size: .86rem; line-height: 1.4; }
.fd-next .btn { white-space: nowrap; min-height: 44px; padding: .4rem .8rem; font-size: .9rem; }
body.fd-on .app { padding-bottom: 210px; }
body.fd-on .order-chip, body.fd-on:has(.tabbar:not([hidden])) .order-chip { bottom: calc(190px + env(safe-area-inset-bottom)); } /* はじめての1日のバーの上に（タブバーの位置の指定より強く） */
body.fd-on .tab-toast { bottom: calc(190px + env(safe-area-inset-bottom)); }
.tabbar button.fd-next { box-shadow: inset 0 0 0 3px #ffd35c; animation: pulse 1.4s ease-in-out infinite; }
/* ひなたんの吹き出しが出ているあいだは、帯をかくす。吹き出しは下のタブにかからない高さに */
body:has(#guide:not([hidden])) .fd-bar { display: none; }
body:has(.tabbar:not([hidden])) .guide { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.guide .btn.ghost { color: #6e5f56; } /* 吹き出しの「あとで」も読める色に */

/* ---- ほかの人の「ある1日」（早送り） ---- */
.peek { position: fixed; inset: 0; z-index: 62; display: grid; place-items: center; padding: 16px; background: rgba(8, 6, 24, .8); }
.peek-card { width: min(440px, 100%); background: #fff8ef; color: #3a2733; border-radius: 12px; padding: 16px; box-shadow: 6px 6px 0 #b34d6e; }
.peek-title { display: flex; justify-content: space-between; align-items: center; margin: 0 0 10px; font: 700 1rem "DotGothic16", monospace; color: #9a3556; }
.peek-count { color: #8a5a00; }
.peek-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.peek-list li { display: grid; grid-template-columns: 3.4em 1.8em 1fr; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; background: #fff; border: 2px dashed #e6d8c2; opacity: .25; transition: opacity .4s, transform .4s; }
.peek-list li.on { opacity: 1; border-style: solid; border-color: #ffd35c; transform: translateX(4px); }
.peek-list time { font: .8rem "DotGothic16", monospace; color: #6e5f56; }
.peek-icon { font-size: 1.3rem; }
.peek-say { margin: 10px 0 0; font-size: .95rem; }
.peek-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.peek-btns .btn { min-height: 44px; }
/* まもりんタブ：毎日のすごし方 */
.life-pick { display: grid; gap: 6px; padding: 10px 12px; border: 2px dashed var(--line); border-radius: 8px; }
.life-pick small { color: #a9a2c8; font-size: .75rem; }
.life-btns { display: flex; flex-wrap: wrap; gap: 6px; }
/* 吹き出し・早送りの、ふつうのボタンも「押せる形」に見えるように */
.guide .guide-actions .btn.ghost, .peek .btn.ghost { color: #6e5f56; background: #fff; border: 2px solid #e6d8c2; box-shadow: 0 3px 0 #e6d8c2; }

/* ---- 「こんなことでいいんだよ」のたとえば ---- */
.ex-tick { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "lab hint" "txt txt"; align-items: center; gap: 2px 8px; min-height: 44px; padding: 6px 10px; border: 2px dashed #ffd35c; border-radius: 10px; background: rgba(255, 211, 92, .08); color: #f4efff; font: inherit; text-align: left; cursor: pointer; }
.ex-tick span { grid-area: lab; font-size: .78rem; color: #ffd35c; }
.ex-tick b { grid-area: txt; font-weight: 400; font-size: .95rem; }
.ex-tick small { grid-area: hint; font-size: .72rem; color: #a9a2c8; }
.ex-tick small::after { content: " ›"; }
.ex-tick.roll b { animation: exRoll .5s ease; }
@keyframes exRoll { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- 「これもできるよ」 ---- */
.discover { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 56; width: min(92vw, 440px); padding: 10px 12px; display: grid; gap: 8px; background: #fff8ef; color: #3a2733; border: 2px solid #ffd35c; border-radius: 12px; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; }
.discover.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.discover p { margin: 0; font-size: .9rem; line-height: 1.5; }
.discover p b { display: block; color: #9a3556; font-size: .82rem; }
.discover div { display: flex; justify-content: space-between; align-items: center; }
.discover .btn { min-height: 44px; }
.dc-x { min-width: 40px; min-height: 40px; border: 0; background: none; color: #6e5f56; font-size: 1.2rem; cursor: pointer; }
body.fd-on .discover { bottom: calc(196px + env(safe-area-inset-bottom)); }

/* ---- ひなたんの郵便（朝会の手紙）---- */
.mail-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mail-item, .mail-wait, .mail-err { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; align-items: center; width: 100%; padding: 6px 8px; border-radius: 8px; background: #fff0d8; color: var(--ink); font: inherit; text-align: left; border: 2px solid transparent; }
.mail-item { cursor: pointer; min-height: 44px; }
.mail-item.new { border-color: #b34d6e; background: #ffe3ec; }
.mail-item b, .mail-wait b, .mail-err b { display: block; font-size: .8rem; line-height: 1.4; }
.mail-item small, .mail-wait small, .mail-err small { display: block; font-size: .72rem; color: #6e5f56; }
.mail-item span, .mail-wait span, .mail-err span { font-size: 1.3rem; text-align: center; }
.mail-wait span { animation: hop 1.2s ease-in-out infinite; }
.mail-empty { font-size: .8rem; color: #6e5f56; padding: 4px 2px; }
.mail-fab { position: fixed; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 45; width: 52px; height: 52px; border-radius: 50%; border: 3px solid #fff; background: #ffd35c; box-shadow: 3px 3px 0 #b34d6e; font-size: 1.6rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.mail-fab.waiting span { animation: hop 1.2s ease-in-out infinite; }
.mail-fab.pop { animation: mailPop .7s ease-in-out 2; }
@keyframes mailPop { 30% { transform: scale(1.25) rotate(-8deg); } 60% { transform: scale(1) rotate(6deg); } }
.mail-badge { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: #e0457b; color: #fff; font: 700 .75rem/22px system-ui, sans-serif; text-align: center; }
.mail-dlg .side-card { box-shadow: none; border-color: transparent; padding: 0; }
@media (min-width: 1440px) { .mail-fab { display: none; } } /* 広い画面は、左の郵便ボックスを使う */
@media (prefers-reduced-motion: reduce) { .mail-fab.pop, .mail-wait span, .mail-fab.waiting span { animation: none; } }
/* 地図（Leaflet）の中の重なり順（最大 1000）が外にもれて、ひなたんの吹き出し・ダイアログより手前に出ていたのを、地図の中に閉じこめる */
.places-map, .leaflet-container { isolation: isolate; z-index: 0; }

/* ---- メニューの絵（assets/menu） ---- */
.mi { width: 44px; height: 44px; object-fit: contain; image-rendering: auto; flex: none; }
.mi-xs { width: 24px; height: 24px; vertical-align: middle; }
.mi-s { width: 26px; height: 26px; vertical-align: middle; }
.mi-l { width: 120px; height: 120px; filter: drop-shadow(0 4px 3px rgba(60, 40, 20, .25)); }
.order-item .oi-name { text-align: left; font-size: .84rem; line-height: 1.3; }
.order-card .mi-l { margin-bottom: 2px; }
.bd-menu .mi { margin-right: 2px; }

/* ---- ポップアップの重なり整理（docs/popup-map の A・B・C）---- */
/* A：📮 は、はじめての1日バー・注文チップの上に出す（いままでは、バーの下にかくれていた） */
body.fd-on .mail-fab { bottom: calc(196px + env(safe-area-inset-bottom)); }
body:has(#order-chip:not([hidden])) .mail-fab { bottom: calc(132px + env(safe-area-inset-bottom)); }
body.fd-on:has(#order-chip:not([hidden])) .mail-fab { bottom: calc(252px + env(safe-area-inset-bottom)); }
/* B：ひなたんの吹き出しが出ているあいだは、暗幕の後ろに見える小さなもの（📮・🛎・お部屋のラベル・たとえば）をかくす */
.mail-fab, .order-chip, .room-labels, .ex-tick, #ex-tick { transition: opacity .2s; }
body:has(#guide:not([hidden])) :is(.mail-fab, .order-chip, .room-labels, #ex-tick, .tab-toast, .discover) { opacity: 0; pointer-events: none; }
/* C：画面をふさぐもの（お祝い・早送り・借りる・ダイアログ）が出ているあいだは、下のカード・ボタン・お知らせもかくす */
body:has(.party, .peek, .borrow, dialog[open]) :is(.fd-bar, .mail-fab, .order-chip, .discover, .tab-toast, .room-labels, #ex-tick) { opacity: 0; pointer-events: none; }

/* ---- お店の名前・オーナーの名前：🎲 ランダムで決める ---- */
.name-row { display: flex; gap: 6px; align-items: stretch; margin-top: 4px; min-width: 0; }
.name-row input { flex: 1 1 0; width: 0; min-width: 0; margin-top: 0; } /* Safari は入力欄が自分の幅を保って🎲がはみ出すので、幅0から伸ばす */
.btn.dice { flex: none; min-width: 48px; min-height: 44px; padding: 0 .6rem; font-size: 1.3rem; line-height: 1; }
.name-row input.rolled { animation: rolled .5s ease-out; }
@keyframes rolled { 0% { box-shadow: 0 0 0 0 rgba(255, 211, 92, .9); } 100% { box-shadow: 0 0 0 10px rgba(255, 211, 92, 0); } }
@media (prefers-reduced-motion: reduce) { .name-row input.rolled { animation: none; } }
/* ---- ひなたんの吹き出し：ボタンは先に場所を取る／3つ以上のえらびは、そろえてならべる ---- */
.guide-actions .btn.wait { visibility: hidden; pointer-events: none; }
.guide-actions.many { display: grid; grid-template-columns: repeat(auto-fit, minmax(11em, 1fr)); justify-content: stretch; }
.guide-actions.many .btn { width: 100%; justify-content: center; }

/* ---- お天気ボード ---- */
.wx header { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.wx header h2 { margin: 0; font: 700 .95rem "Zen Maru Gothic", sans-serif; color: inherit; white-space: nowrap; }
.wx header small { font: .7rem/1 "DotGothic16", monospace; color: #b34d6e; }
.wx-now { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; list-style: none; }
.wx-ico { font-size: 2.1rem; line-height: 1; }
.wx-t { display: grid; font-size: .95rem; line-height: 1.35; min-width: 0; }
.wx-t b { font-size: 1.5rem; }
.wx-t small { font-size: .72rem; color: #6e5f56; }
.wx-pill, .wx-tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.wx-umb { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; align-items: center; margin: 10px 0 8px; padding: 8px 10px; border-radius: 8px; }
.wx-umb > span { font-size: 1.6rem; text-align: center; line-height: 1; }
.wx-umb b { display: block; font-size: 1rem; }
.wx-umb small { display: block; font-size: .78rem; line-height: 1.4; }
.wx .need { background: #ffd9de; color: #7a1f36; } .wx .maybe { background: #fff0c2; color: #6b4a00; } .wx .none { background: #dff3e6; color: #1f5d3a; }
.wx-cap { margin: 8px 0 3px; font-size: .72rem; color: #6e5f56; }
.wx-hours { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; height: 64px; align-items: end; }
.wx-h { position: relative; display: grid; align-items: end; height: 100%; }
.wx-h i { display: block; width: 100%; border-radius: 2px 2px 0 0; background: #b9c9e6; min-height: 4px; }
.wx-h.mid i { background: #f2b83a; } .wx-h.hi i { background: #e0457b; }
.wx-h small { position: absolute; left: 0; right: 0; bottom: -15px; text-align: center; font: .62rem "DotGothic16", monospace; color: #6e5f56; }
.wx-day { margin: 20px 0 0; font-size: .8rem; line-height: 1.6; } .wx-day + .wx-day { margin-top: 6px; }
.wx-tag { font-size: .7rem; padding: 1px 7px; }
.wx-upd { display: block; margin-top: 6px; font-size: .68rem; color: #6e5f56; }
/* せまい画面：お部屋の上の帯。さわると、くわしく */
.wx-home { padding: 6px 12px; margin: 0 0 10px; }
.wx-home > summary { list-style: none; cursor: pointer; min-height: 44px; padding: 2px 0; }
.wx-home > summary::-webkit-details-marker { display: none; }
.wx-home .wx-ico { font-size: 1.7rem; } .wx-home .wx-t b { font-size: 1.2rem; }
.wx-home .wx-pill { margin-left: auto; }
.wx-more { color: #6e5f56; font-size: .8rem; transition: transform .2s; } .wx-home[open] .wx-more { transform: rotate(180deg); }
.wx-home .wx-body { padding: 0 0 8px; }
.wx-pill.need { background: #ffd9de; color: #7a1f36; } .wx-pill.maybe { background: #fff0c2; color: #6b4a00; } .wx-pill.none { background: #dff3e6; color: #1f5d3a; }
.wx-tag.need { background: #ffd9de; color: #7a1f36; } .wx-tag.maybe { background: #fff0c2; color: #6b4a00; } .wx-tag.none { background: #dff3e6; color: #1f5d3a; }
.wx-side { display: none; margin-bottom: 14px; }
@media (min-width: 1440px) { .wx-side { display: block; } .wx-home { display: none; } }
body[data-tab]:not([data-tab="home"]) .wx-home { display: none; }
@media (prefers-reduced-motion: reduce) { .wx-more { transition: none; } }

/* ---- おでかけ：オーナーのおすすめ（東京駅から30分いない） ---- */
.picks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.picks li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .06); }
.picks li b { display: block; overflow-wrap: anywhere; }
.picks li small { display: block; opacity: .8; font-size: .72rem; }
.picks .pk-min { white-space: nowrap; font-size: .8rem; }
.picks .pk-min b { display: inline; font-size: 1.25rem; }
.picks .btn { min-height: 36px; padding-inline: 12px; text-decoration: none; }
.picks-map { height: 380px; border-radius: 12px; overflow: hidden; border: 3px solid #0e0a26; }
.pk-pin { position: relative; width: 54px; height: 30px; display: flex; align-items: center; justify-content: center; gap: 2px; border-radius: 15px; background: #ffd35c; color: #2a2145; border: 2px solid #fff; font-size: .8rem; font-weight: 700; box-shadow: 0 2px 4px rgba(0, 0, 0, .4); animation: pk-drop .7s cubic-bezier(.3, 1.4, .5, 1) both; }
.pk-pin::after { content: ''; position: absolute; left: 50%; bottom: -9px; margin-left: -7px; border: 7px solid transparent; border-top: 9px solid #fff; border-bottom: 0; }
.pk-pin span { font-size: .95rem; }
.pk-pin.still { animation: none; }
@keyframes pk-drop { from { transform: translateY(-340px); opacity: 0; } 25% { opacity: 1; } to { transform: translateY(0); opacity: 1; } }
.pk-home { background: #fff; color: #2a2145; border-radius: 12px; padding: 2px 8px; font-size: .72rem; font-weight: 700; text-align: center; box-shadow: 0 2px 4px rgba(0, 0, 0, .35); white-space: nowrap; }
@media (min-width: 700px) { .picks-map { height: 460px; } }

/* 左の列がせまい画面（1440〜1560px）でも、カードが縮んで、右が見切れない */
.side { grid-template-columns: minmax(0, 1fr); }
.side .side-card, .side .side-card * { min-width: 0; }
.side .side-card header { flex-wrap: wrap; row-gap: 4px; }
.side .side-card h2, .side .side-card h3 { white-space: normal; }
.side .side-card small, .side .side-card p, .side .side-card li { overflow-wrap: anywhere; }

/* 管理人タブ：ポジティブエージェントたち */
.agents { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; }
.agents li { padding: 6px 8px; border-radius: 10px; background: rgba(255, 255, 255, .07); min-width: 0; }
.agents li b { display: block; font-size: .85rem; }
.agents li small { display: block; font-size: .7rem; opacity: .85; overflow-wrap: anywhere; }
.clip-try { margin: 4px 0 0; }

/* おすすめリスト：ピンが降りたら、1行ずつ出てくる */
.picks.rise { margin-top: 10px; }
.picks.rise li { cursor: pointer; grid-template-columns: auto minmax(0, 1fr) auto auto; opacity: 0; transform: translateY(-8px); transition: opacity .35s, transform .35s; }
.picks.rise li.in { opacity: 1; transform: none; }
.picks .pk-ico { font-size: 1.2rem; }
@media (prefers-reduced-motion: reduce) { .picks.rise li { transition: none; } }
body.fd-save:not(.pc-busy):not(:has(#clip-msg .guard-ask)) .clip-try .btn:not(:disabled) { box-shadow: inset 0 0 0 3px #ffd35c; animation: pulse 1.4s ease-in-out infinite; }

body.fd-save .spoint:not(.done) .stamp-ink, body.fd-save .spoint:not(.done) > b { animation: pulse 1.4s ease-in-out infinite; }
/* 街のようす：お店の一覧 */
.town-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.town-list button { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 8px 10px; border-radius: 10px; background: rgba(179, 77, 110, .08); cursor: pointer; }
.town-list button:focus-visible { outline: 3px solid #ffd35c; }
.town-list b { overflow-wrap: anywhere; }
.town-list small { grid-column: 1; font-size: .72rem; opacity: .8; }
.town-list .tl-st { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: .7rem; padding: 2px 8px; border-radius: 999px; background: #ddd; color: #444; }
.town-list .tl-st.open { background: #d8f2df; color: #1f6b3a; }

/* 『次へ → スタンプ帳』は、はじめての1日をとじても、いつも出す。チュートリアル中だけ光る */
.picks-next { display: none; }
body.fd-go .picks-next { display: inline-flex; animation: pulse 1.4s ease-in-out infinite; } /* 「見おわった」は、はじめての1日の「行く」のときだけ */

/* 街タブ（広い画面）：中央に大きな地図＋案内板・回覧板・お店の一覧・お天気 */
@media (min-width: 1440px) {
  body[data-tab="town"] .town-side { --sw: 920px; left: calc(50vw - 460px); width: 920px; max-width: 920px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 2px 4px 90px; align-content: start; }
  body[data-tab="town"] .town-side .town-card { grid-column: 1 / -1; order: 1; }
  body[data-tab="town"] .town-side .town-board { order: 2; }
  body[data-tab="town"] .town-side .town-circular { order: 3; }
  body[data-tab="town"] .town-side .town-list-card { order: 4; }
  body[data-tab="town"] .town-side .wx-side { order: 5; }
}
.notice { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .86rem; line-height: 1.5; }
.notice li { padding: 6px 10px; border-radius: 10px; background: rgba(179, 77, 110, .08); overflow-wrap: anywhere; }
.town-board header h2, .town-circular header h2 { white-space: normal; }
.clip-msg .guard-ask { padding: 8px 10px; border-radius: 12px; background: rgba(255, 211, 92, .15); border: 2px solid #ffd35c; }
.clip-msg .guard-ask .btn.sun { animation: pulse 1.4s ease-in-out infinite; }

.tabbar button.fd-off { opacity: .4; }

#guide.prep { visibility: hidden; }

/* はじめての1日：いまは押せないところを、グレーにする */
.fd-dim { opacity: .3; filter: grayscale(.7); transition: opacity .2s, filter .2s; }
body.ff-show .fd-dim { opacity: 1; filter: none; } /* 1枚目を額に飾ったところは、お部屋をそのままの色で見せる */
body.fd-save #clip-try::before { content: '①'; margin-right: 6px; font-weight: 700; color: #b34d6e; }
body.fd-save #clip-msg .guard-ask [data-g="1"]::before { content: '② '; font-weight: 700; }
.bd-upload { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; min-height: 44px; cursor: pointer; }
/* まもりんの確認中は、バーの「Zenn を貼ってみる」をかくす（②「いいよ」だけに集中） */
.spot-ring.pass { pointer-events: none; } /* 指しているボタンは、押せるように */
.nw { white-space: nowrap; } /* 禁則：行頭に来てはいけない字を、前の字とまとめる（typeText） */

/* 家計簿（きろく） */
.kakeibo-card { background: var(--night2); border: 2px solid var(--line); border-radius: 8px; padding: 14px; box-shadow: 0 0 0 4px rgba(0, 0, 0, .25); display: grid; gap: 10px; }
.kb-top { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; }
.kb-top > div:first-child { display: grid; }
.kb-top > div:first-child b { font-size: 1.8rem; color: var(--sun); }
.kb-top small { font-size: .75rem; opacity: .85; }
.kb-kinds { display: flex; flex-wrap: wrap; gap: 8px; }
.kb-kinds span { padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .08); font-size: .85rem; }
.kb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.kb-list li { display: grid; grid-template-columns: 3.2em minmax(0, 1fr) auto; gap: 8px; padding: 6px 8px; border-radius: 8px; background: rgba(255, 255, 255, .05); font-size: .9rem; }
.kb-list li span { overflow-wrap: anywhere; }

/* はじめての1日のあいだは、ちょきんの窓をシンプルに（写真・ひとこと・ひとことの例だけ） */
body.fd-on #deposit-dlg #tags, body.fd-on #deposit-dlg .spot-check, body.fd-on #deposit-dlg #deposit-dummy { display: none; }
body.fd-wait #fd-bar .fd-next { visibility: hidden; }
body.fd-wait .tabbar button.fd-next { animation: none; box-shadow: none; }
body:has(#guide:not([hidden])) .tabbar button.fd-next { animation: none; box-shadow: none; } /* ひなたんが話しているあいだは、タブを光らせない（「次へ」のあとで、やじるしが指す） */
body.pc-busy .clip-try .btn { opacity: .5; } /* 読んでいるあいだは、押せない見た目に */
body.fd-go :is(#picks-replay, #picks-card li .btn) { display: none; } /* はじめての1日の「行く」では、押すのは「見おわった」だけ（外の地図へも飛ばない） */

/* ポジティブなお誘い（手紙の一覧） */
.invite-card { background: var(--night2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.invite-card h2 { margin: 0 0 12px; font-size: 1.05rem; } .invite-card h2 small { display: block; font-size: .75rem; color: var(--muted); font-weight: 400; margin-top: 2px; }
.invite-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.invite-list a { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: #fff4dc; color: #3a2733; text-decoration: none; box-shadow: 4px 4px 0 #b34d6e; }
.invite-list .env { width: 56px; height: 40px; border-radius: 6px; background: #f7d9a8; position: relative; overflow: hidden; display: grid; place-items: center; }
.invite-list .env::before { content: ""; position: absolute; inset: 0 0 40% 0; background: #efc487; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.invite-list .env i { position: relative; width: 20px; height: 20px; border-radius: 50%; background: #d9506e; color: #fff; font-style: normal; font-size: .7rem; display: grid; place-items: center; }
.invite-list b { display: block; line-height: 1.35; } .invite-list small { color: #7a5a6a; font-size: .78rem; }
.invite-list .new { font-size: .72rem; background: #d9506e; color: #fff; border-radius: 999px; padding: 2px 8px; }
.invite-empty { color: var(--muted); font-size: .88rem; margin: 0 0 12px; }
.invite-paste { display: grid; gap: 6px; font-size: .85rem; margin-bottom: 8px; }
.invite-paste div { display: flex; gap: 8px; } .invite-paste input { flex: 1; min-width: 0; padding: 10px; border-radius: 10px; border: 2px solid var(--line); background: #0e1026; color: #fff; font: inherit; font-size: 16px; }
.invite-paste small { color: var(--muted); min-height: 1em; }
body[data-tab="invite"] #mail-fab { display: none; } /* 手紙の「送る」に重ならないように */

/* ---------- スマホ・ふつうの幅：お部屋の下に、カレンダーとスケジュール（広い画面では左のサイドに出る） ---------- */
.side-home { display: grid; gap: 12px; margin-top: .9rem; font-family: "Zen Maru Gothic", system-ui, sans-serif; }
.side-home .side-card, .side-home .side-card * { min-width: 0; }
@media (min-width: 1440px) { .side-home { display: none; } }
.tl-plan { display: block; width: 100%; margin-top: 10px; padding: 9px 10px; border: 2px dashed #b34d6e; border-radius: 8px; background: #fff; color: var(--ink); font: 700 .88rem "Zen Maru Gothic", sans-serif; cursor: pointer; }
.tl-plan:active { transform: scale(.98); }

/* ---------- おでかけプランのエージェント ---------- */
.plan-dlg { max-height: calc(100dvh - 24px); }
.pl-body { max-height: calc(100dvh - 32px); overflow: auto; font-family: "Zen Maru Gothic", system-ui, sans-serif; }
.pl-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pl-head b { font-size: 1.05rem; }
.pl-doing { display: flex; align-items: center; gap: 10px; min-height: 64px; }
.pl-doing canvas { width: 52px; height: 52px; image-rendering: pixelated; flex: none; }
.pl-bob { animation: plBob .9s steps(2) infinite; }
@keyframes plBob { 50% { transform: translateY(-4px); } }
.pl-bubble { position: relative; flex: 1; min-width: 0; background: #fff; border: 2px solid var(--ink); border-radius: 10px; padding: 8px 10px; font-size: .9rem; line-height: 1.5; }
.pl-bubble::before { content: ""; position: absolute; left: -8px; top: 18px; border: 6px solid transparent; border-right-color: var(--ink); border-left: 0; }
.pl-act { margin-right: 4px; }
.pl-plan { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pl-plan li { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr); gap: 8px; align-items: start; }
.pl-plan time { font: 700 1rem "DotGothic16", monospace; font-variant-numeric: tabular-nums; color: #b34d6e; line-height: 1.2; }
.pl-plan time small { display: block; font-size: .72rem; color: #8a7a90; }
.pl-plan li > div { background: #fff; border: 2px solid #f0dcc8; border-radius: 8px; padding: 8px 10px; }
.pl-plan b { display: block; }
.pl-plan p { margin: 2px 0 4px; font-size: .84rem; color: #5b4f6e; }
.pl-plan a { font-size: .8rem; color: #b34d6e; }
.pl-walk { display: block; font-size: .72rem; color: #8a7a90; }
.pl-ok { width: 100%; margin-top: 10px; }
.pl-cap { margin: 4px 0 0; font-size: .72rem; color: #8a7a90; }
.pl-talk { display: grid; gap: 8px; border-top: 2px dashed #f0dcc8; padding-top: 10px; }
.pl-chips { display: grid; gap: 6px; }
.pl-chips > div { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pl-chips span { font: .72rem "DotGothic16", monospace; color: #8a7a90; width: 3em; }
.pl-chips button { border: 2px solid #e6d8c2; background: #fff; color: var(--ink); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: .8rem; cursor: pointer; }
.pl-chips button[aria-pressed="true"] { border-color: #b34d6e; background: #ffe3ec; font-weight: 700; }
.pl-ask { display: flex; gap: 6px; min-width: 0; }
.pl-ask input { flex: 1; width: 0; min-width: 0; /* Safari は入力欄の元の幅（約20文字）で、ダイアログを横に広げてしまう */ border: 2px solid #e6d8c2; border-radius: 6px; padding: .5rem .6rem; font: inherit; color: var(--ink); background: #fff; }
.pl-log summary { cursor: pointer; font-size: .85rem; color: #b34d6e; }
.pl-steps { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.pl-steps li { display: grid; grid-template-columns: 1.4rem minmax(0, 1fr); gap: 6px; font-size: .8rem; }
.pl-steps li.user b { color: #b34d6e; }
.pl-steps small { display: block; color: #6b6290; }
.pl-loglink { justify-self: end; font-size: .8rem; color: #b34d6e; }

/* ---------- あなたのデータ（🗂）：この端末の中・サーバー・ちょくせつ交換 ---------- */
.data-card { display: grid; gap: 14px; font-family: "Zen Maru Gothic", system-ui, sans-serif; }
.md-head h2 { margin: 0 0 4px; }
.md-head p { margin: 0; font-size: .85rem; color: var(--muted); }
.md-card { background: var(--paper); color: var(--ink); border-radius: 10px; box-shadow: 4px 4px 0 #b34d6e; padding: 12px 14px; display: grid; gap: 10px; min-width: 0; }
.md-card h2 { margin: 0; color: var(--ink); font: 700 1rem "Zen Maru Gothic", sans-serif; }
.md-lead, .md-cap { margin: 0; font-size: .8rem; color: #5b4f6e; }
.md-cap { font-size: .72rem; color: #8a7a90; }
.md-row { display: flex; flex-wrap: wrap; gap: 8px; }
.md-me summary { cursor: pointer; font-weight: 700; color: #b34d6e; }
.md-me[open] { display: grid; gap: 8px; }
.md-name { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.md-name input, .md-send input { flex: 1; min-width: 0; border: 2px solid #e6d8c2; border-radius: 6px; padding: .45rem .6rem; font: inherit; color: var(--ink); background: #fff; }
.md-qr { display: grid; place-items: center; background: #fff; border-radius: 8px; padding: 8px; }
.md-qr img { width: min(200px, 60vw); height: auto; image-rendering: pixelated; }
.md-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.md-pend { background: #fff4f7; border: 2px solid #ffc7d6; border-radius: 8px; padding: 8px 10px; display: grid; gap: 4px; }
.md-pend small, .md-fbtn small { color: #6b6290; font-size: .75rem; }
.md-friend { border: 2px solid #f0dcc8; border-radius: 8px; background: #fff; overflow: hidden; }
.md-fbtn { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 2px 8px; align-items: center; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; font: inherit; color: var(--ink); cursor: pointer; }
.md-fbtn small { grid-column: 2; }
.lamp { width: 12px; height: 12px; border-radius: 50%; background: #d8d0e0; }
.lamp.here { background: #ffd35c; box-shadow: 0 0 6px #ffd35c; }
.lamp.open { background: #4fc77a; box-shadow: 0 0 8px #4fc77a; }
.md-chat { border-top: 2px dashed #f0dcc8; padding: 8px 10px; display: grid; gap: 8px; }
.md-chat ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.md-chat li { max-width: 80%; background: #f3eefc; border-radius: 10px; padding: 6px 8px; font-size: .85rem; }
.md-chat li.out { justify-self: end; background: #ffe9a8; }
.md-chat li p { margin: 0; overflow-wrap: anywhere; }
.md-chat li img { display: block; max-width: 100%; border-radius: 6px; margin-bottom: 4px; }
.md-chat li small { display: block; font-size: .7rem; color: #8a7a90; }
.md-send { display: flex; gap: 6px; align-items: center; }
.md-pic { padding: .4rem .6rem; cursor: pointer; }
.md-rm { justify-self: end; font-size: .75rem; color: #a2364f; }
.md-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.md-stats li { background: #fff; border: 2px solid #f0dcc8; border-radius: 8px; padding: 6px; text-align: center; font-size: .72rem; color: #6b6290; }
.md-stats b { display: block; font: 1.2rem "DotGothic16", monospace; color: #b34d6e; font-variant-numeric: tabular-nums; }
.md-mem { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 360px; overflow: auto; }
.md-mem li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 8px; align-items: center; }
.md-mem img, .md-noimg { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; background: #ffe9a8; display: grid; place-items: center; }
.md-mem b { display: block; font-size: .85rem; overflow-wrap: anywhere; }
.md-mem small { font-size: .72rem; color: #8a7a90; }
.md-mem a { color: #b34d6e; }
.md-srv { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; font-size: .82rem; }
.md-empty { color: #8a7a90; font-size: .82rem; }
.md-guard { justify-self: center; }
.md-card .btn.ghost { color: #6e5f56; border-color: #e6d8c2; }
.md-mem .md-empty { display: block; }
/* ドットのランプ：3×3 のマス目っぽく、四すみを欠いた四角。オンラインは緑でぴかぴか */
.px-lamp { display: inline-block; width: 14px; height: 14px; position: relative; flex: none; vertical-align: -2px; }
.px-lamp i { position: absolute; inset: 0; background: #b9b0c8; clip-path: polygon(33% 0, 67% 0, 67% 33%, 100% 33%, 100% 67%, 67% 67%, 67% 100%, 33% 100%, 33% 67%, 0 67%, 0 33%, 33% 33%); }
.px-lamp.open i { background: #2fd15a; clip-path: polygon(25% 0, 75% 0, 75% 25%, 100% 25%, 100% 75%, 75% 75%, 75% 100%, 25% 100%, 25% 75%, 0 75%, 0 25%, 25% 25%); box-shadow: inset -3px -3px 0 #17a33c, inset 3px 3px 0 #8cf5a6; animation: pxBlink 1.2s steps(2) infinite; }
.px-lamp.here i { background: #2fd15a; opacity: .55; clip-path: polygon(25% 0, 75% 0, 75% 25%, 100% 25%, 100% 75%, 75% 75%, 75% 100%, 25% 100%, 25% 75%, 0 75%, 0 25%, 25% 25%); }
@keyframes pxBlink { 50% { filter: brightness(1.35); } }
@media (prefers-reduced-motion: reduce) { .px-lamp.open i { animation: none; } }
.md-step { display: grid; gap: 4px; background: #fff; border: 2px solid #f0dcc8; border-radius: 8px; padding: 8px 10px; }
.md-step > small, .md-ok, .md-warn { font-size: .75rem; color: #6b6290; }
.md-ok { color: #1f6b3a; } .md-warn { color: #a2364f; }
.md-namerow input { flex: 1; min-width: 0; border: 2px solid #b34d6e; border-radius: 6px; padding: .5rem .6rem; font: inherit; font-size: 1rem; color: var(--ink); background: #fff; }
.md-fbtn { grid-template-columns: 16px minmax(0, 1fr) auto auto; }
.md-fbtn small { grid-column: 2 / -1; }
.md-new { background: #e5484d; color: #fff; border-radius: 999px; font-size: .7rem; padding: 1px 7px; font-weight: 700; }
.md-go { font-size: 1.1rem; }
.md-list > li:not(.md-pend):not(.md-empty) { border: 2px solid #f0dcc8; border-radius: 8px; background: #fff; }
/* チャット窓 */
.chat-dlg { max-height: calc(100dvh - 16px); }
.chat-body { background: var(--paper); color: var(--ink); border-radius: 10px; box-shadow: 6px 6px 0 #b34d6e; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; height: min(640px, calc(100dvh - 24px)); padding: 10px; gap: 8px; font-family: "Zen Maru Gothic", system-ui, sans-serif; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 2px dashed #f0dcc8; padding-bottom: 6px; }
.chat-head b { display: flex; align-items: center; gap: 6px; font-size: 1.05rem; }
.chat-head small { display: block; font-size: .75rem; color: #1f6b3a; }
.chat-log { list-style: none; margin: 0; padding: 4px; display: flex; flex-direction: column; gap: 8px; overflow: auto; background: #f7f1ff; border-radius: 8px; }
.chat-log li { max-width: 78%; align-self: flex-start; background: #fff; border-radius: 12px 12px 12px 2px; padding: 6px 9px; font-size: .9rem; box-shadow: 0 1px 0 #e6d8c2; }
.chat-log li.out { align-self: flex-end; background: #a8f0b8; border-radius: 12px 12px 2px 12px; }
.chat-log li p { margin: 0; overflow-wrap: anywhere; }
.chat-log li img { display: block; max-width: 100%; border-radius: 8px; margin-bottom: 4px; }
.chat-log li small { display: block; font-size: .68rem; color: #6b6290; margin-top: 2px; }
.chat-log .md-empty { max-width: none; align-self: stretch; background: none; box-shadow: none; text-align: center; }
.chat-send { display: flex; gap: 6px; align-items: center; }
.chat-send input { flex: 1; min-width: 0; border: 2px solid #e6d8c2; border-radius: 999px; padding: .55rem .8rem; font: inherit; font-size: 1rem; color: var(--ink); background: #fff; }
.chat-body .btn.ghost { color: #6e5f56; border-color: #e6d8c2; }
.chat-body .md-rm { justify-self: end; }
/* iPhone：入力の文字が16pxより小さいと勝手に拡大して、窓がはみ出す。窓は画面の幅に合わせる */
.chat-dlg { width: calc(100vw - 16px); max-width: 520px; margin: auto; }
.chat-body { grid-template-columns: minmax(0, 1fr); width: 100%; box-sizing: border-box; height: min(640px, calc(100dvh - 32px)); }
.chat-body > * { min-width: 0; }
.chat-send input, .md-namerow input, .pl-ask input, .md-name input { font-size: 16px; }
.chat-head small.off { color: #8a7a90; }
/* データのページ：中身がカードの幅をこえないように（iPhone で右にはみ出していた） */
.data-card { grid-template-columns: minmax(0, 1fr); }
.md-card { grid-template-columns: minmax(0, 1fr); box-sizing: border-box; max-width: 100%; }
.md-card > *, .md-step, .md-list > li, .md-namerow, .md-row { min-width: 0; max-width: 100%; box-sizing: border-box; }
.md-lead, .md-cap, .md-step small, .md-me summary { overflow-wrap: anywhere; }
.md-namerow { flex-wrap: nowrap; }
.md-namerow .btn { flex: none; }

/* あなたのデータ：サーバーとのやりとり（シーケンス図ふう。3本の線＝この端末・サーバー・友達） */
.md-sub { margin: 10px 0 0; font-size: .9rem; }
.sq-lanes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); text-align: center; font-size: .72rem; font-weight: 700; color: #6b6290; padding: 4px 0 0; }
.sq { --lane: calc(100% / 3); list-style: none; margin: 0; padding: 4px 0; display: grid; gap: 6px; position: relative;
  background: linear-gradient(90deg, transparent calc(var(--lane) / 2 - 1px), #d8cbe0 calc(var(--lane) / 2 - 1px) calc(var(--lane) / 2 + 1px), transparent calc(var(--lane) / 2 + 1px), transparent calc(var(--lane) * 1.5 - 1px), #d8cbe0 calc(var(--lane) * 1.5 - 1px) calc(var(--lane) * 1.5 + 1px), transparent calc(var(--lane) * 1.5 + 1px), transparent calc(var(--lane) * 2.5 - 1px), #d8cbe0 calc(var(--lane) * 2.5 - 1px) calc(var(--lane) * 2.5 + 1px), transparent calc(var(--lane) * 2.5 + 1px)); }
.sq-row { position: relative; min-height: 34px; }
.sq-msg { margin-left: calc(100% / 3 * var(--l) + 100% / 6); width: calc(100% / 3 * var(--w)); display: grid; justify-items: center; gap: 2px; text-align: center; font-size: .7rem; min-width: 0; }
.sq-msg b { font-weight: 700; color: #4a3a5a; line-height: 1.35; background: #fffaf2; padding: 0 4px; max-width: 100%; overflow-wrap: anywhere; }
.sq-msg i { display: block; width: 100%; height: 2px; background: #8a7a90; position: relative; }
.sq-msg i::after { content: ""; position: absolute; top: -5px; border: 6px solid transparent; }
.sq-msg.r i::after { right: -2px; border-left-color: #8a7a90; border-right: 0; }
.sq-msg.l i::after { left: -2px; border-right-color: #8a7a90; border-left: 0; }
.sq-row.direct .sq-msg i { height: 4px; background: #c2185b; }
.sq-row.direct .sq-msg i::after { border-left-color: #c2185b; top: -4px; }
.sq-row.direct .sq-msg b { color: #c2185b; }
.sq-self { margin-left: calc(100% / 3 * var(--l) + 4px); width: calc(100% / 3 * 2 - 8px); font-size: .7rem; background: #fff; border: 2px solid #f0dcc8; border-radius: 8px; padding: 4px 8px; position: relative; z-index: 0; }
.nl { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.nl li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 8px; align-items: center; background: #fff; border: 2px solid #f0dcc8; border-radius: 10px; padding: 4px 10px; }
.nl small { line-height: 1.35; }
.nl-ic { font-size: 1.2rem; text-align: center; }
.nl b { font-size: .82rem; }
.nl small { display: block; font-size: .7rem; color: #6b6290; }
.nl em { font-style: normal; font-size: .62rem; background: #fff3c4; border-radius: 999px; padding: 0 6px; margin-left: 4px; font-weight: 500; }
.nl-n { font-size: .7rem; color: #6b6290; white-space: nowrap; text-align: right; line-height: 1.3; }
.nl-n span { display: block; }
.nl-n > b { font: 1.05rem "DotGothic16", monospace; color: #b34d6e; font-variant-numeric: tabular-nums; }
.nl-pos { color: #a2470f; font-weight: 700; }
.nl-ph { color: #2c5d99; }
.nl-clear { font: inherit; font-size: inherit; border: 0; background: none; color: #8a7a90; text-decoration: underline; cursor: pointer; margin-left: 8px; }

.nl-box { border-radius: 12px; padding: 8px 10px 10px; display: grid; gap: 6px; min-width: 0; }
.nl-box h3 { margin: 0; font-size: .86rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.nl-box h3 small { font-size: .68rem; font-weight: 500; color: #6b6290; }
.nl-box.local { background: #f3eefa; }
.nl-box.srv { background: #eef5ff; }
.nl-box.fr { background: #fdeaf1; }
.nl-local { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.nl-local li { background: #fff; border-radius: 999px; padding: 2px 10px; font-size: .74rem; color: #4a3a5a; }
.nl-local b { font-family: "DotGothic16", monospace; color: #b34d6e; margin-left: 4px; font-variant-numeric: tabular-nums; }
.nl li.md-empty { display: block; font-size: .76rem; color: #6b6290; }

/* ---- 配達ゲージ（delivery.js）：ひなたんが荷物を、上の PC（サーバー）か下のスマホ（この端末）へ運ぶ ---- */
.dv { position: fixed; left: 50%; bottom: calc(78px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70; width: min(300px, calc(100vw - 32px));
  background: #fff8ef; color: #2b2140; border: 3px solid #b34d6e; border-radius: 10px; box-shadow: 0 4px 0 #7a2f4a, 0 10px 24px rgba(0, 0, 0, .35);
  padding: 8px 12px 10px; pointer-events: none; display: grid; gap: 6px; animation: dv-in .25s ease-out; }
@keyframes dv-in { from { opacity: 0; transform: translate(-50%, 12px); } }
.dv img { image-rendering: pixelated; display: block; }
.dv-stage { position: relative; height: 170px; display: grid; justify-items: center; align-content: space-between; }
.dv-srv { display: flex; align-items: center; gap: 8px; }
.dv-srv img { width: 52px; height: auto; }
.dv-phone { display: flex; align-items: center; gap: 8px; }
.dv-phone img { width: 30px; height: auto; }
.dv-lbl { font-size: .72rem; color: #6b5f78; }
.dv[data-to="server"] .dv-srv .dv-lbl, .dv[data-to="local"] .dv-phone .dv-lbl { color: #b3123a; }
/* 行き先へ向かうやじるし（上：ネット ▲／下：スマホ ▼）。行かないほうは出さない */
.dv-flow { position: absolute; left: calc(50% + 34px); display: grid; gap: 2px; font-style: normal; font-size: .8rem; line-height: 1; color: #b3123a; opacity: 0; }
.dv-flow.up { top: 40px; }
.dv-flow.down { bottom: 34px; }
.dv[data-to="server"] .dv-flow.up, .dv[data-to="local"] .dv-flow.down { opacity: 1; }
.dv-flow b { animation: dv-march 0.9s steps(1) infinite; opacity: .2; }
.dv-flow.up b:nth-child(3), .dv-flow.down b:nth-child(1) { animation-delay: 0s; }
.dv-flow b:nth-child(2) { animation-delay: .3s; }
.dv-flow.up b:nth-child(1), .dv-flow.down b:nth-child(3) { animation-delay: .6s; }
/* サーバーから受けとるとき（おすそわけ）は、上から下へ流れる */
.dv[data-pull="1"] .dv-flow.up b:nth-child(1) { animation-delay: 0s; }
.dv[data-pull="1"] .dv-flow.up b:nth-child(3) { animation-delay: .6s; }
@keyframes dv-march { 0%, 33% { opacity: 1; } 34%, 100% { opacity: .2; } }
.dv-path { position: absolute; left: 50%; top: 34px; bottom: 30px; border-left: 3px dotted #d9b8c6; transform: translateX(-50%); }
.dv-hina { position: absolute; left: 50%; top: 50%; width: 44px; height: auto; transform: translate(-50%, -50%); }
.dv.go[data-to="server"] .dv-hina { animation: dv-up .7s steps(7) forwards; }
.dv.go[data-to="local"] .dv-hina { animation: dv-down .7s steps(7) forwards; }
.dv.done .dv-hina { animation: dv-back .5s steps(5) forwards !important; }
/* 行き先まで飛んで、荷物ごと すっと入る（とどけた） → まん中にもどって、ぴょん */
@keyframes dv-up { 0% { transform: translate(-50%, -50%); } 20% { transform: translate(-50%, -60%); } 75% { transform: translate(-50%, -150%) scale(.8); opacity: 1; } 100% { transform: translate(-50%, -165%) scale(.3); opacity: 0; } }
@keyframes dv-down { 0% { transform: translate(-50%, -50%); } 20% { transform: translate(-50%, -62%); } 75% { transform: translate(-50%, 45%) scale(.8); opacity: 1; } 100% { transform: translate(-50%, 60%) scale(.3); opacity: 0; } }
@keyframes dv-back { 0% { transform: translate(-50%, -50%) scale(.6); opacity: 0; } 60% { transform: translate(-50%, -66%); opacity: 1; } 100% { transform: translate(-50%, -50%); opacity: 1; } }
.dv.done[data-to="server"] .dv-srv img, .dv.done[data-to="local"] .dv-phone img { animation: dv-pop .35s steps(3); }
@keyframes dv-pop { 50% { transform: scale(1.18); } }
.dv[data-to="local"] .dv-srv { opacity: .3; }
.dv[data-to="server"] .dv-phone { opacity: .3; }
.dv-sign { font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 4px; background: #e6e0ea; color: #6b5f78; border: 2px solid #b9aec4; min-width: 4.2em; text-align: center; font-variant-numeric: tabular-nums; }
.dv-sign.open { background: #dff5e3; color: #1f6b35; border-color: #4f9f62; animation: dv-blink 1s steps(2) infinite; }
.dv-sign.num { background: #fff1c2; color: #8a4b00; border-color: #f2a93b; font-size: .85rem; }
@keyframes dv-blink { 50% { opacity: .55; } }
.dv-gauge { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.dv-gauge::before { content: ""; position: absolute; left: 12.5%; right: 12.5%; top: 10px; height: 3px; background: #d9cfe0; }
.dv-gauge li { position: relative; display: grid; justify-items: center; gap: 2px; font-size: .68rem; color: #8a7f96; }
.dv-gauge li span { width: 22px; height: 22px; border-radius: 50%; background: #d9cfe0; color: #fff; display: grid; place-items: center; font-size: .72rem; font-weight: 700; position: relative; z-index: 1; transition: background .2s; }
.dv-gauge li.on span { background: #b3123a; }
.dv-gauge li.on { color: #2b2140; }
.dv-gauge li.last span { background: #fff8ef; border: 2px solid #d9cfe0; font-size: .8rem; }
.dv-gauge li.last img { height: 14px; width: auto; }
.dv-gauge li.last.on span { border-color: #b3123a; }
.dv-gauge li.last.on small { color: #b3123a; font-weight: 700; }
.dv-gauge li.fail span { border-color: #6b5f78; color: #6b5f78; }
.dv-say { margin: 0; font-size: .78rem; line-height: 1.45; text-align: center; }
@media (prefers-reduced-motion: reduce) { .dv, .dv * { animation-duration: .01s !important; } }
/* 配達ログ（あなたのデータ） */
.dl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.dl-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font-size: .8rem; padding: 4px 0; border-bottom: 1px dashed #e2d6e6; }
.dl-to { font-size: .7rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.to-local .dl-to { background: #e3f3ff; color: #1f5f8a; }
.to-srv .dl-to { background: #fff1c2; color: #8a4b00; }
.dl-what { min-width: 0; overflow-wrap: anywhere; }
.dl-what small { display: block; color: #6b5f78; font-size: .7rem; }
.dl-list time { color: #6b5f78; font-size: .7rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dl-go { justify-self: start; }
.dl-check { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.dl-check .md-cap { grid-column: 1 / -1; margin: 0; }
.dl-col { min-width: 0; background: #fff; border: 2px solid #e2d6e6; border-radius: 8px; padding: 8px 10px; }
.dl-col h4 { margin: 0 0 6px; font-size: .85rem; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.dl-col h4 small { color: #6b5f78; font-weight: 400; font-size: .7rem; }
.dl-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .78rem; }
.dl-col li { display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.dl-col li b { margin-left: auto; font-variant-numeric: tabular-nums; }
.dl-col li span { min-width: 0; overflow-wrap: anywhere; }
.dl-col li small { display: block; color: #6b5f78; font-size: .7rem; }

/* はじめての案内：安心設計（お家と街） */
.dlg.safe .dlg-body { display: grid; gap: 10px; text-align: center; }
.dlg.safe h2 { margin: 0; font-size: 1.15rem; color: #b3123a; }
.safe-art { width: 100%; max-width: 360px; height: auto; justify-self: center; image-rendering: pixelated; }
.safe-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; text-align: left; }
.safe-list li { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: start; background: #fff; border: 2px solid #f0dbe4; border-radius: 8px; padding: 8px 10px; }
.safe-list li span { grid-row: span 2; font-size: 1.3rem; line-height: 1.2; }
.safe-list li b { font-size: .9rem; }
.safe-list li small { color: #6b5f78; font-size: .78rem; line-height: 1.5; }
.safe-talk { display: flex; gap: 8px; align-items: center; text-align: left; font-size: .82rem; }
.safe-talk canvas { width: 36px; height: 36px; flex: none; }
.safe-talk p { margin: 0; }

/* はじめての案内：光らせる1つ目の額の場所（目印だけ。見た目は .spot-ring） */
.frame-spot { position: absolute; pointer-events: none; }

/* あなたの1枚目：額に入れて大きく見せる → お部屋の額へ飛んでいく */
.ff { position: fixed; inset: 0; z-index: 80; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 16px; background: rgba(20, 14, 36, .72); animation: ff-bg .3s ease-out; }
.ff.fly { background: transparent; transition: background .6s; }
.ff.fly .ff-say, .ff.fly .ff-ok { opacity: 0; transition: opacity .2s; }
@keyframes ff-bg { from { background: transparent; } }
.ff-frame { margin: 0; width: min(78vw, 340px); padding: 12px 12px 8px; background: #fffdf6; border: 10px solid #8d6a4c; border-radius: 4px; box-shadow: inset 0 0 0 3px #c79a6c, 0 10px 30px rgba(0, 0, 0, .45); transform-origin: center; animation: ff-pop .7s cubic-bezier(.3, 1.4, .5, 1); transition: transform .85s cubic-bezier(.5, 0, .3, 1); }
.ff-frame img { display: block; width: 100%; aspect-ratio: 26 / 20; object-fit: cover; }
.ff-frame figcaption { margin-top: 6px; font: 1rem/1.4 "Yomogi", "Zen Maru Gothic", sans-serif; color: #3a2733; text-align: center; overflow-wrap: anywhere; }
@keyframes ff-pop { 0% { transform: scale(.3) rotate(-8deg); opacity: 0; } 70% { transform: scale(1.06) rotate(2deg); opacity: 1; } 100% { transform: none; } }
.ff-say { margin: 0; color: #fff; font-weight: 700; text-align: center; text-shadow: 0 2px 0 rgba(0, 0, 0, .4); }
@media (prefers-reduced-motion: reduce) { .ff, .ff * { animation: none !important; transition-duration: .01s !important; } }

/* お店のなかま：自分のお店の名札のランプ（なかまがいる＝緑・営業中／いない＝グレー・準備中） */
.st-lamp { display: inline-block; width: 4px; height: 4px; margin-right: 2px; vertical-align: 0; background: #9a94a6; box-shadow: 0 0 0 .5px #5d566b; }
.st-lamp.on { background: #3fd46a; box-shadow: 0 0 0 .5px #1f6b3a, 0 0 3px #3fd46a; animation: dv-blink 1.6s steps(2) infinite; }
.us-btns { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.friends-dlg { max-width: min(520px, calc(100vw - 16px)); }
.friends-dlg .dlg-body { max-height: calc(100dvh - 32px); overflow-y: auto; }

/* スマホでうごかないときに、エラーを画面に出す（index.html の head） */
.boot-err { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 999; padding: 12px; border-radius: 10px; background: #fff8ef; color: #2b2140; box-shadow: 0 6px 24px rgba(0, 0, 0, .5); font-size: .85rem; }
.boot-err p { margin: 4px 0; }
.boot-err pre { max-height: 40vh; overflow: auto; white-space: pre-wrap; word-break: break-all; font-size: .7rem; background: #f1e8de; padding: 6px; border-radius: 6px; }
.boot-err button { margin-top: 6px; padding: 8px 14px; border: 0; border-radius: 6px; background: #ffd35c; font: inherit; }

/* ひとことボタンの絵本風の絵（文字だけでためると、絵日記にこの絵が入る） */
.say-chip:has(img) { display: inline-flex; align-items: center; gap: 6px; padding-left: 4px; }
.say-chip img { width: 34px; height: 26px; object-fit: cover; border-radius: 6px; flex: none; }

/* 見本：びわさんのお店（月明かり）の名札・見本のやりとり */
.lot.shop .shop-tag.demo { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); white-space: nowrap; font: 700 5px/1.4 "DotGothic16", monospace; background: rgba(255, 255, 255, .92); color: #2b2140; padding: 0 3px; border-radius: 3px; }
.demo-tag { font-style: normal; font-size: .7rem; padding: 1px 6px; border-radius: 999px; background: #ffd35c; color: #3a2733; }
.demo-note { margin: 6px 0 0; font-size: .75rem; color: #6b6290; }
#demo-chat-dlg .chat-log li img { max-height: 180px; width: 100%; object-fit: cover; }

/* 休日ガチャの版と時間 */
.gacha-opts { display: grid; gap: 6px; margin: 8px 0; }
.gacha-opts > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.gacha-opts span { font-size: .75rem; color: var(--muted, #b9b2d6); min-width: 2.4em; }
.gacha-opts small { font-size: .75rem; color: var(--muted, #b9b2d6); }
.gacha-opts .say-chip { min-height: 34px; font-size: .8rem; }
.gacha-opts .say-chip[aria-pressed="true"] { background: var(--sun); border-color: var(--sun); color: #2b2140; font-weight: 700; }

/* ☀ ちょきん：右下に、いつでも（もとの📮の場所）。📮はその上へ */
.chokin-fab { position: fixed; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 46; margin: 0; padding: .6rem 1.1rem; min-height: 52px; border-radius: 999px; border: 3px solid #fff; box-shadow: 3px 3px 0 #b34d6e, 0 0 16px rgba(255, 211, 92, .6); font-size: 1.05rem; font-weight: 700; }
body:has(#app[hidden]) .chokin-fab { display: none; }
body.fd-on .chokin-fab { bottom: calc(196px + env(safe-area-inset-bottom)); }
body:has(#order-chip:not([hidden])) .chokin-fab { bottom: calc(132px + env(safe-area-inset-bottom)); }
body.fd-on:has(#order-chip:not([hidden])) .chokin-fab { bottom: calc(252px + env(safe-area-inset-bottom)); }
.mail-fab { bottom: calc(140px + env(safe-area-inset-bottom)); }
body.fd-on .mail-fab { bottom: calc(260px + env(safe-area-inset-bottom)); }
body:has(#order-chip:not([hidden])) .mail-fab { bottom: calc(196px + env(safe-area-inset-bottom)); }
body.fd-on:has(#order-chip:not([hidden])) .mail-fab { bottom: calc(316px + env(safe-area-inset-bottom)); }

/* 近くのおすすめ・スポットの貯金 */
.pk-safe { margin: 4px 0 8px; padding: 6px 10px; border-radius: 8px; background: rgba(127, 207, 138, .15); border: 1.5px solid #7fcf8a; font-size: .78rem; }
.pk-sub { margin: 14px 0 6px; font-size: .95rem; }
.pk-sub small { font-size: .7rem; font-weight: 400; opacity: .8; }
.pk-save { min-height: 32px; padding: 0 10px; font-size: .78rem; white-space: nowrap; }
.pk-save.on { background: #fff6d6; color: #8a4b00; border-color: #e0a52b; }
/* おすすめの行：アイコン・名前・分/km・地図・⭐ためる（せまい画面では、ボタンが下の行へ） */
.picks li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.picks li > div { flex: 1 1 0; min-width: 0; }
.picks li > .btn { flex: none; }
.picks li > div { flex: 1 1 55%; }

/* わたしのリズム（お部屋）：すごし方と時間を、その場で */
.routine-card { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 2px solid rgba(255, 255, 255, .12); }
.routine-card h2 { margin: 0 0 8px; font-size: 1rem; }
.routine-card h2 small { font-size: .7rem; font-weight: 400; opacity: .8; }
.rt-life { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.rt-life .say-chip[aria-pressed="true"] { background: var(--sun); border-color: var(--sun); color: #2b2140; font-weight: 700; }
.rt-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.rt-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; gap: 2px 8px; padding: 6px 8px; border-radius: 10px; background: rgba(255, 255, 255, .08); }
.rt-list li > span { grid-row: 1 / span 2; font-size: 1.4rem; }
.rt-list label { font-size: .8rem; }
.rt-list label small { margin-left: 4px; font-size: .65rem; opacity: .75; }
.rt-list input { font: inherit; font-size: 1rem; padding: 2px 4px; border-radius: 6px; border: 1.5px solid rgba(255, 255, 255, .3); background: #fff; color: #2b2140; min-width: 0; }
.rt-list input.saved { animation: rtSaved .8s ease-out; }
@keyframes rtSaved { 0% { box-shadow: 0 0 0 0 #7fcf8a; } 50% { box-shadow: 0 0 0 4px #7fcf8a; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ホームの開け閉め（お家・カレンダー・スケジュールは開いたまま。ほかは見出しを押すと開く） */
details.fold { margin-top: 10px; }
details.fold > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, .08); border: 2px solid rgba(255, 255, 255, .14); font-weight: 700; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "▼ ひらく"; margin-left: auto; font-size: .7rem; font-weight: 400; opacity: .75; }
details.fold[open] > summary::after { content: "▲ とじる"; }
details.fold > summary small { font-size: .7rem; font-weight: 400; opacity: .8; }
details.fold[open] > summary { margin-bottom: 8px; }
details.fold-card > section { margin-top: 0; }
.rt-lead { margin: 0 0 8px; }

/* ---- わたしの1日（きょう／ふりかえり を1枚に。その場で開け閉め） ---- */
.day-card { margin-top: 14px; background: var(--night2); border: 2px solid var(--line); border-radius: 8px; padding: 12px 14px 14px; box-shadow: 0 0 0 4px rgba(0, 0, 0, .25); display: grid; gap: 10px; }
.day-card.closed { padding-bottom: 12px; }
.day-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.day-head h2 { margin: 0; font-size: 1.05rem; white-space: nowrap; }
.day-head h2 { margin-right: auto; }
.day-tabs { display: flex; gap: 6px; order: 3; flex-basis: 100%; }
.day-tabs button { min-height: 36px; padding: 2px 14px; border-radius: 999px; border: 2px solid rgba(255, 255, 255, .2); background: transparent; color: #f4efff; font: inherit; font-size: .85rem; cursor: pointer; }
.day-tabs button[aria-selected="true"] { background: var(--pink); border-color: var(--pink); color: var(--ink); font-weight: 700; }
.day-card.closed .day-tabs { display: none; }
.day-x { min-height: 36px; padding: 2px 12px; border-radius: 999px; border: 2px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .06); color: #f4efff; font: inherit; font-size: .8rem; cursor: pointer; white-space: nowrap; }
.day-body, .day-view { display: grid; gap: 12px; min-width: 0; }
.day-sub { margin: 0 0 6px; font-size: .95rem; }
.day-sub small { font-size: .7rem; font-weight: 400; opacity: .8; }
.day-now .quick { margin-top: 0; }
.day-card .side-home { margin-top: 0; }
.day-edit { justify-self: start; }
.day-panel { border: 2px solid var(--sun); border-radius: 12px; padding: 10px 12px; background: rgba(255, 255, 255, .04); }
.day-panel-head { display: flex; align-items: center; gap: 8px; }
.day-panel-head h3 { margin: 0; font-size: .95rem; flex: 1; }
.day-panel .routine-card { margin-top: 6px; }
.day-card .timeline-card { background: none; border: 0; box-shadow: none; padding: 0; }
/* ぽちっとタイムライン：ダイアログではなく、カードの中で開く。見出しは横書きのまま1行目、日の切りかえは2行目 */
.tlm-inline { max-width: none; padding: 0; border: 0; background: none; }
.tlm-inline .tlm-body { box-shadow: none; border-width: 2px; border-color: var(--sun); }
.tlm-head h2 { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) { .tlm-head h2 { font-size: .95rem; } .tlm-head .btn.icon { min-width: 40px; min-height: 40px; padding: 0 .4rem; } }
.tlm-head .days { order: 5; flex-basis: 100%; flex-wrap: wrap; }
.tlm-inline .tlm-scroll { height: min(56vh, 560px); }

/* 送る前にきく（consent.js）とデータのページの🔐 */
.send-dlg { max-width: min(26rem, calc(100vw - 24px)); z-index: 90; }
.send-dlg .dlg-body { gap: .5rem; }
.send-dlg h2 { font-size: 1.05rem; margin: 0; color: var(--ink); }
.send-why { margin: 0; font-size: .9rem; }
.send-items { margin: 0; padding: .5rem .5rem .5rem 1.6rem; font-size: .9rem; display: grid; gap: .2rem; background: #fff; border: 2px dashed #d9c9b0; border-radius: 6px; }
.send-note { margin: 0; font-size: .8rem; opacity: .8; }
.send-btns { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }
.md-send { display: flex; gap: .5rem; flex-wrap: wrap; margin: .3rem 0; }
.md-send .say-chip { color: #3a2733; background: #fff; border-color: #e6d8c2; }
.md-send .say-chip[aria-pressed="true"] { background: var(--sun); border-color: #e0a52b; font-weight: 700; }
.md-sub { margin: .3rem 0 0; padding-left: 1.1rem; display: grid; gap: .2rem; font-size: .9em; }
