/* ==========================================================================
   RingBD Fresh — web restyle layer (staging 2026-11-30)
   --------------------------------------------------------------------------
   "Paddy & Paper" per DESIGN-SYSTEM.md (2026-11-30). Layered ON TOP of the
   legacy theme stylesheets: this file only restyles surfaces, it does not
   reflow the layout grid and it changes no markup, routes or behaviour.
   Every value comes from rf-fresh-tokens.css variables — no hex literals
   except white, which is reserved for text on the primary colour.
   Load order (container.phtml): rf-fresh-tokens.css, then this file, last
   of the theme stylesheets, so it wins the cascade.
   Dark mode: the theme drives night mode with the `mode` cookie (dark.css
   loads when mode=night). A small head script in container.phtml mirrors
   that cookie onto <html data-theme>, so the token dark scheme applies.
   `body.night_mode` is mirrored too, for the toggle path.
   --------------------------------------------------------------------------
   v2 SPECIFICITY PASS (2026-11-30, from rendered QC): the legacy layers
   beat this file in five places, all fixed below with higher-specificity
   selectors (no markup changes):
   - body font lost to premium `body:not(.ringbd-welcome)` (0,1,1);
   - headings lost to the legacy `body :not(...) {font:inherit !important}` reset;
   - header lost to glossy `.navbar-default.g-nav` gradient (0,3,0) !imp;
   - post text lost to premium Hind Siliguri !important;
   - dark body lost to dark.css `body{background:#131313 !important}`.
   --------------------------------------------------------------------------
   v4.3 FIX ROUND 2 (2026-11-30, R2 re-gate): header-search + generic
   .form-control text colour gains !important (legacy dark.css
   `color:#fff !important` beat the plain token colour in light mode);
   `.welcome-apps button` retargeted (the visible /welcome pill, not
   just the footer copy); `.wo_directory_head.post` re-clipped so the
   v4 menu fix no longer unclips the directory hero swoosh.
   v4.4 FIX ROUND 2 (2026-11-30, found by the verify sweep): the /search
   filter inputs (Keyword `#query`, country `#country` — no .form-control
   class) were dark-on-dark in dark mode (1.48:1: rb-2040-forms
   `color:var(--rb-ink-900)` #111827 against dark.css `background:#2b3843
   !important`); token text colour + !important. Light NEW badge on the
   apps pills was 4.28:1 — white on a dark chip (11.52:1).
   v4.5 FIX ROUND 2 (2026-11-30): the footer-apps NEW badge in dark was
   still white-on-dark-chip-over-mint (4.32:1) — the dark badge rule now
   covers the footer copy too (4.73:1, same as the welcome pill).
   v4.6 FIX ROUND 2 (2026-11-30): the /search Keyword placeholder in dark
   was 3.68:1 (muted token on the #474747 filter fill) — stone token in
   dark only (~7.2:1). Typed text was already 8.24:1.
   v4.7 D1 FIX (2026-11-30, logged-in gate blocker): the header Create
   button `#wo_home_btns_create` was a 44px round target holding a 50px
   "Create" label (scrollWidth 47 > clientWidth 44) with the header
   ink-colour rule beating .btn-main — 2.17:1 light / 2.08:1 dark.
   ID rule below widens it to a labelled primary pill (white on forest
   8.07:1 light, #062E22 on mint-bright 6.29:1 dark).
   ========================================================================== */

/* -- Base ---------------------------------------------------------------- */
body {
  background: var(--rf-color-background);
  color: var(--rf-color-on-background);
  font-family: var(--rf-font-text);
  font-variant-numeric: tabular-nums;
}
/* Matches premium's body:not(.ringbd-welcome) (0,1,1); this file loads
   later, so Manrope wins. Welcome keeps its own hero type (see base rule). */
body:not(.ringbd-welcome) {
  font-family: var(--rf-font-text);
}
h1, h2, h3, h4, h5, h6,
.wow_main_float_head .main_head_pro,
.wo_go_pro .main_head_pro {
  color: var(--rf-color-on-surface);
  letter-spacing: -0.01em;
}
/* (0,1,2) + !important beats the legacy `body :not(...){font:inherit !imp}`
   reset, so headings render Sora. Colour stays non-important on purpose:
   legacy !important accent colours (e.g. white blog-hero titles) must win. */
body:not(.ringbd-welcome) h1, body:not(.ringbd-welcome) h2,
body:not(.ringbd-welcome) h3, body:not(.ringbd-welcome) h4,
body:not(.ringbd-welcome) h5, body:not(.ringbd-welcome) h6,
body:not(.ringbd-welcome) .wow_main_float_head .main_head_pro,
body:not(.ringbd-welcome) .wo_go_pro .main_head_pro {
  font-family: var(--rf-font-display) !important;
}
a { color: var(--rf-color-primary); }
a:hover, a:focus { color: var(--rf-color-primary); }
::selection { background: var(--rf-color-primary-container); color: var(--rf-color-on-primary-container); }
:focus-visible {
  outline: none;
  box-shadow: var(--rf-focus-ring);
  border-radius: var(--rf-radius-xs);
}

