/* ===================================================================
   3babees phone shell — app layout, separate from desktop.
   Loaded last. Applies only under 820px.
   =================================================================== */

@media (max-width: 819px) {
  :root {
    --ph-tabs: 58px;
    --ph-nav: calc(var(--ph-tabs) + env(safe-area-inset-bottom, 0px));
  }

  html, body {
    overflow-x: hidden;
  }

  .babees-app {
    max-width: none;
    min-height: 100dvh;
    /* Prefer measured --bb-dock-pad (dock + tabs); fallback keeps footer above chrome */
    padding: 0 0 var(--bb-dock-pad, calc(var(--bb-dock-h, 108px) + var(--ph-nav) + 24px)) !important;
  }

  .babees-credit {
    margin-top: 20px;
    padding: 18px 12px 14px;
  }
  .babees-foot-blurb {
    font-size: 0.76rem;
  }
  .babees-foot-explore a,
  .babees-foot-markets a {
    min-height: 34px;
  }

  .babees-app.is-compete,
  .babees-app.is-waiting {
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  }

  /* ---- Sticky app header ---- */
  html .babees-app > .babees-topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 45;
    margin: 0 !important;
    border-radius: 0 !important;
    border-inline: 0 !important;
    border-top: 0 !important;
    padding: calc(6px + env(safe-area-inset-top, 0px)) 12px 8px !important;
    background: color-mix(in srgb, var(--bb-ink, #070b16) 96%, transparent);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .babees-brand-sub { display: none; }
  .babees-brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .babees-hero-art { height: 104px; margin-bottom: 12px; border-radius: 16px; }
  .babees-brand-name { font-size: 1.05rem; letter-spacing: -0.02em; }
  .babees-topbar-actions { gap: 6px; }
  .babees-topbar-tools { gap: 2px; }
  .babees-icon-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }
  .babees-wallet-chip {
    min-height: 40px;
    padding: 4px 8px 4px 6px;
  }

  /* ---- Bottom navigation (thumb zone) ---- */
  html .babees-app .babees-tabs {
    position: fixed !important;
    z-index: 70;
    inset-inline: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    margin: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px));
    border-radius: 0;
    border-inline: 0;
    border-bottom: 0;
    border-top: 1px solid var(--bb-line, rgba(160, 174, 255, 0.22));
    background: color-mix(in srgb, var(--bb-ink, #070b16) 92%, transparent);
    backdrop-filter: blur(22px) saturate(1.35);
    -webkit-backdrop-filter: blur(22px) saturate(1.35);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.28);
  }

  .babees-app .babees-tabs .babees-tab {
    flex-direction: column;
    gap: 2px;
    min-height: 50px;
    padding: 6px 2px 4px;
    border-radius: 14px;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
  }

  .babees-app .babees-tabs .babees-tab span {
    display: block !important;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .babees-app .babees-tabs .babees-tab .bb-i {
    width: 20px;
    height: 20px;
  }

  .babees-app.is-compete .babees-tabs,
  .babees-app.is-waiting .babees-tabs {
    display: none !important;
  }

  /* Launch bar sits on top of the tab bar, not over the content. */
  html .babees-app .babees-dock {
    inset-inline: 0 !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: auto !important;
    max-width: none !important;
    bottom: var(--ph-nav) !important;
    z-index: 66;
  }

  html .babees-app .babees-dock-inner {
    grid-template-columns: 1fr !important;
    border-radius: 22px 22px 0 0 !important;
    border-inline: 0;
    padding: 12px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    gap: 10px;
  }

  .babees-app .babees-cta {
    width: 100%;
    min-height: 54px;
    border-radius: 16px;
    font-size: 1.05rem;
  }

  .babees-dock-status {
    gap: 8px;
  }

  .babees-dock-hint {
    text-align: start;
    font-size: 0.84rem;
    line-height: 1.35;
    -webkit-line-clamp: 2;
  }

  .babees-lobby-byline {
    font-size: 0.72rem;
    padding: 4px 10px;
  }

  /* ---- Lobby rhythm ---- */
  .babees-view { padding: 0 14px; }

  #babees-lobby {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  #babees-lobby > .babees-lobby-open { order: 0; }
  #babees-lobby > .babees-onboard { order: 0; }
  #babees-lobby > .babees-trial-strip { order: 1; }
  #babees-lobby > .babees-player-slim { order: 2; }
  #babees-lobby > .babees-team-row { order: 3; }
  #babees-lobby > #babees-play-mode { order: 4; }
  #babees-lobby > #babees-cats-host { order: 5; }
  #babees-lobby > .babees-tools-setup { order: 6; }
  #babees-lobby > .babees-lobby-more { order: 7; }

  .babees-lobby-open {
    margin: 8px 0 0;
    gap: 10px;
  }
  .babees-lobby-hero {
    min-height: 220px;
    border-radius: 22px;
  }
  .babees-lobby-hero-copy {
    padding: 18px 16px 16px;
    gap: 8px;
  }
  .babees-lobby-brand {
    font-size: 2.1rem;
  }
  .babees-lobby-title {
    font-size: 1.25rem;
  }
  .babees-lobby-lead {
    font-size: 0.88rem;
  }
  .babees-lobby-jump {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }
  .babees-host-strip {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }
  .babees-host-strip-cta {
    grid-column: 1 / -1;
    width: 100%;
  }

  .babees-hero-lobby .babees-hero-art {
    height: 96px;
    margin: 0;
    border-radius: 14px;
  }

  html .babees-app .babees-hero-lobby .babees-hero-kicker {
    display: block !important;
    margin: 0 0 2px;
  }

  html .babees-app .babees-hero-lobby .babees-hero-brand-name {
    display: block !important;
    margin: 0 0 4px;
    font-size: 1.35rem !important;
    line-height: 1.2;
    filter: none;
  }

  html .babees-app .babees-hero-lobby .babees-hero-lead {
    display: block !important;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--bb-dim, rgba(200, 210, 245, 0.78));
  }

  .babees-field-a,
  .babees-field-b {
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--bb-line);
    background: color-mix(in srgb, var(--bb-glass, rgba(16, 20, 40, 0.55)) 82%, transparent);
  }

  .babees-hero-title {
    font-size: 1.45rem;
    line-height: 1.2;
    margin: 8px 0 4px;
  }

  .babees-hero-lead {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .babees-player-slim {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
  }

  .babees-team-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 0;
  }

  .babees-seats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .babees-color-label { display: none; }

  .babees-input,
  .babees-app select.babees-input {
    font-size: 16px;
    min-height: 48px;
    border-radius: 14px;
  }

  .babees-mode-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .babees-mode-card {
    min-height: 64px;
    text-align: start;
    padding: 12px 14px;
    border-radius: 16px;
  }

  .babees-mode-card span { display: none; }

  #babees-play-mode-note { display: none; }

  .babees-panel {
    padding: 14px;
    border-radius: 18px;
    margin-bottom: 12px;
  }

  .babees-color-swatches { gap: 8px; }
  .babees-swatch {
    width: 28px;
    height: 28px;
  }

  /* Section chips stick under the header while browsing categories. */
  .babees-section-head {
    margin: 6px 0 4px;
  }

  .babees-cat-jump {
    position: sticky;
    top: var(--ph-head, calc(58px + env(safe-area-inset-top, 0px)));
    z-index: 35;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0 -14px 10px;
    padding: 8px 14px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    background: color-mix(in srgb, var(--bb-ink, #070b16) 92%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .babees-cat-jump::-webkit-scrollbar { display: none; }

  .babees-cat-jump-btn {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 0.8rem;
  }

  .babees-cat-section { margin-bottom: 16px; }

  .babees-cat-section-title { font-size: 1rem; }

  .babees-cat-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .babees-cat-card {
    min-height: 124px;
    aspect-ratio: auto;
    border-radius: 18px;
    text-align: start;
  }

  .babees-cat-desc,
  .babees-style-chip { display: none; }

  html .babees-app .babees-cat-name {
    font-size: 0.95rem !important;
    font-weight: 900;
    line-height: 1.3;
  }

  .babees-cat-icon {
    width: 42px;
    height: 42px;
  }

  .babees-trial-strip {
    margin-bottom: 12px;
    border-radius: 16px;
    flex-wrap: wrap;
  }
  .babees-trial-topup {
    width: 100%;
    justify-content: center;
  }

  /* Wallet, rank, chat: full-width cards, 16px fields */
  /* Wallet layout lives in the phone wallet block below. */

  .babees-chat-form {
    flex-direction: column;
  }

  .babees-chat-form .babees-name-input,
  .babees-chat-form .babees-input,
  .babees-chat-form .babees-btn {
    flex: 1 1 auto;
    width: 100%;
    min-height: 48px;
  }

  .babees-rank-head,
  .babees-rank-list {
    font-size: 0.82rem;
  }

  /* ---- Live match: stacked categories, usable host controls ---- */
  .babees-app.is-compete .babees-arena {
    gap: 10px;
    padding: 8px 12px calc(20px + env(safe-area-inset-bottom, 0px));
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden !important;
  }

  .babees-app.is-compete .babees-arena-main,
  .babees-app.is-compete .babees-rail {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
  }

  .babees-app.is-compete .babees-compete-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
  }
  .babees-app.is-compete .babees-compete-bar .babees-room-code-wrap {
    grid-column: 1 / -1;
    width: 100%;
  }
  .babees-app.is-compete .babees-compete-bar .babees-room-code {
    flex: 1 1 auto;
    width: auto;
    min-height: 44px;
    justify-content: center;
  }
  .babees-app.is-compete .babees-compete-bar .babees-room-code-toggle {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 8px 10px;
  }
  .babees-app.is-compete .babees-compete-bar .babees-room-code-toggle-lbl {
    display: none;
  }
  .babees-app.is-compete .babees-compete-bar .babees-turn-pill {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 46px;
    justify-content: center;
    text-align: center;
    font-size: 0.92rem;
    padding: 8px 12px;
    box-sizing: border-box;
  }
  .babees-app.is-compete .babees-compete-bar .babees-fs-btn,
  .babees-app.is-compete .babees-compete-bar .babees-leave-btn,
  .babees-app.is-compete .babees-compete-bar .babees-end-btn {
    min-height: 46px;
    width: 100%;
    justify-content: center;
    font-size: 0.8rem;
    padding: 0 8px;
    gap: 6px;
  }
  .babees-app.is-compete .babees-compete-bar .babees-leave-btn {
    border-color: rgba(255, 84, 112, 0.45);
    color: #ffb4c0;
  }
  /* Keep both labels so the row stays balanced (app.css hid end span). */
  .babees-app.is-compete .babees-compete-bar .babees-end-btn span {
    display: inline !important;
    font-size: 0.78rem;
  }

  /* Director: 2×3 grid of fat buttons — no cramped wrap row */
  .babees-app.is-compete .babees-director-bar {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    margin: 0 0 8px;
    border-radius: 16px;
  }
  .babees-app.is-compete .babees-director-label {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 800;
  }
  .babees-app.is-compete .babees-director-bar .babees-tool {
    min-height: 48px;
    width: 100%;
    justify-content: center;
    border-radius: 12px;
    font-size: 0.86rem;
    font-weight: 800;
    padding: 0 8px;
  }

  .babees-app.is-compete .babees-board-swipe-hint { display: none !important; }
  /* Tip folded from swipe-hint sits on the shell edge — hide like desktop. */
  .babees-app.is-compete .babees-board-shell > .babees-tip { display: none !important; }

  .babees-app.is-compete .babees-board-shell {
    flex: none !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 0 !important;
    overflow: hidden !important; /* clip turn glow / image bleed */
    padding: 12px !important;
    margin: 0;
    border-radius: 20px;
    /* Soft turn tint — no thick red edge bleed on RTL phones */
    border: 1px solid rgba(200, 210, 255, 0.16) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 16px 36px rgba(0, 0, 0, 0.28) !important;
  }
  .babees-app[data-turn="team_a"] .babees-board-shell {
    border-color: color-mix(in srgb, var(--bb-a) 28%, rgba(200, 210, 255, 0.14)) !important;
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--bb-a) 10%, transparent), transparent 42%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
      rgba(7, 10, 24, 0.55);
  }
  .babees-app[data-turn="team_b"] .babees-board-shell {
    border-color: color-mix(in srgb, var(--bb-b) 28%, rgba(200, 210, 255, 0.14)) !important;
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--bb-b) 10%, transparent), transparent 42%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
      rgba(7, 10, 24, 0.55);
  }
  .babees-app.is-compete .babees-board-shell::before { display: none !important; }

  .babees-app.is-compete .babees-board-grid {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    overflow: visible !important;
    scroll-snap-type: none !important;
    height: auto !important;
    min-height: 0 !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    gap: 10px;
    padding: 0 0 8px;
  }

  .babees-app.is-compete .babees-col {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    flex: none !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 12px !important;
    border-radius: 18px;
    overflow: hidden !important;
    scroll-snap-align: none;
    margin: 0;
  }

  /* Stop category photo from poking past rounded corners */
  .babees-app.is-compete .babees-col.has-image::before,
  .babees-app.is-compete .babees-col.has-image::after {
    border-radius: inherit;
    transform: none !important;
  }
  .babees-app.is-compete .babees-col.has-image[data-fit="contain"]::before {
    transform: none !important;
    filter: blur(10px) saturate(1.05) brightness(0.65);
  }

  .babees-app.is-compete .babees-col h4,
  .babees-app.is-compete .babees-col-style {
    grid-column: 1 / -1;
    min-height: 0;
    margin: 0;
    text-align: start;
    padding-inline: 2px;
  }

  .babees-app.is-compete .babees-col h4 {
    font-size: 0.98rem;
    display: block !important;
    -webkit-line-clamp: unset !important;
    overflow: visible !important;
    line-height: 1.4;
    padding-bottom: 4px;
    padding-inline: 2px 4px;
  }

  .babees-app.is-compete .babees-q-btn {
    min-height: 52px !important;
    height: auto !important;
    border-radius: 14px;
    padding: 7px 4px 5px;
    display: grid;
    place-content: center;
    gap: 2px;
  }

  .babees-app.is-compete .babees-q-pts {
    font-size: 1.28rem;
    font-weight: 900;
    line-height: 1;
  }
  .babees-app.is-compete .babees-q-slot {
    font-size: 0.68rem;
    opacity: 0.72;
    font-weight: 700;
  }

  /* Scores + tools: larger tap targets, less hint clutter */
  .babees-app.is-compete .babees-rail-tools {
    gap: 10px;
    padding-top: 4px;
  }
  .babees-app.is-compete .babees-tools-panel {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .babees-app.is-compete .babees-tools-panel .babees-tool,
  .babees-app.is-compete .babees-tools-panel button {
    min-height: 64px !important;
    height: auto !important;
    border-radius: 14px;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 8px 4px;
  }
  .babees-app.is-compete .babees-tools-hint {
    font-size: 0.72rem;
    line-height: 1.45;
    padding: 8px 10px;
    border-radius: 12px;
  }
  .babees-app.is-compete .babees-rail-panel h5 {
    font-size: 0.9rem;
    margin-bottom: 8px;
  }

  .babees-app.is-compete.is-local-mode .babees-arena {
    display: flex;
    flex-direction: column;
  }
  .babees-app.is-compete.is-local-mode .babees-rail-cams {
    order: 0;
    flex: none !important;
    height: auto !important;
    max-height: none !important;
  }
  .babees-app.is-compete.is-local-mode .babees-arena-main { order: 1; }
  .babees-app.is-compete.is-local-mode .babees-rail-tools { order: 2; }

  .babees-cinema-q {
    font-size: clamp(1.55rem, 6.4vw, 2.2rem);
    line-height: 1.35;
  }

  .babees-cinema-q.is-answer {
    font-size: clamp(1.55rem, 6.2vw, 2.35rem);
    line-height: 1.22;
    gap: 8px;
    padding: 4px 4px 10px;
  }
  .babees-cinema-q.is-answer.is-answer-short {
    font-size: clamp(1.85rem, 8vw, 2.7rem);
  }
  .babees-cinema-q.is-answer.is-answer-mid {
    font-size: clamp(1.45rem, 5.8vw, 2.15rem);
  }
  .babees-cinema-q.is-answer.is-answer-long {
    font-size: clamp(1.2rem, 4.6vw, 1.75rem);
  }
  .babees-cinema-q.is-answer.is-answer-xl {
    font-size: clamp(1.05rem, 4vw, 1.45rem);
  }

  .babees-cinema.is-answered .babees-cinema-stage {
    justify-content: flex-start;
    padding-top: 10px;
    gap: 8px;
  }

  .babees-cinema.is-answered .babees-cv-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px;
    width: 100%;
  }
  .babees-cinema.is-answered .babees-cv-pts {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: center;
  }
  .babees-cinema.is-answered .babees-cv-cat,
  .babees-cinema.is-answered .babees-cv-team {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .babees-cinema-inner {
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .babees-tip-pop:not([hidden]) {
    position: fixed;
    z-index: 74;
    inset-inline: 12px;
    top: auto;
    bottom: calc(var(--bb-dock-h, 0px) + var(--ph-nav) + 8px);
    width: auto;
    max-height: min(42dvh, 280px);
    overflow: auto;
    border-radius: 18px;
  }

  .babees-app.is-compete .babees-tip-pop:not([hidden]),
  .babees-app.is-waiting .babees-tip-pop:not([hidden]) {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .babees-help-dialog {
    width: 100%;
    max-height: min(92dvh, 900px);
    border-radius: 22px 22px 0 0;
    margin-top: auto;
  }

  .babees-help-sheet {
    align-items: end;
    padding: 0;
  }

  /* ---- Wallet: one column, nothing overlaps ---- */
  #babees-wallet {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  #babees-wallet > .babees-hero { display: none; }
  #babees-wallet > .babees-wallet-account { order: 8; margin: 0; }

  #babees-wallet .babees-wallet-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0;
  }

  #babees-wallet .babees-wallet-banner,
  #babees-wallet .babees-wallet-stat:has(#babees-wallet-balance),
  #babees-wallet .babees-currency-pick { grid-column: 1 / -1; }

  #babees-wallet .babees-wallet-stat:has(#babees-wallet-balance) > strong {
    font-size: 1.85rem;
    letter-spacing: -0.03em;
    color: var(--bb-text);
  }

  #babees-wallet .babees-wallet-stat > strong { color: var(--bb-text); font-size: 1.15rem; }

  #babees-wallet .babees-currency-pick .babees-input,
  #babees-topup-custom,
  #babees-code-input { font-size: 16px; min-height: 48px; }

  #babees-topup-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
  }

  #babees-wallet .babees-topup-opt {
    min-height: 68px;
    border-radius: 16px;
    color: var(--bb-text);
  }

  #babees-wallet .babees-topup-pay,
  #babees-wallet .babees-wallet-cols,
  #babees-wallet .babees-stripe-fast-more,
  #babees-wallet .babees-chat-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  #babees-pay-open,
  #babees-stripe-fast,
  #babees-code-btn { min-height: 52px; width: 100%; }

  #babees-wallet .babees-sub-grid,
  #babees-pack-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  #babees-wallet .babees-sub-card,
  #babees-wallet .babees-pack {
    min-height: 0;
    height: auto;
    width: auto;
    flex: none;
  }

  #babees-wallet .babees-sub-badge { position: static; }

  #babees-wallet .babees-panel-note {
    margin: 0 0 10px;
    color: var(--bb-dim);
    font-size: 0.84rem;
    line-height: 1.45;
  }

  #babees-wallet .babees-wallet-account-more > summary {
    list-style: none;
    cursor: pointer;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 900;
    color: var(--bb-text);
  }

  #babees-wallet .babees-wallet-account-more > summary::-webkit-details-marker { display: none; }
  #babees-wallet .babees-wallet-account-more > summary::after { content: "▾"; }
  #babees-wallet .babees-wallet-account-more[open] > summary::after { content: "▴"; }
  #babees-wallet .babees-profile-grid { grid-template-columns: 1fr; }

  /* Header stays on two rows so the points chip is never clipped. */
  html .babees-app > .babees-topbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 8px;
    row-gap: 8px;
  }

  html .babees-app > .babees-topbar .babees-brand { grid-column: 1; min-width: 0; }
  html .babees-app > .babees-topbar .babees-brand-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 12rem;
  }

  html .babees-app > .babees-topbar .babees-topbar-actions {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    justify-content: space-between;
    gap: 8px;
  }

  .babees-topbar-tools .babees-icon-btn,
  .babees-topbar-tools .babees-skin-open {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }

  .babees-session-btn {
    height: 36px;
    padding: 0 12px;
  }

  /* Join form is one column inside the open panel, without a second title. */
  .babees-lobby-more .babees-join-panel {
    margin-top: 0;
    padding: 0;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .babees-lobby-more .babees-join-panel h3 { display: none; }

  .babees-join-row {
    grid-template-columns: 1fr !important;
  }

  .babees-join-row .babees-btn { width: 100%; }

  .babees-tools-pick-grid,
  .babees-tools-pick-wait .babees-tools-pick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  /* Question screen: controls on one line, the category under them. */
  .babees-cinema-head {
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }

  .babees-cinema-close,
  .babees-timer,
  .babees-cinema-cam { order: 1; }

  .babees-cv-meta {
    order: 2;
    flex: 1 1 100%;
  }

  .babees-cv-cat { max-width: 100%; }

  .babees-console-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .babees-console-label {
    flex: none;
    width: auto;
  }

  .babees-console-verdict .babees-award-row {
    gap: 6px;
  }
  .babees-console-verdict .babees-award-row .babees-act {
    min-height: 58px;
    height: auto;
    padding: 7px 4px;
    gap: 2px;
  }

  .babees-award-name { font-size: 0.72rem; }
  .babees-award-pts { font-size: 0.98rem; }
  .babees-act.is-live-team {
    transform: none;
  }

  .babees-app.is-compete .babees-rail-tools .babees-score {
    min-height: 96px;
    padding: 10px 8px 12px;
  }
  .babees-app.is-compete .babees-rail-tools .babees-score.is-turn {
    overflow: visible;
  }

  .babees-app.is-compete .babees-rail-tools .babees-score strong {
    font-size: 1.85rem;
  }

  .babees-app.is-compete .babees-rail-tools .babees-score-live {
    font-size: 0.72rem;
    min-height: 22px;
    padding: 4px 10px;
    margin-bottom: 4px;
  }

  .babees-app.is-compete .babees-rail-tools .babees-score > span:not(.babees-score-live) {
    font-size: 0.86rem;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.25;
  }

  /* Auth / Stripe / gender sheets — full-width safe on phones */
  .babees-stripe-sheet,
  .babees-pay-modal .babees-pay-sheet,
  .babees-auth-modal .babees-auth-card,
  .babees-gender-card {
    width: min(100%, 440px);
    max-width: calc(100vw - 20px);
    margin-inline: auto;
    border-radius: 20px;
  }
  .babees-stripe-sheet {
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  }
  .babees-pay-fx-note,
  .babees-stripe-trust {
    font-size: 0.78rem;
    line-height: 1.45;
  }
  .babees-onboard {
    margin: 10px 0 0;
    padding: 11px 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .babees-onboard-main { gap: 8px; }
  .babees-onboard-steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .babees-onboard-steps li {
    width: 100%;
    box-sizing: border-box;
    white-space: normal;
    min-height: 40px;
    border-radius: 14px;
    padding: 8px 10px;
  }
  .babees-onboard-dismiss {
    margin-inline-start: 0;
    width: 100%;
    min-height: 42px;
    justify-content: center;
  }
  .babees-app.is-waiting .babees-waiting {
    padding-inline: 10px;
  }

  .babees-result {
    padding: 12px 10px calc(12px + env(safe-area-inset-bottom, 0px));
    align-items: end;
  }
  .babees-result-card {
    width: 100%;
    max-height: min(92dvh, 920px);
    overflow: auto;
    padding: 18px 14px 16px;
    border-radius: 22px 22px 18px 18px;
  }
  .babees-result-brand-name {
    font-size: 1.45rem;
  }
  .babees-result-icon {
    width: 68px;
    height: 68px;
  }
  .babees-result-actions {
    grid-template-columns: 1fr;
  }
  .babees-result-actions .babees-result-share,
  .babees-result-actions .babees-result-exit {
    grid-column: auto;
  }
}
