﻿:root {
  --bg: #f3efe8;
  --bg-alt: #ece6dc;
  --surface: rgba(255, 252, 247, 0.9);
  --surface-strong: #fffdfa;
  --ink: #1f1b16;
  --muted: #756b60;
  --muted-soft: #9e9487;
  --line: rgba(116, 102, 84, 0.18);
  --accent: #8c6a3d;
  --success-bg: #eef6ef;
  --success-text: #486150;
  --error-bg: #f8ecec;
  --error-text: #9a4b4b;
  --shadow: 0 18px 48px rgba(31, 27, 22, 0.08);
  --paper-grain:
    radial-gradient(circle at 12% 20%, rgba(255,255,255,0.32) 0 1px, transparent 1.2px),
    radial-gradient(circle at 78% 36%, rgba(140,106,61,0.05) 0 1px, transparent 1.4px),
    radial-gradient(circle at 45% 72%, rgba(31,27,22,0.04) 0 1px, transparent 1.3px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html {
  background:
    radial-gradient(circle at top, rgba(214, 190, 165, 0.16), transparent 30%),
    linear-gradient(180deg, #eee7dc 0%, #f4efe7 24%, #f6f2eb 100%);
}
body {
  max-width: 760px;
  min-height: 100vh;
  margin: 0 auto;
  overflow-x: hidden;
  color: var(--ink);
  font-family: "Noto Sans SC", sans-serif;
  background:
    var(--paper-grain),
    radial-gradient(circle at 12% 16%, rgba(219, 186, 151, 0.16), transparent 24%),
    radial-gradient(circle at 84% 12%, rgba(150, 124, 101, 0.12), transparent 26%),
    radial-gradient(circle at 50% 40%, rgba(255,255,255,0.32), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 24%);
  position: relative;
}
::-webkit-scrollbar { display: none; }
button, input, textarea, select { font: inherit; }
.lock-screen, .header, .overview, .grid, .recent-section, .memory-view, .footer, .home-intro { padding-left: 24px; padding-right: 24px; }
.lock-screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.lock-mark, .header-mark { font-size: 11px; line-height: 1; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted-soft); }
.cn-note-inline, .cn-note-title, .btn-note { font-family: "Noto Sans SC", sans-serif; font-style: normal; font-weight: 400; color: color-mix(in srgb, var(--muted-soft) 92%, #8f8578 8%); }
.cn-note-inline { margin-left: 0.32em; font-size: 0.84em; }
.cn-note-title { display: inline-block; margin-left: 0.36em; font-size: 0.32em; vertical-align: middle; }
.btn-note { margin-left: 0.4em; font-size: 0.82em; }
.lock-screen h1, .header h1, .day-badge .label, .day-badge .number, .section-title .main, .memory-view-header .main, .card-toggle, .nav-title, .private-lock-title, .relay-title { font-family: "Bodoni Moda", serif; }
.lock-screen h1 { margin-top: 18px; font-size: clamp(2.8rem, 9vw, 4.6rem); line-height: 0.95; font-weight: 500; }
.lock-sub { margin-top: 14px; font-size: 15px; line-height: 1.8; color: var(--muted); }
.lock-screen input, .toolbar input, .toolbar select, .add-form input, .add-form textarea, .add-form select, .field-stack input, .field-stack textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 16px; outline: none; background: var(--surface-strong); color: var(--ink);
}
.lock-screen input { width: min(320px, 100%); margin-top: 30px; padding: 15px 18px; text-align: center; letter-spacing: 0.3em; box-shadow: var(--shadow); }
.lock-btn, .btn-save, .toolbar-btn, .ghost-btn, .minor-btn { min-height: 48px; padding: 12px 18px; border-radius: 16px; cursor: pointer; }
.lock-btn, .btn-save { border: none; color: #fff; background: linear-gradient(135deg, #8b683d 0%, #72522b 100%); }
.toolbar-btn, .ghost-btn, .minor-btn { border: 1px solid var(--line); color: var(--ink); background: rgba(255, 255, 255, 0.4); }
.lock-btn { margin-top: 16px; min-width: 140px; }
.lock-error { margin-top: 14px; min-height: 20px; font-size: 13px; color: var(--error-text); }
.header {
  position: sticky;
  top: 0;
  z-index: 30;
  overflow: hidden;
  padding-top: 24px;
  padding-bottom: 10px;
  text-align: center;
  backdrop-filter: blur(18px);
  background:
    linear-gradient(180deg, rgba(243, 239, 232, 0.96) 0%, rgba(243, 239, 232, 0.84) 68%, rgba(243, 239, 232, 0) 100%);
}

.header-letter {
  position: relative;
  max-width: 452px;
  margin: 0 auto;
  padding: 16px 20px 12px;
  border-radius: 32px 32px 28px 28px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.46) 0%, rgba(255,252,247,0.18) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.56),
    0 12px 32px rgba(31, 27, 22, 0.04);
}

.header-letter-minimal {
  max-width: 386px;
  padding: 14px 18px 12px;
}

.header-letter > * {
  position: relative;
  z-index: 2;
}

.header-letter,
.write-btn,
.back-btn {
  z-index: 2;
}


.header-haze {
  position: absolute;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  filter: blur(28px);
  opacity: 0.34;
  pointer-events: none;
}

.header-haze-left {
  left: -28px;
  top: 22px;
  background: rgba(182, 138, 34, 0.1);
}

.header-haze-right {
  right: -34px;
  top: 42px;
  background: rgba(108, 18, 41, 0.08);
}
.back-btn {
  position: absolute;
  left: 24px;
  top: 34px;
  display: none;
  border: none;
  background: none;
  color: var(--ink);
  font-size: 14px;
}

.write-btn {
  position: absolute;
  right: 24px;
  top: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid rgba(140, 106, 61, 0.18);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.72);
  box-shadow: 0 12px 30px rgba(31, 27, 22, 0.06);
  backdrop-filter: blur(12px);
  color: var(--accent);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.write-btn .btn-label {
  font-family: "Bodoni Moda", serif;
  font-size: 16px;
  font-style: italic;
  line-height: 1;
}

.write-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 252, 247, 0.92);
  border-color: rgba(140, 106, 61, 0.28);
  box-shadow: 0 16px 34px rgba(31, 27, 22, 0.09);
}

