:root {
  color-scheme: light;
  --canvas: #edf0e5;
  --canvas-warm: #f4f1e7;
  --paper: #fbfaf4;
  --paper-deep: #f2efe3;
  --sage-1: #dbe3d3;
  --sage-2: #b5c5ad;
  --sage-3: #748b70;
  --sage-4: #435b46;
  --ink: #253128;
  --muted: #657266;
  --faint: #59665b;
  --line: rgba(58, 76, 60, .15);
  --line-strong: rgba(52, 70, 55, .28);
  --warm: #85583f;
  --danger: #9f5c58;
  --focus: #355e43;
  --placeholder: #59665b;
  --shadow: 0 18px 48px rgba(54, 67, 52, .13);
  --shadow-soft: 0 10px 28px rgba(54, 67, 52, .09);
  --radius: 14px;
  --nav-h: 76px;
  --display: "Noto Serif SC", "Songti SC", serif;
  --sans: "Noto Sans SC", system-ui, sans-serif;
}

html[data-theme="night"] {
  color-scheme: dark;
  --canvas: #1c251f;
  --canvas-warm: #242a22;
  --paper: #29322b;
  --paper-deep: #222b25;
  --sage-1: #36463a;
  --sage-2: #506553;
  --sage-3: #91aa91;
  --sage-4: #c3d2be;
  --ink: #eef1e8;
  --muted: #b9c3b7;
  --faint: #b6c1b3;
  --line: rgba(221, 231, 215, .13);
  --line-strong: rgba(221, 231, 215, .25);
  --warm: #efb38a;
  --danger: #e09791;
  --focus: #d9e8d3;
  --placeholder: #c1ccbe;
  --shadow: 0 22px 52px rgba(0, 0, 0, .28);
  --shadow-soft: 0 12px 32px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(118deg, transparent 0 64%, rgba(255,255,255,.18) 64% 64.1%, transparent 64.1%),
    var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  transition: background-color .28s ease, color .28s ease;
}

button, input, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
::selection { color: var(--paper); background: var(--sage-4); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--sage-2); border: 3px solid var(--canvas); border-radius: 10px; }

svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.ambient { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.ambient span { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .38; }
.ambient span:first-child { width: 34vw; height: 34vw; top: -15vw; right: -9vw; background: rgba(255,255,255,.62); }
.ambient span:last-child { width: 24vw; height: 24vw; bottom: 2vw; left: -14vw; background: rgba(183,200,173,.42); }

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 12px;
  background: linear-gradient(var(--canvas) 72%, transparent);
}
.home-mark { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0; border: 0; background: transparent; text-align: left; }
.home-mark > svg { width: 33px; height: 33px; padding: 6px; border-radius: 11px; background: var(--sage-4); color: var(--paper); stroke-width: 1.5; box-shadow: var(--shadow-soft); }
.home-mark span { display: grid; }
.home-mark b { font-family: var(--display); font-size: 18px; line-height: 1.3; letter-spacing: -.02em; }
.home-mark small { color: var(--muted); font-size: 11px; }
.top-actions { display: flex; gap: 8px; }
.round-action, .mini-action {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}
.round-action svg, .mini-action svg { width: 19px; height: 19px; }
.moon-icon { display: none; }
html[data-theme="night"] .sun-icon { display: none; }
html[data-theme="night"] .moon-icon { display: block; }

