/* ねむりの潮 — 夜の海の手帳（深海紺×月白×薄紫） */
:root {
  --abyss: #070d1f;
  --tide: #0e1834;
  --swell: #1a2850;
  --moon: #f3efe2;
  --moon2: #dcd7c8;
  --lilac: #bdb5ee;
  --lilac-d: #8c84cc;
  --foam: #8fb3d9;
  --deep: #2f4d8f;
  --dawn: #f2c6b4;
  --dim: #a9b2cc;
  --line: rgba(189, 181, 238, .2);
  --glass: rgba(12, 20, 46, .66);
  --ink: #10163a;

  --st-deep: #bdb5ee;
  --st-light: #6f8fc9;
  --st-rem: #3d5c9e;
  --st-wake: #f2c6b4;

  --mincho: 'Shippori Mincho B1', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --goth: 'Zen Kaku Gothic New', 'Hiragino Sans', sans-serif;
  --num: 'Cormorant Garamond', 'Shippori Mincho B1', serif;
  --slow: cubic-bezier(.3, .7, .3, 1);
  --dock-h: calc(78px + env(safe-area-inset-bottom));
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--abyss); color: var(--moon); font-family: var(--goth); font-size: 15px; font-weight: 500;
  line-break: strict; overflow: hidden; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, p, ul, dl, dd { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.nw { white-space: nowrap; }
.i { width: 24px; height: 24px; flex: none; }
:focus-visible { outline: 2px solid var(--lilac); outline-offset: 3px; }
h1, h2, .cap, .pill, .chip, .hint, .nudge-h, .whisper, .slide-t, .tr-n, .tr-s, .sc-d, .nn, .onb-h, .rg-msg, .ask-t, .snz b, .snz span, .sl-lock, .opt-note, .rs-s, .md span, .tp-k, .cb-d, .mx-l {
  word-break: keep-all; overflow-wrap: normal;
}
h1, h2, .cap, .sc-tide, .onb-h { font-feature-settings: "palt"; }
.adv, .disc, .ab-p, .ask-b, .breath-card span span, .onb-b, .tech dd { word-break: normal; }
.num, .mx-v, .cb-t, .tp-v, .sc-n, .f-v, .dc-t, .rg-t, .sl-clock, .axis, .tt-c b { font-variant-numeric: lining-nums tabular-nums; }

/* ---------- 骨組み ---------- */
.app { position: fixed; inset: 0; overflow: hidden; background: var(--abyss); }
.sea { position: absolute; inset: 0; overflow: hidden; }
.sea img { width: 100%; height: 100%; object-fit: cover; transition: opacity .6s var(--slow), filter .6s; }
.sea img.swap { opacity: 0 !important; }
.sea::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7,13,31,.15) 0%, rgba(7,13,31,.2) 40%, rgba(7,13,31,.82) 72%, var(--abyss) 100%); }
.app[data-scr="tide"] .sea img, .app[data-scr="relax"] .sea img, .app[data-scr="settings"] .sea img { opacity: .32; filter: blur(2px); }
.app[data-scr="alarm"] .sea img { opacity: .4; }
.app[data-scr="about"] .sea img { opacity: .38; }
.app[data-scr="sleeping"] .sea img { opacity: .55; }
.app[data-scr="tide"] .sea::after, .app[data-scr="relax"] .sea::after, .app[data-scr="settings"] .sea::after, .app[data-scr="alarm"] .sea::after, .app[data-scr="about"] .sea::after { background: linear-gradient(180deg, rgba(7,13,31,.2), rgba(7,13,31,.75) 50%, var(--abyss)); }
.app[data-scr="ringing"] .sea::after { background: linear-gradient(180deg, rgba(7,13,31,.1), rgba(7,13,31,.25) 50%, rgba(7,13,31,.8)); }

