/* ==========================================================================
   Lightyears — styles
   Dark, deep-space aesthetic. Moments glow in their category colour (--c).
   Sections: tokens · base · controls · timeline · overlays · editor · search
             · settings · setup/login · responsive · motion
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/inter-latin-ext-wght-normal.woff2') format('woff2');
  font-weight: 100 900; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('../assets/fonts/space-grotesk-latin-wght-normal.woff2') format('woff2');
  font-weight: 300 700; font-display: swap;
}

:root {
  --bg: #07070d;
  --bg-2: #0d0d18;
  --panel: rgba(18, 18, 32, 0.72);
  --panel-solid: #12121f;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-2: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #eef0ff;
  --text-2: #c5c9e6;
  --muted: #8d92b4;
  --accent: #ff6aa8;
  --accent-2: #8b6cff;
  --warm: #ffb37a;
  --grad: linear-gradient(120deg, #ffb37a 0%, #ff5fa2 45%, #8b6cff 100%);
  --danger: #ff5d73;
  --ok: #4be3a0;
  --radius: 20px;
  --radius-sm: 12px;
  --topbar-h: 68px;
  --spine-x: 50%;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Space Grotesk', var(--font);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --warp: 0;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: auto; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 800px at 85% -10%, rgba(139, 108, 255, 0.16), transparent 60%),
    radial-gradient(900px 700px at -10% 30%, rgba(255, 95, 162, 0.10), transparent 60%),
    radial-gradient(900px 900px at 60% 120%, rgba(255, 179, 122, 0.08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.has-overlay { overflow: hidden; }
#warp { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#app { position: relative; z-index: 1; min-height: 100vh; }
#app.booting { display: grid; place-items: center; }
.boot-orb { width: 54px; height: 54px; border-radius: 50%; background: var(--grad); filter: blur(1px); animation: orb 1.4s ease-in-out infinite; box-shadow: 0 0 60px rgba(255, 95, 162, 0.6); }
@keyframes orb { 50% { transform: scale(0.7); opacity: 0.6; } }

h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; line-height: 1.15; margin: 0; }
h2 { font-size: 24px; font-weight: 600; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex: 1; }
[hidden] { display: none !important; }
::selection { background: rgba(255, 95, 162, 0.35); }
mark { background: rgba(255, 179, 122, 0.25); color: #ffd8b8; border-radius: 4px; padding: 0 2px; }
kbd {
  font: 500 11px/1 var(--font); padding: 3px 6px; border-radius: 6px;
  border: 1px solid var(--line-2); background: var(--glass); color: var(--text-2);
}
:focus-visible { outline: 2px solid rgba(255, 140, 190, 0.8); outline-offset: 2px; }

.icon { display: inline-flex; width: 18px; height: 18px; flex: none; }
.icon svg { width: 100%; height: 100%; }
.icon.big { width: 30px; height: 30px; }

.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.center-screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 18px; gap: 22px; }
.card-narrow { padding: 32px; max-width: 420px; display: grid; gap: 14px; text-align: center; }
.brandmark { display: flex; align-items: center; gap: 10px; font: 600 15px var(--display); letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-2); }
.logo-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 18px rgba(255, 95, 162, 0.8); display: inline-block; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--glass-2); color: var(--text); font-weight: 550; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: transform 0.2s var(--ease-out), background 0.2s, border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.btn:hover { background: rgba(255, 255, 255, 0.11); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.55; pointer-events: none; }
.btn.primary { background: var(--grad); border-color: transparent; color: #1a0b18; box-shadow: 0 10px 30px -10px rgba(255, 95, 162, 0.7); }
.btn.primary:hover { box-shadow: 0 14px 36px -10px rgba(255, 95, 162, 0.9); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn.small { height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn.wide { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease-out);
  text-decoration: none;
}
.icon-btn:hover { background: var(--glass-2); color: var(--text); }
.icon-btn:disabled { opacity: 0.3; pointer-events: none; }
.icon-btn.danger-hover:hover { color: var(--danger); background: rgba(255, 93, 115, 0.12); }

.input {
  width: 100%; height: 46px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: rgba(0, 0, 0, 0.25); color: var(--text);
  font: inherit; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
textarea.input { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.55; }
.input::placeholder { color: rgba(141, 146, 180, 0.7); }
.input:focus { outline: none; border-color: rgba(255, 130, 180, 0.7); box-shadow: 0 0 0 4px rgba(255, 95, 162, 0.15); background: rgba(0, 0, 0, 0.35); }
.input[type='date'], .input[type='time'] { color-scheme: dark; }
.input-xl { height: 56px; font: 600 22px var(--display); letter-spacing: -0.01em; }
.input-sm { height: 36px; width: auto; padding: 0 10px; font-size: 13.5px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
select option { background: var(--panel-solid); }
.field { display: grid; gap: 7px; min-width: 0; align-content: start; }
.label { font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.field-hint { font-size: 12.5px; color: var(--muted); min-height: 1em; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stack { display: grid; gap: 18px; }
.stack-sm { display: grid; gap: 8px; justify-items: start; }
.actions-right { display: flex; justify-content: flex-end; gap: 10px; }
.form-error { color: #ff9aa9; font-size: 14px; min-height: 0; }
.form-error:empty { display: none; }

.switch-row { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; color: var(--text-2); }
.switch-row span:last-child { display: inline-flex; align-items: center; gap: 6px; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 44px; height: 26px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); position: relative; transition: background 0.25s; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.3s var(--ease-spring); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); }
.switch-row input:checked + .switch { background: var(--accent); }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.switch-row input:focus-visible + .switch { outline: 2px solid rgba(255, 140, 190, 0.8); outline-offset: 2px; }
.switch-row.big { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--glass); border: 1px solid var(--line); }

.segmented { display: flex; padding: 4px; gap: 4px; border-radius: 14px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); }
.segmented button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 550; font-size: 14px; transition: background 0.25s, color 0.25s; }
.segmented button.on { background: var(--glass-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }

.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 550; color: var(--text-2); background: var(--glass-2); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip .icon { width: 13px; height: 13px; }
.cdot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); display: inline-block; flex: none; }
.cat-chip { color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.span-chip { color: var(--text); background: linear-gradient(90deg, color-mix(in srgb, var(--c) 30%, transparent), color-mix(in srgb, var(--c) 8%, transparent)); }
.milestone-chip { color: #ffd38a; background: rgba(255, 192, 97, 0.14); }
.age-chip { font: 600 12px var(--display); color: var(--warm); letter-spacing: 0.01em; }
.tag { border: 1px solid var(--line-2); background: transparent; color: var(--text-2); border-radius: 99px; padding: 4px 11px; font-size: 13px; cursor: pointer; transition: all 0.2s; }
.tag:hover { border-color: var(--accent); color: var(--text); }

.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { height: 40px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); cursor: pointer; transition: all 0.2s var(--ease-out); }
.choice:hover { border-color: rgba(255, 255, 255, 0.3); }
.choice.on { background: var(--grad); color: #1a0b18; border-color: transparent; font-weight: 600; }

.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08), 0 0 24px rgba(255, 95, 162, 0.25); }
.avatar-initials { display: grid; place-items: center; background: var(--grad); color: #1a0b18; font: 700 15px var(--display); }
.avatar-sm { width: 36px; height: 36px; font-size: 13px; }
.avatar-lg { width: 72px; height: 72px; font-size: 24px; }
.avatar-xl { width: 96px; height: 96px; font-size: 30px; overflow: hidden; }
.avatar-xl img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xl .icon { width: 40px; height: 40px; }

/* toasts */
#toasts { position: fixed; z-index: 100; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; width: min(92vw, 460px); }
.toast { padding: 12px 18px; border-radius: 14px; background: rgba(24, 24, 40, 0.92); border: 1px solid var(--line-2); backdrop-filter: blur(18px); box-shadow: 0 18px 50px -10px rgba(0, 0, 0, 0.7); font-size: 14px; opacity: 0; transform: translateY(16px) scale(0.96); transition: all 0.4s var(--ease-out); text-align: center; }
.toast.in { opacity: 1; transform: none; }
.toast-success { border-color: rgba(75, 227, 160, 0.35); }
.toast-error { border-color: rgba(255, 93, 115, 0.45); color: #ffc4cc; }

/* confirm dialog */
.dialog-wrap { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: rgba(4, 4, 10, 0.6); backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.25s; }
.dialog-wrap.open { opacity: 1; }
.dialog { width: min(420px, 100%); padding: 26px; border-radius: 22px; background: var(--panel-solid); border: 1px solid var(--line-2); display: grid; gap: 12px; transform: scale(0.94) translateY(10px); transition: transform 0.35s var(--ease-spring); }
.dialog-wrap.open .dialog { transform: none; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* ==========================================================================
   Timeline
   ========================================================================== */
.tl-shell { position: relative; min-height: 100vh; padding-top: calc(var(--topbar-h) + 90px); padding-bottom: 46vh; }

.topbar {
  position: fixed; z-index: 20; top: 0; left: 0; right: 0; height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px 0 14px;
  background: linear-gradient(180deg, rgba(7, 7, 13, 0.94), rgba(7, 7, 13, 0.82));
  backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid var(--line);
}
.brand { min-width: 0; }
.brand-btn { display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 6px; border-radius: 16px; cursor: pointer; text-align: left; min-width: 0; }
.brand-btn:hover { background: var(--glass); }
.brand-text { display: grid; min-width: 0; }
.brand-text h1 { font-size: 18px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.public-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); padding: 5px 10px; border-radius: 99px; background: var(--glass); border: 1px solid var(--line); }
.public-chip .icon { width: 14px; height: 14px; }
.search-btn { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--glass); color: var(--muted); cursor: pointer; min-width: 230px; transition: all 0.2s; }
.search-btn:hover { border-color: var(--line-2); color: var(--text); background: var(--glass-2); }
.search-btn .search-label { flex: 1; text-align: left; font-size: 14px; }