.app-shell { position: relative; z-index: 1; width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 22px 0 calc(var(--nav-h) + 42px); }
.screen { display: none; animation: settle .46s cubic-bezier(.22, 1, .36, 1); }
.screen.is-active { display: block; }
@keyframes settle { from { opacity: .5; transform: translateY(10px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .screen { animation: none; } * { transition-duration: .01ms !important; } }

.welcome-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin: 16px 0 30px; }
.date-line { margin: 0 0 8px; color: var(--sage-4); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { max-width: 11ch; margin: 0; font: 700 clamp(42px, 7vw, 78px)/1.06 var(--display); letter-spacing: -.035em; text-wrap: balance; }
.welcome-copy { max-width: 58ch; margin: 12px 0 0; color: var(--muted); }
.note-action { display: inline-flex; align-items: center; gap: 9px; flex: 0 0 auto; padding: 12px 17px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); box-shadow: var(--shadow-soft); font-weight: 600; }
.note-action svg { width: 18px; height: 18px; }

.home-plan {
  display: grid;
  grid-template-columns: 1.55fr .78fr .92fr;
  grid-template-rows: minmax(200px, auto) minmax(180px, auto) minmax(160px, auto);
  grid-template-areas:
    "reading reading window"
    "wishes calendar calendar"
    "memory memory notes";
  border: 1px solid var(--line-strong);
  background: var(--paper-deep);
  box-shadow: var(--shadow);
}
.room { position: relative; min-width: 0; padding: clamp(20px, 3vw, 34px); background: color-mix(in srgb, var(--paper) 88%, transparent); }
.room::after { content: ""; position: absolute; pointer-events: none; }
.reading-room { grid-area: reading; border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.window-room { grid-area: window; border-bottom: 1px solid var(--line-strong); }
.wishes-room { grid-area: wishes; border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.calendar-room { grid-area: calendar; border-bottom: 1px solid var(--line-strong); }
.memory-room { grid-area: memory; border-right: 1px solid var(--line-strong); }
.notes-room { grid-area: notes; }
.room-label { margin-bottom: 18px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .05em; }
.room-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.mini-action { width: 44px; height: 44px; box-shadow: none; border: 1px solid var(--line); background: transparent; }
.mini-action svg { width: 16px; height: 16px; }
.text-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 10px; padding: 8px 0 3px; border: 0; border-bottom: 1px solid var(--line-strong); background: transparent; color: var(--sage-4); font-size: 13px; font-weight: 600; }
.secondary-link { margin-left: 18px; color: var(--muted); }
.text-link span { transition: transform .2s ease; }
.text-link:hover span { transform: translateX(3px); }
.empty-copy { color: var(--muted); }

.latest-diary h2 { max-width: 18ch; margin: 0 0 10px; font: 600 clamp(28px, 4vw, 46px)/1.25 var(--display); letter-spacing: -.025em; }
.latest-diary p { display: -webkit-box; max-width: 65ch; margin: 0; overflow: hidden; color: var(--muted); -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.latest-diary time { display: inline-block; margin-bottom: 12px; color: var(--warm); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.window-room { display: flex; flex-wrap: wrap; align-content: center; justify-content: center; text-align: center; overflow: hidden; }
.window-light { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3,1fr); opacity: .75; }
.window-light i { border-right: 1px solid var(--line); background: linear-gradient(155deg, color-mix(in srgb, var(--sage-1) 62%, transparent), transparent 68%); }
.window-light i:last-child { border-right: 0; }
.window-room p, .window-room small { position: relative; z-index: 1; width: 100%; margin: 0; color: var(--muted); }
.window-room strong { position: relative; z-index: 1; margin: 6px 4px 2px; font: 700 clamp(52px, 7vw, 84px)/1 var(--display); color: var(--sage-4); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.window-room > span { position: relative; z-index: 1; align-self: flex-end; margin-bottom: 9px; color: var(--muted); }
.window-room small { font-size: 11px; }
.countdown strong { display: block; margin: 2px 0 4px; font: 600 clamp(27px, 4vw, 40px)/1.3 var(--display); letter-spacing: -.02em; }
.countdown span { color: var(--warm); font-weight: 600; font-variant-numeric: tabular-nums; }
.home-wish-row { display: grid; grid-template-columns: 21px 1fr; gap: 10px; align-items: start; margin: 9px 0; }
.home-wish-row i { width: 14px; height: 14px; margin-top: 5px; border: 1px solid var(--sage-3); border-radius: 50%; }
.home-wish-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.memory-wall { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; min-height: 82px; }
.memory-thumb { position: relative; min-height: 96px; overflow: hidden; background: var(--sage-1); }
.memory-thumb img { width: 100%; height: 100%; min-height: 96px; object-fit: cover; display: block; }
.memory-thumb span { position: absolute; inset: auto 0 0; padding: 16px 9px 7px; color: white; background: linear-gradient(transparent, rgba(18,29,21,.72)); font-size: 11px; line-height: 1.35; }
.memory-thumb.text-only { display: flex; align-items: flex-end; padding: 12px; color: var(--sage-4); background: linear-gradient(145deg, var(--sage-1), var(--paper-deep)); font-family: var(--display); }
.memory-delete, .note-delete { position: absolute; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--paper) 88%, transparent); color: var(--danger); opacity: 0; transition: opacity .18s ease; }
.memory-delete { top: 7px; right: 7px; }
.note-delete { top: 7px; right: 7px; }
.memory-delete svg, .note-delete svg { width: 14px; height: 14px; }
.memory-thumb:hover .memory-delete, .note-card:hover .note-delete, .memory-delete:focus-visible, .note-delete:focus-visible { opacity: 1; }
.note-card { position: relative; margin: 0 0 10px; padding: 13px 14px 14px; background: color-mix(in srgb, var(--canvas-warm) 82%, var(--paper)); box-shadow: 0 6px 15px rgba(71,75,58,.08); transform: rotate(-.7deg); }
.note-card:nth-child(even) { transform: rotate(.6deg); }
.note-card p { display: -webkit-box; margin: 0; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.note-card time { color: var(--faint); font-size: 10px; font-variant-numeric: tabular-nums; }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin: 22px 0 34px; }
.section-heading h2 { margin: 0; font: 700 clamp(36px, 6vw, 62px)/1.1 var(--display); letter-spacing: -.035em; }
.section-heading p { max-width: 52ch; margin: 10px 0 0; color: var(--muted); }
.section-count { flex: 0 0 auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.primary-action { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 45px; padding: 12px 18px; border: 0; border-radius: 11px; background: var(--sage-4); color: var(--paper); box-shadow: 0 9px 22px rgba(57,77,60,.19); font-weight: 700; }
.primary-action:hover { background: color-mix(in srgb, var(--sage-4) 88%, var(--ink)); }
.primary-action svg { width: 18px; height: 18px; }
.primary-action.compact { flex: 0 0 auto; }
.primary-action.full, .quiet-action.full { width: 100%; }
.quiet-action { min-height: 43px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 11px; background: transparent; color: var(--muted); }

.diary-stage { position: relative; width: min(880px, 100%); min-height: 560px; margin: 0 auto; padding-left: 31px; filter: drop-shadow(0 25px 38px rgba(49,65,52,.15)); }
.diary-stage::before { content: ""; position: absolute; inset: -8px -8px -8px 23px; border-radius: 8px 20px 20px 8px; background: var(--sage-3); }
.book-spine { position: absolute; z-index: 3; top: -9px; bottom: -9px; left: 5px; width: 42px; border-radius: 15px 5px 5px 15px; background: linear-gradient(90deg, #506c55, #8aa084 55%, #5d765f); box-shadow: inset -8px 0 10px rgba(30,48,34,.22); }
.diary-book { position: relative; z-index: 2; min-height: 560px; overflow: hidden; border-radius: 3px 15px 15px 3px; background: var(--paper); }
.diary-page { position: absolute; inset: 0; padding: clamp(28px, 5vw, 58px); background: var(--paper); }
.diary-page[hidden] { display: none; }
.diary-cover { display: flex; flex-direction: column; justify-content: center; background: linear-gradient(135deg, var(--sage-1), var(--paper)); }
.diary-cover h3 { max-width: 8ch; margin: 0; font: 700 clamp(50px, 8vw, 88px)/1.08 var(--display); letter-spacing: -.035em; color: var(--sage-4); }
.diary-cover p { max-width: 34ch; margin: 20px 0 0; color: var(--muted); }
.diary-cover .cover-line { width: 88px; height: 1px; margin-top: 28px; background: var(--sage-3); }
.entry-date { color: var(--warm); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.diary-entry-title { margin: 10px 0 20px; font: 600 clamp(30px, 5vw, 48px)/1.25 var(--display); letter-spacing: -.025em; }
.diary-entry-body { max-width: 72ch; max-height: 390px; overflow: auto; padding-right: 14px; white-space: pre-wrap; line-height: 1.95; }
.diary-entry-foot { position: absolute; right: clamp(28px, 5vw, 58px); bottom: 24px; color: var(--faint); font-size: 11px; }
.page-controls { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 26px 0 0; }
.page-controls > span { min-width: 110px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.page-button { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 9px 13px; border: 0; background: transparent; color: var(--sage-4); font-weight: 600; }
.page-button svg { width: 17px; height: 17px; }

.filter-tabs { display: flex; gap: 4px; width: fit-content; margin: -12px 0 28px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; }
.filter-tabs button { min-height: 44px; padding: 8px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 13px; }
.filter-tabs button.is-active { background: var(--sage-4); color: var(--paper); }
.wish-list { border-top: 1px solid var(--line-strong); }
.wish-item { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: start; padding: 22px 4px; border-bottom: 1px solid var(--line); }
.wish-check { display: grid; place-items: center; width: 44px; height: 44px; margin-top: 0; padding: 0; border: 1px solid var(--sage-3); border-radius: 50%; background: transparent; }
.wish-check svg { width: 14px; height: 14px; opacity: 0; }
.wish-item.is-done .wish-check { background: var(--sage-3); color: var(--paper); }
.wish-item.is-done .wish-check svg { opacity: 1; }
.wish-item.is-done h3 { color: var(--faint); text-decoration: line-through; text-decoration-thickness: 1px; }
.wish-item h3 { margin: 0; font: 600 20px/1.4 var(--display); }
.wish-item p { max-width: 65ch; margin: 5px 0 0; color: var(--muted); }
.icon-action { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--faint); }
.icon-action:hover { background: var(--paper); color: var(--danger); }
.icon-action svg { width: 17px; height: 17px; }

.timeline { position: relative; max-width: 820px; margin-left: clamp(0px, 8vw, 110px); padding-left: 42px; }
.timeline::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 10px; width: 1px; background: var(--line-strong); }
.anniversary-item { position: relative; display: grid; grid-template-columns: 130px 1fr auto; gap: 24px; align-items: start; padding: 0 0 34px; }
.anniversary-item::before { content: ""; position: absolute; top: 7px; left: -36px; width: 9px; height: 9px; border: 2px solid var(--canvas); border-radius: 50%; background: var(--sage-3); box-shadow: 0 0 0 1px var(--sage-3); }
.anniversary-date { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.anniversary-item h3 { margin: 0 0 4px; font: 600 23px/1.35 var(--display); }
.anniversary-item p { margin: 0; color: var(--muted); }
.anniversary-days { text-align: right; }
.anniversary-days strong { display: block; font: 600 28px/1 var(--display); font-variant-numeric: tabular-nums; }
.anniversary-days span { color: var(--muted); font-size: 11px; }

.us-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(250px, .65fr); gap: 24px; align-items: stretch; }
.profile-paper { min-height: 440px; padding: clamp(30px, 5vw, 62px); background: var(--paper); box-shadow: var(--shadow); }
.profile-names { display: flex; align-items: center; justify-content: center; gap: 20px; font: 600 clamp(32px, 5vw, 54px)/1.2 var(--display); letter-spacing: -.025em; }
.profile-names i { width: 42px; height: 1px; background: var(--sage-3); transform: rotate(-12deg); }
.profile-paper blockquote { max-width: 20ch; margin: 44px auto; color: var(--sage-4); font: 500 clamp(22px, 3vw, 30px)/1.75 var(--display); text-align: center; }
.profile-paper dl { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; margin: 0 0 34px; background: var(--line); }
.profile-paper dl div { padding: 18px; background: var(--paper); text-align: center; }
.profile-paper dt { color: var(--muted); font-size: 11px; }
.profile-paper dd { margin: 4px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.profile-paper .primary-action { display: flex; margin: 0 auto; }
.privacy-note { display: flex; flex-direction: column; justify-content: flex-end; padding: clamp(24px, 4vw, 42px); background: var(--sage-4); color: var(--paper); }
.privacy-note > svg { width: 34px; height: 34px; margin-bottom: auto; }
.privacy-note h3 { margin: 80px 0 8px; font: 600 27px/1.3 var(--display); }
.privacy-note p { margin: 0 0 24px; color: color-mix(in srgb, var(--paper) 78%, transparent); }
.privacy-note .quiet-action { border-color: rgba(255,255,255,.28); color: var(--paper); }

.bottom-nav {
  position: fixed;
  z-index: 40;
  right: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 2px;
  width: min(570px, calc(100% - 24px));
  min-height: var(--nav-h);
  padding: 7px;
  transform: translateX(50%);
  border: 1px solid color-mix(in srgb, var(--line-strong) 70%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--paper) 93%, transparent);
  box-shadow: 0 18px 50px rgba(38,50,40,.2);
  backdrop-filter: blur(16px);
}
.bottom-nav button { display: grid; flex: 1; place-items: center; gap: 2px; min-height: 58px; padding: 6px 4px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 10px; }
.bottom-nav svg { width: 22px; height: 22px; }
.bottom-nav button.is-active { background: var(--sage-4); color: var(--paper); }

.gate { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 22px; background: color-mix(in srgb, var(--canvas) 88%, transparent); backdrop-filter: blur(18px); }
.gate-card { width: min(440px, 100%); padding: clamp(28px, 5vw, 46px); background: var(--paper); box-shadow: 0 28px 80px rgba(35,49,38,.24); }
.gate-card h2 { margin: 24px 0 10px; font: 700 38px/1.2 var(--display); letter-spacing: -.025em; }
.gate-card > p { margin: 0 0 25px; color: var(--muted); }
.gate-illustration { position: relative; width: 92px; height: 70px; margin: 0 auto; }
.gate-illustration .roof { position: absolute; top: 6px; left: 7px; width: 78px; height: 46px; transform: skewY(-9deg); border: 1px solid var(--sage-3); background: var(--sage-1); }
.gate-illustration .door { position: absolute; bottom: 0; left: 36px; width: 25px; height: 35px; border: 1px solid var(--sage-3); background: var(--paper); }
.gate-illustration .light { position: absolute; right: 15px; bottom: 18px; width: 12px; height: 14px; background: #deb983; box-shadow: 0 0 18px rgba(222,185,131,.7); }
.key-mark { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--sage-1); color: var(--sage-4); }
.key-mark svg { width: 28px; height: 28px; }
.field-label { display: block; margin: 14px 0 7px; color: var(--muted); font-size: 12px; font-weight: 600; }
.field, textarea.field { width: 100%; min-height: 48px; padding: 12px 13px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--paper); color: var(--ink); outline: none; }
textarea.field { min-height: 112px; resize: vertical; }
.field::placeholder { color: var(--placeholder); opacity: 1; }
.gate .primary-action { margin-top: 14px; }
.form-message { min-height: 24px; margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.form-message.error { color: var(--danger); }
.form-message.ok { color: var(--sage-4); }

.sheet-backdrop { position: fixed; z-index: 60; inset: 0; background: rgba(25,35,28,.36); backdrop-filter: blur(4px); }
.sheet { position: fixed; z-index: 70; right: 0; bottom: 0; left: 0; width: min(620px, 100%); max-height: 88vh; margin: 0 auto; overflow: auto; padding: 10px clamp(22px, 5vw, 40px) max(28px, env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; background: var(--paper); box-shadow: 0 -22px 65px rgba(30,43,33,.22); animation: sheetUp .32s cubic-bezier(.22, 1, .36, 1); }
@keyframes sheetUp { from { transform: translateY(34px); opacity: .7; } to { transform: none; opacity: 1; } }
.sheet-handle { width: 42px; height: 4px; margin: 0 auto 20px; border-radius: 999px; background: var(--line-strong); }
.sheet header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.sheet h2 { margin: 0; font: 700 30px/1.25 var(--display); letter-spacing: -.025em; }
.sheet header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-control { min-width: 0; }
.form-control.full { grid-column: 1 / -1; }
.checkbox-row { display: flex; align-items: center; gap: 9px; min-height: 48px; margin-top: 25px; color: var(--muted); }
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--sage-4); }
.file-field { position: relative; display: grid; place-items: center; min-height: 100px; padding: 16px; border: 1px dashed var(--line-strong); color: var(--muted); text-align: center; }
.file-field input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-field svg { width: 24px; height: 24px; margin-bottom: 5px; }
.settings-lines { border-top: 1px solid var(--line); margin-bottom: 22px; }
.settings-lines > div { display: flex; justify-content: space-between; gap: 24px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.settings-lines span { color: var(--muted); }
.settings-lines strong { max-width: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.archive-list { display: grid; gap: 18px; }
.archive-entry { position: relative; min-height: 112px; padding: 18px 62px 18px 18px; background: var(--paper-deep); }
.archive-entry.with-image { display: grid; grid-template-columns: 120px 1fr; gap: 18px; padding-left: 0; }
.archive-entry img { width: 120px; height: 112px; object-fit: cover; }
.archive-entry h3 { margin: 0 0 5px; font: 600 19px/1.4 var(--display); }
.archive-entry p { margin: 0; color: var(--muted); }
.archive-entry time { display: inline-block; margin-top: 9px; color: var(--faint); font-size: 11px; }
.archive-entry .icon-action { position: absolute; top: 8px; right: 8px; }
.toast { position: fixed; z-index: 120; right: 50%; bottom: calc(var(--nav-h) + 30px); max-width: calc(100% - 32px); padding: 11px 16px; transform: translateX(50%); border-radius: 999px; background: var(--ink); color: var(--paper); box-shadow: var(--shadow); font-size: 13px; }
.list-empty { padding: 48px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); text-align: center; }

@media (min-width: 900px) {
  .bottom-nav { right: 28px; bottom: 26px; width: auto; min-height: 0; transform: none; flex-direction: column; }
  .bottom-nav button { width: 62px; min-height: 58px; }
  .app-shell { padding-bottom: 60px; }
  .toast { right: 116px; bottom: 32px; transform: none; }
}

@media (max-width: 760px) {
  :root { --nav-h: 70px; }
  body { font-size: 14px; }
  .topbar, .app-shell { width: min(100% - 24px, 1180px); }
  .topbar { padding-top: max(12px, env(safe-area-inset-top)); }
  .app-shell { padding-top: 8px; }
  .welcome-row { display: block; margin: 10px 0 22px; }
  h1 { font-size: clamp(42px, 13vw, 60px); }
  .note-action { margin-top: 20px; }
  .home-plan { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto; grid-template-areas: "reading reading" "window calendar" "wishes wishes" "memory memory" "notes notes"; border-radius: 0; }
  .room { padding: 24px 20px; border-right: 0; border-bottom: 1px solid var(--line-strong); }
  .notes-room { border-bottom: 0; }
  .reading-room { min-height: 232px; }
  .window-room { min-height: 210px; padding: 17px 12px; border-right: 1px solid var(--line-strong); }
  .calendar-room { min-height: 210px; padding: 20px 14px; }
  .calendar-room .room-label { margin-bottom: 10px; }
  .calendar-room .countdown strong { font-size: 23px; }
  .calendar-room .countdown p { margin: 4px 0 0; font-size: 11px; }
  .calendar-room .text-link { margin-top: 3px; font-size: 11px; }
  .window-room strong { font-size: 48px; }
  .window-room p { font-size: 11px; }
  .secondary-link { margin-left: 12px; }
  .memory-wall { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .memory-thumb { min-height: 80px; }
  .memory-thumb img { min-height: 80px; }
  .memory-delete, .note-delete { opacity: 1; }
  .section-heading { display: block; margin: 14px 0 26px; }
  .section-heading h2 { font-size: 42px; }
  .section-heading .primary-action { margin-top: 18px; }
  .section-count { display: inline-block; margin-top: 10px; }
  .diary-stage { min-height: 510px; padding-left: 20px; }
  .diary-stage::before { left: 14px; }
  .book-spine { left: 0; width: 27px; }
  .diary-book { min-height: 510px; }
  .diary-page { padding: 30px 24px 54px 31px; }
  .diary-entry-body { max-height: 340px; padding-right: 6px; }
  .diary-entry-foot { right: 24px; }
  .page-controls { gap: 7px; }
  .page-controls > span { min-width: 84px; font-size: 12px; }
  .page-button { padding: 8px 5px; font-size: 12px; }
  .filter-tabs { width: 100%; }
  .filter-tabs button { flex: 1; }
  .wish-item { grid-template-columns: auto minmax(0,1fr) auto; gap: 12px; }
  .timeline { margin-left: 0; padding-left: 30px; }
  .timeline::before { left: 5px; }
  .anniversary-item { grid-template-columns: 1fr auto; gap: 10px 15px; }
  .anniversary-item::before { left: -29px; }
  .anniversary-date { grid-column: 1 / -1; }
  .us-layout { grid-template-columns: 1fr; }
  .profile-paper { min-height: 0; padding: 36px 22px; }
  .profile-paper dl { grid-template-columns: 1fr; }
  .profile-paper dl div { display: flex; justify-content: space-between; gap: 15px; text-align: left; }
  .privacy-note h3 { margin-top: 56px; }
  .bottom-nav { border-radius: 16px; }
  .bottom-nav button { min-height: 54px; }
  .bottom-nav svg { width: 20px; height: 20px; }
  .gate-card { padding: 28px 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-control.full { grid-column: auto; }
}

@media (max-width: 380px) {
  .home-mark b { font-size: 16px; }
  .home-mark > svg { width: 30px; height: 30px; }
  .round-action { width: 44px; height: 44px; }
  .bottom-nav { width: calc(100% - 12px); padding: 5px; }
  .bottom-nav button { padding-inline: 1px; }
  .page-controls > span { min-width: 66px; }
}