.write-btn.active {
  background: linear-gradient(135deg, rgba(139, 104, 61, 0.18) 0%, rgba(114, 82, 43, 0.12) 100%);
  border-color: rgba(140, 106, 61, 0.34);
  color: #6f4e28;
}
.back-btn.visible { display: block; }
.header h1 { margin-top: 0; font-size: clamp(1.9rem, 5.8vw, 3.15rem); line-height: 0.96; font-weight: 500; }
.header-whisper {
  margin-top: 7px;
  font-family: "Bodoni Moda", serif;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(140, 106, 61, 0.62);
}

.subtitle {
  max-width: 390px;
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  letter-spacing: 0.02em;
}

.letter-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.letter-divider::before,
.letter-divider::after {
  content: "";
  width: 74px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(182, 138, 34, 0.34) 36%, rgba(182, 138, 34, 0.08) 100%);
}

.letter-divider::after {
  transform: scaleX(-1);
}

.divider-flourish {
  font-family: "Bodoni Moda", serif;
  font-size: 13px;
  font-style: italic;
  color: rgba(140, 106, 61, 0.72);
}
.home-intro {
  display: flex;
  justify-content: center;
  padding-top: 2px;
}

.day-badge, .overview-card, .cat-card, .recent-card, .toolbar, .status-banner, .add-form, .memory-card, .private-lock-panel, .relay-panel { border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.day-badge { display: inline-flex; align-items: center; gap: 10px; margin-top: 0; padding: 8px 18px; border-radius: 999px; }
.day-badge {
  position: relative;
  padding: 9px 19px;
  border: 1px solid rgba(140, 106, 61, 0.16);
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.42), transparent 70%),
    rgba(255,252,247,0.68);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.72),
    0 10px 24px rgba(31,27,22,0.04);
}

.day-badge::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  border: 1px dashed rgba(140,106,61,0.18);
  opacity: 0.8;
}

.day-badge .label { font-size: 15px; font-style: italic; color: var(--accent); position: relative; z-index: 1; }
.day-badge .number { font-size: 25px; line-height: 1; font-weight: 600; }
.day-badge .number { position: relative; z-index: 1; color: rgba(111,78,40,0.92); }
.overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding-top: 8px; }
.overview-card, .cat-card, .recent-card, .memory-card, .toolbar, .add-form, .private-lock-panel, .relay-panel { border-radius: 22px; }
.overview-card { padding: 18px 16px; }
.overview-label, .recent-date, .card-date, .toolbar-title, .summary, .footer-note { font-size: 13px; color: var(--muted-soft); }
.overview-value { display: block; margin-top: 12px; font-size: clamp(1.4rem, 4vw, 2rem); line-height: 1.2; font-weight: 600; }
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 10px;
  max-width: 680px;
  margin: 0 auto;
}
.recent-section, .footer {
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}
.cat-card, .recent-card, .memory-card { opacity: 0; animation: fadeUp 0.52s ease forwards; }
.cat-card, .memory-view .memory-card { border-color: var(--room-line, var(--line)); background: var(--room-surface, var(--surface)); box-shadow: 0 18px 48px var(--room-shadow, rgba(31, 27, 22, 0.08)); }
.cat-card {
  position: relative;
  min-height: 176px;
  padding: 12px 14px 9px;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
}