/* HUD odometer */
.hud {
  position: fixed; z-index: 15; top: calc(var(--topbar-h) + 14px); left: 50%; transform: translateX(-50%);
  display: grid; justify-items: center; gap: 4px; pointer-events: none;
}
.hud-main {
  display: flex; align-items: center; gap: 12px; padding: 9px 18px; border-radius: 99px;
  background: rgba(14, 14, 26, 0.7); border: 1px solid var(--line-2); backdrop-filter: blur(16px);
  font: 600 15px var(--display); font-variant-numeric: tabular-nums; letter-spacing: 0.01em;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.7), 0 0 calc(var(--warp) * 50px) rgba(255, 95, 162, calc(var(--warp) * 0.7));
  transition: box-shadow 0.2s, transform 0.3s var(--ease-out);
}
.hud-date { color: var(--text); min-width: 7.5em; text-align: right; }
.hud-age { color: var(--warm); min-width: 6.5em; }
.hud-sep { width: 5px; height: 5px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 10px var(--accent); }
.hud-speed {
  font: 600 11.5px var(--display); letter-spacing: 0.14em; text-transform: uppercase;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: 0; transform: translateY(-6px); transition: opacity 0.3s, transform 0.3s var(--ease-out); white-space: pre;
}
.hud.fast .hud-main { transform: scale(1.05); }
.hud.fast .hud-speed { opacity: 1; transform: none; }