/* -- Header / app bar ----------------------------------------------------- */
header.navbar-default,
.navbar-default.navbar-fixed-top,
.header-container {
  background: var(--rf-color-surface) !important;
  border-bottom: 1px solid var(--rf-color-outline-variant) !important;
  box-shadow: none;
  min-height: var(--rf-header-height);
}
/* The glossy layer's .navbar-default.g-nav gradient is (0,3,0) !important
   and beats the rule above; (0,3,1)/(0,4,0) here beats it in turn. */
header .navbar-default.navbar-fixed-top.g-nav,
.header-container .navbar-default.navbar-fixed-top.g-nav {
  background: var(--rf-color-surface) !important;
  background-image: none !important;
  border-bottom: 1px solid var(--rf-color-outline-variant) !important;
  box-shadow: none !important;
}
.header-container .search-input,
#navbar-searchbox .search-input {
  background: var(--rf-color-surface-variant) !important;
  border: 1px solid var(--rf-color-outline-variant) !important;
  border-radius: var(--rf-radius-pill) !important;
  /* FIX ROUND 2 2026-11-30 (R2-E4 B2): typed text was white-on-sand
     (1.19:1) in light mode. The legacy dark.css rule
     `.search-container .search-input { color: #ffffff !important }`
     applies in BOTH themes and beat this non-!important color, while
     the Fresh background (!important, last file) already won — hence
     white text on a light fill. The token resolves per theme (ink
     #1C1917 light / paper-white dark), so !important here is correct
     in both themes; the placeholder rule below is unaffected. */
  color: var(--rf-color-on-surface) !important;
  font-family: var(--rf-font-text);
  font-size: var(--rf-font-size-body-md);
  height: 44px;
}
.header-container .search-input:focus,
#navbar-searchbox .search-input:focus {
  border: 1.6px solid var(--rf-color-primary) !important;
  box-shadow: none !important;
  outline: none;
}
.header-container .search-input::placeholder,
#navbar-searchbox .search-input::placeholder {
  color: var(--rf-color-on-surface-variant);
}
/* Header icon buttons: 44px round targets, sand hover, forest focus. */
#head_menu_rght .rb-hdr-icon a,
.header-container .head_menu_rght a,
.navbar-default .nav > li > a.rb-hdr-icon {
  border-radius: 50%;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#head_menu_rght .rb-hdr-icon a:hover,
.header-container .head_menu_rght a:hover {
  background: var(--rf-color-surface-variant) !important;
}
/* Header action links were white-on-green; on the cream header they must
   be ink. Covers the guest dropdown toggle (verified white) and the
   logged-in icon links (same legacy rule family). */
.header-container .head_menu_rght a,
.navbar-default .nav > li > a,
#head_menu_rght .dropdown-toggle,
.header-container .navbar-nav > li > a.dropdown-toggle {
  color: var(--rf-color-on-surface) !important;
}
/* The guest toggle's user icon is a white-stroke SVG; follow the link. */
.header-container .navbar-nav > li > a.dropdown-toggle svg,
#head_menu_rght .dropdown-toggle svg {
  stroke: currentColor !important;
  color: var(--rf-color-on-surface) !important;
}
.header-container .user-avatar img {
  border: 2px solid var(--rf-color-outline-variant);
}
/* FIX v4.7 D1 (2026-11-30, logged-in gate blocker): the header Create
   button is a labelled primary action, NOT an icon-only target. The
   generic 44px-round header rule squeezed its 50px label outside the
   pill (scrollWidth 47 > clientWidth 44), and the header ink-colour
   rule (0,2,1) !important beat .btn-main, giving ink-on-forest 2.17:1
   (light) / cream-on-mint 2.08:1 (dark). This ID rule (1,0,0)
   !important beats both. Primary pair per DESIGN-SYSTEM.md §7.3 and
   the tokens: white on forest 8.07:1 light, #062E22 on mint-bright
   6.29:1 dark. Desktop only — below 1300px the legacy rule hides the
   label (icon-only) and at 390px the header button is hidden entirely;
   the bottom nav owns Create there, untouched by this rule. */
#wo_home_btns_create {
  width: auto !important;
  min-width: 44px;
  height: 44px !important;
  min-height: 44px;
  padding: 0 16px !important;
  border-radius: 22px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  white-space: nowrap;
  background: var(--rf-color-primary) !important;
  border-color: var(--rf-color-primary) !important;
  color: var(--rf-color-on-primary) !important;
}
#wo_home_btns_create:hover {
  background: var(--rf-color-primary) !important;
  border-color: var(--rf-color-primary) !important;
  color: var(--rf-color-on-primary) !important;
  opacity: 0.92;
}
#wo_home_btns_create svg,
#wo_home_btns_create > span { flex-shrink: 0; }
/* Logo is kept exactly as-is (open item); only its spacing is normalised. */
.header-container .brand img,
.navbar-default .navbar-brand img { max-height: 40px; }

/* -- Badges --------------------------------------------------------------- */
.new-update-alert,
#head_menu_rght .rb-hdr-icon .new-update-alert {
  background: var(--rf-color-unread-badge) !important;
  color: var(--rf-color-on-unread-badge) !important;
  border-radius: var(--rf-radius-pill);
  min-height: 20px;
  min-width: 20px;
  padding: 1px 6px !important;
  font-weight: var(--rf-font-weight-extrabold);
  font-variant-numeric: tabular-nums;
  border: 2px solid var(--rf-color-surface) !important;
}
.wo_go_pro .pro-badge,
.pro-badge {
  background: var(--rf-color-tertiary) !important;
  color: var(--rf-color-on-tertiary) !important;
  border-radius: var(--rf-radius-pill);
}

