:root {
  color-scheme: light;
  --mist: #f5f2f3;
  --paper: #e9e1e4;
  --fog-blue: #cbd5df;
  --jelly-blue: #aabed8;
  --petal: #e7c5ce;
  --sea-glow: #bbd7d7;
  --panther: #202a3a;
  --ink: #454149;
  --muted: #817c84;
  --line: rgba(75, 76, 91, .10);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--mist);
  color: var(--ink);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--mist); }
body { min-height: 100dvh; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.splash-frame {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  border: 0;
  background: #07182b;
  z-index: 20;
  transition: opacity .8s ease, visibility .8s ease;
}
.splash-frame.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.app-shell { min-height: 100dvh; padding-top: var(--safe-top); padding-bottom: calc(76px + var(--safe-bottom)); }
.topbar { height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; }
.brand-lockup { display: flex; align-items: center; gap: 8px; color: var(--panther); font-family: Georgia, serif; letter-spacing: .13em; font-size: 14px; }
.brand-paw { color: #d8aebb; font-size: 17px; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.55); color: #726e78; font-size: 18px; }
.page-stack { width: min(100%, 560px); margin: 0 auto; padding: 10px 16px 28px; }
.page { display: none; animation: page-in .28s ease both; }
.page.is-active { display: block; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.panel, .anniversary-card { border: 1px solid rgba(255,255,255,.78); box-shadow: 0 8px 28px rgba(39, 47, 66, .045); }
.anniversary-card { position: relative; overflow: hidden; min-height: 328px; padding: 30px 20px 25px; border-radius: 30px; text-align: center; background: linear-gradient(145deg, rgba(255,255,255,.94), rgba(234,227,234,.94) 55%, rgba(216,225,234,.88)); }
.anniversary-card::before, .anniversary-card::after { content: ""; position: absolute; width: 190px; height: 190px; border-radius: 50%; filter: blur(35px); opacity: .42; pointer-events: none; }
.anniversary-card::before { left: -105px; top: 75px; background: #e8c8d4; }
.anniversary-card::after { right: -115px; top: 15px; background: #cbd9e8; }
.anniversary-card > * { position: relative; z-index: 1; }
.eyebrow { margin: 0; color: #8d8991; font-size: 11px; letter-spacing: .17em; }
.anniversary-card .eyebrow { font-family: Georgia, serif; letter-spacing: .22em; }
.anniversary-people { height: 67px; display: flex; justify-content: center; align-items: center; margin-top: 18px; }
.avatar { display: grid; place-items: center; width: 58px; height: 58px; border: 3px solid rgba(255,255,255,.82); border-radius: 50%; box-shadow: 0 4px 16px rgba(39,47,66,.08); font-family: Georgia, serif; font-size: 20px; }
.avatar-you { margin-right: -7px; background: linear-gradient(140deg,#f0d8df,#d5c9dc); color: #7b6674; }
.avatar-lumen { margin-left: -7px; background: linear-gradient(145deg,#536077,#202a3a); color: #f4dce8; }
.day-count { margin: 4px 0 0; color: #8d8c99; font: 300 clamp(84px, 25vw, 116px)/.98 Georgia, serif; letter-spacing: -.055em; }
.day-label { margin: 3px 0 17px; color: #74717b; font: 13px Georgia, serif; letter-spacing: .12em; }
.name-pills { display: flex; justify-content: center; gap: 10px; }
.name-pills span { min-width: 42%; padding: 9px 10px; border: 1px solid rgba(141,137,145,.22); border-radius: 999px; color: var(--ink); background: rgba(255,255,255,.55); font: italic 13px Georgia, serif; }
.since-line { margin: 17px 0 0; color: #96919a; font: 12px Georgia, serif; letter-spacing: .1em; }
.love-note { margin: 16px 0 0; color: #85818a; font: 13px/1.6 Georgia, "PingFang SC", serif; letter-spacing: .08em; }

.music-card { display: grid; grid-template-columns: 54px 1fr; gap: 11px; align-items: center; margin-top: 14px; min-height: 128px; padding: 18px; border-radius: 25px; background: linear-gradient(115deg, rgba(255,255,255,.88), rgba(226,229,235,.72)); }
.record-art { display: grid; place-items: center; width: 51px; height: 51px; border-radius: 50%; background: radial-gradient(circle at center,#f7eff2 0 15%,#7c8193 16% 23%,#353d50 24% 100%); color: #f2ceda; font-size: 18px; }
.music-copy h2 { margin: 6px 0 4px; color: var(--ink); font-size: 15px; font-weight: 500; }
.muted { color: var(--muted); font-size: 12px; line-height: 1.65; }
.music-copy .muted { margin: 0; font-size: 11px; }
.music-controls { grid-column: 1 / -1; display: flex; justify-content: center; align-items: center; gap: 23px; margin-top: 2px; }
.music-controls button { min-width: 28px; height: 34px; padding: 0; border: 0; background: transparent; color: #55535d; font-size: 17px; }
.music-controls .play-button { width: 48px; height: 42px; border-radius: 50%; background: #9695a8; color: white; font-size: 15px; }

.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.mini-panel { min-height: 188px; padding: 16px 14px; border-radius: 24px; background: rgba(255,255,255,.67); }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.weather-chip { max-width: 92px; padding: 4px 7px; border-radius: 999px; color: #75818b; background: rgba(203,213,223,.35); font-size: 9px; white-space: nowrap; }
.mood-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 13px 0 8px; }
.mood-options button { min-height: 31px; padding: 3px 1px; border: 1px solid rgba(148,145,153,.17); border-radius: 11px; background: rgba(255,255,255,.54); color: #76737c; font-size: 12px; }
.mood-options button.is-selected { border-color: rgba(178,147,167,.45); background: #f4e8ed; color: #785e70; }
.mood-panel .muted { margin: 4px 0 0; font-size: 10px; }
.today-panel .today-date { margin: 14px 0 8px; color: var(--ink); font: 15px Georgia, "PingFang SC", serif; }
.today-panel > p:not(.eyebrow):not(.today-date) { display: flex; justify-content: space-between; margin: 7px 0; color: #74717b; font-size: 11px; }
.today-panel strong { font-weight: 500; color: #8a8590; }
.message-panel { display: flex; align-items: center; gap: 13px; margin-top: 12px; padding: 17px; border-radius: 22px; background: linear-gradient(125deg,rgba(255,255,255,.8),rgba(242,226,234,.72)); }
.message-orb { flex: 0 0 42px; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(140deg,#f1d8e2,#cbd5df); color: #fff; font-size: 21px; }
.message-placeholder { margin: 7px 0 0; color: #726d78; font: 13px/1.7 Georgia, "PingFang SC", serif; }
.pantry-panel { margin-top: 12px; padding: 18px; border-radius: 24px; background: rgba(255,255,255,.74); }
.pantry-panel h2 { margin: 6px 0 0; color: var(--panther); font: 18px Georgia, "PingFang SC", serif; }
.text-button { border: 0; background: none; color: #77737c; font-size: 12px; }
.pantry-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin-top: 18px; }
.pantry-grid div { min-width: 0; }
.pantry-grid span, .pantry-grid strong, .pantry-grid small { display: block; }
.pantry-grid span { color: #817d85; font-size: 10px; }
.pantry-grid strong { margin-top: 6px; color: #4c4a53; font: 14px Georgia, "PingFang SC", serif; }
.pantry-grid small { margin-top: 5px; color: #aaa5ac; font-size: 9px; line-height: 1.4; }

.page-heading { padding: 17px 4px 19px; }
.page-heading h1 { margin: 5px 0 2px; color: var(--panther); font-size: 35px; font-weight: 300; }
.page-heading p:last-child { margin: 7px 0 0; }
.state-card { display: flex; align-items: center; gap: 15px; padding: 21px 17px; border-radius: 25px; background: linear-gradient(130deg,rgba(255,255,255,.9),rgba(229,220,232,.72)); }
.state-avatar { flex: 0 0 58px; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--panther); color: #f2dce7; font: 24px Georgia, serif; }
.state-card h2 { margin: 7px 0 4px; font-size: 16px; font-weight: 500; }
.state-card p:last-child { margin: 0; }
.simple-panel { margin-top: 12px; padding: 19px; border-radius: 23px; background: rgba(255,255,255,.72); }
.simple-panel p:last-child { margin-bottom: 0; }
.simple-panel h2 { margin: 8px 0; font-size: 17px; font-weight: 500; }
.tool-list { display: grid; gap: 11px; }
.tool-card { width: 100%; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; padding: 15px; border-radius: 22px; text-align: left; background: rgba(255,255,255,.78); }
.tool-icon { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 13px; background: #e8e7ee; color: #626779; font-size: 19px; }
.tool-card strong, .tool-card small { display: block; }
.tool-card strong { font-size: 13px; font-weight: 500; }
.tool-card small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.tool-state { color: #a29ca6; font-size: 10px; }
.trace-shortcuts { display: grid; gap: 9px; }
.trace-shortcuts button { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 16px 18px; border-radius: 19px; background: rgba(255,255,255,.76); text-align: left; font-size: 13px; }
.trace-shortcuts span { color: #aaa5ac; font-size: 18px; }
.night-card { min-height: 220px; display: grid; place-items: center; align-content: center; gap: 12px; padding: 25px; border-radius: 27px; background: linear-gradient(155deg,#253247,#322d42); color: #f4edf2; text-align: center; }
.night-card span { color: #d9cde7; font-size: 42px; }
.night-card p { max-width: 280px; color: rgba(244,237,242,.78); font: 14px/1.8 Georgia, "PingFang SC", serif; }
.back-link { margin-top: 16px; padding: 10px 4px; border: 0; background: transparent; color: #74717b; font-size: 13px; }

.bottom-nav { position: fixed; z-index: 10; right: 0; bottom: 0; left: 0; display: flex; justify-content: space-around; padding: 7px 9px calc(7px + var(--safe-bottom)); border-top: 1px solid rgba(97,96,108,.09); background: rgba(249,247,248,.94); backdrop-filter: blur(18px); }
.nav-item { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 3px; min-height: 47px; padding: 2px 0; border: 0; background: transparent; color: #99949e; }
.nav-item span { font-size: 20px; line-height: 23px; }
.nav-item small { font-size: 10px; }
.nav-item.is-active { color: var(--panther); }
.toast { position: fixed; z-index: 40; right: 50%; bottom: calc(82px + var(--safe-bottom)); max-width: calc(100% - 40px); padding: 10px 15px; border-radius: 999px; background: rgba(32,42,58,.9); color: white; font-size: 12px; opacity: 0; transform: translate(50%, 8px); transition: .2s ease; pointer-events: none; white-space: nowrap; }
.toast.is-visible { opacity: 1; transform: translate(50%, 0); }

@media (min-width: 700px) {
  .app-shell { padding-bottom: 30px; }
  .page-stack { padding-top: 22px; }
  .bottom-nav { position: sticky; width: min(560px,100%); margin: 0 auto; border: 1px solid var(--line); border-radius: 20px; }
}
@media (max-width: 365px) {
  .card-grid { grid-template-columns: 1fr; }
  .anniversary-card { padding-inline: 15px; }
  .pantry-grid { gap: 5px; }
  .pantry-grid small { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
