/* ==========================================================================
   Love Bird — design tokens
   ========================================================================== */
:root {
  --paper: #fbf6f1;
  --surface: #ffffff;
  --surface-2: #f5ede6;
  --ink: #1f1a1e;
  --ink-2: #5d5359;
  --ink-3: #8f848a;
  --line: #eadfd6;
  --accent: #e0455d;
  --accent-ink: #ffffff;
  --accent-soft: #fbe3e5;
  --accent-deep: #b92f46;
  --success: #2f8f6b;
  --danger: #c2333f;
  --shadow: 0 1px 2px rgb(60 30 30 / .05), 0 8px 24px -12px rgb(80 30 40 / .18);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
  --sidebar: 240px;
  --tabbar: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16121a;
    --surface: #201a24;
    --surface-2: #2a222e;
    --ink: #f6eef0;
    --ink-2: #c4b7bd;
    --ink-3: #8e8188;
    --line: #372d3a;
    --accent: #ff6178;
    --accent-ink: #1a0d11;
    --accent-soft: #3c1f29;
    --accent-deep: #ff8a9b;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 12px 32px -16px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--paper); color: var(--ink);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-deep); }
button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
p { margin: 0 0 .75rem; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.icon { width: 24px; height: 24px; flex: none; }
.muted { color: var(--ink-3); }
.center { text-align: center; }
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.fineprint { color: var(--ink-3); font-size: 12px; padding: 0 4px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: .75rem; }

/* ==========================================================================
   Layout & navigation
   ========================================================================== */
.main { width: 100%; max-width: 640px; margin: 0 auto; padding: 20px 16px calc(var(--tabbar) + 32px + env(safe-area-inset-bottom)); }
.main-feed { max-width: 1000px; }
.main-wide { max-width: 1080px; }
.is-public .main { padding-bottom: 48px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 650; font-size: 22px; letter-spacing: -.01em; color: var(--ink); }
.brand:hover { color: var(--ink); }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.public-nav { display: flex; align-items: center; gap: 18px; font-weight: 600; font-size: 14px; }
.topbar-public { max-width: 1120px; margin: 0 auto; border-bottom: 0; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; position: static; padding: 18px 20px; }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 30;
  height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; justify-items: center;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar a { display: grid; place-items: center; width: 52px; height: 44px; border-radius: 14px; color: var(--ink-2); transition: color .15s, background .15s; }
.tabbar a.active { color: var(--accent); }
.tabbar a.active .avatar { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--accent); }
.tabbar .tab-upload { background: var(--accent); color: var(--accent-ink); width: 56px; box-shadow: 0 6px 16px -6px var(--accent); }
.tabbar .tab-upload:hover { color: var(--accent-ink); }

.sidebar { display: none; }

@media (min-width: 900px) {
  .topbar:not(.topbar-public), .tabbar, .mobile-logout { display: none; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 20;
    display: flex; flex-direction: column; gap: 28px; padding: 28px 16px;
    border-right: 1px solid var(--line); background: var(--paper);
  }
  .sidebar .brand { padding: 0 12px; }
  body:has(.sidebar) .main { margin-left: calc(var(--sidebar) + max(0px, (100vw - var(--sidebar) - 1000px) / 2)); margin-right: auto; padding-top: 36px; padding-bottom: 48px; }
  body:has(.sidebar) .main:not(.main-feed):not(.main-wide) { margin-left: calc(var(--sidebar) + max(24px, (100vw - var(--sidebar) - 640px) / 2)); }
  .side-nav { display: flex; flex-direction: column; gap: 4px; }
  .side-nav a, .side-logout button {
    display: flex; align-items: center; gap: 14px; padding: 11px 12px; border-radius: 14px;
    font-weight: 600; color: var(--ink-2); transition: background .15s, color .15s;
  }
  .side-nav a:hover, .side-logout button:hover { background: var(--surface-2); color: var(--ink); }
  .side-nav a.active { background: var(--accent-soft); color: var(--accent-deep); }
  .side-nav a.active .avatar { box-shadow: 0 0 0 2px var(--accent); }
  .side-logout { margin-top: auto; }
  .side-logout button { width: 100%; background: none; border: 0; cursor: pointer; }
}

/* ==========================================================================
   Components
   ========================================================================== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.page-title { font-family: var(--display); font-weight: 650; font-size: 28px; letter-spacing: -.015em; margin-bottom: 18px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .page-title { margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  --fs: 14px; font-weight: 700; font-size: var(--fs); cursor: pointer; white-space: nowrap;
  transition: transform .12s ease, background .2s, box-shadow .2s, color .2s, border-color .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px -10px var(--accent); }
.btn-primary:hover { background: var(--accent-deep); color: var(--accent-ink); }
.btn-soft { background: var(--accent-soft); color: var(--accent-deep); }
.btn-soft:hover { color: var(--accent-deep); filter: brightness(.97); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { color: #fff; filter: brightness(1.08); }
.btn-sm { min-height: 34px; padding: 0 14px; --fs: 13px; }
.btn-lg { min-height: 50px; padding: 0 26px; --fs: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }

.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: none; color: var(--ink); cursor: pointer; transition: background .15s, color .15s, transform .12s; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn:active { transform: scale(.9); }
.icon-btn.danger:hover { color: var(--danger); }
.icon-btn-sm { width: 30px; height: 30px; }
.icon-btn-sm .icon { width: 16px; height: 16px; }

.like-btn.is-liked { color: var(--accent); }
.like-btn.is-liked .icon { fill: currentColor; }
.like-btn.pop .icon { animation: pop .35s ease; }
@keyframes pop { 40% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* Avatars */
.avatar { border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); }
.avatar-initial {
  display: inline-grid; place-items: center; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, hsl(var(--hue, 350) 70% 62%), hsl(calc(var(--hue, 350) + 40) 70% 52%));
}
.avatar-xs { width: 26px; height: 26px; font-size: 12px; }
.avatar-sm { width: 36px; height: 36px; font-size: 14px; }
.avatar-md { width: 48px; height: 48px; font-size: 18px; }
.avatar-lg { width: 80px; height: 80px; font-size: 30px; }
.avatar-xl { width: 128px; height: 128px; font-size: 48px; box-shadow: 0 0 0 4px var(--paper), 0 0 0 6px var(--accent-soft); }