.cat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 14% 16%, rgba(255,255,255,0.34), transparent 28%),
    radial-gradient(circle at 78% 86%, rgba(140,106,61,0.07), transparent 30%);
  opacity: 0.9;
  z-index: -2;
}

.cat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--paper-grain);
  opacity: 0.18;
  mix-blend-mode: multiply;
  z-index: -1;
}

.cat-card:hover {
  transform: translateY(-2px);
}

.cat-card {
  min-height: 196px;
  padding: 14px 15px 12px;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.cat-card-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 132px;
  padding: 8px;
}

.cat-card-copy {
  min-width: 0;
}

.cat-object {
  position: relative;
  width: 100%;
  height: 118px;
  filter: drop-shadow(0 14px 24px rgba(31, 27, 22, 0.08));
}

.cat-object span {
  position: absolute;
  display: block;
}

.cat-profond {
  border-radius: 28px 28px 24px 32px;
}

.cat-folie {
  border-radius: 30px 24px 28px 26px;
}

.cat-quotidien {
  border-radius: 26px 30px 24px 28px;
}

.cat-message {
  border-radius: 32px 26px 30px 24px;
}

.cat-journal {
  border-radius: 24px 30px 30px 26px;
}

.cat-pulse {
  border-radius: 26px 32px 26px 30px;
}

.cat-diary {
  border-radius: 30px 26px 32px 24px;
}

.cat-prive {
  border-radius: 26px 26px 32px 24px;
}

.cat-album {
  border-radius: 32px 30px 24px 30px;
}

.cat-relais {
  border-radius: 28px 24px 32px 28px;
}

.cat-title, .section-title .main, .memory-view-header .main { font-family: "Bodoni Moda", serif; font-weight: 500; }
.cat-title {
  margin-right: 0;
  padding-bottom: 6px;
  border-bottom: 1px solid color-mix(in srgb, var(--room-line, var(--line)) 72%, transparent);
  font-size: 22px;
  line-height: 1;
  color: var(--room-accent, var(--ink));
}
.cat-subtitle, .section-title .sub, .memory-view-header .sub, .private-lock-copy, .relay-copy { margin-top: 5px; font-size: 12px; line-height: 1.55; color: var(--muted); }
.cat-snippet, .recent-text, .card-preview, .card-text, .room-note, .relay-text, .empty-state, .footer p { line-height: 1.72; }
.cat-snippet, .recent-text, .card-preview { margin-top: 8px; font-size: 12px; color: color-mix(in srgb, var(--muted) 90%, #8f8578 10%); }
.cat-snippet {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cat-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--room-line, var(--line)) 72%, transparent);
}

.cat-meta {
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--muted-soft);
  text-align: right;
}

.cat-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--cat-accent, var(--accent)) 76%, #fff 24%);
  background: color-mix(in srgb, var(--room-surface, var(--surface)) 72%, #fff 28%);
  border: 1px solid color-mix(in srgb, var(--room-line, var(--line)) 78%, transparent);
}

.object-profond .drawer-shadow {
  inset: 16px 8px 10px 10px;
  border-radius: 18px 18px 26px 22px;
  background: rgba(58, 27, 34, 0.14);
}

.object-profond .drawer-shell {
  inset: 8px 14px 18px 10px;
  border-radius: 18px 18px 24px 22px;
  background: linear-gradient(180deg, rgba(108,18,41,0.22), rgba(255,247,244,0.82));
  border: 1px solid rgba(108,18,41,0.22);
}

.object-profond .drawer-lining {
  inset: 18px 24px 30px 20px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.82), rgba(244,218,223,0.78));
  border: 1px solid rgba(108,18,41,0.12);
}

.object-profond .drawer-ring {
  width: 18px;
  height: 18px;
  right: 26px;
  bottom: 44px;
  border-radius: 999px;
  border: 2px solid rgba(108,18,41,0.52);
}