.screens { position: absolute; inset: 0; }
.scr { position: absolute; inset: 0; display: flex; flex-direction: column; }
.hd { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 64px; padding: calc(10px + env(safe-area-inset-top)) 12px 4px 20px; }
.push-hd { justify-content: flex-start; padding-left: 6px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mincho); font-weight: 700; font-size: 1.05rem; letter-spacing: .14em; color: var(--moon2); }
.brand .i { color: var(--lilac); width: 20px; height: 20px; }
.ttl { font-family: var(--mincho); font-weight: 700; font-size: 1.6rem; letter-spacing: .06em; }
.ttl.sm { font-size: 1.3rem; }
.ib { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: var(--moon2); transition: background-color .3s, transform .3s var(--slow); flex: none; }
.ib:active { background: rgba(243, 239, 226, .1); transform: scale(.92); }
.ib[aria-disabled="true"] { opacity: .3; pointer-events: none; }
.ib.sm { width: 44px; height: 44px; }
.pane { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 0 20px calc(var(--dock-h) + 28px); scrollbar-width: none; }
.pane::-webkit-scrollbar { display: none; }
.push .pane, .modal .pane { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
.cap { display: flex; align-items: center; gap: 6px; font-family: var(--mincho); font-weight: 700; font-size: .95rem; letter-spacing: .12em; color: var(--lilac); }
.cap .i { width: 20px; height: 20px; }
.pad-b { height: 12px; }

@media (min-width: 600px) {
  body { background: radial-gradient(1px 1px at 20% 30%, #fff8 50%, transparent), radial-gradient(1px 1px at 70% 60%, #fff6 50%, transparent), radial-gradient(1.5px 1.5px at 40% 80%, #fff5 50%, transparent), radial-gradient(ellipse at 50% 120%, #1a2850, var(--abyss) 60%); }
  .app, .splash, .onb { left: 0; right: 0; margin: 0 auto; max-width: 430px; }
  .app { box-shadow: 0 0 0 1px rgba(189,181,238,.12), 0 30px 90px rgba(0,0,0,.6); }
}

/* ---------- ボタン類 ---------- */
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 700; font-size: .95rem; transition: transform .35s var(--slow), background-color .3s, opacity .3s; text-align: center; }
.pill:active { transform: scale(.96); }
.pill .i { width: 20px; height: 20px; }
.pill.solid { background: var(--moon); color: var(--ink); box-shadow: 0 0 30px rgba(243,239,226,.18); }
.pill.ghost { box-shadow: inset 0 0 0 1px rgba(243, 239, 226, .38); color: var(--moon); }
.pill.wide { display: flex; width: 100%; margin-top: 18px; }
.chip { min-height: 44px; padding: 0 16px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(189,181,238,.38); color: var(--moon2); font-size: .95rem; font-weight: 500; transition: background-color .3s, color .3s, transform .3s var(--slow); white-space: nowrap; }
.chip.on { background: var(--lilac); color: var(--ink); font-weight: 700; box-shadow: none; }
.chip:active { transform: scale(.95); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---------- ドック ---------- */
.dock {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; height: var(--dock-h); display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 14px 6px env(safe-area-inset-bottom); background: linear-gradient(180deg, rgba(7,13,31,0) 0%, rgba(7,13,31,.97) 18%, var(--abyss) 100%);
  transition: transform .5s var(--slow), opacity .4s;
}
.dock::before { content: ""; position: absolute; left: 20px; right: 20px; top: 14px; height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); }
.dock.away { transform: translateY(110%); opacity: 0; pointer-events: none; }
.dock a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 56px; color: var(--dim); font-size: .875rem; font-weight: 500; transition: color .4s; }
.dock a .i { width: 24px; height: 24px; transition: transform .5s var(--slow); }
.dock a.on { color: var(--moon); }
.dock a.on .i { transform: translateY(-1px); }
.dock a:active .i { transform: scale(.88); }
.dock-moon { position: absolute; left: 0; top: 5px; width: 18px; height: 18px; color: var(--lilac); filter: drop-shadow(0 0 6px rgba(189,181,238,.8)); transition: transform .7s var(--slow), opacity .3s; }

/* ---------- 今夜 ---------- */
.scr[data-scr="tonight"] .pane { display: flex; flex-direction: column; }
.clock-big { margin-top: 4px; }
.cb-t { display: block; font-family: var(--num); font-weight: 300; font-size: 5.8rem; line-height: .95; letter-spacing: -.01em; color: var(--moon); text-shadow: 0 0 40px rgba(7,13,31,.6); }
.cb-d { margin-top: 6px; font-size: .9rem; color: var(--moon2); text-shadow: 0 1px 8px rgba(7,13,31,.9); }
.sep { margin: 0 .2em; opacity: .7; }
.moon-space { flex: 1 0 120px; }
.night-card { padding: 18px 18px 16px; border-radius: 24px; background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: inset 0 0 0 1px var(--line); }
.trip { display: grid; grid-template-columns: 1fr 76px 1fr; align-items: center; margin-top: 10px; }
.tp:last-child { text-align: right; }
.tp-k { display: inline-flex; align-items: center; gap: 4px; font-size: .875rem; color: var(--dim); }
.tp-k .i { width: 18px; height: 18px; }
.tp-v { font-family: var(--num); font-size: 2.7rem; font-weight: 400; line-height: 1.05; }
.tp-v.off { font-family: var(--goth); font-size: 1.4rem; color: var(--dim); }
.tp-arc { width: 100%; height: auto; }
.tp-arc path { fill: none; stroke: var(--lilac); stroke-width: 1.2; stroke-dasharray: 2 4; opacity: .8; }
.tp-arc circle { fill: var(--moon); }
.adv { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .95rem; line-height: 1.85; color: var(--moon2); }
.sleep-wrap { display: flex; flex-direction: column; align-items: center; margin: 26px 0 4px; }
.moonbtn { position: relative; width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 36% 34%, #fffdf3 0%, #ece6d2 52%, #cbc4ae 100%); transition: transform .5s var(--slow), opacity .6s; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.mb-face { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 36px rgba(243,239,226,.32), 0 0 110px rgba(189,181,238,.22); transition: transform .5s var(--slow); animation: glow 6s ease-in-out infinite; }
.mb-face::after { content: ""; position: absolute; width: 22px; height: 22px; left: 30%; top: 58%; border-radius: 50%; background: rgba(150,140,115,.16); box-shadow: 34px -30px 0 -4px rgba(150,140,115,.14), 46px 8px 0 -7px rgba(150,140,115,.12); }
.mb-t { position: relative; font-family: var(--mincho); font-weight: 700; font-size: 1.15rem; letter-spacing: .12em; color: var(--ink); }
.mb-ring { position: absolute; inset: -12px; width: calc(100% + 24px); height: calc(100% + 24px); transform: rotate(-90deg); }
.mb-track { fill: none; stroke: rgba(189,181,238,.18); stroke-width: 2; }
.mb-prog { fill: none; stroke: var(--lilac); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .25s ease-out; }
.moonbtn.holding .mb-prog { stroke-dashoffset: 0; transition: stroke-dashoffset .9s linear; }
.moonbtn.holding { transform: scale(.94); }
.moonbtn.fired { transform: scale(1.4); opacity: 0; }
@keyframes glow { 50% { box-shadow: 0 0 48px rgba(243,239,226,.42), 0 0 140px rgba(189,181,238,.3); } }
.hint { margin-top: 14px; font-size: .875rem; color: var(--dim); }
.week-link { display: block; margin-top: 22px; padding: 14px 16px 12px; border-radius: 20px; background: rgba(14, 24, 52, .72); box-shadow: inset 0 0 0 1px var(--line); transition: transform .3s var(--slow); }
.week-link:active { transform: scale(.98); }
.wl-h { display: flex; align-items: center; justify-content: space-between; font-family: var(--mincho); font-weight: 700; font-size: .95rem; letter-spacing: .08em; color: var(--lilac); }
.wl-h .i { width: 20px; height: 20px; }
.wl-bars { display: flex; align-items: flex-end; gap: 6px; height: 54px; margin-top: 10px; }
.wl-bars i { flex: 1; height: var(--h); border-radius: 7px 7px 3px 3px; background: linear-gradient(0deg, var(--deep), var(--foam)); opacity: .75; }
.wl-bars i.hi { background: linear-gradient(0deg, var(--deep), var(--lilac)); opacity: 1; }
.wl-bars i.lo { opacity: .4; }

/* ---------- 眠りの記録中 ---------- */
.sl { flex: 1; display: flex; flex-direction: column; align-items: center; padding: calc(40px + env(safe-area-inset-top)) 20px 0; text-align: center; background: rgba(3, 6, 15, .45); transition: filter 1.2s; }
.sl.dim { filter: brightness(.5); }
.sl.dim.peek { filter: none; transition: filter .3s; }
.sl-cap { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mincho); font-size: .95rem; letter-spacing: .14em; color: var(--lilac); }
.sl-cap .i { width: 20px; height: 20px; }
.sl-clock { margin-top: 18vh; font-family: var(--num); font-weight: 300; font-size: 7rem; line-height: 1; color: rgba(243,239,226,.9); }
.sl-el { margin-top: 12px; font-size: .95rem; color: var(--dim); }
.sl-el b { font-family: var(--num); font-size: 1.2rem; font-weight: 500; color: var(--moon2); }
.sl-lock { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; font-size: .875rem; color: var(--dim); max-width: 22em; text-align: left; }
.sl-lock .i { width: 18px; height: 18px; }
.sl-sound { display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; min-height: 48px; padding: 0 18px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); color: var(--moon2); font-size: .95rem; }
.sl-sound .i { width: 20px; height: 20px; }
.sl-foot { margin-top: auto; width: 100%; display: grid; gap: 14px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.slide { position: relative; height: 64px; border-radius: 32px; background: rgba(243, 239, 226, .08); box-shadow: inset 0 0 0 1px var(--line); display: grid; place-items: center; --p: 0; touch-action: none; }
.slide-t { font-size: .95rem; color: var(--moon2); opacity: calc(1 - var(--p) * 1.4); letter-spacing: .06em; padding-left: 40px; }
.slide-k { position: absolute; left: 4px; top: 4px; width: 56px; height: 56px; border-radius: 50%; background: var(--moon); color: var(--ink); display: grid; place-items: center; box-shadow: 0 0 24px rgba(243,239,226,.35); cursor: grab; touch-action: none; }
.slide:not(.drag) .slide-k { transition: transform .45s var(--slow); }

/* ---------- 潮の記録 ---------- */
.nightnav { display: flex; align-items: center; justify-content: space-between; margin: 0 -8px; }
.nn { display: flex; flex-direction: column; align-items: center; }
.nn-d { font-family: var(--mincho); font-weight: 700; font-size: 1.05rem; }
.nn-s { font-size: .875rem; color: var(--dim); }
.score { display: flex; align-items: flex-end; gap: 16px; margin-top: 8px; touch-action: pan-y; }
.sc-n { font-family: var(--num); font-weight: 300; font-size: 5.4rem; line-height: .9; min-width: 1.4em; }
.sc-r { padding-bottom: 8px; }
.sc-tide { font-family: var(--mincho); font-weight: 700; font-size: 1.9rem; color: var(--lilac); letter-spacing: .12em; line-height: 1.2; }
.sc-d { font-size: .9rem; color: var(--moon2); margin-top: 2px; }
.chart { display: grid; grid-template-columns: 46px 1fr; margin: 18px -20px 0 -14px; }
.lv { position: relative; height: 230px; }
.lv span { position: absolute; right: 6px; font-size: .875rem; color: var(--dim); white-space: nowrap; transform: translateY(-50%); }
.lv span:nth-child(1) { top: 36px; color: var(--lilac); }
.lv span:nth-child(2) { top: 93px; }
.lv span:nth-child(3) { top: 151px; }
.lv span:nth-child(4) { top: 208px; }
.cv-wrap { position: relative; }
#tideCv { display: block; width: 100%; height: 230px; touch-action: pan-y; cursor: crosshair; border-radius: 0 0 0 14px; }
.tip { position: absolute; top: -6px; transform: translateX(-50%); padding: 4px 12px; border-radius: 999px; background: var(--moon); color: var(--ink); font-size: .875rem; font-weight: 700; white-space: nowrap; pointer-events: none; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.tip b { font-family: var(--num); font-size: 1.1rem; margin-right: 6px; }
.axis { grid-column: 2; position: relative; height: 26px; margin-top: 4px; font-family: var(--num); font-size: 1rem; color: var(--dim); }
.axis span { position: absolute; top: 0; transform: translateX(-50%); }
.axis span:first-child { left: 0; transform: none; }
.axis span:last-child { right: 14px; transform: none; color: var(--moon2); }
.facts { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; margin-top: 10px; }
.facts > div { padding: 12px 0 10px; border-top: 1px solid var(--line); }
.f-k { font-size: .875rem; color: var(--dim); }
.f-v { font-family: var(--num); font-size: 2.1rem; font-weight: 400; line-height: 1.15; }
.f-v.sm { font-size: 1.55rem; }
.f-v small { font-family: var(--goth); font-size: .875rem; color: var(--dim); margin-left: 6px; font-weight: 500; }
.ratio { margin-top: 16px; }
.rbar { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; }
.r-deep { background: var(--st-deep); }
.r-light { background: var(--st-light); }
.r-rem { background: var(--st-rem); }
.r-wake { background: var(--st-wake); }
.rleg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin-top: 12px; }
.rleg li { display: flex; align-items: center; gap: 8px; }
.rleg li i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.rleg span { flex: 1; font-size: .875rem; color: var(--moon2); }
.rleg b { font-family: var(--num); font-weight: 500; font-size: 1.05rem; white-space: nowrap; }
.mood, .table { margin-top: 24px; }
.moods { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 10px; }
.md { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 80px; padding: 10px 0 8px; border-radius: 18px; transition: background-color .4s, transform .3s var(--slow); }
.md span { font-size: .875rem; color: var(--dim); }
.md.on { background: rgba(189, 181, 238, .16); }
.md.on span { color: var(--moon); font-weight: 700; }
.md:active { transform: scale(.94); }
.mg { width: 30px; height: 30px; }
.mg-dark { fill: #18244a; stroke: rgba(189,181,238,.4); stroke-width: 1; }
.mg-lit { fill: var(--moon2); }
.md.on .mg-lit { fill: var(--moon); filter: drop-shadow(0 0 4px rgba(243,239,226,.6)); }
.tt { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 12px; }
.tt-c { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 14px; transition: background-color .3s; }
.tt-c.on { background: rgba(189,181,238,.14); }
.tt-bar { position: relative; width: 100%; height: 86px; }
.tt-bar i { position: absolute; bottom: 0; left: 26%; right: 26%; border-radius: 8px 8px 3px 3px; background: linear-gradient(0deg, var(--deep), var(--foam)); }
.tt-c.on .tt-bar i { background: linear-gradient(0deg, var(--deep), var(--lilac)); box-shadow: 0 0 14px rgba(189,181,238,.5); }
.tt-c b { font-family: var(--num); font-size: 1.15rem; font-weight: 500; }
.tt-n { font-family: var(--mincho); font-weight: 700; font-size: .875rem; color: var(--lilac); }
.tt-d { font-size: .875rem; color: var(--dim); }
.disc { margin-top: 22px; font-size: .875rem; line-height: 1.8; color: var(--dim); }

/* ---------- 目覚まし ---------- */
.tswitch { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 8px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(189,181,238,.4); font-weight: 700; transition: background-color .35s, color .35s; }
.tswitch i { width: 28px; height: 28px; border-radius: 50%; background: rgba(189,181,238,.3); transition: background-color .35s, transform .45s var(--slow); }
.tswitch.on { background: var(--lilac); color: var(--ink); box-shadow: none; }
.tswitch.on i { background: var(--ink); transform: rotate(180deg); box-shadow: inset -6px -2px 0 var(--lilac); }
.dial { position: relative; width: min(300px, 82vw); aspect-ratio: 1; margin: 0 auto; touch-action: none; transition: opacity .4s; }
.dial.off { opacity: .45; }
.dial.grab .d-knob { filter: drop-shadow(0 0 14px rgba(243,239,226,.9)); }
.dial-svg { width: 100%; height: 100%; overflow: visible; }
.d-ring { fill: none; stroke: rgba(189,181,238,.2); stroke-width: 2; }
.d-night { fill: none; stroke: var(--lilac); stroke-width: 7; stroke-linecap: round; opacity: .55; }
.d-tick { stroke: rgba(243,239,226,.22); stroke-width: 1; }
.d-tick.h { stroke: rgba(243,239,226,.6); stroke-width: 2; }
.d-num { font-family: var(--num); font-size: 18px; fill: var(--dim); text-anchor: middle; }
.d-knob { fill: var(--moon); filter: drop-shadow(0 0 8px rgba(243,239,226,.6)); cursor: grab; }
.d-knob-i { fill: var(--dawn); }
.d-bed { fill: var(--swell); stroke: var(--lilac); stroke-width: 1.4; }
.d-bed-i { fill: var(--lilac); }
.dial-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.dc-t { font-family: var(--num); font-weight: 300; font-size: 4.3rem; line-height: 1; }
.dc-s { margin-top: 6px; font-size: .875rem; color: var(--moon2); }
.nudge { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 6px; }
.nudge .pill { min-width: 84px; padding: 0 12px; font-family: var(--goth); }
.nudge-h { font-size: .875rem; color: var(--dim); text-align: center; }
.opt { margin-top: 16px; padding: 16px; border-radius: 22px; background: rgba(14, 24, 52, .66); box-shadow: inset 0 0 0 1px var(--line); }
.opt-note { margin-top: 10px; font-size: .875rem; color: var(--dim); line-height: 1.7; }
.tones { margin-top: 6px; }
.tone { display: flex; align-items: center; gap: 4px; }
.tone + .tone { border-top: 1px solid var(--line); }
.tone-pick { flex: 1; display: flex; align-items: center; gap: 12px; min-height: 54px; text-align: left; font-size: 1rem; }
.tone-dot { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--lilac); transition: box-shadow .3s; flex: none; }
.tone.on .tone-dot { box-shadow: inset 0 0 0 1.5px var(--lilac), inset 0 0 0 5px var(--abyss), inset 0 0 0 10px var(--lilac); }
.tone.on .tone-pick { font-weight: 700; }
.row-sw { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 64px; padding: 8px 0; text-align: left; margin-top: 6px; border-top: 1px solid var(--line); }
.row-sw > span { display: flex; flex-direction: column; gap: 2px; }
.row-sw b { font-size: 1rem; }
.rs-s { font-size: .875rem; color: var(--dim); font-weight: 500; }
.mini-sw { position: relative; width: 50px; height: 30px; border-radius: 15px; box-shadow: inset 0 0 0 1.5px rgba(189,181,238,.5); flex: none; transition: background-color .3s; }
.mini-sw::after { content: ""; position: absolute; left: 5px; top: 5px; width: 20px; height: 20px; border-radius: 50%; background: var(--dim); transition: transform .4s var(--slow), background-color .3s; }
.mini-sw.on { background: var(--lilac); box-shadow: none; }
.mini-sw.on::after { transform: translateX(20px); background: var(--ink); }

/* ---------- 鳴動 ---------- */
.ring { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; padding: calc(36px + env(safe-area-inset-top)) 20px 0; text-align: center; background: linear-gradient(180deg, rgba(7,13,31,.45) 0%, rgba(7,13,31,.5) 45%, rgba(7,13,31,.86) 75%, rgba(7,13,31,.95) 100%); overflow: hidden; }
.rg-cap { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mincho); letter-spacing: .14em; color: var(--moon); font-size: .95rem; }
.rg-cap .i { width: 20px; height: 20px; color: var(--dawn); }
.rg-t { margin-top: 8px; font-family: var(--num); font-weight: 300; font-size: 6.6rem; line-height: 1; }
.rg-msg { margin-top: 10px; font-family: var(--mincho); font-weight: 500; font-size: 1.1rem; line-height: 1.9; }
.ripples { position: absolute; left: 50%; top: 42%; width: 0; height: 0; pointer-events: none; }
.ripples i { position: absolute; left: -60px; top: -60px; width: 120px; height: 120px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(243,239,226,.5); animation: ripple 3.6s ease-out infinite; opacity: 0; }
.ripples i:nth-child(2) { animation-delay: 1.2s; }
.ripples i:nth-child(3) { animation-delay: 2.4s; }
.ring.snoozed .ripples i { animation-play-state: paused; opacity: 0; }
@keyframes ripple { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(3.2); opacity: 0; } }
.rg-state { position: relative; margin-top: auto; min-height: 60px; display: grid; justify-items: center; gap: 10px; }
.cd { display: flex; flex-direction: column; align-items: center; }
.cd span { font-size: .875rem; color: var(--moon2); }
.cd time { font-family: var(--num); font-size: 3rem; font-weight: 400; line-height: 1.1; }
.rg-foot { position: relative; width: 100%; display: grid; gap: 14px; margin-top: 18px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.snz { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 80px; border-radius: 28px; background: var(--moon); color: var(--ink); transition: transform .35s var(--slow), background-color .3s; }
.snz b { font-family: var(--mincho); font-weight: 700; font-size: 1.35rem; letter-spacing: .1em; }
.snz span { font-size: .875rem; font-weight: 700; }
.snz:active { transform: scale(.97); }
.snz[disabled] { background: rgba(26, 40, 80, .9); color: var(--moon); cursor: default; box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- 波の音 ---------- */
.wavebox { height: 120px; margin: 0 -20px; }
.wavebox canvas { display: block; width: 100%; height: 100%; }
.transport { display: flex; align-items: center; gap: 16px; margin-top: 4px; }
.play { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--moon); color: var(--ink); flex: none; box-shadow: 0 0 30px rgba(243,239,226,.25); transition: transform .35s var(--slow), box-shadow .5s; }
.play .i { width: 32px; height: 32px; }
.play.on { animation: breathe 5s ease-in-out infinite; }
.play:active { transform: scale(.93); }
@keyframes breathe { 50% { box-shadow: 0 0 50px rgba(243,239,226,.45), 0 0 0 10px rgba(189,181,238,.12); } }
.tr-n { font-family: var(--mincho); font-weight: 700; font-size: 1.3rem; letter-spacing: .08em; }
.tr-s { margin-top: 2px; font-size: .9rem; color: var(--moon2); }
.presets { display: flex; gap: 8px; margin: 18px -20px 0; padding: 0 20px; overflow-x: auto; scrollbar-width: none; }
.presets::-webkit-scrollbar { display: none; }
.mixer { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.mx { position: relative; aspect-ratio: 1 / 1.08; border-radius: 22px; overflow: hidden; background: var(--tide); box-shadow: inset 0 0 0 1px var(--line); }
.mx img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .38; filter: saturate(.6); transition: opacity .6s, filter .6s, transform 1.2s var(--slow); }
.mx.on img { opacity: 1; filter: none; transform: scale(1.04); }
.mx-in { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px; padding: 34px 12px 10px; background: linear-gradient(180deg, rgba(7,13,31,0), rgba(7,13,31,.86) 46%, rgba(7,13,31,.94)); }
.mx-l { font-family: var(--mincho); font-weight: 700; font-size: 1rem; letter-spacing: .06em; }
.mx-v { font-family: var(--num); font-size: 1.05rem; color: var(--moon2); min-width: 2ch; text-align: right; }
.mx input { grid-column: 1 / -1; width: 100%; height: 32px; margin: 0; background: none; -webkit-appearance: none; appearance: none; cursor: pointer; }
.mx input::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: rgba(243,239,226,.3); }
.mx input::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -10px; border-radius: 50%; background: var(--moon); box-shadow: 0 0 12px rgba(243,239,226,.6); }
.mx input::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(243,239,226,.3); }
.mx input::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: var(--moon); }
.breath-card { display: flex; gap: 14px; align-items: flex-start; width: 100%; margin-top: 16px; padding: 16px; border-radius: 22px; background: rgba(189,181,238,.1); box-shadow: inset 0 0 0 1px var(--line); text-align: left; transition: transform .3s var(--slow); }
.breath-card:active { transform: scale(.98); }
.breath-card .i { width: 36px; height: 36px; color: var(--lilac); }
.breath-card > span { display: flex; flex-direction: column; gap: 4px; }
.breath-card b { font-family: var(--mincho); font-size: 1.05rem; }
.breath-card span span { font-size: .9rem; color: var(--moon2); line-height: 1.7; }
.br { padding: 0 4px; text-align: center; }
.br-sea { position: relative; height: 230px; display: grid; place-items: center; }
.br-orb { width: 170px; height: 170px; border-radius: 50%; background: radial-gradient(circle, rgba(243,239,226,.95) 0%, rgba(189,181,238,.6) 45%, rgba(189,181,238,0) 72%); }
.br-say { font-family: var(--mincho); font-weight: 700; font-size: 1.2rem; letter-spacing: .1em; }
.br-c { font-family: var(--num); font-size: 1.2rem; color: var(--moon2); }

