/**/
/* THIS FILE AUTOGENERATED FROM CSS in ./web/css/ */ 
/**/
/*
 * RedSquare base layer — sits between Saito globals and component CSS.
 *
 *   Saito global styles (saito.css, themes, components)
 *        ↓
 *   redsquare-base.css  ← token aliases, feed extensions, scoped resets
 *        ↓
 *   Component CSS       ← layout and structure only
 *
 * Saito reference (10px root):
 *   body { font-size: 1.6rem; line-height: 1.2; font-family: var(--saito-font) }
 *   Typography: --font-size-h1…h6, --font-size-large/medium/tiny
 *   Surfaces: --saito-background-color, --saito-surface-*, --saito-border-*
 *   Components: .saito-user, .saito-identicon, .saito-button-*, .saito-notification-dot
 *
 * Rules:
 *   - Alias --rs-* to Saito tokens; do not invent parallel color or type scales
 *   - Extend global component classes; do not reimplement them in component CSS
 *   - Component files: grid/flex/spacing only — inherit typography from body
 */

body.redsquare-body {
  background: var(--saito-background-color);

  /* Typography aliases — point at Saito globals */
  --rs-caption: var(--font-size-tiny);
  --rs-meta: var(--font-size-tiny);
  --rs-meta-md: var(--font-size-medium);
  --rs-heading: var(--font-size-h6);
  --rs-section-title: var(--font-size-large);
  --rs-lead: var(--font-size-large);

  /* Surface / color aliases */
  --rs-canvas: var(--saito-background-color);
  --rs-layer-recessed: var(--saito-surface-color);
  --rs-layer-base: var(--saito-surface-hover);
  --rs-layer-raised: var(--saito-surface-selected);
  --rs-layer-overlay: var(--saito-overlay-panel-bg);
  --rs-layer-hover: var(--saito-surface-hover);
  --rs-surface-feed: var(--saito-feed-bg, var(--saito-background-color));
  --rs-surface-card: var(--saito-card-bg);
  --rs-surface-inset: var(--saito-input-bg);
  --rs-surface-hover: var(--saito-surface-hover);

  --rs-border-subtle: var(--saito-border-color-light);
  --rs-border: var(--saito-border-color);
  --rs-border-strong: var(--saito-border-color-dark);

  --rs-text: var(--saito-font-color);
  --rs-text-strong: var(--saito-font-color-heavy);
  --rs-text-muted: var(--saito-font-color-secondary);
  --rs-text-faint: var(--saito-font-color-light);

  --rs-accent: var(--saito-primary);
  --rs-accent-fill: var(--saito-button-primary-bg);
  --rs-accent-fill-hover: var(--saito-button-primary-bg-hover);
  --rs-accent-on: var(--saito-button-primary-fg);

  /* Spacing aliases */
  --rs-space-xs: var(--saito-space-xs);
  --rs-space-sm: var(--saito-space-sm);
  --rs-space-md: var(--saito-space-md);
  --rs-space-lg: var(--saito-space-lg);
  --rs-space-xl: var(--saito-space-xl);
  --rs-gap-tight: 0.2rem;

  --rs-radius-sm: var(--saito-radius-sm);
  --rs-radius: var(--saito-border-radius);
  --rs-radius-pill: var(--saito-radius-full);
  --rs-radius-media: var(--saito-radius-sm);

  --rs-transition: 0.15s ease;

  /*
   * Canonical avatar scale (10px root → rem ≈ px/10).
   * Page-wide standard is 38×38; Profile card keeps the larger identity mark.
   *
   *   S/M  3.8rem  38px  timeline, embeds, chat, arcade, sidebar, etc.
   *   L    6.8rem  68px  profile card only (banner overlap)
   */
  --rs-avatar-xs: 3.8rem;
  --rs-avatar-s: 3.8rem;
  --rs-avatar-m: 3.8rem;
  --rs-avatar-l: 6.8rem;
  --rs-avatar-radius: var(--saito-identicon-border-radius, var(--saito-border-radius));

  /* Semantic aliases — prefer these at call sites that name a role */
  --rs-tweet-avatar: var(--rs-avatar-m);
  --rs-tweet-embed-avatar: var(--rs-avatar-m);
  --rs-identicon: var(--rs-avatar-m);
  --rs-identicon-radius: var(--rs-avatar-radius);

  /*
   * Feed rhythm — aligned with X desktop (~12×16 pad, 12px avatar gutter)
   * while keeping RedSquare tokens (not cloning X chrome).
   */
  --rs-tweet-header-gap: 1.2rem;
  --rs-tweet-text-gap: var(--saito-space-sm);
  --rs-tweet-block-gap: 0.6rem;
  --rs-tweet-pad-y: 1.2rem;
  --rs-tweet-chain-width: var(--border-thickness-medium, 2px);
  --rs-tweet-chain-color: var(--saito-border-color);

  /* Focused — modest type lift (~17px), not a second typography system */
  --rs-tweet-focused-body: 1.7rem;
  --rs-tweet-focused-leading: 2.4rem;
  --rs-tweet-focused-pad-y: 1.2rem;

  /* Embedded / quote — denser than timeline */
  --rs-tweet-embed-pad-x: 1.2rem;
  --rs-tweet-embed-pad-y: 1rem;

  /* Nav layout — proportions only; type inherits from body / Saito menu */
  --rs-nav-icon: 2.75rem;
  --rs-nav-label: 2.15rem;
  --rs-nav-gap: 1.15rem;
  --rs-nav-item-x: var(--saito-space-md);
  --rs-nav-item-y: 1.1rem;
  --rs-nav-min-height: 5.2rem;
  --rs-nav-post-height: 4.4rem;
  --rs-col-pad-top: 1.2rem;

  --rs-btn-height-compact: 3.2rem;
  --rs-btn-height-sidebar: 2.6rem;
  --rs-icon-btn: 3.2rem;
  --rs-control-min: 3.4rem;
  --rs-composer-min-height: 5rem;
  --rs-feed-header-height: 5.6rem;

  --rs-feed-x: var(--saito-space-md);
  --rs-feed-y: var(--saito-space-sm);
  /* Tweet rows: ~16px horizontal inset (X desktop); feed chrome stays on --rs-feed-x */
  --rs-tweet-pad-x: 1.6rem;
  --rs-sidebar-pad: var(--saito-space-md);
  --rs-panel-x: var(--rs-sidebar-pad);
  --rs-row-y: var(--rs-space-xs);
  /* Vertical rhythm between right-rail cards (Profile, Leaderboard, …) */
  --rs-sidebar-gap: var(--rs-space-lg);

  /*
   * Form controls — calm RedSquare inputs. Do not lean on --saito-focus-ring
   * (orange glow in noir). Scope all overrides to body.redsquare-body.
   */
  --rs-input-bg: var(--saito-input-bg, var(--rs-layer-recessed));
  --rs-input-fg: var(--saito-input-fg);
  --rs-input-placeholder: var(--saito-input-placeholder);
  --rs-input-border: var(--rs-border-subtle);
  --rs-input-border-focus: var(--rs-border);
  --rs-input-radius: var(--rs-radius);
  --rs-input-shadow: none;
  --rs-input-shadow-focus: none;

  --rs-col-left: 26rem;
  --rs-col-center: 58rem;
  --rs-col-right: 32rem;
  /* Match saito-page-layout column gutters; columns + gaps = --saito-width (120rem @ 10px root) */
  --rs-col-gap: 2rem;
  /* Same horizontal inset as #saito-header (saito-header.css) — page content flows from header */
  --rs-page-inset: max(2rem, calc((100vw - var(--saito-width)) / 2 + 0.5rem));
  /* Nav icon/label offsets from left column edge (= logo left edge once inset matches) */
  --rs-nav-cube-center: 2.5rem;
  --rs-nav-wordmark-start: 4.7rem;
  --rs-nav-hover-inset: calc(var(--rs-nav-cube-center) - (var(--rs-nav-icon) / 2));
}

/*
 * Tweet feed — header/body typography.
 * Header modes: .tweet-header.compact | .expanded | .compose
 * .saito-address / .saito-userline remain as type hooks.
 */
body.redsquare-body .tweet-header .tweet-header-primary,
body.redsquare-body .tweet-header .saito-address {
  font-family: var(--saito-font-heavy);
  font-size: var(--font-size-medium);
  font-weight: 700;
  line-height: 1.3;
  color: var(--saito-font-color-heavy);
}

body.redsquare-body .tweet-header .tweet-header-handle,
body.redsquare-body .tweet-header .tweet-header-time,
body.redsquare-body .tweet-header .tweet-header-sep,
body.redsquare-body .tweet-header .tweet-header-secondary,
body.redsquare-body .tweet-header .saito-userline {
  font-family: var(--saito-font, inherit);
  font-weight: 400;
  color: var(--saito-font-color-secondary);
}

/*
 * Compact one-line headers: hierarchy is weight + color, not a smaller meta size.
 * Matches X desktop scanning rhythm.
 */
body.redsquare-body .tweet-header.compact .tweet-header-handle,
body.redsquare-body .tweet-header.compact .tweet-header-time,
body.redsquare-body .tweet-header.compact .tweet-header-sep {
  font-size: var(--font-size-medium);
  line-height: 1.3;
}

body.redsquare-body .tweet-body {
  line-height: 2rem;
  font-size: var(--font-size-medium);
}

/*
 * Three-column shell — overrides default .saito-container grid
 * from saito-page-layout.css for this module's proportions.
 *
 * Horizontal alignment: --rs-page-inset must match #saito-header padding
 * (saito-header.css). Prior fixes targeted .menu / .sidebar-* padding
 * while the container used a different width variable and zero column-gap.
 *
 * Scroll ownership: this shell does NOT scroll. Columns are fixed-height;
 * the center .manager owns overflow (feed scroll). Side columns scroll
 * independently. Header timeline/detail behaviour lives in manager.css.
 */
body.redsquare-body #saito-container.saito-container {
  background: var(--rs-canvas);
  position: absolute;
  top: var(--saito-header-height);
  left: 0;
  right: 0;
  width: 100vw;
  height: calc(100% - var(--saito-header-height));
  max-height: none;
  margin: 0;
  padding: 0 var(--rs-page-inset);
  column-gap: var(--rs-col-gap);
  grid-template-columns: var(--rs-col-left) minmax(0, var(--rs-col-center)) var(--rs-col-right);
  align-items: stretch;
  overflow: hidden;
}

/* Grid items must shrink so children can own overflow */
body.redsquare-body #saito-container.saito-container > * {
  min-width: 0;
  min-height: 0;
  max-height: 100%;
}

@media (max-width: 1200px) {
  body.redsquare-body {
    --saito-width: 100rem;
  }

  body.redsquare-body #saito-container.saito-container {
    grid-template-columns: 9rem minmax(0, 1fr) 28rem;
  }
}

@media (max-width: 820px) {
  body.redsquare-body {
    --saito-width: 70rem;
  }

  body.redsquare-body #saito-container.saito-container {
    grid-template-columns: 8rem minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  body.redsquare-body #saito-container.saito-container {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
    padding: 0;
  }
}

/*
 * Compact controls — carve-out from global button defaults (saito-buttons.css).
 * Contextual menus and icon triggers use div[role="button"] + saito-menu-select-subtle.
 */
body.redsquare-body .menu-post,
body.redsquare-body .composer-submit,
body.redsquare-body .new-post-button,
body.redsquare-body .profile-copy-key,
body.redsquare-body .manager-header-back,
body.redsquare-body .sidebar-suggestion-follow,
body.redsquare-body .compose-tool,
body.redsquare-body .settings-row-inline .saito-button-secondary {
  min-width: unset;
  min-height: unset;
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
}