/* -- Buttons -------------------------------------------------------------- */
.btn-main,
.btn.btn-main,
.btn-mat.btn-main {
  background: var(--rf-color-primary) !important;
  border-color: var(--rf-color-primary) !important;
  color: var(--rf-color-on-primary) !important;
  border-radius: var(--rf-radius-md) !important;
  font-family: var(--rf-font-text);
  font-weight: var(--rf-font-weight-bold);
}
.btn-main:hover, .btn.btn-main:hover, .btn-mat.btn-main:hover {
  background: var(--rf-color-primary) !important;
  opacity: 0.92;
  color: var(--rf-color-on-primary) !important;
}
.btn-main:disabled, .btn.btn-main:disabled {
  opacity: var(--rf-opacity-disabled);
}
/* Composer Post button: full 48px touch target. */
.publisher-box .btn-main,
.sun_pub_box .btn-main {
  min-height: var(--rf-button-height);
  padding: 12px 20px !important;
}
/* Ghost / secondary buttons. */
.btn-default.btn-mat,
.publisher-box .rb-composer-cancel {
  border-radius: var(--rf-radius-md) !important;
  font-weight: var(--rf-font-weight-bold);
  color: var(--rf-color-primary);
}
.publisher-box .rb-composer-cancel:hover {
  background: var(--rf-color-surface-variant) !important;
}

/* -- Inputs --------------------------------------------------------------- */
input.form-control,
textarea.form-control,
select.form-control,
.wo_settings_page input.form-control {
  background: var(--rf-color-surface-variant) !important;
  border: 1px solid var(--rf-color-outline-variant) !important;
  border-radius: var(--rf-radius-md) !important;
  /* FIX ROUND 2 2026-11-30 (R2-E4 B2, same class as the header search):
     this color had no !important, so any legacy !important white-text
     rule (e.g. dark.css) could win over it on a light fill. Token
     resolves per theme (ink light / paper-white dark). */
  color: var(--rf-color-on-surface) !important;
  font-family: var(--rf-font-text);
  font-size: var(--rf-font-size-body-lg);
  min-height: var(--rf-button-height);
}
input.form-control:focus,
textarea.form-control:focus,
select.form-control:focus {
  border: 1.6px solid var(--rf-color-primary) !important;
  box-shadow: none !important;
  outline: none;
}
input.form-control::placeholder,
textarea.form-control::placeholder {
  color: var(--rf-color-on-surface-variant);
}

/* -- Left nav + filter chips ---------------------------------------------- */
.leftcol .nav a,
.wow_hdr_innr_left .nav a,
#filterby-post li,
.filter-by-li {
  font-family: var(--rf-font-text);
  border-radius: var(--rf-radius-md);
}
#filterby-post li:hover,
.filter-by-li:hover {
  background: var(--rf-color-surface-variant) !important;
}
#filterby-post li.avtive,
#filterby-post li.active,
.filter-by-li.avtive,
.filter-by-li.active {
  background: var(--rf-color-primary-container) !important;
  border: 1.5px solid var(--rf-color-primary) !important;
  color: var(--rf-color-on-primary-container) !important;
}
/* Directory left-nav selected link: the legacy red (#F44336 @10%) rule
   wins without this mirror — same mint treatment as the filter chips. */
.post_prnt .wo_direct a.posts,
.wo_direct a.posts,
.wo_direct a.posts:hover {
  background: var(--rf-color-primary-container) !important;
  border: 1.5px solid var(--rf-color-primary) !important;
  color: var(--rf-color-on-primary-container) !important;
}
.rb-filter-label {
  font-weight: var(--rf-font-weight-semibold);
  font-variant-numeric: tabular-nums;
}

/* -- Post cards ----------------------------------------------------------- */
/* FIX ROUND 2026-11-30 (gate E2 blocker): the card no longer clips its own
   content. The post ⋯ options menu (api-posts.phtml, nested inside .post)
   was cut off on short posts by this overflow. Media corners are clipped
   by their own wrappers instead (see the fix-round section at the end). */