.tl-playhead {
  position: fixed; z-index: 2; top: 42vh; left: var(--spine-x); width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.5) 0 2px, rgba(255, 140, 190, 0.25) 3px, transparent 15px);
  box-shadow: 0 0 calc(10px + var(--warp) * 40px) rgba(255, 95, 162, calc(0.25 + var(--warp) * 0.5));
}
.few .tl-playhead, .few .hud { display: none; }

/* spine + items */
.tl { position: relative; max-width: 1180px; margin: 0 auto; padding: 0 24px; transform: skewY(var(--skew, 0deg)); will-change: transform; }
.tl-spine {
  position: absolute; top: -60px; bottom: -40vh; left: var(--spine-x); width: 2px; margin-left: -1px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.22) 80px, rgba(255, 255, 255, 0.22) calc(100% - 200px), transparent);
  box-shadow: 0 0 calc(var(--warp) * 22px) rgba(255, 150, 200, calc(var(--warp) * 0.8));
}
.tl-spine::before { content: ''; position: absolute; inset: 0; background: var(--grad); opacity: calc(0.2 + var(--warp) * 0.8); filter: blur(1px); transition: opacity 0.2s; }
.tl-spans { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.tl-items { position: relative; z-index: 2; }

.span-bar {
  --lane: 0;
  position: absolute; width: 5px; padding: 0; border: 0; border-radius: 99px; cursor: pointer; pointer-events: auto;
  left: calc(var(--spine-x) - 16px - var(--lane) * 10px);
  background: linear-gradient(180deg, var(--c), color-mix(in srgb, var(--c) 45%, transparent));
  box-shadow: 0 0 14px color-mix(in srgb, var(--c) 60%, transparent);
  opacity: 0.85; transition: opacity 0.2s, width 0.2s, box-shadow 0.2s;
}
.span-bar.start-bottom { background: linear-gradient(0deg, var(--c), color-mix(in srgb, var(--c) 45%, transparent)); }
.span-bar::before, .span-bar::after { content: ''; position: absolute; left: 50%; width: 11px; height: 11px; margin-left: -5.5px; border-radius: 50%; background: var(--bg); border: 2px solid var(--c); }
.span-bar::before { top: -4px; }
.span-bar::after { bottom: -4px; }
.span-bar:hover { opacity: 1; width: 7px; box-shadow: 0 0 24px var(--c); }

.tl-year { position: relative; display: grid; justify-items: center; padding: 70px 0 34px; text-align: center; }
.year-num {
  font: 700 clamp(64px, 11vw, 132px)/0.9 var(--display); letter-spacing: -0.05em;
  color: transparent; -webkit-text-stroke: 1.2px rgba(255, 255, 255, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0));
  -webkit-background-clip: text; background-clip: text;
  position: relative; z-index: 1; padding: 0 0.2em; background-color: transparent;
}
.year-sub { margin-top: 10px; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); background: var(--bg); padding: 4px 12px; border-radius: 99px; border: 1px solid var(--line); position: relative; z-index: 1; }
.tl-year:not(.in) .year-num { opacity: 0.2; transform: translateY(30px) scale(0.9); }
.tl-year .year-num { transition: opacity 0.8s, transform 0.9s var(--ease-out); }

.tl-month { position: relative; height: 34px; }
.tl-month span {
  position: absolute; top: 50%; left: var(--spine-x); transform: translate(-50%, -50%);
  font: 600 10.5px var(--display); letter-spacing: 0.2em; color: var(--muted);
  background: var(--bg); padding: 3px 8px; border-radius: 99px; border: 1px solid var(--line);
}