/* Forms */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > span:first-child { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field textarea, .comment-form input, .search input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--paper);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus, .field textarea:focus, .comment-form input:focus, .search input:focus {
  outline: none; border-color: var(--accent); background: var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.field small { font-size: 12px; color: var(--ink-3); }
.field .error, .error { color: var(--danger); font-weight: 500; }
.has-error input, .has-error textarea { border-color: var(--danger); }
.counter { justify-self: end; }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 70px; }
.reveal { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 12px; font-weight: 700; color: var(--ink-3); cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.reveal:hover { color: var(--ink); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.alert { padding: 12px 14px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--danger); font-weight: 500; margin-bottom: 16px; }

/* Toasts */
.toasts { position: fixed; z-index: 50; left: 50%; transform: translateX(-50%); top: calc(14px + env(safe-area-inset-top)); display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); }
.toast { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 12px 10px 12px 16px; border-radius: 14px; background: var(--ink); color: var(--paper); box-shadow: var(--shadow); font-weight: 500; animation: toast-in .35s cubic-bezier(.2,.9,.3,1.2); }
.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast.hide { opacity: 0; transform: translateY(-8px); transition: .25s; }
.toast-close { border: 0; background: none; color: inherit; opacity: .7; cursor: pointer; display: grid; place-items: center; }
.toast-close .icon { width: 18px; height: 18px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px) scale(.98); } }

/* ==========================================================================
   Feed & posts
   ========================================================================== */
.feed-layout { display: grid; gap: 32px; }
.feed { min-width: 0; max-width: 560px; width: 100%; margin: 0 auto; }
.rail { display: none; }
@media (min-width: 1180px) {
  .feed-layout { grid-template-columns: minmax(0, 560px) 300px; justify-content: center; }
  .rail { display: grid; gap: 16px; align-content: start; position: sticky; top: 36px; }
}
.me { display: flex; align-items: center; gap: 12px; padding: 14px; }
.me span, .post-author span, .person a span { display: grid; line-height: 1.25; }
.me small, .post-author small, .person small { color: var(--ink-3); font-size: 12px; }
.suggestions { padding: 16px; }
.suggestions h2 { font-size: 14px; color: var(--ink-2); margin-bottom: 12px; }
.person { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; }
.person a { display: flex; align-items: center; gap: 10px; min-width: 0; }

.post { margin-bottom: 22px; overflow: hidden; }
.post-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; }
.post-author { display: flex; align-items: center; gap: 10px; min-width: 0; }
.post-author strong { font-size: 14px; }
.post-head time { color: var(--ink-3); font-size: 12px; }
.post-media, .photo-stage { position: relative; display: block; background: var(--surface-2); user-select: none; -webkit-user-select: none; }
.post-media img { width: 100%; height: auto; max-height: 720px; object-fit: cover; }
.post-actions { display: flex; gap: 2px; padding: 6px 8px 0; }
.post-body { padding: 0 16px 16px; }
.likes { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.caption { margin-bottom: 4px; overflow-wrap: anywhere; }
.caption a, .comment p a { font-weight: 700; margin-right: 4px; }
.muted-link { color: var(--ink-3); font-size: 14px; }

.burst { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; color: #fff; opacity: 0; }
.burst .icon { width: 96px; height: 96px; fill: currentColor; stroke: none; filter: drop-shadow(0 6px 18px rgb(0 0 0 / .35)); }
.burst.show { animation: burst .8s ease forwards; }
@keyframes burst { 0% { opacity: 0; transform: scale(.4); } 25% { opacity: 1; transform: scale(1.1); } 45% { transform: scale(.95); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(1); } }

.pager { display: flex; justify-content: center; gap: 10px; margin: 20px 0; }

/* Grids */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: var(--radius); overflow: hidden; }
@media (min-width: 640px) { .grid { gap: 10px; border-radius: 0; overflow: visible; } }
.tile { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--surface-2); }
@media (min-width: 640px) { .tile { border-radius: 14px; } }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.tile-meta { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 4px; background: rgb(20 10 15 / .42); color: #fff; font-weight: 700; opacity: 0; transition: opacity .2s; }
.tile-meta .icon { width: 18px; height: 18px; fill: currentColor; stroke: none; }
@media (hover: hover) {
  .tile:hover img { transform: scale(1.04); }
  .tile:hover .tile-meta { opacity: 1; }
}
.grid-sm { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 900px) { .grid-sm { grid-template-columns: repeat(6, 1fr); } }

/* Explore */
.search { position: relative; flex: 1 1 260px; max-width: 360px; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); }
.search input { padding-left: 38px; border-radius: 999px; background: var(--surface); }
.people-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; }
.chip-person { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; white-space: nowrap; }

