/* TARA Social Corner (/SocialCorner) — v2 "fun" skin.
   Token-driven: social-corner.js sets --accent / --radius / --font-* from the
   admin config (or the viewer's prefs); html[data-theme|data-layout|data-size]
   switch the rest. Modern-platform bits: @property (animated composer glow),
   <dialog> sheets, Popover API, View Transitions, field-sizing, container
   queries — each degrades gracefully where unsupported. */

@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

:root {
  --accent: #8b5cf6;
  --accent-2: color-mix(in oklab, var(--accent), #ff5fa2 55%);
  --radius: 22px;
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fredoka", "Plus Jakarta Sans", system-ui, sans-serif;
  --fs: 15px;

  --bg: #faf8ff;
  --surface: rgba(255, 255, 255, .78);
  --surface-solid: #ffffff;
  --sunken: #f2eefc;
  --line: rgba(80, 60, 140, .11);
  --text: #1c1830;
  --text-2: #5d5874;
  --text-3: #9590ab;
  --danger: #e5484d;
  --ok: #12a594;
  --shadow-sm: 0 1px 2px rgba(60, 40, 120, .06);
  --shadow: 0 1px 2px rgba(60, 40, 120, .05), 0 10px 30px -8px rgba(60, 40, 120, .14);
  --shadow-lg: 0 24px 60px -12px rgba(60, 40, 120, .3);
  --accent-soft: color-mix(in oklab, var(--accent) 12%, transparent);
  --accent-ink: color-mix(in oklab, var(--accent) 75%, #000);
  --blob-a: color-mix(in oklab, var(--accent) 40%, transparent);
  --blob-b: rgba(255, 128, 181, .32);
  --blob-c: rgba(80, 200, 255, .26);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0d1a; --surface: rgba(30, 26, 48, .72); --surface-solid: #1c1830; --sunken: #262140;
    --line: rgba(200, 190, 255, .1); --text: #f1eefc; --text-2: #b4adcf; --text-3: #7d7699;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -10px rgba(0, 0, 0, .55);
    --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .7);
    --accent-ink: color-mix(in oklab, var(--accent) 60%, #fff);
    --blob-a: color-mix(in oklab, var(--accent) 34%, transparent); --blob-b: rgba(255, 95, 162, .16); --blob-c: rgba(60, 160, 255, .14);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0d1a; --surface: rgba(30, 26, 48, .72); --surface-solid: #1c1830; --sunken: #262140;
  --line: rgba(200, 190, 255, .1); --text: #f1eefc; --text-2: #b4adcf; --text-3: #7d7699;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -10px rgba(0, 0, 0, .55);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .7);
  --accent-ink: color-mix(in oklab, var(--accent) 60%, #fff);
  --blob-a: color-mix(in oklab, var(--accent) 34%, transparent); --blob-b: rgba(255, 95, 162, .16); --blob-c: rgba(60, 160, 255, .14);
  color-scheme: dark;
}
:root[data-size="s"] { --fs: 14px; }
:root[data-size="l"] { --fs: 17px; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); font-family: var(--font-body);
  font-size: var(--fs); line-height: 1.55; -webkit-font-smoothing: antialiased;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: var(--accent-ink); }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
::selection { background: color-mix(in oklab, var(--accent) 30%, transparent); }

/* ── Aurora background (pure CSS, pauses for reduced motion / hidden tab) ── */
.sc-aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.sc-aurora i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(70px); opacity: .9; animation: sc-drift 28s ease-in-out infinite alternate; }
.sc-aurora i:nth-child(1) { background: var(--blob-a); top: -30vmax; left: -15vmax; }
.sc-aurora i:nth-child(2) { background: var(--blob-b); top: -25vmax; right: -25vmax; animation-delay: -9s; }
.sc-aurora i:nth-child(3) { background: var(--blob-c); bottom: -40vmax; left: 20vw; animation-delay: -18s; }
@keyframes sc-drift { to { transform: translate3d(6vmax, 5vmax, 0) scale(1.1); } }
.sc-paused .sc-aurora i { animation-play-state: paused; }

/* ── Full-width shell: sticky sidebar + main ── */
:root { --gutter: clamp(16px, 2.5vw, 32px); --side-w: 320px; }
.sc-shell { max-width: 1760px; margin: 0 auto; padding: 0 var(--gutter); display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); gap: clamp(20px, 2vw, 32px); align-items: start; }
.sc-main { min-width: 0; padding-bottom: 20px; }