.object-folie .ticket {
  width: 78px;
  height: 94px;
  left: 18px;
  top: 12px;
  border-radius: 18px;
  background:
    radial-gradient(circle at left center, transparent 8px, rgba(255,250,240,0.9) 8px),
    linear-gradient(180deg, rgba(255,248,223,0.95), rgba(250,230,190,0.86));
  border: 1px solid rgba(182,138,34,0.24);
}

.object-folie .ticket-back {
  transform: rotate(-9deg);
  left: 10px;
  opacity: 0.74;
}

.object-folie .ticket-front {
  transform: rotate(8deg);
}

.object-folie .ticket-star {
  width: 28px;
  height: 28px;
  right: 18px;
  top: 18px;
  background: radial-gradient(circle, rgba(250,212,110,0.95) 0 32%, transparent 33%);
  clip-path: polygon(50% 0, 62% 34%, 100% 34%, 69% 56%, 80% 92%, 50% 70%, 20% 92%, 31% 56%, 0 34%, 38% 34%);
}

.object-quotidien .recipe-card {
  inset: 12px 18px 14px 14px;
  border-radius: 18px 20px 16px 16px;
  background: linear-gradient(180deg, rgba(255,252,245,0.96), rgba(245,236,224,0.88));
  border: 1px solid rgba(122,112,94,0.2);
}

.object-quotidien .recipe-lines {
  inset: 28px 30px 30px 28px;
  background:
    linear-gradient(rgba(122,112,94,0.18), rgba(122,112,94,0.18)) 0 0/100% 1px no-repeat,
    linear-gradient(rgba(122,112,94,0.18), rgba(122,112,94,0.18)) 0 22px/100% 1px no-repeat,
    linear-gradient(rgba(122,112,94,0.18), rgba(122,112,94,0.18)) 0 44px/78% 1px no-repeat;
}

.object-quotidien .wood-spoon {
  width: 16px;
  height: 74px;
  right: 14px;
  top: 24px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(166,124,87,0.95), rgba(124,85,53,0.9));
  transform: rotate(18deg);
  box-shadow: inset 0 0 0 1px rgba(94,63,36,0.18);
}

.object-message .sticky-note {
  inset: 18px 18px 10px 14px;
  border-radius: 10px 18px 10px 16px;
  background: linear-gradient(180deg, rgba(255,251,210,0.96), rgba(251,239,179,0.88));
  border: 1px solid rgba(118,100,80,0.18);
  transform: rotate(-3deg);
}

.object-message .note-magnet {
  width: 18px;
  height: 18px;
  top: 16px;
  left: 46px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.9), rgba(168,126,89,0.92));
  box-shadow: 0 2px 8px rgba(118,100,80,0.18);
}

.object-message .note-lines {
  inset: 42px 28px 26px 28px;
  background:
    linear-gradient(rgba(118,100,80,0.2), rgba(118,100,80,0.2)) 0 0/88% 1px no-repeat,
    linear-gradient(rgba(118,100,80,0.2), rgba(118,100,80,0.2)) 0 18px/100% 1px no-repeat,
    linear-gradient(rgba(118,100,80,0.2), rgba(118,100,80,0.2)) 0 36px/76% 1px no-repeat;
}

.object-journal .folder-back,
.object-journal .folder-front {
  border-radius: 18px;
  border: 1px solid rgba(79,97,125,0.22);
}

.object-journal .folder-back {
  inset: 18px 12px 12px 26px;
  background: linear-gradient(180deg, rgba(210,221,235,0.88), rgba(186,201,221,0.92));
}

.object-journal .folder-front {
  inset: 24px 16px 10px 14px;
  background: linear-gradient(180deg, rgba(244,247,252,0.96), rgba(219,229,243,0.92));
}

.object-journal .folder-tab {
  width: 34px;
  height: 16px;
  left: 24px;
  top: 12px;
  border-radius: 10px 10px 0 0;
  background: rgba(186,201,221,0.94);
  border: 1px solid rgba(79,97,125,0.16);
  border-bottom: none;
}

.object-pulse .vitals-card {
  inset: 12px 14px 12px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(244,251,249,0.96), rgba(224,239,236,0.92));
  border: 1px solid rgba(77,117,111,0.2);
}