/*
 * Inputs — RedSquare owns control chrome; Saito globals must not leak in.
 *
 * Saito (saito-form-elements.css) paints every `input` / `textarea` with
 * border + focus ring. RedSquare redefines that under body.redsquare-body.
 *
 * Two patterns:
 *   1. Standalone controls — get a single RedSquare border/background.
 *   2. Framed fields (.compose-surface, .composer-surface,
 *      .sidebar-search-field) — the FRAME owns border/radius/background;
 *      nested inputs are fully chrome-free so they cannot draw a second box.
 *
 * Nested resets use selectors that outrank both Saito globals and the
 * standalone rules below (do not rely on a weaker `.sidebar-search input`
 * carve-out — earlier builds lost that fight to `input:not([type=…])`).
 */
body.redsquare-body textarea,
body.redsquare-body select,
body.redsquare-body input[type='text'],
body.redsquare-body input[type='search'],
body.redsquare-body input[type='email'],
body.redsquare-body input[type='number'],
body.redsquare-body input[type='password'],
body.redsquare-body input[type='url'],
body.redsquare-body input:not([type]) {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--rs-input-bg);
  color: var(--rs-input-fg);
  border: var(--border-thickness-thin, 1px) solid var(--rs-input-border);
  border-radius: var(--rs-input-radius);
  box-shadow: var(--rs-input-shadow);
}

body.redsquare-body textarea:focus,
body.redsquare-body select:focus,
body.redsquare-body input[type='text']:focus,
body.redsquare-body input[type='search']:focus,
body.redsquare-body input[type='email']:focus,
body.redsquare-body input[type='number']:focus,
body.redsquare-body input[type='password']:focus,
body.redsquare-body input[type='url']:focus,
body.redsquare-body input:not([type]):focus {
  outline: none;
  border-color: var(--rs-input-border-focus);
  box-shadow: var(--rs-input-shadow-focus);
}

body.redsquare-body .compose-surface .compose-input,
body.redsquare-body .composer-surface .composer-input,
body.redsquare-body .sidebar-search-field input,
body.redsquare-body .sidebar-search-field input[type='search'] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  background-color: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  outline: none;
}

body.redsquare-body .compose-surface .compose-input:focus,
body.redsquare-body .composer-surface .composer-input:focus,
body.redsquare-body .sidebar-search-field input:focus,
body.redsquare-body .sidebar-search-field input[type='search']:focus {
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  border: none;
  background: transparent;
  background-color: transparent;
  box-shadow: none;
}

body.redsquare-body .compose-surface:focus-within,
body.redsquare-body .composer-surface:focus-within,
body.redsquare-body .sidebar-search-field:focus-within {
  border-color: var(--rs-input-border-focus);
  box-shadow: none;
}

/* WebKit search decorations draw a second chrome box; strip them. */
body.redsquare-body .sidebar-search-field input[type='search']::-webkit-search-decoration,
body.redsquare-body .sidebar-search-field input[type='search']::-webkit-search-cancel-button,
body.redsquare-body .sidebar-search-field input[type='search']::-webkit-search-results-button,
body.redsquare-body .sidebar-search-field input[type='search']::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
/*
 * Embedded Tweet — a nested .tweet.embedded inside the parent .tweet-embed region.
 * Presentation only: nested embeds beyond one level are suppressed in CSS.
 */

.tweet-embed {
  margin-top: var(--rs-tweet-block-gap);
  width: 100%;
  min-width: 0;
}

.tweet-embed > .tweet.embedded,
.tweet-embed > .tweet.tweet-embedded {
  --tweet-current-avatar: var(--rs-tweet-embed-avatar, var(--rs-avatar-m));
  --tweet-current-pad-x: var(--rs-tweet-embed-pad-x, 1.2rem);
  --tweet-current-pad-y: var(--rs-tweet-embed-pad-y, 1rem);
  --tweet-body-gap: 0.15rem;
  display: grid;
  grid-template-columns: var(--tweet-current-avatar) minmax(0, 1fr);
  column-gap: 0.8rem;
  padding: var(--tweet-current-pad-y) var(--tweet-current-pad-x);
  border: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
  border-radius: var(--rs-radius-media, var(--rs-radius));
  background: transparent;
  cursor: pointer;
  transition: background-color var(--rs-transition);
}

.tweet-embed > .tweet.embedded:hover,
.tweet-embed > .tweet.tweet-embedded:hover {
  background: var(--rs-surface-hover);
}

.tweet.embedded,
.tweet.tweet-embedded {
  border-bottom: none;
}

.tweet.embedded .tweet-avatar,
.tweet.tweet-embedded .tweet-avatar {
  width: var(--tweet-current-avatar);
  height: var(--tweet-current-avatar);
}

body.redsquare-body .tweet.embedded .tweet-avatar.saito-identicon,
body.redsquare-body .tweet.tweet-embedded .tweet-avatar.saito-identicon {
  width: var(--tweet-current-avatar);
  height: var(--tweet-current-avatar);
}

body.redsquare-body .tweet.embedded .tweet-header.compact .tweet-header-primary,
body.redsquare-body .tweet.tweet-embedded .tweet-header.compact .tweet-header-primary {
  font-size: var(--font-size-tiny);
  line-height: 1.25;
}

body.redsquare-body .tweet.embedded .tweet-header.compact .tweet-header-handle,
body.redsquare-body .tweet.embedded .tweet-header.compact .tweet-header-time,
body.redsquare-body .tweet.embedded .tweet-header.compact .tweet-header-sep,
body.redsquare-body .tweet.tweet-embedded .tweet-header.compact .tweet-header-handle,
body.redsquare-body .tweet.tweet-embedded .tweet-header.compact .tweet-header-time,
body.redsquare-body .tweet.tweet-embedded .tweet-header.compact .tweet-header-sep {
  font-size: var(--font-size-tiny);
  line-height: 1.25;
}

.tweet-body.embedded {
  font-size: var(--font-size-tiny);
  line-height: 1.4;
  margin-top: 0.15rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
}

/* Suppress chain rail, footer, and further nesting inside embedded Tweets */
.tweet.embedded .tweet-chain,
.tweet.embedded .tweet-footer,
.tweet.tweet-embedded .tweet-chain,
.tweet.tweet-embedded .tweet-footer {
  display: none;
}

.tweet.embedded .tweet-embed,
.tweet.tweet-embedded .tweet-embed {
  display: none;
}
.tweet {
  --tweet-current-avatar: var(--rs-tweet-avatar, var(--rs-avatar-m));
  --tweet-current-pad-x: var(--rs-tweet-pad-x);
  --tweet-current-pad-y: var(--rs-tweet-pad-y, 1.2rem);
  --tweet-header-gap: 0.4rem;
  --tweet-body-gap: 0.1rem;
  position: relative;
  display: grid;
  grid-template-columns: var(--tweet-current-avatar) minmax(0, 1fr);
  column-gap: var(--rs-tweet-header-gap);
  padding: var(--tweet-current-pad-y) var(--tweet-current-pad-x);
  border-bottom: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
  cursor: pointer;
  transition: background-color var(--rs-transition);
}

.tweet:hover {
  background: var(--rs-surface-hover);
}

.tweet-avatar {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  width: var(--tweet-current-avatar);
  height: var(--tweet-current-avatar);
  border: none;
  border-radius: var(--rs-avatar-radius);
  object-fit: cover;
  flex-shrink: 0;
  z-index: 1;
}

/* Beat global .saito-identicon (3.5rem) when both classes are present. */
body.redsquare-body .tweet-avatar.saito-identicon {
  width: var(--tweet-current-avatar);
  height: var(--tweet-current-avatar);
  border-radius: var(--rs-avatar-radius);
}

.tweet-chain {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--tweet-current-pad-x);
  width: var(--tweet-current-avatar);
  pointer-events: none;
  z-index: 0;
}

.tweet-chain::before,
.tweet-chain::after {
  content: '';
  position: absolute;
  left: 50%;
  width: var(--rs-tweet-chain-width);
  transform: translateX(-50%);
  border-radius: var(--rs-radius-pill);
  background: var(--rs-tweet-chain-color);
  opacity: 0;
}

.tweet.chain-prev .tweet-chain::before {
  top: 0;
  bottom: calc(100% - var(--tweet-current-pad-y));
  opacity: 1;
}

.tweet.chain-next .tweet-chain::after {
  top: calc(var(--tweet-current-pad-y) + var(--tweet-current-avatar));
  bottom: 0;
  opacity: 1;
}

/*
 * Continuous conversation — modifier on the Tweet root only
 * (.tweet.chain-continue). Suppresses the divider so this Tweet reads as one
 * object flowing into the next. Pair with .chain-next here and .chain-prev on
 * the following Tweet for the connecting rail.
 */
.tweet.chain-continue {
  border-bottom: none;
}

