/* =====================================================================
   Spill Sisters — Redesign Layer (Pass 1: app chrome + feed + story/thread)

   Loaded AFTER styles.css and brand.css. This file does not edit the
   24k-line styles.css; it overrides it on the token system defined in
   tokens.css. Everything is scoped under `html.ss-redesign` for a
   specificity boost, and `!important` is used only where an existing
   `!important` rule sets the same property.

   Direction: "refined glam" — keep the pink + near-black identity and
   the voice, but fix spacing rhythm and type hierarchy, calm the
   decoration (gradients, glows, oversized radii), and remove dead space
   and generated-looking filler.

   Sections:
     1. Base / typography
     2. App chrome — top bar, rails, primary nav
     3. Feed — header, room filters, story rows, action bar
     4. Story / thread — reading column, body, poll, comments, reader
     5. Decoration cleanup (glows, gradients, stray radii)
===================================================================== */

/* ---------------------------------------------------------------------
   1. BASE / TYPOGRAPHY
--------------------------------------------------------------------- */

/* Kill the phantom horizontal scrollbar: shell widths use 100%/100vw,
   which include the vertical scrollbar gutter, so they sit ~4px past the
   client width. `clip` on the root contains it without breaking sticky. */
html.ss-redesign {
  overflow-x: clip;
  /* Reserve the scrollbar's width permanently instead of letting it appear
     only once page height exceeds the viewport. Without this, switching
     the auth screen to the taller Create-account form could cross that
     threshold mid-interaction and shift the whole page (and the vertical
     split-screen divider) sideways by the scrollbar's width. */
  scrollbar-gutter: stable;
  /* Slim flat bottom nav (see section 2) — feeds the content padding-bottom
     calcs that reference this token with a 76px fallback. */
  --ss-mobile-bottom-nav-h: 58px;
  /* Retire Montserrat: repoint every styles.css font token at the system
     stack (they are set `!important` on :root, so match that). */
  --font-body: var(--ss-font-body) !important;
  --font-display: var(--ss-font-body) !important;
  --ss-font-app: var(--ss-font-body) !important;
  --ss-font-editorial: var(--ss-font-body) !important;
  /* <html> is white by default and shows through below a short page (above
     the fixed bottom nav) — the "half black, half white" seam. app.js also
     stamps .dark-mode on <html> so this token flips. */
  background: var(--ss-color-bg) !important;
}
html.ss-redesign body {
  min-height: 100dvh !important;
  background: var(--ss-color-bg) !important;
}

/* Post reader: one story, one body. The gallery intentionally reads as a
   gallery instead of a row of partially visible cards. */
/* Post media = a bounded "stage" (like Reddit / X): the image is capped
   so the body copy and action bar stay on the first screen. Full image
   is one tap away in the fullscreen viewer. */