.object-pulse .vitals-grid {
  inset: 24px 24px 24px 24px;
  border-radius: 12px;
  background:
    linear-gradient(rgba(77,117,111,0.09), rgba(77,117,111,0.09)) 0 0/100% 1px repeat-y,
    linear-gradient(90deg, rgba(77,117,111,0.08) 0 1px, transparent 1px 14px);
  background-size: 100% 18px, 14px 100%;
}

.object-pulse .vitals-wave {
  left: 20px;
  right: 20px;
  top: 50px;
  height: 22px;
  background: rgba(0,0,0,0);
  clip-path: polygon(0 58%, 12% 58%, 22% 58%, 30% 22%, 38% 80%, 48% 8%, 58% 58%, 68% 58%, 76% 40%, 84% 58%, 100% 58%, 100% 70%, 0 70%);
  background-color: rgba(69, 118, 111, 0.88);
}

.object-pulse .vitals-heart {
  width: 18px;
  height: 18px;
  right: 24px;
  top: 22px;
  background: rgba(98,150,140,0.88);
  transform: rotate(-45deg);
  border-radius: 5px 5px 0 0;
}

.object-pulse .vitals-heart::before,
.object-pulse .vitals-heart::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  background: inherit;
  border-radius: 999px;
}

.object-pulse .vitals-heart::before {
  left: 0;
  top: -9px;
}

.object-pulse .vitals-heart::after {
  left: 9px;
  top: 0;
}

.object-diary .diary-cover {
  inset: 10px 18px 10px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(252,243,247,0.96), rgba(231,205,218,0.92));
  border: 1px solid rgba(139,95,122,0.22);
}

.object-diary .diary-spine {
  inset: 10px auto 10px 16px;
  width: 14px;
  border-radius: 18px 0 0 18px;
  background: rgba(139,95,122,0.22);
}

.object-diary .diary-bookmark {
  width: 12px;
  height: 68px;
  right: 30px;
  top: 8px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(180deg, rgba(184,92,126,0.92), rgba(150,71,101,0.92));
}

.object-diary .diary-heart {
  width: 28px;
  height: 26px;
  left: 44px;
  top: 42px;
  background: rgba(184,92,126,0.86);
  transform: rotate(-45deg);
  border-radius: 6px 6px 0 0;
}

.object-diary .diary-heart::before,
.object-diary .diary-heart::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 26px;
  background: inherit;
  border-radius: 999px;
}

.object-diary .diary-heart::before {
  left: 0;
  top: -14px;
}

.object-diary .diary-heart::after {
  left: 14px;
  top: 0;
}

.object-prive .lockbox-shell {
  inset: 34px 16px 10px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(39,37,48,0.95), rgba(26,24,33,0.98));
  border: 1px solid rgba(255,255,255,0.08);
}

.object-prive .lockbox-lid {
  inset: 18px 20px 48px 20px;
  border-radius: 18px 18px 8px 8px;
  background: linear-gradient(180deg, rgba(56,54,70,0.95), rgba(32,30,41,0.96));
}

.object-prive .lockbox-lock {
  width: 24px;
  height: 28px;
  left: 46px;
  top: 40px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(224,211,178,0.96), rgba(166,140,89,0.92));
}

.object-prive .lockbox-lock::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: -12px;
  border: 3px solid rgba(224,211,178,0.96);
  border-bottom: none;
  border-radius: 14px 14px 0 0;
}

.object-album .photo-stack {
  width: 76px;
  height: 92px;
  bottom: 12px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,244,238,0.96));
  border: 1px solid rgba(85,115,93,0.16);
  box-shadow: 0 8px 20px rgba(31, 27, 22, 0.08);
}

.object-album .photo-stack.back {
  left: 8px;
  transform: rotate(-10deg);
}

.object-album .photo-stack.mid {
  left: 24px;
  transform: rotate(7deg);
}

.object-album .photo-stack.front {
  left: 36px;
  transform: rotate(-2deg);
}

.object-album .photo-scene {
  width: 54px;
  height: 50px;
  left: 47px;
  top: 32px;
  border-radius: 4px;
  background:
    radial-gradient(circle at 20% 22%, rgba(255,239,197,0.95) 0 6px, transparent 7px),
    linear-gradient(180deg, rgba(197,226,215,0.95) 0 50%, rgba(120,164,131,0.98) 51% 100%);
  box-shadow: 0 0 0 1px rgba(85,115,93,0.14);
}

.object-relais .letter-back,
.object-relais .letter-front {
  inset: 22px 16px 18px 18px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,252,248,0.96), rgba(243,234,248,0.92));
  border: 1px solid rgba(92,75,130,0.2);
}