/* moments */
.moment { position: relative; width: 50%; padding: 6px 0 26px; }
.moment.side-left { margin-right: 50%; padding-right: 56px; display: flex; justify-content: flex-end; }
.moment.side-right { margin-left: 50%; padding-left: 56px; }
.moment-dot {
  position: absolute; top: 22px; width: 16px; height: 16px; border-radius: 50%; z-index: 3;
  background: var(--bg); border: 3px solid var(--c); box-shadow: 0 0 0 4px var(--bg), 0 0 18px var(--c);
  display: grid; place-items: center; transition: transform 0.4s var(--ease-spring), box-shadow 0.3s;
}
.side-left .moment-dot { right: -8px; }
.side-right .moment-dot { left: -8px; }
.is-milestone .moment-dot { width: 26px; height: 26px; top: 17px; border-width: 0; background: var(--c); color: #1a0b18; }
.side-left.is-milestone .moment-dot { right: -13px; }
.side-right.is-milestone .moment-dot { left: -13px; }
.is-milestone .moment-dot .icon { width: 15px; height: 15px; }
.is-milestone .moment-dot .icon svg { fill: currentColor; }
.moment-stem { position: absolute; top: 29px; height: 2px; width: 44px; background: linear-gradient(90deg, var(--c), transparent); opacity: 0.6; }
.side-left .moment-stem { right: 10px; transform: scaleX(-1); }
.side-right .moment-stem { left: 10px; }

.moment-card {
  display: block; width: 100%; max-width: 470px; padding: 0; text-align: left; cursor: pointer;
  border-radius: var(--radius); overflow: hidden; color: var(--text);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px -24px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: opacity 0.7s var(--ease-out), translate 0.8s var(--ease-out), scale 0.8s var(--ease-out),
              border-color 0.3s, box-shadow 0.35s, background 0.3s;
  opacity: 0; translate: 0 60px; scale: 0.92;
}
.moment.in .moment-card { opacity: 1; translate: 0 0; scale: 1; }
.moment-card:hover { border-color: color-mix(in srgb, var(--c) 55%, transparent); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.9), 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent), 0 0 40px -10px var(--c); }
.moment.in .moment-card:hover { translate: 0 -3px; }
.moment.focus .moment-card { border-color: color-mix(in srgb, var(--c) 45%, transparent); background: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035)); }
.moment.focus .moment-dot { transform: scale(1.25); box-shadow: 0 0 0 4px var(--bg), 0 0 28px var(--c); }
.moment.pulse .moment-card { animation: pulse 1.4s var(--ease-out); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--c); } 40% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 40%, transparent), 0 0 80px var(--c); } 100% { box-shadow: 0 20px 50px -24px rgba(0, 0, 0, 0.8); } }

.moment-cover { position: relative; aspect-ratio: 16 / 10; background: rgba(0, 0, 0, 0.4); overflow: hidden; }
.moment-cover img, .moment-cover video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.2s var(--ease-out); }
.moment-card:hover .moment-cover img, .moment-card:hover .moment-cover video { transform: scale(1.05); }
.moment-cover::after { content: ''; position: absolute; inset: auto 0 0 0; height: 40%; background: linear-gradient(0deg, rgba(10, 10, 20, 0.55), transparent); pointer-events: none; }
.thumb-video { position: relative; width: 100%; height: 100%; }
.play-badge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: rgba(10, 10, 20, 0.45); backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, 0.3); z-index: 1; }
.play-badge .icon svg { fill: #fff; stroke: none; }
.media-count { position: absolute; right: 10px; bottom: 10px; z-index: 1; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 99px; background: rgba(10, 10, 20, 0.6); backdrop-filter: blur(8px); }
.media-count .icon { width: 14px; height: 14px; }
.moment-body { padding: 16px 18px 18px; display: grid; gap: 7px; }
.moment-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); }
.moment-date { font-weight: 550; letter-spacing: 0.01em; }
.moment-title { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; }
.moment-desc { color: var(--text-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.moment-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

.is-span .moment-card { border-left: 3px solid var(--c); }
.is-span.side-left .moment-card { border-left: 1px solid var(--line); border-right: 3px solid var(--c); }

/* today + empty */
.tl-today { position: relative; display: grid; justify-items: center; padding: 50px 0 20px; }
.today-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 0 6px rgba(255, 95, 162, 0.15), 0 0 30px var(--accent); animation: beat 2.4s ease-in-out infinite; }
@keyframes beat { 50% { box-shadow: 0 0 0 14px rgba(255, 95, 162, 0.05), 0 0 50px var(--accent); } }
.today-label { margin-top: 14px; display: grid; justify-items: center; gap: 2px; background: var(--bg); padding: 8px 16px; border-radius: 16px; position: relative; }
.today-label strong { font: 700 22px var(--display); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.today-label span { font-size: 13px; color: var(--muted); }
.today-age { font: 600 13px var(--display) !important; color: var(--warm) !important; }
.tl-empty { display: grid; justify-items: center; padding: 30px 0; position: relative; z-index: 3; }
.empty-card { max-width: 440px; padding: 30px; display: grid; gap: 12px; justify-items: center; text-align: center; }
.empty-card .icon { color: var(--warm); }

/* scrubber */
.scrubber { position: fixed; z-index: 16; top: calc(var(--topbar-h) + 26px); bottom: calc(28px + var(--safe-b)); right: 8px; width: 50px; cursor: ns-resize; touch-action: none; user-select: none; }
.scrub-track { position: absolute; top: 0; bottom: 0; right: 10px; width: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); }
.scrub-ticks .tick { position: absolute; right: 7px; width: 8px; height: 2px; margin-top: -1px; border-radius: 2px; background: var(--c); opacity: 0.55; }
.scrub-ticks .tick.big { right: 5px; width: 12px; opacity: 0.95; box-shadow: 0 0 6px var(--c); }
.scrub-year { position: absolute; right: 22px; transform: translateY(-50%); padding: 2px 4px; border: 0; background: transparent; cursor: pointer; font: 600 10.5px var(--display); color: var(--muted); letter-spacing: 0.04em; transition: color 0.2s; }
.scrub-year:hover { color: var(--text); }
.scrub-thumb { position: absolute; right: 3px; width: 16px; height: 34px; margin-top: -17px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.35); box-shadow: 0 0 calc(10px + var(--warp) * 30px) rgba(255, 95, 162, 0.6); pointer-events: none; transition: transform 0.2s var(--ease-out); }
.scrubber:hover .scrub-thumb, .scrubber.dragging .scrub-thumb { transform: scaleX(1.25); background: rgba(255, 140, 190, 0.3); }
.scrub-bubble { position: absolute; right: 54px; transform: translateY(-50%); white-space: nowrap; padding: 7px 12px; border-radius: 12px; background: rgba(20, 20, 36, 0.95); border: 1px solid var(--line-2); font: 600 13px var(--display); opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.scrubber.dragging .scrub-bubble { opacity: 1; }

.fab {
  position: fixed; z-index: 18; right: 78px; bottom: calc(28px + var(--safe-b));
  width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--grad); color: #1a0b18; box-shadow: 0 16px 40px -10px rgba(255, 95, 162, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.35s var(--ease-spring), box-shadow 0.3s;
}
.fab .icon { width: 26px; height: 26px; }
.fab .icon svg { stroke-width: 2.4; }
.fab:hover { transform: rotate(90deg) scale(1.08); box-shadow: 0 20px 50px -10px rgba(255, 95, 162, 1); }