/* ---------- 設定・アプリについて ---------- */
.set-g { margin-top: 14px; padding: 4px 16px; border-radius: 22px; background: rgba(14, 24, 52, .74); box-shadow: inset 0 0 0 1px var(--line); }
.set-g.pad { padding: 16px; }
.set-g > .row-sw:first-child, .set-g > .set-r:first-child + .row-sw { margin-top: 0; }
.set-r { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 0 12px; }
.set-r .stepper { align-self: flex-start; }
.set-t { display: flex; flex-direction: column; gap: 2px; }
.set-t b { font-size: 1rem; }
.set-t span { font-size: .875rem; color: var(--dim); }
.stepper { display: flex; align-items: center; gap: 2px; flex: none; }
.stepper b { min-width: 6.4em; text-align: center; font-size: .95rem; }
.stepper .ib { font-size: 1.3rem; box-shadow: inset 0 0 0 1px var(--line); }
.row-link { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 68px; text-align: left; }
.row-link + .row-link { border-top: 1px solid var(--line); }
.row-link > span { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.row-link .i { color: var(--lilac); }
.row-link.danger b { color: #f5c0b6; }
.ab-top { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0 6px; }
.ab-top img { width: 96px; height: 96px; border-radius: 24px; box-shadow: 0 0 40px rgba(189,181,238,.3); }
.ab-n { margin-top: 10px; font-family: var(--mincho); font-weight: 700; font-size: 1.4rem; letter-spacing: .14em; }
.ab-v { font-size: .875rem; color: var(--dim); }
.ab-p { font-size: .95rem; line-height: 1.85; color: var(--moon2); }
.ab-p + .ab-p { margin-top: 10px; }
.tech { margin-top: 6px; }
.tech > div { padding: 10px 0; }
.tech > div + div { border-top: 1px solid var(--line); }
.tech dt { font-weight: 700; color: var(--lilac); }
.tech dd { margin-top: 2px; font-size: .9rem; line-height: 1.7; color: var(--moon2); }

/* ---------- 引き出し・ささやき ---------- */
.veil { position: absolute; inset: 0; z-index: 40; background: rgba(3, 6, 15, .6); opacity: 0; transition: opacity .4s; }
.veil.on { opacity: 1; }
.drawer { position: absolute; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 86%; overflow-y: auto; padding: 0 20px calc(24px + env(safe-area-inset-bottom)); border-radius: 30px 30px 0 0; background: #0f1a3a; box-shadow: inset 0 1px 0 rgba(189,181,238,.28), 0 -20px 60px rgba(0,0,0,.5); transform: translateY(105%); transition: transform .55s var(--slow); }
.drawer.on { transform: none; }
.drawer.drag { transition: none; }
.dr-grip { height: 30px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.dr-grip::before { content: ""; width: 40px; height: 4px; border-radius: 2px; background: rgba(189,181,238,.5); }
.ask-t { font-family: var(--mincho); font-weight: 700; font-size: 1.25rem; letter-spacing: .06em; }
.ask-b { margin-top: 10px; font-size: .95rem; line-height: 1.85; color: var(--moon2); }
.ask-row { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.whisper { position: absolute; left: 50%; top: calc(70px + env(safe-area-inset-top)); z-index: 60; max-width: calc(100% - 32px); width: max-content; padding: 10px 18px; border-radius: 999px; background: rgba(243, 239, 226, .96); color: var(--ink); font-size: .9rem; font-weight: 700; text-align: center; transform: translate(-50%, -16px); opacity: 0; pointer-events: none; transition: transform .5s var(--slow), opacity .4s; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.whisper.on { transform: translate(-50%, 0); opacity: 1; }

/* ---------- 画面の切り替え ---------- */
.scr.in-tide { animation: tideIn .6s var(--slow) both; }
.scr.out-tide { animation: fadeOut .3s ease both; }
.scr.in-push { animation: pushIn .5s var(--slow) both; z-index: 2; }
.scr.out-push { animation: pushOut .4s var(--slow) both; }
.scr.in-back { animation: backIn .5s var(--slow) both; }
.scr.out-back { animation: backOut .4s var(--slow) both; z-index: 2; }
.scr.in-veil { animation: veilIn .8s ease both; z-index: 3; }
.scr.out-veil { animation: fadeOut .5s ease both; }
.scr[class*="out-"] { pointer-events: none; }
@keyframes tideIn { from { opacity: 0; transform: translateY(18px); filter: blur(3px); } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes pushIn { from { opacity: 0; transform: translateX(28%); } }
@keyframes pushOut { to { opacity: 0; transform: translateX(-10%); } }
@keyframes backIn { from { opacity: 0; transform: translateX(-10%); } }
@keyframes backOut { to { opacity: 0; transform: translateX(28%); } }
@keyframes veilIn { from { opacity: 0; filter: brightness(0); } }

/* ---------- スプラッシュ・案内 ---------- */
.splash { position: fixed; inset: 0; z-index: 90; display: grid; place-content: center; justify-items: center; gap: 18px; background: radial-gradient(circle at 50% 40%, #1a2850 0%, var(--abyss) 60%); transition: opacity .6s; }
.splash img { width: 112px; height: 112px; border-radius: 28px; box-shadow: 0 0 60px rgba(189,181,238,.35); animation: rise 1s var(--slow) both; }
.splash-t { font-family: var(--mincho); font-weight: 700; font-size: 1.4rem; letter-spacing: .4em; padding-left: .4em; animation: rise 1s .15s var(--slow) both; }
.splash.bye { opacity: 0; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.onb { position: fixed; inset: 0; z-index: 80; background: var(--abyss); transition: opacity .5s; }
.onb.bye { opacity: 0; }
.onb-tr { position: absolute; inset: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.onb-tr::-webkit-scrollbar { display: none; }
.onb-s { position: relative; flex: 0 0 100%; scroll-snap-align: start; overflow: hidden; }
.onb-s img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.onb-tx { position: absolute; left: 0; right: 0; bottom: 0; padding: 120px 26px calc(120px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(7,13,31,0), rgba(7,13,31,.82) 36%, var(--abyss) 80%); }
.onb-i { font-family: var(--mincho); color: var(--lilac); letter-spacing: .3em; font-size: .95rem; }
.onb-h { margin-top: 8px; font-family: var(--mincho); font-weight: 700; font-size: 1.85rem; line-height: 1.5; letter-spacing: .04em; }
.onb-b { margin-top: 12px; font-size: .95rem; line-height: 1.95; color: var(--moon2); word-break: keep-all; }
.onb-f { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 14px 20px calc(22px + env(safe-area-inset-bottom)); }
.onb-dots { display: flex; justify-content: center; gap: 8px; }
.onb-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(189,181,238,.4); transition: background-color .4s, transform .4s; }
.onb-dots i.on { background: var(--moon); transform: scale(1.4); }

.nojs, .fatal { position: fixed; left: 16px; right: 16px; bottom: 24px; z-index: 99; padding: 16px; border-radius: 18px; background: var(--moon); color: var(--ink); line-height: 1.7; }
.fatal-t { font-weight: 700; }
.fatal a { color: var(--deep); text-decoration: underline; }

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