.post {
  background: var(--rf-color-surface) !important;
  border: 1px solid var(--rf-color-outline-variant) !important;
  border-radius: var(--rf-radius-card) !important;
  box-shadow: var(--rf-shadow-card) !important;
  margin-bottom: var(--rf-space-4);
  overflow: visible;
}
.post:hover { box-shadow: var(--rf-shadow-lg) !important; }
.post .post-heading .title a,
.post .post-heading .title.h5 a {
  font-family: var(--rf-font-display) !important;
  font-size: var(--rf-font-size-title-sm);
  font-weight: var(--rf-font-weight-bold);
  color: var(--rf-color-on-surface);
}
.post .post-heading .title a:hover { color: var(--rf-color-primary); }
.post .post-heading .time a.ajax-time,
.post .post-heading .time {
  color: var(--rf-color-on-surface-variant) !important;
  font-size: var(--rf-font-size-body-sm);
}
.post .post-description,
.post .post-text,
.post .post-description p {
  font-size: var(--rf-font-size-body-lg);
  line-height: var(--rf-line-height-body);
  color: var(--rf-color-on-surface);
}
/* Beats premium's Hind Siliguri !important (same selector, this file later). */
.post .post-description p,
.post .post-description .edited_text {
  font-family: var(--rf-font-text) !important;
}
.post .post-footer {
  border-top: 1px solid var(--rf-color-outline-variant);
}
.post #wo_post_stat_button .stat-item {
  border-radius: var(--rf-radius-md);
  font-family: var(--rf-font-text);
  font-size: var(--rf-font-size-label-md);
  font-weight: var(--rf-font-weight-bold);
  font-variant-numeric: tabular-nums;
  color: var(--rf-color-on-surface-variant);
}
.post #wo_post_stat_button .stat-item:hover {
  background: var(--rf-color-surface-variant) !important;
}
/* Liked state: terracotta (per spec), overriding the legacy green tint. */
.post #wo_post_stat_button .stat-item:has(.active-like),
.post #wo_post_stat_button .stat-item:has(.active-like) span,
.post #wo_post_stat_button .active-like {
  color: var(--rf-color-secondary) !important;
}
.post #wo_post_stat_button .stat-item:has(.active-like) svg path {
  fill: var(--rf-color-secondary) !important;
}
.post .post-footer .comments-list .comment .comment-heading {
  background: var(--rf-color-surface-variant) !important;
  border-radius: var(--rf-radius-card) !important;
  border-bottom-left-radius: var(--rf-radius-bubble-tail) !important;
  color: var(--rf-color-on-surface);
}

/* -- Composer ------------------------------------------------------------- */
.sun_pub_box.panel,
.publisher-box {
  background: var(--rf-color-surface) !important;
  border: 1px solid var(--rf-color-outline-variant) !important;
  border-radius: var(--rf-radius-card) !important;
  box-shadow: var(--rf-shadow-card) !important;
}
.publisher-box textarea.postText,
.sun_pub_box textarea.postText {
  background: var(--rf-color-surface-variant) !important;
  border: 1px solid var(--rf-color-outline-variant) !important;
  border-radius: var(--rf-radius-pill) !important;
  color: var(--rf-color-on-surface);
  font-size: var(--rf-font-size-body-lg);
  line-height: var(--rf-line-height-body);
}
.publisher-box textarea.postText:focus {
  border: 1.6px solid var(--rf-color-primary) !important;
  box-shadow: none !important;
}
.publisher-box .rb-mobile-action,
.sun_pub_box .rb-mobile-action {
  border-radius: var(--rf-radius-md);
  font-weight: var(--rf-font-weight-semibold);
  color: var(--rf-color-on-surface-variant);
}
.publisher-box .rb-mobile-action:hover {
  background: var(--rf-color-surface-variant) !important;
}

/* -- Story rail ----------------------------------------------------------- */
.wow_home_stories .status-list {
  gap: 12px;
}
.wow_home_stories .status-list li img {
  border-radius: var(--rf-radius-card);
}
.wow_home_stories .status-list li .rb-story-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  /* Solid forest ring + paper gap (the Fresh tell); seen stories use the
     plain outline ring instead. */
  border: 2px solid var(--rf-color-primary) !important;
  box-shadow: 0 0 0 2px var(--rf-color-background);
}
.wow_home_stories .status-list li:not(.not_seen_story) .rb-story-avatar img {
  border-color: var(--rf-color-outline) !important;
}
.wow_home_stories .status-list li p {
  font-size: var(--rf-font-size-label-sm);
  font-weight: var(--rf-font-weight-semibold);
  color: var(--rf-color-on-surface-variant);
}
.wow_home_stories .status-list li.create_new img {
  border: 2px solid var(--rf-color-outline-variant);
}
.rb-no-stories {
  background: var(--rf-gradient-wash);
  border: 1px solid var(--rf-color-outline-variant);
  border-radius: var(--rf-radius-card);
}
.rb-no-stories p {
  color: var(--rf-color-on-surface);
  font-family: var(--rf-font-display) !important;
  font-weight: var(--rf-font-weight-semibold);
}
.rb-no-stories small { color: var(--rf-color-on-surface-variant); }

/* -- Menus / dropdowns / sheets ------------------------------------------- */
.dropdown-menu,
.ani-acc-menu {
  background: var(--rf-color-surface) !important;
  border: 1px solid var(--rf-color-outline-variant) !important;
  border-radius: var(--rf-radius-card) !important;
  box-shadow: var(--rf-shadow-lg) !important;
  padding: 8px !important;
}
.dropdown-menu > li > a,
.dropdown-menu li a {
  border-radius: var(--rf-radius-md);
  color: var(--rf-color-on-surface);
  font-size: var(--rf-font-size-body-md);
  min-height: 44px;
  display: flex;
  align-items: center;
}
.dropdown-menu > li > a:hover,
.dropdown-menu li a:hover {
  background: var(--rf-color-surface-variant) !important;
  color: var(--rf-color-on-surface) !important;
}
.dropdown-menu .divider {
  background: var(--rf-color-outline-variant) !important;
}
.modal-content {
  background: var(--rf-color-surface) !important;
  border-radius: var(--rf-radius-lg) !important;
  border: 1px solid var(--rf-color-outline-variant) !important;
  box-shadow: var(--rf-shadow-lg) !important;
}