/* Primary content column — body aligns with username (column 2). */
.tweet-content {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* -------------------------------------------------------------------------
 * TweetHeader — compact (scan) vs expanded (read).
 * Spacing stays local to the header; tweet layout does not encode it.
 * ------------------------------------------------------------------------- */

.tweet-header {
  display: flex;
  min-width: 0;
  overflow: hidden;
}

.tweet-header-primary {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tweet-header-handle {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tweet-header-time {
  flex: 0 0 auto;
  margin-left: auto;
  white-space: nowrap;
}

.tweet-header-sep {
  flex: 0 0 auto;
  white-space: nowrap;
}

.tweet-header-sep-time {
  /* sits immediately before the right-pinned time */
  margin-left: 0;
}

/*
 * Compact — one scanning line:
 *   Username · @publickey… · 2m
 * Username = intrinsic width; handle truncates; time always stays visible.
 */
.tweet-header.compact {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: var(--tweet-header-gap);
  min-height: 0;
  line-height: 1.3;
}

.tweet-header.compact .tweet-header-primary {
  flex: 0 1 auto;
  min-width: 0;
}

.tweet-header.compact .tweet-header-handle {
  flex: 1 1 0;
  min-width: 0;
}

.tweet-header.compact .tweet-header-sep-time {
  margin-left: auto;
}

.tweet-header.compact .tweet-header-time {
  flex: 0 0 auto;
  margin-left: 0;
}

/*
 * Expanded — focused/reading layout:
 *   Username
 *   @publickey
 * Treated as one typographic block, vertically centered beside the avatar.
 */
.tweet-header.expanded {
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 0.2rem;
  min-height: 0;
  padding: 0;
}

.tweet-header.expanded .tweet-header-primary,
.tweet-header.expanded .tweet-header-handle {
  flex: none;
  max-width: 100%;
}

.tweet-header.expanded .tweet-header-primary {
  margin: 0;
  padding: 0;
  line-height: 1.25;
  white-space: normal;
}

.tweet-header.expanded .tweet-header-handle {
  margin: 0;
  padding: 0;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
}

/*
 * Compose — intentionally unchanged stacked instructional header.
 * Layout rules live in compose-overlay.css.
 */
.tweet-header.compose {
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.1rem;
  min-height: 0;
}

.tweet-header.compose .tweet-header-primary,
.tweet-header.compose .tweet-header-secondary {
  flex: none;
  max-width: 100%;
}

.tweet-header-secondary {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tweet-body {
  margin-top: var(--tweet-body-gap);
  padding: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.tweet-time {
  margin-top: var(--rs-tweet-block-gap);
  padding-top: var(--rs-tweet-block-gap);
  border-top: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
  font-size: var(--font-size-tiny);
  line-height: 1.4;
  color: var(--rs-text-muted, var(--saito-font-color-secondary));
}

.tweet-footer {
  margin-top: var(--rs-tweet-block-gap);
}

.tweet-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--rs-gap-tight);
  padding: 0;
  color: var(--saito-font-color-secondary);
  user-select: none;
}

.tweet-controls > .tweet-tool {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: var(--rs-control-min);
  padding: 0.2rem 0;
  border-radius: var(--rs-radius);
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.tweet-controls i {
  font-size: 1.6rem;
  line-height: 1;
  margin: 0 var(--rs-space-xs);
  text-align: center;
  color: inherit;
}

.tweet-controls span {
  display: inline-block;
  font-size: var(--font-size-tiny);
  font-variant-numeric: tabular-nums;
  z-index: 1;
}

/*
 * Show-more row — optional footer element, present in every Tweet's markup
 * but hidden until the .tweet.show-more modifier is set.
 */
.tweet-show-more {
  display: none;
  margin-top: var(--rs-tweet-block-gap);
  color: var(--saito-font-color-secondary);
  font-size: var(--font-size-tiny);
  cursor: pointer;
  transition: color var(--rs-transition);
}

.tweet.show-more {
  border-bottom: none;
}

.tweet.show-more .tweet-show-more {
  display: block;
}

.tweet-show-more:hover {
  color: var(--saito-font-color-heavy);
  text-decoration: underline;
}

/* -------------------------------------------------------------------------
 * Presentation presets
 * ------------------------------------------------------------------------- */

/* Timeline — compact feed baseline */
.tweet.timeline {
  --tweet-current-pad-y: var(--rs-tweet-pad-y, 1.2rem);
}

/*
 * Root — conversation parent / critical-child stub.
 * Same compact anatomy as timeline; slightly quieter handle meta.
 */
.tweet.root {
  --tweet-current-pad-y: var(--rs-tweet-pad-y, 1.2rem);
}

body.redsquare-body .tweet.root .tweet-header.compact .tweet-header-handle {
  color: var(--rs-text-faint, var(--saito-font-color-light));
}

/* Reply — same compact anatomy as timeline */
.tweet.reply {
  --tweet-current-pad-y: var(--rs-tweet-pad-y, 1.2rem);
}

/* Focused — hero in thread view */
.tweet.focused {
  --tweet-current-pad-y: var(--rs-tweet-focused-pad-y);
  padding-top: var(--rs-tweet-focused-pad-y);
  padding-bottom: calc(var(--rs-tweet-focused-pad-y) + 0.2rem);
  cursor: default;
}

.tweet.focused:hover {
  background: transparent;
}

body.redsquare-body .tweet-header.expanded .tweet-header-primary {
  font-size: 1.6rem;
  line-height: 1.25;
}

body.redsquare-body .tweet-header.expanded .tweet-header-handle {
  font-size: var(--font-size-medium);
  line-height: 1.3;
}

.tweet-body.focused {
  font-size: var(--rs-tweet-focused-body);
  line-height: var(--rs-tweet-focused-leading);
  margin-top: 0.8rem;
}

@media (max-width: 600px) {
  .tweet {
    --tweet-current-pad-x: var(--rs-space-sm);
    padding: var(--tweet-current-pad-y) var(--rs-space-sm);
    column-gap: var(--rs-space-sm);
  }

  .tweet.focused {
    --tweet-current-pad-y: var(--rs-space-md);
    padding-top: var(--rs-space-md);
    padding-bottom: var(--rs-space-md);
  }

  body.redsquare-body .tweet-body.focused {
    font-size: 1.8rem;
    line-height: 2.5rem;
  }
}
/*
 * Right-rail stack — spacing owned here via --rs-sidebar-gap.
 * Do not add per-card vertical margins; empty mounts collapse with :empty.
 */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--rs-sidebar-gap);
  width: 100%;
}

.sidebar-search {
  position: relative;
  width: 100%;
}

/*
 * The field owns the search box chrome. Nested input must not paint a box —
 * see redsquare-base.css framed-field reset (Saito input borders leak otherwise).
 */
.sidebar-search-field {
  display: flex;
  align-items: center;
  gap: var(--rs-space-xs);
  width: 100%;
  min-height: var(--rs-btn-height-compact);
  margin: 0;
  padding: 0 var(--rs-sidebar-pad);
  border: var(--border-thickness-thin, 1px) solid var(--rs-input-border, var(--rs-border-subtle));
  border-radius: var(--rs-radius-pill);
  background: var(--rs-input-bg, var(--rs-layer-recessed));
  box-sizing: border-box;
  cursor: text;
  transition: border-color var(--rs-transition);
}

.sidebar-search-field:focus-within {
  border-color: var(--rs-input-border-focus, var(--rs-border));
  box-shadow: none;
}

.sidebar-search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.6rem;
  color: var(--saito-font-color-secondary);
  font-size: var(--font-size-tiny);
  line-height: 1;
  pointer-events: none;
}

.sidebar-search-icon i {
  display: block;
  line-height: 1;
}

.sidebar-search-field input {
  flex: 1;
  min-width: 0;
  min-height: calc(var(--rs-btn-height-compact) - 0.2rem);
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--rs-input-fg, var(--saito-input-fg));
  font-size: var(--font-size-tiny);
  font-family: inherit;
}

.sidebar-search-field input::placeholder {
  color: var(--rs-input-placeholder, var(--saito-input-placeholder));
}

.sidebar-search-field input:focus {
  outline: none;
  border: none;
  box-shadow: none;
  background: transparent;
}

/*
 * Module-injection mounts — peers render via canRenderInto/renderInto.
 * Same vertical rhythm as sibling cards when a mount holds multiple children.
 */
.sidebar .redsquare-arcade,
.sidebar .redsquare-leaderboard,
.sidebar .redsquare-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--rs-sidebar-gap);
  width: 100%;
  min-width: 0;
}

/* Collapse empty mounts so unused peers do not leave dead gaps */
.sidebar .redsquare-arcade:empty,
.sidebar .redsquare-leaderboard:empty,
.sidebar .redsquare-sidebar:empty {
  display: none;
}

.sidebar-panel {
  background: var(--rs-layer-recessed);
  border: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
  border-radius: var(--rs-radius);
  overflow: hidden;
}

.sidebar-panel-title {
  margin: 0;
  padding: var(--rs-sidebar-pad) var(--rs-sidebar-pad) var(--rs-space-xs);
  font-family: var(--saito-font-heavy);
  font-size: var(--rs-section-title);
  color: var(--rs-text-strong, var(--saito-font-color-heavy));
  line-height: 1.3;
}

.sidebar-suggestion-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-suggestion {
  display: grid;
  grid-template-columns: var(--rs-avatar-s) minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--rs-space-xs);
  padding: var(--rs-row-y) var(--rs-sidebar-pad);
}

.sidebar-suggestion-avatar {
  width: var(--rs-avatar-s);
  height: var(--rs-avatar-s);
  border-radius: var(--rs-avatar-radius);
  border: none;
  object-fit: cover;
}

.sidebar-suggestion-info {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.sidebar-suggestion-name {
  font-family: var(--saito-font-medium);
  font-size: var(--font-size-tiny);
  color: var(--rs-text-strong, var(--saito-font-color));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-suggestion-handle {
  font-size: var(--font-size-tiny);
  color: var(--rs-text-muted, var(--saito-font-color-secondary));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/*
 * Follow — secondary / outlined control. Never the orange primary CTA.
 * Stronger emphasis only on hover (and focus-visible).
 */
.sidebar-suggestion-follow {
  white-space: nowrap;
  min-height: var(--rs-btn-height-sidebar, var(--rs-btn-height-compact));
  padding: 0 var(--rs-space-sm);
  border-radius: var(--rs-radius-pill);
  font-size: var(--font-size-tiny);
  font-family: var(--saito-font-medium);
  line-height: 1;
  cursor: pointer;
  transition:
    background var(--rs-transition),
    border-color var(--rs-transition),
    color var(--rs-transition);
}

body.redsquare-body .sidebar-suggestion-follow.saito-button-secondary {
  background: transparent;
  border: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
  color: var(--rs-text-strong, var(--saito-font-color));
  box-shadow: none;
}

body.redsquare-body .sidebar-suggestion-follow.saito-button-secondary:hover,
body.redsquare-body .sidebar-suggestion-follow.saito-button-secondary:focus-visible {
  background: var(--rs-surface-hover);
  border-color: var(--rs-border);
  color: var(--rs-text-strong, var(--saito-font-color));
  outline: none;
}

.sidebar-more {
  display: block;
  padding: var(--rs-row-y) var(--rs-sidebar-pad);
  color: var(--rs-text-muted, var(--saito-font-color-secondary));
  font-size: var(--font-size-tiny);
  text-decoration: none;
  transition:
    background var(--rs-transition),
    color var(--rs-transition);
}

.sidebar-more:hover {
  background: var(--rs-surface-hover);
  color: var(--rs-text-strong, var(--saito-font-color));
  text-decoration: none;
}

.sidebar-footer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rs-space-xs) var(--rs-space-sm);
  padding: var(--rs-space-xs) var(--rs-sidebar-pad) 0;
  font-size: var(--font-size-tiny);
  color: var(--saito-font-color-light);
}

.sidebar-footer a {
  color: inherit;
  text-decoration: none;
  transition: color var(--rs-transition);
}

.sidebar-footer a:hover {
  color: var(--saito-font-color-secondary);
}
/*
 * Arcade My Games embed — presentation only.
 * Arcade owns InviteManager via canRenderInto('.redsquare-arcade') + renderInto.
 * RedSquare only provides the mount and these visual overrides.
 *
 * Architecture (media card, not flex module):
 *   MY GAMES                    ← naked section title
 *   [ artwork surface ]         ← .saito-game is background + clip only
 *     title chip → absolute bottom-left overlay
 *     icons      → absolute bottom-right overlay
 *
 * Title/icons MUST be out of flow. Shared .saito-module treats them as flex
 * children; that is the broken layout we neutralize here.
 */

body.redsquare-body .sidebar .redsquare-arcade > .arcade-invite {
  display: flex;
  flex-direction: column;
  gap: var(--rs-space-sm);
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  user-select: none;
  box-sizing: border-box;
  row-gap: var(--rs-space-sm);
}

/* Naked section title — no enclosing chrome */
body.redsquare-body .sidebar .redsquare-arcade .arcade-invite > .sidebar-header {
  margin: 0;
  padding: 0;
  min-height: 0;
  color: var(--rs-text-strong, var(--saito-font-color-heavy));
  text-transform: none;
  font-family: var(--saito-font-heavy);
  font-size: var(--rs-section-title);
  line-height: 1.3;
  background: transparent;
  border: none;
}

/*
 * Card surface — relative positioning context + clip.
 * display:block (not flex) so absolute overlays do not fight for tracks.
 * Explicit min-height because all chrome is out of flow.
 */
body.redsquare-body .sidebar .redsquare-arcade .arcade-invite .saito-module.saito-game {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  min-height: 11rem;
  height: auto;
  border: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
  border-radius: var(--rs-radius);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-color: transparent;
  background-blend-mode: normal;
  box-shadow: none;
  cursor: pointer;
  transform: none;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
}

body.redsquare-body .sidebar .redsquare-arcade .arcade-invite .saito-module.saito-game:hover {
  filter: brightness(1.05);
  transform: none;
  box-shadow: none;
  border-color: var(--rs-border-subtle);
  background-color: transparent;
}

/* Soft bottom scrim for readability; title chip supplies stronger contrast */
body.redsquare-body .sidebar .redsquare-arcade .arcade-invite .saito-module.saito-game::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 55%;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.2) 55%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 0;
}