html.ss-redesign .story-page.story-thread .story-media-gallery {
  position: relative !important;
  margin: var(--ss-space-3) 0 !important;
}
html.ss-redesign .story-page.story-thread .story-media-grid {
  display: flex !important;
  align-items: stretch !important;
  gap: 0 !important;
  overflow-x: auto !important;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory !important;
  scrollbar-width: none;
  border-radius: var(--ss-radius-md) !important;
  background: #141118 !important;   /* neutral stage so portrait screenshots read as media, not a stray photo */
}
html.ss-redesign .story-page.story-thread .story-media-grid::-webkit-scrollbar { display: none; }
html.ss-redesign .story-page.story-thread .story-media-item {
  flex: 0 0 100% !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 38vh !important;
  height: 52vh !important;
  max-height: 460px !important;
  scroll-snap-align: start !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  aspect-ratio: auto !important;   /* styles.css locks this to 4/3 */
  background: transparent !important;
  cursor: zoom-in !important;
}
html.ss-redesign .story-page.story-thread .story-media-item img {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

/* Gallery controls overlaid on the image, Reddit-style: side arrows +
   a small dot pill at the bottom. Only rendered when 2+ images. */
html.ss-redesign .story-media-controls {
  position: absolute !important;
  inset: 0 !important;
  margin: 0 !important;
  display: block !important;
  pointer-events: none !important;
}
html.ss-redesign .story-media-nav {
  pointer-events: auto !important;
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  display: grid !important;
  place-items: center !important;
  width: 34px !important;
  height: 34px !important;
  border: 0 !important;
  border-radius: var(--ss-radius-circle) !important;
  background: rgba(18, 16, 20, 0.55) !important;
  color: #fff !important;
}
html.ss-redesign .story-media-nav:hover,
html.ss-redesign .story-media-nav:focus-visible {
  background: rgba(18, 16, 20, 0.78) !important;
  color: #fff !important;
  outline: 0 !important;
}
html.ss-redesign .story-media-nav[data-story-media-move="-1"] { left: 8px !important; }
html.ss-redesign .story-media-nav[data-story-media-move="1"] { right: 8px !important; }
/* "1 / 4" position pill, bottom-centre on the image */
html.ss-redesign .story-media-count {
  position: absolute !important;
  left: 50% !important;
  bottom: 10px !important;
  transform: translateX(-50%) !important;
  padding: 3px 9px !important;
  border-radius: var(--ss-radius-pill) !important;
  background: rgba(18, 16, 20, 0.62) !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: var(--ss-weight-semibold) !important;
  letter-spacing: 0.02em !important;
  font-variant-numeric: tabular-nums !important;
}
html.ss-redesign body.story-view .story-page.story-thread {
  padding-bottom: calc(var(--ss-space-6) + env(safe-area-inset-bottom)) !important;
}
@media (max-width: 900px) {
  html.ss-redesign body.story-view .app-grid,
  html.ss-redesign body.logged-in.story-view .app-grid {
    padding-bottom: calc(var(--ss-mobile-bottom-nav-h, 76px) + var(--ss-space-5) + env(safe-area-inset-bottom)) !important;
  }
}
html.ss-redesign body {
  font-family: var(--ss-font-body) !important;
  font-size: var(--ss-text-body) !important;   /* 15px, up from 14 */
  line-height: 1.45;
  color: var(--ss-ink);
  background: var(--ss-bg);
  overflow-x: clip;
}

/* The platform UI font. The --font-* token overrides above flip most of
   styles.css; this catches the rest. Montserrat is no longer loaded, so
   any literal `font-family:"Montserrat",<system…>` rule falls through to
   its own system fallback anyway. The serif reading rules below are more
   specific and re-assert the serif on the post body only. */
html.ss-redesign body,
html.ss-redesign button,
html.ss-redesign input,
html.ss-redesign select,
html.ss-redesign textarea,
html.ss-redesign label,
html.ss-redesign a,
html.ss-redesign p,
html.ss-redesign h1,
html.ss-redesign h2,
html.ss-redesign h3,
html.ss-redesign h4,
html.ss-redesign h5,
html.ss-redesign h6,
html.ss-redesign span,
html.ss-redesign small,
html.ss-redesign strong,
html.ss-redesign b,
html.ss-redesign em,
html.ss-redesign li,
html.ss-redesign td,
html.ss-redesign th,
html.ss-redesign blockquote,
html.ss-redesign legend {
  font-family: var(--ss-font-body) !important;
}

/* Real 700 face now loaded — retire synthetic 800 across the app. */
html.ss-redesign h1,
html.ss-redesign h2,
html.ss-redesign h3,
html.ss-redesign strong,
html.ss-redesign b {
  font-weight: var(--ss-weight-semibold);
}

/* Uppercase micro-labels need tracking or they read as a cramped blob. */
html.ss-redesign .eyebrow,
html.ss-redesign .brand small,
html.ss-redesign .sticker,
html.ss-redesign .read-chip,
html.ss-redesign .stat-strip,
html.ss-redesign .feed-section-head .eyebrow {
  letter-spacing: var(--ss-tracking-caps) !important;
}

/* Brand-pink focus ring everywhere, replacing the teal one. */
html.ss-redesign a:focus-visible,
html.ss-redesign button:focus-visible,
html.ss-redesign input:focus-visible,
html.ss-redesign select:focus-visible,
html.ss-redesign textarea:focus-visible {
  outline: none;
  box-shadow: var(--ss-focus-ring);
}

/* ---------------------------------------------------------------------
   2. APP CHROME
--------------------------------------------------------------------- */

/* --- Top bar: flat, short, aligned to the grid ------------------- */
html.ss-redesign body.logged-in .topbar.app-topbar {
  min-height: 54px !important;
  height: 54px !important;
  padding: 0 clamp(var(--ss-space-3), 2vw, var(--ss-space-6)) !important;
  gap: var(--ss-space-3);
  border: 0 !important;
  border-bottom: var(--ss-divider) !important;
  border-radius: 0 !important;
  /* Match the page ground (hairline divider is the separation) so the app
     chrome doesn't seam against the content — one continuous surface. */
  background: var(--ss-color-bg) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

html.ss-redesign .topbar.app-topbar .brand,
html.ss-redesign body.logged-in .topbar.app-topbar .brand,
html.ss-redesign .topbar.app-topbar .brand > .brand-lockup,
html.ss-redesign body.logged-in .topbar.app-topbar .brand > .brand-lockup {
  min-height: 0 !important;
  padding: 0 !important;
  align-self: center !important;
}

html.ss-redesign .topbar.app-topbar .brand .brand-header-image,
html.ss-redesign body.logged-in .topbar.app-topbar .brand .brand-header-image {
  width: auto !important;
  height: 44px !important;
  max-width: 52vw !important;
}

/* "18+ community" tagline removed from the header per request */
html.ss-redesign .topbar.app-topbar .brand small,
html.ss-redesign body.logged-in .topbar.app-topbar .brand small {
  display: none !important;
}

html.ss-redesign .topbar.app-topbar .search-box {
  min-height: 40px;
  border: var(--ss-divider);
  border-radius: var(--ss-radius-pill);
  background: var(--ss-color-soft);
}
html.ss-redesign .topbar.app-topbar .search-box svg { color: var(--ss-muted); }
html.ss-redesign .topbar.app-topbar .search-box input,
html.ss-redesign .topbar.app-topbar .search-box input::placeholder {
  color: var(--ss-ink);
}
html.ss-redesign .topbar.app-topbar .search-box input::placeholder { color: var(--ss-muted); }

/* Desktop keeps the labelled theme control in Account actions. On phones,
   expose the same preference as a dedicated thumb-sized moon/sun control so
   it cannot disappear with the compacted account actions. */
html.ss-redesign .mobile-theme-toggle,
html.ss-redesign .mobile-alerts-toggle { display: none !important; }

/* Top-bar buttons: quiet ghost, single pink CTA ("Join"). */
html.ss-redesign .topbar .ghost-button {
  color: var(--ss-muted);
  background: transparent;
}
html.ss-redesign .topbar .ghost-button:hover { color: var(--ss-ink); background: var(--ss-color-soft); }
html.ss-redesign .topbar .primary-button {
  background: var(--ss-pink);
  color: #fff;
  border-radius: var(--ss-radius-pill);
  box-shadow: none;
}

/* Notification bell badge: was a bare 9px dot; show the unread count. */
html.ss-redesign .notification-button .notification-dot.has-count {
  top: 2px !important;
  right: 2px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 16px !important;
  height: 16px !important;
  padding: 0 4px !important;
  border-radius: var(--ss-radius-pill) !important;
  background: var(--ss-pink) !important;
  box-shadow: 0 0 0 2px var(--ss-surface) !important;
  color: #fff !important;
  font-size: 10px !important;
  font-weight: var(--ss-weight-semibold) !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
}
/* Inbox gets a real numeric badge for unread chats and requests. */
html.ss-redesign [data-profile-menu-view='notifications'].has-unread,
html.ss-redesign [data-profile-menu-view='inbox'].has-unread,
html.ss-redesign .left-rail [data-view='inbox'].has-unread,
html.ss-redesign .mobile-nav [data-mobile-view='notifications'].has-unread,
html.ss-redesign .mobile-nav [data-mobile-view='inbox'].has-unread {
  position: relative;
}
html.ss-redesign [data-profile-menu-view='notifications'].has-unread::after,
html.ss-redesign [data-profile-menu-view='inbox'].has-unread::after,
html.ss-redesign .mobile-nav [data-mobile-view='notifications'].has-unread::after,
html.ss-redesign .mobile-nav [data-mobile-view='inbox'].has-unread::after {
  content: attr(data-unread-count);
  position: absolute;
  top: 5px;
  right: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border: 2px solid var(--ss-surface);
  border-radius: var(--ss-radius-pill);
  background: var(--ss-pink);
  color: #fff;
  font-size: 10px;
  font-weight: var(--ss-weight-semibold);
  line-height: 1;
}
/* Left rail keeps the count aligned at the far edge of its nav pill. */
html.ss-redesign .left-rail [data-view='inbox'].has-unread::after {
  content: attr(data-unread-count);
  position: absolute;
  top: 50%;
  right: var(--ss-space-3);
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--ss-radius-pill);
  background: var(--ss-pink);
  color: #fff;
  font-size: 10px;
  font-weight: var(--ss-weight-semibold);
  line-height: 1;
}

/* --- Grid: leave the app's responsive column template alone (it already
       collapses correctly for drawer / 2-col / mobile). Only add rhythm,
       and cap the feed content width via the inner list, not the cell. --- */
/* Never let the shell paint wider than the viewport (the app's fixed-ish
   grid tracks + padding can sum past 100% and add a phantom h-scrollbar).
   `clip` (not `hidden`) keeps position:sticky descendants working. */
html.ss-redesign .app-shell {
  max-width: 100%;
  overflow-x: clip;
}

@media (min-width: 901px) {
  html.ss-redesign body.logged-in .app-grid {
    gap: var(--ss-space-6) !important;
    margin-top: var(--ss-space-5) !important;
  }
  /* Content-forward: let the shell use the screen and give the extra
     width to the feed, so the main column doesn't float in a void. */
  html.ss-redesign body.logged-in:not(.story-view):not(.inbox-view):not(.control-center-view) .app-grid {
    grid-template-columns: 210px minmax(0, 1fr) 300px !important;
    width: min(1300px, 100%) !important;
    max-width: 1300px !important;
  }
  /* Hamburger on desktop hides the left rail (focus mode). Drop its 210px
     track too, or the feed gets auto-placed into that sliver. */
  html.ss-redesign body.logged-in.sidebar-collapsed:not(.story-view):not(.inbox-view):not(.control-center-view) .app-grid {
    grid-template-columns: minmax(0, 1fr) 300px !important;
  }
  /* Profile / settings / connections: keep the nav rail, drop the trending
     rail (feed chrome, not relevant here) and let the content fill.
     Depth matches redesign.css:385 + styles.css so the 3rd track is gone. */
  html.ss-redesign body.logged-in.profile-view:not(.story-view):not(.inbox-view):not(.control-center-view) .app-shell .app-grid.app-grid {
    grid-template-columns: 210px minmax(0, 720px) !important;
    justify-content: center !important;
  }
  html.ss-redesign body.logged-in.profile-view.sidebar-collapsed:not(.story-view):not(.inbox-view):not(.control-center-view) .app-shell .app-grid.app-grid {
    grid-template-columns: minmax(0, 720px) !important;
  }
  html.ss-redesign body.logged-in.profile-view .right-rail {
    display: none !important;
  }
  html.ss-redesign body.logged-in:not(.story-view):not(.inbox-view):not(.control-center-view) .feed-column {
    max-width: none !important;
  }
  html.ss-redesign body.logged-in.profile-view .feed-column,
  html.ss-redesign body.logged-in.profile-view #feed,
  html.ss-redesign body.logged-in.profile-view .public-profile,
  html.ss-redesign body.logged-in.profile-view .alias-profile-page {
    max-width: 720px !important;
    width: 100% !important;
  }
}
@media (min-width: 1440px) {
  html.ss-redesign body.logged-in:not(.story-view):not(.inbox-view):not(.control-center-view) .feed-column {
    max-width: 760px !important;   /* stop the feed getting silly-wide */
    margin-inline: auto !important;
  }
  /* renderViewHead screens (notifications, rooms, drafts, following, …)
     have intrinsically-flexible content, so the 760px cap + auto margins
     above let the column shrink-wrap to its text and leave a wide dead
     gap before the right rail. Let those fill their grid track. */
  html.ss-redesign body.logged-in:not(.story-view):not(.inbox-view):not(.control-center-view) .feed-column:has(.view-head) {
    max-width: none !important;
    margin-inline: 0 !important;
  }
}
@media (min-width: 901px) {
  html.ss-redesign .left-rail,
  html.ss-redesign .right-rail {
    top: calc(var(--ss-topbar-h) + var(--ss-space-4));
    gap: var(--ss-space-3);
  }
  /* Rails: plain columns, not shadowed cards floating over a flat feed. */
  html.ss-redesign .left-rail {
    padding: 0 var(--ss-space-4) 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
}
/* Right rail: plain stacked sections, not floating cards. A hairline
   between each is the only structure — matches the flat feed. The
   `body.logged-in` depth beats styles.css's own `.right-rail .panel`
   rule, which otherwise re-adds a border-bottom and its own padding. */
html.ss-redesign body.logged-in .right-rail .panel,
html.ss-redesign body.logged-in .right-rail .rail-card {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  /* left inset so the text clears the rail's own left rule */
  padding: 0 0 0 var(--ss-space-5) !important;
}
html.ss-redesign body.logged-in .right-rail .panel + .panel,
html.ss-redesign body.logged-in .right-rail .rail-card + .rail-card,
html.ss-redesign body.logged-in .right-rail .panel + .rail-card {
  margin-top: var(--ss-space-5) !important;
  padding-top: var(--ss-space-5) !important;
  border-top: var(--ss-divider) !important;
}
html.ss-redesign .rail-card {
  border: var(--ss-divider) !important;
  border-radius: var(--ss-radius-lg) !important;
  background: var(--ss-surface) !important;
  box-shadow: none !important;
  padding: var(--ss-space-4) !important;
}

/* --- Primary nav pills ----------------------------------------- */
html.ss-redesign .left-rail .nav-pill {
  min-height: var(--ss-tap-target-min);
  gap: var(--ss-space-3);
  padding: 0 var(--ss-space-3);
  border-radius: var(--ss-radius-md);
  color: var(--ss-muted);
  font-size: var(--ss-text-nav);
  font-weight: var(--ss-weight-medium);
}
html.ss-redesign body.logged-in .left-rail .nav-pill:hover,
html.ss-redesign body.drawer-open .left-rail .nav-pill:hover {
  background: var(--ss-color-soft) !important;
  color: var(--ss-ink) !important;
}
html.ss-redesign body.logged-in .left-rail .nav-pill.active,
html.ss-redesign body.drawer-open .left-rail .nav-pill.active {
  background: var(--ss-color-pink-soft) !important;
  color: var(--ss-pink) !important;
}
html.ss-redesign body.logged-in .left-rail .nav-pill.active svg { color: var(--ss-pink) !important; }

/* "Spill the Tea" composer button — the one place a filled pink lives here.
   styles.css paints it with a #cf1b63 -> #ff5f6a gradient whose light end
   puts white text at 2.95:1, so this is forced flat: solid raspberry clears
   4.5:1 across the whole button and matches the rest of the flat redesign. */
html.ss-redesign .left-rail .spill-button {
  min-height: var(--ss-tap-target-min);
  margin-top: var(--ss-space-2);
  border-radius: var(--ss-radius-pill);
  background: #cf1b63 !important;
  background-image: none !important;
  color: #fff !important;
  font-weight: var(--ss-weight-semibold);
  box-shadow: none;
}
/* Dark mode dropped the fill entirely, leaving the primary action looking
   like a ghost button. Keep it filled, in the ratio-safe raspberry. */
html.ss-redesign body.logged-in.dark-mode .left-rail .spill-button,
html.ss-redesign body.dark-mode .left-rail .spill-button {
  background: #cf1b63 !important;
  background-image: none !important;
  color: #fff !important;
  border-color: transparent !important;
}
html.ss-redesign body.dark-mode .left-rail .spill-button svg { color: #fff !important; }

/* --- Mobile bottom nav: active tab was a solid near-black rounded
       card (styles.css:1762 `background: var(--black)`), which reads as
       a stray floating chip. Match the left-rail treatment: quiet pink
       tint + pink label, no invert. --------------------------------- */
html.ss-redesign .mobile-nav button.active {
  background: var(--ss-color-pink-soft, rgba(255, 47, 139, 0.12)) !important;
  color: var(--ss-pink) !important;
  border-radius: var(--ss-radius-md) !important;
}
html.ss-redesign .mobile-nav button.active svg { color: var(--ss-pink) !important; }
html.ss-redesign .mobile-nav button:focus-visible {
  outline: 2px solid var(--ss-focus-ring, var(--ss-pink)) !important;
  outline-offset: -2px !important;
}

/* --- Slim bottom nav: was a ~68px floating rounded pill (12px inset all
       round, 22px radius, blur + a big drop shadow) that ate screen and
       overlapped content. Make it a flat ~54px full-width bar flush to the
       edge with a hairline top rule — closer to a native tab bar. ------ */
@media (max-width: 900px) {
  html.ss-redesign body.logged-in .mobile-nav {
    right: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    gap: 0 !important;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom)) !important;
    border: 0 !important;
    border-top: var(--ss-divider) !important;
    border-radius: 0 !important;
    /* Same ground as the page — a hairline top rule is the only separation,
       like a native tab bar. Avoids a "two shades of black" seam. */
    background: var(--ss-color-bg) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  html.ss-redesign body.logged-in .mobile-nav button {
    min-height: 46px !important;
    gap: 2px !important;
    border-radius: var(--ss-radius-md) !important;
    /* 10px muted labels came in at 3.67:1 on the dark ground. 11px at
       medium weight, on the lighter muted, clears 4.5:1. */
    font-size: 11px !important;
    font-weight: var(--ss-weight-medium) !important;
  }
  html.ss-redesign body.logged-in.dark-mode .mobile-nav button {
    color: var(--ss-muted) !important;
  }
  html.ss-redesign body.logged-in.dark-mode .mobile-nav button.active {
    color: var(--ss-pink) !important;
  }
  html.ss-redesign body.logged-in .mobile-nav button svg,
  html.ss-redesign body.logged-in .mobile-nav svg {
    width: 20px !important;
    height: 20px !important;
  }
  /* Flat bar → tint the active tab, no filled chip. */
  html.ss-redesign body.logged-in .mobile-nav button.active {
    background: transparent !important;
    color: var(--ss-pink) !important;
  }
  /* "Spill" centre button: flat pink, no raised transform / glow. */
  html.ss-redesign body.logged-in .mobile-nav .mobile-spill {
    transform: none !important;
    background: var(--ss-pink) !important;
    box-shadow: none !important;
  }
  /* White on the lighter dark-mode pink is only 3.46:1; the deeper brand
     raspberry takes it to ~5:1 and still reads as the same accent. */
  html.ss-redesign body.logged-in.dark-mode .mobile-nav .mobile-spill {
    background: #cf1b63 !important;
    color: #fff !important;
  }
  html.ss-redesign body.logged-in.dark-mode .mobile-nav .mobile-spill svg { color: #fff !important; }
  html.ss-redesign body.logged-in .mobile-nav .mobile-spill svg { color: #fff !important; }
  /* styles.css reserves 92px for the old tall pill; match the slim bar. */
  html.ss-redesign body.logged-in .app-shell {
    padding-bottom: calc(var(--ss-mobile-bottom-nav-h) + var(--ss-space-3) + env(safe-area-inset-bottom)) !important;
  }
}

/* ---------------------------------------------------------------------
   3. FEED
--------------------------------------------------------------------- */

/* --- Hero prompt: was a 220px gradient panel with a decorative
       "case files" graphic and duplicate copy. Collapse to a slim
       composer prompt; the heading/subtitle just repeated the feed. -- */
html.ss-redesign .feed-column .hero-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ss-space-4);
  min-height: 0;
  padding: var(--ss-space-4) var(--ss-space-5);
  border: var(--ss-divider);
  border-radius: var(--ss-radius-lg);
  background: var(--ss-color-soft);
  color: var(--ss-ink);
  box-shadow: none;
}
html.ss-redesign .hero-strip > div { margin: 0; }
html.ss-redesign .hero-strip h1 {
  margin: 0;
  font-size: var(--ss-text-feed-title);
  font-weight: var(--ss-weight-semibold);
  color: var(--ss-ink);
}
html.ss-redesign .hero-strip p,
html.ss-redesign .hero-strip .eyebrow,
html.ss-redesign .hero-strip .hero-graphic-board { display: none; }
html.ss-redesign .hero-strip .primary-button {
  flex: none;
  background: var(--ss-pink);
  color: #fff;
  border-radius: var(--ss-radius-pill);
  box-shadow: none;
}

/* --- Feed header: one 44px row — title · sort · count ----------- */
/* styles.css adds a blanket 18px .feed-column top pad; on the feed it
   shoved "For You" far below the topbar rule while the section's own
   bottom rule hugged the Hot/New control. Zero the top pad and let the
   header's own min-height center the row between the two rules. */
html.ss-redesign .feed-column:has(.feed-section-head) {
  padding-top: 0 !important;
}
html.ss-redesign .feed-section-head {
  display: flex !important;
  align-items: center !important;
  gap: var(--ss-space-3);
  min-height: 40px !important;
  padding: 0 !important;
  border-bottom: var(--ss-divider);
  margin-bottom: var(--ss-space-2) !important;
}
html.ss-redesign .feed-section-head > div:first-child { flex: 1 1 auto; }
html.ss-redesign .feed-section-head h2,
html.ss-redesign body.logged-in .feed-section-head h2 {
  margin: 0 !important;
  font-size: 18px !important;   /* was the thread-title token (24-32px) — too loud for a section label */
  font-weight: var(--ss-weight-semibold) !important;
  line-height: var(--ss-leading-tight) !important;
}
html.ss-redesign .feed-section-head > span:last-child {
  color: var(--ss-muted);
  font-size: var(--ss-text-meta);
  font-weight: var(--ss-weight-regular);
  letter-spacing: 0;
  text-transform: none;
}

/* Hot / New as a real segmented control. */
html.ss-redesign .feed-mini-controls {
  display: inline-flex !important;
  align-items: center !important;
  gap: 2px !important;
  padding: 2px !important;
  border: var(--ss-divider);
  border-radius: var(--ss-radius-pill);
  background: var(--ss-color-soft);
}
html.ss-redesign .feed-mini-controls button {
  min-height: 26px !important;
  height: 26px !important;
  padding: 0 var(--ss-space-3) !important;
  border: 0;
  border-radius: var(--ss-radius-pill);
  background: transparent;
  color: var(--ss-muted);
  font-size: var(--ss-text-meta);
  font-weight: var(--ss-weight-medium);
}
html.ss-redesign .feed-mini-controls button.active {
  background: var(--ss-surface);
  color: var(--ss-ink);
  box-shadow: var(--ss-shadow-xs);
}
html.ss-redesign .feed-mini-controls .refresh-feed-button {
  min-height: 26px !important;
  height: 26px !important;
  width: 26px !important;
  padding: 0 !important;
  color: var(--ss-muted);
}
html.ss-redesign .feed-mini-controls .refresh-feed-button svg { width: 14px; height: 14px; }

/* --- Room filter: the app shows a <select> for logged-in users.
       Style it as a clean control rather than fighting to swap it. --- */
html.ss-redesign .category-row {
  margin: var(--ss-space-4) 0;
  padding: 0;
  border: 0;
  background: transparent;
}
html.ss-redesign .category-row .category-select-wrap {
  gap: var(--ss-space-1);
}
html.ss-redesign .category-row .category-select-wrap > span {
  color: var(--ss-muted);
  font-size: var(--ss-text-meta);
  font-weight: var(--ss-weight-medium);
  letter-spacing: 0;
  text-transform: none;
}
html.ss-redesign .category-row .category-select {
  min-height: 38px !important;
  max-width: 260px;
  padding: 0 var(--ss-space-3) !important;
  border: var(--ss-divider) !important;
  border-radius: var(--ss-radius-pill) !important;
  background: var(--ss-color-soft) !important;
  color: var(--ss-ink) !important;
  font-size: var(--ss-text-meta) !important;
  font-weight: var(--ss-weight-medium);
}

/* --- Story rows ------------------------------------------------- */
html.ss-redesign .feed-column {
  gap: 0 !important;
}
html.ss-redesign body.logged-in .story-card.feed-row {
  margin-inline: 0 !important;
  padding: var(--ss-space-2) 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-bottom: var(--ss-divider) !important;
}
/* Row highlight = exactly the row width (the old box-shadow spread bled
   ~12px past the column on every side and looked broken). */
html.ss-redesign body.logged-in .story-card.feed-row:hover,
html.ss-redesign body.logged-in .story-card.feed-row:focus-within {
  background: var(--ss-color-soft) !important;
  box-shadow: none !important;
}

html.ss-redesign .story-card .story-face {
  display: flex !important;   /* was grid with a fixed 44px first row (author-row content is only 34px) */
  flex-direction: column !important;
  gap: var(--ss-space-1) !important;
  padding: 0 !important;
  background: none !important;   /* kill per-tone gradient card fills */
}

html.ss-redesign .story-card .story-author-row { margin: 0 !important; }
/* styles.css hangs the title/body/actions 42px to the right of the
   author row on desktop (a leftover avatar-column indent). Pull them
   flush so every row of the card shares one left edge, matching the
   mobile layout — applies to For You + Following (same component). */
html.ss-redesign body.logged-in .story-card .story-main-link {
  padding-left: 0 !important;
}
html.ss-redesign body.logged-in .story-card .story-actions,
html.ss-redesign body.logged-in .story-card .story-card-media-wrap,
html.ss-redesign body.logged-in .story-card .story-card-media,
html.ss-redesign body.logged-in .story-card .story-media-grid {
  margin-left: 0 !important;
  padding-left: 0 !important;
}
html.ss-redesign .story-card .author-chip { gap: var(--ss-space-2); padding: 0; }
html.ss-redesign .story-card .author-chip .author-avatar,
html.ss-redesign .story-card .author-chip .author-avatar img {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  border-radius: var(--ss-radius-circle) !important;
}
html.ss-redesign body.logged-in .story-card .author-chip strong {
  font-size: var(--ss-text-meta) !important;
  font-weight: var(--ss-weight-medium) !important;
  color: var(--ss-ink) !important;
}
html.ss-redesign body.logged-in .story-card .author-chip small {
  font-size: var(--ss-text-meta) !important;
  color: var(--ss-muted) !important;
}
html.ss-redesign body.logged-in .author-chip:hover strong,
html.ss-redesign body.logged-in .author-chip:focus-visible strong {
  text-decoration: none !important;
}
html.ss-redesign body.logged-in .author-chip:focus-visible {
  outline: 2px solid var(--ss-pink) !important;
  outline-offset: 3px;
  border-radius: var(--ss-radius-sm);
}

html.ss-redesign body.logged-in .story-card h2,
html.ss-redesign body.logged-in .story-card.feed-row h2 {
  margin: 0 0 3px !important;
  font-family: var(--ss-font-display) !important;
  font-optical-sizing: auto !important;
  font-size: 16.5px !important;
  font-weight: var(--ss-weight-medium) !important;
  line-height: 1.26 !important;
  letter-spacing: -0.002em !important;
  color: var(--ss-ink) !important;
}
html.ss-redesign body.logged-in .story-preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 !important;
  font-size: var(--ss-text-body) !important;
  line-height: 1.4 !important;
  color: var(--ss-muted) !important;
}

html.ss-redesign .story-card .story-media-grid img {
  margin-top: var(--ss-space-2);
  border-radius: var(--ss-radius-md);
  max-height: 420px;
  object-fit: cover;
}

/* Feed card media — bounded frame, whole image shown (no unbounded
   tall crop). One image sits contained on a soft frame; two split the
   width as tiles; 3+ show the first two plus a "+N" pill. Tap opens
   the fullscreen viewer. */
html.ss-redesign body.logged-in .story-card .story-card-media-wrap {
  margin: var(--ss-space-2) 0 0 !important;
}
html.ss-redesign body.logged-in .story-card .story-card-media-wrap.is-split {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 3px !important;
  border-radius: var(--ss-radius-md) !important;
  overflow: hidden !important;
}
html.ss-redesign body.logged-in .story-card .story-card-media {
  position: relative !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  cursor: zoom-in !important;
  overflow: hidden !important;
}
/* Single image: sits at its own size, centred, height-capped — no crop,
   no letterbox frame (the card ground shows around a portrait). */
html.ss-redesign body.logged-in .story-card .story-card-media-wrap:not(.is-split) .story-card-media {
  display: block !important;
  width: -moz-fit-content !important;
  width: fit-content !important;
  min-width: 140px !important;   /* real box pre-load so lazy images still fetch */
  min-height: 120px !important;
  max-width: 100% !important;
  max-height: none !important;
  aspect-ratio: auto !important;   /* styles.css locks .story-card-media to 4/3 */
  margin: 0 auto !important;
  border-radius: var(--ss-radius-md) !important;
  background: var(--ss-color-soft) !important;
}
html.ss-redesign body.logged-in .story-card .story-card-media-wrap:not(.is-split) .story-card-media img {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 300px !important;
}
/* Two images: equal square tiles, cover. */
html.ss-redesign body.logged-in .story-card .story-card-media-wrap.is-split .story-card-media {
  display: block !important;
  width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  background: var(--ss-color-soft) !important;
}
html.ss-redesign body.logged-in .story-card .story-card-media-wrap.is-split .story-card-media img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
html.ss-redesign .story-card .story-card-media-more {
  position: absolute !important;
  right: 8px !important;
  bottom: 8px !important;
  padding: 2px 8px !important;
  border-radius: var(--ss-radius-pill) !important;
  background: rgba(18, 16, 20, 0.62) !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: var(--ss-weight-semibold) !important;
  line-height: 1.4 !important;
}

/* --- Action bar: left-aligned icon row, not 4 stretched columns -- */
html.ss-redesign body.logged-in .story-card .story-actions,
html.ss-redesign body.logged-in .story-card > .story-actions.simple-actions {
  display: flex !important;
  grid-template-columns: none !important;
  justify-content: flex-start !important;
  gap: var(--ss-space-5) !important;
  margin-top: var(--ss-space-1) !important;
  padding: 0 !important;
  border-top: 0 !important;
  background: transparent !important;
}
html.ss-redesign body.logged-in .story-card .story-action,
html.ss-redesign body.logged-in .story-card > .story-actions .story-action {
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 28px !important;
  gap: 6px !important;
  padding: 0 !important;
  border: 0 !important;
  color: var(--ss-muted) !important;
  font-size: var(--ss-text-meta) !important;
  font-weight: var(--ss-weight-medium) !important;
  background: transparent !important;
}
html.ss-redesign body.logged-in .story-card .story-action:hover { color: var(--ss-ink) !important; }
html.ss-redesign body.logged-in .story-card .story-action[data-active="true"] { color: var(--ss-pink) !important; }
html.ss-redesign body.logged-in .story-card .story-action svg { width: 16px !important; height: 16px !important; }
/* The teacup artwork sits smaller inside its box than the lucide glyphs
   (thin steam + saucer, cup body only mid-frame), so it needs a larger
   box to read at the same visual weight as comment / save. */
html.ss-redesign body.logged-in .story-card .story-action .ss-sip-icon { width: 21px !important; height: 21px !important; }

/* ---------------------------------------------------------------------
   ACTION-ICON MOTION
   The "sip the tea" reaction (teacup, replaces the heart) plus a
   bookmark drop-in and a press-scale on every icon. Transient classes
   are toggled by app.js (sipBurst / bounceSaveButton), which also
   guards prefers-reduced-motion.
--------------------------------------------------------------------- */
html.ss-redesign .story-action,
html.ss-redesign .take-icon-button {
  position: relative !important;
  overflow: visible !important;
  transition: color 160ms ease, transform 120ms ease !important;
}
html.ss-redesign .story-action svg,
html.ss-redesign .take-icon-button svg {
  transition: transform 140ms ease, color 160ms ease, fill 200ms ease, filter 200ms ease !important;
  transform-origin: center;
}
/* Quick press feedback on every tap (comment / share / more / reply) */
html.ss-redesign .story-action:active svg,
html.ss-redesign .take-icon-button:active svg { transform: scale(0.86); }

/* --- Sip teacup --------------------------------------------------- */
html.ss-redesign .ss-sip-icon {
  width: 23px !important;
  height: 23px !important;
  transform-origin: 30% 85%;   /* pivot near the base, like tipping a cup */
  overflow: visible;
}
html.ss-redesign .ss-sip-icon .ss-sip-cup { fill: none; }
html.ss-redesign .ss-sip-icon .ss-sip-steam { opacity: 0; }
/* Muted until sipped, then the brand pink — consistent on feed + thread
   + comments (comments used a heart, now the same teacup vocabulary). */
html.ss-redesign .story-action.sip-action,
html.ss-redesign .take-icon-button.sip-action { color: var(--ss-muted) !important; }
html.ss-redesign .story-action.sip-action[data-active="true"],
html.ss-redesign .take-icon-button.sip-action[data-active="true"] { color: var(--ss-pink) !important; }
html.ss-redesign .story-action.sip-action:hover,
html.ss-redesign .take-icon-button.sip-action:hover { color: var(--ss-pink) !important; }
/* Sipped: the cup fills with tea */
html.ss-redesign .story-action[data-active="true"] .ss-sip-icon .ss-sip-cup,
html.ss-redesign .take-icon-button[data-active="true"] .ss-sip-icon .ss-sip-cup {
  fill: currentColor;
}
html.ss-redesign .inline-takes .take-actions .take-icon-button.sip-action .ss-sip-icon { width: 15px !important; height: 15px !important; }

/* Steam puff released on a sip */
html.ss-redesign .ss-sip-puff {
  position: absolute;
  left: var(--ss-burst-x, 10px);
  top: var(--ss-burst-y, 50%);
  width: 12px;
  height: 12px;
  margin: -14px 0 0 -6px;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--ss-pink) 55%, transparent), transparent 70%);
}