/* ── Top bar ── */
.sc-top { position: sticky; top: 0; z-index: 30; backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  background: color-mix(in oklab, var(--bg) 70%, transparent); border-bottom: 1px solid transparent; transition: border-color .2s; }
.sc-top.is-scrolled { border-bottom-color: var(--line); }
.sc-top__in { max-width: 1760px; margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; gap: 10px; height: 60px; }
.sc-back { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: var(--text-2); }
.sc-back:hover { background: var(--sunken); color: var(--text); }
.sc-brand { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.sc-brand__mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; font-size: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 4px 12px -2px color-mix(in oklab, var(--accent) 60%, transparent); }
.sc-brand__name { font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-top__tools { display: flex; gap: 4px; align-items: center; }
.sc-me { margin-left: 6px; display: inline-flex; }

/* ── Sidebar (profile + TaraChat friends) ── */
.sc-side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 16px; max-height: calc(100dvh - 92px); padding: 16px 0 0; }
.sc-profile { flex: none; overflow: hidden; padding: 0; }
.sc-profile__banner { height: 74px; background: linear-gradient(120deg, var(--accent), var(--accent-2) 60%, #ffb648);
  background-size: 200% 100%; animation: sc-sheen 12s ease-in-out infinite alternate; }
@keyframes sc-sheen { to { background-position: 100% 0; } }
.sc-paused .sc-profile__banner { animation-play-state: paused; }
.sc-profile__body { padding: 0 18px 18px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.sc-profile__ava { margin-top: -38px; }
.sc-profile__ava .sc-ava { --size: 76px; }
.sc-profile__ava .sc-ava__img { box-shadow: 0 0 0 4px var(--surface-solid), var(--shadow); }
.sc-profile__ava .sc-ava[data-shape="diamond"] .sc-ava__img, .sc-profile__ava .sc-ava[data-shape="hexagon"] .sc-ava__img { box-shadow: none; }
.sc-profile__name { margin-top: 10px; font-family: var(--font-display); font-weight: 600; font-size: 1.3em; line-height: 1.2; overflow-wrap: anywhere; }
.sc-profile__name small { display: block; font-family: var(--font-body); font-weight: 500; font-size: .62em; color: var(--text-3); }
.sc-profile__status { margin-top: 6px; font-size: .82em; color: var(--text-2); display: flex; align-items: center; justify-content: center; gap: 6px; max-width: 100%; }
.sc-profile__status span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 100%; margin: 14px 0; }
.sc-stats div { background: var(--sunken); border-radius: 14px; padding: 8px 4px; }
.sc-stats dt { font-size: .68em; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.sc-stats dd { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.3em; font-variant-numeric: tabular-nums; }
.sc-profile__acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.sc-profile__acts .sc-btn { padding: 9px 10px; font-size: 13px; }

.sc-friends { flex: 1 1 auto; min-height: 220px; display: flex; flex-direction: column; padding: 14px 10px 10px; overflow: hidden; }
.sc-friends__head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 10px; }
.sc-friends__head h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.15em; }
.sc-online-chip { font-size: .74em; font-weight: 700; color: var(--ok); background: color-mix(in oklab, var(--ok) 13%, transparent); border-radius: 999px; padding: 2px 9px; }
.sc-search { display: flex; align-items: center; gap: 8px; margin: 0 6px 8px; padding: 0 12px; height: 38px; border-radius: 12px; background: var(--sunken); color: var(--text-3); }
.sc-search svg { width: 16px; height: 16px; }
.sc-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: 0; font-size: .9em; color: var(--text); }
.sc-search:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.sc-friends__list { list-style: none; margin: 0; padding: 0 2px; overflow-y: auto; flex: 1; overscroll-behavior: contain; scrollbar-width: thin; }
.sc-friends__group { font-size: .7em; font-weight: 800; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; padding: 10px 8px 4px; }
.sc-friend { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; text-align: left; padding: 7px 8px; border-radius: 14px; transition: background .15s; }
.sc-friend:hover { background: var(--sunken); }
.sc-friend[aria-pressed="true"] { background: var(--accent-soft); }
.sc-friend.is-offline .sc-ava__img { filter: grayscale(.55); opacity: .75; }
.sc-friend__txt { flex: 1; min-width: 0; line-height: 1.25; }
.sc-friend__name { display: block; font-weight: 700; font-size: .9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-friend__sub { display: block; font-size: .76em; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-friend__new { flex: none; font-size: .7em; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-radius: 999px; padding: 2px 8px; }
.sc-friends__empty { padding: 18px 10px; text-align: center; font-size: .86em; color: var(--text-3); }
.sc-friends__more { display: block; text-align: center; font-size: .8em; font-weight: 700; padding: 10px 0 2px; text-decoration: none; color: var(--accent-ink); }
.sc-friends__more:hover { text-decoration: underline; }

/* Presence dot on avatars (sidebar) */
.sc-pdot { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--text-3); box-shadow: 0 0 0 2.5px var(--surface-solid); }
.sc-pdot[data-s="online"] { background: #22c55e; }
.sc-pdot[data-s="away"] { background: #f59e0b; }
.sc-pdot[data-s="dnd"] { background: #ef4444; }
.sc-pdot--inline { position: static; display: inline-block; width: 9px; height: 9px; box-shadow: none; flex: none; }

/* ── User page hero (?u=<id>): cover, avatar, bio, stats ── */
.sc-page { overflow: hidden; margin: 16px 0 18px; padding: 0; animation: sc-rise .35s ease both; }
.sc-page__cover { height: clamp(130px, 22vw, 240px); background: linear-gradient(120deg, var(--accent), var(--accent-2) 60%, #ffb648) center / cover no-repeat; }
.sc-page__body { padding: 0 20px 18px; display: flex; flex-direction: column; gap: 10px; }
.sc-page__top { display: flex; align-items: flex-end; gap: 14px; margin-top: -44px; flex-wrap: wrap; }
.sc-ava--page { --size: 104px; }
.sc-ava--page .sc-ava__img { box-shadow: 0 0 0 5px var(--surface-solid), var(--shadow); }
.sc-ava--page[data-shape="diamond"] .sc-ava__img, .sc-ava--page[data-shape="hexagon"] .sc-ava__img { box-shadow: none; }
.sc-page__id { flex: 1; min-width: 160px; padding-bottom: 4px; }
.sc-page__id, .sc-page__acts { margin-top: 50px; } /* only the avatar overlaps the cover */
.sc-page__name { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.5em, 3.4vw, 2em); line-height: 1.1; overflow-wrap: anywhere; }
.sc-page__sub { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .84em; color: var(--text-3); font-weight: 600; margin-top: 4px; }
.sc-page__pres { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.sc-page__acts { display: flex; gap: 6px; align-items: center; padding-bottom: 4px; }
.sc-page__bio { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1.02em; }
.sc-page__bio.is-empty { color: var(--text-3); font-style: italic; }
.sc-page__stats { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .9em; color: var(--text-2); }
.sc-page__stats b { font-family: var(--font-display); font-weight: 600; color: var(--text); font-size: 1.15em; }
@media (max-width: 560px) {
  .sc-page__body { padding: 0 14px 14px; }
  .sc-ava--page { --size: 84px; }
  .sc-page__top { margin-top: -36px; }
  .sc-page__id, .sc-page__acts { margin-top: 42px; }
  .sc-page__top .sc-page__id { margin-top: 0; flex-basis: 100%; order: 3; }
}

/* Page background (owner's look on their page, or mine with "everywhere") */
.sc-pagebg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; display: none; --dim: 30%; --blur: 0px; }
.has-pagebg .sc-pagebg { display: block; }
.has-pagebg .sc-aurora { display: none; }
.sc-pagebg i { position: absolute; inset: calc(var(--blur) * -2); background: center / cover no-repeat; filter: blur(var(--blur)); }
.sc-pagebg[data-fit="tile"] i { background-size: auto; background-repeat: repeat; background-position: 0 0; }
.sc-pagebg[data-fit="contain"] i { background-size: contain; background-color: var(--bg); }
.sc-pagebg::after { content: ""; position: absolute; inset: 0; background: color-mix(in oklab, var(--bg) var(--dim), transparent); }
.has-pagebg .sc-hero__tag, .has-pagebg .sc-hero h1 { text-shadow: 0 1px 12px color-mix(in oklab, var(--bg) 70%, transparent); }

/* Sidebar banner = my cover */
.sc-profile__banner.has-img { background-size: cover; background-position: center; animation: none; }
.sc-profile .sc-profile__paint { position: absolute; top: 10px; left: 10px; z-index: 1; width: 34px; height: 34px; font-size: 16px; background: rgba(0, 0, 0, .22); color: #fff; backdrop-filter: blur(6px); }
.sc-profile .sc-profile__paint:hover { background: rgba(0, 0, 0, .38); color: #fff; }
.sc-me.is-link { cursor: pointer; border-radius: 50%; }
.sc-me.is-link:hover { filter: brightness(1.08); }

/* Sidebar toggle + scrim (below 1000px the sidebar is an off-canvas panel) */
.sc-top .sc-side-toggle { position: relative; display: none; }
.sc-profile .sc-side__close { display: none; position: absolute; top: 10px; right: 10px; z-index: 1; color: #fff; background: rgba(0, 0, 0, .18); }
.sc-side__close:hover { background: rgba(0, 0, 0, .3); color: #fff; }
.sc-profile { position: relative; }
.sc-side-toggle__n { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: #22c55e; color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }
.sc-scrim { position: fixed; inset: 0; z-index: 39; background: rgba(15, 10, 35, .4); backdrop-filter: blur(2px); animation: sc-fade .2s ease; }
@keyframes sc-fade { from { opacity: 0; } }

@media (max-width: 1280px) { :root { --side-w: 280px; } }
@media (max-width: 999px) {
  .sc-shell { grid-template-columns: minmax(0, 1fr); }
  .sc-top .sc-side-toggle { display: inline-grid; }
  .sc-profile .sc-side__close { display: inline-grid; }
  .sc-side { position: fixed; z-index: 40; top: 0; left: 0; bottom: 0; width: min(340px, 88vw); max-height: none; padding: 14px; background: var(--bg);
    box-shadow: var(--shadow-lg); transform: translateX(-105%); visibility: hidden; transition: transform .3s cubic-bezier(.2, .9, .3, 1), visibility 0s .3s; overflow-y: auto; }
  .sc-side.is-open { transform: none; visibility: visible; transition: transform .3s cubic-bezier(.2, .9, .3, 1); }
  .sc-friends { min-height: 320px; flex: none; }
  .sc-friends__list { overflow: visible; }
}

/* ── Buttons ── */
.sc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 999px; padding: 10px 18px;
  font-weight: 700; font-size: 14px; white-space: nowrap; transition: transform .15s cubic-bezier(.3, 1.6, .5, 1), filter .15s, background .15s, opacity .15s; }
.sc-btn:active { transform: scale(.94); }
.sc-btn--brand { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px -6px color-mix(in oklab, var(--accent) 80%, transparent), inset 0 1px 0 rgba(255, 255, 255, .25); }
.sc-btn--brand:hover { filter: brightness(1.08) saturate(1.1); }
.sc-btn--brand:disabled { opacity: .45; cursor: default; filter: grayscale(.3); box-shadow: none; }
.sc-btn--soft { background: var(--sunken); color: var(--text); }
.sc-btn--soft:hover { background: color-mix(in oklab, var(--sunken), var(--text) 6%); }
.sc-wide { width: 100%; }
.sc-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; border: 0; background: transparent; color: var(--text-2); font-size: 15px; }
.sc-icon:hover { background: var(--sunken); color: var(--text); }

/* ── Avatars (match TaraChat's avatar_shape) ── */
.sc-ava { --h: 260; --size: 44px; position: relative; display: inline-block; vertical-align: middle; flex: none; width: var(--size); height: var(--size); }
.sc-ava__img { width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; border-radius: 50%;
  font-family: var(--font-display); font-weight: 600; font-size: calc(var(--size) * .38); color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 80% 66%), hsl(calc(var(--h) + 50) 78% 58%)); }
.sc-ava__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-ava[data-shape="rounded"] .sc-ava__img, .sc-ava[data-shape="square"] .sc-ava__img { border-radius: 28%; }
.sc-ava[data-shape="diamond"] .sc-ava__img { border-radius: 0; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.sc-ava[data-shape="hexagon"] .sc-ava__img { border-radius: 0; clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); }
.sc-ava--anon .sc-ava__img { background: linear-gradient(135deg, hsl(var(--h) 45% 48%), hsl(calc(var(--h) + 40) 45% 38%)); font-size: calc(var(--size) * .5); }
.sc-ava__mood { position: absolute; right: -5px; bottom: -4px; font-size: calc(var(--size) * .42); line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .25)); animation: sc-pop .4s cubic-bezier(.3, 1.8, .5, 1) both; }
.sc-ava--sm { --size: 30px; }
.sc-ava--xs { --size: 32px; }

/* ── Hero ── */
.sc-hero { position: relative; padding: 26px 0 20px; text-align: center; }
.sc-hero h1 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(34px, 8vw, 50px); line-height: 1.05; letter-spacing: -.02em;
  background: linear-gradient(110deg, var(--accent) 10%, var(--accent-2) 60%, #ffb648); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sc-hero__tag { margin: 8px 0 0; color: var(--text-2); font-size: 1.08em; font-weight: 500; }
.sc-hero__note { margin: 16px auto 0; max-width: 520px; font-size: .86em; color: var(--text-2); background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; backdrop-filter: blur(8px); }
.sc-hero__stickers span { position: absolute; font-size: 26px; animation: sc-float 6s ease-in-out infinite; }
.sc-hero__stickers span:nth-child(1) { left: 6%; top: 34px; }
.sc-hero__stickers span:nth-child(2) { right: 8%; top: 22px; animation-delay: -2s; font-size: 22px; }
.sc-hero__stickers span:nth-child(3) { right: 16%; top: 96px; animation-delay: -4s; font-size: 18px; }
@keyframes sc-float { 50% { transform: translateY(-8px) rotate(8deg); } }
.sc-paused .sc-hero__stickers span { animation-play-state: paused; }

/* ── Glass cards ── */
.sc-card, .sc-compose { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); }

/* Composer — animated gradient ring while focused (@property --spin) */
.sc-compose { position: relative; padding: 16px; margin-bottom: 22px; display: flex; flex-direction: column; gap: 12px; isolation: isolate; }
.sc-compose::before { content: ""; position: absolute; inset: -1.5px; z-index: -1; border-radius: inherit; padding: 1.5px; opacity: 0; transition: opacity .25s;
  background: conic-gradient(from var(--spin), var(--accent), var(--accent-2), #ffb648, var(--accent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: sc-spin 4s linear infinite paused; }
.sc-compose:focus-within::before { opacity: 1; animation-play-state: running; }
@keyframes sc-spin { to { --spin: 360deg; } }
.sc-compose__row { display: flex; gap: 12px; align-items: flex-start; }
.sc-compose__ava { display: block; flex: none; }
.sc-compose__main { flex: 1; min-width: 0; }
.sc-compose__who { font-size: .82em; color: var(--text-3); font-weight: 600; margin: 2px 0 4px; }
.sc-compose__who b { color: var(--text); }
.sc-compose__who .sc-anon-badge { color: var(--accent-ink); }
.sc-compose textarea { display: block; width: 100%; border: 0; background: transparent; outline: 0; resize: none; padding: 2px 0;
  font-size: 1.12em; line-height: 1.5; min-height: 3lh; max-height: 14lh; field-sizing: content; }
.sc-compose textarea::placeholder { color: var(--text-3); }
.sc-compose__bar { display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px dashed var(--line); }
.sc-compose__tools { display: flex; gap: 4px; flex: 1; min-width: 0; flex-wrap: wrap; }
.sc-tool { display: inline-flex; align-items: center; gap: 5px; height: 36px; min-width: 36px; justify-content: center; border: 0; border-radius: 12px;
  background: transparent; color: var(--text-2); font-size: 18px; transition: background .15s, transform .15s cubic-bezier(.3, 1.6, .5, 1); }
.sc-tool:hover { background: var(--sunken); }
.sc-tool:active { transform: scale(.9); }
.sc-tool--txt { font-size: .84em; font-weight: 650; padding: 0 10px; }
.sc-tool[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); }
.sc-compose__send { display: flex; align-items: center; gap: 8px; }
.sc-ring { width: 26px; height: 26px; transform: rotate(-90deg); }
.sc-ring circle { fill: none; stroke: var(--sunken); stroke-width: 3.5; }
.sc-ring .sc-ring__val { stroke: var(--accent); stroke-dasharray: 94.25; stroke-dashoffset: 94.25; transition: stroke-dashoffset .15s, stroke .15s; }
.sc-ring.is-near .sc-ring__val { stroke: #f59e0b; }
.sc-ring.is-over .sc-ring__val { stroke: var(--danger); }
.sc-ring__left { font-size: .75em; font-weight: 700; color: var(--text-3); min-width: 2ch; font-variant-numeric: tabular-nums; }

/* Chips / segments */
.sc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sc-chips--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; scroll-snap-type: x proximity; }
.sc-chips--scroll::-webkit-scrollbar { display: none; }
.sc-chip { --c: var(--accent); display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); background: var(--surface-solid);
  border-radius: 999px; padding: 6px 13px; font-size: .84em; font-weight: 650; color: var(--text-2); white-space: nowrap; scroll-snap-align: start;
  transition: background .15s, border-color .15s, color .15s, transform .15s cubic-bezier(.3, 1.6, .5, 1); }
.sc-chip:hover { border-color: color-mix(in oklab, var(--c) 40%, transparent); }
.sc-chip:active { transform: scale(.94); }
.sc-chip[aria-pressed="true"], .sc-chip[aria-checked="true"] { background: color-mix(in oklab, var(--c) 14%, var(--surface-solid)); border-color: var(--c); color: var(--text); }
.sc-seg { display: flex; background: var(--sunken); border-radius: 14px; padding: 4px; gap: 2px; }
.sc-seg button { flex: 1; border: 0; background: transparent; border-radius: 10px; padding: 8px 10px; font-size: .86em; font-weight: 650; color: var(--text-2); white-space: nowrap; }
.sc-seg button[aria-pressed="true"] { background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow-sm); }

/* Filters */
.sc-filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.sc-tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 4px; backdrop-filter: blur(10px); }
.sc-tabs button { flex: 1; border: 0; background: transparent; padding: 8px 6px; border-radius: 12px; font-weight: 700; font-size: .86em; color: var(--text-3); white-space: nowrap; transition: color .15s, background .15s; }
.sc-tabs button:hover { color: var(--text); }
.sc-tabs button[aria-selected="true"] { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 4px 12px -4px color-mix(in oklab, var(--accent) 70%, transparent); }

/* ── Feed ── */
.sc-feed { display: grid; gap: 16px; align-items: start; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); }
:root[data-layout="grid"] .sc-feed { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 14px; }
:root[data-layout="compact"] .sc-feed { display: flex; flex-direction: column; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.sc-post { container-type: inline-size; padding: 16px 16px 12px; animation: sc-rise .4s cubic-bezier(.2, .9, .3, 1.2) both; view-transition-class: post; }
@keyframes sc-rise { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.sc-post.is-fresh { animation: sc-fresh 1.6s ease-out; }
@keyframes sc-fresh { 0%, 30% { box-shadow: 0 0 0 3px var(--accent), 0 0 34px -4px color-mix(in oklab, var(--accent) 70%, transparent); } }
.sc-post.is-hidden { opacity: .6; border-style: dashed; }
:root[data-layout="compact"] .sc-post { border-radius: 0; box-shadow: none; border-width: 0 0 1px; background: transparent; backdrop-filter: none; padding: 12px 14px; }
:root[data-layout="compact"] .sc-post:last-child { border-bottom: 0; }
:root[data-layout="compact"] .sc-post .sc-ava { --size: 34px; }
.sc-post__head { display: flex; align-items: center; gap: 12px; }
.sc-post__who { flex: 1; min-width: 0; line-height: 1.3; }
.sc-post__name { display: flex; align-items: center; gap: 6px; font-weight: 700; min-width: 0; }
.sc-post__name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-namebtn { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: inherit; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sc-namebtn:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.sc-badge { flex: none; font-size: .7em; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); }
.sc-badge--anon { background: var(--sunken); color: var(--text-2); }
.sc-post__meta { font-size: .78em; color: var(--text-3); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-weight: 500; }
.sc-post__meta .sc-dot::before { content: "·"; }
.sc-tag { --c: var(--accent); display: inline-flex; gap: 4px; align-items: center; font-size: .95em; font-weight: 700; padding: 1px 9px; border-radius: 999px;
  color: color-mix(in oklab, var(--c) 70%, var(--text)); background: color-mix(in oklab, var(--c) 14%, transparent); }
.sc-tag svg { width: 11px; height: 11px; stroke-width: 2.5; }
.sc-post__body { margin: 12px 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1.04em; }
.sc-post__body--big { font-family: var(--font-display); font-weight: 500; font-size: 1.45em; line-height: 1.3; letter-spacing: -.005em; }
@container (max-width: 360px) { .sc-post__body--big { font-size: 1.25em; } }
:root[data-layout="compact"] .sc-post__body { margin: 6px 0 6px 46px; }
:root[data-layout="compact"] .sc-post__body--big { font-size: 1.15em; }
.sc-post__foot { display: flex; align-items: center; gap: 6px; }
:root[data-layout="compact"] .sc-post__foot { margin-left: 46px; }
.sc-reacts { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; align-items: center; }
.sc-react { position: relative; display: inline-flex; align-items: center; gap: 5px; border: 1.5px solid var(--line); background: var(--surface-solid);
  border-radius: 999px; padding: 3px 10px 3px 8px; font-size: .86em; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums;
  transition: transform .2s cubic-bezier(.3, 1.8, .5, 1), background .15s, border-color .15s; }
.sc-react:hover { transform: translateY(-1px); }
.sc-react:active { transform: scale(.88); }
.sc-react[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.sc-react .e { font-size: 1.15em; line-height: 1; }
.sc-react.is-bump { animation: sc-bump .45s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes sc-bump { 40% { transform: scale(1.25) rotate(-6deg); } }
.sc-addreact { width: 32px; height: 30px; display: inline-grid; place-items: center; border: 1.5px dashed var(--line); background: transparent; border-radius: 999px; color: var(--text-3); }
.sc-addreact:hover { border-color: var(--accent); color: var(--accent-ink); }
.sc-addreact svg { width: 17px; height: 17px; }
.sc-acts { display: flex; align-items: center; gap: 2px; flex: none; margin-left: auto; }
.sc-link { border: 0; background: transparent; color: var(--text-2); font-size: .84em; font-weight: 700; padding: 6px 9px; border-radius: 10px; display: inline-flex; gap: 5px; align-items: center; }
.sc-link:hover { background: var(--sunken); color: var(--text); }
.sc-link svg { width: 17px; height: 17px; }
.sc-admin-flag { font-weight: 800; color: var(--danger); }

/* Floating emoji burst (reactions) + confetti (new post) */
.sc-fx { position: fixed; z-index: 70; pointer-events: none; font-size: 22px; line-height: 1; will-change: transform, opacity;
  animation: sc-fly .9s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes sc-fly { to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(.6); opacity: 0; } }
.sc-confetti { position: fixed; z-index: 70; pointer-events: none; width: 8px; height: 12px; border-radius: 2px; top: -12px;
  animation: sc-fall var(--t, 1.6s) cubic-bezier(.3, .6, .4, 1) forwards; }
@keyframes sc-fall { to { transform: translate(var(--dx), 105vh) rotate(var(--rot)); } }

/* Replies */
.sc-replies { margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 10px; }
.sc-reply { display: flex; gap: 8px; animation: sc-rise .3s ease both; }
.sc-reply__bubble { background: var(--sunken); border-radius: 4px 16px 16px 16px; padding: 7px 12px 8px; min-width: 0; flex: 1; }
.sc-reply__name { font-weight: 700; font-size: .8em; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sc-reply__name time { font-weight: 500; color: var(--text-3); }
.sc-reply__name .sc-x { margin-left: auto; border: 0; background: transparent; color: var(--text-3); font-size: 12px; padding: 0 2px; border-radius: 6px; }
.sc-reply__name .sc-x:hover { color: var(--danger); }
.sc-reply__body { font-size: .92em; white-space: pre-wrap; overflow-wrap: anywhere; }
.sc-reply-form { display: flex; gap: 6px; align-items: center; }
.sc-reply-form input[type="text"] { flex: 1; min-width: 0; border: 1.5px solid var(--line); background: var(--surface-solid); border-radius: 999px; padding: 9px 15px; outline: 0; font-size: .92em; transition: border-color .15s; }
.sc-reply-form input[type="text"]:focus { border-color: var(--accent); }
.sc-reply-form .sc-btn { padding: 9px 15px; }
.sc-reply-form .sc-tool { height: 38px; width: 38px; font-size: 17px; }

/* New posts pill / more / empty / skeleton */
.sc-newpill { position: sticky; top: 74px; z-index: 15; display: flex; margin: 0 auto 12px; border: 0; color: #fff; font-weight: 700; font-size: .85em;
  border-radius: 999px; padding: 8px 16px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: var(--shadow-lg); animation: sc-pop .4s cubic-bezier(.3, 1.8, .5, 1) both; }
@keyframes sc-pop { from { transform: scale(.5); opacity: 0; } }
.sc-more { display: flex; margin: 22px auto 0; }
.sc-empty { text-align: center; color: var(--text-2); padding: 56px 20px; background: var(--surface); border: 1.5px dashed var(--line); border-radius: var(--radius); }
.sc-empty i { display: block; font-style: normal; font-size: 46px; margin-bottom: 10px; animation: sc-float 4s ease-in-out infinite; }
.sc-empty b { display: block; font-family: var(--font-display); font-size: 1.25em; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.sc-empty a { font-weight: 700; }
.sc-skel { height: 128px; border-radius: var(--radius); background: linear-gradient(100deg, var(--surface) 30%, var(--sunken) 50%, var(--surface) 70%) 0 0 / 300% 100%; animation: sc-sk 1.3s linear infinite; }
@keyframes sc-sk { to { background-position: -150% 0; } }

/* ── Popovers (Popover API) ── */
.sc-pop { margin: 0; inset: auto; border: 1px solid var(--line); background: var(--surface-solid); color: var(--text); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 6px;
  opacity: 0; transform: translateY(6px) scale(.96); transition: opacity .16s, transform .2s cubic-bezier(.3, 1.6, .5, 1), overlay .2s allow-discrete, display .2s allow-discrete; }
.sc-pop:popover-open { opacity: 1; transform: none; }
@starting-style { .sc-pop:popover-open { opacity: 0; transform: translateY(6px) scale(.96); } }
.sc-pop--emoji { display: none; gap: 2px; flex-wrap: wrap; max-width: 260px; }
.sc-pop--emoji:popover-open { display: flex; }
.sc-pop--emoji button { width: 42px; height: 42px; border: 0; background: transparent; border-radius: 12px; font-size: 24px; transition: transform .15s cubic-bezier(.3, 1.8, .5, 1), background .15s; }
.sc-pop--emoji button:hover { transform: scale(1.25); background: var(--sunken); }
.sc-pop--emoji button[aria-pressed="true"] { background: var(--accent-soft); }
.sc-pop--menu { min-width: 180px; }
.sc-pop--menu button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 12px; border-radius: 12px; font-size: .9em; font-weight: 600; }
.sc-pop--menu button:hover { background: var(--sunken); }
.sc-pop--menu .is-danger { color: var(--danger); }

/* ── Sheets (<dialog>) ── */
.sc-sheet { margin: 0 0 0 auto; height: 100dvh; max-height: none; width: min(520px, 100%); padding: 0; border: 0; background: var(--bg); color: var(--text);
  box-shadow: var(--shadow-lg); display: none; flex-direction: column; transform: translateX(40px); opacity: 0;
  transition: transform .28s cubic-bezier(.2, .9, .3, 1), opacity .2s, overlay .28s allow-discrete, display .28s allow-discrete; }
.sc-sheet[open] { display: flex; transform: none; opacity: 1; }
@starting-style { .sc-sheet[open] { transform: translateX(40px); opacity: 0; } }
.sc-sheet--small { width: min(380px, 100%); }
.sc-sheet::backdrop { background: rgba(15, 10, 35, .4); backdrop-filter: blur(3px); opacity: 0; transition: opacity .25s, overlay .28s allow-discrete, display .28s allow-discrete; }
.sc-sheet[open]::backdrop { opacity: 1; }
@starting-style { .sc-sheet[open]::backdrop { opacity: 0; } }
.sc-sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.sc-sheet__head h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 21px; }
.sc-sheet__body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 16px; overscroll-behavior: contain; }
.sc-sheet__foot { display: flex; justify-content: space-between; gap: 10px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.sc-hint { margin: 0; font-size: .82em; color: var(--text-3); }
.sc-field { display: flex; flex-direction: column; gap: 7px; }
.sc-field > span, .sc-field > label { font-size: .74em; font-weight: 800; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.sc-field input[type="text"], .sc-field input[type="number"], .sc-field textarea, .sc-field select {
  width: 100%; border: 1.5px solid var(--line); background: var(--surface-solid); border-radius: 12px; padding: 9px 12px; outline: 0; transition: border-color .15s; }
.sc-field input:focus, .sc-field textarea:focus, .sc-field select:focus { border-color: var(--accent); }
.sc-field textarea { resize: vertical; min-height: 70px; }
.sc-field input[type="range"] { accent-color: var(--accent); }
.sc-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sc-sec { border: 1px solid var(--line); border-radius: 18px; background: var(--surface-solid); }
.sc-sec > summary { padding: 14px 16px; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.sc-sec > summary::-webkit-details-marker { display: none; }
.sc-sec > summary::after { content: ""; width: 8px; height: 8px; border: solid var(--text-3); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .2s; }
.sc-sec[open] > summary::after { transform: rotate(-135deg); }
.sc-sec__body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.sc-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .92em; font-weight: 600; }
.sc-switch { width: 44px; height: 26px; appearance: none; background: var(--sunken); border-radius: 999px; position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.sc-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.sc-switch:checked { background: var(--accent); }
.sc-switch:checked::after { transform: translateX(18px); }
.sc-cat-row { display: grid; grid-template-columns: 52px 1fr 1fr 40px 34px; gap: 6px; align-items: center; }
.sc-cat-row input { border: 1.5px solid var(--line); background: var(--bg); border-radius: 10px; padding: 7px 9px; min-width: 0; outline: 0; }
.sc-cat-row input[type="color"] { padding: 2px; height: 36px; cursor: pointer; }
.sc-swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.sc-swatch { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--c); box-shadow: 0 0 0 2px var(--bg), 0 0 0 2px transparent; transition: box-shadow .15s, transform .15s cubic-bezier(.3, 1.8, .5, 1); }
.sc-swatch:hover { transform: scale(1.1); }
.sc-swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--c, var(--text)); }
.sc-swatch--auto { --c: var(--text-3); background: conic-gradient(#8b5cf6, #ec4899, #f59e0b, #14b8a6, #8b5cf6); }

/* ── Composer media tray ── */
.sc-tray { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; padding: 2px; margin: -2px 0 0 56px; }
.sc-tray__item { position: relative; flex: none; width: 96px; height: 96px; border-radius: 14px; overflow: hidden; background: var(--sunken); animation: sc-pop .3s cubic-bezier(.3, 1.8, .5, 1) both; }
.sc-tray__item img, .sc-tray__item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-tray__item.is-up img, .sc-tray__item.is-up video { filter: saturate(.6) brightness(.8); }
.sc-tray__x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; backdrop-filter: blur(4px); }
.sc-tray__x:hover { background: var(--danger); }
.sc-tray__dur { position: absolute; left: 4px; bottom: 4px; font-size: 11px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .55); border-radius: 999px; padding: 1px 7px; }
.sc-tray__prog { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.sc-tray__prog i { display: block; height: 100%; width: var(--p, 0%); background: #fff; border-radius: inherit; transition: width .15s; }
.sc-tray__item:has(.sc-tray__prog) .sc-tray__dur { bottom: 16px; }
.sc-compose.is-drop { outline: 2.5px dashed var(--accent); outline-offset: 3px; }
@media (max-width: 560px) { .sc-tray { margin-left: 0; } .sc-tray__item { width: 80px; height: 80px; } }

/* ── Post photos ── */
.sc-gallery { display: grid; gap: 4px; margin: 10px 0 12px; border-radius: calc(var(--radius) * .7); overflow: hidden; }
.sc-gallery__item { position: relative; border: 0; padding: 0; background: var(--sunken); cursor: zoom-in; min-height: 0; overflow: hidden; }
.sc-gallery__item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s cubic-bezier(.2, .9, .3, 1); }
.sc-gallery__item:hover img { transform: scale(1.03); }
.sc-gallery[data-n="1"] .sc-gallery__item { aspect-ratio: var(--ar, 4 / 3); max-height: min(70vh, 620px); }
.sc-gallery[data-n="1"] .sc-gallery__item img { object-fit: contain; background: color-mix(in oklab, var(--text) 6%, transparent); }
.sc-gallery[data-n="2"] { grid-template-columns: 1fr 1fr; aspect-ratio: 2 / 1.2; }
.sc-gallery[data-n="3"] { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 4 / 3; }
.sc-gallery[data-n="3"] .sc-gallery__item:first-child { grid-row: span 2; }
.sc-gallery[data-n="4"] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 1 / 1; }
.sc-gallery__more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10, 6, 25, .5); color: #fff; font-family: var(--font-display); font-size: 1.8em; font-weight: 600; }
:root[data-layout="compact"] .sc-gallery, :root[data-layout="compact"] .sc-reel { margin-left: 46px; max-width: 360px; }

/* ── Post reel (feed) ── */
.sc-reel { position: relative; margin: 10px 0 12px; border-radius: calc(var(--radius) * .7); overflow: hidden; background: #000;
  aspect-ratio: var(--ar, 9 / 16); max-height: min(72vh, 640px); width: 100%; }
.sc-reel video { width: 100%; height: 100%; object-fit: contain; display: block; cursor: pointer; }
.sc-reel::after { content: "▶"; position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; padding-left: 5px;
  font-size: 24px; color: #fff; background: rgba(0, 0, 0, .45); backdrop-filter: blur(6px); pointer-events: none; transition: opacity .2s, transform .2s; }
.sc-reel.is-playing::after { opacity: 0; transform: scale(.7); }
.sc-reel__badge { position: absolute; left: 10px; top: 10px; font-size: 12px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .5); border-radius: 999px; padding: 3px 10px; backdrop-filter: blur(4px); pointer-events: none; }
.sc-reel__mute, .sc-reel__open { position: absolute; bottom: 10px; width: 36px; height: 36px; border: 0; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(0, 0, 0, .5); backdrop-filter: blur(4px); font-size: 16px; }
.sc-reel__mute { right: 10px; }
.sc-reel__open { right: 52px; }
.sc-reel__mute:hover, .sc-reel__open:hover { background: rgba(0, 0, 0, .7); }
.sc-reel__mute svg { width: 18px; height: 18px; }
.sc-tabs .sc-tabs__reels { flex: 0 0 auto; padding: 8px 12px; color: var(--accent-ink); background: var(--accent-soft); }
.sc-tabs .sc-tabs__reels:hover { color: var(--accent-ink); filter: brightness(1.05); }

/* ── Photo lightbox ── */
.sc-lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(8, 5, 18, .94); display: none; place-items: center; touch-action: pan-y; }
.sc-lightbox[open] { display: grid; animation: sc-fade .2s ease; }
.sc-lightbox::backdrop { background: transparent; }
.sc-lightbox img { max-width: 94vw; max-height: 88dvh; object-fit: contain; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); user-select: none; -webkit-user-drag: none; }
.sc-lb-btn { position: absolute; z-index: 2; width: 46px; height: 46px; border: 0; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, .14); font-size: 26px; line-height: 1; backdrop-filter: blur(6px); }
.sc-lb-btn:hover { background: rgba(255, 255, 255, .26); }
.sc-lb-close { top: calc(14px + env(safe-area-inset-top)); right: 14px; font-size: 17px; }
.sc-lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.sc-lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.sc-lb-count { position: absolute; bottom: calc(18px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); color: #fff; font-weight: 700; font-size: 14px; background: rgba(0, 0, 0, .4); border-radius: 999px; padding: 4px 12px; }
.sc-lb-count:empty { display: none; }

/* ── Reels viewer ── */
.sc-reels { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #000; color: #fff; display: none; }
.sc-reels[open] { display: block; animation: sc-fade .2s ease; }
.sc-reels::backdrop { background: #000; }
.sc-reels__list { height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; }
.sc-reels__list::-webkit-scrollbar { display: none; }
.sc-rslide { --col: min(100vw, calc(100dvh * .7)); --edge: calc((100% - var(--col)) / 2);
  position: relative; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; display: grid; place-items: center; overflow: hidden; }
.sc-rslide video { width: 100%; height: 100%; max-width: var(--col); object-fit: contain; background: #000; cursor: pointer; }
.sc-rslide.is-paused::after { content: "▶"; position: absolute; inset: 0; margin: auto; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; padding-left: 6px;
  font-size: 30px; background: rgba(0, 0, 0, .4); backdrop-filter: blur(6px); pointer-events: none; }
.sc-rslide__info { position: absolute; left: var(--edge); right: calc(var(--edge) + 70px); bottom: 0; padding: 60px 18px calc(22px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0, 0, 0, .7)); pointer-events: none; }
.sc-rslide__info > * { pointer-events: auto; }
.sc-rslide__who { display: flex; align-items: center; gap: 8px; font-weight: 700; flex-wrap: wrap; }
.sc-rslide__who .sc-namebtn { color: #fff; }
.sc-rslide__who time { font-weight: 500; font-size: .82em; opacity: .75; }
.sc-rslide__cap { margin: 8px 0 0; max-width: 560px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .95em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.sc-rslide__rail { position: absolute; right: max(12px, calc(var(--edge) - 66px)); bottom: calc(30px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; align-items: center; }
.sc-rbtn { width: 50px; min-height: 50px; border: 0; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 6px 0;
  background: rgba(255, 255, 255, .14); color: #fff; backdrop-filter: blur(8px); transition: transform .2s cubic-bezier(.3, 1.8, .5, 1), background .15s; }
.sc-rbtn:hover { background: rgba(255, 255, 255, .24); }
.sc-rbtn:active { transform: scale(.88); }
.sc-rbtn[aria-pressed="true"] { background: color-mix(in oklab, var(--accent) 70%, transparent); }
.sc-rbtn .e { font-size: 22px; line-height: 1; }
.sc-rbtn small { font-size: 11px; font-weight: 800; }
.sc-rbtn small:empty { display: none; }
.sc-rslide__replies { position: absolute; left: var(--edge); right: var(--edge); bottom: 0; max-height: 62%; overflow-y: auto; padding: 0 14px calc(14px + env(safe-area-inset-bottom));
  background: var(--bg); color: var(--text); border-radius: 22px 22px 0 0; transform: translateY(105%); transition: transform .3s cubic-bezier(.2, .9, .3, 1); z-index: 3; }
.sc-rslide__replies.is-open { transform: none; box-shadow: var(--shadow-lg); }
.sc-rslide__replies .sc-replies { border-top: 0; }
.sc-rslide--empty { flex-direction: column; gap: 6px; text-align: center; padding: 20px; color: #ddd; display: flex; justify-content: center; }
.sc-rslide--empty i { font-style: normal; font-size: 52px; }
.sc-rslide--empty b { font-family: var(--font-display); font-size: 1.4em; color: #fff; }
.sc-reels .sc-lb-close { z-index: 4; }

/* My page sheet bits — light backdrop so the live preview stays visible */
#sc-me-sheet::backdrop { background: rgba(15, 10, 35, .12); backdrop-filter: none; }
.sc-imgpick { display: flex; flex-direction: column; gap: 8px; }
.sc-imgpick__prev { height: 110px; border-radius: 14px; background: var(--sunken) center / cover no-repeat; display: grid; place-items: center; font-size: .84em; color: var(--text-3); border: 1.5px dashed var(--line); }
.sc-imgpick__prev[style*="background-image"] { border-style: solid; }
.sc-imgpick__prev--bg { height: 150px; }
.sc-imgpick__prev.is-busy { animation: sc-busy 1s ease-in-out infinite alternate; }
@keyframes sc-busy { to { opacity: .5; } }
.sc-imgpick__btns { display: flex; gap: 8px; }
.sc-imgpick__btns .sc-btn { padding: 8px 14px; font-size: 13px; }
.sc-range { display: flex; align-items: center; gap: 10px; }
.sc-range input { flex: 1; min-width: 0; }
.sc-range output { font-size: .82em; font-weight: 700; color: var(--text-2); min-width: 4ch; text-align: right; font-variant-numeric: tabular-nums; }
.sc-swatch--pick { padding: 0; overflow: hidden; cursor: pointer; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); }
.sc-swatch--pick::-webkit-color-swatch-wrapper { padding: 0; opacity: 0; }
.sc-swatch--pick::-moz-color-swatch { opacity: 0; }

/* Toasts */
.sc-toasts { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; width: calc(100% - 32px); max-width: 420px; pointer-events: none; }
.sc-toast { background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 650; box-shadow: var(--shadow-lg); animation: sc-pop .35s cubic-bezier(.3, 1.8, .5, 1) both; }
.sc-toast.is-err { background: var(--danger); color: #fff; }

/* View Transitions (feed swaps / new posts) */
::view-transition-group(*) { animation-duration: .3s; animation-timing-function: cubic-bezier(.2, .9, .3, 1); }

@media (max-width: 560px) {
  .sc-hero { padding-top: 20px; }
  .sc-hero__stickers span:nth-child(3) { display: none; }
  .sc-tool--txt span { display: none; }
  .sc-tabs { overflow-x: auto; scrollbar-width: none; }
  .sc-tabs::-webkit-scrollbar { display: none; }
  .sc-tabs button { font-size: .8em; flex: 0 0 auto; padding: 8px 10px; }
  .sc-cat-row { grid-template-columns: 46px 1fr 40px 34px; }
  .sc-cat-row .sc-cat-key { display: none; }
  .sc-row2 { grid-template-columns: 1fr; }
  .sc-sheet { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .sc-aurora i { animation: none; }
}