/*
 * Title chip — absolute overlay, lower-left.
 * Matches existing invite look: dark translucent rounded plate over art.
 */
body.redsquare-body .sidebar .redsquare-arcade .arcade-invite .saito-module-titlebar {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  z-index: 1;
  width: auto;
  max-width: calc(100% - 9rem);
  min-width: 0;
  margin: 0;
  padding: 0.55rem 0.9rem;
  opacity: 1;
  background: rgba(0, 0, 0, 0.62);
  border-radius: var(--rs-radius-sm, var(--rs-radius));
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  pointer-events: none;
}

body.redsquare-body .sidebar .redsquare-arcade .arcade-invite .saito-module-titlebar > div {
  margin: 0;
}

body.redsquare-body .sidebar .redsquare-arcade .arcade-invite .saito-module-titlebar-title {
  font-family: var(--saito-font-medium);
  font-size: 1.5rem;
  line-height: 1.25;
  color: var(--saito-white, #fff);
  text-shadow: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.redsquare-body .sidebar .redsquare-arcade .arcade-invite .saito-module-titlebar-details {
  margin-top: 0.15rem;
  font-size: 1.1rem;
  line-height: 1.2;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: none;
}

/*
 * Player icons — absolute overlay, lower-right.
 * Neutralize Arcade/saito flex growth + min-content that forced in-flow width.
 */
body.redsquare-body .sidebar .redsquare-arcade .arcade-invite .arcade-invite-actions {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 1;
  margin: 0;
  padding: 0;
  background: transparent;
  width: auto;
  max-width: none;
}

body.redsquare-body .sidebar .redsquare-arcade .arcade-invite .saito-game-details,
body.redsquare-body .sidebar .redsquare-arcade .arcade-invite .arcade-invite-identicons,
body.redsquare-body .sidebar .redsquare-arcade .arcade-invite .saito-game-details.arcade-invite-identicons {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  flex-grow: 0;
  flex-shrink: 0;
  width: auto;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  column-gap: 0.35rem;
  row-gap: 0;
}

body.redsquare-body .sidebar .redsquare-arcade .arcade-invite .arcade-invite-identicons div {
  height: auto;
}

/* ~36px — match existing invite cards; do not use page feed avatar scale */
body.redsquare-body .sidebar .redsquare-arcade .arcade-invite .saito-identicon-box,
body.redsquare-body .sidebar .redsquare-arcade .arcade-invite .arcade-invite-requested,
body.redsquare-body .sidebar .redsquare-arcade .arcade-invite .arcade-invite-slot {
  position: relative;
  width: 3.6rem;
  height: 3.6rem;
  margin: 0;
  overflow: hidden;
  flex: 0 0 3.6rem;
  border: 1px solid rgba(0, 0, 0, 0.55);
  border-radius: var(--rs-radius-sm, var(--rs-avatar-radius));
  background: rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
}

body.redsquare-body .sidebar .redsquare-arcade .arcade-invite .saito-module-identicon.saito-identicon,
body.redsquare-body .sidebar .redsquare-arcade .arcade-invite .saito-identicon-box .saito-identicon,
body.redsquare-body .sidebar .redsquare-arcade .arcade-invite .arcade-invite-requested .saito-identicon {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  border: none;
  border-radius: inherit;
}

body.redsquare-body .sidebar .redsquare-arcade .arcade-invite .arcade-invite-badge {
  right: 0.6rem;
  bottom: 0.6rem;
  max-width: 50%;
  min-height: 2.4rem;
  height: auto;
  padding: 0.3rem 0.8rem;
  font-size: var(--font-size-tiny);
  border-radius: var(--rs-radius-sm);
  border-width: 1px;
  z-index: 2;
}

/* Empty shell (no active games) — hide the mount gap */
body.redsquare-body .sidebar .redsquare-arcade:not(:has(.sidebar-header)):not(:has(.saito-game)) {
  display: none;
}
/*
 * RedSquare settings overlay — panel layout only.
 * Close control: standard SaitoOverlay closebox (saito-overlay.css).
 * List rows: saito-menu-select-subtle (saito-buttons.css).
 * Secondary action: saito-button-secondary (whitelist).
 */

.saito-overlay .settings-overlay {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(52rem, 92vw);
  max-height: min(88vh, 72rem);
  border-radius: var(--rs-radius);
  border: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
  background: var(--rs-layer-overlay, var(--saito-overlay-panel-bg));
  box-shadow: var(--saito-box-shadow, 0 1.2rem 3.2rem rgba(0, 0, 0, 0.28));
  overflow: hidden;
}

.settings-overlay-header {
  padding: var(--rs-tweet-pad-y) var(--rs-tweet-pad-x);
  border-bottom: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
}

.settings-overlay-title {
  margin: 0;
  font-family: var(--saito-font-heavy);
  font-size: var(--rs-heading);
  font-weight: normal;
  line-height: 1.2;
  color: var(--rs-text-strong);
}

.settings-overlay-body {
  display: flex;
  flex-direction: column;
  gap: var(--rs-space-lg);
  padding: var(--rs-space-lg) var(--rs-tweet-pad-x) var(--rs-space-xl);
  overflow-y: auto;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: var(--rs-space-md);
}

.settings-section-title {
  margin: 0;
  font-family: var(--saito-font-heavy);
  font-size: var(--rs-section-title);
  font-weight: normal;
  line-height: 1.2;
  color: var(--rs-text-strong);
}

.settings-section-description {
  margin: 0;
  font-size: var(--font-size-medium);
  line-height: 1.45;
  color: var(--rs-text-muted);
}

.settings-preference-group {
  display: flex;
  flex-direction: column;
  gap: var(--rs-space-xs);
  margin-top: var(--rs-space-xs);
}

.settings-preference {
  display: flex;
  align-items: flex-start;
  gap: var(--rs-space-sm);
  margin: 0;
  padding: var(--rs-space-sm) var(--rs-space-md);
  border: var(--border-thickness-thin, 1px) solid transparent;
  border-radius: var(--rs-radius);
  background: transparent;
  color: var(--rs-text);
  cursor: pointer;
  transition:
    background var(--rs-transition),
    border-color var(--rs-transition);
}

.settings-preference:hover {
  background: var(--rs-layer-recessed);
  border-color: var(--rs-border-subtle);
}

.settings-preference:has(input:focus-visible) {
  border-color: var(--rs-input-border-focus, var(--rs-border));
}

.settings-preference input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.settings-preference-indicator {
  position: relative;
  flex-shrink: 0;
  width: 1.8rem;
  height: 1.8rem;
  margin-top: 0.15rem;
  border: var(--border-thickness-thin, 1px) solid var(--rs-border-strong, var(--rs-border-subtle));
  border-radius: 50%;
  background: var(--rs-layer-recessed);
  box-sizing: border-box;
}

.settings-preference-indicator::after {
  content: '';
  position: absolute;
  inset: 0.35rem;
  border-radius: 50%;
  background: var(--rs-text-strong);
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity var(--rs-transition),
    transform var(--rs-transition);
}

.settings-preference:has(input:checked) .settings-preference-indicator {
  border-color: var(--rs-text-strong);
  background: var(--rs-layer-base);
}

.settings-preference:has(input:checked) .settings-preference-indicator::after {
  opacity: 1;
  transform: scale(1);
}

.settings-preference-text {
  flex: 1;
  min-width: 0;
  font-size: var(--font-size-medium);
  line-height: 1.4;
  color: var(--rs-text);
}

.settings-preference:has(input:checked) .settings-preference-text {
  color: var(--rs-text-strong);
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: var(--rs-space-sm);
}

.settings-row {
  display: flex;
  align-items: center;
  gap: var(--rs-space-md);
  width: 100%;
  min-height: 4.8rem;
  padding: 0 var(--rs-space-md);
  border: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
  border-radius: var(--rs-radius);
  background: var(--rs-layer-recessed);
  color: var(--rs-text);
  text-align: left;
}

.settings-row-action {
  cursor: pointer;
}

.settings-row-inline {
  justify-content: flex-start;
  min-height: auto;
  padding: var(--rs-space-xs) 0 0;
  border: none;
  background: transparent;
}

.settings-row-inline .saito-button-secondary {
  margin: 0;
}

.settings-row-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.2rem;
  color: var(--rs-text-muted);
  font-size: var(--font-size-medium);
}

.settings-row-label {
  flex: 1;
  min-width: 0;
  font-size: var(--font-size-medium);
  line-height: 1.2;
  color: var(--rs-text-strong);
}

.settings-row-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--rs-text-faint);
  font-size: 1.2rem;
}
/*
 * League Leaderboard embed — presentation only.
 * League owns data/behaviour via canRenderInto('.redsquare-leaderboard') + renderInto.
 * RedSquare only provides the mount and these visual overrides.
 */

body.redsquare-body .sidebar .redsquare-leaderboard .league-rankings {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  background: var(--rs-layer-recessed);
  border: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
  border-radius: var(--rs-radius);
  overflow: hidden;
  user-select: none;
  box-sizing: border-box;
}

body.redsquare-body .sidebar .redsquare-leaderboard .league-rankings > .sidebar-header {
  margin: 0;
  padding: var(--rs-sidebar-pad) var(--rs-sidebar-pad) var(--rs-space-xs);
  min-height: 0;
  color: var(--rs-text-strong, var(--saito-font-color-heavy));
  text-transform: none;
  font-family: var(--saito-font-heavy);
  font-size: var(--rs-section-title);
  line-height: 1.3;
}

body.redsquare-body .sidebar .redsquare-leaderboard .league-rankings .sidebar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  cursor: default;
}

body.redsquare-body .sidebar .redsquare-leaderboard .league-rankings .sidebar-title-text {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

body.redsquare-body .sidebar .redsquare-leaderboard .league-rankings .sidebar-title-icon {
  color: var(--rs-text-muted, var(--saito-font-color-secondary));
  font-size: var(--font-size-tiny);
  transform: none;
}

body.redsquare-body .sidebar .redsquare-leaderboard .league-rankings .saito-table.saito-sidebar-element,
body.redsquare-body .sidebar .redsquare-leaderboard .league-rankings .saito-table {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

body.redsquare-body .sidebar .redsquare-leaderboard .league-rankings .saito-table-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  min-height: 0;
  max-height: none;
  overflow: visible;
  border-radius: 0;
  font-size: var(--font-size-tiny);
  grid-gap: 0;
}

body.redsquare-body .sidebar .redsquare-leaderboard .league-rankings .saito-table-row.league-leaderboard-ranking,
body.redsquare-body .sidebar .redsquare-leaderboard .league-rankings .league-leaderboard-ranking {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--rs-space-sm);
  grid-gap: 0;
  width: 100%;
  margin: 0;
  padding: var(--rs-row-y) var(--rs-sidebar-pad);
  border: none;
  border-radius: 0;
  background: transparent;
  box-sizing: border-box;
  cursor: pointer;
  transition: background var(--rs-transition);
}

body.redsquare-body .sidebar .redsquare-leaderboard .league-rankings .league-leaderboard-ranking:hover {
  background: var(--rs-surface-hover);
}