@media (prefers-reduced-motion: no-preference) {
  html.ss-redesign .story-action.ss-sip-anim .ss-sip-icon {
    animation: ss-sip-tip 520ms cubic-bezier(0.3, 0.7, 0.3, 1.3) both;
  }
  @keyframes ss-sip-tip {
    0%   { transform: rotate(0) scale(1); }
    22%  { transform: rotate(-24deg) scale(0.94); }
    50%  { transform: rotate(-14deg) scale(1.06); }
    72%  { transform: rotate(4deg) scale(0.98); }
    100% { transform: rotate(0) scale(1); }
  }
  html.ss-redesign .story-action.ss-sip-anim .ss-sip-steam {
    animation: ss-sip-steam 620ms ease-out both;
  }
  @keyframes ss-sip-steam {
    0%   { opacity: 0; transform: translateY(2px) scaleY(0.6); }
    35%  { opacity: 0.9; }
    100% { opacity: 0; transform: translateY(-5px) scaleY(1.15); }
  }
  html.ss-redesign .ss-sip-puff {
    animation: ss-sip-puff 780ms ease-out both;
  }
  @keyframes ss-sip-puff {
    0%   { transform: translateY(0) scale(0.4); opacity: 0; }
    25%  { opacity: 0.85; }
    100% { transform: translateY(-22px) scale(1.5); opacity: 0; }
  }

  /* --- Bookmark: drop-in bounce --- */
  html.ss-redesign .story-action.ss-save-anim svg {
    animation: ss-save-drop 440ms cubic-bezier(0.2, 0.8, 0.2, 1.35) both;
  }
  @keyframes ss-save-drop {
    0%   { transform: translateY(-5px) scale(1.18); }
    55%  { transform: translateY(1px) scale(0.92); }
    100% { transform: translateY(0) scale(1); }
  }
}

/* Legacy sticker/mood tags: quiet them down. */
html.ss-redesign .story-card .sticker {
  background: var(--ss-ink);
  font-size: 10px;
}
html.ss-redesign .story-card .read-chip,
html.ss-redesign .story-card .mood-tag {
  border: var(--ss-divider);
  background: var(--ss-color-soft);
  color: var(--ss-muted);
  font-size: 10px;
}

/* ---------------------------------------------------------------------
   4. STORY / THREAD
--------------------------------------------------------------------- */

html.ss-redesign body.story-view .feed-column,
html.ss-redesign body.logged-in.story-view .feed-column {
  max-width: 760px !important;
  margin-inline: auto !important;
  justify-self: center !important;
  padding-inline: 0 !important;   /* .story-page carries the gutter, don't double it */
}
html.ss-redesign body.story-view .story-page.story-thread,
html.ss-redesign body.logged-in.story-view .story-page.story-thread {
  display: block !important;   /* was a grid stretching every row +10-15px */
  grid-template-rows: none !important;
  max-width: 760px !important;
  margin-inline: auto !important;
  padding: var(--ss-space-3) var(--ss-space-4) var(--ss-space-8) !important;
}
html.ss-redesign body.story-view .story-page.story-thread > *,
html.ss-redesign body.logged-in.story-view .story-page.story-thread > * {
  min-height: 0 !important;
}
html.ss-redesign body.story-view .thread-detail,
html.ss-redesign body.logged-in.story-view .thread-detail { margin-top: var(--ss-space-2) !important; }

/* --- Reddit-style density on mobile ---------------------------------
   styles.css + the shell reserve wide left/right gutters on the story
   view (app-grid padding-inline 24px + .story-page padding-inline 16px),
   leaving the reading column ~80px narrower than the screen. Drop the
   shell gutter, keep a tight ~14px text inset, and let post media run
   edge-to-edge (Reddit does the same). ------------------------------- */
@media (max-width: 900px) {
  html.ss-redesign body.story-view .app-grid,
  html.ss-redesign body.logged-in.story-view .app-grid {
    padding-inline: 0 !important;
  }
  /* Trim the stacked top padding (shell + feed-column + story-page) that
     left a chunk of dead space above the author row. */
  html.ss-redesign body.story-view .feed-column,
  html.ss-redesign body.logged-in.story-view .feed-column {
    padding-top: 0 !important;
  }
  html.ss-redesign body.story-view .story-page.story-thread,
  html.ss-redesign body.logged-in.story-view .story-page.story-thread {
    padding-inline: 14px !important;
    padding-top: var(--ss-space-2) !important;
  }
  html.ss-redesign body.story-view .story-page.story-thread .story-media-gallery,
  html.ss-redesign .story-page.story-thread .story-media-gallery {
    margin-inline: -14px !important;
    width: auto !important;
  }
  html.ss-redesign .story-page.story-thread .story-media-grid {
    border-radius: 0 !important;
  }
  /* Tighten the vertical rhythm so more than a few lines are visible
     at once — the author row eats too much height. */
  html.ss-redesign body.logged-in.story-view .story-page.story-thread .thread-author {
    padding-bottom: var(--ss-space-1) !important;
    margin-bottom: var(--ss-space-1) !important;
  }
}

/* styles.css redefines these ~10× each, several with !important and up to
   5 classes deep. We mirror its deepest selector shape + an extra class
   (`.ss-redesign`) + `!important` so the redesign value wins cleanly. */
html.ss-redesign body.logged-in.story-view .story-page.story-thread h1,
html.ss-redesign body.logged-in.story-view .story-page.editorial-thread h1,
html.ss-redesign body.story-view .story-page.story-thread h1,
html.ss-redesign .reader-slide h1 {
  margin: var(--ss-space-1) 0 var(--ss-space-2) !important;
  font-family: var(--ss-font-display) !important;
  font-optical-sizing: auto !important;
  font-size: clamp(23px, 2vw + 14px, 29px) !important;
  font-weight: var(--ss-weight-medium) !important;
  line-height: 1.22 !important;
  letter-spacing: -0.012em !important;
}

html.ss-redesign body.logged-in.story-view .story-page.story-thread .thread-hook,
html.ss-redesign body.logged-in.story-view .story-page.editorial-thread .thread-hook,
html.ss-redesign body.story-view .story-page.story-thread .thread-hook,
html.ss-redesign .reader-slide .thread-hook {
  margin: 0 0 var(--ss-space-3) !important;
  font-family: var(--ss-font-reading) !important;
  font-size: 17px !important;
  line-height: 1.5 !important;
  font-style: italic !important;
  font-weight: var(--ss-weight-regular) !important;
  color: var(--ss-muted) !important;
}

html.ss-redesign body.logged-in.story-view .story-page.story-thread .thread-body,
html.ss-redesign body.logged-in.story-view .story-page.story-thread .thread-body p,
html.ss-redesign body.logged-in.story-view .story-page.story-thread .thread-body strong,
html.ss-redesign body.logged-in.story-view .story-page.story-thread .thread-body b,
html.ss-redesign body.logged-in.story-view .story-page.story-thread .thread-body em,
html.ss-redesign body.logged-in.story-view .story-page.story-thread .thread-body i,
html.ss-redesign body.logged-in.story-view .story-page.story-thread .thread-body a,
html.ss-redesign body.logged-in.story-view .story-page.editorial-thread .thread-body p,
html.ss-redesign body.story-view .story-page.story-thread .thread-body p,
html.ss-redesign .reader-slide .thread-body,
html.ss-redesign .reader-slide .thread-body p,
html.ss-redesign .reader-slide .thread-body strong,
html.ss-redesign .reader-slide .thread-body b,
html.ss-redesign .reader-slide .thread-body em {
  font-family: var(--ss-font-reading) !important;
}
html.ss-redesign body.logged-in.story-view .story-page.story-thread .thread-body p,
html.ss-redesign body.logged-in.story-view .story-page.editorial-thread .thread-body p,
html.ss-redesign body.story-view .story-page.story-thread .thread-body p,
html.ss-redesign .reader-slide .thread-body p {
  /* space-3 left paragraphs barely further apart than the 1.62 leading
     inside them, so long posts read as one block. */
  margin: 0 0 var(--ss-space-5) !important;
  font-size: 16.5px !important;
  line-height: 1.62 !important;
  color: var(--ss-ink) !important;
}
html.ss-redesign body.logged-in.story-view .story-page.story-thread .thread-body p:last-child,
html.ss-redesign body.story-view .story-page.story-thread .thread-body p:last-child,
html.ss-redesign .reader-slide .thread-body p:last-child {
  margin-bottom: 0 !important;
}
html.ss-redesign body.story-view .story-page.story-thread .thread-body,
html.ss-redesign .story-page.story-thread .thread-body {
  margin-top: var(--ss-space-2) !important;
  padding-top: 0 !important;
}
html.ss-redesign body.story-view .story-page.story-thread .story-page-actions,
html.ss-redesign .story-page.story-thread .story-page-actions {
  margin-top: var(--ss-space-2) !important;
  padding: var(--ss-space-1) 0 !important;
  border: 0 !important;   /* styles.css boxes the action bar top + bottom */
}

html.ss-redesign body.logged-in.story-view .story-page.story-thread .thread-author,
html.ss-redesign body.logged-in.story-view .story-page.editorial-thread .thread-author {
  padding-bottom: var(--ss-space-1) !important;
  margin-bottom: var(--ss-space-1) !important;
  border-bottom: 0 !important;
}
html.ss-redesign .story-page .thread-author .author-avatar,
html.ss-redesign .story-page .thread-author .author-avatar img {
  width: 36px !important;
  height: 36px !important;
}

/* Question / poll block — the "Sister Verdict" prompt. Cherry gives it a
   warm cream ground and a thin brass rule so it reads like a pull quote,
   the one place a second colour appears. */
html.ss-redesign body.story-view .story-page.story-thread .thread-question,
html.ss-redesign .story-page.story-thread .thread-question,
html.ss-redesign .reader-slide .thread-question {
  display: block !important;
  grid-template-rows: none !important;
  margin: var(--ss-space-4) 0 !important;
  padding: var(--ss-space-3) var(--ss-space-4) !important;
  border: 0 !important;
  border-left: 3px solid var(--ss-color-note-line) !important;
  border-radius: var(--ss-radius-md) !important;
  background: var(--ss-color-note) !important;
}
html.ss-redesign .story-page.story-thread .thread-question > *,
html.ss-redesign .reader-slide .thread-question > * { min-height: 0 !important; margin: 0 !important; }
html.ss-redesign .story-page.story-thread .thread-question strong,
html.ss-redesign .reader-slide .thread-question strong {
  display: block !important;
  margin-bottom: var(--ss-space-1) !important;
  font-size: 11px !important;
  font-weight: var(--ss-weight-bold) !important;
  letter-spacing: var(--ss-tracking-caps) !important;
  text-transform: uppercase !important;
  color: var(--ss-color-note-ink) !important;
}
html.ss-redesign .story-page.story-thread .thread-question p,
html.ss-redesign .reader-slide .thread-question p {
  font-family: var(--ss-font-display) !important;
  font-optical-sizing: auto !important;
  font-size: 16px !important;
  line-height: 1.42 !important;
  color: var(--ss-ink) !important;
}
html.ss-redesign .poll-option,
html.ss-redesign .poll-bar {
  border-radius: var(--ss-radius-pill) !important;
}
html.ss-redesign .poll-bar > span,
html.ss-redesign .poll-fill {
  background: var(--ss-pink) !important;
}