.object-relais .letter-back {
  transform: rotate(-5deg);
  inset: 16px 18px 24px 14px;
  opacity: 0.78;
}

.object-relais .letter-front::before {
  content: "";
  position: absolute;
  inset: 24px 14px 16px 14px;
  clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%);
  background: rgba(92,75,130,0.1);
}

.object-relais .letter-seal {
  width: 22px;
  height: 22px;
  left: 47px;
  top: 48px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.9), rgba(173,114,142,0.96));
  border: 1px solid rgba(92,75,130,0.16);
}

.object-phonograph .record-plinth {
  inset: 24px 10px 12px 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(143,105,78,0.92), rgba(104,69,45,0.96));
  border: 1px solid rgba(89,61,40,0.18);
}

.object-phonograph .record-disc {
  width: 68px;
  height: 68px;
  left: 16px;
  top: 24px;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, rgba(246,230,205,0.94) 0 10px, rgba(43,31,23,0.92) 11px 100%);
  box-shadow: inset 0 0 0 10px rgba(18,16,18,0.12);
}

.object-phonograph .record-armature {
  width: 46px;
  height: 8px;
  right: 18px;
  top: 34px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(244,230,204,0.94), rgba(178,145,102,0.92));
  transform: rotate(28deg);
  transform-origin: right center;
}

.object-phonograph .record-armature::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  right: -2px;
  top: -2px;
  border-radius: 999px;
  background: rgba(178,145,102,0.96);
}
.recent-section, .memory-view { padding-top: 12px; padding-bottom: 100px; }
.memory-view { display: none; }
.section-title, .toolbar-top, .recent-meta, .card-meta, .card-footer, .form-head, .relay-form-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.memory-view-header { margin-bottom: 18px; }
.memory-view-header .summary, .room-note, .relay-text { margin-top: 12px; }
.recent-list { display: grid; gap: 14px; }
.recent-card, .memory-card .card-header, .toolbar, .add-form, .private-lock-panel, .relay-panel { padding: 14px 16px; }
.recent-card { cursor: pointer; }
.recent-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.56) 0%, rgba(255,252,247,0.82) 100%);
}
.meta-inline { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pill, .author-chip, .card-mood { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12px; }
.pill { background: rgba(140, 106, 61, 0.08); color: var(--accent); }
.author-chip, .card-mood { border: 1px solid var(--room-line, var(--line)); background: var(--room-surface, rgba(31, 27, 22, 0.05)); color: var(--muted); }
.recent-title, .card-title, .form-head .title { margin-top: 12px; font-size: 18px; line-height: 1.5; font-weight: 600; }
.toolbar-grid, .form-grid { display: grid; gap: 12px; margin-top: 14px; }
.toolbar-grid { grid-template-columns: minmax(0, 1.6fr) minmax(180px, 0.9fr); }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.toolbar label, .add-form label, .field-stack { display: block; font-size: 13px; color: var(--muted); }
.toolbar input, .toolbar select, .add-form input, .add-form textarea, .add-form select, .field-stack input, .field-stack textarea { margin-top: 8px; padding: 13px 14px; font-size: 15px; }
.add-form textarea, .field-stack textarea { min-height: 150px; resize: vertical; }
.add-form { display: none; margin-bottom: 16px; }
.add-form.active { display: block; }
.form-head .sub { font-size: 13px; color: var(--muted-soft); }
.form-actions, .inline-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.btn-save { flex: 1; }
.status-banner { display: none; border-radius: 18px; padding: 14px 16px; margin-bottom: 16px; font-size: 14px; line-height: 1.8; }
.status-banner.visible { display: block; }
.status-banner.success { background: var(--success-bg); color: var(--success-text); }
.status-banner.error { background: var(--error-bg); color: var(--error-text); }
.card-toggle { font-size: 16px; line-height: 1; font-style: italic; color: var(--room-accent, var(--accent)); }
.card-preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-body { display: none; padding: 0 20px 18px; border-top: 1px solid var(--room-line, var(--line)); }
.memory-card.expanded .card-body { display: block; }
.card-text, .relay-text { white-space: pre-wrap; color: var(--ink); }
.card-image-wrap,
.form-image-preview {
  margin-top: 16px;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--room-line, var(--line));
  background: rgba(255, 255, 255, 0.62);
}

.card-image,
.form-image-preview img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.card-image {
  animation: albumBreath 8s ease-in-out infinite alternate;
}