body.redsquare-body .sidebar .redsquare-leaderboard .league-rankings .saito-table-gamename {
  font-family: var(--saito-font-medium);
  font-size: var(--font-size-tiny);
  color: var(--rs-text-strong, var(--saito-font-color));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.redsquare-body .sidebar .redsquare-leaderboard .league-rankings .saito-table-rank {
  display: block;
  font-family: var(--saito-font-medium);
  font-size: var(--font-size-tiny);
  color: var(--rs-text-muted, var(--saito-font-color-secondary));
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
  gap: 0;
}

body.redsquare-body .sidebar .redsquare-leaderboard .league-rankings .saito-table-rank.saito-deemphasize {
  color: var(--rs-text-muted, var(--saito-font-color-secondary));
  opacity: 0.85;
}
/*
 * RedSquare layout — column shell and sidebars only.
 * App-wide tokens and container overrides live in redsquare-base.css.
 *
 * Center column: .main is a fixed-height shell; .manager owns scrolling
 * (timeline header scrolls away; detail header sticks — see manager.css).
 */

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  border-left: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
  border-right: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
  border-top: none;
  border-bottom: none;
  border-radius: 0;
  background: var(--rs-canvas);
}

/*
 * Side columns fill the shell height and scroll their own content.
 * They are no longer sticky children of a page-level scroller.
 */
.sidebar-left {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--rs-space-lg);
  box-sizing: border-box;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  width: 100%;
  min-width: 0;
  padding: var(--rs-col-pad-top) 0 var(--rs-space-md);
  overflow-x: hidden;
  overflow-y: auto;
}

.sidebar-right {
  display: flex;
  flex-direction: column;
  gap: var(--rs-sidebar-gap);
  box-sizing: border-box;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  width: 100%;
  min-width: 0;
  padding: var(--rs-col-pad-top) 0 var(--rs-space-md);
  overflow-x: hidden;
  overflow-y: auto;
}

.sidebar-right > .profile,
.sidebar-right > .sidebar {
  width: 100%;
  flex-shrink: 0;
}

@media (max-width: 820px) {
  .sidebar-right {
    display: none;
  }
}

@media (max-width: 600px) {
  .sidebar-left {
    display: none;
  }

  .main {
    border-left: none;
    border-right: none;
    border-radius: 0;
  }
}
/*
 * Manager = center-column scrollport.
 *
 *   .manager              → single overflow-y scroller for all modes
 *   .manager-header       → in flow (timeline) or sticky (detail)
 *   .manager-body         → layout wrapper; does not own scrolling
 *
 * Mode classes (set by Manager.syncFeedHeader):
 *   .manager--timeline → header scrolls away with the feed
 *   .manager--detail   → header sticks; back stays available
 */
.manager {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}

.manager-header {
  flex: 0 0 auto;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--rs-space-sm);
  box-sizing: border-box;
  height: var(--rs-feed-header-height, 5.6rem);
  min-height: var(--rs-feed-header-height, 5.6rem);
  padding: 0 var(--rs-tweet-pad-x);
  border-bottom: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
  background: var(--rs-surface-feed, var(--rs-canvas));
}

/* Timeline: header is normal flow → scrolls off with tweets */
.manager--timeline .manager-header {
  position: relative;
}

/* Detail: header sticks to the top of .manager’s scrollport */
.manager--detail .manager-header {
  position: sticky;
  top: 0;
}

.manager-header-start {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  flex: 1 1 auto;
}

/*
 * Module back control — quiet icon, never primary/orange.
 * Must outrank theme `button` fill when shown.
 */
html[data-theme] body.redsquare-body .manager-header-back,
body.redsquare-body .manager-header-back,
.manager-header-back {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 3.2rem;
  height: 3.2rem;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  background-image: none;
  box-shadow: none;
  color: var(--rs-text-strong, var(--saito-font-color-heavy));
  font-size: 1.8rem;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
  line-height: 1;
  transform: none;
  filter: none;
  transition:
    background-color var(--rs-transition),
    color var(--rs-transition);
}

html[data-theme] body.redsquare-body .manager-header-back:hover,
html[data-theme] body.redsquare-body .manager-header-back:focus-visible,
body.redsquare-body .manager-header-back:hover,
body.redsquare-body .manager-header-back:focus-visible,
.manager-header-back:hover,
.manager-header-back:focus-visible {
  background: var(--rs-surface-hover, rgba(255, 255, 255, 0.08));
  background-image: none;
  box-shadow: none;
  color: var(--rs-text-strong, var(--saito-font-color-heavy));
  outline: none;
  transform: none;
  filter: none;
}

.manager-header-back[hidden] {
  display: none !important;
}

.manager-header-back i {
  margin: 0;
  line-height: 1;
}

.manager-header-title {
  margin: 0;
  min-width: 0;
  font-family: var(--saito-font-heavy, var(--saito-font-medium));
  font-size: var(--rs-heading);
  font-weight: normal;
  line-height: 1.2;
  color: var(--rs-text-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manager-header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--rs-space-sm);
}

.manager-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
}

.manager-list {
  display: flex;
  flex-direction: column;
}

.manager-thread-context {
  padding: var(--rs-space-sm) var(--rs-tweet-pad-x);
  color: var(--rs-text-muted);
  font-size: var(--font-size-tiny);
  cursor: pointer;
  transition: color var(--rs-transition);
}

.manager-thread-context:hover {
  color: var(--rs-text-strong);
  text-decoration: underline;
}

.manager-panel-hidden {
  display: none;
}

.manager-new-posts-banner {
  position: relative;
  flex: 0 0 auto;
  z-index: 1;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.9rem var(--rs-tweet-pad-x);
  border: none;
  border-bottom: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
  border-radius: 0;
  background: var(--saito-primary, var(--saito-primary-color, #4a90d9));
  color: var(--saito-font-color-inverse, #fff);
  font-family: var(--saito-font-heavy, var(--saito-font));
  font-size: var(--rs-body-sm, 1.4rem);
  text-align: center;
  cursor: pointer;
  box-sizing: border-box;
}

.manager-new-posts-banner-hidden {
  display: none;
}

.manager-new-posts-banner:hover {
  filter: brightness(1.05);
}

article.tweet.tweet-enter {
  animation: manager-tweet-enter 0.45s ease forwards;
}

@keyframes manager-tweet-enter {
  from {
    opacity: 0;
    transform: translateY(-0.8rem) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.manager-feed-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  box-sizing: border-box;
}

.manager-feed-status-loader {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 7rem;
}

.manager-feed-status-loader .saito-loader {
  position: relative;
  width: 5.5rem;
  height: 5.5rem;
}

/* Contain the global pulse (::after translate -50%/-50% + fixed bg) inside the status. */
.manager-feed-status-loader .saito-loader::after {
  top: 50%;
  left: 50%;
  width: 3.5rem;
  height: 3.5rem;
  background-attachment: scroll;
}

.manager-feed-status-message {
  display: none;
  margin: 0;
  max-width: 24rem;
  text-align: center;
  font-size: var(--font-size-tiny);
  line-height: 1.4;
  color: var(--rs-text-muted, var(--saito-font-color-light));
}

/* content — scroll sentinel only; no empty/end copy */
.manager-feed-status[data-status='content'] {
  min-height: 2.4rem;
  padding: 1.2rem var(--rs-tweet-pad-x);
}

/* loading / empty / end — one visible status chrome */
.manager-feed-status[data-status='loading'],
.manager-feed-status[data-status='empty'],
.manager-feed-status[data-status='end'] {
  padding: 7rem var(--rs-tweet-pad-x) 5rem;
}

.manager-feed-status[data-status='loading'] .manager-feed-status-loader {
  display: flex;
}

/* Empty/end copy only — never alongside the spinner */
.manager-feed-status[data-status='empty'] .manager-feed-status-message,
.manager-feed-status[data-status='end'] .manager-feed-status-message {
  display: block;
}

.manager-feed-status[data-status='loading'] .manager-feed-status-message {
  display: none;
}

@media (max-width: 600px) {
  .manager-header {
    padding: 0 var(--rs-space-sm);
  }
}
/*
 * Compact New Post — lives in `.manager-header-actions`.
 * Color from .saito-button-primary; geometry owned here (not the 18rem CTA).
 */
body.redsquare-body .manager-header .new-post-button,
.manager-header .new-post-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  box-sizing: border-box;
  width: auto;
  max-width: none;
  min-width: 0;
  min-height: 0;
  height: 3.2rem;
  margin: 0;
  padding: 0 1.1rem;
  border-radius: var(--rs-radius-pill);
  font-size: var(--font-size-tiny);
  font-family: var(--saito-font-medium);
  letter-spacing: normal;
  text-transform: none;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

body.redsquare-body .manager-header .new-post-button i {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1;
}
.menu {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  padding-left: calc(var(--rs-nav-cube-center) - (var(--rs-nav-icon) / 2));
  user-select: none;
}

.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

.menu-item {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: var(--rs-nav-icon) minmax(0, 1fr);
  align-items: center;
  column-gap: var(--rs-nav-gap);
  width: 100%;
  min-height: var(--rs-nav-min-height);
  padding: var(--rs-nav-item-y) var(--rs-nav-item-x);
  padding-left: calc(
    var(--rs-nav-wordmark-start) - var(--rs-nav-cube-center) - (var(--rs-nav-icon) / 2) - var(--rs-nav-gap)
  );
  border: var(--border-thickness-thin, 1px) solid transparent;
  border-radius: var(--rs-radius-pill);
  box-sizing: border-box;
  cursor: pointer;
  transition:
    color var(--rs-transition),
    border-color var(--rs-transition);
}

/* Highlight extends to cube-logo left edge; icon/label position unchanged */
.menu-item::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: calc(-1 * var(--rs-nav-hover-inset));
  border-radius: var(--rs-radius-pill);
  background: transparent;
  z-index: -1;
  transition: background-color var(--rs-transition);
}

.menu-list.saito-menu-select-subtle > .menu-item:not(.disabled-option):hover {
  background-color: transparent;
}

.menu-item:not(.disabled-option):hover::before {
  background-color: var(--saito-surface-selected);
}

.menu-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--rs-nav-icon);
  height: var(--rs-nav-icon);
  flex-shrink: 0;
  justify-self: center;
}

.menu-icon i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: var(--rs-nav-icon);
  line-height: 1;
  text-align: center;
}

.menu-icon i::before {
  -webkit-text-stroke: var(--saito-font-color) 1px;
  color: transparent;
  font-size: smaller;
  transition: -webkit-text-stroke-color var(--rs-transition);
}

.menu-label {
  display: flex;
  align-items: center;
  min-height: var(--rs-nav-icon);
  font-size: var(--rs-nav-label);
  line-height: 1.1;
}

.menu-item:hover .menu-icon i::before {
  -webkit-text-stroke-color: var(--saito-font-color-heavy);
}

.menu-item.active {
  font-family: var(--saito-font-heavy);
}

.menu-item.active .menu-icon i::before {
  -webkit-text-stroke: var(--saito-font-color-heavy) 2px;
  color: transparent;
}

/*
 * Notification badge — menu-specific component; inherits saito-notification-dot
 * semantics but sized and positioned for the bell icon rail.
 */
.menu-icon .menu-badge {
  position: absolute;
  top: -0.3rem;
  right: -0.55rem;
  left: auto;
  min-width: 2.1rem;
  min-height: 2.1rem;
  padding: 0 0.5rem;
  border-radius: var(--saito-radius-full, 999px);
  background-color: var(--saito-notification-bg);
  color: var(--saito-notification-fg);
  border: var(--border-thickness-medium, 2px) solid var(--saito-background-color);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  z-index: 2;
  pointer-events: none;
}