/* --- "Sister Takes" comments → Instagram-style compact threads -------
   styles.css makes .inline-takes (and every wrapper down to .take-message)
   a `display:grid` that stretches to a tall parent track, so a single
   comment balloons to ~1000px with huge internal gaps. Force the whole
   chain back to normal flow, then rebuild the row compactly. */
html.ss-redesign .inline-takes,
html.ss-redesign .inline-takes > [data-inline-takes],
html.ss-redesign .inline-takes .takes-thread-list,
html.ss-redesign .inline-takes .take-replies {
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  grid-template-rows: none !important;
}
html.ss-redesign .inline-takes .take-message,
html.ss-redesign .inline-takes .take-content > * {
  height: auto !important;
  min-height: 0 !important;
}

html.ss-redesign .inline-takes { margin-top: var(--ss-space-3) !important; }
html.ss-redesign .inline-takes .drawer-head {
  padding: 0 0 var(--ss-space-2) !important;
  border-bottom: var(--ss-divider) !important;
}
/* The composer sits above the takes and pins just under the top bar, so
   it's one tap away no matter how far down the thread you've scrolled. */
html.ss-redesign body.story-view .inline-takes > .comment-entry-row {
  position: sticky !important;
  top: calc(var(--ss-topbar-h, 54px) + var(--ss-space-1)) !important;
  z-index: 6 !important;
  margin: var(--ss-space-2) 0 var(--ss-space-3) !important;
  box-shadow: 0 6px 16px -10px rgba(18, 16, 20, 0.4) !important;
}
html.ss-redesign .inline-takes .drawer-head strong {
  font-size: var(--ss-text-body) !important;
  font-weight: var(--ss-weight-semibold) !important;
}
html.ss-redesign .inline-takes .drawer-head span { font-size: var(--ss-text-meta) !important; color: var(--ss-muted) !important; }
html.ss-redesign .inline-takes .takes-thread-list { padding-top: var(--ss-space-2) !important; }

/* One comment row */
html.ss-redesign .inline-takes .take-row {
  display: grid !important;
  grid-template-columns: 30px minmax(0, 1fr) !important;
  column-gap: var(--ss-space-3) !important;
  row-gap: 0 !important;
  align-items: start !important;
  height: auto !important;
  min-height: 0 !important;
  padding: var(--ss-space-2) 0 !important;
  border: 0 !important;
  background: none !important;
}
html.ss-redesign .inline-takes .take-row .take-row,
html.ss-redesign .inline-takes .take-replies .take-row {
  grid-template-columns: 24px minmax(0, 1fr) !important;
  column-gap: var(--ss-space-2) !important;
  margin: 0 !important;
  padding-left: 0 !important;
  border-left: 0 !important;
}
html.ss-redesign .inline-takes .take-replies .take-avatar,
html.ss-redesign .inline-takes .take-replies .take-avatar img {
  width: 24px !important;
  min-width: 24px !important;
  max-width: 24px !important;
  height: 24px !important;
  min-height: 24px !important;
}
/* Replies sit inside the parent's content column (past its 30px avatar
   gutter). Pull them left a little — but not so far they overflow a narrow
   viewport — so the indent reads ~16px instead of ~46px. */
html.ss-redesign .inline-takes .take-replies {
  margin-left: -24px !important;
  padding-left: var(--ss-space-3) !important;
  border-left: 2px solid var(--ss-color-border) !important;
}

/* Empty state: renderEmptyTakes() reuses <article class="take-row empty-take">,
   so the grid columns push its <p> into the 30px avatar track. */
html.ss-redesign .inline-takes .take-row.empty-take {
  display: block !important;
  padding: var(--ss-space-4) 0 !important;
  border: 0 !important;
}
html.ss-redesign .inline-takes .take-row.empty-take p {
  margin: 0 !important;
  font-size: var(--ss-text-body) !important;
  line-height: 1.4 !important;
  color: var(--ss-muted) !important;
}

html.ss-redesign .inline-takes .take-avatar-button { padding: 0 !important; }
html.ss-redesign .inline-takes .take-avatar,
html.ss-redesign .inline-takes .take-avatar img {
  width: 30px !important;
  min-width: 30px !important;   /* styles.css forces min-width:38px, which stretched the 30px-tall box into an oval */
  max-width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  border-radius: var(--ss-radius-circle) !important;
}
html.ss-redesign .inline-takes .take-avatar {
  border: 0 !important;
  box-shadow: none !important;
  overflow: hidden !important;
}
html.ss-redesign .inline-takes .take-avatar img {
  object-fit: cover !important;
  object-position: center !important;
}

html.ss-redesign .inline-takes .take-content {
  display: flex !important;
  flex-direction: column !important;
  gap: 1px !important;
  height: auto !important;
}
html.ss-redesign .inline-takes .take-meta {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: baseline !important;
  gap: 0 var(--ss-space-2) !important;
  min-height: 0 !important;
}
html.ss-redesign .inline-takes .take-author-name {
  padding: 0 !important;
  font-size: 13px !important;
  font-weight: var(--ss-weight-semibold) !important;
  color: var(--ss-ink) !important;
}
html.ss-redesign .inline-takes .take-meta > span {
  font-size: 11.5px !important;
  color: var(--ss-muted) !important;
}

/* Instagram-style: message on its own full-width line, then a thin
   muted actions row underneath (time · like · reply). */
/* Instagram-style: the message takes the row and the like/□ actions sit
   at the end on the right, aligned to the first line — not stacked below. */
html.ss-redesign .inline-takes .take-message-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: var(--ss-space-2) !important;
  height: auto !important;
  min-height: 0 !important;
}
html.ss-redesign .inline-takes .take-message {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: auto !important;
}
html.ss-redesign .inline-takes .take-message > p {
  margin: 0 !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
  color: var(--ss-ink) !important;
}

/* Sister Take GIFs are reactions, not post media. Keep them compact so one
   animated reply cannot take over an entire thread. */
html.ss-redesign .inline-takes .take-gif {
  display: block !important;
  width: min(160px, 100%) !important;
  height: 120px !important;
  margin: var(--ss-space-2) 0 !important;
  border-radius: var(--ss-radius-md) !important;
}
html.ss-redesign .inline-takes .take-gif img {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: cover !important;
}

@media (max-width: 600px) {
  html.ss-redesign .inline-takes .take-gif {
    width: min(136px, 100%) !important;
    height: 102px !important;
  }
}

html.ss-redesign .inline-takes .take-actions {
  flex: 0 0 auto !important;
  display: flex !important;
  align-self: flex-start !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: var(--ss-space-2) !important;
  margin: 0 0 0 auto !important;
  padding-top: 1px !important;
}
html.ss-redesign .inline-takes .take-actions .take-icon-button {
  min-height: 0 !important;
  min-width: 0 !important;
  padding: 0 !important;
  gap: 4px !important;
  color: var(--ss-muted) !important;
  font-size: 11.5px !important;
  font-weight: var(--ss-weight-medium) !important;
}
html.ss-redesign .inline-takes .take-actions .take-icon-button svg { width: 13px !important; height: 13px !important; }
html.ss-redesign .inline-takes .take-actions .take-icon-button[data-active="true"] { color: var(--ss-pink) !important; }
html.ss-redesign .inline-takes .take-actions .options-wrap { display: flex !important; }

/* --- Instagram-style reply affordances ------------------------------- */
/* Visible "Reply" link under each take (not buried in the ⋯ menu). */
html.ss-redesign .take-footer {
  display: flex !important;
  align-items: center !important;
  gap: var(--ss-space-3) !important;
  margin-top: 3px !important;
}
html.ss-redesign .take-reply-button {
  padding: 2px 0 !important;
  border: 0 !important;
  background: none !important;
  color: var(--ss-muted) !important;
  font-size: 12px !important;
  font-weight: var(--ss-weight-semibold) !important;
  line-height: 1 !important;
  cursor: pointer !important;
}
html.ss-redesign .take-reply-button:hover,
html.ss-redesign .take-reply-button:focus-visible { color: var(--ss-ink) !important; }

/* @mention that a reply prefills */
html.ss-redesign .take-mention {
  color: var(--ss-pink) !important;
  font-weight: var(--ss-weight-medium) !important;
}

/* Replies stay collapsed behind a "View N replies" toggle. */
html.ss-redesign .take-replies-wrap { margin-top: var(--ss-space-1) !important; }
html.ss-redesign .take-replies-toggle {
  display: flex !important;
  align-items: center !important;
  gap: var(--ss-space-2) !important;
  padding: var(--ss-space-2) 0 !important;
  border: 0 !important;
  background: none !important;
  color: var(--ss-muted) !important;
  font-size: 12.5px !important;
  font-weight: var(--ss-weight-semibold) !important;
  cursor: pointer !important;
}
html.ss-redesign .take-replies-toggle .take-replies-line {
  width: 24px !important;
  height: 1px !important;
  flex: 0 0 auto !important;
  background: var(--ss-color-border-strong) !important;
}
html.ss-redesign .take-replies-toggle:hover { color: var(--ss-ink) !important; }
html.ss-redesign .take-replies-toggle:hover .take-replies-line { background: var(--ss-ink) !important; }

/* "View N more takes" at the foot of a long thread. */
html.ss-redesign .take-list-more {
  display: block !important;
  width: 100% !important;
  margin-top: var(--ss-space-2) !important;
  padding: var(--ss-space-3) 0 !important;
  border: 0 !important;
  border-top: var(--ss-divider) !important;
  background: none !important;
  color: var(--ss-muted) !important;
  font-size: 13px !important;
  font-weight: var(--ss-weight-semibold) !important;
  text-align: left !important;
  cursor: pointer !important;
}
html.ss-redesign .take-list-more:hover { color: var(--ss-ink) !important; }

/* reply composer under a take */
html.ss-redesign .inline-takes .take-reply-form,
html.ss-redesign .inline-takes .reply-take {
  margin: var(--ss-space-2) 0 var(--ss-space-2) 42px !important;
}

/* --- Comment bar: one rounded field with GIF + send inside it -------- */
html.ss-redesign .comment-entry-row {
  position: relative !important;
  display: flex !important;
  align-items: flex-end !important;
  gap: var(--ss-space-1) !important;
  width: 100% !important;
  margin: var(--ss-space-3) 0 0 !important;
  padding: 3px 3px 3px var(--ss-space-4) !important;
  border: 1px solid var(--ss-border) !important;
  border-radius: 22px !important;
  background: var(--ss-surface) !important;
  box-shadow: none !important;
}
html.ss-redesign .comment-entry-row:focus-within {
  border-color: var(--ss-pink) !important;
  box-shadow: 0 0 0 3px var(--ss-color-pink-soft) !important;
}
html.ss-redesign .comment-entry-row .comment-text-field {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
}
html.ss-redesign .comment-entry-row .comment-text-field > span {
  position: absolute !important;
  width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);   /* sr-only label */
}
html.ss-redesign .comment-entry-row .comment-text-field textarea,
html.ss-redesign body.logged-in.story-view .comment-entry-row .comment-text-field textarea {
  width: 100% !important;
  min-height: 0 !important;
  max-height: 120px !important;
  padding: 6px 0 !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  resize: none !important;
  field-sizing: content;   /* auto-grow where supported */
  font-size: 16px !important;   /* < 16px makes iOS Safari zoom on focus */
  line-height: 1.4 !important;
  color: var(--ss-ink) !important;
  caret-color: var(--ss-pink) !important;
}
html.ss-redesign .comment-entry-row .comment-text-field textarea:focus,
html.ss-redesign .comment-entry-row .comment-text-field textarea:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  border: 0 !important;
}
html.ss-redesign .comment-entry-row .comment-text-field textarea::placeholder { color: var(--ss-muted) !important; }

/* GIF tools collapse to just an icon button; url input + labels hidden */
html.ss-redesign .comment-entry-row .comment-gif-tools {
  position: static !important;
  display: flex !important;
  align-items: center !important;
  flex: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
html.ss-redesign .comment-entry-row .comment-gif-url-input { display: none !important; }
html.ss-redesign .comment-entry-row .comment-gif-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: var(--ss-radius-circle) !important;
  background: transparent !important;
  color: var(--ss-muted) !important;
}
html.ss-redesign .comment-entry-row .comment-gif-button:hover {
  background: var(--ss-color-soft) !important;
  color: var(--ss-ink) !important;
}
html.ss-redesign .comment-entry-row .comment-gif-button > span { display: none !important; }
html.ss-redesign .comment-entry-row .comment-gif-button svg,
html.ss-redesign .comment-entry-row .comment-gif-button i { width: 18px !important; height: 18px !important; }

/* Round pink send button */
html.ss-redesign .comment-entry-row .comment-send-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: none !important;
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: var(--ss-radius-circle) !important;
  background: var(--ss-pink) !important;
  color: #fff !important;
  box-shadow: none !important;
}
html.ss-redesign .comment-entry-row .comment-send-button svg { width: 16px !important; height: 16px !important; }
html.ss-redesign .comment-entry-row .comment-send-button:disabled { opacity: 0.45 !important; }

/* GIF picker floats above the bar */
html.ss-redesign .comment-entry-row .gif-picker-panel {
  position: absolute !important;
  top: auto !important;
  bottom: calc(100% + var(--ss-space-2)) !important;
  right: 0 !important;
  left: auto !important;
  width: min(320px, 86vw) !important;
  max-height: 60vh !important;
  overflow-y: auto !important;
  padding: var(--ss-space-3) !important;
  z-index: var(--ss-z-modal, 360) !important;
  border: 1px solid var(--ss-border) !important;
  border-radius: var(--ss-radius-lg) !important;
  background: var(--ss-surface) !important;
  box-shadow: var(--ss-shadow-md) !important;
}
html.ss-redesign .comment-entry-row .gif-picker-panel .gif-picker-head input {
  border: 1px solid var(--ss-border) !important;
  border-radius: var(--ss-radius-sm) !important;
}
html.ss-redesign .comment-entry-row .gif-picker-panel .gif-picker-footer {
  font-size: 11px !important;
  color: var(--ss-muted) !important;
}

/* the old standalone "Drop a Sister Take" full-width button is gone from
   markup; hide any that linger from a cached render */
html.ss-redesign .inline-takes > .primary-button.full[data-inline-comment-submit] { display: none !important; }

/* the reply form's separate action row is now just a Cancel text link */
html.ss-redesign .inline-reply-form > .reply-cancel-button {
  margin: var(--ss-space-1) 0 0 var(--ss-space-3) !important;
  color: var(--ss-muted) !important;
  font-size: var(--ss-text-meta) !important;
}
html.ss-redesign .inline-reply-form .comment-entry-row { margin-top: var(--ss-space-2) !important; }

/* Reader modal — flatten the gradient slides. */
html.ss-redesign .reader-modal {
  border-radius: var(--ss-radius-xl) !important;
  box-shadow: var(--ss-shadow-modal) !important;
}
html.ss-redesign .reader-slide,
html.ss-redesign .reader-slide-inner {
  background: var(--ss-surface) !important;
}
html.ss-redesign .reader-slide h1 {
  font-weight: var(--ss-weight-semibold) !important;
  line-height: var(--ss-leading-tight) !important;
}
html.ss-redesign .reader-copy {
  font-size: var(--ss-text-body) !important;
  line-height: var(--ss-leading-body) !important;
}

/* ---------------------------------------------------------------------
   5. DECORATION CLEANUP
--------------------------------------------------------------------- */

/* Pink glow on the brand mark and drop-shadow CTAs → gone / softened. */
html.ss-redesign .brand img { filter: none !important; }
/* The wordmark PNG is baked in the old bubblegum pink. A full match needs
   a re-exported asset; until then, just take the neon edge off so it sits
   a little closer to the deeper "Cherry" UI tone. */
html.ss-redesign .topbar.app-topbar .brand .brand-header-image,
html.ss-redesign body.logged-in .topbar.app-topbar .brand .brand-header-image,
html.ss-redesign body.logged-out .public-auth-copy .public-auth-logo,
html.ss-redesign .verification-brand img {
  filter: saturate(0.9) brightness(0.92) !important;
}
html.ss-redesign .spill-button,
html.ss-redesign .primary-button {
  box-shadow: none !important;
}
/* styles.css paints primary buttons with a #cf1b63 -> #ff5b72 gradient.
   White on that light end is ~3:1, under AA, and a gradient fill is the
   thing this redesign set out to remove. Flat raspberry: 5.26:1. */