.form-image-preview img {
  max-height: 280px;
}
.private-lock-title, .relay-title { margin-top: 14px; font-size: 24px; line-height: 1.2; color: var(--room-accent, var(--ink)); }
.empty-state, .footer { text-align: center; }
.empty-state { padding: 38px 24px; font-size: 15px; color: var(--muted); }
.footer { margin-top: 2px; padding-bottom: 100px; }
.footer p { font-size: 15px; color: var(--muted); }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; display: flex; justify-content: center; padding: 10px 0 24px; background: linear-gradient(180deg, rgba(243, 239, 232, 0) 0%, rgba(243, 239, 232, 0.96) 30%, rgba(243, 239, 232, 0.98) 100%); backdrop-filter: blur(18px); }
.bottom-nav-inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 6px; width: min(720px, calc(100% - 24px)); padding: 10px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255, 252, 247, 0.9); box-shadow: var(--shadow); }
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 54px; padding: 8px 6px; border: none; border-radius: 16px; background: transparent; color: var(--muted-soft); cursor: pointer; }
.nav-item.active { background: rgba(140, 106, 61, 0.1); color: var(--ink); }
.nav-title { font-size: 15px; line-height: 1; }
.nav-sub { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes albumBreath {
  from { transform: scale(1.01); filter: saturate(0.96); }
  to { transform: scale(1.04); filter: saturate(1.04); }
}

@keyframes pageTurnIn {
  from { opacity: 0; transform: perspective(1200px) rotateY(8deg) translateY(12px); transform-origin: left center; }
  to { opacity: 1; transform: perspective(1200px) rotateY(0deg) translateY(0); transform-origin: left center; }
}

.memory-view {
  animation: pageTurnIn 0.45s ease;
}
@media (max-width: 640px) {
  .overview, .grid, .toolbar-grid, .form-grid { grid-template-columns: 1fr; }
  .header {
    padding-top: 12px;
    padding-bottom: 8px;
  }
  .header-mark {
    font-size: 9px;
    letter-spacing: 0.18em;
  }
  .header-whisper {
    margin-top: 5px;
    font-size: 8px;
    letter-spacing: 0.16em;
  }
  .header h1 {
    margin-top: 4px;
    font-size: clamp(1.7rem, 10.4vw, 2.55rem);
    line-height: 0.98;
  }
  .subtitle {
    max-width: 292px;
    margin-top: 7px;
    font-size: 12px;
    line-height: 1.55;
  }
  .letter-divider {
    margin-top: 7px;
    gap: 8px;
  }
  .letter-divider::before,
  .letter-divider::after {
    width: 44px;
  }
  .divider-flourish {
    font-size: 12px;
  }
  .home-intro {
    padding-top: 0;
  }
  .day-badge {
    gap: 8px;
    padding: 8px 14px;
  }
  .day-badge .label {
    font-size: 13px;
  }
  .day-badge .number {
    font-size: 22px;
  }
  .cat-card {
    grid-template-columns: 84px minmax(0, 1fr);
    min-height: 164px;
    padding: 12px 12px 10px;
    gap: 10px;
  }
  .cat-card-visual {
    min-height: 94px;
    padding: 4px;
  }
  .cat-object {
    height: 86px;
  }
  .cat-title {
    font-size: 18px;
    padding-bottom: 5px;
  }
  .cn-note-title {
    display: block;
    margin-left: 0;
    margin-top: 4px;
    font-size: 0.46em;
  }
  .cat-subtitle {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.45;
  }
  .cat-snippet {
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.6;
    -webkit-line-clamp: 2;
  }
  .cat-meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-top: 8px;
    padding-top: 7px;
  }
  .cat-meta {
    text-align: left;
    font-size: 10px;
  }
  .cat-chip {
    min-height: 24px;
    padding: 0 9px;
    font-size: 10px;
  }
  .lock-screen, .header, .overview, .grid, .recent-section, .memory-view, .footer, .home-intro { padding-left: 18px; padding-right: 18px; }
  .back-btn {
    left: 18px;
    top: 14px;
    max-width: calc(100% - 124px);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .write-btn {
    right: 18px;
    top: 12px;
    min-height: 34px;
    min-width: 68px;
    padding: 0 12px;
    border-radius: 999px;
  }
  .write-btn .btn-label {
    font-size: 14px;
  }
  .bottom-nav-inner { width: calc(100% - 18px); }
  .bottom-nav {
    padding: 8px 0 18px;
  }
  .nav-item {
    min-height: 50px;
    padding: 7px 4px;
  }
  .nav-title {
    font-size: 14px;
  }
  .nav-sub {
    font-size: 10px;
  }
  .header-letter {
    max-width: 100%;
    margin-top: 20px;
    padding: 14px 14px 12px;
    border-radius: 24px;
  }
  .header-letter-minimal {
    max-width: 320px;
    padding: 12px 14px 11px;
  }
  .header-haze {
    width: 120px;
    height: 120px;
  }
  .grid {
    gap: 10px;
    padding-top: 8px;
  }
  .recent-section {
    padding-top: 10px;
  }
  .grid,
  .recent-section,
  .memory-view,
  .footer {
    max-width: none;
  }
}


.cat-phonograph {
  border-radius: 30px 32px 26px 28px;
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,0.34), transparent 28%),
    linear-gradient(180deg, rgba(131, 87, 64, 0.12) 0%, rgba(255, 252, 247, 0.7) 100%);
}