/* -- Mobile bottom nav ---------------------------------------------------- */
.rb-mobile-bottom-nav {
  background: var(--rf-color-surface) !important;
  border-top: 1px solid var(--rf-color-outline-variant) !important;
  box-shadow: var(--rf-shadow-card) !important;
}
.rb-mobile-bottom-nav a {
  color: var(--rf-color-on-surface-variant);
  font-size: var(--rf-font-size-label-sm);
  font-weight: var(--rf-font-weight-semibold);
}
.rb-mobile-bottom-nav a.active,
.rb-mobile-bottom-nav a.avtive {
  color: var(--rf-color-primary) !important;
}

/* -- Go Pro / premium surfaces -------------------------------------------- */
.wow_price_plans .wow_price_plan {
  border-radius: var(--rf-radius-card) !important;
  border: 1px solid var(--rf-color-outline-variant) !important;
  box-shadow: var(--rf-shadow-card) !important;
}
.wow_price_plans .wow_price_plan .plan_header {
  background: var(--rf-gradient-brand) !important;
  border-radius: var(--rf-radius-card) var(--rf-radius-card) 0 0 !important;
}

/* -- Dark scheme: mirror the theme's night-mode cookie -------------------- */
/* The head script in container.phtml sets <html data-theme> from the mode
   cookie, so the token file's :root[data-theme="dark"] block applies.
   body.night_mode is covered too, in case the toggle adds the class. */
/* dark.css sets body{background:#131313 !important} and loads before this
   file; only an !important rule keyed off the data-theme attribute beats
   it (the app never adds a night_mode class to <body> on load). */
html[data-theme="dark"] body {
  background: var(--rf-color-background) !important;
  color: var(--rf-color-on-background) !important;
}
body.night_mode {
  --rf-color-background: var(--rf-forest-night);
  --rf-color-surface: var(--rf-moss);
  --rf-color-surface-variant: var(--rf-moss-deep);
  --rf-color-surface-container: var(--rf-moss-raised);
  --rf-color-on-background: var(--rf-paper-white);
  --rf-color-on-surface: var(--rf-paper-white);
  --rf-color-on-surface-variant: var(--rf-stone-muted);
  --rf-color-primary: var(--rf-mint-bright);
  --rf-color-on-primary: var(--rf-on-primary-dark);
  --rf-color-primary-container: var(--rf-forest-night-green);
  --rf-color-on-primary-container: var(--rf-mint-pale);
  --rf-color-secondary: var(--rf-terracotta-soft);
  --rf-color-on-secondary: var(--rf-forest-night);
  --rf-color-tertiary: var(--rf-harvest-bright);
  --rf-color-on-tertiary: var(--rf-ink);
  --rf-color-outline: #3D4A41;
  --rf-color-outline-variant: #2C3831;
  --rf-color-error: var(--rf-error-dark);
  --rf-color-on-error: var(--rf-forest-night);
  --rf-color-success: var(--rf-success-dark);
  --rf-color-warning: var(--rf-warning-dark);
  --rf-color-scrim: rgb(16 22 19 / 0.7);
  --rf-color-own-bubble: var(--rf-own-bubble-dark);
  --rf-color-on-own-bubble: var(--rf-paper-white);
  --rf-color-other-bubble: var(--rf-moss-deep);
  --rf-color-on-other-bubble: var(--rf-paper-white);
  --rf-color-unread-badge: var(--rf-terracotta-soft);
  --rf-color-on-unread-badge: var(--rf-forest-night);
  --rf-color-online-dot: var(--rf-success-dark);
  --rf-color-offline-dot: var(--rf-stone-muted);
  --rf-gradient-brand: linear-gradient(135deg, var(--rf-mint-bright), var(--rf-terracotta-soft));
  --rf-gradient-wash: linear-gradient(180deg, #1E2A22, var(--rf-forest-night));
  color-scheme: dark;
}
body.night_mode .post,
body.night_mode .sun_pub_box.panel,
body.night_mode .dropdown-menu,
body.night_mode .modal-content {
  box-shadow: var(--rf-shadow-card) !important;
}
body.night_mode .wow_home_stories .status-list li .rb-story-avatar img {
  box-shadow: 0 0 0 2px var(--rf-forest-night);
}

/* ==========================================================================
   FIX ROUND 2026-11-30 — gate findings (E1/E2/E4/E5), staging only.
   Appended to the v3 layer; nothing above this line was changed except the
   .post overflow fix noted at the rule itself. Every value is a token from
   rf-fresh-tokens.css; no new hex literals.
   ========================================================================== */

/* -- 1. LOGO (E1 B-3, E2 major, E4 B1, E5 B3) --------------------------------
   DESIGN-SYSTEM.md §7.3: the header wordmark is Sora 700 forest (mint
   bright on dark). The shipped logo.png is a white-lettered dark-header
   mark (31.5% near-white pixels, 1,958 dark px of 116,499 opaque) —
   invisible on the cream header. This is the spec's stated choice, not a
   new mark: text wordmark on light, the existing image kept on dark
   (legible on moss) and on the welcome hero (dark in both themes).
   Markup: <span class="rf-brand-wordmark">RingBD</span> added next to the
   logo <img> in header/content.phtml and user_info/content.phtml. */
.header-brand .rf-brand-wordmark {
  font-family: var(--rf-font-display) !important;
  font-weight: 700;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--rf-color-primary);
  display: inline-block;
  vertical-align: middle;
}
/* Light-first default: wordmark shows, image hides. */
.header-brand img { display: none !important; }
html[data-theme="dark"] .header-brand img,
body.night_mode .header-brand img { display: inline-block !important; }
html[data-theme="dark"] .header-brand .rf-brand-wordmark,
body.night_mode .header-brand .rf-brand-wordmark { display: none !important; }
/* Welcome hero is dark in both themes: the white image logo stays. */
body.ringbd-welcome .header-brand img { display: inline-block !important; }
body.ringbd-welcome .header-brand .rf-brand-wordmark { display: none !important; }