html.ss-redesign .primary-button {
  background-image: none !important;
  background-color: #cf1b63 !important;
  color: #fff !important;
}
html.ss-redesign .primary-button:disabled,
html.ss-redesign .primary-button[disabled] {
  background-color: color-mix(in srgb, #cf1b63 38%, var(--ss-surface)) !important;
}
html.ss-redesign .primary-button:hover,
html.ss-redesign .spill-button:hover {
  box-shadow: var(--ss-shadow-sm) !important;
}

/* Right-rail "Boiling Now" etc. — plain section headers. */
html.ss-redesign .right-rail h2 {
  font-size: var(--ss-text-feed-title);
  font-weight: var(--ss-weight-semibold);
  letter-spacing: 0;
  text-transform: none;
}
html.ss-redesign .trend-list .boiling-empty {
  color: var(--ss-muted);
  font-size: var(--ss-text-meta);
}

/* Icon + optional action on the shared view-empty component */
html.ss-redesign .view-empty {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: var(--ss-space-2) !important;
}
html.ss-redesign .view-empty-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: var(--ss-space-1);
  border-radius: var(--ss-radius-pill);
  background: var(--ss-color-pink-soft, rgba(255, 47, 139, 0.12));
  color: var(--ss-pink);
}
html.ss-redesign .view-empty-icon svg {
  width: 22px;
  height: 22px;
}
/* Painted illustration in place of the icon on a few empty states
   (drafts, message requests, empty inbox). */
html.ss-redesign .view-empty-illo,
html.ss-redesign .inbox-empty-illo {
  display: block;
  width: clamp(128px, 34vw, 172px);
  height: auto;
  margin: 0 auto var(--ss-space-2);
}
html.ss-redesign .view-empty-action {
  margin-top: var(--ss-space-3);
  padding: 0 var(--ss-space-5);
  min-height: var(--ss-tap-target-min, 40px);
  border: 0;
  border-radius: var(--ss-radius-pill);
  background: var(--ss-pink);
  color: #fff;
  font-weight: var(--ss-weight-semibold);
  cursor: pointer;
}
html.ss-redesign .view-empty-action:hover { filter: brightness(0.96); }

/* --- Content-shaped loading skeletons ----------------------------- */
html.ss-redesign .view-skeleton {
  display: flex !important;
  flex-direction: column !important;
  gap: var(--ss-space-3) !important;
  padding: var(--ss-space-4) 0 !important;
}
html.ss-redesign .view-skeleton .sk-row {
  display: flex !important;
  align-items: center !important;
  gap: var(--ss-space-3) !important;
  padding: var(--ss-space-2) 0 !important;
}
html.ss-redesign .view-skeleton .sk-dot {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--ss-radius-pill);
}
html.ss-redesign .view-skeleton .sk-row-lines {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
html.ss-redesign .view-skeleton .sk-bar {
  height: 12px;
  border-radius: var(--ss-radius-pill);
}
html.ss-redesign .view-skeleton .sk-bar.short { width: 38%; }
html.ss-redesign .view-skeleton .sk-bar.medium { width: 66%; }
html.ss-redesign .view-skeleton-thread .sk-bar { width: 100%; }
html.ss-redesign .view-skeleton-thread .sk-eyebrow { width: 30%; height: 10px; margin-bottom: 4px; }
html.ss-redesign .view-skeleton-thread .sk-title { height: 26px; }
html.ss-redesign .view-skeleton-thread .sk-title.short { width: 70%; }
html.ss-redesign .view-skeleton-thread .sk-gap { height: var(--ss-space-4); }
html.ss-redesign .view-skeleton .sk-dot,
html.ss-redesign .view-skeleton .sk-bar {
  background-color: rgba(23, 18, 26, 0.10);
  background-image: linear-gradient(90deg, transparent 20%, rgba(23, 18, 26, 0.05) 40%, transparent 60%);
  background-size: 300% 100%;
  background-repeat: no-repeat;
  animation: ss-skeleton-slide 1.4s ease infinite;
}
html.ss-redesign body.dark-mode .view-skeleton .sk-dot,
html.ss-redesign body.dark-mode .view-skeleton .sk-bar {
  background-color: rgba(255, 255, 255, 0.09);
  background-image: linear-gradient(90deg, transparent 20%, rgba(255, 255, 255, 0.13) 40%, transparent 60%);
}
@keyframes ss-skeleton-slide {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@media (prefers-reduced-motion: reduce) {
  html.ss-redesign .view-skeleton .sk-dot,
  html.ss-redesign .view-skeleton .sk-bar { animation: none; }
}

/* =====================================================================
   8. NOTIFICATIONS / FOLLOWING / ROOMS / DRAFTS  (Pass 4)
===================================================================== */

/* Same blanket 18px .feed-column top pad that boxed the profile/rooms
   views — this one covers every renderViewHead page in one shot
   (notifications, following, drafts, saved, ...). */
html.ss-redesign .feed-column:has(.view-head) {
  padding-top: var(--ss-space-2) !important;
}
/* Shared view header (renderViewHead) */
html.ss-redesign .view-head {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: var(--ss-space-3) !important;
  padding: 0 0 var(--ss-space-2) !important;
  border-bottom: var(--ss-divider) !important;
}
html.ss-redesign .view-head > div:first-child { flex: 1 1 auto; }
html.ss-redesign .view-head h2 {
  margin: 0 !important;
  font-size: 20px !important;   /* was the thread-title token (24-32px) */
  font-weight: var(--ss-weight-semibold) !important;
  line-height: var(--ss-leading-tight) !important;
}
html.ss-redesign .view-head p {
  margin: var(--ss-space-1) 0 0 !important;
  font-size: var(--ss-text-meta) !important;
  line-height: 1.35 !important;
  color: var(--ss-muted) !important;
}
html.ss-redesign .view-head .secondary-button {
  flex: none !important;
  width: auto !important;
  min-height: 32px !important;
  padding: 0 var(--ss-space-3) !important;
  border-radius: var(--ss-radius-pill) !important;
  font-size: var(--ss-text-meta) !important;
}

html.ss-redesign .view-action-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: var(--ss-space-2) 0 !important;
  font-size: var(--ss-text-meta) !important;
}
html.ss-redesign .view-action-row > span { color: var(--ss-muted) !important; }
html.ss-redesign .view-action-buttons {
  display: inline-flex !important;
  gap: var(--ss-space-4) !important;
}
html.ss-redesign .view-action-row .text-button {
  color: var(--ss-pink) !important;
  font-weight: var(--ss-weight-semibold) !important;
}
/* Destructive/secondary action: quiet by default so it isn't mistaken for
   the primary one, and it asks for confirmation before firing. */
html.ss-redesign .view-action-row .text-button.is-quiet {
  color: var(--ss-muted) !important;
  font-weight: var(--ss-weight-medium) !important;
}
html.ss-redesign .view-action-row .text-button.is-quiet:hover,
html.ss-redesign .view-action-row .text-button.is-quiet:focus-visible {
  color: var(--ss-ink) !important;
  text-decoration: underline !important;
}
html.ss-redesign .view-action-row .text-button:disabled {
  color: var(--ss-muted) !important;
  opacity: 0.6 !important;
}

/* "Replying to <alias>" stays on the reply field's label so the target is
   visible even if the writer deletes the @mention. */
html.ss-redesign .inline-reply-form [data-reply-context].is-targeted {
  color: var(--ss-pink) !important;
  font-weight: var(--ss-weight-medium) !important;
}

/* "Author" chip on takes written by the person who posted the story —
   otherwise every replier is just another anonymous alias. */
html.ss-redesign .take-author-badge,
html.ss-redesign .inline-takes .take-meta > .take-author-badge {
  flex: none !important;
  padding: 1px var(--ss-space-2) !important;
  border-radius: var(--ss-radius-pill) !important;
  background: color-mix(in srgb, var(--ss-pink) 14%, transparent) !important;
  color: var(--ss-pink) !important;
  font-size: 11px !important;
  font-weight: var(--ss-weight-semibold) !important;
  letter-spacing: var(--ss-tracking-caps) !important;
  text-transform: uppercase !important;
  line-height: 1.5 !important;
}

/* Composer autosave state: "Saving…" then "Draft saved", so the writer can
   see that drafts are being kept without opening the drafts list. */
html.ss-redesign .composer-save-state {
  display: inline-flex !important;
  align-items: center !important;
  gap: var(--ss-space-2) !important;
  align-self: flex-end !important;
  margin: 0 0 var(--ss-space-2) !important;
  font-size: var(--ss-text-meta) !important;
  color: var(--ss-muted) !important;
}
html.ss-redesign .composer-save-state[hidden] { display: none !important; }
html.ss-redesign .composer-save-state::before {
  content: "" !important;
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
  background: currentColor !important;
  opacity: 0.55 !important;
}
/* Stays muted on purpose — the one strong action on this screen is the
   Spill button; an ambient autosave note must not compete with it. The
   dot going solid is the "done" signal. */
html.ss-redesign .composer-save-state[data-state="saved"] {
  font-weight: var(--ss-weight-medium) !important;
}
html.ss-redesign .composer-save-state[data-state="saved"]::before {
  opacity: 1 !important;
  background: var(--ss-pink) !important;
}
@media (prefers-reduced-motion: no-preference) {
  html.ss-redesign .composer-save-state[data-state="saving"]::before {
    animation: ss-save-pulse 900ms ease-in-out infinite !important;
  }
  @keyframes ss-save-pulse {
    0%, 100% { opacity: 0.25; }
    50% { opacity: 0.8; }
  }
}

/* Control Center: the moderation queue leads the page when it has work in
   it, and the open-reports figure reads as a task rather than a statistic. */
html.ss-redesign .control-attention {
  margin-bottom: var(--ss-space-4) !important;
  border-left: 3px solid var(--ss-color-danger, #d94141) !important;
}
html.ss-redesign .control-kpi.is-urgent {
  border-color: var(--ss-color-danger, #d94141) !important;
}
html.ss-redesign .control-kpi.is-urgent strong,
html.ss-redesign .control-kpi.is-urgent small {
  color: var(--ss-color-danger, #d94141) !important;
}

/* What Accept / Decline / Block actually do, on the request itself. */
html.ss-redesign .request-row .request-explainer {
  margin: var(--ss-space-1) 0 0 !important;
  font-size: var(--ss-text-meta) !important;
  line-height: 1.45 !important;
  color: var(--ss-muted) !important;
}

/* Room-filtered feed: the only cue used to be the heading text, with no way
   back to everything. */
html.ss-redesign body.logged-in .feed-section-head.is-room-filtered > div {
  display: flex !important;
  align-items: center !important;
  gap: var(--ss-space-3) !important;
  flex-wrap: wrap !important;
}
html.ss-redesign body.logged-in .feed-room-clear {
  display: inline-flex !important;
  align-items: center !important;
  gap: var(--ss-space-1) !important;
  min-height: 28px !important;
  padding: 0 var(--ss-space-2) 0 var(--ss-space-1) !important;
  border: 1px solid var(--ss-color-border) !important;
  border-radius: var(--ss-radius-pill) !important;
  background: var(--ss-color-soft) !important;
  color: var(--ss-muted) !important;
  font-size: var(--ss-text-meta) !important;
  font-weight: var(--ss-weight-medium) !important;
  cursor: pointer !important;
}
html.ss-redesign body.logged-in .feed-room-clear:hover {
  border-color: var(--ss-pink) !important;
  color: var(--ss-pink) !important;
}
html.ss-redesign body.logged-in .feed-room-clear svg { width: 14px !important; height: 14px !important; }

/* Someone else's profile: Follow was a white outlined button sitting next
   to an equally-weighted Message, so the page had no primary action. Same
   language as room Join/Joined. */
html.ss-redesign body.logged-in .profile-action-row .alias-profile-action {
  border: 1px solid var(--ss-pink) !important;
  background: var(--ss-pink) !important;
  color: #fff !important;
  font-weight: var(--ss-weight-semibold) !important;
}
html.ss-redesign body.logged-in .profile-action-row .alias-profile-action svg { color: currentColor !important; }
html.ss-redesign body.logged-in .profile-action-row .alias-profile-action.is-following {
  background: color-mix(in srgb, var(--ss-pink) 12%, transparent) !important;
  color: var(--ss-pink) !important;
}
html.ss-redesign body.logged-in.dark-mode .profile-action-row .alias-profile-action.is-following {
  background: color-mix(in srgb, var(--ss-pink) 22%, transparent) !important;
}

/* Inbox: .is-unread was applied but had no styling anywhere, so an unread
   chat looked exactly like a read one. Same language as notification rows:
   a pink edge, a solid name/preview, and the count on the right. */
html.ss-redesign body.logged-in.inbox-view .conversation-row.is-unread {
  background: linear-gradient(var(--ss-pink), var(--ss-pink)) left / 3px 100% no-repeat !important;
}
html.ss-redesign body.logged-in.inbox-view .conversation-row.is-unread strong {
  font-weight: var(--ss-weight-semibold) !important;
  color: var(--ss-ink) !important;
}
html.ss-redesign body.logged-in.inbox-view .conversation-row.is-unread .conversation-row-preview {
  color: var(--ss-ink) !important;
  font-weight: var(--ss-weight-medium) !important;
}
html.ss-redesign body.logged-in.inbox-view .conversation-row.is-unread .conversation-row-time {
  color: var(--ss-pink) !important;
  font-weight: var(--ss-weight-medium) !important;
}
html.ss-redesign body.logged-in.inbox-view .conversation-row .conversation-row-dot {
  display: grid !important;
  place-items: center !important;
  align-self: center !important;
  min-width: 18px !important;
  height: 18px !important;
  padding: 0 5px !important;
  border-radius: var(--ss-radius-pill) !important;
  background: var(--ss-pink) !important;
  color: #fff !important;
  font-size: 11px !important;
  font-weight: var(--ss-weight-semibold) !important;
  font-variant-numeric: tabular-nums !important;
}

/* Own profile: "Edit profile" lived only in the drawer's Settings entry. */
html.ss-redesign .alias-profile-owner-actions {
  display: flex !important;
  gap: var(--ss-space-2) !important;
  margin-top: var(--ss-space-3) !important;
}
html.ss-redesign .alias-profile-owner-actions .secondary-button {
  min-height: 34px !important;
  padding: 0 var(--ss-space-4) !important;
  border-radius: var(--ss-radius-pill) !important;
  font-size: var(--ss-text-meta) !important;
  font-weight: var(--ss-weight-semibold) !important;
}
html.ss-redesign .alias-profile-owner-actions svg { width: 15px !important; height: 15px !important; }
/* Lock on tabs only you can see (Saved Tea) */
html.ss-redesign .alias-profile-tabs .tab-private-mark,
html.ss-redesign .alias-profile-tabs svg.tab-private-mark {
  width: 12px !important;
  height: 12px !important;
  margin-left: var(--ss-space-1) !important;
  vertical-align: -1px !important;
  opacity: 0.7 !important;
}

/* Avatar picker: equal cells, a ring you can actually see at a glance, and
   the preview sized like the feed avatar so the choice is honest. */
html.ss-redesign .avatar-picker-grid {
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)) !important;
  gap: var(--ss-space-3) !important;
}
html.ss-redesign .avatar-pick {
  padding: 2px !important;
  border: 2px solid var(--ss-color-border) !important;
  background: var(--ss-color-soft) !important;
  box-shadow: none !important;
  transition: border-color 140ms ease, transform 140ms ease !important;
}
html.ss-redesign .avatar-pick:hover { border-color: var(--ss-muted) !important; }
html.ss-redesign .avatar-pick.active {
  border-color: var(--ss-pink) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ss-pink) 26%, transparent) !important;
}
@media (prefers-reduced-motion: no-preference) {
  html.ss-redesign .avatar-pick.active { animation: ss-avatar-pick 260ms cubic-bezier(0.2, 0.8, 0.2, 1.3) !important; }
  @keyframes ss-avatar-pick {
    0% { transform: scale(0.9); }
    60% { transform: scale(1.06); }
    100% { transform: scale(1); }
  }
}
html.ss-redesign .avatar-pick-image,
html.ss-redesign .avatar-pick-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  border-radius: 999px !important;
}
html.ss-redesign .settings-avatar-preview {
  width: 44px !important;   /* the size it actually appears at in the feed */
  height: 44px !important;
  border: 2px solid var(--ss-color-border) !important;
  box-shadow: none !important;
}

/* Inline "this isn't saved yet" note (avatar picker). */
html.ss-redesign .settings-hint {
  margin: var(--ss-space-2) 0 0 !important;
  font-size: var(--ss-text-meta) !important;
  color: var(--ss-pink) !important;
}
html.ss-redesign .settings-hint strong { font-weight: var(--ss-weight-semibold) !important; }
html.ss-redesign .settings-hint[hidden] { display: none !important; }