/* ==========================================================================
   Overlays
   ========================================================================== */
.ov-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 28px; background: rgba(4, 4, 10, 0.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; transition: opacity 0.28s; }
.ov-wrap.open { opacity: 1; }
.ov-panel { position: relative; outline: none; display: flex; flex-direction: column; max-height: 100%; background: var(--panel-solid); border: 1px solid var(--line-2); box-shadow: 0 40px 120px -20px rgba(0, 0, 0, 0.9); }
.ov-sheet { width: min(760px, 100%); max-height: min(920px, 100%); border-radius: 28px; overflow: hidden; transform: translateY(40px) scale(0.96); transition: transform 0.45s var(--ease-out); }
.ov-sheet.editor, .ov-sheet.settings { height: min(920px, 100%); }
.ov-sheet.settings { width: min(940px, 100%); }
.ov-wrap.open .ov-sheet { transform: none; }
.ov-wrap.closing .ov-sheet { transform: translateY(30px) scale(0.97); }
.ov-sheet::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 220px; background: radial-gradient(500px 200px at 20% 0, color-mix(in srgb, var(--c, #ff5fa2) 22%, transparent), transparent 70%); pointer-events: none; }
.sheet-head { position: relative; display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px 24px; flex: none; }
.sheet-head h2 { flex: 1; font-size: 20px; }
.sheet-scroll { position: relative; flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.sheet-foot { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px 0 calc(4px + var(--safe-b)); margin-top: 6px; background: linear-gradient(0deg, var(--panel-solid) 70%, transparent); }
.detail-head { padding-left: 12px; }
.detail-nav { display: flex; gap: 4px; }

/* carousel */
.carousel { position: relative; background: #000; }
.car-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.car-track::-webkit-scrollbar { display: none; }
.car-slide { flex: 0 0 100%; scroll-snap-align: center; margin: 0; position: relative; display: grid; place-items: center; max-height: 62vh; aspect-ratio: 4 / 3; }
.car-slide img, .car-slide video { width: 100%; height: 100%; max-height: 62vh; display: block; }
.fit-cover img { object-fit: cover; cursor: zoom-in; }
.fit-cover video, .fit-contain img, .fit-contain video { object-fit: contain; }
.car-slide figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 20px 14px; font-size: 13.5px; color: var(--text-2); background: linear-gradient(0deg, rgba(0, 0, 0, 0.7), transparent); pointer-events: none; }
.car-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(10, 10, 20, 0.5); backdrop-filter: blur(8px); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity 0.2s; }
.carousel:hover .car-btn { opacity: 1; }
.car-btn.prev { left: 12px; }
.car-btn.next { right: 12px; }
.car-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.car-dots i { width: 6px; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.4); transition: all 0.3s var(--ease-out); }
.car-dots i.on { width: 20px; background: #fff; }

.detail-body { padding: 24px 28px 40px; display: grid; gap: 14px; }
.detail-kicker { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-title { font-size: clamp(26px, 4vw, 34px); font-weight: 650; letter-spacing: -0.025em; }
.detail-when { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; color: var(--text-2); font-size: 14px; }
.detail-when > span { display: inline-flex; align-items: center; gap: 6px; }
.detail-when .icon { width: 16px; height: 16px; color: var(--muted); }
.detail-desc { white-space: pre-wrap; font-size: 16px; line-height: 1.7; color: var(--text-2); overflow-wrap: anywhere; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* lightbox */
.ov-wrap-lightbox { padding: 0; background: rgba(0, 0, 0, 0.94); z-index: 60; }
.ov-lightbox { width: 100%; height: 100%; background: transparent; border: 0; box-shadow: none; justify-content: center; }
.ov-lightbox .carousel { background: transparent; height: 100%; }
.ov-lightbox .car-track { height: 100%; }
.ov-lightbox .car-slide { aspect-ratio: auto; max-height: none; height: 100%; }
.ov-lightbox .car-slide img, .ov-lightbox .car-slide video { max-height: 100vh; cursor: default; }
.lb-close, .lb-download { position: absolute; z-index: 2; top: 16px; background: rgba(255, 255, 255, 0.1); }
.lb-close { right: 16px; }
.lb-download { right: 64px; }

/* ==========================================================================
   Editor
   ========================================================================== */
.editor-form { padding: 6px 24px 0; display: grid; gap: 22px; align-content: start; }
.quick-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.qchip { height: 28px; padding: 0 10px; border-radius: 99px; border: 1px dashed var(--line-2); background: transparent; color: var(--text-2); font-size: 12.5px; cursor: pointer; }
.qchip:hover { border-style: solid; border-color: var(--accent); color: var(--text); }
.cat-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-opt { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px; border-radius: 99px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); cursor: pointer; font-size: 13.5px; transition: all 0.2s var(--ease-out); }
.cat-opt:hover { border-color: color-mix(in srgb, var(--c) 60%, transparent); }
.cat-opt.on { background: color-mix(in srgb, var(--c) 18%, transparent); border-color: var(--c); color: var(--text); box-shadow: 0 0 20px -6px var(--c); }
.dropzone { display: grid; justify-items: center; gap: 4px; padding: 26px; border-radius: 18px; border: 1.5px dashed var(--line-2); background: rgba(255, 255, 255, 0.02); cursor: pointer; text-align: center; transition: all 0.25s; }
.dropzone .icon { color: var(--accent); margin-bottom: 4px; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: rgba(255, 95, 162, 0.06); }
.dropzone.over { transform: scale(1.01); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.media-grid:empty { display: none; }
.media-tile { position: relative; border-radius: 14px; overflow: hidden; background: #000; border: 1px solid var(--line); aspect-ratio: 1; }
.media-tile img, .media-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-tile.cover { border-color: var(--warm); box-shadow: 0 0 0 2px rgba(255, 179, 122, 0.5); }
.media-tile.queued { opacity: 0.85; }
.tile-actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
.tile-btn { width: 30px; height: 30px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: rgba(10, 10, 20, 0.65); backdrop-filter: blur(6px); }
.tile-btn .icon { width: 15px; height: 15px; }
.tile-btn:hover { background: rgba(255, 95, 162, 0.7); }
.tile-badge { position: absolute; top: 8px; left: 8px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--warm); color: #1a0b18; }
.tile-badge.pending { background: rgba(10, 10, 20, 0.7); color: var(--text-2); }
.tile-caption { position: absolute; left: 0; right: 0; bottom: 0; border: 0; padding: 8px 10px; font: 12px var(--font); color: #fff; background: linear-gradient(0deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.3)); }
.tile-caption:focus { outline: none; background: rgba(0, 0, 0, 0.9); }
.progress { flex: 1; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--grad); transition: width 0.2s; }

/* ==========================================================================
   Search palette
   ========================================================================== */
.ov-wrap-palette { align-items: flex-start; padding-top: 12vh; }
.ov-palette { width: min(680px, 100%); max-height: 72vh; border-radius: 24px; overflow: hidden; transform: translateY(-16px) scale(0.97); transition: transform 0.35s var(--ease-out); }
.ov-wrap.open .ov-palette { transform: none; }
.palette-bar { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 20px; border-bottom: 1px solid var(--line); }
.palette-bar > .icon { color: var(--accent); width: 20px; height: 20px; }
.palette-input { flex: 1; height: 50px; border: 0; background: transparent; color: var(--text); font: 500 19px var(--font); outline: none; }
.palette-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.fchip { height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); cursor: pointer; font-size: 13px; }
.fchip span { display: inline-flex; align-items: center; gap: 6px; }
.fchip .icon { width: 14px; height: 14px; }
.fchip.on { background: rgba(255, 95, 162, 0.16); border-color: var(--accent); color: var(--text); }
.fselect { height: 32px; border-radius: 99px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); padding: 0 10px; font: 13px var(--font); }
.fdate { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.fdate input { height: 32px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); padding: 0 8px; font: 13px var(--font); color-scheme: dark; }
.palette-results { flex: 1; overflow-y: auto; padding: 8px; }
.result { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px; border-radius: 14px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.result.active { background: var(--glass-2); box-shadow: inset 3px 0 0 var(--c); }
.result-thumb { width: 56px; height: 56px; border-radius: 12px; overflow: hidden; flex: none; background: color-mix(in srgb, var(--c) 18%, transparent); display: grid; place-items: center; color: var(--c); }
.result-thumb img, .result-thumb video { width: 100%; height: 100%; object-fit: cover; }
.result-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.result-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-meta { font-size: 12.5px; color: var(--muted); }
.result-snippet { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-go { color: var(--muted); opacity: 0; transition: opacity 0.2s; }
.result.active .result-go { opacity: 1; }
.palette-empty { padding: 40px 20px; text-align: center; color: var(--text-2); display: grid; gap: 6px; }
.palette-hint { display: flex; flex-wrap: wrap; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.palette-hint kbd { margin-right: 3px; }

/* ==========================================================================
   Settings
   ========================================================================== */
.settings-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 200px 1fr; }
.settings-nav { display: grid; align-content: start; gap: 4px; padding: 10px 12px 20px 16px; border-right: 1px solid var(--line); }
.snav { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px; border-radius: 12px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; font-weight: 550; text-align: left; }
.snav:hover { background: var(--glass); }
.snav.on { background: var(--glass-2); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.settings-body { padding: 10px 28px 40px; display: grid; gap: 30px; }
.s-section { display: grid; gap: 14px; }
.s-section > p.muted { margin-top: -8px; font-size: 14px; }
.avatar-row { display: flex; align-items: center; gap: 18px; }
.copy-row { display: flex; gap: 10px; align-items: center; }
.copy-row .input { flex: 1; }
.user-list { display: grid; gap: 8px; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); }
.user-info { flex: 1; min-width: 0; display: grid; }
.user-info strong { display: flex; align-items: center; gap: 8px; }
.user-info .muted { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.you { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 7px; border-radius: 99px; background: rgba(255, 95, 162, 0.18); color: #ffb3d0; }
.shortcuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.shortcuts > div { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); }
.shortcuts kbd { min-width: 46px; text-align: center; }

/* ==========================================================================
   Setup & login
   ========================================================================== */
.setup-card { width: min(560px, 100%); padding: 30px; display: grid; gap: 20px; overflow: hidden; }
.setup-dots { display: flex; gap: 6px; }
.setup-dots i { height: 4px; flex: 1; border-radius: 99px; background: rgba(255, 255, 255, 0.1); transition: background 0.4s; }
.setup-dots i.done { background: rgba(255, 140, 190, 0.5); }
.setup-dots i.on { background: var(--grad); }
.setup-stage { min-height: 300px; }
.step { display: grid; gap: 12px; align-content: start; opacity: 0; transition: opacity 0.45s var(--ease-out), transform 0.55s var(--ease-out); }
.step.from-right { transform: translateX(50px); }
.step.from-left { transform: translateX(-50px); }
.step.in { opacity: 1; transform: none; }
.step > h2 + p { margin-bottom: 10px; }
.step-hero { display: grid; gap: 18px; justify-items: start; padding: 10px 0; }
.hero-orb { width: 64px; height: 64px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 80px rgba(255, 95, 162, 0.7); animation: orb 4s ease-in-out infinite; }
.display { font-size: clamp(34px, 7vw, 48px); font-weight: 700; letter-spacing: -0.04em; line-height: 1.02; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 16.5px; color: var(--text-2); line-height: 1.6; }
.setup-actions { display: flex; align-items: center; gap: 10px; }
.avatar-pick { display: flex; align-items: center; gap: 16px; }
#app.liftoff .setup-card, #app.liftoff .brandmark { transition: transform 0.9s cubic-bezier(0.7, 0, 0.84, 0), opacity 0.8s; transform: translateY(-40vh) scale(0.6); opacity: 0; }

.login-card { width: min(400px, 100%); padding: 32px; display: grid; gap: 16px; text-align: center; }
.login-card .field { text-align: left; }
.login-mark { display: grid; justify-items: center; margin-bottom: 4px; }
.login-mark .logo-dot { width: 26px; height: 26px; }
.shake { animation: shake 0.45s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1000px) {
  .search-btn { min-width: 0; }
  .search-btn .search-label, .search-btn kbd { display: none; }
  .search-btn { width: 40px; padding: 0; justify-content: center; }
}

@media (max-width: 760px) {
  :root { --spine-x: 26px; --topbar-h: 60px; }
  body { font-size: 14.5px; }
  .topbar { padding: 0 8px 0 6px; }
  .brand-text h1 { font-size: 16px; }
  .public-chip { display: none; }
  .tl-shell { padding-top: calc(var(--topbar-h) + 70px); }
  .tl { padding: 0 44px 0 0; }
  .moment, .moment.side-left, .moment.side-right { width: 100%; margin: 0; padding: 4px 0 20px 52px; display: block; }
  .moment .moment-dot, .side-left .moment-dot, .side-right .moment-dot { left: calc(var(--spine-x) - 8px); right: auto; }
  .is-milestone .moment-dot, .side-left.is-milestone .moment-dot, .side-right.is-milestone .moment-dot { left: calc(var(--spine-x) - 13px); right: auto; }
  .moment-stem, .side-left .moment-stem { left: calc(var(--spine-x) + 10px); right: auto; width: 16px; transform: none; }
  .is-span.side-left .moment-card { border-right: 1px solid var(--line); border-left: 3px solid var(--c); }
  .moment-card { max-width: none; }
  .span-bar { left: calc(var(--spine-x) + 10px + var(--lane) * 7px); width: 4px; }
  .tl-year { justify-items: start; padding: 50px 0 24px 46px; text-align: left; }
  .year-num { font-size: 72px; }
  .tl-month span { left: var(--spine-x); }
  .tl-today { justify-items: start; padding-left: calc(var(--spine-x) - 9px); }
  .today-label { justify-items: start; margin-left: 18px; margin-top: -26px; padding-left: 22px; }
  .hud { top: calc(var(--topbar-h) + 10px); }
  .hud-main { padding: 7px 14px; font-size: 13.5px; gap: 9px; }
  .scrubber { width: 36px; right: 2px; }
  .scrub-year { display: none; }
  .scrubber.dragging .scrub-year { display: block; }
  .scrub-bubble { right: 40px; }
  .fab { right: 46px; bottom: calc(18px + var(--safe-b)); width: 56px; height: 56px; }

  .ov-wrap { padding: 0; align-items: flex-end; }
  .ov-sheet { width: 100%; max-height: calc(100% - 28px); }
  .ov-sheet.editor, .ov-sheet.settings { height: calc(100% - 28px); }
  .ov-sheet { border-radius: 26px 26px 0 0; transform: translateY(100%); transition: transform 0.45s var(--ease-out); }
  .ov-wrap.closing .ov-sheet { transform: translateY(100%); }
  .ov-wrap-palette { align-items: flex-start; padding: 10px; }
  .ov-palette { max-height: 85vh; }
  .palette-hint { display: none; }
  .car-slide { aspect-ratio: 1; }
  .car-btn { display: none; }
  .detail-body { padding: 20px 20px 40px; }
  .editor-form { padding: 6px 18px 0; }
  .row-2 { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .settings-nav { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 4px 14px 10px; gap: 6px; scrollbar-width: none; }
  .snav { flex: none; height: 36px; font-size: 13.5px; }
  .snav.on { box-shadow: inset 0 -2px 0 var(--accent); }
  .settings-body { padding: 16px 18px 40px; }
  .user-row { flex-wrap: wrap; }
  .setup-card { padding: 22px; }
}

/* ==========================================================================
   Motion preferences
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .tl { transform: none; }
  .moment-card { opacity: 1; translate: none; scale: none; }
}

/* ==========================================================================
   Media processing states & private photo details
   ========================================================================== */
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.18); border-top-color: var(--accent); animation: spin 0.9s linear infinite; display: inline-block; flex: none; }
.spinner.big { width: 34px; height: 34px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.thumb-pending, .tile-generic {
  width: 100%; height: 100%; display: grid; place-items: center; align-content: center; gap: 10px; text-align: center;
  padding: 12px; font-size: 13px; color: var(--text-2);
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.03) 30%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 70%);
  background-size: 250% 100%; animation: shimmer 1.8s linear infinite;
}
.tile-generic span:last-child { font-size: 11.5px; word-break: break-all; color: var(--muted); }
.thumb-pending.failed, .tile-generic.failed { animation: none; background: rgba(255, 93, 115, 0.08); color: #ffb3bf; }
@keyframes shimmer { to { background-position: -150% 0; } }
.thumb-video .duration { position: absolute; left: 10px; bottom: 10px; z-index: 1; font: 600 12px var(--display); padding: 3px 8px; border-radius: 99px; background: rgba(10, 10, 20, 0.6); backdrop-filter: blur(8px); }
.thumb-video img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(10, 10, 20, 0.5); pointer-events: none; }
.tile-play .icon svg { fill: #fff; stroke: none; }
.dz-note { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--muted); max-width: 440px; text-align: left; }
.dz-note .icon { width: 15px; height: 15px; color: var(--ok); flex: none; }

.slide-pending { display: grid; place-items: center; align-content: center; gap: 12px; width: 100%; height: 100%; min-height: 260px; padding: 24px; text-align: center; color: var(--text-2); }
.slide-pending.failed { color: #ffb3bf; }
.slide-info { position: absolute; top: 12px; left: 12px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(10, 10, 20, 0.55); backdrop-filter: blur(8px); display: grid; place-items: center; cursor: pointer; color: #fff; }
.slide-info:hover { background: rgba(255, 95, 162, 0.5); }
.meta-panel {
  position: absolute; inset: 0; z-index: 3; overflow-y: auto; padding: 56px 22px 22px;
  background: rgba(8, 8, 16, 0.9); backdrop-filter: blur(14px); display: grid; align-content: start; gap: 8px; font-size: 14px; text-align: left;
}
.meta-loading { display: grid; place-items: center; height: 100%; }
.meta-head { display: flex; align-items: center; gap: 8px; color: var(--ok); font-size: 12.5px; margin-bottom: 6px; }
.meta-head .icon { width: 16px; height: 16px; }
.meta-row { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.meta-k { color: var(--muted); font-size: 12.5px; }
.meta-v { color: var(--text); overflow-wrap: anywhere; }
.meta-link { margin-left: 10px; color: var(--warm); text-decoration: none; font-size: 13px; }
.meta-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.meta-all summary { cursor: pointer; color: var(--text-2); margin-top: 10px; font-size: 13px; }
.meta-grid { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 4px 14px; margin-top: 10px; font-size: 12.5px; }

.stat-row { display: flex; flex-wrap: wrap; gap: 8px; }
.stat-pill { display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 14px; border-radius: 99px; background: var(--glass); border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.stat-pill strong { font: 700 16px var(--display); color: var(--text); }
.stat-pill.busy strong { color: var(--warm); }
.stat-pill.bad strong { color: var(--danger); }
.failed-list { display: grid; gap: 6px; }
.failed-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 93, 115, 0.07); }
.failed-item > span { flex: 1; min-width: 0; }
.failed-item .icon { color: var(--danger); }
.actions-left { display: flex; flex-wrap: wrap; gap: 8px; }
.s-section > .btn { justify-self: start; }