/* -- 2. DARK MODE (E1 B-1, E4 B3 + m7) ---------------------------------------
   Legacy navy surfaces beat the v3 layer in dark mode:
   - .wo_directory_head: [data-theme="dark"] rule in rb-2027-premium.css
     (rgba(15,23,42,0.6) !important).
   - post cards: body.night_mode .post-container .post > .panel.panel-white
     in rb-2027-premium.css (rgba(15,23,42,0.88) !important).
   Both become moss (the Fresh dark surface). The .post wrapper itself is
   already moss via the base rule; it is listed here so the override is
   explicit and survives if the base rule ever changes. */
html[data-theme="dark"] .post,
html[data-theme="dark"] .post-container .post > .panel.panel-white,
html[data-theme="dark"] .wo_directory_head,
body.night_mode .post,
body.night_mode .post-container .post > .panel.panel-white,
body.night_mode .wo_directory_head {
  background: var(--rf-color-surface) !important;
  background-image: none !important;
  border-color: var(--rf-color-outline-variant) !important;
}

/* Post-heading secondary text ("created new event", "created new blog",
   "added new photos to …"): legacy #595959 in Inter in BOTH themes —
   2.58:1 on the dark card (AA floor 4.5:1). Fresh muted token in Manrope:
   ink-soft on cream 7.50:1 (light), stone-muted on moss 6.51:1 (dark). */
.post .post-heading .title small.small-text,
.post .post-heading .meta .title small.small-text,
.post-heading .meta small.small-text,
.post .wow_shared_posts .post-heading .title .small-text,
.post .post-heading .meta .h5.title .small-text,
.post .post-heading .meta .h5.title small.small-text {
  color: var(--rf-color-on-surface-variant) !important;
  font-family: var(--rf-font-text) !important;
}

/* Dark comment box (E4 B3): the legacy light fill #F0F2F5 beat the v3
   input rule, leaving paper-white typed text at 1.12:1. Moss-deep fill +
   paper-white text is 12.24:1; the placeholder in stone-muted is 5.47:1. */
html[data-theme="dark"] .post textarea.form-control.comment-textarea,
body.night_mode .post textarea.form-control.comment-textarea,
html[data-theme="dark"] textarea.form-control.comment-textarea,
body.night_mode textarea.form-control.comment-textarea {
  background: var(--rf-color-surface-variant) !important;
  color: var(--rf-color-on-surface) !important;
  border-color: var(--rf-color-outline-variant) !important;
}
html[data-theme="dark"] textarea.form-control.comment-textarea::placeholder,
body.night_mode textarea.form-control.comment-textarea::placeholder {
  color: var(--rf-color-on-surface-variant) !important;
}

/* Light comment placeholder (fix-round re-probe 2026-11-30): the legacy
   #6B7280 placeholder sat at 4.31:1 on the #F0F2F5 fill, just under AA.
   #565656 is 6.54:1. The typed text was already #111827 (15.82:1). */
textarea.form-control.comment-textarea::placeholder {
  color: #565656 !important;
}

/* -- 3. /WELCOME FRESH (E1 M-1) ---------------------------------------------
   The welcome hero is a JS-painted canvas scene (#ringbd-bg) — the canvas
   art itself is owner content and is NOT restyled. What changes is the
   chrome around it, per DESIGN-SYSTEM.md §2.4 (brand gradient is the
   welcome-hero moment):
   - page base: the banned navy body (#050D1A) becomes the brand gradient
     (forest → terracotta) in light, the wash gradient in dark;
   - Sign In CTA: pink/red gradient → forest (ringbd-welcome.css wins over
     the v3 .btn-main rule at (0,3,1) !important, so this mirrors it);
   - login card glass: navy-violet → forest-night glass (blur/border/
     radius/shadow untouched — the card keeps its shape, only its tint);
   - pink accents (password eye, checkbox) → forest. */
