:root {
  --ink: #1f2525;
  --muted: #707976;
  --paper: #f6f5f1;
  --surface: #ffffff;
  --line: #dfe4df;
  --green: #1f7663;
  --green-dark: #155747;
  --coral: #e8795e;
  --sun: #e8bb55;
  --rose: #d87983;
  --blue: #6698ab;
  --shadow: 0 12px 32px rgba(28, 44, 40, 0.09);
}

/* Final cascade for the recipe dialog and the compact calendar redesign. */
body.modal-open { overflow: hidden; }
.recipe-dialog { width: min(76vw, 1080px); height: min(82vh, 820px); max-width: calc(100vw - 28px); max-height: calc(100vh - 28px); padding: 0; overflow: visible; border: 0; background: transparent; }
.recipe-dialog::backdrop { background: rgba(27, 40, 35, .46); backdrop-filter: blur(3px); }
.recipe-modal-card { position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; min-width: 0; min-height: 0; gap: 0; overflow: hidden; padding: 0; border: 1px solid #d8e2d8; border-radius: 8px; background: #fbfcf8; box-shadow: 0 24px 60px rgba(12, 30, 23, .2); }
.recipe-modal-card .modal-header { flex: 0 0 auto; padding: 21px 25px 16px; border-bottom: 1px solid #e4e9e2; }
.recipe-modal-card .modal-header h3 { margin-bottom: 2px; }
.recipe-draft-status { min-height: 16px; color: #89988e; font-size: 11px; font-weight: 400; }
.recipe-form-body { container: recipe-body / inline-size; flex: 1 1 auto; min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 19px 25px 23px; scrollbar-color: #b6c7b9 transparent; }
.recipe-form-body textarea { min-height: 88px; resize: vertical; }
.recipe-modal-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 9px; min-height: 69px; margin: 0; padding: 13px 25px; border-top: 1px solid #e1e8e1; background: rgba(247, 250, 245, .96); }
.recipe-modal-actions > span { flex: 1 1 auto; min-width: 12px; }
.recipe-modal-actions button { white-space: nowrap; }
.modal-resize-handle { position: absolute; right: 7px; bottom: 7px; z-index: 3; width: 15px; height: 15px; border-right: 1px solid #92aa98; border-bottom: 1px solid #92aa98; opacity: .62; cursor: nwse-resize; transition: opacity .16s ease, border-color .16s ease; }
.modal-resize-handle::before, .modal-resize-handle::after { content: ""; position: absolute; right: 2px; bottom: 3px; width: 9px; border-top: 1px solid currentColor; transform: rotate(-45deg); transform-origin: right center; }
.modal-resize-handle::after { right: 0; bottom: 7px; width: 6px; }
.modal-resize-handle:hover, .modal-resize-handle.is-dragging { color: #46745a; border-color: #46745a; opacity: 1; }
@container recipe-body (max-width: 690px) { .recipe-form-body .form-grid { grid-template-columns: 1fr; } }

.calendar-stats { grid-template-columns: minmax(310px, .82fr) minmax(0, 1.18fr); gap: 18px; align-items: stretch; margin: 16px 0 18px; }
.calendar-memory-hero { position: relative; display: flex; flex-direction: column; min-height: 207px; overflow: hidden; padding: 19px 22px 17px; border: 1px solid #d6e1d7; border-radius: 7px; background: #f8fbf6; }
.calendar-memory-hero::after { content: ""; position: absolute; right: -34px; bottom: -50px; width: 170px; height: 170px; border: 1px solid rgba(153, 134, 87, .17); border-radius: 50%; box-shadow: 0 0 0 16px rgba(153, 134, 87, .035), 0 0 0 33px rgba(153, 134, 87, .025); pointer-events: none; }
.calendar-memory-hero-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 15px; color: #9b8b69; font: 10px "DM Mono", monospace; letter-spacing: .08em; }
.calendar-memory-hero-top span:last-child { color: #8b9a90; letter-spacing: .02em; }
.calendar-stat-label { color: #6f8376; font-size: 12px; letter-spacing: .13em; }
.calendar-relationship-count { position: relative; z-index: 1; display: flex; align-items: baseline; gap: 7px; margin-top: 3px; color: #315c48; font: 500 55px/.98 "DM Mono", monospace; letter-spacing: -.08em; }
.calendar-relationship-count small { color: #7a8e81; font: 13px "Source Han Sans SC", sans-serif; letter-spacing: 0; }
.calendar-memory-duration { position: relative; z-index: 1; margin: 9px 0 0; color: #536c5c; font: 15px "Noto Serif SC", serif; }
.calendar-memory-meta { display: flex; flex-wrap: wrap; gap: 5px 15px; margin-top: auto; color: #89988e; font-size: 10px; line-height: 1.5; }
.calendar-memory-progress { position: relative; z-index: 1; height: 2px; margin: 12px 0 8px; overflow: hidden; background: #dbe7dc; }
.calendar-memory-progress span { display: block; height: 100%; background: #8aaa91; transition: width .35s ease; }
.calendar-memory-copy { position: relative; z-index: 1; margin: 0; color: #9a8157; font-size: 11px; line-height: 1.6; }
.calendar-memory-list { display: grid; align-content: stretch; min-width: 0; border-top: 1px solid #dbe5dc; border-bottom: 1px solid #dbe5dc; }
.calendar-memory-item { display: grid; grid-template-columns: minmax(0, 1fr) 29px; gap: 12px; align-items: center; min-width: 0; padding: 10px 5px 10px 17px; border-bottom: 1px solid #e5ebe5; }
.calendar-memory-item:last-child { border-bottom: 0; }
.calendar-memory-item.is-featured { background: rgba(239, 247, 239, .62); }
.calendar-memory-item div { display: grid; min-width: 0; gap: 4px; }
.calendar-memory-item span { color: #89978e; font-size: 10px; letter-spacing: .08em; }
.calendar-memory-item strong { overflow: hidden; color: #456552; font: 600 16px/1.3 "Noto Serif SC", serif; text-overflow: ellipsis; white-space: nowrap; }
.calendar-memory-item small { overflow: hidden; color: #8c998f; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.calendar-memory-item em { color: #b59c68; font: 11px "DM Mono", monospace; font-style: normal; text-align: right; }
.calendar-toolbar { margin-bottom: 12px; }
.calendar-nav { gap: 6px; }
.calendar-nav strong { min-width: 112px; font-size: 16px; }
.calendar-nav .calendar-today-button { padding: 3px 4px; color: #7d8f83; font-size: 11px; }
.calendar-month-view { padding: 0; border: 0; background: transparent; }
.calendar-month-caption { margin: 0 2px 9px; }
.calendar-month-caption strong { font-size: 20px; }
.calendar-month-caption span, .calendar-month-caption small { font-size: 10px; }
.calendar-grid { gap: 1px; overflow: hidden; border: 0; border-radius: 5px; background: #e4ebe4; }
.calendar-cell { min-height: 91px; padding: 7px 7px 5px; border: 0; background: #fffefa; }
.calendar-cell:hover { background: #f7fbf5; box-shadow: inset 0 0 0 1px #b5cbb8; }
.calendar-cell.is-weekend { background: #fcfbf7; }
.calendar-cell.is-today { background: #fffef8; box-shadow: inset 0 0 0 1px #a08659, inset 0 0 0 3px rgba(160, 134, 89, .1); }
.calendar-cell.muted-day { min-height: 91px; background: #f8faf6; }
.calendar-date-button { gap: 5px; }
.calendar-date-button strong { color: #405d4d; font-size: 16px; font-weight: 500; }
.calendar-date-button small { color: #a18f69; font-size: 9px; }
.calendar-day-notes { min-height: 0; margin-top: 4px; }
.calendar-day-notes:empty { display: none; }
.calendar-day-note { font-size: 9px; }
.calendar-event-stack { gap: 2px; margin-top: 5px; }
.calendar-event { min-height: 19px; padding: 3px 4px; border-left-width: 2px; font-size: 9px; }
.calendar-event i { width: 4px; height: 4px; }
.calendar-more { padding: 1px 2px; border: 0; color: #a18758; background: transparent; font-size: 9px; text-align: left; cursor: pointer; }
.calendar-more:hover { color: #557861; }
.calendar-rest-badge { position: absolute; top: 6px; right: 6px; color: #a16f55; font: 9px "DM Mono", monospace; font-style: normal; }
.calendar-rest-badge.is-work { color: #8b8b72; }

@media (max-width: 980px) and (min-width: 721px) {
  .calendar-stats { grid-template-columns: minmax(270px, .78fr) minmax(0, 1.22fr); gap: 12px; }
  .calendar-memory-hero { padding-inline: 17px; }
  .calendar-memory-item { padding-left: 13px; }
  .calendar-cell { min-height: 82px; padding-inline: 5px; }
}
@media (max-width: 720px) {
  .recipe-dialog { inset: auto 0 0; width: 100%; max-width: 100%; height: min(94vh, 760px); max-height: 94dvh; margin: 0; border-radius: 14px 14px 0 0; }
  .recipe-modal-card { border-radius: 14px 14px 0 0; }
  .recipe-modal-card .modal-header { padding: 17px 18px 13px; }
  .recipe-form-body { padding: 16px 18px 19px; }
  .recipe-modal-actions { min-height: 63px; padding: 11px 18px; }
  .recipe-modal-actions .outline-button:first-child { margin-right: auto; }
  .modal-resize-handle { display: none; }
  .calendar-stats { grid-template-columns: 1fr; gap: 12px; margin-top: 13px; }
  .calendar-memory-hero { min-height: 185px; padding: 17px 18px 15px; }
  .calendar-relationship-count { font-size: 47px; }
  .calendar-memory-item { padding-block: 9px; }
  .calendar-toolbar { align-items: stretch; }
  .calendar-toolbar .segmented-control { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .calendar-toolbar .segment { flex: 0 0 auto; }
  .calendar-nav { width: 100%; justify-content: space-between; }
  .calendar-nav strong { flex: 1; min-width: 0; }
  .calendar-nav .calendar-today-button { margin-inline: auto; }
  .calendar-month-caption small { display: none; }
  .calendar-cell, .calendar-cell.muted-day { min-height: 72px; padding: 5px 4px 4px; }
  .calendar-date-button { display: grid; gap: 1px; }
  .calendar-date-button strong { font-size: 14px; }
  .calendar-date-button small { font-size: 8px; }
  .calendar-day-note { font-size: 8px; }
  .calendar-event { min-height: 16px; padding: 2px; font-size: 8px; }
  .calendar-event i { width: 3px; height: 3px; }
  .calendar-rest-badge { top: 4px; right: 4px; font-size: 8px; }
}

/* Final interaction polish: recipe writing space */
body.modal-open { overflow: hidden; }
.recipe-dialog { width: min(76vw, 1080px); height: min(82vh, 820px); max-width: calc(100vw - 28px); max-height: calc(100vh - 28px); padding: 0; overflow: visible; border: 0; background: transparent; }
.recipe-dialog::backdrop { background: rgba(27, 40, 35, .46); backdrop-filter: blur(3px); }
.recipe-modal-card { position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; min-width: 0; min-height: 0; gap: 0; overflow: hidden; padding: 0; border: 1px solid #d8e2d8; border-radius: 8px; background: #fbfcf8; box-shadow: 0 24px 60px rgba(12, 30, 23, .2); }
.recipe-modal-card .modal-header { flex: 0 0 auto; padding: 21px 25px 16px; border-bottom: 1px solid #e4e9e2; }
.recipe-modal-card .modal-header h3 { margin-bottom: 2px; }
.recipe-draft-status { min-height: 16px; color: #89988e; font-size: 11px; font-weight: 400; }
.recipe-form-body { container: recipe-body / inline-size; flex: 1 1 auto; min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 19px 25px 23px; scrollbar-color: #b6c7b9 transparent; }
.recipe-form-body > label, .recipe-form-body > .form-grid { min-width: 0; }
.recipe-form-body textarea { min-height: 88px; resize: vertical; }
.recipe-form-body .form-grid { min-width: 0; }
.recipe-modal-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 9px; min-height: 69px; margin: 0; padding: 13px 25px; border-top: 1px solid #e1e8e1; background: rgba(247, 250, 245, .96); }
.recipe-modal-actions > span { flex: 1 1 auto; min-width: 12px; }
.recipe-modal-actions button { white-space: nowrap; }
.modal-resize-handle { position: absolute; right: 7px; bottom: 7px; z-index: 3; width: 15px; height: 15px; border-right: 1px solid #92aa98; border-bottom: 1px solid #92aa98; opacity: .62; cursor: nwse-resize; transition: opacity .16s ease, border-color .16s ease; }
.modal-resize-handle::before, .modal-resize-handle::after { content: ""; position: absolute; right: 2px; bottom: 3px; width: 9px; border-top: 1px solid currentColor; transform: rotate(-45deg); transform-origin: right center; }
.modal-resize-handle::after { right: 0; bottom: 7px; width: 6px; }
.modal-resize-handle:hover, .modal-resize-handle.is-dragging { color: #46745a; border-color: #46745a; opacity: 1; }
@container recipe-body (max-width: 690px) {
  .recipe-form-body .form-grid { grid-template-columns: 1fr; }
}

/* Calendar: compact paper grid and a clear emotional hierarchy */
.calendar-stats { grid-template-columns: minmax(310px, .82fr) minmax(0, 1.18fr); gap: 18px; align-items: stretch; margin: 16px 0 18px; }
.calendar-memory-hero { position: relative; display: flex; flex-direction: column; min-height: 207px; overflow: hidden; padding: 19px 22px 17px; border: 1px solid #d6e1d7; border-radius: 7px; background: #f8fbf6; }
.calendar-memory-hero::after { content: ""; position: absolute; right: -34px; bottom: -50px; width: 170px; height: 170px; border: 1px solid rgba(153, 134, 87, .17); border-radius: 50%; box-shadow: 0 0 0 16px rgba(153, 134, 87, .035), 0 0 0 33px rgba(153, 134, 87, .025); pointer-events: none; }
.calendar-memory-hero-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 15px; color: #9b8b69; font: 10px "DM Mono", monospace; letter-spacing: .08em; }
.calendar-memory-hero-top span:last-child { color: #8b9a90; letter-spacing: .02em; }
.calendar-stat-label { color: #6f8376; font-size: 12px; letter-spacing: .13em; }
.calendar-relationship-count { position: relative; z-index: 1; display: flex; align-items: baseline; gap: 7px; margin-top: 3px; color: #315c48; font: 500 55px/.98 "DM Mono", monospace; letter-spacing: -.08em; }
.calendar-relationship-count small { color: #7a8e81; font: 13px "Source Han Sans SC", sans-serif; letter-spacing: 0; }
.calendar-memory-duration { position: relative; z-index: 1; margin: 9px 0 0; color: #536c5c; font: 15px "Noto Serif SC", serif; }
.calendar-memory-meta { display: flex; flex-wrap: wrap; gap: 5px 15px; margin-top: auto; color: #89988e; font-size: 10px; line-height: 1.5; }
.calendar-memory-progress { position: relative; z-index: 1; height: 2px; margin: 12px 0 8px; overflow: hidden; background: #dbe7dc; }
.calendar-memory-progress span { display: block; height: 100%; background: #8aaa91; transition: width .35s ease; }
.calendar-memory-copy { position: relative; z-index: 1; margin: 0; color: #9a8157; font-size: 11px; line-height: 1.6; }
.calendar-memory-list { display: grid; align-content: stretch; min-width: 0; border-top: 1px solid #dbe5dc; border-bottom: 1px solid #dbe5dc; }
.calendar-memory-item { display: grid; grid-template-columns: minmax(0, 1fr) 29px; gap: 12px; align-items: center; min-width: 0; padding: 10px 5px 10px 17px; border-bottom: 1px solid #e5ebe5; }
.calendar-memory-item:last-child { border-bottom: 0; }
.calendar-memory-item.is-featured { background: rgba(239, 247, 239, .62); }
.calendar-memory-item div { display: grid; min-width: 0; gap: 4px; }
.calendar-memory-item span { color: #89978e; font-size: 10px; letter-spacing: .08em; }
.calendar-memory-item strong { overflow: hidden; color: #456552; font: 600 16px/1.3 "Noto Serif SC", serif; text-overflow: ellipsis; white-space: nowrap; }
.calendar-memory-item small { overflow: hidden; color: #8c998f; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.calendar-memory-item em { color: #b59c68; font: 11px "DM Mono", monospace; font-style: normal; text-align: right; }
.calendar-toolbar { margin-bottom: 12px; }
.calendar-nav { gap: 6px; }
.calendar-nav strong { min-width: 112px; font-size: 16px; }
.calendar-nav .calendar-today-button { padding: 3px 4px; color: #7d8f83; font-size: 11px; }
.calendar-month-view { padding: 0; border: 0; background: transparent; }
.calendar-month-caption { margin: 0 2px 9px; }
.calendar-month-caption strong { font-size: 20px; }
.calendar-month-caption span, .calendar-month-caption small { font-size: 10px; }
.calendar-grid { gap: 1px; overflow: hidden; border: 0; border-radius: 5px; background: #e4ebe4; }
.calendar-cell { min-height: 91px; padding: 7px 7px 5px; border: 0; background: #fffefa; }
.calendar-cell:hover { background: #f7fbf5; box-shadow: inset 0 0 0 1px #b5cbb8; }
.calendar-cell.is-weekend { background: #fcfbf7; }
.calendar-cell.is-today { background: #fffef8; box-shadow: inset 0 0 0 1px #a08659, inset 0 0 0 3px rgba(160, 134, 89, .1); }
.calendar-cell.muted-day { min-height: 91px; background: #f8faf6; }
.calendar-date-button { gap: 5px; }
.calendar-date-button strong { color: #405d4d; font-size: 16px; font-weight: 500; }
.calendar-date-button small { color: #a18f69; font-size: 9px; }
.calendar-day-notes { min-height: 0; margin-top: 4px; }
.calendar-day-notes:empty { display: none; }
.calendar-day-note { font-size: 9px; }
.calendar-event-stack { gap: 2px; margin-top: 5px; }
.calendar-event { min-height: 19px; padding: 3px 4px; border-left-width: 2px; font-size: 9px; }
.calendar-event i { width: 4px; height: 4px; }
.calendar-more { padding: 1px 2px; border: 0; color: #a18758; background: transparent; font-size: 9px; text-align: left; cursor: pointer; }
.calendar-more:hover { color: #557861; }
.calendar-rest-badge { position: absolute; top: 6px; right: 6px; color: #a16f55; font: 9px "DM Mono", monospace; font-style: normal; }
.calendar-rest-badge.is-work { color: #8b8b72; }

@media (max-width: 980px) and (min-width: 721px) {
  .calendar-stats { grid-template-columns: minmax(270px, .78fr) minmax(0, 1.22fr); gap: 12px; }
  .calendar-memory-hero { padding-inline: 17px; }
  .calendar-memory-item { padding-left: 13px; }
  .calendar-cell { min-height: 82px; padding-inline: 5px; }
}

@media (max-width: 720px) {
  .recipe-dialog { inset: auto 0 0; width: 100%; max-width: 100%; height: min(94vh, 760px); max-height: 94dvh; margin: 0; border-radius: 14px 14px 0 0; }
  .recipe-modal-card { border-radius: 14px 14px 0 0; }
  .recipe-modal-card .modal-header { padding: 17px 18px 13px; }
  .recipe-form-body { padding: 16px 18px 19px; }
  .recipe-modal-actions { min-height: 63px; padding: 11px 18px; }
  .recipe-modal-actions .outline-button:first-child { margin-right: auto; }
  .modal-resize-handle { display: none; }
  .calendar-stats { grid-template-columns: 1fr; gap: 12px; margin-top: 13px; }
  .calendar-memory-hero { min-height: 185px; padding: 17px 18px 15px; }
  .calendar-relationship-count { font-size: 47px; }
  .calendar-memory-item { padding-block: 9px; }
  .calendar-toolbar { align-items: stretch; }
  .calendar-toolbar .segmented-control { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .calendar-toolbar .segment { flex: 0 0 auto; }
  .calendar-nav { width: 100%; justify-content: space-between; }
  .calendar-nav strong { flex: 1; min-width: 0; }
  .calendar-nav .calendar-today-button { margin-inline: auto; }
  .calendar-month-caption small { display: none; }
  .calendar-cell, .calendar-cell.muted-day { min-height: 72px; padding: 5px 4px 4px; }
  .calendar-date-button { display: grid; gap: 1px; }
  .calendar-date-button strong { font-size: 14px; }
  .calendar-date-button small { font-size: 8px; }
  .calendar-day-note { font-size: 8px; }
  .calendar-event { min-height: 16px; padding: 2px; font-size: 8px; }
  .calendar-event i { width: 3px; height: 3px; }
  .calendar-rest-badge { top: 4px; right: 4px; font-size: 8px; }
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--ink); background: var(--paper); font-family: "Source Han Sans SC", "Microsoft YaHei", sans-serif; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 254px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 30px 18px 22px; border-right: 1px solid var(--line); background: #fbfbf8; }
.brand-lockup { display: flex; align-items: center; gap: 12px; padding: 0 8px 33px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--green); border-radius: 50%; color: var(--green); font: 500 12px "DM Mono", monospace; letter-spacing: 0; }
.eyebrow { margin: 0 0 5px; color: var(--green); font: 500 10px "DM Mono", monospace; letter-spacing: 0.08em; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 0; font: 600 17px/1.25 "Noto Serif SC", serif; letter-spacing: 0; }
h2 { margin-bottom: 0; font: 600 28px/1.25 "Noto Serif SC", serif; letter-spacing: 0; }
h3 { margin-bottom: 0; font: 600 27px/1.28 "Noto Serif SC", serif; letter-spacing: 0; }
h4 { margin-bottom: 8px; font: 600 20px/1.3 "Noto Serif SC", serif; letter-spacing: 0; }
.side-nav { display: grid; gap: 5px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 13px; padding: 11px 12px; border: 0; border-radius: 6px; color: #4e5955; background: transparent; text-align: left; font-size: 14px; transition: background .18s ease, color .18s ease; }
.nav-item:hover, .nav-item.active { background: #e6f0eb; color: var(--green-dark); }
.nav-icon { width: 18px; text-align: center; font-size: 20px; line-height: 1; }
.sidebar-bottom { margin-top: auto; }
.shared-status { display: flex; gap: 8px; align-items: center; margin: 18px 12px 0; color: var(--muted); font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px #e0eee7; }

.main-content { min-width: 0; padding: 30px 38px 50px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; max-width: 1480px; margin: 0 auto 26px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.topbar-context[hidden] { display: none; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: #3b4542; background: var(--surface); font-size: 21px; line-height: 1; }
.icon-button:hover { color: var(--green); border-color: var(--green); }
.primary-button, .outline-button, .text-button { border-radius: 5px; font-weight: 600; }
.primary-button { min-height: 39px; padding: 9px 14px; border: 1px solid var(--green); color: #fff; background: var(--green); box-shadow: 0 4px 9px rgba(31, 118, 99, .17); }
.primary-button:hover { background: var(--green-dark); }
.primary-button span { margin-right: 3px; font-size: 18px; line-height: 0; }
.outline-button { min-height: 37px; padding: 8px 13px; border: 1px solid #c9d1cc; color: #39433f; background: #fff; }
.outline-button:hover { color: var(--green); border-color: var(--green); }
.restore-button { margin-right: auto; color: #8b3d35; border-color: #d8b5ae; }
.restore-button:hover { color: #fff; border-color: #9b4b42; background: #9b4b42; }
.text-button { padding: 0; border: 0; color: var(--green); background: transparent; }
.text-button:hover { color: var(--green-dark); text-decoration: underline; }

.view { display: none; max-width: 1480px; margin: 0 auto; }
.view.active { display: block; }
.map-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 13px; }.map-toolbar-controls { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.segmented-control { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: #eef0ec; }
.segment { min-height: 30px; padding: 5px 13px; border: 0; border-radius: 4px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 600; }
.segment.active { color: var(--ink); background: white; box-shadow: 0 1px 3px rgba(24, 38, 34, .12); }
.map-stat { display: flex; gap: 7px; align-items: baseline; color: var(--muted); font-size: 12px; }
.map-stat strong { color: var(--green); font: 500 21px "DM Mono", monospace; }
.map-stage { position: relative; height: min(68vh, 700px); min-height: 500px; overflow: hidden; border: 1px solid #d9e1db; border-radius: 7px; background: #e9f0ea; box-shadow: var(--shadow); isolation: isolate; }.leaflet-map { width: 100%; height: 100%; background: #e6ece8; }.leaflet-container { font-family: "Source Han Sans SC", sans-serif; }.leaflet-control-attribution { font-size: 10px !important; }.leaflet-control-zoom a { color: #33453b !important; }.memory-map-marker { position: relative; display: block; width: 22px; height: 22px; border: 3px solid #fff; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 5px rgba(232,121,94,.24), 0 5px 12px rgba(91,49,40,.3); }.memory-map-marker.showcase { background: var(--green); box-shadow: 0 0 0 5px rgba(31,118,99,.24), 0 5px 12px rgba(29,76,64,.3); }.memory-map-marker::after { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(255,255,255,.9); border-radius: 50%; }.map-photo-preview-icon { overflow: visible !important; }.map-photo-preview { display: block; width: var(--preview-size); height: var(--preview-size); overflow: hidden; border: 2px solid rgba(255,255,255,.96); border-radius: 5px; background: #d8e1da; box-shadow: 0 6px 14px rgba(22,41,33,.26); transform: translate(var(--preview-x), var(--preview-y)); transition: transform .18s ease, box-shadow .18s ease; }.map-photo-preview:hover { transform: translate(var(--preview-x), var(--preview-y)) scale(1.08); box-shadow: 0 10px 22px rgba(22,41,33,.35); }.map-photo-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }.province-label-icon { overflow: visible !important; }.province-label { display: block; width: max-content; padding: 2px 4px; color: #115847; background: rgba(255,255,252,.68); font-size: 11px; font-weight: 600; line-height: 1.2; text-shadow: 0 1px 1px rgba(255,255,255,.95); transform: translate(-50%, -50%); }.map-caption { position: absolute; z-index: 450; bottom: 26px; left: 29px; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid rgba(106,132,119,.2); border-radius: 4px; color: #587066; background: rgba(255,255,252,.86); font: 11px "DM Mono", monospace; letter-spacing: 0; pointer-events: none; }
.caption-line { width: 23px; height: 1px; background: currentColor; }
.map-empty { position: absolute; z-index: 3; top: 50%; left: 50%; display: none; min-width: 260px; padding: 20px; border: 1px solid rgba(31, 118, 99, .18); border-radius: 6px; background: rgba(255,255,253,.93); text-align: center; transform: translate(-50%, -50%); box-shadow: var(--shadow); }
.map-empty p { margin-bottom: 10px; color: #4d5c56; }

.gallery-heading, .profiles-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 18px; }
.gallery-organizer { display: flex; align-items: center; gap: 10px; margin: 0 0 24px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.organizer-label { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.gallery-order-button { margin-left: auto; min-width: 84px; }
.gallery-collection-layout { --gallery-nav-width: 184px; display: grid; grid-template-columns: var(--gallery-nav-width) minmax(0, 1fr); gap: 24px; align-items: start; }
.gallery-group-nav { position: sticky; top: 20px; display: grid; gap: 3px; min-width: 0; padding: 12px 13px 12px 10px; border-right: 1px solid #dbe3dc; }
.gallery-group-nav[hidden] { display: none; }
.gallery-group-nav p { margin: 0 0 6px; color: var(--green); font: 500 10px "DM Mono", monospace; letter-spacing: 0; }
.gallery-group-nav button { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; width: 100%; padding: 7px 6px; overflow: hidden; border: 0; border-left: 2px solid transparent; color: #52645b; background: transparent; font: 500 12px/1.35 "Source Han Sans SC", sans-serif; text-align: left; white-space: nowrap; text-overflow: ellipsis; }
.gallery-group-nav button:hover, .gallery-group-nav button:focus-visible { border-left-color: var(--green); color: var(--green-dark); background: #f1f7f2; }
.gallery-group-nav button span { flex: 0 0 auto; color: #84918a; font: 10px "DM Mono", monospace; }
.gallery-nav-resizer { position: absolute; top: 5px; right: -7px; bottom: 5px; width: 13px; border-radius: 4px; cursor: col-resize; touch-action: none; }
.gallery-nav-resizer::after { content: ""; position: absolute; top: 12px; right: 6px; bottom: 12px; width: 2px; border-radius: 999px; background: transparent; }
.gallery-group-nav:hover .gallery-nav-resizer::after, .gallery-nav-resizer:hover::after, .gallery-nav-resizer:focus-visible::after, .resizing-gallery-nav .gallery-nav-resizer::after { background: #1f7663; }
.resizing-gallery-nav { cursor: col-resize; user-select: none; }
#photo-grid { display: grid; gap: 31px; min-width: 0; }
.photo-group { scroll-margin-top: 18px; display: grid; gap: 13px; }
.photo-group-heading { display: flex; align-items: baseline; gap: 9px; padding-bottom: 9px; border-bottom: 1px solid #dfe5df; }
.photo-group-heading h4 { margin: 0; color: #284438; font: 600 18px/1.3 "Noto Serif SC", serif; }
.photo-group-heading span { color: #7b8981; font: 11px "DM Mono", monospace; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.photo-card { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: 0 3px 9px rgba(33, 52, 45, .05); content-visibility: auto; contain-intrinsic-size: 330px; }
.photo-thumb { position: relative; width: 100%; aspect-ratio: 4 / 3; display: block; overflow: hidden; padding: 0; border: 0; background: #dae4dd; text-align: left; }
.photo-thumb:hover img, .photo-thumb:focus-visible img { transform: scale(1.025); }
.photo-thumb img, .photo-thumb video { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb video.lazy-live-thumb { background: #d8e2db; }
.photo-thumb img { transition: transform .2s ease; }
.showcase-toggle { position: absolute; z-index: 2; top: 8px; left: 8px; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(255,255,255,.72); border-radius: 50%; color: rgba(255,255,255,.82); background: rgba(29,52,45,.52); box-shadow: 0 4px 12px rgba(14,33,25,.16); font-size: 17px; line-height: 1; cursor: pointer; }
.showcase-toggle:hover, .showcase-toggle:focus-visible { color: #fff; background: rgba(31,118,99,.88); }
.showcase-toggle.active { color: #fff5c2; background: rgba(31,118,99,.94); }
.gallery-load-more { justify-self: start; margin-top: 2px; }
.photo-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: #6a8779; background: linear-gradient(135deg, #ceddd1, #e8e4d4); font: 600 24px "Noto Serif SC", serif; }
.live-badge { position: absolute; top: 8px; right: 8px; padding: 4px 6px; border-radius: 3px; color: white; background: rgba(29, 52, 45, .76); font: 500 10px "DM Mono", monospace; }
.photo-meta { padding: 11px 12px 13px; }
.photo-meta h4 { min-height: 39px; margin: 0 0 5px; color: #293c34; font: 600 15px/1.32 "Noto Serif SC", serif; overflow-wrap: anywhere; }
.photo-meta p { margin: 0; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.55; }
.photo-meta .photo-time { margin-bottom: 4px; color: #52665d; font: 500 11px/1.4 "DM Mono", monospace; }
.photo-meta .photo-note { min-height: 36px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.photo-facts { display: flex; gap: 7px; margin-top: 9px; color: #718079; font: 10px "DM Mono", monospace; }
.gallery-actions { display: flex; gap: 8px; align-items: center; }
.batch-panel { display: grid; gap: 15px; margin: 0 0 18px; padding: 16px; border: 1px solid #b8d2c1; border-radius: 6px; background: #f4faf5; }
.batch-panel[hidden] { display: none; }
.batch-panel-head, .batch-selection-actions, .batch-footer { display: flex; align-items: center; justify-content: space-between; gap: 13px; }.batch-panel-head p { margin: 0 0 3px; }.batch-panel-head strong { font-size: 15px; }.batch-selection-actions { gap: 14px; font-size: 12px; }
.batch-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }.batch-edit-field { gap: 6px; font-size: 12px; }.batch-edit-field > span { display: flex; gap: 7px; align-items: center; color: #3e5147; }.batch-edit-field input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--green); }.batch-edit-field select { width: 100%; height: 39px; padding: 8px 10px; border: 1px solid #ccd5cf; border-radius: 5px; color: var(--ink); background: #fff; }.batch-edit-field input:disabled, .batch-edit-field textarea:disabled { color: #97a39b; background: #eef2ef; }.batch-note-field { grid-column: 1 / -1; }.batch-note-field textarea { min-height: 76px; }.batch-footer { align-items: end; }.batch-footer p { max-width: 340px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.photo-card { position: relative; }.photo-card.selected { outline: 2px solid var(--green); outline-offset: 2px; }.photo-select { position: absolute; z-index: 2; top: 8px; left: 8px; display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid #a6bbb0; border-radius: 4px; background: rgba(255,255,255,.94); }.photo-select input { width: 16px; height: 16px; accent-color: var(--green); }
.empty-library { display: none; min-height: 350px; align-content: center; justify-items: center; border: 1px dashed #c7d3ca; border-radius: 6px; color: var(--muted); text-align: center; }
.empty-library.visible { display: grid; }
.empty-library h3 { margin: 9px 0 5px; font-size: 21px; }
.empty-library p { max-width: 300px; margin: 0 0 17px; font-size: 13px; line-height: 1.7; }
.empty-symbol { color: var(--green); font-size: 35px; }

.diary-layout { display: grid; grid-template-columns: minmax(270px, .75fr) minmax(0, 1.25fr); gap: 45px; padding-top: 10px; }
.diary-intro { padding: 30px 0 0 6px; }
.diary-intro > p:not(.eyebrow) { max-width: 270px; margin: 15px 0 23px; color: var(--muted); line-height: 1.8; }
.diary-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.diary-list { display: grid; gap: 11px; }
.diary-entry { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 17px; padding: 20px; border-top: 1px solid var(--line); background: transparent; }
.diary-entry:last-child { border-bottom: 1px solid var(--line); }
.diary-date { color: var(--green); font: 500 12px/1.5 "DM Mono", monospace; }
.diary-entry-head { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.diary-delete-button { flex: 0 0 auto; color: #8b4a42; font-size: 12px; }
.diary-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; color: #6d7e75; font-size: 12px; }
.diary-meta span::before { content: "发布于 "; color: #91a099; }
.diary-entry h4 { margin-bottom: 5px; font-size: 17px; }
.diary-entry p { margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.diary-empty { min-height: 240px; display: grid; place-items: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }

.profiles-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 330px)); gap: 17px; }
.profile-card { min-height: 285px; padding: 27px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.profile-orbit { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 28px; border-radius: 50%; color: #fff; font: 600 23px "Noto Serif SC", serif; }
.profile-orbit.zhao { background: var(--rose); box-shadow: 13px 11px 0 rgba(216, 121, 131, .16); }
.profile-orbit.xu { background: var(--blue); box-shadow: 13px 11px 0 rgba(102, 152, 171, .16); }
.profile-label { margin-bottom: 4px; color: var(--green); font: 500 11px "DM Mono", monospace; }
.profile-note { min-height: 42px; margin-bottom: 16px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.vault-panel { max-width: 680px; min-height: 360px; display: grid; justify-items: center; align-content: center; margin: 5vh auto 0; padding: 35px; border: 1px solid var(--line); border-radius: 7px; background: #f7fbf7; text-align: center; }
.vault-lock { width: 55px; height: 55px; display: grid; place-items: center; margin-bottom: 22px; border: 1px solid #abd0c0; border-radius: 50%; color: var(--green); font-size: 29px; }
.vault-panel > p:not(.eyebrow) { max-width: 430px; margin: 13px 0 22px; color: var(--muted); font-size: 13px; line-height: 1.8; }

.settings-layout { display: grid; grid-template-columns: minmax(230px, .65fr) minmax(330px, 1fr); gap: 40px; max-width: 900px; padding-top: 8px; }
.settings-copy { margin: 13px 0 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.settings-form { display: grid; gap: 15px; }
label { display: grid; gap: 7px; color: #4b5651; font-size: 13px; font-weight: 600; }
input, textarea { width: 100%; border: 1px solid #ccd5cf; border-radius: 5px; color: var(--ink); background: #fff; outline: none; }
input { height: 39px; padding: 8px 10px; }
textarea { min-height: 105px; padding: 10px; resize: vertical; line-height: 1.6; }
input:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31,118,99,.11); }
.connection-card { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid #d7e0d9; border-radius: 6px; background: #fbfcfa; }
.connection-indicator { width: 9px; height: 9px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 4px #f5ecd4; }
.connection-card strong, .connection-card small { display: block; }
.connection-card strong { font-size: 14px; }
.connection-card small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.connection-card .outline-button { margin-left: auto; }
.sync-note { margin: -7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.sharing-row { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 24px; border-top: 1px solid var(--line); }
.storage-status-card { grid-column: 1 / -1; margin-top: 4px; padding: 18px 20px; border: 1px solid rgba(44,72,58,.16); border-radius: 10px; background: #f8f6ed; box-shadow: 0 8px 24px rgba(34,51,43,.05); }
.storage-status-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.storage-status-heading h4 { margin: 3px 0 0; color: var(--ink); font-size: 16px; }
.storage-status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.storage-status-item { display: grid; gap: 4px; min-width: 0; padding: 11px 12px; border-left: 2px solid #c3d4c7; background: rgba(255,255,255,.54); }
.storage-status-item span, .storage-status-item small { color: var(--muted); font-size: 11px; }
.storage-status-item strong { color: var(--green-dark, #2d5b47); font-size: 15px; font-weight: 650; }
.sharing-row strong { font-size: 14px; }.sharing-row p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.switch { display: block; width: 44px; height: 25px; }.switch input { display: none; }.switch span { display: block; position: relative; width: 44px; height: 25px; border-radius: 999px; background: #cbd4ce; cursor: pointer; }.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: transform .18s ease; }.switch input:checked + span { background: var(--green); }.switch input:checked + span::after { transform: translateX(19px); }

.modal { width: min(600px, calc(100vw - 32px)); max-height: min(760px, calc(100vh - 32px)); padding: 0; overflow: auto; border: 0; background: transparent; }.modal::backdrop { background: rgba(27, 40, 35, .42); backdrop-filter: blur(2px); }.modal-card { display: grid; gap: 16px; padding: 24px; border: 0; border-radius: 7px; background: #fbfcf9; box-shadow: 0 22px 55px rgba(12, 30, 23, .22); }.modal-header { display: flex; justify-content: space-between; align-items: start; gap: 14px; }.modal-header h3 { font-size: 24px; }.modal-header .icon-button { width: 33px; height: 33px; background: transparent; }.dropzone { min-height: 138px; display: grid; justify-items: center; align-content: center; gap: 5px; padding: 16px; border: 1px dashed #9fc6b1; border-radius: 6px; color: #385f4e; background: #f2f8f3; text-align: center; cursor: pointer; }.dropzone input { display: none; }.dropzone-plus { font-size: 27px; }.dropzone small { color: var(--muted); font-size: 11px; font-weight: 400; }.selected-files { display: grid; gap: 7px; }.file-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 9px; border: 1px solid #e0e5e0; border-radius: 4px; background: white; color: #4d5e56; font-size: 11px; }.file-line em { color: var(--green); font-style: normal; text-align: right; }.form-hint { margin: -4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }.checkbox-line { display: flex; align-items: center; gap: 8px; font-size: 12px; }.checkbox-line input { width: 16px; height: 16px; accent-color: var(--green); }.modal-actions { display: flex; justify-content: end; gap: 9px; padding-top: 2px; }.detail-card { width: min(940px, calc(100vw - 32px)); min-height: 250px; }.detail-summary { display: grid; grid-template-columns: 1fr auto; gap: 15px; padding: 15px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }.detail-summary p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }.detail-count { color: var(--green); font: 500 23px "DM Mono", monospace; }.detail-card .photo-grid { margin-top: 15px; }.photo-detail-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(240px, .65fr); gap: 18px; align-items: start; }.photo-viewer { display: grid; min-height: 280px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #edf1ed; place-items: center; }.photo-viewer img, .photo-viewer video { display: block; width: 100%; max-height: min(58vh, 580px); object-fit: contain; background: #17211d; }.photo-viewer img { background: #edf1ed; }.photo-inspector { padding: 2px 0; }.photo-file-title { display: grid; gap: 4px; padding-bottom: 14px; border-bottom: 1px solid var(--line); word-break: break-word; }.photo-file-title strong { font-size: 14px; }.photo-file-title span { color: var(--green); font-size: 11px; }.raw-file-link { width: fit-content; margin-top: 4px; padding: 6px 8px; border: 1px solid #b9cec1; border-radius: 4px; color: var(--green-dark); background: #f6fbf7; font-size: 11px; text-decoration: none; }.raw-file-link:hover { background: #eaf4ed; }.photo-facts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; }.photo-facts-grid div { min-height: 73px; padding: 13px 8px 10px 0; border-bottom: 1px solid var(--line); }.photo-facts-grid dt { margin-bottom: 5px; color: var(--muted); font-size: 10px; }.photo-facts-grid dd { margin: 0; font: 500 11px/1.55 "DM Mono", monospace; overflow-wrap: anywhere; }.photo-facts-grid small { color: var(--muted); font-size: 10px; }.live-motion { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; align-items: center; padding: 15px; border: 1px solid #bcd4c5; border-radius: 6px; background: #f1f8f3; }.live-motion p { margin-bottom: 4px; }.live-motion strong { font-size: 15px; }.live-motion video { width: 100%; max-height: 180px; border-radius: 4px; background: #17211d; }.live-file-note { margin: 0; padding: 12px; border: 1px solid #e2d9bd; border-radius: 5px; color: #74613a; background: #fff9e9; font-size: 12px; line-height: 1.6; }.photo-edit-form { display: grid; gap: 14px; padding-top: 4px; border-top: 1px solid var(--line); }.edit-heading { display: grid; gap: 2px; padding-top: 3px; }.edit-heading p { margin: 0; }
#detail-dialog { width: min(1280px, calc(100vw - 40px)); height: min(82vh, 900px); min-width: 640px; min-height: 390px; max-height: calc(100vh - 32px); resize: both; overflow: auto; }.detail-card { width: 100%; min-height: 100%; box-sizing: border-box; }.detail-card .photo-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }.detail-card .modal-header { position: sticky; z-index: 1; top: 0; padding-bottom: 10px; background: #fbfcf9; }.detail-card #close-detail { flex: 0 0 auto; border-color: #8fb4a1; color: #216b58; background: #f4faf5; box-shadow: 0 2px 5px rgba(31,118,99,.12); }.detail-card #close-detail:hover { color: #fff; background: var(--green); }
.modal-header .icon-button { position: relative; flex: 0 0 auto; width: 36px; height: 36px; border: 1px solid #d9e3dc; color: transparent; background: rgba(255,255,252,.86); font-size: 0; box-shadow: 0 4px 12px rgba(24,49,39,.08); transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.modal-header .icon-button::before, .modal-header .icon-button::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 1.6px; border-radius: 999px; background: #2d735f; transform-origin: center; }
.modal-header .icon-button::before { transform: translate(-50%, -50%) rotate(45deg); }
.modal-header .icon-button::after { transform: translate(-50%, -50%) rotate(-45deg); }
.modal-header .icon-button:hover, .modal-header .icon-button:focus-visible { border-color: #93b9a7; background: #edf7f0; box-shadow: 0 7px 17px rgba(31,118,99,.15); transform: translateY(-1px); }
.modal-header .icon-button:hover::before, .modal-header .icon-button:hover::after, .modal-header .icon-button:focus-visible::before, .modal-header .icon-button:focus-visible::after { background: var(--green-dark); }
.detail-card #close-detail { border-color: #d9e3dc; color: transparent; background: rgba(255,255,252,.86); box-shadow: 0 4px 12px rgba(24,49,39,.08); }
.detail-card #close-detail:hover, .detail-card #close-detail:focus-visible { color: transparent; border-color: #93b9a7; background: #edf7f0; box-shadow: 0 7px 17px rgba(31,118,99,.15); }
.photo-viewer { position: relative; }
.photo-nav-button { position: absolute; z-index: 2; top: 50%; display: grid; place-items: center; width: 38px; height: 54px; border: 1px solid rgba(255,255,255,.55); border-radius: 4px; color: #fff; background: rgba(28,49,42,.62); font: 500 31px/1 "Noto Serif SC", serif; transform: translateY(-50%); cursor: pointer; }
.photo-nav-button:hover, .photo-nav-button:focus-visible { background: rgba(31,118,99,.86); }
.photo-nav-button.prev { left: 10px; }
.photo-nav-button.next { right: 10px; }
.live-cover-button { justify-self: start; margin-top: -8px; }
.readonly-note { display: grid; gap: 5px; margin-top: 14px; padding: 13px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.readonly-note p { margin: 0; color: #4f5d55; font-size: 13px; line-height: 1.7; }
.photo-readonly-actions { margin-top: 13px; }
.photo-image-editor { display: grid; gap: 12px; padding: 13px; border: 1px solid #d7e0d9; border-radius: 6px; background: #fff; }
#photo-edit-canvas { width: 100%; max-height: 360px; border: 1px solid var(--line); border-radius: 5px; background: #17211d; object-fit: contain; }
.image-edit-toolbar, .coordinate-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.crop-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.crop-grid label { gap: 5px; font-size: 11px; }
.crop-grid input[type="range"] { height: 24px; padding: 0; accent-color: var(--green); }
#coordinate-lookup-status { color: var(--muted); font-size: 11px; line-height: 1.5; }
.toast { position: fixed; z-index: 10; bottom: 28px; left: 50%; display: none; max-width: calc(100vw - 40px); padding: 10px 14px; border-radius: 5px; color: #fff; background: #233c32; box-shadow: 0 8px 23px rgba(19,38,31,.2); font-size: 13px; transform: translateX(-50%); }.toast.visible { display: block; }
.mobile-nav { display: none; }

@media (max-width: 850px) {
  .app-shell { display: block; }.sidebar { display: none; }.main-content { padding: 24px 22px 92px; }.topbar { margin-bottom: 20px; }.map-stage { min-height: 460px; height: calc(100vh - 210px); }.diary-layout, .settings-layout { grid-template-columns: 1fr; gap: 25px; }.diary-intro { padding-top: 0; }.mobile-nav { position: fixed; z-index: 5; right: 0; bottom: 0; left: 0; height: 66px; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; padding: 5px 9px; border-top: 1px solid var(--line); background: rgba(251,252,249,.96); backdrop-filter: blur(12px); }.mobile-nav-item { display: grid; justify-items: center; gap: 3px; padding: 4px; border: 0; color: #718078; background: transparent; }.mobile-nav-item span { font-size: 20px; line-height: 1; }.mobile-nav-item small { font-size: 10px; }.mobile-nav-item.active { color: var(--green); }.mobile-upload { width: 43px; height: 43px; justify-self: center; border: 0; border-radius: 50%; color: white; background: var(--green); box-shadow: 0 5px 13px rgba(31,118,99,.28); font-size: 25px; }.sharing-row { grid-column: auto; }.storage-status-card { grid-column: auto; }.storage-status-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .main-content { padding: 18px 14px 86px; }.topbar { align-items: end; }.topbar h2 { font-size: 23px; }.topbar-actions .icon-button, #share-button { display: none; }.primary-button { min-height: 37px; padding: 8px 10px; font-size: 12px; }.map-stage { min-height: 420px; height: calc(100vh - 190px); }.china-shape { width: 115%; max-height: 78%; }.map-caption { bottom: 14px; left: 15px; font-size: 10px; }.map-grid { background-size: 36px 36px; }.map-toolbar { margin-bottom: 9px; }.profiles-grid { grid-template-columns: 1fr; }.profile-card { min-height: 240px; }.gallery-heading { align-items: start; flex-direction: column; }.gallery-actions { width: 100%; justify-content: space-between; }.gallery-organizer { flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }.gallery-organizer .segmented-control { order: 3; width: 100%; }.gallery-organizer .segment { flex: 1; padding-right: 7px; padding-left: 7px; }.gallery-order-button { margin-left: auto; }.batch-edit-grid { grid-template-columns: 1fr; }.batch-note-field { grid-column: auto; }.batch-footer { align-items: stretch; flex-direction: column; }.batch-footer .modal-actions { width: 100%; justify-content: space-between; }.photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }.photo-meta { padding: 9px; }.photo-meta h4 { font-size: 13px; }.photo-meta p { font-size: 11px; }.photo-facts { font-size: 9px; gap: 3px; }.diary-entry { grid-template-columns: 1fr; gap: 8px; padding: 16px 4px; }.modal-card { padding: 19px; }.form-grid, .photo-detail-layout, .live-motion { grid-template-columns: 1fr; }.photo-viewer { min-height: 220px; }.photo-facts-grid { grid-template-columns: 1fr 1fr; }.connection-card { flex-wrap: wrap; }.connection-card .outline-button { margin-left: auto; }.vault-panel { min-height: 330px; margin-top: 2vh; padding: 24px; }
  .crop-grid { grid-template-columns: 1fr; }
}

/* Independent original-file upload queue.  Previews stay in the existing
   gallery styling; this compact status area only appears while a batch is
   being prepared or retried. */
.archive-upload-queue { display: grid; gap: 9px; margin: 2px 0 4px; padding: 11px 12px; border: 1px solid #d8e5dc; border-radius: 7px; background: #f7faf6; }
.archive-upload-queue-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.archive-upload-queue-head > div:first-child { display: grid; gap: 2px; }
.archive-upload-queue-head strong { color: #315b48; font-size: 12px; }
.archive-upload-queue-head small { color: #7b8c81; font-size: 11px; }
.archive-upload-queue-actions { display: flex; gap: 8px; }
.archive-upload-queue-actions .text-button { padding: 3px 0; color: #386d58; font-size: 11px; }
.archive-upload-row { display: grid; gap: 5px; padding: 8px 0; border-top: 1px solid #e3ebe3; }
.archive-upload-row-head, .archive-upload-row-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.archive-upload-row-head strong { min-width: 0; overflow: hidden; color: #31483d; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.archive-upload-row-head span, .archive-upload-row-foot span { color: #718479; font: 10px "DM Mono", monospace; white-space: nowrap; }
.archive-upload-row-foot small { min-width: 0; overflow: hidden; color: #87958b; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.archive-upload-row-foot .text-button { flex: 0 0 auto; padding: 0; color: #a45e46; font-size: 10px; }
.archive-upload-progress { height: 4px; overflow: hidden; border-radius: 999px; background: #e4ebe5; }
.archive-upload-progress i { display: block; height: 100%; border-radius: inherit; background: #c18a42; transition: width .18s ease; }
.archive-upload-row.success .archive-upload-progress i { background: #5d8f72; }
.archive-upload-row.failed .archive-upload-progress i { background: #b66a55; }
.archive-upload-row.paused .archive-upload-progress i { background: #8b9b91; }
@media (max-width: 560px) {
  .archive-upload-queue-head { align-items: flex-start; flex-direction: column; }
  .archive-upload-queue-actions { width: 100%; justify-content: space-between; }
}

/* Locked diary publication stamp */
.diary-publish-row { display: grid; grid-template-columns: minmax(190px, .42fr) minmax(0, 1fr); gap: 13px; align-items: end; }
.diary-published-display { min-height: 40px; padding: 11px 2px 8px; color: #88968e; border-bottom: 1px solid #dce5dd; font: 12px "DM Mono", monospace; }
.diary-published-display.is-published { color: #557865; border-bottom-color: #a9c6b2; }
.diary-card.text-only { display: block; }
.diary-card.text-only .diary-card-body { padding: 18px 21px 16px; }

/* Couple calendar — memory archive, not an office schedule */
#calendar-view { max-width: 1280px; }
.calendar-heading { align-items: end; }
.calendar-heading-actions { display: flex; align-items: center; gap: 8px; }
.calendar-memory-hero { display: flex; flex-direction: column; justify-content: center; min-height: 142px; padding: 22px 25px; border: 1px solid #d3e0d5; border-radius: 7px; background: #f8fbf6; }
.calendar-stat-label, .calendar-memory-notes article > span { color: #88978d; font-size: 11px; letter-spacing: .08em; }
.calendar-relationship-count { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; color: #355e49; font: 500 48px/1 "DM Mono", monospace; letter-spacing: -.05em; }
.calendar-relationship-count small { color: #788b7e; font: 13px "Source Han Sans SC", sans-serif; letter-spacing: 0; }
.calendar-memory-hero p { margin: 9px 0 0; color: #6c7d72; font: 14px "Noto Serif SC", serif; }
.calendar-memory-hero .text-button { align-self: start; margin-top: 9px; padding: 0; }
.calendar-stat-note { margin-top: 9px; color: #a08c60; font-size: 11px; }
.calendar-stats { display: grid; grid-template-columns: minmax(250px, .9fr) minmax(0, 1.7fr); gap: 12px; margin: 20px 0 17px; }
.calendar-memory-notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid #dbe5dc; border-bottom: 1px solid #dbe5dc; }
.calendar-memory-notes article { display: grid; align-content: center; min-height: 106px; padding: 14px 17px; border-left: 1px solid #dbe5dc; }
.calendar-memory-notes article:first-child { border-left: 0; }
.calendar-memory-notes strong { margin-top: 8px; overflow: hidden; color: #4b6858; font: 600 17px "Noto Serif SC", serif; text-overflow: ellipsis; white-space: nowrap; }
.calendar-memory-notes small { margin-top: 5px; color: #8a978f; font-size: 11px; line-height: 1.5; }
.calendar-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 13px; }
.calendar-toolbar .segmented-control { flex-wrap: wrap; }
.calendar-nav { display: flex; align-items: center; gap: 10px; color: #496455; }
.calendar-nav strong { min-width: 120px; color: #466456; font: 600 17px "Noto Serif SC", serif; text-align: center; }
.calendar-nav .outline-button { min-width: 31px; padding: 4px 8px; }
.calendar-month-view, .calendar-year-overview, .calendar-list, .calendar-countdown-list, .calendar-timeline { min-width: 0; }
.calendar-month-caption { display: flex; justify-content: space-between; align-items: end; gap: 15px; margin: 0 2px 11px; }
.calendar-month-caption > div { display: grid; gap: 3px; }
.calendar-month-caption strong { color: #365b48; font: 600 22px "Noto Serif SC", serif; }
.calendar-month-caption span, .calendar-month-caption small { color: #8a978f; font-size: 11px; }
.calendar-month-caption small { max-width: 47%; text-align: right; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { padding: 0 1px 6px; color: #8d9c92; font: 10px "DM Mono", monospace; text-align: center; }
.calendar-grid { overflow: hidden; border-top: 1px solid #dce6de; border-left: 1px solid #dce6de; border-radius: 5px; background: #fffefa; }
.calendar-cell { position: relative; min-width: 0; min-height: 118px; padding: 8px 8px 6px; border-right: 1px solid #dce6de; border-bottom: 1px solid #dce6de; background: rgba(255,254,250,.88); transition: background .2s ease, box-shadow .2s ease; }
.calendar-cell:hover { z-index: 1; background: #f7fbf5; box-shadow: inset 0 0 0 1px #a9c7b1; }
.calendar-cell.is-weekend { background: #fcfbf6; }
.calendar-cell.is-today { background: #f0f8f0; box-shadow: inset 0 0 0 1px #8cb39a; }
.calendar-cell.muted-day { min-height: 118px; background: #fafbf7; }
.calendar-date-button { display: flex; align-items: baseline; gap: 7px; width: 100%; padding: 0; border: 0; color: #65796c; background: transparent; text-align: left; cursor: pointer; }
.calendar-date-button strong { color: #3f5c4b; font: 600 19px "DM Mono", monospace; }
.calendar-date-button small { overflow: hidden; color: #a18e65; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.calendar-date-button:hover strong { color: #2f6a4d; }
.calendar-day-notes { display: flex; gap: 5px; min-height: 18px; margin-top: 5px; overflow: hidden; white-space: nowrap; }
.calendar-day-note { overflow: hidden; color: #a08048; font-size: 10px; text-overflow: ellipsis; }
.calendar-day-note.note-holiday, .calendar-day-note.note-festival, .calendar-day-note.note-couple-festival { color: #a46f50; }
.calendar-event-stack { display: grid; gap: 3px; margin-top: 3px; }
.calendar-event { display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0; padding: 4px 5px; overflow: hidden; border: 0; border-left: 2px solid #78a48a; border-radius: 2px; color: #526b5b; background: #edf5ec; font-size: 10px; text-align: left; cursor: pointer; transition: background .18s ease, border-color .18s ease; }
.calendar-event i { flex: 0 0 auto; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .7; }
.calendar-event span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event:hover { border-left-color: #3e7454; background: #e0efe2; }
.calendar-event.event-birthday { border-left-color: #a68d5e; background: #faf4e6; }
.calendar-event.event-travel { border-left-color: #7699a1; background: #edf5f5; }
.calendar-event.event-date { border-left-color: #9f7d83; background: #f7eff0; }
.calendar-event.is-system { color: #967847; border-left-color: #c9b375; background: transparent; }
.calendar-event.is-system.event-workday { color: #8f7565; border-left-color: #b89583; }
.calendar-more { padding: 3px 5px; border: 0; color: #87968c; background: transparent; font-size: 10px; text-align: left; cursor: pointer; }
.calendar-more:hover { color: #486a56; }
.calendar-rest-badge { position: absolute; top: 7px; right: 7px; padding: 1px 3px; color: #a76e55; font: 10px "DM Mono", monospace; font-style: normal; }
.calendar-rest-badge.is-work { color: #967b68; }
.calendar-year-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.calendar-year-month { padding: 14px; border-top: 1px solid #d8e4da; background: rgba(255,254,250,.76); }
.calendar-year-month-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.calendar-year-month-head strong { color: #41624f; font: 600 17px "Noto Serif SC", serif; }
.calendar-year-month-head span { color: #94a097; font-size: 10px; }
.calendar-year-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.calendar-year-day { position: relative; display: grid; justify-items: center; gap: 2px; padding: 3px 0; border: 0; color: #89978e; background: transparent; font: 10px "DM Mono", monospace; cursor: pointer; }
.calendar-year-day:hover, .calendar-year-day.is-today { color: #376249; background: #edf5ee; }
.calendar-year-day i { width: 4px; height: 4px; border-radius: 50%; background: transparent; }
.calendar-year-day i.has-event { background: #9a8060; }
.calendar-list { display: grid; gap: 10px; }
.calendar-list-item { display: grid; grid-template-columns: 88px 72px minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 16px; border-top: 1px solid #dce6de; background: rgba(255,254,250,.68); transition: background .2s ease, transform .2s ease; }
.calendar-list-item:hover { background: #f8fbf6; transform: translateY(-1px); }
.calendar-list-date { display: grid; gap: 5px; color: #9b8457; }
.calendar-list-date strong { font: 600 19px "DM Mono", monospace; }
.calendar-list-date span { color: #85948a; font-size: 10px; }
.calendar-list-item > img { width: 72px; height: 72px; object-fit: cover; border-radius: 4px; }
.calendar-list-copy { min-width: 0; }
.calendar-list-title { display: flex; align-items: baseline; gap: 10px; }
.calendar-list-title h4 { margin: 0; color: #41604e; font: 600 17px "Noto Serif SC", serif; }
.calendar-list-title em { color: #a07948; font-size: 11px; font-style: normal; white-space: nowrap; }
.calendar-list-copy p { margin: 6px 0 8px; overflow: hidden; color: #76877c; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.calendar-list-copy > small { color: #97a29a; font-size: 10px; }
.calendar-source-note { color: #9b8c6e; font-size: 10px; }
.calendar-countdown-list { display: grid; gap: 12px; max-width: 900px; }
.calendar-countdown-list .calendar-list-item { grid-template-columns: 100px 72px minmax(0,1fr) auto; }
.calendar-timeline { position: relative; max-width: 860px; padding: 4px 0 15px 108px; }
.calendar-timeline::before { content: ""; position: absolute; top: 7px; bottom: 0; left: 79px; border-left: 1px solid #c7d9cc; }
.calendar-timeline-item { position: relative; display: grid; grid-template-columns: 90px minmax(0,1fr); gap: 18px; padding: 0 0 28px; }
.calendar-timeline-item::before { content: ""; position: absolute; top: 2px; left: -33px; width: 7px; height: 7px; border: 2px solid #78a18a; border-radius: 50%; background: #f6f8f3; }
.calendar-timeline-item time { color: #a08559; font: 11px "DM Mono", monospace; }
.calendar-timeline-item div { padding-bottom: 15px; border-bottom: 1px solid #e1e9e2; }
.calendar-timeline-item span { color: #8d9a91; font-size: 10px; }
.calendar-timeline-item h4 { margin: 5px 0; color: #466354; font: 600 17px "Noto Serif SC", serif; }
.calendar-timeline-item p { margin: 0; color: #7e8e84; font-size: 12px; line-height: 1.7; }
.calendar-day-dialog-card { width: min(680px, calc(100vw - 30px)); max-height: calc(100vh - 36px); overflow: auto; }
.calendar-day-summary { display: grid; gap: 5px; padding: 4px 0 17px; border-bottom: 1px solid #dfe8df; color: #9b845a; }
.calendar-day-summary small { color: #436352; font: 600 20px "Noto Serif SC", serif; }
.calendar-day-section, .calendar-related-section { padding: 17px 0 0; }
.calendar-day-section > span, .calendar-related-section > span { display: block; margin-bottom: 8px; color: #87958c; font-size: 11px; letter-spacing: .06em; }
.calendar-system-lines { display: grid; gap: 4px; }
.calendar-system-lines p { display: flex; align-items: center; gap: 8px; margin: 0; color: #6b7d71; font-size: 13px; }
.calendar-system-lines p em { margin-left: auto; color: #a07c54; font: 10px "DM Mono", monospace; font-style: normal; }
.calendar-system-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #c0a66d; }
.calendar-system-dot.term { background: #7ba78c; }.calendar-system-dot.festival { background: #aa7d75; }
.calendar-day-events { display: grid; gap: 8px; }
.calendar-day-events article { padding: 12px 13px; border-left: 2px solid #7ca38a; background: #f5faf4; }
.calendar-day-events article > div:first-child { display: flex; justify-content: space-between; gap: 10px; }
.calendar-day-events strong { color: #476657; font: 600 15px "Noto Serif SC", serif; }
.calendar-day-events small { color: #8c9a91; font-size: 10px; }
.calendar-day-events p { margin: 7px 0; color: #708078; font-size: 12px; line-height: 1.7; }
.calendar-day-photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.calendar-day-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 3px; }
.calendar-related-section { display: grid; gap: 5px; }
.calendar-related-link { padding: 7px 0; border: 0; border-bottom: 1px solid #e7ede7; color: #567462; background: transparent; text-align: left; cursor: pointer; }
.calendar-related-link:hover { color: #2e6146; }
.calendar-day-empty { margin: 18px 0 0; color: #9aa69e; font-size: 12px; }
.calendar-event-detail-hero { padding: 2px 0 19px; border-bottom: 1px solid #dfe8df; }
.calendar-event-detail-hero > span { color: #a08354; font-size: 10px; letter-spacing: .08em; }
.calendar-event-detail-hero h4 { margin: 7px 0 11px; color: #3e604c; font: 600 25px "Noto Serif SC", serif; }
.calendar-event-detail-hero p { margin: 13px 0 0; color: #718177; font-size: 13px; line-height: 1.8; }
.calendar-event-detail-hero > small { display: block; margin-top: 7px; color: #8b998f; font-size: 11px; }
.calendar-event-detail-numbers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.calendar-event-detail-numbers div { padding: 11px 12px; background: #f7faf5; }
.calendar-event-detail-numbers strong { display: block; color: #537362; font: 500 23px "DM Mono", monospace; }
.calendar-event-detail-numbers small { display: block; margin-top: 4px; color: #8b998f; font-size: 10px; }
.calendar-history-line { display: flex; gap: 12px; margin: 0; padding: 8px 0; border-bottom: 1px solid #e7eee7; color: #728178; font-size: 12px; }
.calendar-history-line time { color: #a08458; font: 10px "DM Mono", monospace; }
.calendar-history-line strong { font-weight: 400; }
.calendar-date-mode { display: grid; grid-template-columns: minmax(130px, .8fr) minmax(180px, 1fr) repeat(3, minmax(90px, .55fr)); gap: 10px; align-items: end; }
.calendar-lunar-field[hidden], .calendar-solar-field[hidden] { display: none; }
.calendar-all-day { align-self: end; min-height: 40px; }
.calendar-event-options { display: flex; flex-wrap: wrap; gap: 17px; padding: 2px 0; }

@media (max-width: 900px) {
  .calendar-stats { grid-template-columns: 1fr; }
  .calendar-year-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-date-mode { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .calendar-heading, .calendar-toolbar, .calendar-month-caption { align-items: start; flex-direction: column; }
  .calendar-heading-actions { width: 100%; }
  .calendar-heading-actions .primary-button { flex: 1; }
  .calendar-memory-notes { grid-template-columns: 1fr; }
  .calendar-memory-notes article { min-height: 72px; padding: 12px 15px; border-top: 1px solid #dbe5dc; border-left: 0; }
  .calendar-memory-notes article:first-child { border-top: 0; }
  .calendar-relationship-count { font-size: 41px; }
  .calendar-toolbar .segmented-control { width: 100%; }
  .calendar-toolbar .segment { flex: 1 1 auto; }
  .calendar-nav { align-self: stretch; justify-content: space-between; }
  .calendar-nav strong { flex: 1; }
  .calendar-cell, .calendar-cell.muted-day { min-height: 88px; padding: 5px 4px; }
  .calendar-date-button { display: grid; gap: 1px; }
  .calendar-date-button strong { font-size: 15px; }
  .calendar-date-button small { font-size: 9px; }
  .calendar-day-notes { min-height: 14px; margin-top: 3px; }
  .calendar-day-note { font-size: 8px; }
  .calendar-event { padding: 3px 2px; font-size: 8px; }
  .calendar-event i { width: 4px; height: 4px; }
  .calendar-year-overview { grid-template-columns: 1fr; }
  .calendar-list-item, .calendar-countdown-list .calendar-list-item { grid-template-columns: 70px minmax(0,1fr) auto; gap: 10px; padding: 13px 3px; }
  .calendar-list-item > img { display: none; }
  .calendar-list-title { display: block; }
  .calendar-list-title em { display: block; margin-top: 4px; }
  .calendar-list-item .plan-actions { grid-column: 2 / -1; }
  .calendar-timeline { padding-left: 67px; }
  .calendar-timeline::before { left: 48px; }
  .calendar-timeline-item { grid-template-columns: 1fr; gap: 5px; }
  .calendar-timeline-item::before { left: -23px; }
  .calendar-day-photos { grid-template-columns: repeat(3, 1fr); }
  .calendar-date-mode { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-date-mode label:first-child { grid-column: 1 / -1; }
  .diary-publish-row { grid-template-columns: 1fr; gap: 3px; }
}

/* Quiet archive pass: collapsed tools, paper rhythm, and text-first entries */
#diary-view [hidden] { display: none !important; }
#diary-view { position: relative; max-width: 1260px; }
#diary-view .diary-heading { align-items: end; margin-bottom: 16px; }
#diary-view .diary-heading h3 { margin-bottom: 6px; font-size: clamp(28px, 3vw, 38px); letter-spacing: .01em; }
#diary-view .diary-heading p:last-child { max-width: 390px; color: #77877d; font-size: 13px; line-height: 1.75; }
.diary-toolbar-primary { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 42px; margin: 0 0 17px; }
.diary-toolbar-tools { display: flex; gap: 5px; }
.diary-tool-button { display: inline-grid; place-items: center; width: 35px; height: 35px; padding: 0; border: 1px solid transparent; border-radius: 50%; color: #668074; background: transparent; font: 22px/1 "Noto Serif SC", serif; cursor: pointer; transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s ease; }
.diary-tool-button:hover, .diary-tool-button[aria-expanded="true"] { border-color: #cbdacf; color: #315845; background: #eef5ee; transform: translateY(-1px); }
.diary-view-switch { margin-left: auto; }
.diary-search-popover, .diary-filter-popover { position: absolute; z-index: 10; top: 108px; right: 0; animation: diary-popover-in .18s ease both; }
.diary-search-popover { display: flex; align-items: center; gap: 7px; width: min(410px, calc(100vw - 32px)); padding: 8px 9px 8px 13px; border: 1px solid #d8e3d9; border-radius: 5px; background: rgba(255, 254, 248, .98); box-shadow: 0 12px 28px rgba(42, 60, 49, .11); }
.diary-search-popover .diary-search-box { min-width: 0; }
.diary-search-popover .diary-search-box input { border: 0; background: transparent; box-shadow: none; }
.diary-search-popover .diary-search-box input:focus { outline: 0; box-shadow: none; }
.diary-popover-close { display: inline-grid; flex: 0 0 auto; place-items: center; width: 27px; height: 27px; padding: 0; border: 0; border-radius: 50%; color: #829188; background: transparent; font-size: 18px; cursor: pointer; }
.diary-popover-close:hover { color: #315845; background: #edf4ee; }
.diary-filter-popover { width: min(565px, calc(100vw - 32px)); padding: 15px 16px 12px; border: 1px solid #d5e0d7; border-radius: 5px; background: rgba(255, 254, 248, .99); box-shadow: 0 14px 32px rgba(42, 60, 49, .12); }
.diary-filter-popover-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: 11px; }
.diary-filter-popover-head strong { display: block; margin-top: 3px; color: #3e5c4c; font: 600 15px "Noto Serif SC", serif; }
.diary-filterbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; padding: 0; border: 0; background: transparent; }
.diary-filter-field { display: grid; gap: 5px; color: #87958c; font-size: 10px; letter-spacing: .05em; }
.diary-filterbar input, .diary-filterbar select { width: 100%; min-width: 0; min-height: 34px; padding: 7px 8px; border: 1px solid #d6e0d7; border-radius: 3px; color: #425b4d; background: #fbfcf8; font-size: 12px; }
.diary-filterbar input:focus, .diary-filterbar select:focus { border-color: #8eae98; outline: 0; box-shadow: 0 0 0 3px rgba(142, 174, 152, .13); }
.diary-date-filter { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 7px; color: #87958c; font-size: 10px; }
.diary-date-filter input { min-width: 0; }
.diary-clear-filters { margin: 10px 0 0; padding: 0; color: #9b8355; font-size: 11px; }
.diary-summary { display: flex; flex-wrap: wrap; gap: 13px; min-height: 24px; margin: 0 0 11px; padding-left: 1px; color: #89968e; font-size: 11px; }
.diary-summary span + span { padding-left: 13px; border-left: 1px solid #d6e0d7; }
.diary-summary strong { color: #496a58; font: 500 16px "DM Mono", monospace; }
.diary-workspace { grid-template-columns: minmax(0, 1fr) 224px; gap: 28px; }
.diary-side-column { gap: 10px; }
.diary-side-card { padding: 14px 15px; border-color: #dfe6df; border-radius: 4px; box-shadow: 0 4px 14px rgba(44, 62, 52, .035); }
.diary-side-card h4 { margin: 3px 0 9px; font-size: 15px; }
.diary-month-group { grid-template-columns: 72px minmax(0, 1fr); gap: 16px; padding-bottom: 19px; }
.diary-month-node { padding-top: 8px; }
.diary-month-node strong { font-size: 27px; }
.diary-month-entries { gap: 13px; }
.diary-month-entries::before { left: -17px; border-color: #d0ddd2; }
.diary-card { grid-template-columns: 160px minmax(0, 1fr); border-color: #d9e2d9; border-radius: 4px; box-shadow: 0 4px 14px rgba(43, 62, 51, .045); transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease; }
.diary-card::after { content: ""; position: absolute; left: 0; top: 17px; bottom: 17px; width: 2px; background: #7d9f89; opacity: .68; }
.diary-card.tone-zjy::after { background: #a18b71; }
.diary-card.tone-together::after { background: #829aa0; }
.diary-card.tone-unknown::after { background: #c7d0c8; }
.diary-card.text-only { display: block; }
.diary-card.text-only .diary-card-summary { min-height: 0; max-width: 680px; }
.diary-card-cover { min-height: 166px; border-radius: 3px 0 0 3px; background: #e8eee7; }
.diary-card-cover.has-cover img { transition: transform .35s cubic-bezier(.2,.7,.2,1), filter .3s ease; }
.diary-card:hover .diary-card-cover.has-cover img { filter: saturate(.94); transform: scale(1.035); }
.diary-card-body { padding: 14px 16px 13px 18px; }
.diary-card-date { gap: 7px; font-size: 10px; }
.diary-card-date span { color: #75877c; }
.diary-card h4 { margin: 8px 0 6px; font-size: 20px; }
.diary-card-summary { min-height: 42px; margin-bottom: 11px; font-size: 13px; line-height: 1.7; }
.diary-card-author-row { padding-top: 9px; }
.diary-card-meta { margin-top: 8px; }
.diary-card-menu > summary { border-radius: 50%; transition: background .18s ease, color .18s ease; }
.diary-card-menu[open] > summary { color: #315845; background: #edf4ee; }
.diary-author-avatar { box-shadow: none; }
.diary-author-name { color: #557062; }
.tone-unknown .diary-author-name { color: #9aa49c; font-size: 11px; }
.tone-unknown .diary-author-avatar { box-shadow: none; }
.diary-reader-stamps { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; color: #929d96; font: 10px "DM Mono", monospace; }
.diary-reader-stamps span + span { padding-left: 12px; border-left: 1px solid #d9e2da; }
.diary-reader-date { letter-spacing: .04em; }
#diary-dialog { width: min(900px, calc(100vw - 32px)); }
#diary-dialog::backdrop, #diary-reader-dialog::backdrop { background: rgba(36, 55, 45, .27); backdrop-filter: blur(2px); }
#diary-dialog .modal-card { padding: 26px 30px 23px; border: 1px solid #dce5dc; border-radius: 6px; background: #fffefa; box-shadow: 0 22px 58px rgba(31, 50, 40, .2); }
#diary-dialog .modal-header { margin-bottom: 21px; }
#diary-dialog .modal-header h3 { margin-top: 5px; font-size: 28px; }
.diary-author-row { grid-template-columns: minmax(300px, 1fr) minmax(190px, .72fr); gap: 18px; align-items: end; padding: 12px 0 17px; border-bottom: 1px solid #e3eae3; }
.diary-field-label { color: #74857a; font-size: 11px; }
.diary-author-picker { display: flex; gap: 6px; margin-top: 8px; }
.diary-author-picker button { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 5px 10px 5px 6px; border: 1px solid #dce5dc; border-radius: 4px; color: #607568; background: #fbfcf8; font-size: 12px; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.diary-author-picker button:hover, .diary-author-picker button.active { border-color: #9ab9a3; color: #315845; background: #f1f7f0; transform: translateY(-1px); }
.diary-author-picker .diary-author-avatar { width: 27px; height: 27px; font-size: 9px; }
#diary-dialog > form > label, #diary-dialog > form > .form-grid { margin-top: 15px; }
#diary-dialog > form > label > input, #diary-dialog > form > .form-grid input, #diary-dialog > form > label > textarea { border-color: #dce5dc; border-radius: 3px; background: #fffefa; }
#diary-title-input { min-height: 48px; border-width: 0 0 1px !important; border-radius: 0 !important; padding-left: 0; color: #315845; font: 600 22px "Noto Serif SC", serif; }
#diary-title-input::placeholder { color: #b3beb5; font-weight: 400; }
.diary-editor-shell { margin-top: 19px; border: 1px solid #dce5dc; border-radius: 4px; background: #fffefa; }
.diary-editor-shell .editor-toolbar { border-color: #e3eae3; background: #f8faf6; }
.diary-content-editor { min-height: 260px; padding: 20px 21px; color: #435c4d; background: transparent; font-size: 15px; line-height: 1.95; }
.diary-content-editor:focus { outline: 0; box-shadow: inset 0 0 0 2px rgba(138, 172, 147, .1); }
.diary-content-editor:empty::before { color: #b2beb5; }
.editor-hint { margin: 0; padding: 0 20px 13px; color: #9ba69e; }
.diary-photo-manager { margin-top: 19px; padding-top: 15px; border-top-color: #e3eae3; }
.diary-photo-manager-head strong { font-size: 13px; }
.diary-photo-manager-empty { padding: 10px 0 2px; color: #a1aba4; }
@keyframes diary-popover-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 850px) {
  .diary-workspace { grid-template-columns: 1fr; }
  .diary-side-column { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  #diary-view .diary-heading { align-items: start; }
  #diary-view .diary-heading .primary-button { align-self: start; }
  .diary-side-column { display: none; }
  .diary-search-popover, .diary-filter-popover { position: fixed; top: 106px; right: 12px; left: 12px; width: auto; }
}
@media (max-width: 560px) {
  .diary-toolbar-primary { align-items: center; }
  .diary-view-switch { max-width: calc(100vw - 112px); }
  .diary-view-switch .segment { padding: 7px 8px; font-size: 11px; }
  .diary-filterbar { grid-template-columns: 1fr; }
  .diary-card { grid-template-columns: 1fr; }
  .diary-card.has-photo .diary-card-cover { min-height: 145px; border-radius: 3px 3px 0 0; }
  .diary-card-body { padding: 13px 15px 13px 17px; }
  .diary-card h4 { font-size: 19px; }
  .diary-author-row { grid-template-columns: 1fr; gap: 10px; }
  .diary-author-picker { flex-wrap: wrap; }
  #diary-dialog .modal-card { padding: 19px 16px 18px; }
  #diary-dialog .modal-header h3 { font-size: 24px; }
  .diary-content-editor { min-height: 220px; padding: 16px; }
}

.travel-pin span img { width: 100%; height: 100%; border-radius: 50% 50% 50% 0; object-fit: cover; }
.recipe-details { margin-top: 10px; border-top: 1px solid #edf0ec; color: var(--muted); font-size: 11px; }
.recipe-details summary { padding: 8px 0 3px; color: var(--green-dark); cursor: pointer; font-weight: 600; }
.recipe-details p { margin: 6px 0 0; line-height: 1.65; white-space: pre-wrap; }
.recipe-details strong { color: #52665d; }
.event-list-item .event-date { display: grid; gap: 4px; border: 0; background: transparent; }
select { width: 100%; min-height: 39px; padding: 8px 10px; border: 1px solid #ccd5cf; border-radius: 5px; color: var(--ink); background: #fff; outline: none; }
select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31,118,99,.11); }

@media (max-width: 850px) {
  #detail-dialog { width: calc(100vw - 24px); height: min(84vh, 820px); min-width: 0; min-height: 0; resize: none; }
  .detail-card { min-height: auto; }
  .photo-detail-layout { grid-template-columns: 1fr; }
  .photo-viewer img, .photo-viewer video { max-height: 52dvh; }
}

@media (max-width: 720px) {
  .gallery-collection-layout { grid-template-columns: 1fr; gap: 14px; }
  .gallery-group-nav { position: static; display: flex; gap: 3px; overflow-x: auto; padding: 0 0 8px; border-right: 0; border-bottom: 1px solid #dbe3dc; }
  .gallery-group-nav p { display: none; }
  .gallery-group-nav button { flex: 0 0 auto; width: auto; max-width: 150px; border-left: 0; border-bottom: 2px solid transparent; }
  .gallery-group-nav button:hover, .gallery-group-nav button:focus-visible { border-bottom-color: var(--green); }
  .gallery-nav-resizer { display: none; }
  .map-photo-preview { pointer-events: auto; }
  .photo-card { contain-intrinsic-size: 250px; }
  #detail-dialog { width: calc(100vw - 12px); height: calc(100dvh - 14px); max-height: calc(100dvh - 14px); }
  #detail-dialog .modal-card { padding: 14px; }
  .detail-card .modal-header { gap: 9px; }
  .detail-card .modal-header h3 { font-size: 21px; }
  .photo-viewer { min-height: 190px; }
  .photo-viewer img, .photo-viewer video { max-height: 43dvh; }
  .photo-nav-button { width: 34px; height: 48px; font-size: 27px; }
  .photo-facts-grid { grid-template-columns: 1fr; }
  .modal-actions { flex-wrap: wrap; }
  .restore-button { width: 100%; margin-right: 0; order: 3; }
  .photo-meta h4, .photo-meta p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; }
  .photo-meta h4 { min-height: 34px; -webkit-line-clamp: 2; }
  .photo-meta p { -webkit-line-clamp: 2; }
}

/* Shared experience modules */
.module-heading { display: flex; justify-content: space-between; align-items: end; gap: 22px; margin: 4px 0 22px; }
.module-heading > div > p:not(.eyebrow) { max-width: 520px; margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.diary-toolbar, .travel-toolbar, .menu-toolbar, .calendar-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.diary-toolbar input, .menu-toolbar input { flex: 1 1 230px; min-width: 160px; }
.diary-toolbar select { min-height: 39px; padding: 8px 10px; border: 1px solid #ccd5cf; border-radius: 5px; color: var(--ink); background: #fff; }
.sync-chip { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 9px; border: 1px solid #c7ded0; border-radius: 999px; color: var(--green-dark); background: #eef8f0; font-size: 11px; white-space: nowrap; }
.diary-summary { display: flex; flex-wrap: wrap; gap: 9px 20px; align-items: center; margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.diary-summary strong { color: var(--green-dark); font: 500 18px "DM Mono", monospace; }
.diary-layout { grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); }
.diary-entry { grid-template-columns: 150px minmax(0, 1fr); padding: 21px 16px; }
.diary-date { display: grid; align-content: start; gap: 5px; }
.diary-date strong { font-weight: 500; }
.diary-date small { color: var(--muted); font: 11px/1.4 "Source Han Sans SC", sans-serif; }
.entry-actions, .plan-actions { display: flex; gap: 12px; align-items: center; }
.diary-meta span { display: inline-flex; align-items: center; }
.diary-meta span::before { content: ""; }
.mood-badge { padding: 3px 7px; border-radius: 999px; font-size: 11px; }
.mood-happy { color: #8b6b23; background: #fff3cb; }.mood-calm { color: #276a5a; background: #e1f2e8; }.mood-excited { color: #a64f39; background: #ffe6dc; }.mood-tired { color: #596b73; background: #e8eef0; }.mood-sad { color: #6b587a; background: #eee6f3; }
.tag-pill { color: #61766c; font-size: 11px; }
.diary-photo-strip { display: flex; gap: 8px; margin-top: 13px; overflow-x: auto; }
.diary-photo-strip img { width: 82px; height: 62px; flex: 0 0 auto; border-radius: 4px; object-fit: cover; background: #e4ece6; }
.diary-calendar-panel { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 7px; background: #fffdf8; }
.calendar-month-title { margin-bottom: 14px; color: var(--green-dark); font: 600 16px "Noto Serif SC", serif; }
.diary-weekdays, .diary-calendar-grid, .calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.diary-weekdays, .calendar-weekdays { margin-bottom: 6px; color: #98a49d; font: 10px "DM Mono", monospace; text-align: center; }
.diary-day { min-height: 70px; padding: 5px; border: 1px solid #edf0ec; background: #fff; font-size: 11px; }
.diary-day > span { color: var(--muted); font: 10px "DM Mono", monospace; }
.diary-day.has-diary { border-color: #c3decf; background: #f3faf4; }.diary-day button { display: block; width: 100%; overflow: hidden; margin-top: 5px; padding: 3px 4px; border: 0; border-radius: 3px; color: var(--green-dark); background: #dfefe4; font-size: 10px; text-align: left; text-overflow: ellipsis; white-space: nowrap; }

.travel-toolbar { justify-content: space-between; }.travel-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(290px, .8fr); gap: 18px; align-items: start; }
.travel-blackboard { position: relative; min-height: 565px; overflow: hidden; border: 10px solid #c3a16b; border-radius: 6px; background-color: #2f514d; background-image: radial-gradient(rgba(255,255,255,.08) .7px, transparent .7px), linear-gradient(130deg, rgba(255,255,255,.04), transparent 38%), linear-gradient(40deg, transparent 55%, rgba(8,30,28,.16)); background-size: 7px 7px, auto, auto; box-shadow: 0 10px 24px rgba(38, 48, 40, .14), inset 0 0 0 2px rgba(255,255,255,.1); }
.blackboard-title { position: absolute; top: 20px; left: 24px; color: rgba(255,249,225,.9); font: 500 11px "DM Mono", monospace; letter-spacing: .08em; }.blackboard-title span { color: #f2c978; }
.blackboard-note { position: absolute; right: 20px; bottom: 22px; color: rgba(255,249,225,.72); font: 600 15px/1.7 "Noto Serif SC", serif; text-align: right; transform: rotate(-4deg); }.blackboard-note small { font: 10px "Source Han Sans SC", sans-serif; }
.travel-route-line { position: absolute; top: 31%; left: 17%; width: 68%; height: 26%; border-top: 2px dashed rgba(249,211,132,.55); border-right: 2px dashed rgba(249,211,132,.55); border-radius: 50%; transform: rotate(-10deg); }
.travel-pin { position: absolute; z-index: 1; left: var(--pin-x); top: var(--pin-y); display: grid; justify-items: center; gap: 3px; padding: 0; border: 0; color: #ffe8aa; background: transparent; transform: translate(-50%, -50%); }.travel-pin span { display: grid; place-items: center; width: 31px; height: 31px; border: 2px solid #fff8d8; border-radius: 50% 50% 50% 0; color: white; background: #e47861; box-shadow: 0 4px 9px rgba(13, 34, 29, .35); transform: rotate(-45deg); }.travel-pin span::first-letter { transform: rotate(45deg); }.travel-pin em { padding: 3px 6px; border-radius: 3px; background: rgba(12, 38, 34, .72); font: 600 11px "Source Han Sans SC", sans-serif; font-style: normal; white-space: nowrap; }.travel-pin.status-计划中 span { background: #e8b74e; }.travel-pin.status-已完成 span { background: #6bb486; }.travel-pin:hover { z-index: 2; }.travel-pin:hover span { transform: rotate(-45deg) scale(1.12); }
.travel-plan-list { display: grid; gap: 11px; }.travel-plan-card { position: relative; padding: 17px; border: 1px solid var(--line); border-left: 4px solid #e8795e; border-radius: 6px; background: #fff; box-shadow: 0 4px 12px rgba(33,52,45,.05); cursor: pointer; }.travel-plan-card.status-计划中 { border-left-color: #e8b74e; }.travel-plan-card.status-已完成 { border-left-color: #69af85; }.plan-card-top { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font: 10px "DM Mono", monospace; }.status-label { color: #af5d4b; font-size: 11px; }.status-计划中 .status-label { color: #9c7725; }.status-已完成 .status-label { color: #397c58; }.travel-plan-card h4 { margin: 9px 0 4px; font-size: 18px; }.travel-plan-card p { margin: 5px 0; color: var(--muted); font-size: 12px; line-height: 1.65; }.plan-place { color: var(--green-dark) !important; }.plan-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }.plan-actions { justify-content: end; margin-top: 12px; }.delete-action { color: #9a574d; }
.travel-detail-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; padding: 13px; border: 1px solid #d4e2d8; border-radius: 5px; background: #f3f9f4; }.travel-detail-head strong { color: var(--green-dark); }.travel-detail-head > span:last-child { color: var(--muted); font-size: 12px; }.travel-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }.travel-detail-grid section { padding: 13px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }.travel-detail-grid h4 { margin-bottom: 7px; font-size: 15px; }.detail-copy { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; white-space: pre-wrap; }

.menu-toolbar { align-items: stretch; }.menu-toolbar .segmented-control { overflow-x: auto; }.menu-feature-row { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 12px; margin: 4px 0 20px; }.menu-feature-card, .menu-count-card { min-height: 106px; padding: 18px; border: 1px solid #eadfbe; border-radius: 6px; background: linear-gradient(135deg, #fff9e5, #fffdf5); }.feature-kicker { display: block; margin-bottom: 6px; color: #b38c3a; font: 500 10px "DM Mono", monospace; }.menu-feature-card strong { color: #5e4b25; font: 600 18px "Noto Serif SC", serif; }.menu-feature-card p { margin: 6px 0; color: #81714d; font-size: 12px; }.menu-count-card { display: grid; align-content: center; background: #f1f8f2; border-color: #cfe1d3; }.menu-count-card span, .menu-count-card small { color: var(--muted); font-size: 11px; }.menu-count-card strong { margin: 3px 0; color: var(--green); font: 500 31px "DM Mono", monospace; }.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 15px; }.recipe-card { overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: 0 4px 12px rgba(33,52,45,.05); }.recipe-cover { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; background: linear-gradient(140deg, #f1dbc1, #faf0dc); }.recipe-cover img { width: 100%; height: 100%; object-fit: cover; }.recipe-cover > span { color: #c27f56; font-size: 54px; }.recipe-favorite { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border: 1px solid rgba(255,255,255,.8); border-radius: 50%; color: white; background: rgba(48,54,45,.45); }.recipe-favorite.active { color: #ffe8a1; background: rgba(31,118,99,.88); }.recipe-category { position: absolute; bottom: 10px; left: 10px; padding: 4px 7px; border-radius: 3px; color: #fff; background: rgba(43,58,47,.7); font-size: 10px; }.recipe-body { padding: 13px 14px 15px; }.recipe-title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }.recipe-title-row h4 { margin: 0 0 6px; font-size: 17px; }.recipe-rating { color: #d19e45; font-size: 11px; white-space: nowrap; }.recipe-body > p { min-height: 39px; margin: 0 0 10px; color: var(--muted); font-size: 12px; line-height: 1.6; }.recipe-meta { display: flex; flex-wrap: wrap; gap: 7px; color: #6a7b70; font: 10px "DM Mono", monospace; }

.calendar-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin-bottom: 19px; }.calendar-stats > div { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; align-items: baseline; padding: 13px 15px; border: 1px solid #d4e2d8; border-radius: 6px; background: #f6fbf7; }.calendar-stats span, .calendar-stats small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }.calendar-stats strong { color: var(--green); font: 500 27px "DM Mono", monospace; }.calendar-stats small { color: #618174; }.calendar-toolbar { justify-content: space-between; }.calendar-nav { display: flex; align-items: center; gap: 12px; }.calendar-nav strong { min-width: 115px; color: var(--green-dark); font: 600 16px "Noto Serif SC", serif; text-align: center; }.calendar-content, #calendar-content { min-width: 0; }.calendar-month-view { padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }.calendar-month-caption { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }.calendar-month-caption strong { color: var(--green-dark); font: 600 17px "Noto Serif SC", serif; }.calendar-month-caption span { color: var(--muted); font-size: 11px; }.calendar-cell { min-height: 105px; padding: 7px; border: 1px solid #edf0ec; background: #fff; }.calendar-cell.today { background: #f4fbf5; box-shadow: inset 0 0 0 2px #9ec7aa; }.calendar-day-number { display: block; margin-bottom: 5px; color: #76847c; font: 11px "DM Mono", monospace; }.calendar-event { display: grid; width: 100%; margin: 3px 0; padding: 4px 5px; overflow: hidden; border: 0; border-left: 3px solid #9e8fbd; border-radius: 2px; color: #4e4a5b; background: #f0ebf7; text-align: left; }.calendar-event span { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }.calendar-event small { margin-top: 2px; color: #817990; font-size: 9px; }.event-anniversary { border-left-color: #d87983; background: #fbecef; }.event-birthday { border-left-color: #e8b74e; background: #fff5d8; }.event-travel { border-left-color: #6698ab; background: #eaf4f7; }.event-date { border-left-color: #1f7663; background: #e4f3ea; }.year-calendar-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }.year-calendar-grid > section { padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }.year-calendar-grid h4 { margin-bottom: 9px; color: var(--green-dark); font-size: 15px; }.year-calendar-grid .calendar-cell { min-height: 34px; padding: 3px; }.year-calendar-grid .calendar-event { height: 4px; margin: 1px 0; padding: 0; border-left-width: 0; border-radius: 999px; }.year-calendar-grid .calendar-event span, .year-calendar-grid .calendar-event small { display: none; }.event-list { display: grid; gap: 10px; }.event-list-item { display: grid; grid-template-columns: 105px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 15px; border: 1px solid var(--line); border-left: 4px solid #9e8fbd; border-radius: 6px; background: #fff; }.event-list-item.event-anniversary { border-left-color: #d87983; }.event-list-item.event-birthday { border-left-color: #e8b74e; }.event-list-item.event-travel { border-left-color: #6698ab; }.event-list-item.event-date { border-left-color: var(--green); }.event-date { display: grid; gap: 4px; border: 0; background: transparent; }.event-date strong { color: var(--green); font: 500 17px "DM Mono", monospace; }.event-date span { color: var(--muted); font-size: 10px; }.event-list-item h4 { margin: 0 0 5px; font-size: 16px; }.event-list-item p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.wide-form { width: min(760px, calc(100vw - 32px)); }.wide-form textarea { min-height: 82px; }

@media (max-width: 850px) {
  .travel-layout { grid-template-columns: 1fr; }.travel-blackboard { min-height: 460px; }.travel-plan-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }.travel-detail-grid { grid-template-columns: 1fr; }.year-calendar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mobile-nav { display: flex; overflow-x: auto; justify-content: space-around; gap: 2px; }
  .mobile-nav-item { flex: 0 0 60px; }
}
@media (max-width: 560px) {
  .module-heading { align-items: start; flex-direction: column; gap: 13px; }.module-heading .primary-button { align-self: stretch; }.diary-layout { display: block; }.diary-calendar-panel { margin-top: 12px; }.diary-entry { grid-template-columns: 1fr; }.travel-plan-list { grid-template-columns: 1fr; }.travel-blackboard { min-height: 390px; border-width: 7px; }.menu-toolbar .segmented-control { width: 100%; }.menu-feature-row, .calendar-stats { grid-template-columns: 1fr; }.calendar-stats > div { min-height: 73px; }.calendar-month-view { padding: 8px; }.calendar-cell { min-height: 82px; padding: 5px 3px; }.calendar-event small { display: none; }.calendar-month-caption span { display: none; }.year-calendar-grid { grid-template-columns: 1fr; }.event-list-item { grid-template-columns: 70px minmax(0, 1fr); }.event-list-item .plan-actions { grid-column: 2; justify-content: start; }.wide-form { width: min(100vw - 18px, 760px); }.form-grid { grid-template-columns: 1fr; }
}

/* Basic Word-like diary editor */
#diary-dialog { width: min(980px, calc(100vw - 32px)); }
.diary-editor-shell { display: grid; gap: 0; overflow: hidden; border: 1px solid #cbd6cd; border-radius: 6px; background: #fff; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 5px; padding: 7px; border-bottom: 1px solid #e0e6e1; background: #f5f7f4; }
.editor-toolbar-group { display: flex; gap: 3px; padding-right: 6px; margin-right: 2px; border-right: 1px solid #d9e1db; }
.editor-toolbar-group:last-child { padding-right: 0; margin-right: 0; border-right: 0; }
.editor-toolbar button, .editor-toolbar select { min-width: 32px; min-height: 30px; padding: 4px 7px; border: 1px solid transparent; border-radius: 4px; color: #47564e; background: transparent; font-size: 12px; }
.editor-toolbar button { cursor: pointer; }
.editor-toolbar button:hover, .editor-toolbar button:focus-visible { border-color: #b9d1c1; background: #eaf4ed; color: var(--green-dark); }
.editor-toolbar select { width: auto; min-width: 92px; min-height: 30px; padding: 3px 6px; border-color: #d8e1da; background: #fff; }
.editor-toolbar-last { margin-left: auto; }
.diary-emoji-panel { display: grid; grid-template-columns: repeat(10, minmax(30px, 1fr)); gap: 4px; max-height: 170px; overflow: auto; padding: 9px; border-bottom: 1px solid #e0e6e1; background: #fffdf8; }
.diary-emoji-option { min-height: 31px; border: 0; border-radius: 4px; background: transparent; font-size: 21px; cursor: pointer; }
.diary-emoji-option:hover { background: #f3e8c6; }
.diary-content-editor { min-height: 330px; max-height: 55vh; overflow: auto; padding: 18px 20px; outline: none; color: var(--ink); font: 15px/1.9 "Source Han Sans SC", sans-serif; }
.diary-content-editor:empty::before { content: attr(data-placeholder); color: #a3ada6; pointer-events: none; }
.diary-content-editor h2, .diary-content-editor h3 { margin: 12px 0 5px; font-family: "Noto Serif SC", serif; }
.diary-content-editor p { margin: 0 0 9px; }
.diary-content-editor blockquote, .diary-rich-content blockquote { margin: 10px 0; padding: 8px 13px; border-left: 3px solid #9fc6b1; color: #60756b; background: #f4faf5; }
.diary-content-editor ul, .diary-content-editor ol { padding-left: 24px; }
.diary-content-editor img, .diary-rich-content img { display: block; max-width: 100%; height: auto; margin: 12px 0; border-radius: 5px; box-shadow: 0 4px 12px rgba(33, 52, 45, .12); }
.diary-inline-image { max-height: 420px; object-fit: contain; }
.editor-uploading-image { display: inline-block; padding: 7px 9px; border-radius: 4px; color: #587066; background: #eef5ef; font-size: 12px; }
.editor-hint { padding: 0 18px 11px; margin: 0; }
.diary-rich-content { color: var(--muted); font-size: 13px; line-height: 1.8; white-space: normal; }
.diary-rich-content p { margin: 0 0 7px; }

@media (max-width: 560px) {
  #diary-dialog { width: calc(100vw - 14px); }
  .diary-content-editor { min-height: 260px; padding: 14px; }
  .diary-emoji-panel { grid-template-columns: repeat(7, minmax(30px, 1fr)); }
  .editor-toolbar-last { margin-left: 0; }
}

/* Private archive diary redesign */
#diary-view { max-width: 1240px; }
.diary-heading { margin-bottom: 20px; }
.diary-heading h3 { letter-spacing: .03em; }
.diary-toolbar-primary { margin-bottom: 10px; }
.diary-search-box { position: relative; display: flex; flex: 1 1 360px; align-items: center; min-width: 230px; }
.diary-search-box > span { position: absolute; left: 12px; color: #779087; font-size: 20px; pointer-events: none; }
.diary-search-box input { width: 100%; padding-left: 36px; }
.diary-view-switch { flex: 0 0 auto; }
.diary-filterbar { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; padding: 10px; border-top: 1px solid #dfe7e0; border-bottom: 1px solid #dfe7e0; background: rgba(247, 249, 245, .64); }
.diary-filterbar input, .diary-filterbar select { min-height: 34px; min-width: 112px; padding: 6px 8px; border: 1px solid #d4ded6; border-radius: 4px; color: var(--ink); background: #fff; font-size: 12px; }
.diary-filterbar select { min-width: 130px; }
.diary-date-filter { display: inline-flex; align-items: center; gap: 5px; color: #78877e; font-size: 11px; }
.diary-date-filter input { min-width: 132px; }
.diary-clear-filters { margin-left: auto; white-space: nowrap; }
.diary-summary { min-height: 27px; margin: 13px 0 9px; padding-left: 5px; color: #74847a; font-size: 12px; }
.diary-summary strong { color: var(--green-dark); font: 500 18px "DM Mono", monospace; }
.diary-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 258px; gap: 24px; align-items: start; }
.diary-main-column { min-width: 0; }
.diary-side-column { position: sticky; top: 18px; display: grid; gap: 12px; }
.diary-side-card { padding: 16px; border: 1px solid #dbe4dc; border-radius: 6px; background: rgba(255, 254, 249, .86); box-shadow: 0 5px 17px rgba(44, 62, 52, .045); }
.diary-side-card h4 { margin: 4px 0 12px; color: var(--green-dark); font: 600 16px "Noto Serif SC", serif; }
.side-card-kicker { color: #a18650; font: 500 10px "DM Mono", monospace; letter-spacing: .08em; }
.side-empty { margin: 0; color: #8b9790; font-size: 12px; line-height: 1.7; }
.side-memory-line { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 7px; width: 100%; padding: 7px 0; border: 0; border-top: 1px solid #e9eee9; color: var(--muted); background: transparent; text-align: left; cursor: pointer; }
.side-memory-line:first-of-type { border-top: 0; }
.side-memory-line strong { color: #a18650; font: 500 11px "DM Mono", monospace; }
.side-memory-line span { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.side-memory-line:hover span { color: var(--green-dark); }
.side-photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.side-photo-grid button { aspect-ratio: 1; overflow: hidden; padding: 0; border: 0; background: #e9eee9; cursor: pointer; }
.side-photo-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.side-photo-grid button:hover img { transform: scale(1.06); }
.month-memory-number { margin: -2px 0 8px; color: var(--green); font: 500 30px "DM Mono", monospace; }
.month-memory-number small { margin-left: 4px; color: #84928a; font: 12px "Source Han Sans SC", sans-serif; }
.diary-month-group { position: relative; display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 18px; padding-bottom: 22px; }
.diary-month-group:last-child { padding-bottom: 0; }
.diary-month-node { position: relative; z-index: 1; display: grid; align-content: start; justify-items: center; gap: 2px; padding-top: 10px; color: #7c8c82; background: var(--paper, #f6f8f3); text-align: center; }
.diary-month-node::after { content: ""; position: absolute; top: 12px; right: -19px; width: 9px; height: 9px; border: 2px solid #6e9783; border-radius: 50%; background: #f6f8f3; box-shadow: 0 0 0 4px #f6f8f3; }
.diary-month-node span { font: 10px "DM Mono", monospace; letter-spacing: .08em; }
.diary-month-node strong { color: var(--green-dark); font: 600 30px/1 "Noto Serif SC", serif; }
.diary-month-node small { color: #9a8a60; font-size: 10px; }
.diary-month-entries { position: relative; display: grid; gap: 15px; }
.diary-month-entries::before { content: ""; position: absolute; top: 0; bottom: 0; left: -19px; border-left: 1px solid #c6d8cb; }
.diary-card { position: relative; display: grid; grid-template-columns: 174px minmax(0, 1fr); min-width: 0; overflow: visible; border: 1px solid #d7e1d8; border-radius: 6px; background: #fffefa; box-shadow: 0 6px 17px rgba(43, 62, 51, .055); cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.diary-card::before { content: ""; position: absolute; top: 25px; left: -24px; width: 7px; height: 7px; border: 2px solid #7ba18b; border-radius: 50%; background: #f6f8f3; }
.diary-card:hover, .diary-card:focus-visible { border-color: #a7c5b2; box-shadow: 0 10px 23px rgba(43, 62, 51, .095); outline: 0; transform: translateY(-1px); }
.diary-card-cover { position: relative; min-height: 178px; overflow: hidden; border-radius: 5px 0 0 5px; background: #e7eee7; }
.diary-card-cover.has-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.diary-card:hover .diary-card-cover.has-cover img { transform: scale(1.035); }
.diary-cover-empty { display: grid; place-items: center; background: linear-gradient(135deg, #e6eee6, #f5efd9 58%, #e9e3d1); }
.diary-cover-empty > span { color: #698776; font: 600 42px "Noto Serif SC", serif; }
.diary-cover-label { position: absolute; right: 9px; bottom: 9px; padding: 3px 6px; border: 1px solid rgba(255,255,255,.55); border-radius: 3px; color: #fffef4; background: rgba(37, 58, 47, .65); font: 10px "DM Mono", monospace; }
.diary-card-body { min-width: 0; padding: 16px 17px 14px; }
.diary-card-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.diary-card-date { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; color: #7b8c81; font: 10px "DM Mono", monospace; }
.diary-card-date small { color: #9a8870; font: 11px "Source Han Sans SC", sans-serif; }
.diary-card h4 { margin: 9px 0 7px; color: #2d4c3d; font: 600 21px/1.35 "Noto Serif SC", serif; }
.diary-card-summary { display: -webkit-box; min-height: 43px; margin: 0 0 13px; overflow: hidden; color: #687a70; font-size: 13px; line-height: 1.75; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.diary-card-author-row, .diary-card-meta, .diary-card-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.diary-card-author-row { justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid #e8eee8; }
.diary-author { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.diary-author-avatar { display: inline-grid; flex: 0 0 auto; place-items: center; width: 27px; height: 27px; border: 1px solid rgba(255,255,255,.8); border-radius: 50%; color: #fff; font: 600 11px "Noto Serif SC", serif; box-shadow: 0 2px 5px rgba(35,55,44,.1); }
.diary-author-avatar.tone-xy { background: #5d8974; }.diary-author-avatar.tone-zjy { background: #9a8165; }.diary-author-avatar.tone-together { background: #718c9a; }.diary-author-avatar.tone-unknown { color: #7e897f; background: #e6ece6; }
.diary-author-name { max-width: 90px; overflow: hidden; color: #4d685a; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.diary-photo-count { color: #89978f; font: 10px "DM Mono", monospace; }
.diary-card-meta { margin-top: 9px; color: #7b8b82; font-size: 11px; }
.mood-badge { display: inline-flex; align-items: center; padding: 3px 7px; border: 1px solid #d8e5da; border-radius: 999px; color: #5c7768; background: #f0f7f0; font-size: 10px; }
.diary-card-tags { min-height: 16px; margin-top: 8px; }
.diary-card-menu { position: relative; flex: 0 0 auto; }
.diary-card-menu > summary { width: 28px; height: 26px; color: #718178; font: 600 17px/20px "DM Mono", monospace; list-style: none; text-align: center; cursor: pointer; }
.diary-card-menu > summary::-webkit-details-marker { display: none; }
.diary-card-menu > summary:hover { color: var(--green-dark); background: #edf5ee; }
.diary-menu-popover { position: absolute; z-index: 4; top: 28px; right: 0; display: grid; min-width: 82px; padding: 4px; border: 1px solid #d7e1d8; border-radius: 4px; background: #fffefa; box-shadow: 0 8px 18px rgba(35, 54, 44, .13); }
.diary-menu-popover button { padding: 6px 8px; border: 0; color: #53665b; background: transparent; font-size: 12px; text-align: left; cursor: pointer; }
.diary-menu-popover button:hover { background: #edf5ee; color: var(--green-dark); }
.archive-empty { display: grid; justify-items: center; gap: 7px; min-height: 240px; padding: 50px 20px; border: 1px dashed #cbd9ce; border-radius: 6px; color: #7f9185; background: rgba(255,255,250,.55); text-align: center; }
.archive-empty > span { color: #b19a62; font-size: 29px; }.archive-empty strong { color: var(--green-dark); font: 600 17px "Noto Serif SC", serif; }.archive-empty small { color: #8a988f; font-size: 12px; }
.diary-calendar-panel { min-width: 0; padding: 16px; border: 1px solid #d7e1d8; border-radius: 6px; background: #fffefa; }
.diary-calendar-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; }.diary-calendar-head strong { color: var(--green-dark); font: 600 17px "Noto Serif SC", serif; }.diary-calendar-head .outline-button { min-width: 32px; padding: 5px 8px; }
.diary-weekdays, .diary-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }.diary-weekdays { margin-bottom: 5px; color: #94a198; font: 10px "DM Mono", monospace; text-align: center; }.diary-calendar-cell { min-height: 91px; padding: 6px; border: 1px solid #e9eee9; background: #fff; }.diary-calendar-cell > span { color: #7c8b82; font: 10px "DM Mono", monospace; }.diary-calendar-cell.has-diary { border-color: #bcd5c4; background: #f4faf3; }.diary-calendar-cell button { display: block; width: 100%; overflow: hidden; margin-top: 6px; padding: 4px 5px; border: 0; border-left: 2px solid #7da48c; border-radius: 2px; color: #4d6b5a; background: #e5f1e6; font-size: 10px; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.diary-photo-wall { min-width: 0; }.diary-photo-wall-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }.diary-wall-photo { overflow: hidden; border: 1px solid #d7e1d8; border-radius: 5px; background: #fffefa; cursor: pointer; }.diary-wall-photo img { display: block; width: 100%; aspect-ratio: 1.12; object-fit: cover; }.diary-wall-photo div { display: grid; gap: 3px; padding: 9px 10px 10px; }.diary-wall-photo strong { overflow: hidden; color: #466456; font: 500 12px "Noto Serif SC", serif; text-overflow: ellipsis; white-space: nowrap; }.diary-wall-photo span { color: #89978f; font: 10px "DM Mono", monospace; }

#diary-dialog { width: min(980px, calc(100vw - 32px)); }
.diary-author-row { display: grid; grid-template-columns: minmax(180px, .45fr) minmax(0, 1fr); gap: 13px; align-items: end; }.diary-author-field { display: grid; gap: 6px; }.diary-author-field select { min-height: 40px; padding: 8px 10px; border: 1px solid #ccd5cf; border-radius: 5px; color: var(--ink); background: #fff; }.diary-author-hint { margin: 0 0 3px; }.diary-draft-status { display: block; margin-top: 4px; color: #8a978f; font-size: 11px; font-weight: 400; }.diary-note-field textarea { min-height: 66px; }
.diary-photo-manager { padding-top: 13px; border-top: 1px solid #dfe7e0; }.diary-photo-manager-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }.diary-photo-manager-head strong { display: block; color: #4d685a; font: 600 14px "Noto Serif SC", serif; }.diary-photo-manager-head small { display: block; margin-top: 3px; color: #8a978f; font-size: 11px; }.diary-photo-add { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }.diary-photo-add input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }.diary-selected-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 9px; margin-top: 11px; }.diary-photo-manager-empty { margin: 10px 0 0; color: #8a978f; font-size: 12px; }.diary-selected-photo { overflow: hidden; border: 1px solid #d8e2d9; border-radius: 4px; background: #fbfcf8; }.diary-selected-photo.is-cover { border-color: #9bbca5; box-shadow: 0 0 0 2px rgba(155,188,165,.18); }.diary-selected-photo > img { display: block; width: 100%; height: 92px; object-fit: cover; }.diary-selected-photo-tools { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; padding: 5px; }.diary-selected-photo-tools span { flex: 1 0 100%; color: #6a7e71; font-size: 10px; }.diary-selected-photo-tools button { min-height: 22px; padding: 2px 5px; border: 1px solid #d8e2d9; border-radius: 3px; color: #60756a; background: #fff; font-size: 10px; cursor: pointer; }.diary-selected-photo-tools button:hover { background: #edf5ee; }.diary-selected-photo-tools button:disabled { cursor: default; opacity: .45; }

#diary-reader-dialog { width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 30px); }
.diary-reader-card { min-height: 100%; padding: 26px 38px 42px; border-radius: 7px; background: #fbfcf8; box-shadow: 0 22px 55px rgba(12,30,23,.22); }.diary-reader-topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }.diary-reader-topbar .eyebrow { margin: 0 auto 0 0; }.diary-reader-actions { display: flex; gap: 8px; }.diary-reader-header { max-width: 780px; margin: 0 auto; }.diary-reader-date { color: #9a865b; font: 11px "DM Mono", monospace; letter-spacing: .08em; }.diary-reader-header h2 { margin: 10px 0 13px; color: #2c4b3d; font: 600 35px/1.35 "Noto Serif SC", serif; }.diary-reader-author { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; color: #77887e; font-size: 12px; }.diary-reader-header > .tag-pill { display: inline-block; margin-top: 12px; }.diary-reader-cover { max-width: 780px; margin: 25px auto 28px; }.diary-reader-cover img { display: block; width: 100%; max-height: 480px; border-radius: 5px; object-fit: cover; }.diary-reader-body { max-width: 720px; margin: 0 auto; color: #455d50; font-size: 16px; line-height: 2.05; }.diary-reader-body p { margin: 0 0 16px; }.diary-reader-body img { display: block; max-width: 100%; height: auto; margin: 18px auto; border-radius: 4px; }.diary-reader-body blockquote { margin: 17px 0; padding: 11px 16px; border-left: 3px solid #9dbca6; color: #667d6f; background: #f1f7f0; }.diary-note-to-partner { max-width: 720px; margin: 29px auto 0; padding: 14px 17px; border-left: 3px solid #b29b63; background: #fff8e8; }.diary-note-to-partner span { color: #a07f39; font: 10px "DM Mono", monospace; letter-spacing: .06em; }.diary-note-to-partner p { margin: 7px 0 0; color: #715e38; font: 15px/1.8 "Noto Serif SC", serif; }.diary-reader-gallery { max-width: 780px; margin: 34px auto 0; padding-top: 18px; border-top: 1px solid #dfe7e0; }.diary-reader-gallery > div:last-child { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 9px; }.diary-reader-gallery img { width: 100%; height: 120px; object-fit: cover; border-radius: 3px; }

@media (max-width: 850px) {
  .diary-workspace { grid-template-columns: 1fr; }.diary-side-column { position: static; grid-template-columns: repeat(3, minmax(0, 1fr)); }.diary-side-card { min-width: 0; }.diary-photo-wall-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.diary-reader-card { padding: 20px 24px 34px; }
}
@media (max-width: 560px) {
  .diary-filterbar { align-items: stretch; }.diary-filterbar input, .diary-filterbar select, .diary-date-filter { flex: 1 1 145px; }.diary-clear-filters { width: 100%; margin-left: 0; text-align: left; }.diary-side-column { grid-template-columns: 1fr; }.diary-month-group { grid-template-columns: 1fr; gap: 4px; }.diary-month-node { display: flex; justify-content: start; gap: 7px; padding: 0 0 5px; text-align: left; }.diary-month-node strong { font-size: 23px; }.diary-month-node::after, .diary-month-entries::before, .diary-card::before { display: none; }.diary-card { grid-template-columns: 1fr; }.diary-card-cover { min-height: 145px; border-radius: 5px 5px 0 0; }.diary-card-body { padding: 13px 14px; }.diary-card h4 { font-size: 19px; }.diary-author-row { grid-template-columns: 1fr; }.diary-author-hint { margin: 0; }.diary-photo-manager-head { align-items: start; flex-direction: column; }.diary-photo-add { align-self: start; }.diary-calendar-cell { min-height: 69px; padding: 4px 3px; }.diary-calendar-cell button { padding: 3px; font-size: 9px; }.diary-reader-card { padding: 16px 15px 28px; }.diary-reader-topbar { gap: 8px; margin-bottom: 22px; }.diary-reader-topbar .eyebrow { display: none; }.diary-reader-header h2 { font-size: 27px; }.diary-reader-body { font-size: 15px; line-height: 1.9; }.diary-reader-gallery > div:last-child { grid-template-columns: repeat(2, minmax(0, 1fr)); }.diary-reader-gallery img { height: 112px; }
}