.home-sigil-phonograph {
  background: linear-gradient(180deg, rgba(131,87,64,0.16) 0%, rgba(255,252,247,0.72) 100%);
}

.phonograph-hero {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--room-line, var(--line));
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255,255,255,0.52) 0%, rgba(255,252,247,0.78) 100%);
  box-shadow: 0 18px 48px var(--room-shadow, rgba(31, 27, 22, 0.08));
}

.phonograph-stage {
  position: relative;
  height: 150px;
  border-radius: 24px;
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,0.18), transparent 42%), linear-gradient(180deg, rgba(131,87,64,0.16) 0%, rgba(70,46,33,0.2) 100%);
  overflow: hidden;
}

.record-base {
  position: absolute;
  inset: auto 18px 18px;
  height: 22px;
  border-radius: 999px;
  background: rgba(52, 34, 26, 0.2);
  filter: blur(1px);
}

.record-disc {
  position: absolute;
  left: 28px;
  top: 20px;
  width: 102px;
  height: 102px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(236,223,214,0.9) 0 10px, rgba(79,52,37,0.9) 11px 14px, rgba(32,18,14,0.96) 15px 100%),
    repeating-radial-gradient(circle at center, rgba(255,255,255,0.03) 0 2px, rgba(0,0,0,0.04) 2px 4px);
  box-shadow: 0 10px 22px rgba(28, 18, 14, 0.24);
}

.record-label {
  position: absolute;
  left: 68px;
  top: 60px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(226, 199, 177, 0.92);
  box-shadow: inset 0 0 0 5px rgba(105, 70, 52, 0.18);
}

.record-arm {
  position: absolute;
  right: 28px;
  top: 34px;
  width: 76px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(236,223,214,0.9), rgba(132,91,68,0.76));
  transform-origin: right center;
  transform: rotate(-22deg);
  box-shadow: 0 4px 10px rgba(45, 30, 22, 0.14);
}

.record-arm::after {
  content: "";
  position: absolute;
  left: -10px;
  top: -5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(236,223,214,0.96);
}

.phonograph-hero.playing .record-disc {
  animation: phonographSpin 2.8s linear infinite;
}

.phonograph-hero.playing .record-arm {
  transform: rotate(-12deg);
}

.phonograph-copy {
  display: grid;
  gap: 8px;
}

.phonograph-title {
  font-family: "Bodoni Moda", serif;
  font-size: 28px;
  line-height: 1.1;
  color: var(--room-accent, var(--accent));
}

.phonograph-note {
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
}

.phonograph-form {
  margin-bottom: 18px;
}

.record-button-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.record-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #8b683d 0%, #72522b 100%);
}

.record-btn.alt {
  background: linear-gradient(135deg, #6a5044 0%, #4e382d 100%);
}

.record-status {
  margin-top: 12px;
  min-height: 22px;
  font-size: 13px;
  color: var(--muted);
}

.record-status.is-live {
  color: #8c6a3d;
}

.record-status.is-error {
  color: #9a4b4b;
}

.record-preview {
  margin-top: 14px;
}

.record-preview audio,
.phonograph-audio-wrap audio {
  width: 100%;
}

.phonograph-list {
  display: grid;
  gap: 14px;
}

.phonograph-item.playing {
  box-shadow: 0 18px 48px rgba(131, 87, 64, 0.22);
}

.phonograph-item .card-body {
  display: block;
}

@keyframes phonographSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  .phonograph-hero {
    grid-template-columns: 1fr;
  }

  .phonograph-stage {
    height: 170px;
  }

  .record-button-row {
    flex-direction: column;
  }
}
