:root {
  --paper: #fbf5f9;
  --cream: #f1e4f1;
  --ink: #36243e;
  --muted: #68536c;
  --rose: #98466e;
  --rose-soft: #f6e0e8;
  --blue: #55598e;
  --blue-soft: #e9e6f7;
  --line: rgba(83, 48, 92, .16);
  --shadow: 0 24px 80px rgba(73, 35, 79, .13);
  --title-font: "Songti SC", "Noto Serif CJK SC", "STSong", Georgia, serif;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 78% 45%, #f3e9f7, transparent 58%), var(--paper); color: var(--ink); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; color: inherit; }
main { position: relative; }
:where(a, button, summary, select):focus-visible { outline: 2px solid var(--rose); outline-offset: 4px; }
h1, h2, h3 { font-family: var(--title-font); font-weight: 600; }
em { color: var(--rose); font-style: italic; }
.site-header { height: 76px; padding: 0 clamp(20px, 5vw, 80px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; background: rgba(251,245,249,.94); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: var(--rose-soft); color: var(--ink); font: italic 16px Georgia, serif; }
.brand strong { font-family: var(--title-font); font-size: 17px; }
.site-header nav { display: flex; align-items: center; gap: 24px; font-size: 14px; }
.site-header nav > a:hover { color: var(--rose); }
.site-header form { margin: 0; }
.user-pill { padding: 7px 12px; border-radius: 999px; font-size: 12px; }
.user-pill.rose { background: var(--rose-soft); color: #762853; }
.user-pill.blue { background: var(--blue-soft); color: #494578; }
.text-button { border: 0; background: transparent; color: var(--muted); padding: 0; }

.login-shell {
  min-height: 100vh; min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  gap: clamp(28px, 6vw, 124px); align-items: center; padding: 64px clamp(35px, 7vw, 116px);
  background: linear-gradient(90deg, #23152cbf, #29183244 58%, #27182e66), url("romance/rose-garden.webp") center / cover, #352440;
}
.login-art { color: #fff9f4; text-shadow: 0 3px 24px #29122e99; }
.monogram { display: inline-flex; align-items: center; justify-content: center; gap: .2em; width: 78px; height: 78px; border-radius: 50%; border: 1px solid #ffe8ea9c; color: #fff5f1; font: italic 30px Georgia, serif; }
.monogram i { color: #ffd1dc; font-size: 19px; }
.login-art h1 { font-size: clamp(42px, 5.4vw, 82px); line-height: 1.17; letter-spacing: .035em; margin: 25px 0 17px; }
.login-art .lead { max-width: 500px; line-height: 1.85; color: #fff2f6; margin: 0; }
.love-count { display: inline-block; margin-top: 26px; border-top: 1px solid #ffe7ed73; padding-top: 17px; color: #fff1f4; font-size: .86rem; }
.login-card-wrap { display: grid; justify-items: end; }
.login-card { width: min(100%, 420px); padding: clamp(24px, 3.6vw, 48px); border: 1px solid #fff9; border-radius: 26px; background: #fff6f9ef; box-shadow: 0 24px 90px #1b0e29a1; }
.login-card h2 { font-size: clamp(27px, 3vw, 37px); margin: 0 0 25px; }
.login-card > label, .editor-card label { display: block; font-size: 13px; font-weight: 650; margin: 20px 0 9px; }
input, textarea { width: 100%; border: 1px solid var(--line); background: rgba(255,255,255,.66); border-radius: 14px; padding: 14px 16px; color: var(--ink); outline: none; transition: .2s; }
input:focus, textarea:focus { border-color: rgba(185,103,109,.65); box-shadow: 0 0 0 4px rgba(185,103,109,.08); }
textarea { resize: vertical; line-height: 1.8; }
.identity-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; border: 0; padding: 0; min-inline-size: 0; }
.identity-switch legend { padding: 0; margin-bottom: 9px; font-size: 13px; font-weight: 650; }
.identity-switch label { margin: 0; }
.identity-switch input { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; opacity: 0; pointer-events: none; }
.identity-switch span { display: block; padding: 12px 6px; text-align: center; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: .2s; }
.identity-switch input:checked + span { background: var(--rose-soft); color: #762853; border-color: #ad688c; }
.identity-switch input:focus-visible + span { outline: 2px solid var(--rose); outline-offset: 3px; }
.primary-button, .secondary-button { width: 100%; border: 0; border-radius: 14px; padding: 15px 18px; margin-top: 22px; font-weight: 700; }
.primary-button { background: #633358; color: white; display: flex; justify-content: center; gap: 12px; }
.primary-button:hover { background: #813f67; }
.primary-button.compact { width: auto; padding-inline: 25px; }
.secondary-button { background: var(--cream); color: var(--ink); }
.privacy-note { color: var(--muted); font-size: 12px; text-align: center; margin-top: 22px; }

.calendar-section { max-width: 1180px; margin: 0 auto; padding: 20px 24px 120px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 24px; }
.section-heading h2 { font-size: 38px; margin: 8px 0 0; }
.calendar-actions { display: flex; gap: 8px; }
.calendar-actions button { border: 1px solid var(--line); background: transparent; min-width: 45px; height: 42px; border-radius: 12px; }
.calendar-actions button:hover { background: var(--cream); }
.calendar-card { --calendar-row-height: 118px; background: rgba(255,255,255,.66); border: 1px solid var(--line); border-radius: 26px; overflow: hidden; box-shadow: var(--shadow); }
.weekday-row, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-grid { min-height: calc(var(--calendar-row-height) * 6); }
.weekday-row { border-bottom: 1px solid var(--line); color: var(--muted); text-align: center; font-size: 12px; background: #f1e4f1; }
.weekday-row span { padding: 15px; }
.calendar-day { min-height: var(--calendar-row-height); padding: 15px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); position: relative; transition: .2s; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day:hover:not(.muted) { background: var(--cream); transform: translateY(-2px); }
.calendar-day > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; font: 15px Georgia; }
.calendar-day.today > span { background: var(--rose); color: white; }
.calendar-day.muted { color: #887788; background: #f8f1f8; }
.calendar-day small { display: block; margin: 9px 0 0; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11px; }
.memory-dots { position: absolute; left: 16px; bottom: 13px; display: flex; gap: 5px; }
.dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; }
.dot.photo { background: var(--blue); }
.dot.words { background: var(--rose); }
.calendar-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px 20px; color: var(--muted); font-size: 12px; margin-top: 15px; }
.calendar-legend span { display: flex; align-items: center; gap: 7px; }
.calendar-events, .day-events { display: flex; gap: 4px; }
.calendar-events { flex-direction: column; align-items: flex-start; }
.calendar-day.has-memory:has(.calendar-events) { padding-bottom: 24px; }
.calendar-event { display: inline-block; max-width: 100%; padding: 2px 5px; border-radius: 6px; color: #684c3e; background: #f1e6d9; font-size: .72rem; font-style: normal; }
.calendar-events .calendar-event { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar-event.holiday { background: #f0dcd9; color: #792e3b; }
.calendar-event.workday { background: #e2e8ed; color: #384f6a; }
.calendar-event.personal { color: #704367; background: #ecdeeb; }
.calendar-event[data-mark]::before { content: attr(data-mark); margin-inline-end: 3px; }
.day-events { flex-wrap: wrap; margin-block: 14px; }
.day-events .calendar-event { font-size: .85rem; padding: 5px 10px; }

.day-hero, .timeline-hero { max-width: 1180px; margin: 0 auto; padding: 65px 24px 40px; }
.back-link { color: var(--muted); font-size: 13px; }
.day-hero h1 { font-size: clamp(44px, 6vw, 72px); margin: 12px 0; }
.day-hero > p:last-child { color: var(--muted); }
.day-layout { max-width: 1180px; margin: 0 auto; padding: 20px 24px 120px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.editor-card { padding: 32px; border: 1px solid var(--line); border-radius: 24px; background: #fffbfeed; box-shadow: 0 15px 55px #49234f12; }
.editor-card.full-width { grid-column: 1 / -1; }
.card-title { display: flex; gap: 15px; align-items: flex-start; margin-bottom: 25px; }
.card-title > span { color: var(--rose); font: italic 15px Georgia; padding-top: 5px; }
.card-title h2 { margin: 0; font-size: 27px; }
.card-title p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.upload-box { margin-top: 20px; }
.file-drop { border: 1px dashed rgba(47,41,39,.25); border-radius: 18px; min-height: 140px; display: flex !important; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; background: rgba(242,232,223,.36); }
.file-drop input { display: none; }
.file-drop strong, .file-drop small { display: block; }
.file-drop small { color: var(--muted); margin-top: 5px; }
.upload-icon { font-size: 28px; color: var(--rose); }
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.photo-grid figure { margin: 0; position: relative; border-radius: 15px; overflow: hidden; background: var(--cream); }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.photo-grid figcaption { padding: 10px 12px; }
.photo-grid figcaption span, .photo-grid figcaption small { display: block; }
.photo-grid figcaption small { color: var(--muted); margin-top: 3px; font-size: 10px; }
.photo-delete { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(34,30,28,.72); color: white; }
.reflection-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.reflection-box { padding: 25px; border-radius: 19px; background: var(--cream); min-height: 280px; }
.reflection-box.mine.rose { background: var(--rose-soft); }
.reflection-box.mine.blue { background: var(--blue-soft); }
.reflection-owner { display: flex; align-items: center; gap: 10px; margin-bottom: 17px; }
.reflection-owner i { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: white; font-style: normal; color: var(--rose); }
.saved-reflection { white-space: pre-wrap; line-height: 1.9; }
.reflection-box small, .empty-copy { color: var(--muted); }

.timeline-hero h1 { font-size: clamp(50px, 7vw, 88px); line-height: 1.08; margin: 15px 0 24px; }
.timeline-hero > p:last-child { color: var(--muted); }
.timeline-list { max-width: 1080px; margin: 0 auto; padding: 30px 24px 120px; }
.timeline-item { display: grid; grid-template-columns: 80px 30px 1fr; gap: 15px; min-height: 230px; position: relative; }
.timeline-item::after { content: ""; position: absolute; left: 110px; top: 28px; bottom: -5px; width: 1px; background: var(--line); }
.timeline-date { text-align: right; padding-top: 15px; }
.timeline-date strong, .timeline-date span { display: block; }
.timeline-date strong { font: 33px Georgia; }
.timeline-date span { font-size: 11px; color: var(--muted); }
.timeline-dot { width: 12px; height: 12px; margin: 27px auto 0; background: var(--rose); border-radius: 50%; z-index: 2; box-shadow: 0 0 0 7px var(--paper); }
.timeline-card { display: grid; grid-template-columns: 220px 1fr; min-height: 190px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.68); overflow: hidden; margin-bottom: 30px; transition: .25s; }
.timeline-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.timeline-card img { width: 100%; height: 100%; object-fit: cover; }
.timeline-card > div { padding: 27px; }
.timeline-card h2 { margin: 7px 0 12px; font-size: 27px; }
.timeline-card p { color: var(--muted); line-height: 1.7; }
.timeline-card small { color: var(--rose); }
.empty-state { text-align: center; padding: 80px 20px; color: var(--muted); }
.empty-state span { font-size: 50px; color: var(--rose); }
.empty-state h2 { color: var(--ink); }
.flash-stack { position: fixed; right: 24px; top: 100px; z-index: 50; }
.flash { padding: 13px 18px; border-radius: 12px; box-shadow: var(--shadow); background: white; margin-bottom: 10px; font-size: 13px; }
.flash.success { border-left: 4px solid #698b77; }
.flash.error { border-left: 4px solid var(--rose); }

@media (max-width: 860px) {
  .login-shell { grid-template-columns: minmax(0, 1fr); justify-items: center; padding: 42px 22px 72px; gap: 28px; background-position: 35% center; }
  .login-art { width: min(100%, 420px); }
  .login-art h1 { font-size: clamp(34px, 6.5vw, 52px); margin-block: 16px 12px; }
  .monogram { width: 56px; height: 56px; font-size: 24px; }
  .monogram i { font-size: 15px; }
  .love-count { margin-top: 16px; padding-top: 11px; }
  .login-card-wrap { width: min(100%, 420px); }
  .site-header { height: auto; padding: 17px 20px; align-items: flex-start; }
  .user-pill, .site-header nav > a { display: none; }
  .site-header nav { gap: 12px; padding-top: 10px; }
  .calendar-card { --calendar-row-height: 82px; }
  .calendar-day { padding: 9px; }
  .calendar-day small { display: none; }
  .day-layout { grid-template-columns: 1fr; }
  .editor-card.full-width { grid-column: auto; }
  .reflection-grid { grid-template-columns: 1fr; }
  .timeline-card { grid-template-columns: 150px 1fr; }
}
@media (max-width: 600px) {
  .section-heading { align-items: flex-start; gap: 20px; }
  .section-heading h2 { font-size: 28px; }
  .calendar-actions button { min-width: 37px; height: 37px; }
  .calendar-card { --calendar-row-height: 60px; border-radius: 15px; }
  .calendar-day { padding: 6px; }
  .calendar-day > span { width: 25px; height: 25px; font-size: 12px; }
  .memory-dots { left: 8px; bottom: 7px; }
  .weekday-row span { padding: 10px 4px; }
  .day-hero h1 { font-size: 41px; }
  .editor-card { padding: 23px; }
  .timeline-item { grid-template-columns: 52px 18px 1fr; gap: 8px; }
  .timeline-item::after { left: 69px; }
  .timeline-date strong { font-size: 24px; }
  .timeline-card { display: block; }
  .timeline-card img { height: 180px; }
  .timeline-card > div { padding: 20px; }
}


.site-nav a[aria-current="page"] { color: var(--rose); font-weight: 700; }
#site-page[data-page="dashboard"] { position: relative; }
#site-page[data-page="dashboard"] > .site-header {
  position: absolute; inset: 0 0 auto; color: #fff7f6; background: #2b1d3b3b;
  border-color: #fff2; backdrop-filter: none;
}
#site-page[data-page="dashboard"] :is(.site-header .text-button, .site-header a:hover) { color: #fff0f3; }
#site-page[data-page="dashboard"] .brand-mark { background: #fff2f32b; border-color: #ffe5ed80; color: white; }
@media (min-width: 861px) {
  #site-page[data-page="dashboard"] > .site-header { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  #site-page[data-page="dashboard"] .account-nav { justify-self: end; }
  #site-page[data-page="dashboard"] .site-nav a[aria-current="page"] { color: #fff2f6; text-decoration: underline; text-underline-offset: 7px; }
}
.home-hero {
  padding: clamp(110px, 11vw, 153px) 24px 70px;
  background: linear-gradient(180deg, #23173766, #3a224435 43%, transparent 66%, #fff2 88%, var(--paper)),
    url("romance/evening-clouds.webp") center / cover, #6a4f7d;
  text-align: center; color: #fffaf7;
}
.home-hero h1 { margin: 0; font-size: clamp(43px, 6vw, 85px); line-height: 1.18; letter-spacing: .09em; text-shadow: 0 3px 24px #281b4c80; }
.home-date { margin: 13px 0 30px; color: #fff3f8; font-size: .94rem; letter-spacing: .06em; text-shadow: 0 1px 8px #2b1a47; }
.day-date { color: var(--rose); font-size: .9rem; }
.sky-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 225px)); gap: clamp(16px, 2.9vw, 40px); align-items: center; justify-content: center; margin: 0 auto; }
.sky-cards.with-cover { grid-template-columns: minmax(150px, 225px) minmax(230px, 340px) minmax(150px, 225px); }
.sky-card {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: end;
  min-height: clamp(128px, 17vw, 206px); position: relative; text-align: left; color: #402941;
  border: 1px solid #fffc; border-radius: 28px; padding: clamp(15px, 2.2vw, 27px);
  box-shadow: 0 17px 34px #46304d4f; transition: transform .23s ease, box-shadow .23s ease;
  transform: rotate(var(--tilt)) translateY(18px);
}
.sky-journal { --tilt: -8deg; background: #f6d8dc; }
.sky-goals { --tilt: 8deg; background: #e5dff8; }
.sky-card strong { font: 600 clamp(20px, 2.25vw, 33px) / 1.25 var(--title-font); }
.sky-description { margin-top: 5px; color: #5e445f; font-size: .85rem; }
.sky-arrow {
  position: absolute; inset: 13px 14px auto auto; width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 50%; background: #57375719; font-size: 1rem;
}
.sky-card:hover, .sky-card:focus-visible { transform: translateY(4px); box-shadow: 0 20px 38px #46304d69; }
.couple-cover {
  margin: 0; padding: 9px 9px 0; color: #63415a; border: 1px solid #fff;
  border-radius: 21px; background: #fff8f7; box-shadow: 0 19px 55px #36264772;
}
.couple-cover img { width: 100%; height: auto; aspect-ratio: 4 / 3; display: block; border-radius: 13px; background: var(--cream); }
.couple-cover figcaption { display: block; padding: 8px 4px 10px; font: 600 .95rem var(--title-font); letter-spacing: .12em; }
.hero-quicklinks { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 23px; }
.hero-quicklinks a { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 5px 15px; border: 1px solid #ffeef477; border-radius: 30px; background: #4b2e53df; font-size: .88rem; }
.hero-quicklinks a:hover { background: #6c3c64; }
.hero-quicklinks a:focus-visible, #site-page[data-page="dashboard"] .brand:focus-visible { outline-color: #fff5f6; }
#site-page:is([data-page="day_detail"], [data-page="timeline"], [data-page="goals"]) main { isolation: isolate; }
#site-page:is([data-page="day_detail"], [data-page="timeline"], [data-page="goals"]) main::before {
  content: ""; position: absolute; z-index: -1; inset: 0 0 auto; height: clamp(270px, 42vw, 545px);
  background: linear-gradient(180deg, #f8eaf4cc, #faf1f7d9 54%, var(--paper)), url("romance/evening-clouds.webp") center 65% / cover;
}
.day-edit { display: inline-flex; width: auto; margin: 0; }
.goals-hero { max-width: 850px; }
.goals-list { width: min(802px, calc(100% - 48px)); margin: 0 auto 120px; }
.goal-items { padding: 0; margin: 26px 0 0; list-style: none; }
.goal-items li { border-top: 1px solid var(--line); padding-block: 18px; }
.goal-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.goal-field { flex: 1 1 210px; }
.goal-field label { margin: 0 0 7px; }
.goal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.goal-form button { width: auto; margin: 0; }
.goal-complete label { color: #537058; }
.entry-lock { color: var(--muted); }
.supplement-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.supplement-byline { font-size: .85rem; color: var(--muted); margin: 0; }
#supplements { scroll-margin-top: 108px; }
.remembered { max-width: 1180px; margin: 0 auto; padding: 0 24px 36px; }
.remembered h2 { font-size: clamp(25px, 4vw, 34px); margin: 0 0 14px; }
.remembered-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr)); gap: 14px; }
.remembered-card {
  display: flex; align-items: center; gap: 16px; min-height: 96px;
  border: 1px solid var(--line); border-radius: 16px; background: #fff8fd; padding: 14px;
  overflow-wrap: anywhere;
}
.remembered-card img { inline-size: 68px; block-size: 68px; object-fit: cover; border-radius: 10px; }
.remembered-card time, .remembered-card strong { display: block; }
.remembered-card time { color: var(--muted); font-size: .8rem; margin-bottom: 4px; }
.remembered-card p { margin: 5px 0 0; }
#calendar, #photos, #reflection { scroll-margin-top: 98px; }
.calendar-day { min-width: 0; overflow: hidden; }
.calendar-thumb { display: block; object-fit: cover; width: 100%; height: 42px; border-radius: 5px; margin: 4px 0 12px; }
.calendar-day:has(.calendar-thumb) { padding-bottom: 18px; }

.day-hero > .day-date { margin: 30px 0 0; }
.day-hero h1 { overflow-wrap: anywhere; }
.day-layout { grid-template-columns: minmax(0, 1fr); max-width: 990px; padding-top: 0; }
.reading-layout .saved-reflection, .reflection-box { overflow-wrap: anywhere; }
.memory-cover { display: block; overflow: hidden; border-radius: 20px; background: var(--cream); }
.memory-cover img {
  display: block; width: 100%; max-height: 560px; aspect-ratio: 16 / 9; object-fit: cover;
}
.reflection-box { min-height: 0; }
.reflection-box.rose { background: var(--rose-soft); }
.reflection-box.blue { background: var(--blue-soft); }
.photo-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.photo-grid figure { overflow-wrap: anywhere; }
.file-drop { min-height: 92px; margin-bottom: 8px !important; }
#photo-files { display: block; padding: 8px; }
.upload-queue { list-style: none; padding: 0; margin: 10px 0; }
.upload-queue:empty, .upload-status:empty { display: none; }
.upload-queue li {
  display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line);
  min-height: 48px; padding: 7px 0; overflow-wrap: anywhere;
}
.upload-queue img { width: 36px; height: 36px; object-fit: cover; border-radius: 7px; }
.upload-queue small { margin-left: auto; text-align: right; color: var(--muted); }
.upload-box button:disabled { opacity: .68; cursor: wait; }
.photo-viewer {
  width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0;
  border: 0; padding: 0 14px 14px; background: #221c20; color: white;
}
.photo-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.photo-viewer img { display: block; margin: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-bar { display: flex; align-items: center; gap: 12px; justify-content: center; padding-block: 12px; }
.viewer-bar button { border: 1px solid #a9989d; color: white; background: transparent; border-radius: 10px; min-width: 44px; height: 44px; font-size: 25px; }
.timeline-card:not(:has(img)) { grid-template-columns: 1fr; }

.background-music { position: fixed; z-index: 30; right: 18px; bottom: 18px; }
.music-panel { position: relative; color: var(--ink); }
.music-panel summary {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  background: #fff2f7; border: 1px solid var(--line); border-radius: 24px;
  padding: 8px 15px; box-shadow: 0 8px 30px #49234f28; cursor: pointer;
  list-style: none; font-size: .84rem; color: #663456;
}
.music-note { font-size: 1.05rem; }
.music-panel summary::-webkit-details-marker { display: none; }
.music-controls {
  width: min(270px, calc(100vw - 36px)); position: absolute; right: 0; bottom: calc(100% + 10px);
  display: grid; gap: 8px; padding: 16px; background: #fff7fb;
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); font-size: .88rem;
}
.music-controls select, .music-actions button {
  font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: white;
}
.music-controls select { width: 100%; min-width: 0; }
.music-credits { justify-self: start; text-decoration: underline; font-size: .78rem; }
.music-actions { display: flex; gap: 8px; }
.music-actions button { flex: 1; }
.music-controls input[type="range"] { margin: 0; padding: 0; accent-color: var(--rose); }
#music-status { margin: 0; }
#music-status:empty { display: none; }

@media (max-width: 860px) {
  .site-header .site-nav {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 25;
    display: flex; padding: 0 10px env(safe-area-inset-bottom);
    border-top: 1px solid var(--line); background: var(--paper);
  }
  .site-header { position: relative; backdrop-filter: none; z-index: auto; }
  #site-page[data-page="dashboard"] .site-header { z-index: 24; }
  #site-page[data-page="dashboard"] .site-nav { color: var(--ink); }
  #site-page[data-page="dashboard"] .site-nav a:hover { color: var(--rose); }
  .site-header .site-nav > a { display: grid; place-items: center; flex: 1; min-height: 52px; }
  .site-header .site-nav > a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }
  body:has(.site-nav) .background-music { bottom: calc(64px + env(safe-area-inset-bottom)); }
  #calendar, #photos, #reflection, #supplements { scroll-margin-top: 12px; }
}
@media (max-width: 680px) {
  .brand { gap: 9px; }
  .brand strong { font-size: .95rem; }
  .brand-mark { width: 35px; height: 35px; }
  .home-hero { padding: 99px 22px 60px; background-position: 53% center; }
  .home-date { margin-bottom: 20px; font-size: .83rem; }
  .sky-cards, .sky-cards.with-cover { width: min(100%, 360px); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
  .sky-card { min-height: 109px; border-radius: 19px; transform: rotate(var(--tilt)); }
  .sky-card:hover, .sky-card:focus-visible { transform: translateY(-3px); }
  .sky-journal { --tilt: -3deg; }
  .sky-goals { --tilt: 3deg; }
  .sky-arrow { width: 25px; height: 25px; inset: 8px 9px auto auto; }
  .sky-card strong { font-size: 1.24rem; }
  .sky-description { font-size: .72rem; }
  .couple-cover { grid-row: 1; grid-column: 1 / -1; width: min(85%, 283px); justify-self: center; padding: 7px 7px 0; }
  .couple-cover figcaption { padding: 6px 4px 8px; }
}
@media (max-width: 600px) {
  .calendar-day { padding-inline: 3px; }
  .calendar-events { gap: 2px; }
  .calendar-events .calendar-event { padding-inline: 2px; font-size: .61rem; line-height: 1.2; white-space: normal; overflow-wrap: anywhere; }
  .calendar-event[data-mark]::before { margin-inline-end: 1px; }
  .calendar-thumb { height: 23px; margin: 2px 0 8px; }
  .calendar-day:has(.calendar-thumb) { min-height: 72px; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .music-panel summary { min-width: 44px; padding: 0; }
  .music-panel summary .music-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
@media (prefers-reduced-motion: reduce) {
  .sky-card, .calendar-day, .timeline-card { transition: none; }
}