body.ringbd-welcome {
  background: var(--rf-gradient-brand) !important;
}
html[data-theme="dark"] body.ringbd-welcome,
body.ringbd-welcome.night_mode {
  background: var(--rf-gradient-wash) !important;
}
body.ringbd-welcome .login_innre .btn-main,
body.ringbd-welcome .btn-main {
  background: var(--rf-color-primary) !important;
  background-image: none !important;
  border-color: var(--rf-color-primary) !important;
  color: var(--rf-color-on-primary) !important;
  font-family: var(--rf-font-text) !important;
  box-shadow: 0 14px 30px rgba(0, 92, 63, 0.45) !important;
}
body.ringbd-welcome .login_innre {
  background: linear-gradient(160deg, rgba(16, 22, 19, 0.78), rgba(26, 33, 28, 0.82)) !important;
}
body.ringbd-welcome .rb-eye {
  background: var(--rf-color-primary) !important;
  background-image: none !important;
}
body.ringbd-welcome input[type="checkbox"] {
  accent-color: var(--rf-color-primary) !important;
}
body.ringbd-welcome .terms input[type="checkbox"]:checked + label::before {
  background-color: var(--rf-color-primary) !important;
  border-color: var(--rf-color-primary) !important;
}
/* Welcome headline joins the type system (Sora); the Bengali span falls
   back to Noto Sans Bengali through the display stack. */
body.ringbd-welcome .login_left_combo h1 {
  font-family: var(--rf-font-display) !important;
}

/* -- 4. COOKIE BUTTON (E1 M-2) ----------------------------------------------
   "Got It!" was legacy blue #0B5ED7 on a #006A4E bar (rf-fresh.css had no
   cookie rule). Bar becomes forest; the button becomes white fill with a
   forest label so it still reads as a button on the forest bar (forest
   on white 7.94:1). */
.cc-window {
  background: var(--rf-color-primary) !important;
  color: var(--rf-color-on-primary) !important;
  font-family: var(--rf-font-text);
}
.cc-window .cc-message,
.cc-window .cc-link {
  color: var(--rf-color-on-primary) !important;
}
.cc-btn.cc-allow,
.cc-btn.cc-deny,
.cc-window .cc-btn {
  background: var(--rf-color-surface) !important;
  background-image: none !important;
  color: var(--rf-color-primary) !important;
  border-color: transparent !important;
  font-family: var(--rf-font-text);
  font-weight: 700;
}

/* -- 5. FOOTER (E1 M-3) ------------------------------------------------------
   The footer was the legacy dark-green glossy gradient; the "Language"
   pill was #858585 on it (~2.5–3.3:1). Flat forest-night footer (the
   footer text was already light-on-dark, so links stay legible); the
   pill becomes mint / forest-deep (10.27:1 light; forest-night-green /
   mint-pale 9.59:1 dark). The "Ring BD Apps" pill keeps its place but
   loses the green→blue inline gradient (forest fill, white label). */
.footer-wrapper.g-footer {
  background: var(--rf-forest-night) !important;
  background-image: none !important;
  border-top: 1px solid var(--rf-color-outline-variant);
}
.footer-wrapper.g-footer .footer-powered p,
.footer-wrapper.g-footer .footer-powered a,
.footer-wrapper.g-footer .list-inline a {
  color: var(--rf-paper-white) !important;
}
.footer-wrapper.g-footer .lang_selct a,
.footer-wrapper.g-footer .footer-powered .lang_selct > li > a {
  background: var(--rf-color-primary-container) !important;
  color: var(--rf-color-on-primary-container) !important;
}
.footer-apps button {
  background: var(--rf-color-primary) !important;
  background-image: none !important;
  border-color: transparent !important;
  box-shadow: 0 6px 20px rgba(0, 92, 63, 0.25) !important;
}
/* FIX ROUND 2 2026-11-30 (R2-E1 R2-1): the rule above only matches the
   copy inside .footer-wrapper.g-footer. The pill guests actually see on
   /welcome lives in .welcome-footer as `.welcome-apps button` and kept
   its legacy green→blue gradient from TWO sources: its own inline style
   AND rb-responsive-fix.css `.welcome-apps button[data-target=...] {
   background: linear-gradient(...) !important }`. This rule uses the
   same attribute selector (same specificity, later file wins) with
   !important, so it beats both. Light: forest fill, white label
   (7.94:1). Dark: mint-bright fill with dark label (#062E22, 6.29:1 —
   the cookie-bar pair), including the download icon and the NEW badge,
   which would otherwise stay pale-on-mint. */