@media (max-width: 1200px) {
  .menu {
    padding-left: 0;
    align-items: flex-end;
  }

  .menu-item {
    display: flex;
    justify-content: flex-end;
    padding: var(--rs-nav-item-y) var(--rs-space-sm);
    min-height: var(--rs-nav-min-height);
  }

  .menu-item::before {
    left: 0;
  }

  .menu-label {
    display: none;
  }

  .menu-icon .menu-badge {
    top: -0.2rem;
    right: -0.4rem;
    min-width: 1.95rem;
    min-height: 1.95rem;
    font-size: 1.2rem;
  }
}
.notification {
  border-bottom: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
  cursor: pointer;
  transition: background-color var(--rs-transition);
}

.notification:hover {
  background: var(--rs-surface-hover);
}

.notification:last-child {
  border-bottom: none;
}

.notification-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  column-gap: var(--rs-space-sm);
  padding: var(--rs-tweet-pad-y) var(--rs-tweet-pad-x) var(--rs-space-xs);
}

.notification-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: var(--saito-font-color-secondary);
  font-size: var(--font-size-tiny);
  line-height: 1;
}

.notification-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  min-width: 0;
}

.notification-actor {
  font-family: var(--saito-font-medium);
  font-size: var(--font-size-medium);
  color: var(--saito-font-color-heavy);
}

.notification-text {
  font-size: var(--font-size-medium);
  color: var(--saito-font-color);
}

.notification-time {
  font-size: var(--font-size-tiny);
  color: var(--saito-font-color-secondary);
}

.notification-tweet {
  padding: 0 var(--rs-tweet-pad-x) var(--rs-tweet-pad-y);
}

.notification-tweet .tweet {
  border-bottom: none;
  padding-top: 0;
  cursor: inherit;
}

.notification-tweet .tweet:hover {
  background: transparent;
}

@media (max-width: 600px) {
  .notification-meta,
  .notification-tweet {
    padding-left: var(--rs-space-sm);
    padding-right: var(--rs-space-sm);
  }
}
/*
 * Tweet gallery — dedicated content region for image grids (1–4 images).
 * Parent: .tweet-gallery.count-N > .tweet-gallery-grid > .tweet-gallery-item
 */

.tweet-gallery {
  margin-top: var(--rs-tweet-block-gap);
  width: 100%;
  min-width: 0;
}

.tweet-gallery-grid {
  display: grid;
  gap: var(--rs-gap-tight);
  border-radius: var(--rs-radius-media);
  overflow: hidden;
}

.tweet-gallery-item {
  position: relative;
  margin: 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--rs-layer-recessed);
}

.tweet-gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Single image — wide landscape frame, crops gracefully */
.tweet-gallery.count-1 .tweet-gallery-grid {
  display: block;
}

.tweet-gallery.count-1 .tweet-gallery-item {
  aspect-ratio: 16 / 9;
  max-height: 30rem;
}

.tweet-gallery.count-1 .tweet-gallery-item img {
  min-height: 12rem;
}

/* Two images — equal columns */
.tweet-gallery.count-2 .tweet-gallery-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 24rem;
}

.tweet-gallery.count-2 .tweet-gallery-item {
  min-height: 12rem;
}

/* Three images — tall left panel, two stacked on the right */
.tweet-gallery.count-3 .tweet-gallery-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  max-height: 26rem;
}

.tweet-gallery.count-3 .tweet-gallery-item:first-child {
  grid-row: 1 / 3;
}

/* Four images — balanced 2×2 grid */
.tweet-gallery.count-4 .tweet-gallery-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  max-height: 26rem;
}

.tweet-gallery.count-4 .tweet-gallery-item {
  min-height: 10rem;
}

/* Focused variant — taller gallery ceiling */
.tweet.focused .tweet-gallery.count-1 .tweet-gallery-item,
.tweet-gallery.focused.count-1 .tweet-gallery-item {
  max-height: 36rem;
}

.tweet.focused .tweet-gallery.count-2 .tweet-gallery-grid,
.tweet.focused .tweet-gallery.count-3 .tweet-gallery-grid,
.tweet.focused .tweet-gallery.count-4 .tweet-gallery-grid,
.tweet-gallery.focused.count-2 .tweet-gallery-grid,
.tweet-gallery.focused.count-3 .tweet-gallery-grid,
.tweet-gallery.focused.count-4 .tweet-gallery-grid {
  max-height: 32rem;
}

/* Embedded tweets — proportionally smaller gallery */
.tweet.embedded .tweet-gallery.count-1 .tweet-gallery-item,
.tweet.tweet-embedded .tweet-gallery.count-1 .tweet-gallery-item,
.tweet-gallery.embedded.count-1 .tweet-gallery-item {
  max-height: 18rem;
}

.tweet.embedded .tweet-gallery.count-2 .tweet-gallery-grid,
.tweet.embedded .tweet-gallery.count-3 .tweet-gallery-grid,
.tweet.embedded .tweet-gallery.count-4 .tweet-gallery-grid,
.tweet.tweet-embedded .tweet-gallery.count-2 .tweet-gallery-grid,
.tweet.tweet-embedded .tweet-gallery.count-3 .tweet-gallery-grid,
.tweet.tweet-embedded .tweet-gallery.count-4 .tweet-gallery-grid,
.tweet-gallery.embedded.count-2 .tweet-gallery-grid,
.tweet-gallery.embedded.count-3 .tweet-gallery-grid,
.tweet-gallery.embedded.count-4 .tweet-gallery-grid {
  max-height: 16rem;
}
/*
 * Compose overlay — new post + reply composer.
 *
 * Panel chrome (background, border, radius, shadow) and the close button are
 * inherited from the standard SaitoOverlay conventions (saito-overlay.css).
 * This file only lays out the compose content.
 *
 * Shared horizontal rhythm with tweets:
 *   body pad-x == tweet pad-x; reply-preview tweets drop their own pad-x
 *   so parent + composer avatars share one vertical axis.
 */

.saito-overlay .compose-overlay {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(54rem, 92vw);
  max-height: min(88vh, 72rem);
  overflow: hidden;
}

.compose-overlay-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: var(--rs-space-lg) var(--rs-tweet-pad-x);
  overflow-y: auto;
}

/*
 * Reply preview — the tweet being replied to, rendered by the Tweet template.
 * Horizontal padding is stripped so the tweet avatar aligns with .compose-composer.
 */
.compose-reply-preview {
  max-height: min(32vh, 26rem);
  overflow-y: auto;
  margin: 0 calc(-1 * var(--rs-tweet-pad-x));
  padding: 0 var(--rs-tweet-pad-x) var(--rs-space-md);
  border-bottom: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
}

.compose-reply-preview article.tweet {
  --tweet-current-pad-x: 0;
  pointer-events: none;
  cursor: default;
  border-bottom: none;
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
  padding-bottom: var(--rs-tweet-pad-y);
  background: transparent;
}

.compose-reply-preview article.tweet:hover {
  background: transparent;
}

/* Composer block — same avatar | content grid as .tweet */
.compose-composer {
  display: grid;
  grid-template-columns: var(--rs-avatar-m) minmax(0, 1fr);
  column-gap: var(--rs-tweet-header-gap);
  align-items: start;
  padding-top: var(--rs-space-lg);
}

.compose-overlay--reply .compose-composer,
.compose-overlay--retweet .compose-composer {
  padding-top: var(--rs-space-xl);
}

.compose-author-avatar {
  grid-column: 1;
  width: var(--rs-avatar-m);
  height: var(--rs-avatar-m);
  border-radius: var(--rs-avatar-radius);
  object-fit: cover;
}

body.redsquare-body .compose-author-avatar.saito-identicon {
  width: var(--rs-avatar-m);
  height: var(--rs-avatar-m);
  border-radius: var(--rs-avatar-radius);
}

.compose-composer-main {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

/* Compose reuses TweetHeader — stacked name + instructional second line. */
.compose-composer .tweet-header.compose {
  flex-direction: column;
  justify-content: flex-start;
  align-self: start;
  gap: 0.15rem;
  min-height: 0;
}

body.redsquare-body .compose-composer .tweet-header.compose .tweet-header-primary {
  font-size: var(--font-size-medium);
  line-height: 1.25;
}

body.redsquare-body .compose-composer .tweet-header.compose .tweet-header-secondary {
  margin: 0;
  font-size: var(--font-size-tiny);
  line-height: 1.35;
  color: var(--rs-text-muted);
  white-space: normal;
}

.compose-surface {
  display: flex;
  flex-direction: column;
  gap: var(--rs-space-xs);
  padding: var(--rs-space-sm);
  border: var(--border-thickness-thin, 1px) solid var(--rs-input-border, var(--rs-border-subtle));
  border-radius: var(--rs-input-radius, var(--rs-radius));
  background: var(--rs-input-bg, var(--rs-layer-recessed));
  transition: border-color var(--rs-transition);
}

.compose-surface:focus-within {
  border-color: var(--rs-input-border-focus, var(--rs-border));
  box-shadow: none;
}

.compose-input {
  display: block;
  width: 100%;
  min-height: 8rem;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--rs-input-fg, var(--saito-input-fg));
  font-size: inherit;
  line-height: 2rem;
  resize: vertical;
}

.compose-input::placeholder {
  color: var(--rs-input-placeholder, var(--saito-input-placeholder));
}

.compose-input:focus {
  outline: none;
  border: none;
  box-shadow: none;
  background: transparent;
}

.compose-image-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: var(--rs-gap-tight);
}

.compose-image-preview:empty {
  display: none;
}

.compose-image-item {
  position: relative;
  margin: 0;
  aspect-ratio: 1;
  border-radius: var(--rs-radius-sm);
  overflow: hidden;
  border: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
}

.compose-image-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compose-image-remove {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: var(--rs-radius-pill);
  background: color-mix(in srgb, var(--saito-background-color) 80%, transparent);
  color: var(--rs-text-strong);
  cursor: pointer;
}

.compose-image-remove:hover {
  background: var(--rs-surface-hover);
}

.compose-gif-placeholder {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--rs-space-sm);
  padding: var(--rs-space-xs) var(--rs-space-sm);
  border-radius: var(--rs-radius-sm);
  border: var(--border-thickness-thin, 1px) dashed var(--rs-border-subtle);
  color: var(--rs-text-muted);
  font-size: var(--font-size-tiny);
}

.compose-gif-placeholder.visible {
  display: flex;
}

.compose-gif-placeholder p {
  margin: 0;
}

.compose-gif-dismiss {
  flex-shrink: 0;
  color: var(--rs-accent);
  cursor: pointer;
}

/* Footer — tools bottom-left, character count + Post bottom-right */
.compose-overlay-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--rs-space-sm);
  padding: var(--rs-space-sm) var(--rs-tweet-pad-x) var(--rs-space-md);
  border-top: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
}

/* Icon tools follow the tweet-controls pattern (divs, not global buttons) */
.compose-tools {
  display: flex;
  align-items: center;
  gap: var(--rs-space-xs);
  min-width: 0;
  color: var(--rs-text-muted);
}

.compose-tool {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--rs-icon-btn, 3.4rem);
  height: var(--rs-icon-btn, 3.4rem);
  border-radius: var(--rs-radius-pill);
  color: inherit;
  cursor: pointer;
  transition:
    background var(--rs-transition),
    color var(--rs-transition);
}

.compose-tool i {
  font-size: 1.65rem;
  line-height: 1;
}

.compose-tool:hover {
  background: var(--rs-surface-hover);
  color: var(--rs-text-strong);
}