/* Notification rows */
html.ss-redesign .notification-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  height: auto !important;
  padding: 0 !important;
}
html.ss-redesign .notification-row {
  display: grid !important;
  grid-template-columns: 40px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 0 var(--ss-space-3) !important;
  padding: var(--ss-space-3) 0 !important;
  border-bottom: var(--ss-divider) !important;
  border-radius: 0 !important;
  background: none !important;
}
html.ss-redesign .notification-row.is-unread {
  background: linear-gradient(var(--ss-color-pink-soft), var(--ss-color-pink-soft)) left / 3px 100% no-repeat !important;
  padding-left: var(--ss-space-3) !important;
}
html.ss-redesign .notification-row > .notification-avatar,
html.ss-redesign .notification-row > .notification-avatar img {
  grid-column: 1 !important;
  width: 40px !important;
  height: 40px !important;
}
html.ss-redesign .notification-row > .notification-main {
  grid-column: 2 !important;
  display: block !important;
  text-align: left !important;
}
html.ss-redesign .notification-row > .notification-side {
  grid-column: 3 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: var(--ss-space-2) !important;
  white-space: nowrap !important;
  color: var(--ss-muted) !important;
}
html.ss-redesign .notification-main strong {
  font-weight: var(--ss-weight-semibold) !important;
  color: var(--ss-ink) !important;
}
html.ss-redesign .notification-main > span,
html.ss-redesign .notification-main .notification-text {
  font-size: var(--ss-text-body) !important;
  line-height: 1.45 !important;
  color: var(--ss-muted) !important;
}
html.ss-redesign .notification-main .notification-text {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}
html.ss-redesign .notification-side small { font-size: var(--ss-text-meta) !important; color: var(--ss-muted) !important; }

/* Rooms */
html.ss-redesign .rooms-grid {
  margin-top: var(--ss-space-4) !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: var(--ss-space-3) !important;
  height: auto !important;
}
@media (min-width: 700px) {
  html.ss-redesign .rooms-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: var(--ss-space-3) var(--ss-space-4) !important; }
}
/* A room is a choice, not a feed item — a flat tile the whole surface
   opens, with the Join control the one thing that doesn't. */
html.ss-redesign .room-card {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  grid-template-areas:
    "icon name join"
    "icon desc desc"
    "icon meta meta" !important;
  align-items: center !important;
  gap: 2px var(--ss-space-3) !important;
  padding: var(--ss-space-4) !important;
  border: 1px solid var(--ss-color-border) !important;
  border-radius: var(--ss-radius-lg) !important;
  background: var(--ss-surface) !important;
  cursor: pointer !important;
  transition: border-color 140ms ease, background 140ms ease !important;
}
html.ss-redesign .room-card:hover,
html.ss-redesign .room-card:focus-visible {
  border-color: var(--ss-pink) !important;
  background: var(--ss-color-soft) !important;
  outline: none !important;
}
html.ss-redesign .room-card-icon {
  grid-area: icon !important;
  align-self: start !important;
  display: grid !important;
  place-items: center !important;
  width: 34px !important;
  height: 34px !important;
  border-radius: var(--ss-radius-md) !important;
  /* per-room accent (set inline by renderRoomsGrid), falling back to brand */
  background: color-mix(in srgb, var(--room-accent, var(--ss-pink)) 14%, transparent) !important;
}
html.ss-redesign .room-card-icon svg {
  width: 17px !important;
  height: 17px !important;
  color: var(--room-accent, var(--ss-pink)) !important;
}
html.ss-redesign .room-card:hover,
html.ss-redesign .room-card:focus-visible {
  border-color: var(--room-accent, var(--ss-pink)) !important;
}

/* "Your rooms" / "Discover" group headings */
html.ss-redesign .rooms-group-head {
  margin: var(--ss-space-5) 0 0 !important;
  font-size: var(--ss-text-meta) !important;
  font-weight: var(--ss-weight-semibold) !important;
  letter-spacing: var(--ss-tracking-caps) !important;
  text-transform: uppercase !important;
  color: var(--ss-muted) !important;
}
html.ss-redesign .rooms-group-head + .rooms-grid { margin-top: var(--ss-space-3) !important; }
html.ss-redesign .room-card-name {
  grid-area: name !important;
  align-self: center !important;
  font-size: var(--ss-text-feed-title) !important;
  font-weight: var(--ss-weight-semibold) !important;
  color: var(--ss-ink) !important;
  line-height: 1.25 !important;
}
html.ss-redesign .room-card p,
html.ss-redesign body.logged-in .room-card p {
  grid-area: desc !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  margin: var(--ss-space-1) 0 0 !important;
  font-size: var(--ss-text-body) !important;
  line-height: 1.4 !important;
  color: var(--ss-muted) !important;
}
html.ss-redesign .room-card small {
  grid-area: meta !important;
  margin-top: var(--ss-space-1) !important;
  font-size: var(--ss-text-meta) !important;
  color: var(--ss-muted) !important;
  font-variant-numeric: tabular-nums !important;
}
html.ss-redesign .room-follow-button {
  grid-area: join !important;
  align-self: center !important;
  min-height: 30px !important;
  padding: 0 var(--ss-space-3) !important;
  border: 1px solid var(--ss-pink) !important;
  border-radius: var(--ss-radius-pill) !important;
  background: var(--ss-pink) !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: var(--ss-weight-semibold) !important;
  white-space: nowrap !important;
}
html.ss-redesign .room-follow-button svg { width: 14px !important; height: 14px !important; color: currentColor !important; }
/* "Joined" state: quiet pink-tint chip */
html.ss-redesign .room-follow-button.room-following,
html.ss-redesign body.logged-in .room-follow-button.room-following {
  background: color-mix(in srgb, var(--ss-pink) 12%, transparent) !important;
  border: 1px solid var(--ss-pink) !important;
  color: var(--ss-pink) !important;
}
html.ss-redesign .room-follow-button.room-following svg { color: var(--ss-pink) !important; }
/* styles.css turns every .room-follow-button into a dark app-surface pill
   in dark mode — keep the un-joined one solid pink like light mode. */
html.ss-redesign body.logged-in.dark-mode .room-follow-button:not(.room-following) {
  background: var(--ss-pink) !important;
  border-color: var(--ss-pink) !important;
  color: #fff !important;
}
html.ss-redesign body.logged-in.dark-mode .room-follow-button.room-following {
  background: color-mix(in srgb, var(--ss-pink) 22%, transparent) !important;
  border-color: var(--ss-pink) !important;
  color: var(--ss-pink) !important;
}

/* Following list rows (renderProfileListRow) */
html.ss-redesign .profile-list-row,
html.ss-redesign .follow-list-row {
  padding: var(--ss-space-3) 0 !important;
  border-bottom: var(--ss-divider) !important;
  border-radius: 0 !important;
  background: none !important;
}

/* =====================================================================
   9. SEARCH  (Pass 5a — Instagram-simple)
===================================================================== */

/* the "choose room" dropdown, feed sort toolbar, and old search heading
   are all just noise on the search page */
html.ss-redesign body.search-view .category-row,
html.ss-redesign body.logged-in.search-view .category-row,
html.ss-redesign body.search-view .feed-toolbar,
html.ss-redesign body.logged-in.search-view .feed-toolbar,
html.ss-redesign body.search-view .feed-section-head,
html.ss-redesign body.logged-in.search-view .feed-section-head,
html.ss-redesign body.search-view .feed-mini-controls,
html.ss-redesign body.logged-in.search-view .feed-mini-controls,
html.ss-redesign body.search-view .hero-strip,
html.ss-redesign .search-view .search-head { display: none !important; }

@media (max-width: 900px) {
  html.ss-redesign body.logged-in.search-view:not(.drawer-open) .left-rail { display: none !important; }
}

html.ss-redesign .search-view {
  display: block !important;
  padding: var(--ss-space-3) 0 0 !important;
}
html.ss-redesign .search-view .search-field-wrap {
  display: flex !important;
  align-items: center !important;
  gap: var(--ss-space-2) !important;
  margin: 0 0 var(--ss-space-3) !important;
  padding: 0 var(--ss-space-4) !important;
  border: 1px solid var(--ss-border) !important;
  border-radius: var(--ss-radius-pill) !important;
  background: var(--ss-color-soft) !important;
}
html.ss-redesign .search-view .search-field-wrap:focus-within {
  border-color: var(--ss-pink) !important;
  background: var(--ss-surface) !important;
  box-shadow: none !important;
}
html.ss-redesign .search-view .search-field-wrap input:focus,
html.ss-redesign .search-view .search-field-wrap input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
html.ss-redesign .search-view .search-field-wrap > svg,
html.ss-redesign .search-view .search-field-wrap > i { width: 17px !important; height: 17px !important; color: var(--ss-muted) !important; flex: none !important; }
html.ss-redesign .search-view .search-field-wrap input,
html.ss-redesign body.logged-in.search-view .search-view .search-field-wrap input {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  min-height: 42px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  font-size: var(--ss-text-body) !important;
  color: var(--ss-ink) !important;
}
html.ss-redesign .search-view .search-clear {
  flex: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 20px !important;
  height: 20px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: var(--ss-radius-circle) !important;
  background: var(--ss-muted) !important;
  color: var(--ss-surface) !important;
}
html.ss-redesign .search-view .search-clear svg { width: 11px !important; height: 11px !important; }
html.ss-redesign .search-field-wrap input:placeholder-shown ~ .search-clear { display: none !important; }

/* tabs only make sense once you're searching (the field wrap holds just the
   search input, so `:has` here is safe — scoping to `.search-view` alone
   would also match `body.search-view`, which always contains some empty input) */
html.ss-redesign .search-field-wrap:has(input:placeholder-shown) + .search-tabs { display: none !important; }

html.ss-redesign .search-view .search-tabs {
  display: flex !important;
  gap: var(--ss-space-5) !important;
  margin: 0 var(--ss-space-4) var(--ss-space-1) !important;
  border-bottom: var(--ss-divider) !important;
}
html.ss-redesign .search-view .search-tabs button {
  padding: 0 0 var(--ss-space-2) !important;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  background: none !important;
  color: var(--ss-muted) !important;
  font-size: var(--ss-text-meta) !important;
  font-weight: var(--ss-weight-medium) !important;
}
html.ss-redesign .search-view .search-tabs button.active {
  color: var(--ss-ink) !important;
  border-bottom-color: var(--ss-pink) !important;
  /* weight as well as colour + rule, so the selected tab is not signalled
     by hue alone */
  font-weight: var(--ss-weight-semibold) !important;
}

html.ss-redesign .search-view .search-hint {
  padding: var(--ss-space-8) var(--ss-space-4) !important;
  color: var(--ss-muted) !important;
  font-size: var(--ss-text-meta) !important;
  text-align: center !important;
}
html.ss-redesign .search-view .search-results { padding: 0 !important; }
html.ss-redesign .search-view .search-results .story-card.feed-row { padding-inline: var(--ss-space-4) !important; }
html.ss-redesign .search-view .search-result-row {
  display: flex !important;
  align-items: center !important;
  gap: var(--ss-space-3) !important;
  width: 100% !important;
  padding: var(--ss-space-2) var(--ss-space-4) !important;
  border: 0 !important;
  background: none !important;
  text-align: left !important;
}
html.ss-redesign .search-view .search-result-row:hover { background: var(--ss-color-soft) !important; }
html.ss-redesign .search-view .search-result-row .author-avatar,
html.ss-redesign .search-view .search-result-row .author-avatar img {
  width: 44px !important;
  height: 44px !important;
  border-radius: var(--ss-radius-circle) !important;
}
html.ss-redesign .search-view .search-result-row strong {
  display: block !important;
  font-size: var(--ss-text-body) !important;
  font-weight: var(--ss-weight-semibold) !important;
  color: var(--ss-ink) !important;
}
html.ss-redesign .search-view .search-result-row small {
  display: block !important;
  font-size: var(--ss-text-meta) !important;
  color: var(--ss-muted) !important;
}

/* =====================================================================
   10. LOGGED-OUT AUTH SCREEN  (login / create account)
   Never got a redesign pass — styles.css floats a big logo left and a
   card right with a lot of dead space, controls are un-tokenised, the
   only error feedback was a 2.8s toast. Rebuild as one calm centred card.
===================================================================== */

/* styles.css falls this screen's type back to Arial once Montserrat is
   gone — pull it onto the system stack like the rest of the app. */
html.ss-redesign body.logged-out .landing-sections,
html.ss-redesign body.logged-out .landing-sections * {
  font-family: var(--ss-font-body) !important;
}