/* Empty states */
.empty { text-align: center; padding: 40px 24px; display: grid; justify-items: center; gap: 4px; }
.empty h2 { font-family: var(--display); font-size: 22px; }
.empty p { color: var(--ink-2); max-width: 34ch; }
.empty-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 20px; background: var(--accent-soft); color: var(--accent); margin-bottom: 8px; }
.error-page { margin-top: 8vh; }
.error-page h1 { font-family: var(--display); font-size: 32px; }

/* ==========================================================================
   Photo detail
   ========================================================================== */
.photo-view { display: grid; overflow: hidden; }
.photo-stage { display: grid; place-items: center; background: #0f0b0e; }
.photo-stage img { max-height: 78vh; width: auto; height: auto; }
.photo-side { display: flex; flex-direction: column; min-height: 0; border-top: 1px solid var(--line); }
.photo-side .post-head { border-bottom: 1px solid var(--line); }
.thread { flex: 1; overflow-y: auto; padding: 14px 16px; display: grid; gap: 14px; align-content: start; max-height: 420px; }
.comment { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; }
.comment p { margin: 0; overflow-wrap: anywhere; font-size: 14px; }
.comment time { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.photo-foot { border-top: 1px solid var(--line); padding: 4px 12px 14px; }
.photo-foot .post-actions { padding: 4px 0 0; }
.photo-foot .likes { padding: 0 4px; }
.photo-foot .likes time { font-weight: 500; color: var(--ink-3); }
.comment-form { display: flex; gap: 8px; margin-top: 10px; }
.comment-form input { border-radius: 999px; }
@media (min-width: 900px) {
  .photo-view { grid-template-columns: minmax(0, 1fr) 360px; max-height: 82vh; }
  .photo-stage img { max-height: 82vh; }
  .photo-side { border-top: 0; border-left: 1px solid var(--line); }
  .thread { max-height: none; }
}
.more-from { margin-top: 32px; }
.more-from h2 { font-size: 15px; color: var(--ink-2); margin-bottom: 12px; }

/* ==========================================================================
   Profile
   ========================================================================== */
.profile-head { display: grid; justify-items: center; text-align: center; gap: 18px; margin: 8px 0 28px; }
.profile-name h1 { font-family: var(--display); font-size: 28px; font-weight: 650; margin: 0; }
.handle { color: var(--ink-3); }
.stats { list-style: none; display: flex; justify-content: center; gap: 22px; padding: 0; margin: 14px 0; color: var(--ink-2); font-size: 14px; }
.stats strong { color: var(--ink); font-size: 16px; margin-right: 2px; }
.bio { max-width: 44ch; color: var(--ink-2); white-space: pre-line; }
.profile-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
@media (min-width: 640px) {
  .profile-head { grid-template-columns: auto 1fr; justify-items: start; text-align: left; gap: 36px; align-items: center; }
  .stats, .profile-actions { justify-content: flex-start; }
}

/* ==========================================================================
   Upload & settings
   ========================================================================== */
.upload { padding: 22px; }
.dropzone { position: relative; display: grid; place-items: center; min-height: 280px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--paper); cursor: pointer; overflow: hidden; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-empty { display: grid; justify-items: center; gap: 6px; color: var(--ink-2); text-align: center; padding: 20px; pointer-events: none; }
.dz-empty .icon { width: 44px; height: 44px; color: var(--accent); }
.dz-empty small { color: var(--ink-3); }
.dz-preview { max-height: 460px; width: 100%; object-fit: contain; background: #0f0b0e; pointer-events: none; }
.dropzone.has-file { border-style: solid; }
.dropzone.has-file .dz-empty { display: none; }

.settings-block { padding: 22px; margin-bottom: 18px; }
.settings-block h2 { font-size: 17px; margin-bottom: 14px; }
.avatar-edit { display: flex; align-items: center; gap: 18px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }

/* ==========================================================================
   Public pages: landing & auth
   ========================================================================== */
.hero { display: grid; gap: 40px; align-items: center; padding: 24px 4px 48px; }
.hero h1 { font-family: var(--display); font-weight: 650; font-size: clamp(34px, 6vw, 58px); letter-spacing: -.025em; line-height: 1.05; margin-bottom: 18px; }
.hero h1 em { font-style: italic; font-weight: 500; color: var(--accent); }
.lede { font-size: 17px; color: var(--ink-2); max-width: 46ch; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 14px; }
.hero-note { font-size: 14px; color: var(--ink-3); }
.hero-note a { color: var(--accent-deep); font-weight: 700; }
.hero-emblem { display: grid; place-items: center; aspect-ratio: 1; max-width: 380px; margin: 0 auto; border-radius: 40% 60% 55% 45% / 50% 45% 55% 50%; background: radial-gradient(circle at 30% 30%, var(--accent-soft), transparent 70%), var(--surface-2); }
.collage { position: relative; aspect-ratio: 1; max-width: 440px; margin: 0 auto; }
.collage img { position: absolute; width: 46%; aspect-ratio: 1; object-fit: cover; border-radius: 20px; border: 5px solid var(--surface); box-shadow: var(--shadow); }
.collage .c1 { left: 4%; top: 6%; transform: rotate(-6deg); }
.collage .c2 { right: 6%; top: 0; transform: rotate(5deg); }
.collage .c3 { left: 27%; top: 30%; z-index: 2; transform: rotate(-1deg); width: 50%; }
.collage .c4 { left: 0; bottom: 4%; transform: rotate(4deg); }
.collage .c5 { right: 2%; bottom: 0; transform: rotate(-5deg); }
.features { display: grid; gap: 14px; padding-bottom: 32px; }
.feature { padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.feature h3 { font-size: 16px; }
.feature p { color: var(--ink-2); margin: 0; font-size: 14px; }
@media (min-width: 860px) {
  .hero { grid-template-columns: 1.1fr 1fr; padding-top: 56px; }
  .features { grid-template-columns: repeat(3, 1fr); }
}

.is-auth .main { max-width: 440px; padding-top: 4vh; }
.auth-card { padding: 30px 26px; }
.auth-head { display: grid; justify-items: center; text-align: center; gap: 4px; margin-bottom: 22px; }
.auth-head h1 { font-family: var(--display); font-weight: 650; font-size: 28px; margin: 10px 0 0; }
.auth-head p { color: var(--ink-2); margin: 0; }
.auth-switch { text-align: center; margin: 20px 0 0; color: var(--ink-2); font-size: 14px; }
.auth-switch a { color: var(--accent-deep); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.forgot-link { justify-self: end; margin-top: -8px; font-size: 13px; font-weight: 600; color: var(--accent-deep); }

/* ==========================================================================
   Social features (v1.1)
   ========================================================================== */
/* Notification badge / dot */
.side-nav a { position: relative; }
.badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.bell { position: relative; }
.dot { position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--paper); }
.tabbar .dot { top: 9px; right: 13px; }
.topbar-actions { display: flex; gap: 2px; }

/* Post actions */
.post-actions { align-items: center; }
.spacer { flex: 1; }
.save-btn.is-saved { color: var(--ink); }
.save-btn.is-saved .icon { fill: currentColor; }
.save-btn.pop .icon { animation: pop .35s ease; }
.who { font-weight: 700; margin-right: 4px; }
a.tag, a.mention { color: var(--accent-deep); font-weight: 600; }
a.tag:hover, a.mention:hover { text-decoration: underline; }
.liked-by { font-size: 13px; color: var(--ink-2); margin: 0 4px 2px; }
.liked-by a { font-weight: 700; color: var(--ink); }
.stamp { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin: 0 4px 6px; }
.feed-end { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink-3); font-size: 14px; padding: 12px 0 28px; }
.feed-end .icon { width: 18px; height: 18px; color: var(--accent); fill: currentColor; stroke: none; }

/* Comments */
.comment p time { display: inline; margin-left: 8px; }
.reply { border: 0; background: none; padding: 0; margin-left: 10px; font-size: 12px; font-weight: 700; color: var(--ink-3); cursor: pointer; }
.reply:hover { color: var(--ink); }
.comment-form { align-items: center; }
.owner-tools { display: flex; align-items: center; gap: 2px; }
.edit-caption { display: grid; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.edit-caption textarea { width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--paper); resize: vertical; }
.edit-caption textarea:focus { outline: none; border-color: var(--accent); }
.row-end { display: flex; justify-content: flex-end; gap: 8px; }
.more-from h2 a { color: var(--ink); }

/* Chips & tabs */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: 13px; color: var(--accent-deep); }
.chip small { color: var(--ink-3); font-weight: 500; }
.chip:hover { background: var(--accent-soft); }
.tabs { display: flex; justify-content: center; gap: 28px; border-top: 1px solid var(--line); margin: 0 0 16px; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 14px 2px 12px; margin-top: -1px; border-top: 2px solid transparent; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.tabs a .icon { width: 16px; height: 16px; }
.tabs a.active { color: var(--ink); border-top-color: var(--ink); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 600; vertical-align: middle; }
.stats a:hover strong, .stats a:hover { color: var(--accent-deep); }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; margin-bottom: 12px; }
.back-link .icon { width: 20px; height: 20px; }

/* Tag page */
.tag-head { display: flex; align-items: center; gap: 20px; margin: 6px 0 24px; }
.tag-head h1 { font-family: var(--display); font-size: 30px; margin: 0; }
.tag-head p { margin: 0; }
.tag-badge { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent-soft), var(--surface-2)); color: var(--accent); border: 1px solid var(--line); }
.tag-badge .icon { width: 38px; height: 38px; }