.compose-footer-actions {
  display: flex;
  align-items: center;
  gap: var(--rs-space-md);
  flex-shrink: 0;
}

.compose-char-count {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  font-size: var(--font-size-tiny);
  color: var(--rs-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: color var(--rs-transition);
}

.compose-char-count.warning {
  color: var(--rs-accent);
}

.compose-char-separator {
  opacity: 0.75;
}

.compose-submit {
  position: relative;
  min-width: 11rem;
  min-height: var(--rs-nav-post-height, 4.4rem);
  border-radius: var(--rs-radius-pill);
}

.compose-submit-spinner {
  display: none;
  width: 1.6rem;
  height: 1.6rem;
  border: 2px solid color-mix(in srgb, var(--saito-button-primary-fg) 35%, transparent);
  border-top-color: var(--saito-button-primary-fg);
  border-radius: 50%;
  animation: compose-submit-spin 0.8s linear infinite;
}

.compose-overlay--posting .compose-submit-label {
  opacity: 0;
}

.compose-overlay--posting .compose-submit-spinner {
  display: inline-block;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.compose-posting-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--rs-space-sm);
  background: color-mix(in srgb, var(--saito-overlay-panel-bg) 82%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 2;
}

.compose-overlay--posting .compose-posting-screen {
  opacity: 1;
  pointer-events: auto;
}

.compose-posting-loader {
  width: 4rem;
  height: 4rem;
}

.compose-posting-loader .saito-loader {
  width: 100%;
  height: 100%;
}

.compose-posting-loader .saito-loader::after {
  width: 2.8rem;
  height: 2.8rem;
}

.compose-posting-message {
  margin: 0;
  font-size: var(--font-size-tiny);
  color: var(--rs-text-muted);
}

@keyframes compose-submit-spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@media (max-width: 600px) {
  .saito-overlay .compose-overlay {
    width: 100%;
    max-height: 100vh;
  }

  .compose-overlay-body {
    padding: var(--rs-space-md) var(--rs-tweet-pad-x);
  }

  .compose-overlay-footer {
    padding: var(--rs-space-sm) var(--rs-tweet-pad-x) var(--rs-space-md);
  }

  .compose-submit {
    min-width: 9.5rem;
  }
}
.settings {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: var(--rs-canvas);
}

.settings-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: var(--rs-feed-y) var(--rs-feed-x);
  border-bottom: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
  background: var(--rs-canvas);
}

.settings-header h2 {
  margin: 0;
  font-family: var(--saito-font-heavy);
  font-size: var(--rs-heading);
  font-weight: normal;
  line-height: 1.2;
  color: var(--rs-text-strong);
}

.settings-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.settings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--rs-space-sm);
  padding: var(--rs-space-sm) var(--rs-feed-x);
  border-bottom: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
  transition: background var(--rs-transition);
}

.settings-item:hover {
  background: var(--rs-surface-hover);
}

.settings-item:last-child {
  border-bottom: none;
}

@media (max-width: 600px) {
  .settings-header,
  .settings-item {
    padding-left: var(--rs-space-sm);
    padding-right: var(--rs-space-sm);
  }
}
.composer {
  display: flex;
  align-items: flex-start;
  gap: var(--rs-space-sm);
  padding: var(--rs-feed-y) var(--rs-feed-x);
  border-bottom: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
}

.saito-overlay .composer {
  border-bottom: none;
  padding: var(--rs-space-md) var(--rs-space-md) var(--rs-space-lg);
  width: min(56rem, 92vw);
}

.composer-avatar {
  width: var(--rs-avatar-m);
  height: var(--rs-avatar-m);
  border-radius: var(--rs-avatar-radius);
  border: none;
  object-fit: cover;
  flex-shrink: 0;
}

.composer-body {
  flex: 1;
  min-width: 0;
}

.composer-surface {
  display: flex;
  flex-direction: column;
  border: var(--border-thickness-thin, 1px) solid var(--rs-input-border, var(--rs-border-subtle));
  border-radius: var(--rs-input-radius, var(--rs-radius));
  background: var(--rs-input-bg, var(--rs-layer-recessed));
  overflow: hidden;
  transition: border-color var(--rs-transition);
}

.composer-surface:focus-within {
  border-color: var(--rs-input-border-focus, var(--rs-border));
  background: var(--rs-input-bg, var(--rs-layer-recessed));
  box-shadow: none;
}

.composer-input {
  display: block;
  width: 100%;
  min-height: var(--rs-composer-min-height);
  padding: var(--rs-space-sm) var(--rs-space-sm) var(--rs-space-xs);
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--rs-input-fg, var(--saito-input-fg));
  font-size: inherit;
  line-height: 2rem;
  resize: none;
}

.composer-input::placeholder {
  color: var(--rs-input-placeholder, var(--saito-input-placeholder));
}

.composer-input:focus {
  outline: none;
  border: none;
  box-shadow: none;
  background: transparent;
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--rs-space-sm);
  padding: var(--rs-space-xs) var(--rs-space-sm) var(--rs-space-sm);
  border-top: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
}

.composer-tools {
  display: flex;
  align-items: center;
  gap: var(--rs-gap-tight);
  flex: 1;
  min-width: 0;
}

.composer-tool {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--rs-icon-btn);
  height: var(--rs-icon-btn);
  padding: 0;
  border: none;
  border-radius: var(--rs-radius-pill);
  background: transparent;
  cursor: pointer;
  transition: background var(--rs-transition);
}

.composer-tool i {
  font-size: inherit;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: var(--saito-font-color-secondary) 1px;
  transition: -webkit-text-stroke-color var(--rs-transition);
}

.composer-tool:hover {
  background: var(--rs-surface-hover);
}

.composer-tool:hover i {
  -webkit-text-stroke-color: var(--saito-font-color-heavy);
}

.composer-submit {
  flex-shrink: 0;
  min-width: 7.5rem;
  border-radius: var(--rs-radius-pill);
}

.compose-image-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
  gap: var(--rs-gap-tight);
  padding: 0 var(--rs-space-sm) var(--rs-space-sm);
}

.compose-image-preview:empty {
  display: none;
}

.compose-image-item {
  position: relative;
  margin: 0;
  aspect-ratio: 1;
  border-radius: var(--rs-radius);
  overflow: hidden;
  border: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
}

.compose-image-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compose-image-remove {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border: none;
  border-radius: var(--rs-radius-pill);
  background: color-mix(in srgb, var(--rs-canvas) 72%, transparent);
  color: var(--rs-text-strong);
  cursor: pointer;
}

.compose-image-remove:hover {
  background: var(--rs-surface-hover);
}

.compose-gif-placeholder {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--rs-space-sm);
  margin: 0 var(--rs-space-sm) var(--rs-space-sm);
  padding: var(--rs-space-sm);
  border-radius: var(--rs-radius);
  border: var(--border-thickness-thin, 1px) dashed var(--rs-border-subtle);
  color: var(--rs-text-muted, var(--saito-font-color-light));
  font-size: var(--rs-body-sm, 1.4rem);
}

.compose-gif-placeholder.visible {
  display: flex;
}

.compose-gif-placeholder p {
  margin: 0;
}

.compose-gif-dismiss {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--saito-primary);
  cursor: pointer;
  font-size: inherit;
}

.compose-char-count {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
  font-size: var(--rs-body-sm, 1.35rem);
  color: var(--rs-text-muted, var(--saito-font-color-light));
  transition: color var(--rs-transition);
}

.compose-char-count.warning {
  color: var(--saito-primary);
}

.compose-char-separator {
  opacity: 0.72;
}

@media (max-width: 600px) {
  .composer {
    gap: var(--rs-space-xs);
    padding: var(--rs-feed-y) var(--rs-space-sm);
  }

  .saito-overlay .composer {
    padding: var(--rs-space-sm);
    width: 100%;
  }

  .composer-input {
    min-height: 4.5rem;
    padding: var(--rs-space-sm);
  }

  .composer-submit {
    min-width: 6.8rem;
  }
}
/*
 * Tweet options popover — contextual menu (div rows inside saito-menu-select-subtle).
 * Panel chrome only; row hover inherits from saito-buttons.css (.saito-menu-select-subtle).
 */

.tweet-tool-more {
  transition:
    transform 0.2s ease,
    color var(--rs-transition),
    background-color var(--rs-transition);
}

.tweet-tool-more.active {
  transform: scale(1.12);
  color: var(--rs-text-strong);
  background: color-mix(in srgb, var(--rs-layer-hover) 75%, transparent);
}

.tweet-menu {
  position: fixed;
  z-index: 120;
  min-width: 22rem;
  padding: var(--rs-space-xs);
  border: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
  border-radius: var(--rs-radius);
  background: var(--rs-layer-overlay, var(--saito-overlay-panel-bg));
  box-shadow:
    0 0.8rem 2.4rem color-mix(in srgb, var(--saito-background-color) 55%, transparent),
    0 0.2rem 0.6rem color-mix(in srgb, var(--saito-background-color) 35%, transparent);
  opacity: 0;
  transform: translateY(-0.35rem) scale(0.98);
  transform-origin: top right;
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
  pointer-events: auto;
}

.tweet-menu.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.tweet-menu-item {
  display: flex;
  align-items: center;
  gap: var(--rs-space-md);
  width: 100%;
  min-height: 4.4rem;
  padding: 0 var(--rs-space-md);
  border-radius: calc(var(--rs-radius) - 0.2rem);
  color: var(--rs-text);
  font-family: var(--saito-font);
  font-size: var(--font-size-medium);
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.tweet-menu-item:focus-visible {
  outline: none;
  box-shadow: var(--saito-focus-ring);
}

.tweet-menu-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2rem;
  color: var(--rs-text-muted);
  font-size: var(--font-size-medium);
}

.tweet-menu-item:hover .tweet-menu-icon,
.tweet-menu-item:focus-visible .tweet-menu-icon {
  color: var(--rs-text-strong);
}

.tweet-menu-label {
  flex: 1;
  min-width: 0;
}
/*
 * Chat Manager embed — presentation only.
 * Chat owns chat via respondTo('chat-manager'); RedSquare mounts it in `.sidebar-left`.
 *
 * Preferred earlier RedSquare look: tighter rows, 38px avatars, cleaner hierarchy.
 * Keep Chat's unread .saito-notification-dot badge; do not restyle it away.
 */

body.redsquare-body .sidebar-left > .chat-manager {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: var(--rs-layer-recessed);
  border: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
  border-radius: var(--rs-radius);
  overflow: hidden;
  box-sizing: border-box;
  /* Override global chat-manager grid for sidebar density */
  grid-template-rows: none;
}

body.redsquare-body .sidebar-left .chat-manager-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--rs-space-xs);
  margin: 0;
  padding: 0.8rem var(--rs-sidebar-pad) 0.4rem;
  min-height: 0;
  color: var(--rs-text-strong, var(--saito-font-color-heavy));
  text-transform: none;
}

body.redsquare-body .sidebar-left .chat-manager-title {
  font-family: var(--saito-font-heavy);
  font-size: var(--rs-section-title);
  font-weight: normal;
  letter-spacing: normal;
  text-transform: none;
  color: inherit;
}

/* Overlay/mobile chrome — hide when Chat Manager is sidebar-embedded */
body.redsquare-body .sidebar-left .chat-manager .close-chat-manager,
body.redsquare-body .sidebar-left .chat-manager .alternate-close-button {
  display: none;
}

body.redsquare-body .sidebar-left .chat-manager-options {
  color: var(--rs-text-muted, var(--saito-font-color-secondary));
  cursor: pointer;
}