.welcome-apps button[data-target="#ringbd-apps-modal-welcome"] {
  background: var(--rf-color-primary) !important;
  background-image: none !important;
  border-color: transparent !important;
  color: #FFFFFF !important;
  box-shadow: 0 6px 20px rgba(0, 92, 63, 0.25) !important;
}
html[data-theme="dark"] .welcome-apps button[data-target="#ringbd-apps-modal-welcome"],
body.night_mode .welcome-apps button[data-target="#ringbd-apps-modal-welcome"] {
  background: var(--rf-color-primary) !important;
  background-image: none !important;
  color: var(--rf-color-on-primary) !important;
  box-shadow: 0 6px 20px rgba(61, 190, 139, 0.25) !important;
}
html[data-theme="dark"] .welcome-apps button[data-target="#ringbd-apps-modal-welcome"] svg,
body.night_mode .welcome-apps button[data-target="#ringbd-apps-modal-welcome"] svg {
  color: var(--rf-color-on-primary) !important;
}
html[data-theme="dark"] .welcome-apps button[data-target="#ringbd-apps-modal-welcome"] > span:last-child,
body.night_mode .welcome-apps button[data-target="#ringbd-apps-modal-welcome"] > span:last-child,
html[data-theme="dark"] .footer-apps button > span:last-child,
body.night_mode .footer-apps button > span:last-child {
  /* The NEW badge: rb-responsive-fix forces #ffe9a8 !important, which is
     unreadable on the mint-bright dark fill. Dark label + dark chip. */
  color: var(--rf-color-on-primary) !important;
  background: rgba(6, 46, 34, 0.18) !important;
}
/* FIX ROUND 2 extra (same pill, footer copy): in dark the footer-apps
   button was mint-bright with WHITE text (~2:1, unmeasured by the gate).
   Same dark-label treatment as the welcome pill. */
html[data-theme="dark"] .footer-apps button,
body.night_mode .footer-apps button {
  color: var(--rf-color-on-primary) !important;
}
/* FIX ROUND 2 (verify sweep): the gold NEW badge was #ffe9a8 / #ffd36b on
   a translucent gold chip over the forest fill — 4.28:1 light (under AA).
   White label on a dark chip: 11.52:1. The dark rules above still win in
   dark mode (higher specificity). */
.welcome-apps button[data-target="#ringbd-apps-modal-welcome"] > span:last-child,
.footer-apps button > span:last-child {
  color: #FFFFFF !important;
  background: rgba(0, 0, 0, 0.28) !important;
}

/* -- 6. POST MENU CLIP (E2 blocker) ------------------------------------------
   Two clippers cut the post ⋯ options menu on short posts: Fresh .post
   (now overflow:visible, see the rule above) and the legacy panel rule
   (.post-container .post > .panel.panel-white { overflow:hidden }, plus
   the ≤767px .post .panel-white rule). Both are opened here — the menu
   lives in .post-heading, so it is never clipped again. The panel's own
   22px radius is preserved for its last child instead: the footer gets
   the panel's 22px bottom corners (it was 8px, which would poke square
   corners past the card curve once the panel stops clipping). Media
   keeps its own corner clipping (post-file already clips on mobile;
   the wrappers below clip at all widths). */
.post-container .post > .panel.panel-white,
.post .panel.panel-white {
  overflow: visible !important;
}
.post .post-footer {
  border-bottom-left-radius: 22px !important;
  border-bottom-right-radius: 22px !important;
}
.post .post-file,
.post .post-fetched-url,
.post .post-youtube,
.post .post-map {
  overflow: hidden;
}

/* -- 7. FIX ROUND 2 2026-11-30 (R2-E1 R2-2 / R2-E4 B1) ----------------------
   DIRECTORY HERO RE-CLIP. The v4 `.post { overflow: visible }` menu fix
   unclipped the directory hero, because the hero itself carries class
   `post` (`class="wo_directory_head post"`): its 1408px swoosh SVG
   (left -64, right 1344 at 1280) made /directory scroll 64px sideways
   at 800/1024/1280/1440/1600. The visible-overflow rule is deliberately
   NOT narrowed to `.post-container .post`: feed posts also render
   outside .post-container on other surfaces, and narrowing the base
   rule would re-clip their menus there. Instead the hero — the one
   `.post` whose overflowing child is decorative, not a menu — is
   re-clipped specifically. Specificity (0,2,0) beats `.post` (0,1,0);
   the hero has no `.panel`, so the §6 panel override cannot unclip it
   again. Causality was proven by E1 with a live toggle (hero overflow
   hidden → scrollWidth exactly 1280); this rule is that toggle made
   permanent. If a future `.post` surface grows a decorative overflow,
   clip that element the same way — do not touch the base rule. */
.wo_directory_head.post {
  overflow: hidden;
}

/* -- 8. FIX ROUND 2 (verify sweep, 2026-11-30) ---------------------------
   /search FILTER INPUTS IN DARK MODE. The Keyword input (`#query`) and
   the country select (`#country`) carry no .form-control class, so the
   generic input rule above never touches them. In dark mode dark.css
   paints their background `#2b3843 !important` while rb-2040-forms
   paints their text `var(--rb-ink-900)` #111827 (a light-theme token
   that does not flip in dark) — dark-on-dark, 1.48:1, typed text
   invisible. Token text colour + !important (the forms rule has no
   !important, so this wins in both themes): ink on #F5F5F5 light,
   paper-white on #2b3843 dark. Placeholder gets the muted token. */
.search-filter-form input[type="text"],
.search-filter-form select {
  color: var(--rf-color-on-surface) !important;
}
.search-filter-form input[type="text"]::placeholder {
  color: var(--rf-color-on-surface-variant) !important;
}
html[data-theme="dark"] .search-filter-form input[type="text"]::placeholder,
body.night_mode .search-filter-form input[type="text"]::placeholder {
  /* The filter input's dark fill is #474747, not the #2b3843 the muted
     token was measured against — the muted token only reaches 3.68:1
     here. Stone token: ~7.2:1. */
  color: var(--rf-stone) !important;
}