/* Lists: people & notifications */
.people-list, .notif-list { padding: 0; overflow: hidden; }
.people-list .person, .notif { padding: 10px 16px; }
.people-list .person + .person, .notif + .notif { border-top: 1px solid var(--line); }
.people-list small { display: block; max-width: 40ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif { display: flex; align-items: center; gap: 12px; }
.notif p { flex: 1; margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.notif time { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.notif .quote { color: var(--ink-2); }
.notif.is-new { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.notif-thumb img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; }

/* Upload filters */
.filters { border: 0; padding: 0; margin: 0; min-width: 0; }
.filters legend { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; padding: 0; }
.filter-row { display: flex; gap: 12px; overflow-x: auto; padding: 5px 5px 8px; scrollbar-width: thin; }
.filter { display: grid; justify-items: center; gap: 6px; cursor: pointer; flex: none; }
.filter input { position: absolute; opacity: 0; pointer-events: none; }
.filter-swatch { width: 76px; height: 76px; border-radius: 14px; overflow: hidden; background: var(--surface-2); outline: 2px solid transparent; outline-offset: 2px; transition: outline-color .15s; }
.filter-swatch img { width: 100%; height: 100%; object-fit: cover; }
.filter-name { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.filter input:checked + .filter-swatch { outline-color: var(--accent); }
.filter input:checked ~ .filter-name { color: var(--accent-deep); }
.filter input:focus-visible + .filter-swatch { outline-color: var(--ink); }

/* ==========================================================================
   Multi-photo posts (v1.2)
   ========================================================================== */
.carousel { position: relative; width: 100%; background: var(--surface-2); user-select: none; -webkit-user-select: none; }
.carousel-track {
  display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
  scroll-behavior: smooth; overscroll-behavior-x: contain; scrollbar-width: none;
  aspect-ratio: var(--ratio, 1); outline: none; cursor: grab; touch-action: pan-x pan-y;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track.dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.carousel-track:focus-visible { box-shadow: inset 0 0 0 3px var(--accent); }
.slide { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; display: grid; place-items: center; overflow: hidden; }
.slide img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.carousel-contain { background: #0f0b0e; }
.carousel-contain .slide img { object-fit: contain; }

.car-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgb(255 255 255 / .9); color: #1f1a1e; box-shadow: 0 2px 10px rgb(0 0 0 / .25);
  cursor: pointer; opacity: 0; transition: opacity .2s, transform .15s;
}
.car-btn .icon { width: 18px; height: 18px; stroke-width: 2.4; }
.car-prev { left: 10px; }
.car-next { right: 10px; }
.carousel:hover .car-btn, .car-btn:focus-visible { opacity: 1; }
.car-btn:active { transform: translateY(-50%) scale(.92); }
@media (hover: none) { .car-btn { display: none; } }
.car-count {
  position: absolute; top: 12px; right: 12px; z-index: 2; padding: 3px 9px; border-radius: 999px;
  background: rgb(20 10 15 / .62); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .02em;
}
.car-dots { position: absolute; left: 0; right: 0; bottom: 10px; z-index: 2; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.car-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgb(255 255 255 / .55); box-shadow: 0 0 3px rgb(0 0 0 / .3); transition: transform .2s, background .2s; }
.car-dots i.on { background: #fff; transform: scale(1.3); }
.carousel .burst { z-index: 3; }

/* Photo page */
.photo-stage.has-carousel { display: block; }
.photo-stage .carousel { height: 100%; }
.photo-stage .carousel-track { max-height: 82vh; aspect-ratio: var(--ratio, 1); }
@media (min-width: 900px) {
  .photo-stage.has-carousel { align-self: stretch; display: grid; align-items: center; }
  .photo-stage .carousel-track { height: min(82vh, 100%); aspect-ratio: auto; min-height: 420px; }
}

/* Grid badge */
.tile-multi { position: absolute; top: 8px; right: 8px; z-index: 1; color: #fff; filter: drop-shadow(0 1px 2px rgb(0 0 0 / .5)); }
.tile-multi .icon { width: 20px; height: 20px; stroke-width: 2; }

/* Upload: picked photos strip */
.picked { display: grid; gap: 10px; }
.picked-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 13px; }
.picked-strip { list-style: none; margin: 0; padding: 4px 2px 6px; display: flex; gap: 10px; overflow-x: auto; }
.pick { position: relative; flex: none; width: 88px; }
.pick-view { display: block; width: 88px; height: 88px; padding: 0; border: 0; border-radius: 12px; overflow: hidden; cursor: pointer; background: var(--surface-2); outline: 2px solid transparent; outline-offset: 2px; }
.pick.is-current .pick-view { outline-color: var(--accent); }
.pick-view img { width: 100%; height: 100%; object-fit: cover; }
.pick-n { position: absolute; top: 5px; left: 5px; white-space: nowrap; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: rgb(20 10 15 / .7); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; pointer-events: none; }
.pick:first-child .pick-n::after { content: " · cover"; margin-left: 2px; }
.pick-tools { display: flex; justify-content: space-between; margin-top: 6px; }
.pick-tools button { width: 26px; height: 24px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 15px; line-height: 1; cursor: pointer; }
.pick-tools button:hover:not(:disabled) { color: var(--ink); border-color: var(--ink-3); }
.pick-tools button:disabled { opacity: .35; cursor: default; }
.pick-tools [data-remove]:hover { color: var(--danger) !important; border-color: var(--danger) !important; }
.add-more { justify-self: start; position: relative; overflow: hidden; }
.add-more input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.filters legend small { font-weight: 500; }


/* ==========================================================================
   v1.3: inline comments, live badge, button states, transitions
   ========================================================================== */
.mini-comments { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 3px; }
.mini-comment { font-size: 14px; overflow-wrap: anywhere; }
.mini-comment.is-fresh { animation: fresh .5s ease; }
@keyframes fresh { from { opacity: 0; transform: translateY(4px); background: var(--accent-soft); } }
.post-body .muted-link { display: inline-block; margin-top: 2px; }
.inline-comment { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.inline-comment input { flex: 1; min-width: 0; border: 0; background: none; padding: 6px 0; font-size: 14px; }
.inline-comment input:focus { outline: none; }
.inline-comment input:disabled { opacity: .6; }
.inline-post { border: 0; background: none; padding: 6px 2px; font-weight: 700; font-size: 14px; color: var(--accent-deep); cursor: pointer; transition: opacity .15s; }
.inline-post:disabled { opacity: .35; cursor: default; }

/* Following -> Unfollow on hover / keyboard focus */
[data-follow] button[aria-pressed="true"]:is(:hover, :focus-visible) {
  font-size: 0; gap: 0; color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}
[data-follow] button[aria-pressed="true"]:is(:hover, :focus-visible)::after { content: "Unfollow"; font-size: var(--fs); }
[data-follow] button { min-width: 96px; }
[data-follow] .btn-sm { min-width: 88px; }
[data-follow] button[disabled] { opacity: .7; }

/* Bell rings when a new notification arrives */
.ring .icon { animation: ring .9s ease; transform-origin: 50% 8%; }
@keyframes ring { 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } 75% { transform: rotate(2deg); } }
.badge { animation: badge-in .25s ease; }
@keyframes badge-in { from { transform: scale(.4); opacity: 0; } }

/* Gentle page entrance and nav feedback */
.main { animation: page-in .28s ease-out; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }
.side-nav a .icon, .tabbar a .icon { transition: transform .15s ease; }
.side-nav a:active .icon, .tabbar a:active .icon { transform: scale(.88); }
.card.post { transition: box-shadow .2s ease; }
.tile img { will-change: transform; }

/* ==========================================================================
   v1.4: direct messages, confirm dialog, Explore filtering
   ========================================================================== */
/* Messages layout: inbox + thread, single pane on phones */
.main-dm { max-width: 1040px; }
.dm { display: grid; grid-template-columns: 1fr; height: calc(100vh - 196px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); height: calc(100dvh - 196px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-height: 380px; overflow: hidden; }
.main-dm { padding-bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom)); }
.dm-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.dm-thread { display: none; flex-direction: column; min-height: 0; }
.dm.has-thread .dm-list { display: none; }
.dm.has-thread .dm-thread { display: flex; }
@media (min-width: 900px) {
  .dm { grid-template-columns: 340px 1fr; height: calc(100vh - 72px); height: calc(100dvh - 72px); }
  .main-dm { padding-bottom: 36px; }
  .dm .dm-list, .dm.has-thread .dm-list { display: flex; }
  .dm .dm-thread { display: flex; }
  .dm-back { display: none; }
}
.dm-list-head { padding: 18px 18px 8px; }
.dm-list-head h1 { font-family: var(--display); font-size: 24px; margin: 0; }
.dm-start { position: relative; margin: 6px 14px 10px; }
.dm-start .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-3); }
.dm-start input { width: 100%; padding: 10px 12px 10px 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font-size: 14px; }
.dm-start input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.dm-convs { list-style: none; margin: 0; padding: 0 6px 10px; overflow-y: auto; }
.dm-conv { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; transition: background .15s; }
.dm-conv:hover { background: var(--surface-2); color: inherit; }
.dm-conv.active { background: var(--accent-soft); }
.dm-conv-text { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.dm-conv-text small { color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-conv.unread strong, .dm-conv.unread small { color: var(--ink); font-weight: 700; }
.dm-empty-list { padding: 8px 18px; display: grid; gap: 8px; }
.small { font-size: 13px; }

.dm-thread-head { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.dm-messages { list-style: none; margin: 0; padding: 18px 16px 8px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
.msg { display: grid; max-width: min(75%, 520px); }
.msg.mine { align-self: flex-end; justify-items: end; }
.msg.theirs { align-self: flex-start; justify-items: start; }
.bubble { margin: 0; padding: 9px 14px; border-radius: 20px; font-size: 15px; line-height: 1.4; white-space: pre-line; overflow-wrap: anywhere; }
.mine .bubble { background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 6px; }
.theirs .bubble { background: var(--surface-2); color: var(--ink); border-bottom-left-radius: 6px; }
.mine .bubble a { color: inherit; text-decoration: underline; }
.msg time { font-size: 11px; color: var(--ink-3); margin: 2px 6px 0; opacity: 0; transition: opacity .15s; }
.msg:hover time, .msg:last-child time { opacity: 1; }
.msg.is-fresh { animation: msg-in .25s ease-out; }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.dm-hello { margin: auto; display: grid; justify-items: center; gap: 8px; text-align: center; max-width: 36ch; padding: 20px; }
.dm-seen { margin: 0 20px 4px; text-align: right; font-size: 12px; color: var(--ink-3); }
.dm-compose { display: flex; align-items: flex-end; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); }
.dm-compose textarea { flex: 1; min-height: 42px; max-height: 140px; resize: none; padding: 10px 16px; border-radius: 22px; border: 1px solid var(--line); background: var(--paper); line-height: 1.4; }
.dm-compose textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.dm-compose .btn { min-height: 42px; }
.dm-placeholder { margin: auto; display: grid; justify-items: center; gap: 6px; text-align: center; padding: 24px; max-width: 40ch; }
.dm-placeholder h2 { font-family: var(--display); font-size: 22px; margin: 6px 0 0; }

/* Confirmation dialog */
.confirm { border: 0; padding: 0; border-radius: var(--radius); background: var(--surface); color: var(--ink); width: min(380px, calc(100% - 32px)); box-shadow: 0 24px 60px -20px rgb(20 10 15 / .5); }
.confirm::backdrop { background: rgb(20 10 15 / .45); backdrop-filter: blur(2px); }
.confirm[open] { animation: dialog-in .18s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.97); } }
.confirm form { padding: 24px 22px 20px; display: grid; gap: 6px; text-align: center; }
.confirm h2 { font-size: 18px; margin: 0; }
.confirm p { margin: 0 0 12px; }
.confirm p:empty { display: none; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }

/* Feed comment delete */
.mini-comment { display: flex; align-items: flex-start; gap: 6px; transition: opacity .2s, transform .2s; }
.mini-comment > span { flex: 1; min-width: 0; }
.mini-comment form { flex: none; }
.mini-delete { border: 0; background: none; padding: 2px; color: var(--ink-3); cursor: pointer; opacity: 0; transition: opacity .15s, color .15s; display: grid; }
.mini-delete .icon { width: 15px; height: 15px; }
.mini-comment:hover .mini-delete, .mini-delete:focus-visible { opacity: 1; }
.mini-delete:hover { color: var(--danger); }
@media (hover: none) { .mini-delete { opacity: .7; } }
.mini-comment.is-leaving { opacity: 0; transform: translateX(-8px); }

/* Explore: hashtag filter */
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.active small { color: inherit; opacity: .8; }
.filter-bar { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 0 0 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.filter-bar p { margin: 0; flex: 1; }
.filter-bar .btn .icon { width: 15px; height: 15px; }
.tag-badge-sm { width: 40px; height: 40px; }
.tag-badge-sm .icon { width: 20px; height: 20px; }
.chip-person span { display: grid; line-height: 1.2; }
.chip-person small { color: var(--ink-3); font-weight: 500; font-size: 11px; }

/* ==========================================================================
   v1.5: stories, menus, sheets, mute/block, edited posts, notifications
   ========================================================================== */
body.no-scroll { overflow: hidden; }

/* ⋯ menus */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary { background: var(--surface-2); }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 25; min-width: 220px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  display: grid; animation: menu-in .14s ease-out;
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
.menu-pop form { margin: 0; }
.menu-pop [role="menuitem"] {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px;
  background: none; color: var(--ink); font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; white-space: nowrap;
}
.menu-pop [role="menuitem"]:hover, .menu-pop [role="menuitem"]:focus-visible { background: var(--surface-2); color: var(--ink); outline: none; }
.menu-pop [role="menuitem"] .icon { width: 18px; height: 18px; color: var(--ink-3); }
.menu-pop .danger, .menu-pop .danger .icon { color: var(--danger); }
.menu-sm .menu-pop { min-width: 200px; }
.btn-icon { padding: 0; width: 42px; }
.profile-actions .menu .menu-pop { left: auto; right: 0; }
@media (max-width: 640px) { .profile-actions .menu .menu-pop { right: auto; left: 50%; transform: translateX(-50%); } }
.post-head .menu { margin-left: 4px; }
.post-meta { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.post-head .post-author { min-width: 0; }
.edited { color: var(--ink-3); font-size: 12px; }
.comment p .edited { margin-left: 4px; }
.comment-tools { display: flex; align-items: center; gap: 2px; }
.post.is-leaving { opacity: 0; transform: scale(.98); transition: opacity .25s, transform .25s; }
.relation-list li.is-leaving { opacity: 0; transition: opacity .25s; }

/* Sheets (modal dialogs) */
.sheet {
  border: 0; padding: 0; border-radius: var(--radius); background: var(--surface); color: var(--ink);
  width: min(480px, calc(100% - 24px)); max-height: min(86vh, 720px); box-shadow: 0 30px 70px -24px rgb(20 10 15 / .55);
}
.sheet::backdrop { background: rgb(20 10 15 / .45); backdrop-filter: blur(2px); }
.sheet[open] { animation: dialog-in .18s ease-out; display: flex; flex-direction: column; }
.sheet > form { padding: 0 20px 18px; overflow-y: auto; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 8px 8px 20px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.sheet > form .sheet-head { margin: 0 -20px 4px; }
.sheet-head h2 { font-size: 17px; margin: 0; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.sheet-list { width: min(440px, calc(100% - 24px)); }
.sheet-body { overflow-y: auto; padding: 0 0 8px; min-height: 120px; }
.sheet-body .people-list { border: 0; box-shadow: none; border-radius: 0; }
.sheet-body .empty { border: 0; box-shadow: none; padding: 28px 20px; }
.tabs-sheet { margin: 0; justify-content: center; border-top: 0; border-bottom: 1px solid var(--line); }
.tabs-sheet a { margin-top: 0; padding: 10px 2px; border-top: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs-sheet a.active { border-bottom-color: var(--ink); }
@media (max-width: 640px) {
  .sheet { width: 100%; max-width: 100%; max-height: 92vh; margin: auto 0 0; border-radius: 22px 22px 0 0; }
  .sheet[open] { animation: sheet-up .22s ease-out; }
  @keyframes sheet-up { from { transform: translateY(40px); opacity: .6; } }
}

/* Profile: blocked / muted notes */
.blocked-note { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; color: var(--ink-2); }
.blocked-note .icon, .muted-note .icon { width: 16px; height: 16px; vertical-align: -3px; }
.muted-note { margin-top: 10px; }
.relation-list { list-style: none; margin: 0; padding: 0; display: grid; }
.relation-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; }
.relation-list li + li { border-top: 1px solid var(--line); }
.relation-list a { display: flex; align-items: center; gap: 10px; min-width: 0; }
.relation-list a span { display: grid; line-height: 1.25; }
.relation-list small { color: var(--ink-3); font-size: 12px; }
.dm-blocked { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--ink-2); }
.dm-blocked p { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 14px; }
.dm-blocked .icon { width: 16px; height: 16px; }

/* Notifications: kind badges, clickable rows */
.notif[data-href] { cursor: pointer; transition: background .15s; }
.notif[data-href]:hover { background: var(--surface-2); }
.notif-avatar { position: relative; flex: none; }
.notif-kind { position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--ink-3); box-shadow: 0 0 0 2px var(--surface); }
.notif-kind .icon { width: 12px; height: 12px; stroke-width: 2.4; }
.kind-like, .kind-story_like { background: var(--accent); }
.kind-like .icon, .kind-story_like .icon { fill: currentColor; }
.kind-comment, .kind-reply { background: #4f7cf0; }
.kind-mention { background: #8a5cf5; }
.kind-follow { background: var(--success); }
.kind-message { background: #e08a2c; }
.notif-story img { border-radius: 10px; height: 64px; width: 40px; }
.notif-dms { margin-bottom: 14px; }
.notif p .who { margin-right: 0; }

/* Stories row */
.stories { margin: 0 0 18px; }
.stories-track { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; scroll-snap-type: x proximity; }
.stories-track::-webkit-scrollbar { display: none; }
.story { position: relative; flex: none; width: 74px; scroll-snap-align: start; }
.story-open, .story-add label { display: grid; justify-items: center; gap: 6px; width: 100%; border: 0; padding: 0; background: none; cursor: pointer; color: inherit; font: inherit; }
.story-ring {
  position: relative; display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%;
  background: conic-gradient(from 210deg, #f9a03f, var(--accent), #b44cf0, #f9a03f); padding: 3px;
  transition: transform .15s ease;
}
.story-ring .avatar { width: 100%; height: 100%; font-size: 24px; box-sizing: border-box; border: 2.5px solid var(--paper); box-shadow: none; }
.story-ring.is-seen { background: var(--line); }
.story-ring.is-empty { background: none; padding: 3px; }
.story-open:hover .story-ring, .story-add label:hover .story-ring { transform: scale(1.04); }
.story-open:active .story-ring { transform: scale(.96); }
.story-name { max-width: 74px; font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story-plus { position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 16px; font-weight: 700; line-height: 1; box-shadow: 0 0 0 3px var(--paper); }
.story-add input, .story-more input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.story-add label:focus-within .story-ring, .story-more label:focus-within .story-plus { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.story-more { position: absolute; left: 50px; top: 48px; }
.story-more label { cursor: pointer; display: block; position: relative; width: 22px; height: 22px; }
.story-more .story-plus { position: static; }
@media (max-width: 899px) {
  .stories { margin: -8px -16px 14px; padding: 0 16px; border-bottom: 1px solid var(--line); }
  .stories-track { padding-bottom: 12px; }
}

/* Story viewer */
.story-viewer { position: fixed; inset: 0; z-index: 60; background: #0b0809; display: grid; place-items: center; animation: sv-in .2s ease-out; }
.story-viewer[hidden] { display: none; }
@keyframes sv-in { from { opacity: 0; transform: scale(.98); } }
.sv-frame { position: relative; width: min(100vw, calc(100dvh * 9 / 16), 460px); height: min(100dvh, 820px); background: #000; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
@media (min-width: 640px) { .sv-frame { border-radius: 16px; height: min(92dvh, 820px); width: min(calc(92dvh * 9 / 16), 460px); } }
.sv-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.sv-loading { position: absolute; inset: 0; display: grid; place-items: center; }
.sv-loading::after { content: ""; width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgb(255 255 255 / .25); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sv-bars { position: absolute; z-index: 3; top: calc(10px + env(safe-area-inset-top)); left: 10px; right: 10px; display: flex; gap: 4px; }
.sv-bar { flex: 1; height: 3px; border-radius: 3px; background: rgb(255 255 255 / .35); overflow: hidden; }
.sv-bar i { display: block; height: 100%; width: 0; background: #fff; }
.sv-head { position: absolute; z-index: 3; top: calc(20px + env(safe-area-inset-top)); left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 0 12px; background: linear-gradient(rgb(0 0 0 / .45), transparent); }
.sv-user { display: flex; align-items: center; gap: 8px; color: #fff; font-size: 14px; min-width: 0; }
.sv-user:hover { color: #fff; }
.sv-user time { color: rgb(255 255 255 / .75); font-size: 13px; font-weight: 500; }
.sv-tools { display: flex; gap: 2px; }
.sv-icon { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: #fff; cursor: pointer; }
.sv-icon:hover { background: rgb(255 255 255 / .12); }
.sv-icon .icon { filter: drop-shadow(0 1px 2px rgb(0 0 0 / .5)); }
[data-sv-pause] .i-play, [data-sv-pause].is-paused .i-pause { display: none; }
[data-sv-pause].is-paused .i-play { display: block; }
.sv-nav { position: absolute; z-index: 2; top: 70px; bottom: 80px; border: 0; background: none; cursor: pointer; }
.sv-prev { left: 0; width: 32%; }
.sv-next { right: 0; width: 68%; }
.sv-nav:focus-visible { outline: none; background: linear-gradient(90deg, rgb(255 255 255 / .08), transparent); }
.sv-foot { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; padding: 14px 12px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgb(0 0 0 / .55)); }
.sv-own, .sv-other { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sv-pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; border: 1px solid rgb(255 255 255 / .35); background: rgb(0 0 0 / .25); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; }
.sv-pill:hover { color: #fff; background: rgb(255 255 255 / .12); }
.sv-pill .icon { width: 18px; height: 18px; }
.sv-reply { flex: 1; justify-content: flex-start; }
.sv-like.is-liked { color: var(--accent); }
.sv-like.is-liked .icon { fill: currentColor; }
.sv-like.pop .icon { animation: pop .35s ease; }
.sv-panel { position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; max-height: 60%; background: var(--surface); color: var(--ink); border-radius: 18px 18px 0 0; display: flex; flex-direction: column; animation: sheet-up .2s ease-out; }
.sv-panel[hidden] { display: none; }
.sv-panel header { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 8px 18px; border-bottom: 1px solid var(--line); }
.sv-panel > div { overflow-y: auto; padding: 6px 12px 16px; }
.sv-viewer-list { list-style: none; margin: 0; padding: 0; display: grid; }
.sv-viewer-list li { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px; }
.sv-viewer-list a { display: flex; align-items: center; gap: 10px; }
.sv-viewer-list a span { display: grid; line-height: 1.25; }
.sv-viewer-list small { color: var(--ink-3); font-size: 12px; }
.sv-liked { color: var(--accent); }
.sv-liked .icon { width: 18px; height: 18px; fill: currentColor; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: .6; } }