html.ss-redesign body.logged-out .landing-sections {
  max-width: none !important;
  min-height: 100dvh !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  /* A fixed top offset, not "center" — centering on the block's own
     height meant switching to the taller Create-account form nudged the
     whole card (and the tabs inside it) upward by a few pixels on every
     toggle. A flat offset holds everything above the form in place. */
  justify-content: flex-start !important;
  padding: clamp(var(--ss-space-5), 6vh, 56px) var(--ss-space-4) var(--ss-space-8) !important;
  /* A warm blush gradient instead of flat white — this screen is the
     one place the product gets to feel playful before the calmer,
     flattened "refined glam" interior takes over. */
  background: linear-gradient(180deg, #ffe1ee 0%, #fff3f8 45%, var(--ss-bg) 100%) !important;
  position: relative !important;
  overflow: hidden !important;
}

/* Girly touch: the app's hand-painted floral, faint and tucked into the
   top-left and bottom-right corners so it frames the card without
   crowding it. Phone screen only — the desktop split-screen stays flat
   white per the auth redesign. */
@media (max-width: 900px) {
  html.ss-redesign body.logged-out .landing-sections::before,
  html.ss-redesign body.logged-out .landing-sections::after {
    content: "" !important;
    position: absolute !important;
    pointer-events: none !important;
    z-index: 0 !important;
  }
  /* Corner cluster, top-left */
  html.ss-redesign body.logged-out .landing-sections::before {
    width: clamp(150px, 44vw, 250px) !important;
    aspect-ratio: 600 / 577 !important;
    background: url("/assets/floral-corner.webp?v=1") center / contain no-repeat !important;
    opacity: 0.15 !important;
    top: -14px !important;
    left: -36px !important;
    transform: scaleY(-1) !important;
  }
  /* Wildflower meadow along the whole bottom edge. Taller than the art
     so nothing crops, and the top third is masked to fade the stems out
     into the page instead of ending on a hard line. */
  html.ss-redesign body.logged-out .landing-sections::after {
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: clamp(160px, 46vw, 240px) !important;
    background: url("/assets/floral-border.webp?v=1") bottom center / 100% auto no-repeat !important;
    opacity: 0.2 !important;
    -webkit-mask-image: linear-gradient(to top, #000 42%, transparent 92%) !important;
    mask-image: linear-gradient(to top, #000 42%, transparent 92%) !important;
  }
  html.ss-redesign body.logged-out.dark-mode .landing-sections::before {
    opacity: 0.12 !important;
  }
  html.ss-redesign body.logged-out.dark-mode .landing-sections::after {
    opacity: 0.15 !important;
  }
  html.ss-redesign body.logged-out .public-auth-landing {
    position: relative !important;
    z-index: 1 !important;
  }
}
html.ss-redesign body.logged-out.dark-mode .landing-sections {
  background: linear-gradient(180deg, #2b0f20 0%, #1a1017 55%, var(--ss-bg) 100%) !important;
}
html.ss-redesign body.logged-out .public-auth-landing {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: var(--ss-space-3) !important;
  width: min(400px, 100%) !important;
  max-width: 400px !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 auto !important;
  padding: 0 !important;
  grid-template-columns: none !important;
  background: transparent !important;
}

html.ss-redesign body.logged-out .public-auth-copy {
  display: block !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
html.ss-redesign body.logged-out .public-auth-logo {
  display: block !important;
  width: 168px !important;
  max-width: 60vw !important;
  height: auto !important;
  margin: 0 auto !important;
  padding: 0 !important;
}
/* The pitch copy (tagline + feature list) is a desktop-only addition — see
   the split-screen block below. On phones the centred-card layout has no
   room for it and the logo already carries the brand moment. */
html.ss-redesign body.logged-out .public-auth-pitch,
html.ss-redesign body.logged-out .public-auth-illustration {
  display: none !important;
}

/* No card chrome — a bordered, shadowed, rounded panel floating on the
   page read as generic "AI slop" UI. The form sits flush on the page's
   own background instead; inputs/buttons carry their own minimal
   styling, so there's still enough structure without a container box. */
html.ss-redesign body.logged-out .public-auth-card {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: var(--ss-space-2) var(--ss-space-6) var(--ss-space-6) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: var(--ss-space-4) !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Password-reset links stay inside the product instead of falling back to a
   browser prompt. The form shares the existing modal mechanics but gets a
   deliberate compact width on phones and desktop. */
html.ss-redesign .password-reset-form {
  width: min(100%, 420px) !important;
}
html.ss-redesign .password-reset-form .form-note:empty {
  display: none !important;
}

html.ss-redesign body.logged-out .public-auth-heading { margin: 0 !important; }
html.ss-redesign body.logged-out .public-auth-heading h2 {
  margin: 0 0 var(--ss-space-1) !important;
  font-size: var(--ss-text-feed-title) !important;
  font-weight: var(--ss-weight-semibold) !important;
  color: var(--ss-ink) !important;
}
html.ss-redesign body.logged-out .public-auth-heading p {
  margin: 0 !important;
  font-size: var(--ss-text-meta) !important;
  color: var(--ss-muted) !important;
}

/* mode tabs — a pink-filled segmented control instead of a grey/white one,
   so the active mode reads as an inviting choice, not a settings toggle */
html.ss-redesign body.logged-out .public-auth-tabs {
  display: flex !important;
  gap: 0 !important;
  padding: 3px !important;
  border: 0 !important;
  border-radius: var(--ss-radius-pill) !important;
  background: color-mix(in srgb, var(--ss-pink) 10%, var(--ss-color-soft)) !important;
}
html.ss-redesign body.logged-out .public-auth-tabs button {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  min-height: 36px !important;
  border: 0 !important;
  border-radius: var(--ss-radius-pill) !important;
  background: transparent !important;
  color: var(--ss-muted) !important;
  font-size: var(--ss-text-meta) !important;
  font-weight: var(--ss-weight-semibold) !important;
  cursor: pointer !important;
  transition: background 140ms ease, color 140ms ease !important;
}
html.ss-redesign body.logged-out .public-auth-tabs button.active {
  background: var(--ss-pink) !important;
  color: #fff !important;
  box-shadow: none !important;
}

/* form */
html.ss-redesign body.logged-out .public-auth-form {
  display: flex !important;
  flex-direction: column !important;
  gap: var(--ss-space-3) !important;
  margin: 0 !important;
}
html.ss-redesign body.logged-out .public-auth-form > label[hidden] { display: none !important; }
html.ss-redesign body.logged-out .public-auth-form > label:not([hidden]) {
  display: flex !important;
  flex-direction: column !important;
  gap: var(--ss-space-1) !important;
}
html.ss-redesign body.logged-out .public-auth-form > label > span {
  font-size: var(--ss-text-meta) !important;
  font-weight: var(--ss-weight-medium) !important;
  color: var(--ss-ink) !important;
}
html.ss-redesign body.logged-out .public-auth-form input[type="email"],
html.ss-redesign body.logged-out .public-auth-form .password-field input {
  width: 100% !important;
  min-height: 44px !important;
  padding: 0 var(--ss-space-3) !important;
  border: 1px solid var(--ss-border) !important;
  border-radius: var(--ss-radius-sm) !important;
  background: var(--ss-surface) !important;
  color: var(--ss-ink) !important;
  font-size: var(--ss-text-body) !important;
}
html.ss-redesign body.logged-out .public-auth-form input[type="email"]:focus,
html.ss-redesign body.logged-out .public-auth-form .password-field input:focus {
  outline: none !important;
  border-color: var(--ss-pink) !important;
  box-shadow: 0 0 0 3px var(--ss-color-pink-soft) !important;
}

/* password field: input + right-aligned eye toggle */
/* Show/hide password control. Scoped to .password-field itself, NOT to
   .public-auth-form — the password-reset dialog uses the same markup, and
   while these rules were auth-only its toggle fell out of the input as a
   grey block underneath, with *both* eye icons visible because neither
   pw-icon-hide rule reached it. */
html.ss-redesign .password-field {
  position: relative !important;
  display: block !important;
}
html.ss-redesign .password-field input {
  padding-right: 46px !important;
}
html.ss-redesign .password-field .password-toggle {
  position: absolute !important;
  top: 50% !important;
  right: 4px !important;
  left: auto !important;
  transform: translateY(-50%) !important;
  width: 40px !important;
  min-width: 0 !important;
  height: 40px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 0 !important;
  border-radius: var(--ss-radius-circle) !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--ss-muted) !important;
  cursor: pointer !important;
}
html.ss-redesign .password-field .password-toggle svg {
  width: 20px !important;
  height: 20px !important;
}
html.ss-redesign .password-field .password-toggle .pw-icon-hide { display: none !important; }
html.ss-redesign .password-field .password-toggle[aria-pressed="true"] .pw-icon-show { display: none !important; }
html.ss-redesign .password-field .password-toggle[aria-pressed="true"] .pw-icon-hide { display: inline-block !important; }
html.ss-redesign .password-field .password-toggle:hover { color: var(--ss-ink) !important; }
html.ss-redesign .password-field .password-toggle:focus-visible {
  outline: 2px solid var(--ss-pink) !important;
  outline-offset: -2px !important;
}

/* password strength meter (register only) */
html.ss-redesign body.logged-out .public-auth-form .password-strength[hidden] { display: none !important; }
html.ss-redesign body.logged-out .public-auth-form .password-strength {
  display: flex !important;
  align-items: center !important;
  gap: var(--ss-space-2) !important;
  margin: 0 !important;
}
html.ss-redesign body.logged-out .public-auth-form .password-strength-track {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  height: 4px !important;
  border-radius: var(--ss-radius-pill) !important;
  background: var(--ss-color-soft) !important;
  overflow: hidden !important;
}
html.ss-redesign body.logged-out .public-auth-form .password-strength-fill {
  display: block !important;
  height: 100% !important;
  width: var(--ss-strength-pct, 0%) !important;
  border-radius: var(--ss-radius-pill) !important;
  background: var(--ss-color-danger) !important;
  transition: width 160ms ease, background 160ms ease !important;
}
html.ss-redesign body.logged-out .public-auth-form .password-strength[data-score="2"] .password-strength-fill { background: #d9a441 !important; }
html.ss-redesign body.logged-out .public-auth-form .password-strength[data-score="3"] .password-strength-fill { background: #3f9d5b !important; }
html.ss-redesign body.logged-out .public-auth-form .password-strength[data-score="4"] .password-strength-fill { background: #2f8f4a !important; }
html.ss-redesign body.logged-out .public-auth-form .password-strength-label {
  flex: none !important;
  min-width: 58px !important;
  text-align: right !important;
  font-size: 11px !important;
  color: var(--ss-muted) !important;
}

/* submit button: loading / disabled state (text swap only — no spinner) */
html.ss-redesign body.logged-out .public-auth-form .primary-button.is-loading,
html.ss-redesign body.logged-out .public-auth-form .primary-button:disabled {
  opacity: 0.72 !important;
  cursor: progress !important;
}
/* kill the styles.css "gloss-sweep" gradient that slides across .primary-button
   on tap/hover — it reads as a stray moving blob on the flat auth screen. */
html.ss-redesign body.logged-out .public-auth-form .primary-button::after {
  content: none !important;
  display: none !important;
  animation: none !important;
  background: none !important;
}

/* 18+ checkbox row (register only — must still honour the [hidden] attr) */
html.ss-redesign body.logged-out .public-auth-form .check-row[hidden] { display: none !important; }
html.ss-redesign body.logged-out .public-auth-form .check-row:not([hidden]) {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: var(--ss-space-2) !important;
  margin: var(--ss-space-1) 0 0 !important;
  font-size: var(--ss-text-meta) !important;
  line-height: 1.45 !important;
  color: var(--ss-muted) !important;
}
html.ss-redesign body.logged-out .public-auth-form .check-row span {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}
html.ss-redesign body.logged-out .public-auth-form .check-row input {
  width: 18px !important;
  height: 18px !important;
  margin: 2px 0 0 !important;
  flex: none !important;
  accent-color: var(--ss-pink) !important;
}
html.ss-redesign body.logged-out .public-auth-form .check-row a {
  color: var(--ss-color-blue) !important;
  text-decoration: underline !important;
}
/* Forgot-password button is login-only — keep the attr working too. */
html.ss-redesign body.logged-out .public-auth-form .text-button[hidden] { display: none !important; }

/* persistent inline error (replaces the fleeting toast as primary feedback) */
html.ss-redesign body.logged-out .public-auth-note {
  margin: 0 !important;
  font-size: var(--ss-text-meta) !important;
  font-weight: var(--ss-weight-medium) !important;
  color: var(--ss-color-danger) !important;
}
html.ss-redesign body.logged-out .public-auth-note:empty { display: none !important; }

/* submit — flat solid pink, no glow */
html.ss-redesign body.logged-out .public-auth-form .primary-button {
  width: 100% !important;
  min-height: 46px !important;
  margin: var(--ss-space-1) 0 0 !important;
  border: 0 !important;
  border-radius: var(--ss-radius-pill) !important;
  background: var(--ss-pink) !important;
  background-image: none !important;
  color: #fff !important;
  font-weight: var(--ss-weight-semibold) !important;
  box-shadow: none !important;
}
html.ss-redesign body.logged-out .public-auth-form .text-button {
  align-self: center !important;
  color: var(--ss-muted) !important;
  font-size: var(--ss-text-meta) !important;
}

/* google / oauth */
html.ss-redesign body.logged-out .public-oauth-block {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}
html.ss-redesign body.logged-out .public-oauth-block::before {
  content: "or" !important;
  display: block !important;
  margin: 0 0 var(--ss-space-3) !important;
  text-align: center !important;
  font-size: var(--ss-text-meta) !important;
  color: var(--ss-muted) !important;
}
html.ss-redesign body.logged-out .google-button {
  width: 100% !important;
  min-height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: var(--ss-space-2) !important;
  border: 1px solid var(--ss-border) !important;
  border-radius: var(--ss-radius-pill) !important;
  background: var(--ss-surface) !important;
  color: var(--ss-ink) !important;
  font-weight: var(--ss-weight-medium) !important;
}

/* footer */
html.ss-redesign body.logged-out .public-auth-footer {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: var(--ss-space-2) var(--ss-space-4) !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}
html.ss-redesign body.logged-out .public-auth-footer a {
  font-size: var(--ss-text-meta) !important;
  color: var(--ss-muted) !important;
}

/* toast — hard-coded dark so it never depends on the legacy --black var
   (an undefined --black rendered the box transparent → "white box, can't
   read the error"). */
/* The widget controls its own visibility; its host must not paint an empty card. */
html.ss-redesign body .turnstile-challenge-host {
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

html.ss-redesign .toast {
  background: #1b1620 !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: var(--ss-radius-md) !important;
  font-size: var(--ss-text-meta) !important;
  font-weight: var(--ss-weight-medium) !important;
  box-shadow: var(--ss-shadow-lg) !important;
}
/* An empty toast is an invisible box at the lower-right corner. Keep the
   host out of layout and hit testing until it contains real feedback. */
html.ss-redesign .toast:not(.show),
html.ss-redesign .toast:empty {
  display: none !important;
}

/* --- Desktop: split-screen, not a phone card floating in white space ---
   Below 901px this screen is the calm centred card above (already shipped
   and correct). At desktop widths that same 400px card centred in a mostly
   empty viewport read as unfinished — this reuses the existing markup
   (.public-auth-copy / .public-auth-card / .public-auth-footer are already
   siblings in index.html) to build a full-height two-pane layout: a fixed
   dark brand pane (independent of light/dark theme, like the rest of the
   app's identity) carrying the pitch copy, and the form pinned to a
   comfortable fixed-width column on the right. */
@media (min-width: 901px) {
  html.ss-redesign body.logged-out .landing-sections {
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
  }
  /* Fixed height, not min-height: the photo panel spans both grid rows
     (see .public-auth-copy below), so if this were allowed to grow past
     100dvh whenever the taller Create-account form didn't fit, the photo
     panel grew with it — and being background-size:cover, a taller box
     means a different crop, so the photo visibly shifted on every mode
     switch. Locking the row height and letting the card scroll internally
     (see .public-auth-card's overflow-y below) keeps the photo static. */
  html.ss-redesign body.logged-out .public-auth-landing {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 440px) !important;
    grid-template-rows: 1fr auto !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    width: 100% !important;
    max-width: none !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    gap: 0 !important;
  }

  /* Left pane: a colorful flat illustration (unDraw's "Coffee with
     friends", MIT-licensed — free to use, no attribution required)
     recolored into the brand pink. The pane sits on the same flat
     surface as the form column — one clean white (or dark) screen,
     with a hairline rule the only seam between the two halves. */
  html.ss-redesign body.logged-out .public-auth-copy {
    position: relative !important;
    grid-column: 1 !important;
    grid-row: 1 / -1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: var(--ss-space-6) !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: var(--ss-space-12) clamp(var(--ss-space-8), 6vw, 96px) !important;
    background: var(--ss-surface) !important;
    border-right: 1px solid var(--ss-color-border) !important;
    overflow: hidden !important;
  }
  html.ss-redesign body.logged-out .public-auth-copy > * {
    position: relative !important;
    z-index: 1 !important;
  }
  html.ss-redesign body.logged-out .public-auth-copy .public-auth-logo {
    width: 220px !important;
    max-width: 40% !important;
    margin: 0 !important;
    filter: none !important;
  }
  html.ss-redesign body.logged-out .public-auth-illustration {
    display: block !important;
    width: min(300px, 62%) !important;
    height: auto !important;
    margin: 0 auto !important;
    filter: drop-shadow(0 16px 28px rgba(207, 27, 99, 0.22)) !important;
  }
  html.ss-redesign body.logged-out .public-auth-pitch {
    display: flex !important;
    flex-direction: column !important;
    gap: var(--ss-space-6) !important;
    max-width: 24ch !important;
  }
  html.ss-redesign body.logged-out .public-auth-tagline {
    display: block !important;
    margin: 0 !important;
    font-size: 24px !important;
    line-height: 1.45 !important;
    font-weight: var(--ss-weight-medium) !important;
    color: var(--ss-ink) !important;
  }

  /* Right pane: the same card, un-boxed (it already fills its own column).
     align-self is fixed at "start" with a flat top offset rather than
     "center" — centering on the card's own height meant switching from
     Log in to Create account (a taller form) shrank the space above it
     and visibly shoved the tabs/heading upward. A fixed offset keeps
     everything above the form pinned in place across both modes. */
  html.ss-redesign body.logged-out .public-auth-card {
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: start !important;
    width: 100% !important;
    /* The row is now a hard 100dvh (minus the footer row) instead of
       growing to fit — so if Create-account's extra fields don't fit,
       this scrolls internally instead of stretching the grid (and the
       photo panel that spans it) taller. min-height:0 is the standard
       fix for a grid item that needs to shrink below its content size. */
    min-height: 0 !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    margin: 0 auto !important;
    padding: clamp(48px, 9vh, 104px) var(--ss-space-8) 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: var(--ss-surface) !important;
  }
  html.ss-redesign body.logged-out .public-auth-footer {
    grid-column: 2 !important;
    grid-row: 2 !important;
    justify-content: center !important;
    padding: var(--ss-space-6) var(--ss-space-8) var(--ss-space-8) !important;
  }
}

/* ---------------------------------------------------------------------
   RESPONSIVE
--------------------------------------------------------------------- */
@media (max-width: 900px) {
  /* Keep the menu control above the off-canvas rail and give touch input a
     dependable 44px target on phones. */
  html.ss-redesign body.logged-in .menu-toggle {
    position: relative !important;
    z-index: calc(var(--ss-z-modal, 360) + 2) !important;
    display: inline-grid !important;
    place-items: center !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    pointer-events: auto !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  /* The drawer sits above the page. Lift only the toggle above it so a second
     tap always closes the navigation instead of leaving the control trapped. */
  html.ss-redesign body.logged-in.drawer-open .topbar.app-topbar {
    z-index: calc(var(--ss-z-modal, 360) + 2) !important;
    pointer-events: none;
  }
  html.ss-redesign body.logged-in.drawer-open .topbar.app-topbar .menu-toggle {
    pointer-events: auto !important;
  }

  /* menu · brand · theme · alerts · avatar */
  html.ss-redesign body.logged-in .topbar.app-topbar {
    grid-template-columns: 44px minmax(0, 1fr) 40px 40px 44px !important;
    gap: var(--ss-space-1) !important;
    min-height: 52px !important;
    height: 52px !important;
    padding: 0 var(--ss-space-2) !important;
  }
  html.ss-redesign body.logged-in .topbar.app-topbar .brand .brand-header-image {
    height: 40px !important;
  }
  html.ss-redesign body.logged-in .mobile-theme-toggle,
  html.ss-redesign body.logged-in .mobile-alerts-toggle {
    position: relative !important;
    display: inline-grid !important;
    place-items: center !important;
    width: 40px !important;
    min-width: 40px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: var(--ss-radius-pill) !important;
    background: transparent !important;
    color: var(--ss-ink) !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  html.ss-redesign body.logged-in .mobile-alerts-toggle[hidden] { display: none !important; }
  html.ss-redesign body.logged-in .mobile-alerts-toggle.active { color: var(--ss-pink) !important; }
  html.ss-redesign body.logged-in .mobile-theme-toggle svg,
  html.ss-redesign body.logged-in .mobile-alerts-toggle svg {
    width: 20px !important;
    height: 20px !important;
  }
  /* unread count sits on the bell */
  html.ss-redesign body.logged-in .mobile-alerts-toggle .notification-dot {
    position: absolute !important;
    top: 5px !important;
    right: 2px !important;
    min-width: 16px !important;
    height: 16px !important;
    padding: 0 4px !important;
    border-radius: var(--ss-radius-pill) !important;
    background: var(--ss-pink) !important;
    color: #fff !important;
    font-size: 10px !important;
    font-weight: var(--ss-weight-semibold) !important;
    line-height: 16px !important;
    text-align: center !important;
  }
  html.ss-redesign body.logged-in .mobile-alerts-toggle .notification-dot[hidden] { display: none !important; }
  html.ss-redesign body.logged-in .mobile-theme-toggle:focus-visible,
  html.ss-redesign body.logged-in .mobile-alerts-toggle:focus-visible {
    outline: 2px solid var(--ss-focus-ring, var(--ss-pink)) !important;
    outline-offset: 2px !important;
  }

  /* --- Mobile layout repair -------------------------------------------
     styles.css pins `body.logged-in .app-grid` to a 3-column template
     with `!important` and NO media query, so on phones the empty left
     nav track still reserves ~260px and squishes the feed. The app's own
     `@media (max-width: 900px) .app-grid { minmax(0,1fr) }` never wins.
     Force the single-column layout here and park the nav rail off-canvas
     unless the drawer is open (mirrors app.js applyDrawerVisualState, so
     it also survives resize when that JS hasn't re-run). ---------------- */
  html.ss-redesign body.logged-in .app-grid,
  html.ss-redesign body.logged-in.story-view .app-grid,
  html.ss-redesign body.logged-in.inbox-view .app-grid,
  html.ss-redesign body.logged-in.profile-view .app-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  html.ss-redesign body.logged-in .right-rail {
    display: none !important;
  }
  html.ss-redesign body.logged-in .left-rail {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    /* The rail must sit above its click-to-close backdrop. */
    z-index: calc(var(--ss-z-modal, 360) + 1) !important;
    width: min(78vw, 300px) !important;
    max-width: 300px !important;
    padding: var(--ss-space-4) !important;
    border-right: var(--ss-divider) !important;
    box-shadow: var(--ss-shadow-lg) !important;
    overflow-y: auto !important;
  }
  /* styles.css paints the drawer with an 8-class white !important selector and
     no dark variant — match its depth so the drawer follows the theme. */
  html.ss-redesign body.logged-in .app-shell .app-grid.app-grid .left-rail.left-rail.left-rail {
    background: var(--ss-surface) !important;
  }
  html.ss-redesign body.logged-in:not(.drawer-open) .left-rail {
    left: calc(-1 * min(78vw, 300px) - 24px) !important;
    pointer-events: none !important;
  }
  html.ss-redesign body.logged-in.drawer-open .left-rail {
    left: 0 !important;
    pointer-events: auto !important;
  }
  html.ss-redesign body.logged-in.drawer-open .drawer-backdrop {
    position: fixed !important;
    inset: 0 !important;
    z-index: var(--ss-z-modal, 360) !important;
    background: rgba(9, 7, 13, 0.44) !important;
  }
  /* Beat the legacy drawer selectors, which otherwise leave the backdrop
     above the rail and consume all navigation taps. */
  html.ss-redesign body.logged-in .app-shell .app-grid .left-rail.left-rail {
    z-index: 361 !important;
  }
  html.ss-redesign body.logged-in.drawer-open .app-shell .app-grid .drawer-backdrop#drawerBackdrop {
    z-index: 360 !important;
  }

  html.ss-redesign .feed-column .hero-strip {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }
  html.ss-redesign body.story-view .story-page.story-thread h1,
  html.ss-redesign .story-page.story-thread h1 {
    margin-top: var(--ss-space-2) !important;
  }
}

/* saved-draft row on /drafts */
html.ss-redesign .draft-row {
  display: flex !important;
  flex-direction: column !important;
  gap: var(--ss-space-3) !important;
  padding: var(--ss-space-4) 0 !important;
  border-bottom: var(--ss-divider) !important;
}
html.ss-redesign .draft-row .draft-row-main h2 {
  margin: 0 0 4px !important;
  font-family: var(--ss-font-display) !important;
  font-optical-sizing: auto !important;
  font-size: 17px !important;
  font-weight: var(--ss-weight-medium) !important;
  color: var(--ss-ink) !important;
}
html.ss-redesign .draft-row .draft-row-main p {
  margin: 0 0 6px !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  font-size: 14px !important;
  color: var(--ss-muted) !important;
}
html.ss-redesign .draft-row .draft-row-meta {
  font-size: 11px !important;
  letter-spacing: var(--ss-tracking-caps) !important;
  text-transform: uppercase !important;
  color: var(--ss-muted) !important;
}
html.ss-redesign .draft-row .draft-row-actions {
  display: flex !important;
  gap: var(--ss-space-2) !important;
}
html.ss-redesign .draft-row .draft-row-actions button {
  min-height: 34px !important;
  padding: 0 16px !important;
  border-radius: var(--ss-radius-pill) !important;
  font-size: 13px !important;
  font-weight: var(--ss-weight-semibold) !important;
}
html.ss-redesign .draft-row .draft-row-actions [data-draft-continue] {
  border: 0 !important;
  background: var(--ss-pink) !important;
  color: #fff !important;
}
html.ss-redesign .draft-row .draft-row-actions [data-draft-delete] {
  border: 1px solid var(--ss-color-border) !important;
  background: transparent !important;
  color: var(--ss-muted) !important;
}

/* =====================================================================
   11. FLORAL CORNER — a hand-painted botanical tucked into the bottom-
   right of the app, filling the dead space under the right rail and
   giving the product a little of the site's floral personality.
   Fixed, low-opacity, pointer-events:none, and sat in a corner the
   content columns don't reach — so it never fights the reading.
===================================================================== */
html.ss-redesign body.logged-in .app-floral {
  position: fixed !important;
  right: 0 !important;
  bottom: 0 !important;
  width: clamp(150px, 17vw, 250px) !important;
  aspect-ratio: 600 / 577 !important;
  background: url("/assets/floral-corner.webp?v=1") right bottom / contain no-repeat !important;
  /* the arrangement's open corner faces up-left; flip it so the dense
     cluster hugs the true bottom-right of the screen. */
  transform: scaleX(-1) !important;
  opacity: 0.5 !important;
  pointer-events: none !important;
  z-index: 1 !important;
}
/* Keep it off the dense/serious surfaces and the tight mobile layout. */
html.ss-redesign body.logged-in.control-center-view .app-floral,
html.ss-redesign body.logged-in.inbox-view.conversation-view .app-floral,
html.ss-redesign body.logged-in.compose-view .app-floral,
html.ss-redesign body.logged-out .app-floral {
  display: none !important;
}
/* Mobile is a single full-width content column — a bottom-corner floral
   would sit on top of post text. There's no dead space for it there, so
   it's desktop-only. */
@media (max-width: 900px) {
  html.ss-redesign body.logged-in .app-floral {
    display: none !important;
  }
}

/* =====================================================================
   12. ICON DISCIPLINE
   supericons.css tints each feed/comment action a different hue
   (comment purple, save orange, share green, more grey). One calm
   palette: muted at rest, brand pink when active. Keep the motion.
===================================================================== */
html.ss-redesign body.logged-in .story-action,
html.ss-redesign body.logged-in .story-actions .story-action,
html.ss-redesign body.logged-in .story-card > .story-actions .story-action,
html.ss-redesign body.logged-in.story-view .story-page-actions .story-action,
html.ss-redesign body.logged-in .story-action.boost-action,
html.ss-redesign body.logged-in .story-action.icon-comment-action,
html.ss-redesign body.logged-in .story-action.icon-save-action,
html.ss-redesign body.logged-in .story-action.icon-share-action,
html.ss-redesign body.logged-in .story-action.icon-more-action,
html.ss-redesign body.logged-in .story-action.report-action,
html.ss-redesign body.logged-in .story-action[data-story-share],
html.ss-redesign body.logged-in .story-action[data-reaction="gasp"],
html.ss-redesign .take-icon-button,
html.ss-redesign .take-icon-button[data-comment-action="like"] {
  color: var(--ss-muted) !important;
}
html.ss-redesign body.logged-in .story-action:hover,
html.ss-redesign body.logged-in .story-action:focus-visible,
html.ss-redesign .take-icon-button:hover,
html.ss-redesign .take-icon-button:focus-visible {
  color: var(--ss-ink) !important;
}
html.ss-redesign body.logged-in .story-action[data-active="true"],
html.ss-redesign body.logged-in .story-card .story-action[data-active="true"],
html.ss-redesign body.logged-in.story-view .story-page-actions .story-action[data-active="true"],
html.ss-redesign .take-icon-button[data-active="true"],
html.ss-redesign .inline-takes .take-actions .take-icon-button[data-active="true"] {
  color: var(--ss-pink) !important;
}

/* =====================================================================
   13. PENDING POST — the "posting…" placeholder card on the feed.
===================================================================== */
html.ss-redesign body.logged-in .feed-column .story-card.pending-post {
  display: flex !important;
  gap: var(--ss-space-3) !important;
  align-items: flex-start !important;
  padding: var(--ss-space-4) 0 !important;
  border-bottom: var(--ss-divider) !important;
  opacity: 1 !important;
}
html.ss-redesign .story-card.pending-post .pending-post-main {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}
html.ss-redesign .story-card.pending-post .pending-post-status {
  margin: 0 0 var(--ss-space-1) !important;
  font-size: 11px !important;
  font-weight: var(--ss-weight-bold) !important;
  letter-spacing: var(--ss-tracking-caps) !important;
  text-transform: uppercase !important;
  color: var(--ss-muted) !important;
}
html.ss-redesign .story-card.pending-post.is-failed .pending-post-status {
  color: var(--ss-color-danger) !important;
}
html.ss-redesign .story-card.pending-post h2 {
  margin: 0 0 4px !important;
  opacity: 0.65 !important;
}
html.ss-redesign .story-card.pending-post .story-preview {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  opacity: 0.6 !important;
}
html.ss-redesign .story-card.pending-post .pending-post-thumb {
  width: 56px !important;
  height: 56px !important;
  flex: none !important;
  border-radius: var(--ss-radius-md) !important;
  overflow: hidden !important;
  background: var(--ss-color-soft) !important;
}
html.ss-redesign .story-card.pending-post .pending-post-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  opacity: 0.7 !important;
}
html.ss-redesign .story-card.pending-post .pending-post-bar {
  margin-top: var(--ss-space-2) !important;
  height: 3px !important;
  border-radius: var(--ss-radius-pill) !important;
  background: var(--ss-color-pink-soft) !important;
  overflow: hidden !important;
}
html.ss-redesign .story-card.pending-post .pending-post-bar span {
  display: block !important;
  width: 40% !important;
  height: 100% !important;
  border-radius: inherit !important;
  background: var(--ss-pink) !important;
  animation: ss-pending-slide 1.15s ease-in-out infinite !important;
}
@keyframes ss-pending-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
@media (prefers-reduced-motion: reduce) {
  html.ss-redesign .story-card.pending-post .pending-post-bar span {
    animation: none !important;
    width: 100% !important;
  }
}
html.ss-redesign .story-card.pending-post .pending-post-actions {
  display: flex !important;
  gap: var(--ss-space-2) !important;
  margin-top: var(--ss-space-2) !important;
}
html.ss-redesign .story-card.pending-post .pending-post-actions button {
  min-height: 32px !important;
  padding: 0 14px !important;
  border-radius: var(--ss-radius-pill) !important;
  font-size: 13px !important;
  font-weight: var(--ss-weight-semibold) !important;
}
html.ss-redesign .story-card.pending-post .pending-post-actions button[data-pending-retry] {
  border: 0 !important;
  background: var(--ss-pink) !important;
  color: #fff !important;
}
html.ss-redesign .story-card.pending-post .pending-post-actions button[data-pending-discard] {
  border: 1px solid var(--ss-color-border) !important;
  background: transparent !important;
  color: var(--ss-muted) !important;
}

/* =====================================================================
   14. DARK MODE — ONE GROUND
   styles.css has three dark values in play: --ss-color-bg (#140e12),
   --ss-surface (#1c151b) and --ss-app-surface (#191417). Full-bleed
   chrome painted with the latter two "seams" against the page. Flatten
   every large surface to the page ground; keep --ss-surface only for
   genuinely raised small controls (pills, chips, bubbles, menus).
===================================================================== */
html.ss-redesign body.dark-mode {
  /* styles.css redefines these in its own body.dark-mode block; ours wins
     on load order + the .ss-redesign class. Point the app-surface family
     at the page ground so view containers stop seaming. */
  --ss-app-bg: var(--ss-color-bg);
  --ss-app-surface: var(--ss-color-bg);
  --paper: var(--ss-color-bg);
}

/* View containers + their lists: page ground, no card border. */
html.ss-redesign body.dark-mode .view-screen,
html.ss-redesign body.dark-mode .notifications-screen,
html.ss-redesign body.dark-mode .drafts-screen,
html.ss-redesign body.dark-mode .following-screen,
html.ss-redesign body.dark-mode .rooms-screen,
html.ss-redesign body.dark-mode .me-screen,
html.ss-redesign body.dark-mode .settings-screen,
html.ss-redesign body.dark-mode .public-profile,
html.ss-redesign body.dark-mode .connections-screen,
html.ss-redesign body.dark-mode .search-view,
html.ss-redesign body.dark-mode .notification-list,
html.ss-redesign body.dark-mode .request-list,
html.ss-redesign body.dark-mode .feed-list,
html.ss-redesign body.dark-mode .conversation-list-scroll {
  background: var(--ss-color-bg) !important;
  border: 0 !important;
}

/* Sidebar widgets (Boiling Now / Safety): plain stacked sections on the
   page ground, a hairline between each — same as light mode. */
html.ss-redesign body.dark-mode.logged-in .right-rail .panel,
html.ss-redesign body.dark-mode.logged-in .right-rail .rail-card,
html.ss-redesign body.dark-mode .safety-policy-links {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding-left: var(--ss-space-5) !important;
}
html.ss-redesign body.dark-mode.logged-in .right-rail .panel + .panel,
html.ss-redesign body.dark-mode.logged-in .right-rail .panel + .rail-card {
  border-top: 1px solid var(--ss-color-border) !important;
}
html.ss-redesign body.dark-mode .left-rail .rail-card {
  background: var(--ss-color-bg) !important;
  border: 1px solid var(--ss-color-border) !important;
}

/* App chrome: same ground so it never seams against the content.
   The inbox pieces carry a `body.logged-in.inbox-view` prefix elsewhere,
   so match that depth (+ .dark-mode) to win. */
html.ss-redesign body.dark-mode .topbar.app-topbar,
html.ss-redesign body.dark-mode .mobile-nav {
  background: var(--ss-color-bg) !important;
}
html.ss-redesign body.dark-mode.logged-in.inbox-view .inbox-screen,
html.ss-redesign body.dark-mode.logged-in.inbox-view .inbox-toolbar,
html.ss-redesign body.dark-mode.logged-in.inbox-view .conversation-layout,
html.ss-redesign body.dark-mode.logged-in.inbox-view .conversation-list,
html.ss-redesign body.dark-mode.logged-in.inbox-view .conversation-panel,
html.ss-redesign body.dark-mode.logged-in.inbox-view .inbox-workspace,
html.ss-redesign body.dark-mode.logged-in.inbox-view .message-request-stage {
  background: var(--ss-color-bg) !important;
}
