.icon-button { display: grid; width: var(--tap); height: var(--tap); place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--paper-strong); }
.button { display: inline-flex; min-height: var(--tap); align-items: center; justify-content: center; gap: .55rem; padding: .72rem 1rem; border: 1px solid transparent; border-radius: 999px; background: var(--brand); color: white; font-weight: 700; }
.button.secondary { border-color: var(--line); background: var(--paper-strong); color: var(--ink); }
.button.ghost { background: transparent; color: var(--brand); }
.button.danger { background: #b42318; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.card { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper-strong); box-shadow: var(--shadow-soft); overflow: hidden; }
.card-body { padding: 18px; }
.stat-card { min-height: 126px; padding: 18px; }
.stat-card .value { display: block; margin-top: 18px; font: 700 clamp(1.8rem,5vw,2.8rem)/1 Georgia,serif; }
.stat-card .label { color: var(--ink-soft); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.muted { color: var(--ink-soft); }
.eyebrow { color: var(--brand); font-weight: 800; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: .3rem .65rem; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: .76rem; }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--category-color,var(--brand)); }
.memory-list { display: grid; gap: 16px; }
.memory-card { position: relative; display: grid; grid-template-columns: 116px minmax(0,1fr); min-height: 150px; }
.memory-card.no-media { grid-template-columns: 1fr; border-left: 6px solid var(--category-color,var(--brand)); }
.memory-cover { width: 100%; height: 100%; object-fit: cover; background: var(--brand-soft); }
.memory-card .card-body { min-width: 0; }
.memory-date { color: var(--ink-soft); font-size: .78rem; }
.memory-title { margin: .35rem 0 .45rem; font-size: 1.15rem; }
.memory-summary { display: -webkit-box; overflow: hidden; color: var(--ink-soft); font-size: .88rem; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.favorite { color: #d79811; }
.field { display: grid; gap: 7px; margin-bottom: 17px; }
.field label, .field-label { font-size: .8rem; font-weight: 750; }
.input, .textarea, .select { width: 100%; min-height: 48px; padding: .75rem .9rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
.textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--brand); outline: 3px solid color-mix(in srgb,var(--brand) 15%,transparent); }
.field-error { color: #b42318; font-size: .75rem; }
.form-actions { position: sticky; bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 20px); display: flex; justify-content: flex-end; gap: 10px; padding: 12px; margin: 26px -6px 0; border: 1px solid var(--line); border-radius: 22px; background: color-mix(in srgb,var(--paper-strong) 92%,transparent); backdrop-filter: blur(20px); }
.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: color-mix(in srgb,var(--ink) 7%,transparent); overflow-x: auto; }
.segmented button { min-height: 38px; padding: 0 .8rem; border: 0; border-radius: 999px; background: transparent; white-space: nowrap; }
.segmented button.active { background: var(--paper-strong); box-shadow: var(--shadow-soft); color: var(--brand); font-weight: 700; }
.coverage { height: 15px; display: flex; overflow: hidden; border-radius: 999px; background: color-mix(in srgb,var(--ink) 8%,transparent); }
.coverage > span { min-width: 2px; height: 100%; background: var(--category-color,var(--brand)); }
.calendar-year { scroll-margin-top: 84px; }
.months { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.month { padding: 14px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper-strong); content-visibility: auto; contain-intrinsic-size: 260px; }
.month h3 { margin-bottom: 12px; text-transform: capitalize; }
.weekdays,.days { display: grid; grid-template-columns: repeat(7,1fr); gap: 3px; text-align: center; }
.weekdays { margin-bottom: 5px; color: var(--ink-soft); font-size: .58rem; }
.day { aspect-ratio: 1; display: grid; position: relative; place-items: center; border: 0; border-radius: 50%; background: transparent; font-size: .64rem; }
.day.has-memory { background: var(--day-color,var(--brand)); color: white; font-weight: 800; box-shadow: inset 0 0 0 2px rgba(255,255,255,.22); }
.day.approximate { border: 1px dashed var(--brand); }
.day .count { position: absolute; right: -3px; top: -4px; min-width: 13px; height: 13px; padding: 0 2px; border-radius: 8px; background: var(--ink); color: var(--paper); font-size: .48rem; line-height: 13px; }
.day.outside { visibility: hidden; }
.day.future { opacity: .25; }
.media-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; }
.media-tile { position: relative; aspect-ratio: 1; border: 0; padding: 0; background: var(--brand-soft); overflow: hidden; }
.media-tile img { width: 100%; height: 100%; object-fit: cover; }
.empty { padding: 42px 24px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius-md); color: var(--ink-soft); }
.empty strong { display: block; margin-bottom: 8px; color: var(--ink); font: 700 1.35rem Georgia,serif; }
.toast-region { position: fixed; z-index: 60; left: 50%; bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 24px); transform: translateX(-50%); display: grid; gap: 8px; width: min(90vw,420px); pointer-events: none; }
.toast { padding: 13px 16px; border-radius: 16px; background: var(--ink); color: var(--paper); box-shadow: var(--shadow); animation: toast-in .2s ease-out; }
@keyframes toast-in { from { opacity:0; transform:translateY(8px); } }
.sync { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: .7rem; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); }
.sync.offline .sync-dot,.sync.error .sync-dot { background: #d97706; }
.dialog-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; align-items: end; background: rgba(20,17,14,.46); backdrop-filter: blur(4px); }
.sheet { width: min(100%,620px); max-height: 88vh; margin: 0 auto; padding: 12px 20px calc(20px + env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0; background: var(--paper-strong); overflow: auto; box-shadow: var(--shadow); }
.sheet-handle { width: 44px; height: 5px; margin: 0 auto 18px; border-radius: 3px; background: var(--line); }
.detail-hero { min-height: 240px; display: grid; align-items: end; padding: 24px; border-radius: var(--radius-lg); color: white; background: linear-gradient(150deg,color-mix(in srgb,var(--category-color,var(--brand)) 85%,black),var(--category-color,var(--brand))); }
.detail-hero h1 { margin-bottom: 10px; font-size: clamp(2.2rem,8vw,4.5rem); }
.detail-prose { font: 1.08rem/1.7 Georgia,serif; white-space: pre-wrap; }
.timeline-track { padding: 18px; }
.timeline-bar { position: relative; height: 8px; margin: 18px 0 8px; border-radius: 999px; background: var(--line); }
.timeline-stage { position: absolute; top: -6px; height: 20px; min-width: 12px; border-radius: 999px; background: var(--stage-color,var(--brand)); }
.install-hint { margin-bottom: 18px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--brand-soft); font-size: .84rem; }
@media (max-width: 820px) { .months { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 520px) { .months { grid-template-columns: 1fr; } .month { padding: 16px; } .day { font-size: .74rem; } .memory-card { grid-template-columns: 96px minmax(0,1fr); } }
@media (min-width: 720px) { .media-grid { grid-template-columns: repeat(6,1fr); gap: 7px; } .dialog-backdrop { align-items: center; padding: 20px; } .sheet { border-radius: 28px; } }

