/* v69 editorial surface; legacy form and dialog behavior stays in styles.css. */
:root { --display-font: "Songti SC", "STSong", "SimSun", serif; --body-font: "Microsoft YaHei", "Segoe UI", sans-serif; --surface-radius: 16px; --control-radius: 6px; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.ui-icon { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
/* One navigation surface per viewport: desktop top tabs, mobile bottom tabs. */
.app-shell > .view-nav { display: grid; }
body { padding-bottom: 24px; }
html { scroll-padding-bottom: 24px; }
.mobile-nav {
  position: fixed; inset: auto 0 0; z-index: 40;
  display: none; grid-template-columns: repeat(4, minmax(0, 160px)); justify-content: center;
  padding: 8px 18px max(8px, env(safe-area-inset-bottom));
  border: 0; border-top: 1px solid var(--line); border-radius: 0;
  background: var(--panel); box-shadow: none; backdrop-filter: none;
}
.mobile-nav button {
  display: grid; place-items: center; gap: 4px; min-height: 56px;
  padding: 5px 12px; border: 0; border-radius: 0; background: none;
  color: var(--muted); font-size: 12px; font-weight: 500; box-shadow: none;
}
.mobile-nav button[aria-current="page"] { color: var(--rose-strong); background: none; box-shadow: inset 0 -2px var(--rose); }
body.modal-open :is(.mobile-nav, .view-nav), body:has(.pswp--open) :is(.mobile-nav, .view-nav) { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.app-shell { width: min(1160px, calc(100% - 72px)); }
.app-topbar { margin-bottom: 20px; }
.app-brand strong { font: 600 25px/1.3 var(--display-font); color: var(--rose-strong); letter-spacing: .04em; }
.identity-badge { margin-top: 5px; font-size: 11px; font-weight: 400; }
.topbar-settings { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 10px 2px 10px 10px; color: var(--muted); }
.topbar-settings svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.settings-label { font-size: 13px; font-weight: 500; }
.hero { display: grid; grid-template-columns: 1fr 1.15fr; align-items: center; gap: 48px; height: auto; min-height: 0; overflow: visible; border: 0; border-radius: 0; background: none; padding: 0; }
.hero::before { display: none; }
.app-shell[data-active-view="memories"] > .memory-cover.is-empty { display: none; }
.app-shell:has(.memory-cover.is-empty) .memory-heading { margin-bottom: 24px; }
.hero-copy { width: 100%; padding: 0; }
.hero h1 { font: 500 clamp(44px, 5vw, 68px)/1.3 var(--display-font); letter-spacing: -.03em; margin: 20px 0; }
.hero-meta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .eyebrow { margin: 0; letter-spacing: 0; }
.hero #appSubtitle { display: none; }
.hero-storyline { display: flex; flex-wrap: wrap; margin-top: 20px; }
.hero-storyline span { border: 0; background: none; padding: 0; font-size: 12px; color: var(--muted); }
.hero-storyline span + span::before { content: "·"; margin: 0 8px; }
.cover-actions { margin-top: 22px; }
.hero-secondary { padding: 6px 0; border: 0; min-height: 44px; border-radius: 0; font-size: 15px; }
.hero-secondary { display: inline-flex; align-items: center; gap: 8px; }
.hero-secondary span { display: inline; }
.editorial-photos { display: grid; grid-template-columns: 1.12fr .88fr; align-items: end; gap: 16px; position: relative; }
.editorial-photo { margin: 0; min-width: 0; }
.editorial-photo img { width: 100%; display: block; object-fit: cover; border-radius: 4px; background: var(--soft); }
.editorial-photo-main .cover-frame { height: 410px; }
.editorial-photo-detail .cover-frame { height: 290px; }
.editorial-photo figcaption { padding-top: 10px; font-size: 12px; color: var(--muted); }
.hero-carousel-controls { position: static; grid-column: 1 / -1; justify-self: end; margin: -8px 0 0; transform: none; background: none; color: var(--muted); border: 0; padding: 0; gap: 0; box-shadow: none; backdrop-filter: none; }
.hero-carousel-controls button { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0; color: var(--muted); background: none; border-radius: 4px; }
.hero-carousel-controls button:hover { color: var(--rose-strong); background: var(--soft); }
.hero-carousel-controls svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.hero-carousel-controls span { min-width: 40px; font-size: 11px; font-weight: 400; font-variant-numeric: tabular-nums; }
.cover-empty { grid-column: 1 / -1; min-height: 230px; background: var(--soft); padding: 40px 24px; }
.cover-empty p { font: 28px/1.5 var(--display-font); }
.hero:not(.has-cover) .editorial-photo { display: none; }
.quick-nav { position: sticky; top: 0; z-index: 32; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 34px; border-radius: 0; padding: 0; border-width: 1px 0; background: color-mix(in srgb, var(--panel) 96%, transparent); backdrop-filter: blur(12px); }
.quick-nav button { border-radius: 0; min-height: 54px; background: none; }
.quick-nav button[aria-current="page"] { background: none; box-shadow: inset 0 -2px var(--rose); }
.today-hub { margin-top: 24px; gap: 28px; }
.today-copy { grid-row: 3; border-top: 1px solid var(--line); padding-top: 20px; }
.today-copy h2 { font: 26px/1.4 var(--display-font); }
.quick-actions { grid-row: 1; display: flex; justify-content: flex-start; border-block: 1px solid var(--line); padding: 2px 0; }
.quick-actions button { display: flex; justify-content: flex-start; gap: 10px; flex: 1; border: 0; border-right: 1px solid var(--line); border-radius: 0; min-height: 50px; padding: 6px 2px; background: none; color: var(--rose-strong); }
.quick-actions button:last-child { border-right: 0; }
.quick-actions button small { display: none; }
.quick-actions button > span { width: auto; height: auto; background: none; }
.quick-actions button strong { font-size: 16px; font-weight: 400; }
.daily-ritual { grid-row: 2; background: none; border: 0; border-radius: 0; padding: 8px 0 24px; box-shadow: none; }
.daily-ritual h3 { font: 27px/1.4 var(--display-font); }
.daily-question { border: 0; padding-top: 0; font: 22px/1.65 var(--display-font); }
.daily-ritual .section-label { display: inline; font-size: 13px; color: var(--rose-strong); letter-spacing: 0; }
.daily-feelings { border-top: 1px solid var(--line); }
.daily-feelings > summary { display: flex; align-items: center; gap: 8px; width: fit-content; min-height: 44px; color: var(--rose-strong); cursor: pointer; font-size: 13px; font-weight: 500; }
.daily-feelings > summary span { color: var(--muted); font-size: 11px; font-weight: 400; }
.daily-feelings > summary::marker { color: var(--rose); }
.daily-feelings .daily-choices { padding: 4px 0 12px; }
.daily-form > #saveDaily { justify-self: end; min-width: 124px; }
.daily-perspectives { grid-row: 2; border-left: 1px solid var(--line); padding-left: 28px; }
.perspective-card, .perspective-card.together { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; padding: 16px 0; }
.panel, .stat-card { box-shadow: none; }
.stat-card { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }
.view-heading h2 { font: 500 48px/1.25 var(--display-font); letter-spacing: -.025em; }
.view-heading > .section-label { display: none; }
.memory-heading { position: relative; z-index: 1; margin-bottom: -55px; max-width: 720px; }
.memory-heading h2 { font-size: clamp(46px, 6vw, 76px); }
.memory-heading p { background: var(--panel); width: fit-content; padding-right: 12px; }
.memory-cover { margin: 0 0 28px 20%; position: relative; }
.memory-cover .cover-frame { height: 440px; }
.memory-cover img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 3px; background: var(--soft); }
.memory-cover figcaption { position: absolute; bottom: 0; left: 0; background: var(--panel); color: var(--ink); padding: 14px 24px; font: 18px/1.4 var(--display-font); }
.memory-cover.is-empty { display: none; }
.memory-tabs { border-radius: 0; border-width: 1px 0; padding: 0; gap: 20px; }
.memory-tabs button { border-radius: 0; background: none; min-height: 52px; }
.memory-tabs button[aria-selected="true"] { background: none; box-shadow: inset 0 -2px var(--rose); }
.story-panel, #timelinePanel, #moments, #notes, .qa-panel { background: none; border: 0; border-radius: 0; padding-inline: 0; }
.view-heading, .section-shortcuts, #records, #period, #wishes, #qa { width: min(100%, 1040px); margin-inline: auto; }
.memory-panel-stack { width: min(100%, 920px); margin-inline: auto; }
.story-panel { padding-block: 8px 30px; border-bottom: 1px solid var(--line); }
.story-panel h2 { margin: 0 0 8px; font: 500 28px/1.35 var(--display-font); color: var(--rose-strong); }
.story-panel p { max-width: 72ch; margin: 14px 0; color: var(--ink); line-height: 1.8; }
.elapsed-chip { display: inline-flex; min-height: 36px; align-items: center; padding: 0; border: 0; border-radius: 0; background: none; color: var(--rose-strong); font-size: 13px; font-weight: 500; }
.story-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.story-meta span { padding: 0; border: 0; border-radius: 0; background: none; color: var(--muted); font-size: 13px; }
#timelinePanel { padding-top: 28px; }
#timelinePanel > .panel-intro { max-width: 68ch; }
.timeline { gap: 0; margin-top: 18px; }
.timeline-item { position: relative; grid-template-columns: 108px minmax(0, 1fr); gap: 28px; padding: 20px 0 24px; border-bottom: 1px solid var(--line); }
.timeline-item::before { content: ""; position: absolute; left: 120px; top: 27px; width: 7px; height: 7px; border: 2px solid var(--panel); border-radius: 50%; background: var(--rose); box-shadow: 0 0 0 1px var(--rose); }
.timeline-item time { color: var(--muted); font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
.timeline-copy { min-width: 0; }
.timeline-copy strong { margin-bottom: 7px; color: var(--ink); font: 500 18px/1.45 var(--display-font); }
.timeline-copy p { max-width: 70ch; font-size: 14px; line-height: 1.75; }
.anniversary-timeline-item { padding: 20px 0 24px; border-width: 0 0 1px; border-radius: 0; background: none; }
.anniversary-timeline-item time::before { content: none; }
.timeline-links { gap: 6px; }
.timeline-link { min-height: 44px; border-radius: var(--control-radius); font-weight: 500; background: none; }
.timeline-photo { width: min(100%, 420px); border: 0; border-radius: 3px; }
.section-shortcuts a { border-radius: 0; border-width: 0 0 1px; background: none; }
.note-head h3, .note-box .clean-list li.empty-state { color: var(--ink); }
.wish-column-head h3, #storyElapsed { color: var(--rose-strong); }
.section-label { display: none; }
.footer-hearts { display: none; }
.daily-note-modal { background: rgba(38, 20, 31, .42); backdrop-filter: blur(5px); }
.daily-note-paper { position: relative; width: min(540px, calc(100% - 40px)); background: var(--panel); color: var(--ink); border: 0; border-radius: 2px; padding: 64px 42px 38px; box-shadow: 0 18px 50px #00000026; }
.daily-note-paper h2 { font: 20px/1.5 var(--display-font); margin: 0; }
.daily-note-paper blockquote { margin: 26px 0; font: 500 32px/1.65 var(--display-font); overflow-wrap: anywhere; }
.daily-note-close { position: absolute; right: 14px; top: 12px; color: var(--ink); background: none; font-size: 28px; }
.daily-note-caption { font-size: 12px; color: var(--muted); line-height: 1.6; }
.daily-note-keep { margin-top: 20px; padding: 8px 0; background: none; color: var(--ink); border-radius: 0; border-bottom: 1px solid var(--muted); font: 18px/1.5 var(--display-font); }
@media (max-width: 820px) {
  html { scroll-behavior: auto; }
  body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  html { scroll-padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .app-shell > .view-nav { display: none; }
  .mobile-nav { display: grid; }
  .settings-label { display: none; }
  .app-shell { width: calc(100% - 36px); padding-top: 10px; }
  .app-topbar { margin-bottom: 18px; }
  .app-brand strong { font-size: 24px; }
  .hero { display: flex; flex-direction: column; align-items: stretch; gap: 12px; height: auto; margin-top: 0; }
  .app-shell[data-active-view="today"] > .hero { display: flex; }
  .hero-copy { position: relative; padding: 0; }
  .hero-meta { margin: 0; justify-content: space-between; gap: 4px; }
  .hero .eyebrow, .hero-date { font-size: 10px; }
  .hero h1 { margin: 14px 0 8px; font-size: clamp(32px, 8.9vw, 39px); line-height: 1.3; }
  .hero-storyline { margin: 0; gap: 0; }
  .hero-storyline span { font-size: 10px; padding: 0; }
  .hero-storyline span:first-child { display: none; }
  .hero-storyline span + span::before { display: none; }
  .cover-actions { position: absolute; right: 0; bottom: 0; margin: 0; }
  .hero-secondary { font-size: 13px; }
  .editorial-photos { gap: 9px; }
  .editorial-photo-main .cover-frame { height: 280px; }
  .editorial-photo-detail .cover-frame { height: 190px; }
  .editorial-photo figcaption { font-size: 10px; padding-top: 7px; white-space: nowrap; }
  .hero-carousel-controls { margin-top: -5px; }
  .today-hub { margin-top: 14px; gap: 20px; }
  .quick-actions { padding: 0; }
  .quick-actions button { gap: 8px; flex-direction: row; min-height: 44px; }
  .quick-actions button strong { font-size: 12px; }
  .quick-actions button > span { font-size: 21px; line-height: 1; }
  .daily-ritual { padding: 0 0 20px; }
  .daily-ritual h3 { font-size: 23px; }
  .daily-question { font-size: 20px; }
  .daily-form > #saveDaily { width: 100%; justify-self: stretch; }
  .daily-perspectives { grid-row: 4; border: 0; padding: 0; }
  .today-copy { grid-row: 3; }
  .view-heading h2 { font-size: 36px; }
  .memory-heading { margin-top: 28px; margin-bottom: -34px; }
  .memory-heading h2 { font-size: 49px; }
  .memory-heading > button { justify-self: end; min-width: 0; margin-top: -40px; }
  .memory-cover { margin-left: 14%; margin-right: -18px; }
  .memory-cover .cover-frame { height: 310px; }
  .memory-cover figcaption { font-size: 14px; padding: 12px 18px; }
  .mobile-nav { border-radius: 0; box-shadow: none; border-top: 1px solid var(--line); }
  .mobile-nav button { border-radius: 0; }
  .mobile-nav button[aria-current="page"] { background: none; box-shadow: inset 0 -2px var(--rose); }
  .daily-note-paper { padding: 56px 28px 30px; }
  .daily-note-modal { align-items: center; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .daily-note-paper blockquote { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { .hero, .editorial-photo img, .daily-note-paper { animation: none; transition: none; } }

/* Warm paper and restrained accents. Preference keys and photo pixels stay intact. */
body[data-theme="cream"] {
  --ink: #38332c; --muted: #6e665c; --line: #e0d8c9;
  --panel: #fffdf6; --soft: #eee9da; --rose: #79603d; --rose-strong: #66502f;
  --accent: #656b48; --gold: #756039; --page-start: #f8f5ec; --page-end: #f8f5ec;
}
body[data-theme="night"] {
  --ink: #f2e8e7; --muted: #c0afaf; --line: #514147;
  --panel: #2a2328; --soft: #382d33; --rose: #e6aabb; --rose-strong: #f3bdcd;
  --accent: #d6b4bf; --gold: #d4bf94; --page-start: #201c20; --page-end: #201c20;
  --shadow: 0 12px 32px #00000024;
}
body { background: var(--page-start); }
::selection { color: var(--panel); background: var(--ink); }
input, textarea { caret-color: var(--rose-strong); }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--rose-strong); outline-offset: 4px; }
.app-brand strong { color: var(--rose-strong); letter-spacing: 0; }
.hero h1, .view-heading h2, .collection-heading h2, .daily-ritual h3, .daily-note-paper h2 { color: var(--rose-strong); }
.quick-actions .ui-icon { color: var(--rose); }
.mobile-nav button[aria-current="page"] { background: var(--soft); }
.identity-badge { color: var(--muted); }
button, input, textarea, select, .secondary-btn { border-radius: 6px; }
body[data-theme="night"] :is(input, textarea, select, .secondary-btn, .music-picker, .icon-btn) { color: var(--ink); background: var(--panel); }
body[data-theme="night"] :is(.hero-primary, .note-compose button, #saveDaily, #saveAnswer, #addWish, #saveLetter, #unlockButton, #addAnniversary, #openMomentDialog, #saveMoment) { color: #171717; }
.interaction-item.bubu .interaction-icon { color: var(--ink); background: var(--soft); }
.interaction-item.bubu .interaction-copy strong { color: var(--ink); }
.lock { background: #f5e7e1; }
.lock-panel { border: 1px solid #e5ccc5; border-top: 5px solid var(--rose); border-radius: 20px; background: var(--panel); box-shadow: 0 18px 64px #793e4912; padding: 32px 28px 24px; }
.lock-panel h1 { color: var(--rose-strong); font-size: 38px; }
.lock-panel .welcome-kicker { font-size: 13px; font-weight: 500; letter-spacing: .08em; }
.identity-picker label { background: #fff9f5; }
.identity-picker label > span { color: #a35067; }
.identity-picker label:last-child > span { color: #657354; }
.identity-picker label:has(input:checked) { box-shadow: none; border-color: var(--rose); }
.identity-picker label:has(input:focus-visible) { outline: 2px solid var(--rose-strong); outline-offset: 3px; }
#unlockButton { background: var(--rose); box-shadow: none; min-height: 48px; }
.cover-frame { position: relative; background: var(--soft); border-radius: 4px; overflow: hidden; }
.cover-frame img { width: 100%; height: 100%; object-fit: cover; }
.cover-frame img[hidden] { display: none; }
.cover-load-state { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; padding: 16px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.6; }
.cover-load-state[hidden] { display: none; }
.cover-load-state button { min-height: 44px; box-shadow: none; font-size: 12px; }
.daily-note-modal { background: #00000066; }
.panel, .note-box, .wish-column, .perspective-card { box-shadow: none; }
.note-box, .wish-column { border-radius: 6px; }
.memory-heading { margin: 36px 0 28px; max-width: none; align-items: end; }
.memory-heading h2 { font-size: clamp(38px, 4.5vw, 58px); line-height: 1.2; }
.memory-heading p { padding: 0; background: none; margin-bottom: 0; }
.memory-heading > button { align-self: end; justify-self: end; margin: 0; }
.app-shell[data-active-view="memories"][data-active-memory-view="photos"] > .memory-cover { display: none; }
.app-shell[data-active-memory-view="photos"] .memory-heading > button { display: none; }
.memory-tabs { display: flex; gap: 0; background: var(--page-start); border: 1px solid var(--line); border-radius: 6px; padding: 3px; }
#app[data-active-view="memories"] > #memoryTabs { display: flex; top: 53px; }
.memory-tabs button { flex: 0 0 50%; min-width: 0; padding: 12px 0; font-size: 14px; border-radius: 3px; text-align: center; }
.memory-tabs button + button { border-left: 1px solid var(--line); }
.memory-tabs button[aria-selected="true"] { background: var(--soft); color: var(--rose-strong); box-shadow: none; font-weight: 600; }
#moments { margin-top: 28px; padding-top: 0; }
@media (min-width: 821px) { #moments { margin-top: 42px; } }
[data-memory-panel] { scroll-margin-top: 122px; }
#moments .panel-head { flex-direction: row; justify-content: space-between; align-items: center; text-align: left; margin-bottom: 10px; gap: 16px; }
.collection-heading { display: flex; align-items: baseline; gap: 14px; }
.collection-heading h2 { margin: 0; font: 500 22px/1.4 var(--display-font); }
.collection-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
#moments > .panel-intro { margin: 0 0 28px; color: var(--muted); font-size: 13px; }
.gallery-head-actions { gap: 10px; }
#galleryModeToggle { border: 0; background: none; color: var(--muted); padding-inline: 8px; }
#galleryModeToggle:hover { color: var(--ink); }
#openMomentDialog { padding: 10px 18px; }
.gallery { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 42px 24px; align-items: start; margin-top: 0; }
.gallery .photo-card { grid-column: span 4; border: 0; border-radius: 0; background: none; box-shadow: none; display: block; overflow: visible; cursor: default; }
.gallery .photo-card:nth-child(5n + 1) { grid-column: span 8; }
.gallery .photo-card:hover { transform: none; box-shadow: none; }
.photo-frame { position: relative; background: var(--soft); }
.gallery .photo-card .photo { display: block; width: 100%; height: auto; aspect-ratio: 1; background: var(--soft); border-radius: 2px; }
.gallery .photo-card:nth-child(5n + 1) .photo { aspect-ratio: 8 / 5; }
.gallery .photo-card:nth-child(5n + 2) .photo { aspect-ratio: 4 / 5; }
.gallery .photo-card .photo img { object-fit: cover; }
.gallery .photo-text { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 12px 0 0; align-items: baseline; }
.gallery .photo-text strong { font-size: 15px; font-weight: 500; line-height: 1.5; margin: 0; overflow-wrap: anywhere; }
.photo-date { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gallery .photo-text p { grid-column: 1; max-width: 52ch; font-size: 12px; line-height: 1.7; }
.photo-load-state { background: var(--soft); color: var(--muted); pointer-events: none; z-index: 1; }
.photo-retry { pointer-events: auto; min-height: 44px; }
.gallery > .empty-state { grid-column: 1 / -1; padding: 72px 24px; text-align: center; border: 1px solid var(--line); background: none; }
.gallery > .content-pagination { border-top: 1px solid var(--line); border-radius: 0; background: none; padding: 22px 0; margin-top: 0; }
.memory-stream { gap: 18px; margin-top: 0; }
.memory-tile { width: 220px; height: 270px; border: 0; border-radius: 2px; box-shadow: none; }
.memory-lane.lane-2 .memory-tile { width: 270px; height: 210px; }
/* Shared compact surfaces: content first, one border level, secondary work on demand. */
.panel-head > button::before { display: none; }
.panel-head h2, .qa-copy h2 { font-size: 23px; line-height: 1.4; color: var(--rose-strong); }
.panel-intro, .qa-copy > p { font-size: 14px; line-height: 1.7; margin: 8px 0 16px; }
.panel-head { margin-bottom: 16px; gap: 12px; }
.section-shortcuts { gap: 0; border-bottom: 1px solid var(--line); }
.section-shortcuts a { justify-content: center; border: 0; padding: 10px; font-size: 13px; }
.section-shortcuts a + a { border-left: 1px solid var(--line); }
#wishes, #period { padding: 24px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }
#wishes { position: relative; border-top: 0; }
#wishes > .panel-head { padding-right: 100px; margin-bottom: 8px; }
#wishComposer > summary { position: absolute; right: 0; top: 20px; }
#wishes .wish-board { margin-top: 8px; }
.note-box, .wish-column { padding: 0; border: 0; border-radius: 0; background: none; }
.notebook-grid { gap: 24px; }
.note-box + .note-box { border-left: 1px solid var(--line); padding-left: 24px; }
.clean-list li { border-radius: 0; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 10px 0; }
.clean-list li.empty-state, .qa-list > .empty-state, .interaction-feed > .empty-state { min-height: 0; padding: 14px 0; margin: 0; background: none; border: 0; font-size: 13px; line-height: 1.7; }
.note-box .clean-list li.empty-state { justify-content: flex-start; text-align: left; color: var(--muted); }
.wish-board { grid-template-columns: 1fr; gap: 12px; margin-top: 16px; }
.wish-column-head { margin: 0; min-height: 44px; }
.wish-column-head h3, .wish-column-head > span { font-size: 14px; font-weight: 500; }
.check-list { margin: 0; }
.check-list li:not(.empty-state) { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.check-list .wish-text { font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.check-list .toggle { width: 44px; height: 44px; padding: 0; border: 0; position: relative; background: none; color: var(--rose-strong); }
.check-list .toggle::before { content: ""; position: absolute; inset: 12px; border: 1px solid var(--rose); border-radius: 50%; }
.check-list .row-actions { gap: 4px; }
.check-list .row-actions button { padding: 0 4px; min-height: 44px; min-width: 44px; background: none; border: 0; color: var(--muted); font-size: 11px; }
.pager[hidden] { display: none; }
.pager { font-size: 12px; margin-top: 12px; }
.completed-wishes { border-top: 1px solid var(--line); }
.completed-wishes > summary { display: flex; cursor: pointer; color: var(--muted); list-style: none; gap: 8px; }
.completed-wishes > summary::-webkit-details-marker { display: none; }
.completed-wishes > summary::after { content: ""; width: 6px; height: 6px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); margin: 0 4px 4px 8px; }
.completed-wishes[open] > summary::after { transform: rotate(225deg); margin-bottom: -3px; }
.completed-wishes #doneWishCount { margin-left: auto; }
.inline-disclosure > summary { cursor: pointer; color: var(--rose-strong); min-height: 44px; padding: 10px 0; font-size: 14px; width: fit-content; }
summary:focus-visible { outline: 2px solid var(--rose-strong); outline-offset: 3px; }
.wish-compose { display: flex; gap: 8px; margin: 8px 0 12px; }
.wish-compose input { flex: 1; min-width: 0; }
.wish-compose button { flex-shrink: 0; }
.qa-intro-quote { display: none; }
.qa-card { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 16px 0; background: none; box-shadow: none; }
.activity-head > small { display: none; }
.stats-grid { gap: 20px; }
.stat-card { padding: 16px 0; }
.stat-card strong { font-size: 26px; }
.stat-card small { font-size: 11px; }
.content-pagination, .clean-list li.content-pagination, .update-list li.content-pagination, .gallery > .content-pagination {
  display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-end;
  gap: 4px; box-shadow: none; border-radius: 0; background: none; border: 0; border-top: 1px solid var(--line); padding: 8px 0; margin-top: 0;
}
.content-pagination .content-mode-select, body[data-theme="night"] .content-pagination .content-mode-select {
  flex: 0 1 128px; width: 128px; min-width: 0; min-height: 44px; margin-right: auto;
  padding: 8px 20px 8px 0; border: 0; border-radius: 0; background-color: transparent; color: var(--muted); font-size: 12px; font-weight: 400; box-shadow: none;
}
.content-pagination option { background: var(--panel); color: var(--ink); }
.content-pagination .content-page-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; min-width: 44px; height: 44px; min-height: 44px;
  padding: 0; border: 0; border-radius: 4px; background: none; color: var(--muted); box-shadow: none; transform: none;
}
.content-pagination .content-page-btn:hover { background: var(--soft); color: var(--rose-strong); box-shadow: none; transform: none; }
.content-pagination .content-page-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.content-pagination .content-count { font-size: 12px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.content-pagination .content-more { font-size: 12px; padding: 8px; border: 0; background: none; color: var(--rose-strong); box-shadow: none; }
@media (max-width: 820px) {
  .panel-head h2, .qa-copy h2 { font-size: 21px; }
  .view-heading { margin: 24px 0; }
  .view-heading h2 { font-size: 32px; }
  .view-heading p { font-size: 13px; line-height: 1.7; }
  .note-box + .note-box { border-left: 0; border-top: 1px solid var(--line); padding: 20px 0 0; }
  .note-compose { display: flex; gap: 8px; }
  .note-compose input { min-width: 0; flex: 1; }
  .note-compose button { flex-shrink: 0; }
  .stats-grid { gap: 12px; }
  .memory-heading { margin: 26px 0 24px; }
  .memory-heading h2 { font-size: 38px; }
  .memory-heading > button { grid-row: 1; grid-column: 2; margin: 0; min-width: 0; }
  .memory-tabs { gap: 0; top: 0; }
  #app[data-active-view="memories"] > #memoryTabs { top: 0; }
  [data-memory-panel] { scroll-margin-top: 66px; }
  #moments { margin-top: 22px; }
  #moments .panel-head { flex-wrap: wrap; gap: 12px; }
  .collection-heading { gap: 10px; }
  .collection-heading h2 { font-size: 20px; }
  .gallery-head-actions { gap: 4px; }
  #openMomentDialog { padding: 8px 12px; font-size: 12px; }
  #galleryModeToggle { font-size: 12px; }
  #moments > .panel-intro { margin-bottom: 20px; font-size: 12px; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 12px; }
  .gallery .photo-card, .gallery .photo-card:nth-child(5n + 1) { grid-column: span 1; }
  .gallery .photo-card:nth-child(3n + 1) { grid-column: 1 / -1; }
  .gallery .photo-card .photo, .gallery .photo-card:nth-child(5n + 1) .photo, .gallery .photo-card:nth-child(5n + 2) .photo { aspect-ratio: 3 / 4; }
  .gallery .photo-card:nth-child(3n + 1) .photo { aspect-ratio: 4 / 3; }
  .gallery .photo-text { grid-template-columns: minmax(0, 1fr); gap: 4px; padding-top: 10px; }
  .gallery .photo-text strong { grid-column: 1; font-size: 14px; }
  .photo-date { grid-column: 1; grid-row: 2; font-size: 10px; }
  .gallery .photo-text p { grid-row: 3; grid-column: 1; font-size: 11px; }
  .memory-tile { width: 170px; height: 220px; }
  .memory-lane.lane-2 .memory-tile { width: 210px; height: 160px; }
  .story-panel { padding-bottom: 24px; }
  .story-panel h2 { font-size: 24px; }
  .story-panel p { margin-block: 10px; font-size: 14px; }
  #timelinePanel { padding-top: 22px; }
  .timeline-item { grid-template-columns: 76px minmax(0, 1fr); gap: 18px; padding: 17px 0 20px; }
  .timeline-item::before { left: 84px; top: 24px; width: 6px; height: 6px; }
  .timeline-copy strong { font-size: 17px; }
  .timeline-copy p { font-size: 13px; }
}

/* Finish pass: one type scale and one surface language, including secondary dialogs. */
body { font-family: var(--body-font); }
.panel-head h2, .qa-copy h2, #story h2, .activity-head h3, .today-copy h2 {
  font-family: var(--display-font); font-size: 24px; font-weight: 500; line-height: 1.4; letter-spacing: 0; color: var(--rose-strong);
}
.note-head h3, .qa-question-row strong, .select-control, .secondary-btn, .daily-form > label, .daily-state { font-weight: 500; }
.panel-head, .note-head { align-items: center; }
.panel-head { flex-direction: row; }
.daily-ritual .panel-head { flex-wrap: wrap; }
.panel-intro, .qa-copy > p, .utility-note { font-size: 13px; line-height: 1.7; }
.privacy-state { display: flex; align-items: center; gap: 7px; margin: 4px 0 16px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.privacy-state::before { content: ""; flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--rose); }
.privacy-state[data-state="syncing"]::before { background: var(--gold); }
.privacy-state[data-state="error"]::before, .privacy-state[data-state="conflict"]::before { background: #a13746; }
.identity-answer-status { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: 12px; }
.secondary-btn { border-radius: var(--control-radius); background: var(--panel); box-shadow: none; }
.note-compose button, #saveDaily, #saveAnswer, #addWish, #addAnniversary, #openMomentDialog, #saveMoment {
  background: var(--rose); box-shadow: none; font-weight: 500; border-radius: var(--control-radius);
}
.note-compose input, .wish-compose input, .daily-form textarea, .qa-compose textarea { background: var(--panel); }
.quick-actions button strong { font-size: 13px; }
.quick-actions button { color: var(--rose-strong); }
.perspective-card strong { font-size: 15px; font-weight: 500; line-height: 1.65; }
.perspective-card small { font-size: 12px; }
.site-footer { padding: 28px 0 16px; gap: 4px; }
.site-footer > span { font-size: 12px; font-weight: 500; letter-spacing: 0; }
.site-footer p { max-width: 48ch; font-size: 12px; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; margin-top: 0; font-size: 12px; font-weight: 500; }
.modal, .period-mood-modal { background: rgba(37, 26, 32, .5); }
.modal-panel:not(.daily-note-paper), .period-mood-panel {
  background: var(--panel); color: var(--ink); border: 0; border-radius: var(--surface-radius);
  box-shadow: 0 16px 56px #21121c29; padding: 24px; gap: 12px;
  max-height: calc(100dvh - 40px); overscroll-behavior: contain;
}
.modal-panel .panel-head { display: flex; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: nowrap; margin: 0; gap: 16px; }
.modal-panel .panel-head > div { min-width: 0; }
.modal-panel:not(.daily-note-paper) h2, .period-mood-panel h2 { margin: 0; color: var(--rose-strong); font: 500 26px/1.4 var(--display-font); }
.modal-panel .panel-head > .icon-btn, #cancelPeriodMood {
  flex: 0 0 44px; width: 44px; min-width: 44px; height: 44px; min-height: 44px;
  background: none; border: 0; border-radius: var(--control-radius); color: var(--muted); box-shadow: none; font-size: 24px; font-weight: 400;
}
.modal-panel .panel-head > .icon-btn:hover, #cancelPeriodMood:hover { background: var(--soft); color: var(--rose-strong); }
.settings-panel { width: min(640px, 100%); }
.settings-panel-head { position: sticky; top: -1px; z-index: 4; background: var(--panel); padding: 0 0 12px; border-bottom: 1px solid var(--line); }
.settings-panel .utility-content { display: grid; grid-template-columns: 1fr; gap: 20px; }
.settings-group { min-width: 0; }
.settings-group h3 { margin: 0 0 10px; color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1.5; }
.settings-group .utility-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-top: 0; }
.settings-group .utility-actions > * { min-width: 0; }
.settings-group .select-control { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-group .select-control select { width: min(210px, 70%); flex: none; font-size: 14px; }
.settings-group button { min-height: 44px; font-size: 13px; font-weight: 400; }
.settings-group .music-box { margin-top: 12px; }
.settings-group .music-box audio { width: 100%; min-width: 0; }
.settings-group .storage-meter { margin-top: 16px; padding: 0; border: 0; background: none; gap: 8px; }
.storage-meter strong { font-size: 13px; font-weight: 500; }
.storage-meter > div { align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.storage-meter small { font-size: 11px; line-height: 1.6; }
.storage-meter progress { height: 5px; background: var(--soft); }
.storage-meter progress::-webkit-progress-bar { background: var(--soft); }
.storage-meter progress[data-level="warning"] { --meter-color: #ad7226; }
.storage-meter progress[data-level="danger"] { --meter-color: #b74255; }
.storage-meter progress::-webkit-progress-value { background: var(--meter-color, var(--rose)); }
.storage-meter progress::-moz-progress-bar { background: var(--meter-color, var(--rose)); }
.sync-conflict { background: var(--soft); color: var(--ink); border-color: var(--gold); }
#useLocalState { background: var(--rose); color: var(--panel); box-shadow: none; }
.utility-note { margin: 0; color: var(--muted); }
.device-settings { border-top: 1px solid var(--line); padding-top: 16px; }
.settings-updates { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; margin: 0; }
.settings-updates summary { padding: 12px 0; gap: 8px; min-height: 44px; }
.settings-updates summary strong { font-size: 14px; font-weight: 500; color: var(--ink); }
.settings-updates summary small { font-size: 12px; color: var(--muted); }
.settings-updates .update-list { padding: 0; }
#momentModal .modal-panel { gap: 8px; }
.upload-box { position: relative; min-height: 80px; margin: 8px 0; border: 1px dashed var(--line); border-radius: 8px; color: var(--rose-strong); background: var(--soft); text-align: center; padding: 16px; font-size: 14px; font-weight: 500; }
.upload-box input { display: block; position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-box:has(input:focus-visible) { outline: 2px solid var(--rose-strong); outline-offset: 3px; }
.field-label { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 -2px; color: var(--ink); font-size: 13px; font-weight: 500; }
.field-label small, .field-hint { font-size: 11px; color: var(--muted); font-weight: 400; line-height: 1.6; }
.field-hint { margin: 0; }
.moment-save-bar { bottom: -24px; margin: 8px -24px -24px; padding: 12px 24px max(24px, env(safe-area-inset-bottom)); background: var(--panel); box-shadow: none; backdrop-filter: none; }
.moment-save-bar button { min-height: 46px; }
.confirm-panel { width: min(430px, 100%); gap: 20px; }
.confirm-message { font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
.confirm-actions { margin-top: 8px; gap: 12px; }
.confirm-actions button { min-height: 46px; font-size: 14px; font-weight: 500; box-shadow: none; }
.danger-btn { background: #a13746; color: #fff; }
.viewer-delete { min-height: 44px; justify-self: start; padding: 6px 0; border: 0; border-radius: 0; background: none; color: #c88b98; font: 500 12px/1.4 var(--body-font); text-decoration: underline; text-underline-offset: 4px; }
.viewer-delete:hover { color: #fff; }
.pswp__button--love-delete { width: auto; min-width: 64px; padding-inline: 12px; color: #fff; font: 500 13px/1 var(--body-font); }
.device-recovery-notice { display: flex; align-items: center; gap: 16px; padding: 14px 0; margin-bottom: 16px; border-block: 1px solid var(--line); }
.device-recovery-notice[hidden] { display: none; }
.device-recovery-notice > div { flex: 1; min-width: 0; }
.device-recovery-notice strong { font-size: 14px; font-weight: 500; color: var(--rose-strong); }
.device-recovery-notice p, .device-recovery-panel p { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.device-recovery-notice button { flex: none; min-height: 44px; font-size: 13px; }
.device-recovery-panel { width: min(590px, 100%); }
.device-recovery-copies { display: grid; gap: 0; margin-block: 8px; }
.device-recovery-copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding-block: 16px; border-block-start: 1px solid var(--line); }
.device-recovery-copy h3 { margin: 0; color: var(--ink); font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.device-recovery-copy p { grid-column: 1; margin: 0; }
.device-recovery-copy button { grid-column: 2; grid-row: 1 / 3; min-height: 44px; align-self: center; font-size: 13px; }
.device-recovery-actions { display: grid; gap: 8px; margin-top: 12px; }
.device-recovery-actions button { min-height: 46px; font-size: 14px; }
.device-readonly [data-view] input:disabled, .device-readonly [data-view] textarea:disabled { cursor: not-allowed; }
.device-settings .danger-secondary { color: #a13746; background: none; border-color: var(--line); }
body[data-theme="night"] .device-settings .danger-secondary { color: #f3aab3; background: none; }
.period-mood-panel { width: min(460px, 100%); padding: 28px; }
.period-mood-panel h2 { padding-right: 36px; }
.period-mood-panel .mood-hint { color: var(--muted); font-size: 13px; line-height: 1.7; }
.mood-options button { border: 1px solid var(--line); background: var(--soft); box-shadow: none; border-radius: 8px; }
@media (max-width: 820px) {
  .panel-head h2, .qa-copy h2, #story h2, .activity-head h3, .today-copy h2 { font-size: 22px; }
  .daily-ritual h3 { font-size: 24px; }
  .modal-panel:not(.daily-note-paper) { padding: 20px 18px max(20px, env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; max-height: calc(100dvh - 16px); }
  .modal-panel:not(.daily-note-paper) h2, .period-mood-panel h2 { font-size: 24px; }
  .settings-panel .utility-content { gap: 18px; }
  .identity-answer-status { min-height: 40px; }
  #momentModal .modal-panel { padding-bottom: 0; }
  .moment-save-bar { bottom: 0; margin: 8px -18px 0; padding: 12px 18px max(20px, env(safe-area-inset-bottom)); }
  #confirmModal { align-items: center; padding: 20px; }
  #confirmModal .confirm-panel { border-radius: 16px; padding: 24px; }
  .period-mood-panel { max-height: calc(100dvh - 32px); overflow: auto; padding: 24px 20px; }
}
#timelineImportPanel input[type="file"] {
  display: block;
  width: 100%;
  min-width: 0;
  margin-block: 8px;
}

#timelineImportPanel p {
  overflow-wrap: anywhere;
}