body.redsquare-body .sidebar-left .chat-manager-list,
body.redsquare-body .sidebar-left .chat-manager-list.saito-sidebar-element {
  margin: 0;
  padding: 0.2rem 0;
  border: none;
  border-radius: 0;
  background: transparent;
  max-height: none;
  min-height: 0;
  overflow: visible;
  gap: 0;
}

/* Tighter chat rows — preferred earlier density; keep unread badge */
body.redsquare-body .sidebar-left .chat-manager-list .saito-user {
  grid-template-columns: var(--rs-avatar-m) minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 0.8rem;
  row-gap: 0.1rem;
  min-height: 0;
  margin: 0;
  padding: 0.55rem var(--rs-sidebar-pad);
  border-radius: 0;
  overflow: hidden;
  transition: background var(--rs-transition);
}

body.redsquare-body .sidebar-left .chat-manager-list .saito-user:hover {
  background: var(--rs-surface-hover);
}

body.redsquare-body .sidebar-left .chat-manager-list .saito-identicon-box {
  width: var(--rs-avatar-m);
  height: var(--rs-avatar-m);
  overflow: hidden;
  flex-shrink: 0;
}

body.redsquare-body .sidebar-left .chat-manager-list .saito-identicon-box .saito-identicon,
body.redsquare-body .sidebar-left .chat-manager-list .saito-identicon {
  width: var(--rs-avatar-m);
  height: var(--rs-avatar-m);
  border-radius: var(--rs-avatar-radius);
  object-fit: cover;
}

body.redsquare-body .sidebar-left .chat-manager-list .saito-address {
  min-width: 0;
  max-width: 100%;
  align-self: end;
  font-size: var(--font-size-tiny);
  font-weight: 500;
  line-height: 1.25;
  color: var(--rs-text-strong, var(--saito-font-color-heavy));
}

body.redsquare-body .sidebar-left .chat-manager-list .chat-group-name {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.redsquare-body .sidebar-left .chat-manager-list .saito-userline {
  font-size: 1.25rem;
  line-height: 1.3;
  height: auto;
  color: var(--rs-text-muted, var(--saito-font-color-secondary));
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

body.redsquare-body .sidebar-left .chat-manager-list .saito-chat-notifications {
  align-self: center;
}

/* Unread badge — keep Chat's native .saito-notification-dot */
body.redsquare-body .sidebar-left .chat-manager-list .saito-notification-dot {
  display: flex;
}

body.redsquare-body .sidebar-left .chat-manager-list .online-status-indicator:after,
body.redsquare-body .sidebar-left .chat-manager-list .stun .online-status-indicator i {
  top: calc(var(--rs-avatar-m) - 0.15rem);
  left: calc(var(--rs-avatar-m) - 0.15rem);
}

@media (max-width: 1200px) {
  /*
   * Narrow left column — nav icons stay; Chat Manager needs horizontal room
   * and is suppressed here (same breakpoint as production RedSquare).
   */
  body.redsquare-body .sidebar-left > .chat-manager {
    display: none;
  }
}
.profile {
  margin: 0;
}

/*
 * Profile card — compact sidebar unit (Twitter/X-like).
 *
 * Cascade owners this file must neutralize:
 *   .saito-profile-banner          → aspect-ratio padding box (saito-profile.css)
 *   .saito-profile-description     → flex:1 + lateral margins (saito-profile.css)
 *   .profile-public-key            → width:fit-content (saito-header.css)
 *   button / .profile-copy-key     → min 18rem×4.5rem (saito-buttons.css)
 *
 * Identity overlap uses ONE method: raise the row, pad text to clear the seam.
 * Do not also align-items:end — a tall text cell cancels the overlap.
 */
.profile-card {
  display: flex;
  flex-direction: column;
  overflow: visible;
  background: var(--rs-layer-base);
  border: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
  border-radius: var(--rs-radius);
  margin-bottom: 0;
}

/* Header strip — prior balanced height; avatar owns the identity mark */
.profile-banner,
.profile-card .saito-profile-banner {
  position: relative;
  flex: 0 0 auto;
  height: 8.5rem;
  padding-top: 0;
  margin: 0;
  overflow: hidden;
  border: none;
  border-bottom: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
  border-top-left-radius: var(--rs-radius);
  border-top-right-radius: var(--rs-radius);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background-color: var(--rs-layer-recessed);
  background-image: url(/saito/img/dreamscape.png);
  background-size: cover;
  background-position: center;
  box-sizing: border-box;
}

.profile-card .saito-banner-edit {
  margin-left: 0;
  right: 0.6rem;
  bottom: 0.6rem;
  position: absolute;
  z-index: 2;
  color: var(--saito-white, #fff);
  text-shadow: 1px 1px 4px var(--saito-black, #000);
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
}

/*
 * Body: no horizontal pad on the container — identity/bio inset,
 * nav full-bleed so its rules share the card edge with the banner.
 */
.profile-body {
  display: flex;
  flex-direction: column;
  padding: 0;
  border-bottom-left-radius: var(--rs-radius);
  border-bottom-right-radius: var(--rs-radius);
  background: var(--rs-layer-base);
  overflow: visible;
}

/*
 * ~32% of avatar into the banner (lower = more below the seam so name + key
 * sit inside the avatar’s vertical span). Text pad tracks that overlap, plus
 * 0.15rem so the display name clears the banner by ~4px of breathing room.
 */
.profile-identity {
  display: grid;
  grid-template-columns: var(--rs-avatar-l) minmax(0, 1fr);
  align-items: start;
  column-gap: var(--rs-space-sm);
  margin-top: calc(var(--rs-avatar-l) * -0.32);
  margin-bottom: var(--rs-space-sm);
  padding: 0 var(--rs-sidebar-pad);
  min-width: 0;
}

.profile-avatar {
  grid-column: 1;
  width: var(--rs-avatar-l);
  height: var(--rs-avatar-l);
  border-radius: var(--rs-avatar-radius);
  border: var(--border-thickness-medium, 2px) solid var(--rs-layer-base);
  background: var(--rs-layer-base);
  object-fit: cover;
  flex-shrink: 0;
  z-index: 1;
}

.profile-identity-text {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.1rem;
  min-width: 0;
  padding-top: calc(var(--rs-avatar-l) * 0.32 + 0.15rem);
  z-index: 1;
}

/* Display name — strongest voice in the card */
.profile-name {
  display: block;
  font-family: var(--saito-font-medium);
  font-size: var(--font-size-large);
  color: var(--saito-font-color-heavy);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Key + copy — one secondary line; copy must not inherit CTA min-* */
.profile-key-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  max-width: 100%;
  min-height: 2.2rem;
}

.profile-handle,
.profile-card .profile-public-key,
.profile-key-row .profile-public-key {
  display: block;
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  font-size: var(--font-size-tiny);
  color: var(--saito-font-color-secondary);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/*
 * Copy control — secondary affordance only. Must outrank Noir
 * `html[data-theme] button` (gradient + glow) or it paints primary orange.
 */
html[data-theme] body.redsquare-body .profile-copy-key,
body.redsquare-body .profile-copy-key {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 2.2rem;
  height: 2.2rem;
  min-width: 0;
  min-height: 0;
  max-width: 2.2rem;
  margin: 0;
  padding: 0;
  border: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle, rgba(255, 255, 255, 0.28));
  border-radius: var(--rs-radius-sm, var(--rs-radius));
  background: transparent;
  background-image: none;
  box-shadow: none;
  color: var(--saito-font-color-secondary);
  font-size: 1.2rem;
  font-weight: normal;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
  line-height: 1;
  transform: none;
  filter: none;
  transition:
    color var(--rs-transition),
    background-color var(--rs-transition),
    border-color var(--rs-transition);
}

html[data-theme] body.redsquare-body .profile-copy-key:hover,
html[data-theme] body.redsquare-body .profile-copy-key:focus-visible,
body.redsquare-body .profile-copy-key:hover,
body.redsquare-body .profile-copy-key:focus-visible {
  color: var(--saito-font-color-heavy);
  background: var(--rs-surface-hover, rgba(255, 255, 255, 0.08));
  background-image: none;
  border-color: var(--rs-border, rgba(255, 255, 255, 0.45));
  box-shadow: none;
  outline: none;
  transform: none;
  filter: none;
}

html[data-theme] body.redsquare-body .profile-copy-key:active,
body.redsquare-body .profile-copy-key:active {
  background: var(--rs-layer-raised, rgba(255, 255, 255, 0.1));
  background-image: none;
  box-shadow: none;
  transform: none;
  filter: none;
}

html[data-theme] body.redsquare-body .profile-copy-key i,
body.redsquare-body .profile-copy-key i {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1;
  color: inherit;
}

/* Bio — kill saito-profile flex:1 / lateral margins */
.profile-bio,
.profile-card .saito-profile-description {
  position: relative;
  flex: none;
  margin: 0;
  padding: 0 var(--rs-sidebar-pad) var(--rs-space-sm);
  font-size: var(--font-size-tiny);
  line-height: 1.4;
  color: var(--saito-font-color);
  overflow: hidden;
}

.profile-bio.profile-bio-empty:not(.can-edit) {
  display: none;
}

.profile-card .saito-profile-description.can-edit {
  display: grid;
  grid-template-columns: 1fr min-content;
  gap: 0.4rem;
  cursor: pointer;
  align-items: start;
}

.profile-card .saito-profile-description.can-edit.empty {
  display: block;
}

.profile-card .saito-description-edit {
  display: none;
  color: var(--saito-font-color-secondary);
  font-size: 1.4rem;
  line-height: 1;
  align-items: center;
  justify-content: center;
}

.profile-card .saito-profile-description.can-edit .saito-description-edit {
  display: flex;
}

.profile-card .saito-profile-description.can-edit.empty .saito-description-edit {
  display: block;
  width: 100%;
  border-bottom: none;
  color: var(--saito-font-color-secondary);
  font-size: var(--font-size-tiny);
  font-weight: normal;
  font-style: italic;
  line-height: 1.4;
}

/*
 * Destinations — full card width, tight strip under bio.
 * No default selection on the global timeline.
 */
.profile-nav {
  display: flex;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  border-top: var(--border-thickness-thin, 1px) solid var(--rs-border-subtle);
  background: transparent;
  box-sizing: border-box;
  border-bottom-left-radius: var(--rs-radius);
  border-bottom-right-radius: var(--rs-radius);
  overflow: hidden;
}

.profile-nav-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  margin: 0;
  padding: 0.9rem 0.4rem;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--saito-font-color-secondary);
  font-family: var(--saito-font);
  font-size: var(--font-size-tiny);
  font-weight: normal;
  letter-spacing: normal;
  line-height: 1.2;
  text-align: center;
  text-transform: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
  user-select: none;
  transition:
    color var(--rs-transition),
    background-color var(--rs-transition);
}

.profile-nav-item:hover {
  background: var(--rs-surface-hover);
  color: var(--saito-font-color-heavy);
}

.profile-nav-item:focus-visible {
  outline: none;
  color: var(--saito-font-color-heavy);
  box-shadow: inset 0 0 0 1px var(--rs-border);
}

.profile-nav-item.active {
  background: transparent;
  color: var(--saito-font-color-heavy);
  font-family: var(--saito-font-medium);
  box-shadow: inset 0 -0.2rem 0 0 var(--rs-text-strong);
}

.profile-nav-item.active:hover {
  background: var(--rs-surface-hover);
  color: var(--saito-font-color-heavy);
}
