/* ── 10-settings.css — Settings panel (sectioned flat layout) ── */

  /* ── Settings panel — flat sectioned layout (v1.4.4 redesign)
     macOS System Settings style: no card borders, no inner backgrounds,
     just sections separated by a subtle horizontal rule. Each section
     has an icon + uppercase label header, then content. Clean & airy. */

  .stg-panel .panel-title {
    display: inline-flex; align-items: center; gap: 8px;
  }
  .stg-panel .panel-title .icon { background: var(--primary); }
  /* Override the global .panel-body { padding: 0 0 24px } — needs higher
     specificity (the rule lives later in the file). */
  .stg-panel .panel-body.stg-body {
    padding: 18px 20px 24px;
    display: flex; flex-direction: column;
    gap: 0;                    /* sections separate via border, not gap */
    overflow-y: auto;
  }

  /* Section (replaces the old .stg-card) — flat, no border, divided by
     a top border on every section after the first. */
  .stg-card {
    padding: 14px 0;
    border-top: 1px solid var(--border);
  }
  .stg-card:first-child {
    border-top: none;
    padding-top: 4px;
  }
  .stg-card:last-child {
    padding-bottom: 4px;
  }
  .stg-card-head {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 10px;
  }
  .stg-card-head .icon { background: var(--primary); flex-shrink: 0; }
  .stg-card-title {
    font-size: 11px; font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
  }
  .stg-card-body {
    display: flex; flex-direction: column; gap: 10px;
  }

  /* Row patterns inside cards */
  .stg-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
  }
  .stg-row--toggle {
    cursor: pointer;
    user-select: none;
    padding: 6px 8px; margin: -2px -8px;
    border-radius: 9px;
    transition: background .15s;
  }
  .stg-row--toggle:hover { background: var(--surface-2); }
  .stg-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .stg-row-title { font-size: 13px; font-weight: 600; color: var(--text); }
  .stg-row-sub   { font-size: 11px; color: var(--muted); line-height: 1.35; }
  .stg-row-help {
    margin: 0;
    font-size: 12px; color: var(--muted); line-height: 1.45;
  }

  /* Action button rows (single line by default, column when --col modifier) */
  .stg-row-actions {
    display: flex; gap: 8px; flex-wrap: wrap;
  }
  .stg-row-actions--col {
    flex-direction: column;
    align-items: stretch;
  }
  .stg-row-actions--col > * {
    justify-content: flex-start;
  }
  .stg-row-actions .ghost,
  .stg-row-actions .stg-link-btn {
    font-size: 12px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 9px;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, transform .08s, box-shadow .15s;
  }
  .stg-row-actions .ghost .icon,
  .stg-row-actions .stg-link-btn .icon { background: var(--muted); transition: background .15s; }
  .stg-row-actions .ghost:hover,
  .stg-row-actions .stg-link-btn:hover {
    background: var(--surface);
    border-color: var(--primary);
    color: var(--primary-text);
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
  }
  .stg-row-actions .ghost:hover .icon,
  .stg-row-actions .stg-link-btn:hover .icon { background: var(--primary); }
  .stg-row-actions .ghost:active,
  .stg-row-actions .stg-link-btn:active { transform: translateY(1px); box-shadow: none; }
  .stg-row-actions .ghost:disabled { opacity: .5; cursor: not-allowed; }
  .stg-row-actions .ghost:disabled:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); box-shadow: none; }

  /* About content — flat lines directly inside the card body, no inner box */
  #stgAbout .stg-about-name    { font-size: 13px; font-weight: 600; color: var(--text); }
  #stgAbout .stg-about-version { font-size: 13px; color: var(--primary-text); font-family: var(--mono); font-weight: 700; }
  #stgAbout .stg-about-tech    { font-size: 11px; color: var(--muted); user-select: text; font-family: var(--mono); margin-bottom: 4px; }

  /* Status line (Checking… / Up to date / Available / Ready / Error) */
  .stg-status {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.4;
    padding: 8px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    word-break: break-word;
  }
  .stg-status[data-kind="ok"]   { color: var(--success-text); border-color: rgba(22,163,74,.3); }
  .stg-status[data-kind="warn"] { color: rgb(217, 119, 6); border-color: rgba(217,119,6,.3); }
  :root:not([data-theme="dark"]) .stg-status[data-kind="warn"] { color: var(--warning-text); }
  .stg-status[data-kind="err"]  { color: var(--danger-text); border-color: rgba(220,38,38,.3); }

  /* Spool detail panel → Storage location row.
     Compact one-liner: package icon · rack name · orange coord badge.
     Lets the user know exactly where to physically grab / put the spool. */
  .panel-storage-loc .storage-loc-row {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
  }
  .panel-storage-loc .storage-loc-row .icon { background: var(--muted); flex-shrink: 0; }
  .panel-storage-loc .storage-loc-rack {
    flex: 1; min-width: 0;
    color: var(--text);
    font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .panel-storage-loc .storage-loc-coord {
    flex-shrink: 0;
    font-family: var(--mono);
    font-size: 12px; font-weight: 700;
    color: var(--primary-text);
    background: var(--primary-soft);
    border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent);
    padding: 2px 8px;
    border-radius: 5px;
    letter-spacing: .04em;
  }
  .panel-storage-loc .storage-loc-locked {
    background: rgb(217, 119, 6);
    flex-shrink: 0;
  }
  /* Clickable variant — entire row is a button that takes the user to
     Storage view with the spool pre-filtered. Hover lights up the border
     in primary, and the right-side chevron hints at the navigation. */
  .panel-storage-loc .storage-loc-row--clickable {
    width: 100%;
    margin: 0;
    cursor: pointer;
    font: inherit;
    text-align: left;
    -webkit-appearance: none;
            appearance: none;
    transition: border-color .15s, background .15s;
  }
  .panel-storage-loc .storage-loc-row--clickable:hover {
    background: var(--surface);
    border-color: var(--primary);
  }
  .panel-storage-loc .storage-loc-row--clickable:hover .icon { background: var(--primary); }
  .panel-storage-loc .storage-loc-row--clickable:hover .storage-loc-rack { color: var(--primary-text); }
  .panel-storage-loc .storage-loc-locate {
    background: var(--muted);
    flex-shrink: 0;
    transition: background .15s, transform .15s;
  }
  .panel-storage-loc .storage-loc-row--clickable:hover .storage-loc-locate {
    background: var(--primary);
    transform: translateX(2px);
  }
  /* Auto-store button reduced to its icon only — square, centred hit area,
     with a clear hover state so it's obvious the cursor is on it. */
  .panel-storage-loc .storage-loc-autobtn {
    flex-shrink: 0;
    padding: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    border-radius: 8px;
    transition: background .15s, border-color .15s;
  }
  .panel-storage-loc .storage-loc-autobtn .icon {
    transition: background .15s, transform .15s;
  }
  .panel-storage-loc .storage-loc-autobtn:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
  }
  .panel-storage-loc .storage-loc-autobtn:hover .icon {
    background: var(--primary);
    transform: scale(1.12);
  }
  /* Hovering the auto-store button lights up the WHOLE location card, so the
     user sees exactly what the action will fill. */
  .panel-storage-loc .storage-loc-row--empty {
    transition: background .15s, border-color .15s;
  }
  .panel-storage-loc .storage-loc-row--empty:has(.storage-loc-autobtn:hover) {
    border-color: var(--primary);
    background: var(--primary-soft);
  }
  .panel-storage-loc .storage-loc-row--empty:has(.storage-loc-autobtn:hover) .storage-loc-rack--empty {
    color: var(--primary-text);
  }
  .panel-storage-loc .storage-loc-row--empty:has(.storage-loc-autobtn:hover) .icon-package {
    background: var(--primary);
  }

  /* ── Collapsible section (Data / Tools) ──────────────────────
     Header is a real <button> for accessibility, no chrome around it.
     Hover only changes the title + chevron color, no background fill. */
  .stg-card-head--btn {
    width: calc(100% + 16px);
    padding: 6px 8px;
    border: 0;
    margin: -2px -8px 10px;
    border-radius: 9px;
    cursor: pointer;
    font: inherit;
    color: inherit;
    text-align: left;
    -webkit-appearance: none;
            appearance: none;
    transition: background .15s;
  }
  .stg-card-head--btn:hover { background: var(--surface-2); }
  .stg-card--collapsible[data-collapsed="true"] .stg-card-head--btn { margin-bottom: -2px; }
  .stg-card-head--btn .stg-card-title {
    flex: 1;
    transition: color .15s;
  }
  .stg-card-chev {
    background: var(--muted);
    flex-shrink: 0;
    transition: transform .2s cubic-bezier(.4, 0, .2, 1), background .15s;
  }
  /* On hover: title TEXT turns orange (no background!), the chevron is an SVG
     mask icon so its `background` IS its fill colour. Setting `background` on the
     title span made an orange box over the text — that was the bug. */
  .stg-card-head--btn:hover .stg-card-title { color: var(--primary-text); }
  .stg-card-head--btn:hover .stg-card-chev { background: var(--primary); }
  .stg-card-head--btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
  }

  /* Collapsed: body fully hidden via max-height + padding 0 */
  .stg-card--collapsible[data-collapsed="true"] .stg-card-body--collapsible {
    max-height: 0;
    margin-top: 0;
    opacity: 0;
    pointer-events: none;
  }
  /* Expanded: chevron rotates 90° down, body slides open */
  .stg-card--collapsible[data-collapsed="false"] .stg-card-chev {
    transform: rotate(90deg);
    background: var(--primary);
  }
  .stg-card-body--collapsible {
    max-height: 480px;
    overflow: hidden;
    transition:
      max-height .25s cubic-bezier(.4, 0, .2, 1),
      margin-top .25s cubic-bezier(.4, 0, .2, 1),
      opacity   .15s linear;
  }
  /* Wiki — OUR brand colour, so it tracks the theme (var(--primary) shifts
     between light and dark) instead of freezing one orange. The buttons below
     hardcode a THIRD-PARTY brand colour, which legitimately stays fixed; this
     one is ours. Solid + white mono logo, same shape as them. */
  .sb-wiki-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--primary); border: none; border-radius: 8px;
    padding: 8px 12px; color: var(--on-accent); font-size: 12px; font-weight: 600;
    cursor: pointer;
    transition: background .15s, box-shadow .2s, width .25s cubic-bezier(.4,0,.2,1);
    width: 100%; box-sizing: border-box;
  }
  /* Glow derived from the brand colour at the same weight the buttons below use
     (~.42), rather than --primary-20 (.25/.30) which would read weaker than its
     neighbours. color-mix keeps it theme-aware; 00-base.css already uses it. */
  .sb-wiki-btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 3px 14px color-mix(in srgb, var(--primary) 42%, transparent);
  }
  /* GitHub / 3D Files now match the Discord card: solid brand colour + a white
     (mono) logo, instead of translucent tints. */
  .sb-github-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: #2d333b; border: none; border-radius: 8px;
    padding: 8px 12px; color: var(--on-dark); font-size: 12px; font-weight: 600;
    cursor: pointer; transition: background .15s, box-shadow .2s, width .25s cubic-bezier(.4,0,.2,1);
    width: 100%; box-sizing: border-box;
  }
  .sb-github-btn:hover { background: #3a414b; box-shadow: 0 3px 14px rgba(0,0,0,.4); }
  .sb-makerworld-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: #00BCA0; border: none; border-radius: 8px;
    padding: 8px 12px; color: var(--on-dark); font-size: 12px; font-weight: 600;
    cursor: pointer; transition: background .15s, box-shadow .2s, width .25s cubic-bezier(.4,0,.2,1);
    width: 100%; box-sizing: border-box;
  }
  .sb-makerworld-btn:hover { background: #00a890; box-shadow: 0 3px 14px rgba(0,188,160,.4); }
  .sb-discord-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: #5865F2; border: none; border-radius: 8px;
    padding: 8px 12px; color: var(--on-accent); font-size: 12px; font-weight: 600;
    cursor: pointer; text-decoration: none;
    transition: background .15s, box-shadow .2s, width .25s cubic-bezier(.4,0,.2,1); width: 100%; box-sizing: border-box;
  }
  .sb-discord-btn:hover { background: #4752C4; box-shadow: 0 3px 14px rgba(88,101,242,.45); }
  /* Buy Me a Coffee — the OFFICIAL brand button image (never restyled or
     distorted, per their charter). Expanded: the full pill wordmark, centred.
     Collapsed: a yellow 40×40 square with just the coffee-cup glyph, since the
     wide wordmark can't fit the rail (see collapsed overrides below). */
  /* Same shape/size as the other community buttons (Discord/Shop/…): full-width
     pill, dark typed label, but Buy-Me-a-Coffee yellow with the official cup as
     its icon. Collapsed → 40px yellow square with just the cup (shared rules
     hide the label + square it off). */
  .sb-coffee-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: #FFDD00; border: none; border-radius: 8px;
    padding: 8px 12px; color: #12100e; font-size: 12px; font-weight: 700;
    cursor: pointer; width: 100%; box-sizing: border-box;
    transition: filter .15s, width .25s cubic-bezier(.4,0,.2,1);
  }
  .sb-coffee-btn:hover { filter: brightness(1.05); }
  .sb-coffee-cup { width: 24px; height: 24px; flex-shrink: 0; display: block; }
  /* Shared fixed height so the community buttons are identical whether the
     sidebar is expanded or collapsed (40px — matches the Notifications button +
     friend avatars; collapsed they become a 40×40 square, only the width changes). */
  /* Improvements & suggestions — a tool, so it stays quiet next to the brand
     buttons: outline only, brand-orange glyph + label, filled on hover / open. */
  .sb-report-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: none; border: 1px solid color-mix(in srgb, var(--primary) 50%, transparent); border-radius: 8px;
    padding: 8px 12px; color: var(--primary-text); font-size: 12px; font-weight: 600;
    cursor: pointer; width: 100%; box-sizing: border-box;
    transition: background .15s, color .15s, width .25s cubic-bezier(.4,0,.2,1);
  }
  .sb-report-btn .icon { background: currentColor; }
  .sb-report-btn:hover { background: var(--primary); color: var(--on-accent); }
  .sb-report-btn.is-on { background: var(--primary); color: var(--on-accent); border-color: var(--primary); }
  .sb-wiki-btn, .sb-github-btn, .sb-makerworld-btn, .sb-discord-btn, .sb-coffee-btn, .sb-report-btn, .sb-download-btn { height: 40px; flex-shrink: 0; }
  /* Brand logos fill more of the button (app-icon presence), uniform across the
     buttons. Shared rule replaces the old per-button inline sizes. */
  .sb-community button > .icon { width: 24px; height: 24px; }
  /* Community nudge — a message-style red "1" badge on a community button until
     its nudge is done (per account, synced via users/{uid}.{key}Seen). Hidden by
     default; shown only while the button carries `.sb-nudge`. */
  .sb-wiki-btn, .sb-github-btn, .sb-makerworld-btn, .sb-discord-btn, .sb-coffee-btn, .sb-report-btn, .sb-download-btn { position: relative; }
  .sb-community-badge {
    position: absolute; top: -6px; right: -6px;
    display: none;
    min-width: 16px; height: 16px; padding: 0 4px;
    align-items: center; justify-content: center;
    background: #ed4245; color: var(--on-accent);          /* plain red bubble, like a phone app badge */
    font-size: 10px; font-weight: 700; line-height: 1;
    border-radius: 8px;
  }
  .sb-nudge .sb-community-badge { display: inline-flex; }
  /* Collapsed rail: the button shrinks to ~44px, keep the badge tight to the corner. */
  .sidebar.collapsed .sb-community-badge { top: -5px; right: -5px; }
  /* The QR data-URL is generated locally and set on the img after the module
     loads (see _makeQrDataUrl for #sbQrImg). Until then the img has no src, so
     hide it — otherwise the browser's broken-image icon + "QR" alt text flash for
     a beat on cold start. The fixed box above keeps the layout from shifting. */
  /* Short label shown only when the sidebar is collapsed (see collapsed rule). */

  /* ── Settings panel — `.stg-copy-btn` is still used by the raw-JSON copy
     button in the spool detail panel. Other legacy `.stg-*` classes were
     dropped in v1.4.4 along with the old flat settings layout (see the
     new `.stg-card` system above). */
  .stg-copy-btn {
    width: 32px; height: 30px; padding: 0; border-radius: 7px; flex-shrink: 0;
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--muted); display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .15s;
  }
  .stg-copy-btn:hover { background: var(--border); color: var(--text); transform: scale(1.08); }
  .stg-copy-btn.copied { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 30%, transparent); color: var(--success-text); }
  @keyframes copyPop { 0%{transform:scale(1)} 40%{transform:scale(1.3)} 100%{transform:scale(1)} }
  .stg-copy-btn.pop { animation: copyPop .25s cubic-bezier(.4,0,.2,1); }


  /* ── Sidebar footer, v2 (after the founder's mockup) ─────────────────────────
     "Resources" and "Support the project" as labelled groups of quiet rows —
     the brand lives in the icon's colour, not in a filled button — then a
     footer line: version on the left, Settings on the right. Collapsed, every
     row is the same 40×40 square (rules in 00-base.css). */
  .sb-group { display: flex; flex-direction: column; gap: 5px; }
  .sb-group-label { font-size: 12px; font-weight: 700; color: var(--ink-50); padding: 4px 2px 1px; white-space: nowrap; overflow: hidden; }
  .sb-community .sb-group > button {
    justify-content: flex-start; gap: 10px; height: 36px; padding: 0 10px; border-radius: 9px;
    background: var(--ink-06); border: 1px solid transparent; color: var(--text);
    font-size: 13px; font-weight: 600; box-shadow: none;
  }
  .sb-community .sb-group > button:hover { background: var(--ink-12); box-shadow: none; filter: none; }
  .sb-community .sb-group > button > .icon { width: 20px; height: 20px; flex-shrink: 0; }
  .sb-community .sb-group > .sb-download-btn > .icon   { background: var(--primary); }
  .sb-community .sb-group > .sb-wiki-btn > .icon       { background: #f5a524; }
  .sb-community .sb-group > .sb-github-btn > .icon     { background: var(--text); }
  .sb-community .sb-group > .sb-makerworld-btn > .icon { background: #00bca0; }
  .sb-community .sb-group > .sb-discord-btn > .icon    { background: #5865f2; }
  /* Support: the coffee row tinted yellow, the suggestions row outlined. */
  .sb-community .sb-group > .sb-coffee-btn { background: color-mix(in srgb, #ffdd00 12%, transparent); }
  .sb-community .sb-group > .sb-coffee-btn:hover { background: color-mix(in srgb, #ffdd00 22%, transparent); }
  .sb-community .sb-group > .sb-coffee-btn .sb-coffee-cup { width: 20px; height: 20px; }
  .sb-community .sb-group > .sb-report-btn { background: none; border-color: color-mix(in srgb, var(--primary) 60%, transparent); }
  .sb-community .sb-group > .sb-report-btn > .icon { background: #ffc61a; }
  .sb-community .sb-group > .sb-report-btn:hover { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--text); }
  .sb-community .sb-group > .sb-report-btn.is-on { background: color-mix(in srgb, var(--primary) 22%, transparent); border-color: var(--primary); color: var(--text); }
  .sb-community .sb-group > .sb-report-btn.is-on > .icon { background: #ffc61a; }
  /* Footer line */
  .sb-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding-top: 2px; }
  .sb-foot .sb-version { text-align: left; padding: 2px 2px; font-size: 11px; }
  .sb-settings-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border: 0; border-radius: 8px;
    background: none; color: var(--ink-50); font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit;
  }
  .sb-settings-btn .icon { background: currentColor; width: 14px; height: 14px; }
  .sb-settings-btn:hover { color: var(--text); background: var(--ink-06); }
  .sb-community .sb-group > button .label { max-width: 190px; }
  .sb-community .sb-foot .sb-settings-btn > .icon { width: 15px; height: 15px; }
  /* The longest label ("Améliorations & suggestions") must fit the expanded rail. */
  .sb-community .sb-group > button { font-size: 12.5px; gap: 9px; padding: 0 9px; }
  .sb-community .sb-group > button .label { text-overflow: ellipsis; }
  /* …and when a locale is longer still (de, nl, pl…), it wraps to two lines
     rather than being cut. */
  .sb-community .sb-group > .sb-report-btn { height: auto; min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
  .sb-community .sb-group > .sb-report-btn .label { white-space: normal; line-height: 1.2; text-align: left; }
  .sidebar:not(.collapsed) .sb-community { padding-left: 8px; padding-right: 8px; }
  .sb-community .sb-group > button { gap: 7px; padding-left: 8px; padding-right: 8px; }
  /* Downloads: same quiet row (base geometry — it has no legacy brand style). */
  .sb-download-btn { display: flex; align-items: center; cursor: pointer; width: 100%; box-sizing: border-box; font-family: inherit;
    transition: background .15s, width .25s cubic-bezier(.4,0,.2,1); }

  /* ── Sidebar footer — founder's palette & micro-motion ─────────────────────
     Icons carry the colour (and a halo of that same colour on hover, through
     `--ic`), labels stay neutral. Hover: lighter row, icon +6 %, row nudged
     2 px right, 180 ms. Backgrounds/text are the dark-theme values; the light
     theme keeps its own tokens. */
  .sb-community .sb-group > button { --ic: currentColor; transition: background 180ms ease, border-color 180ms ease, transform 180ms ease, width .25s cubic-bezier(.4,0,.2,1); }
  .sb-community .sb-group > button > .icon { transition: transform 180ms ease, filter 180ms ease; }
  .sb-community .sb-group > button:hover { transform: translateX(2px); }
  .sb-community .sb-group > button:hover > .icon { transform: scale(1.06); filter: drop-shadow(0 0 5px var(--ic)); }
  .sb-community .sb-group > .sb-download-btn   { --ic: #FF8A32; }
  .sb-community .sb-group > .sb-wiki-btn       { --ic: #FFC83D; }
  .sb-community .sb-group > .sb-github-btn     { --ic: #E2E8F0; }
  .sb-community .sb-group > .sb-makerworld-btn { --ic: #00D4C7; }
  .sb-community .sb-group > .sb-discord-btn    { --ic: #5865F2; }
  .sb-community .sb-group > .sb-coffee-btn     { --ic: #FFD600; }
  .sb-community .sb-group > .sb-report-btn     { --ic: #FFC83D; }
  .sb-community .sb-group > button > .icon { background: var(--ic) !important; }
  .sb-community .sb-group > .sb-coffee-btn:hover .sb-coffee-cup { transform: scale(1.06); filter: drop-shadow(0 0 5px #FFD600); }
  .sb-community .sb-group > .sb-coffee-btn .sb-coffee-cup { transition: transform 180ms ease, filter 180ms ease; }
  /* GitHub's white mark would vanish on the light theme: dark there. */
  :root:not([data-theme="dark"]) .sb-community .sb-group > .sb-github-btn { --ic: #2d333b; }

  :root[data-theme="dark"] .sb-community .sb-group > button { background: #211F2B; color: #E8EAF2; }
  :root[data-theme="dark"] .sb-community .sb-group > button:hover { background: #2C2938; border-color: #34303F; }
  :root[data-theme="dark"] .sb-group-label { color: #858397; }
  :root[data-theme="dark"] .sb-community-badge { background: #FF4D5A; }
  :root[data-theme="dark"] .sb-foot .sb-version { color: #9294A6; }

  /* Improvements & suggestions — the card's door: its own warm treatment. */
  .sb-community .sb-group > .sb-report-btn { transition: background 200ms ease, border-color 200ms ease, box-shadow 200ms ease, transform 180ms ease, width .25s cubic-bezier(.4,0,.2,1); }
  :root[data-theme="dark"] .sb-community .sb-group > .sb-report-btn { background: #211A23; border-color: #C88B22; color: #F5F0E8; }
  :root[data-theme="dark"] .sb-community .sb-group > .sb-report-btn:hover,
  :root[data-theme="dark"] .sb-community .sb-group > .sb-report-btn.is-on { background: #30251F; border-color: #FFC83D; box-shadow: 0 0 12px rgba(255,200,61,.12); }
  .sb-community .sb-group > .sb-report-btn:hover > .icon { animation: sb-sparkle 450ms ease; filter: drop-shadow(0 0 5px #FFC83D); }
  @keyframes sb-sparkle { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(8deg) scale(1.12); } 100% { transform: rotate(0) scale(1); } }

  /* Settings: light grey, white on hover. */
  .sb-settings-btn { color: #9299AA; transition: color 180ms ease, background 180ms ease; }
  .sb-settings-btn:hover { color: #fff; }
  :root:not([data-theme="dark"]) .sb-settings-btn { color: var(--muted); }
  :root:not([data-theme="dark"]) .sb-settings-btn:hover { color: var(--text); }
  :root:not([data-theme="dark"]) .sb-settings-btn:hover { color: var(--text); }

  /* "Support the project" chooser (Buy Me a Coffee / PayPal) — opened by every
     coffee button, anchored next to it (_openCoffee). */
  .support-menu {
    position: fixed; z-index: 10062; width: 320px; padding: 12px; border-radius: 14px;
    background: var(--surface); border: 1px solid var(--border); box-shadow: 0 14px 40px rgba(0,0,0,.35);
    display: flex; flex-direction: column; gap: 6px; animation: support-pop .15s ease-out;
  }
  .support-menu.is-closing { animation: support-out .12s ease-in forwards; pointer-events: none; }
  /* Compact centred modal (opened from the requests side card with no room on its right). */
  .support-backdrop { position: fixed; inset: 0; z-index: 10059; background: rgba(0,0,0,.45); animation: support-fade .15s ease-out; }
  .support-backdrop.is-closing { animation: support-fade .12s ease-in reverse forwards; }
  @keyframes support-fade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes support-pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
  @keyframes support-out { to { opacity: 0; transform: scale(.97); } }
  @media (prefers-reduced-motion: reduce) { .support-menu, .support-menu.is-closing, .support-backdrop, .support-backdrop.is-closing { animation: none; } }
  /* Caret pointing back at the button that opened the popover (placement in _openCoffee). */
  .support-menu-caret {
    position: absolute; width: 12px; height: 12px; background: var(--surface);
    border: 1px solid var(--border); transform: rotate(45deg); pointer-events: none;
  }
  .support-menu[data-place="right"] .support-menu-caret { left: -7px; margin-top: -6px; border-top-color: transparent; border-right-color: transparent; }
  .support-menu[data-place="top"] .support-menu-caret { bottom: -7px; margin-left: -6px; border-top-color: transparent; border-left-color: transparent; }
  .support-menu[data-place="bottom"] .support-menu-caret { top: -7px; margin-left: -6px; border-bottom-color: transparent; border-right-color: transparent; }
  .support-menu[data-place="none"] .support-menu-caret { display: none; }
  .support-menu-title { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--text); padding: 2px 4px 0; }
  .support-menu .support-menu-heart { background-color: #F0475B; }
  /* Reassure before asking: free for good, every bit counts. */
  .support-menu-intro { margin: 0 4px 6px; font-size: 12px; line-height: 1.45; color: var(--muted); }
  .support-menu-foot {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    margin-top: 2px; padding: 8px 4px 0; border-top: 1px solid var(--border);
    font-size: 11px; color: var(--muted);
  }
  .support-menu-safe { display: inline-flex; align-items: center; gap: 5px; opacity: .8; }
  .support-menu-star {
    display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border: none; border-radius: 7px;
    background: none; color: var(--muted); font: inherit; cursor: pointer; transition: color .15s, background .15s;
  }
  .support-menu-star:hover { color: #FFC83D; background: color-mix(in srgb, #FFC83D 12%, transparent); }
  /* The button that opened the popover stays lit while it is open. */
  .support-anchor-open { box-shadow: 0 0 0 2px #FFD600, 0 0 14px color-mix(in srgb, #FFD600 35%, transparent) !important; }
  .support-opt {
    display: flex; align-items: center; justify-content: flex-start; gap: 12px; width: 100%; padding: 10px; text-align: left;
    border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text);
    cursor: pointer; font-family: inherit; transition: border-color .15s, background .15s, transform .15s;
  }
  .support-opt img { width: 28px; height: 28px; flex-shrink: 0; }
  .support-opt span:not(.icon) { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .support-opt { position: relative; }
  .support-opt .support-opt-go { position: absolute; top: 9px; right: 9px; background-color: var(--muted); opacity: 0; transform: translate(-3px, 3px); transition: opacity .15s, transform .15s; }
  .support-opt:hover .support-opt-go { opacity: 1; transform: none; }
  .support-opt b { font-size: 13.5px; }
  .support-opt small { font-size: 11.5px; color: var(--muted); }
  .support-opt:hover { transform: translateY(-2px); }
  @media (prefers-reduced-motion: reduce) { .support-opt:hover { transform: none; } }
  .support-opt[data-support="bmc"]:hover { border-color: #FFD600; background: color-mix(in srgb, #FFD600 10%, var(--surface-2)); }
  .support-opt[data-support="kofi"]:hover { border-color: #29ABE0; background: color-mix(in srgb, #29ABE0 12%, var(--surface-2)); }
  .support-opt[data-support="paypal"]:hover { border-color: #0070E0; background: color-mix(in srgb, #0070E0 12%, var(--surface-2)); }

/* Buy Me a Coffee cup on a dark surface — the brand cup's outline is black, so
   the dark theme swaps in the white-outline variant (the coffee stays #FFDD00).
   The yellow .support-btn pill keeps the original: black reads on yellow. */
:root[data-theme="dark"] .support-opt[data-support="bmc"] img { content: url('../../assets/svg/logos/logo_buy_me_coffee_dark.svg'); }

/* Supporter badge — a small golden heart on the sidebar avatar's corner, shown
   once a payment is tied to the account (users/{uid}.supporter, server-set). */
.sb-supporter-badge {
  position: absolute; right: -3px; bottom: -3px; z-index: 2; width: 17px; height: 17px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; pointer-events: none;
  background: linear-gradient(135deg, var(--sq-a, #FFD600), var(--sq-b, #FF9F1C)); box-shadow: 0 0 0 2px var(--sidebar-solid, #15111D);
}
.sb-supporter-badge .icon { background: var(--sq-ink, #fff); }
/* "Put your code in the message" — ties a Ko-fi payment to this account. */
.support-menu-code {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 0; padding: 8px 10px;
  border: 1px dashed color-mix(in srgb, #FFD600 45%, var(--border)); border-radius: 10px;
  font-size: 11.5px; line-height: 1.35; color: var(--muted);
}
.support-code-chip {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; padding: 4px 8px; border: none; border-radius: 7px;
  background: color-mix(in srgb, #FFD600 16%, transparent); color: var(--text); cursor: pointer;
  font: 700 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .5px; transition: background .15s;
}
.support-code-chip .icon { background: var(--muted); }
.support-code-chip:hover { background: color-mix(in srgb, #FFD600 26%, transparent); }
.support-code-chip.is-copied .icon { background: #20E39A; }
.notif-ic--supporter { background: linear-gradient(135deg, #FFD600, #FF9F1C); }
.notif-ic--supporter .icon { background: #fff; }
/* "Already gave? Get your badge" — claim an unmatched payment by email / transaction id. */
.support-claim { margin: 2px 4px 0; font-size: 11.5px; color: var(--muted); }
.support-claim > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 5px; padding: 2px 0; }
.support-claim > summary::-webkit-details-marker { display: none; }
.support-claim > summary::before { content: "›"; display: inline-block; transition: transform .15s; }
.support-claim[open] > summary::before { transform: rotate(90deg); }
.support-claim > summary:hover { color: var(--text); }
.support-claim-form { display: flex; gap: 6px; margin-top: 6px; }
.support-claim-form .support-claim-input {
  flex: 1; min-width: 0; height: 30px; padding: 0 9px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 12px;
}
.support-claim-form .support-claim-input:focus { outline: none; border-color: #FFD600; }
.support-claim-go {
  height: 30px; padding: 0 11px; border: none; border-radius: 8px; background: #FFDD00; color: #0d0c22;
  font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
.support-claim-go:disabled { opacity: .6; cursor: default; }
.support-claim-msg { margin-top: 5px; line-height: 1.35; }
.support-claim-msg:empty { display: none; }
.support-claim-msg.is-ok { color: #20E39A; }
.support-claim-msg.is-ko { color: #FF8A65; }
:root:not([data-theme="dark"]) .support-claim-msg.is-ok { color: var(--success-text); }
:root:not([data-theme="dark"]) .support-claim-msg.is-ko { color: var(--danger-text); }
.support-code-chip.is-loading { opacity: .55; cursor: progress; }

/* TigerSquad — supporters who chose to show it. A golden ring on the avatar
   wherever it is drawn (own sidebar, friends lists, banners), and a pill under
   one's own name: belonging you can see. */
.av-squad.av-squad { box-shadow: 0 0 0 2px var(--sq-a, #FFD600), 0 0 10px color-mix(in srgb, var(--sq-a, #FFD600) 45%, transparent); }
.sb-squad-pill {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; padding: 2px 7px 2px 6px; border-radius: 999px;
  background: linear-gradient(135deg, var(--sq-a, #FFD600), var(--sq-b, #FF9F1C)); color: var(--sq-ink, #1a1205); font-size: 10px; font-weight: 800; letter-spacing: .3px; width: fit-content;
}
.sb-squad-pill .icon { background: var(--sq-ink, #1a1205); }
/* "Join the TigerSquad" — in the support popover. */
.support-squad {
  display: flex; align-items: flex-start; gap: 10px; margin: 2px 0 0; padding: 9px 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid color-mix(in srgb, #FFD600 40%, var(--border));
  background: color-mix(in srgb, #FFD600 7%, transparent); transition: background .15s, border-color .15s;
  width: 100%; align-items: center; text-align: left; font-family: inherit;
}
.support-squad.support-squad { height: auto; min-height: 0; }
.support-squad-badge { width: 34px; height: 34px; flex-shrink: 0; object-fit: contain; }
.support-squad .support-squad-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.support-squad-go { flex-shrink: 0; background: var(--muted); transition: transform .15s, background .15s; }
.support-squad:hover .support-squad-go { background: var(--text); transform: translateX(2px); }
.support-squad:focus-visible { outline: 2px solid #FFD600; outline-offset: 2px; }
.support-squad:hover { background: color-mix(in srgb, #FFD600 12%, transparent); }
  flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; border-radius: 5px; border: 1.5px solid var(--muted);
  display: inline-flex; align-items: center; justify-content: center; transition: background .15s, border-color .15s;
}
.support-squad-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.support-squad-txt b { font-size: 12.5px; color: var(--text); }
.support-squad-txt small { font-size: 11px; line-height: 1.35; color: var(--muted); }
/* Joined from the popover: the card folds away (leaving lives in My profile). */
/* My profile → TigerSquad row. */
.eac-squad-label { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.eac-squad-label .eac-squad-pill { margin-top: 0; align-self: flex-start; }
.eac-squad-label { text-align: left; }
.eac-squad-sub { font-size: 11.5px; line-height: 1.35; color: var(--muted); font-weight: 400; }
.sb-squad-pill.fvb-squad { margin-top: 0; align-self: center; height: 20px; box-sizing: border-box; padding: 0 8px; font-size: 10px; gap: 4px; }
/* TigerSquad heart on a friend's avatar corner (avatarMarkup wraps the avatar). */
/* The Platinum "aurora" colour style (inventory.js _auroraBg): three soft
   lights over a dark sky, each layer drifting its own way, so the colours swirl
   like a northern light. The animation sets the sizes too: the colours are an
   inline background shorthand that resets them. Still with reduced motion. */
.av-fx-aurora { animation: av-aurora 7s ease-in-out infinite alternate; }
@keyframes av-aurora {
  0%   { background-size: 75% 90%, 75% 90%, 75% 90%, 100% 100%; background-position: 0% 0%, 100% 10%, 50% 100%, 0 0; }
  50%  { background-size: 85% 95%, 70% 85%, 80% 90%, 100% 100%; background-position: 90% 60%, 0% 90%, 30% 0%, 0 0; }
  100% { background-size: 70% 85%, 85% 95%, 75% 90%, 100% 100%; background-position: 40% 100%, 70% 0%, 100% 50%, 0 0; }
}
@media (prefers-reduced-motion: reduce) { .av-fx-aurora { animation: none; } }
.av-squad-host { position: relative; display: inline-flex; flex-shrink: 0; }
/* `av-fill`: the friends bar's avatar (userAvatar), filling its container — the
   container sets the size and the initials' font-size (the send and freeze
   windows' friends, a friend's envelope seal, the letter's stamp). */
.av-fill { position: relative; width: 100%; height: 100%; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: inherit; font-weight: 700; color: var(--on-accent); letter-spacing: -.5px; overflow: hidden; }
.av-squad-host:has(> .av-fill) { display: block; width: 100%; height: 100%; }
.av-squad-heart {
  position: absolute; right: -2px; bottom: -2px; width: 38%; min-width: 13px; max-width: 18px; aspect-ratio: 1;
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; pointer-events: none;
  background: linear-gradient(135deg, var(--sq-a, #FFD600), var(--sq-b, #FF9F1C)); box-shadow: 0 0 0 2px var(--sidebar-solid, #15111D);
}
.av-squad-heart .icon { width: 60%; height: 60%; background: var(--sq-ink, #fff); }

/* TigerSquad levels — one palette each; every squad mark (ring, heart, pill)
   reads these. Bronze = joined, Silver = 20+ certified TigerTag+,
   Gold = gave, Platinum = gave + 50+ certified. */
.sq-bronze   { --sq-a: #F0B27A; --sq-b: #A8652B; --sq-ink: #2a1606; }
.sq-silver   { --sq-a: #C9D3E0; --sq-b: #8794A6; --sq-ink: #1b2430; }
.sq-gold     { --sq-a: #FFD600; --sq-b: #FF9F1C; --sq-ink: #1a1205; }
.sq-platinum { --sq-a: #6CB8FF; --sq-b: #2F6FE0; --sq-ink: #0b1630; }   /* the blue of the Platinum crystals */

.eac-squad-label.eac-squad-label, .eac-squad-label > * { text-align: left; align-self: flex-start; }
/* Avatars sized in % of their container (my own banner's edit button) keep it through the heart wrapper. */
.fvb-avatar-edit .av-squad-host { width: 100%; height: 100%; }
/* ══ TigerSquad invite (_openSquadInvite) — dark premium, gamified ══════════
   Palette from the redesign brief; motion 160–300 ms, none under reduced motion. */
.squad-invite {
  --tsq-bg: var(--game-win-bg); --tsq-bg2: var(--game-win-bg-2); --tsq-card: var(--game-win-card); --tsq-line: var(--game-win-line);
  --tsq-text: var(--game-text); --tsq-muted: var(--game-muted); --tsq-orange: var(--game-orange-text);
  position: fixed; z-index: 10061; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(700px, calc(100vw - 32px)); max-height: 90vh; display: flex; flex-direction: column;
  border-radius: 18px; border: 1px solid var(--tsq-line); color: var(--tsq-text); text-align: center;
  background: radial-gradient(120% 50% at 50% 0%, color-mix(in srgb, var(--game-orange) 10%, transparent), transparent 60%), var(--tsq-bg);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
  animation: tsq-in .24s cubic-bezier(.2, .8, .2, 1);
}
.squad-invite.is-closing { animation: tsq-out .16s ease-in forwards; }
@keyframes tsq-in { from { opacity: 0; transform: translate(-50%, calc(-50% + 8px)) scale(.97); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes tsq-out { to { opacity: 0; transform: translate(-50%, -50%) scale(.98); } }
.tsq-scroll { overflow-y: auto; overflow-x: hidden; padding: 34px 24px 16px; display: flex; flex-direction: column; gap: 18px; }
.squad-invite-x {
  position: absolute; top: 12px; right: 12px; z-index: 1; width: 32px; height: 32px; border: none; border-radius: 50%;
  background: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background .15s;
}
.squad-invite-x .icon { background: var(--tsq-muted); }
.squad-invite-x:hover { background: var(--ink-08); }
.squad-invite-x:hover .icon { background: var(--tsq-text); }
.squad-invite button:focus-visible, .tsq-rank:focus-visible { outline: 2px solid var(--tsq-orange); outline-offset: 2px; }

/* B — title */
.tsq-title { margin: 0; font-size: 27px; font-weight: 800; line-height: 1.15; color: var(--tsq-text); }
.tsq-grad { background: linear-gradient(90deg, var(--game-orange), var(--game-gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tsq-sub { margin: -8px 0 0; font-size: 15px; font-weight: 600; color: var(--tsq-text); }
.tsq-desc { margin: -10px auto 0; max-width: 440px; font-size: 13px; line-height: 1.5; color: var(--tsq-muted); }

/* C — the three perks (informative: no pointer) */
.tsq-perks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tsq-perk {
  --acc: var(--game-orange); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px; border-radius: 12px;
  background: var(--tsq-card); border: 1px solid var(--tsq-line); transition: background .16s ease-out, border-color .16s ease-out, transform .16s ease-out;
}
.tsq-perk--badges { --acc: #A66BFF; } .tsq-perk--support { --acc: #FF4D5A; }
.tsq-perk-ic { width: 36px; height: 36px; margin-bottom: 4px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--acc) 16%, transparent); transition: transform .16s ease-out; }
.tsq-perk-ic .icon { width: 18px; height: 18px; background: var(--acc); }
.tsq-perk b { font-size: 13px; color: var(--tsq-text); }
.tsq-perk span:last-child { font-size: 11.5px; line-height: 1.4; color: var(--tsq-muted); }
.tsq-perk:hover { background: var(--game-card-2); border-color: color-mix(in srgb, var(--acc) 45%, var(--tsq-line)); transform: translateY(-2px); }
.tsq-perk:hover .tsq-perk-ic { transform: scale(1.08); }

/* D — levels (TigerSquadRankBadge) */
.tsq-adventure { padding: 14px; border-radius: 14px; background: var(--tsq-bg2); border: 1px solid var(--tsq-line); }
.tsq-adv-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.tsq-adv-title { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 700; color: var(--tsq-text); }
.tsq-adv-title .icon { background: var(--game-gold-text); }
.tsq-adv-link { border: none; background: none; padding: 2px 0; font-family: inherit; font-size: 12px; color: var(--tsq-muted); cursor: pointer; }
.tsq-adv-link:hover { color: var(--tsq-orange); }
.tsq-ranks { list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-start; justify-content: center; gap: 2px; }
.tsq-rank {
  --rc: #CD8750; --rb: color-mix(in srgb, var(--rc) 18%, var(--tsq-card)); flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 2px; border-radius: 12px; outline: none; transition: transform .16s ease-out;
}
.tsq-rank--silver   { --rc: #B9C5D5; --rb: color-mix(in srgb, var(--rc) 18%, var(--tsq-card)); }
.tsq-rank--gold     { --rc: var(--game-gold); --rb: color-mix(in srgb, var(--rc) 18%, var(--tsq-card)); }
.tsq-rank--platinum { --rc: #B9D8F5; --rb: color-mix(in srgb, var(--rc) 18%, var(--tsq-card)); }
.tsq-rank-badge { width: 66px; height: 66px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--rb); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 35%, transparent); transition: box-shadow .16s ease-out; }
.tsq-rank-badge img, .tsq-rank-badge svg { width: 46px; height: 46px; }
.tsq-rank-shield { fill: color-mix(in srgb, var(--rc) 22%, transparent); stroke: var(--rc); stroke-width: 2.5; }
.tsq-rank-heart { fill: var(--rc); }
.tsq-rank-name { font-size: 12.5px; font-weight: 800; color: var(--rc); }
.tsq-rank-desc { font-size: 10.5px; line-height: 1.35; color: var(--tsq-muted); }
.tsq-rank:hover, .tsq-rank:focus-visible { transform: translateY(-2px); }
.tsq-rank:hover .tsq-rank-badge, .tsq-rank:focus-visible .tsq-rank-badge { box-shadow: inset 0 0 0 1px var(--rc), 0 0 16px color-mix(in srgb, var(--rc) 35%, transparent); }
.tsq-rank-arrow { flex: 0 0 auto; align-self: center; margin-top: -30px; }
.tsq-rank-arrow .icon { background: var(--game-muted); }
.tsq-every { margin: 10px 0 0; font-size: 12px; color: var(--tsq-muted); }

/* E — optional support (secondary to the free join) */
.tsq-coffee { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 12px; text-align: left; background: #24231C; border: 1px solid #D6AA00; }
.tsq-coffee-art { flex-shrink: 0; width: 58px; height: 58px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: rgba(255, 178, 44, .12); }
.tsq-coffee-art img { width: 100%; height: 100%; object-fit: contain; }
.tsq-coffee-art .icon { width: 28px; height: 28px; background: #FFB22C; }
.tsq-coffee-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tsq-coffee-txt b { font-size: 13.5px; color: var(--tsq-text); }
.tsq-coffee-txt span { font-size: 12px; line-height: 1.45; color: var(--tsq-muted); }
.tsq-coffee-txt small { font-size: 11px; color: var(--game-muted); }
.tsq-coffee-btn { flex-shrink: 0; height: 36px; padding: 0 14px; border: none; border-radius: 9px; background: #FFB22C; color: var(--game-on-gold); font-family: inherit; font-size: 13px; font-weight: 800; cursor: pointer; white-space: nowrap; transition: background .16s; }
.tsq-coffee-btn:hover { background: #FFC14D; }

/* F — the free join (primary) */
.tsq-join {
  width: 100%; height: 48px; border: none; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(90deg, var(--game-orange), #FFAA61); color: var(--game-on-gold); font-family: inherit; font-size: 14.5px; font-weight: 750; cursor: pointer;
  transition: filter .18s, box-shadow .18s;
}
.tsq-join .icon { background: var(--game-on-gold); }
.tsq-join:hover:not(:disabled) { filter: brightness(1.06); box-shadow: 0 0 18px rgba(255, 146, 63, .20); }
.tsq-join:disabled { cursor: progress; }
.tsq-join.is-busy { filter: saturate(.7) brightness(.95); }
.tsq-join.is-busy .icon { animation: tsq-pulse 1s ease-in-out infinite; }
.tsq-join.is-done { background: linear-gradient(90deg, var(--game-ok), var(--game-ok)); }
@keyframes tsq-pulse { 50% { opacity: .35; } }
.tsq-join-msg { margin: -12px 0 0; font-size: 12.5px; }
.tsq-join-msg:empty { display: none; }
.tsq-join-msg.is-error { color: var(--game-danger-text); }
.tsq-reassure { list-style: none; margin: -8px 0 0; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--game-text-2); }
.tsq-reassure li { display: inline-flex; align-items: center; gap: 5px; }
.tsq-reassure .icon { background: var(--game-ok-text); }

/* G — later (keeps the 30-day snooze) */
.tsq-later { width: 100%; height: 42px; border-radius: 10px; border: 1px solid #394354; background: #1C212D; color: #B9C5D5; font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .16s; }
.tsq-later:hover { background: var(--game-card-2); }

/* H — footer */
.tsq-foot { margin: -4px 0 0; font-size: 12px; color: var(--game-muted); }

/* I — small notices in the same look: leaving (what goes for 30 days, held to
   confirm) and back within the wait (days left) — openDialog's "notice" look (renderer/dialog.js). */
.squad-notice { width: min(460px, calc(100vw - 32px)); }
.squad-notice .tsq-scroll { gap: 14px; padding-top: 30px; }
/* The tiger on top (assets/img/tigersquad/squad-notice/): leaving, or back with the calendar. */
.sqn-art { align-self: center; height: 118px; width: auto; margin: -10px 0 -10px; }
.squad-notice .tsq-title { font-size: 23px; }
.squad-notice .tsq-desc { margin-top: -6px; }
.sqn-lost { padding: 12px 14px; border-radius: 12px; text-align: left; background: var(--tsq-bg2); border: 1px solid var(--tsq-line); }
.sqn-lost-h { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--game-danger-text); }
.sqn-lost ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }   /* two columns */
.sqn-lost li { display: flex; align-items: center; gap: 10px; padding: 8px 0; min-width: 0; }
.sqn-lost li:nth-child(n+3) { border-top: 1px solid var(--tsq-line); }
.sqn-lost-ic { flex-shrink: 0; width: 22px; aspect-ratio: 1; display: grid; place-items: center; }   /* bare icon, no tile */
.sqn-lost-ic .icon { background: var(--game-danger-text); }
.sqn-lost li > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.sqn-lost li b { font-size: 13px; color: var(--tsq-text); }
.sqn-lost li small { font-size: 11.5px; line-height: 1.35; color: var(--tsq-muted); }
/* What stays: its own small card, a bare green tick. */
.sqn-keep { margin: -4px 0 0; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--tsq-line); background: var(--tsq-bg2); text-align: left; font-size: 12.5px; color: var(--tsq-text); }
.sqn-keep-ic { flex-shrink: 0; width: 20px; aspect-ratio: 1; display: grid; place-items: center; }
/* Leaving: the word to type before the hold button unlocks. */
.sqn-confirm { display: flex; flex-direction: column; gap: 6px; text-align: left; font-size: 12px; color: var(--tsq-muted); }
.sqn-confirm input { height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--tsq-line); background: var(--tsq-bg2); color: var(--tsq-text);
  font: 700 13.5px/1 inherit; letter-spacing: .06em; text-transform: uppercase; outline: none; transition: border-color .16s; }
.sqn-confirm input:focus { border-color: color-mix(in srgb, var(--game-danger) 55%, transparent); }
.sqn-confirm input.is-ok { border-color: var(--game-danger); }
.squad-notice--leave [data-dlg="leave"][aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.sqn-keep .icon { background: var(--game-ok-text); }
.sqn-leave { position: relative; overflow: hidden; width: 100%; height: 42px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--game-danger) 45%, transparent);
  background: transparent; color: var(--game-danger-text); font-family: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; transition: background .16s; }
.sqn-leave:hover { background: color-mix(in srgb, var(--game-danger) 8%, transparent); }
.sqn-leave .hold-progress { background: var(--game-danger); opacity: .3; }
.sqn-bar { height: 10px; border-radius: 5px; overflow: hidden; background: var(--tsq-bg2); box-shadow: inset 0 0 0 1px var(--tsq-line); }
.sqn-bar span { display: block; width: var(--p); height: 100%; border-radius: inherit; background: linear-gradient(90deg, #5AB8F0, var(--game-ice)); transition: width .4s ease-out; }
.sqn-bar-label { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--tsq-muted); }
/* Back within the wait: a kicker over the title, the return date in its own card above the bar. */
.squad-notice .tsq-title { text-wrap: balance; }
.sqn-kicker { margin-bottom: -14px; font-size: 14px; font-weight: 600; color: var(--tsq-muted); }
.sqn-when { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 12px; text-align: left; background: var(--tsq-bg2); border: 1px solid var(--tsq-line); }
.sqn-when > small { font-size: 12px; color: var(--tsq-muted); }
.sqn-when > b { margin-top: -6px; font-size: 20px; color: var(--tsq-text); }

@media (max-width: 560px) {
  .tsq-perks { grid-template-columns: 1fr; }
  .tsq-ranks { flex-wrap: wrap; }
  .tsq-rank { flex: 0 0 calc(50% - 4px); }
  .tsq-rank-arrow { display: none; }
  .tsq-coffee { flex-wrap: wrap; }
  .tsq-coffee-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .squad-invite, .squad-invite.is-closing, .tsq-join.is-busy .icon { animation: none; }
  .tsq-perk, .tsq-perk-ic, .tsq-rank { transition: none; }
  .tsq-perk:hover, .tsq-rank:hover, .tsq-rank:focus-visible { transform: none; }
  .tsq-perk:hover .tsq-perk-ic { transform: none; }
}

/* In the scrolling column, nothing may shrink below its own height (the 48 / 42 px buttons). */
.tsq-scroll > * { flex-shrink: 0; }
/* The real coffee artwork fills its slot (no tinted tile behind it). */
.tsq-coffee-art:has(img) { background: none; width: 62px; height: 64px; }
.tsq-coffee-art img { filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .45)); }
/* Real level artwork: no placeholder disc — the badge fills the slot, its halo follows its shape. */
.tsq-rank-badge:has(img) { background: none; box-shadow: none; width: 84px; height: 84px; }
.tsq-rank-badge img { width: 100%; height: 100%; object-fit: contain; transition: filter .16s ease-out; }
.tsq-rank:hover .tsq-rank-badge:has(img), .tsq-rank:focus-visible .tsq-rank-badge:has(img) { box-shadow: none; }
.tsq-rank:hover .tsq-rank-badge img, .tsq-rank:focus-visible .tsq-rank-badge img { filter: drop-shadow(0 0 10px color-mix(in srgb, var(--rc) 55%, transparent)); }
/* Perk icons are the colour SVG artwork: no tinted tile, a touch larger. */
.tsq-perk-ic { background: none; width: 48px; height: 48px; margin-bottom: -4px; }
.tsq-perk-ic img { width: 100%; height: 100%; }
/* Perk cards — each glows in its own colour: radial light from the icon, tinted rim, two sparkles. */
.tsq-perk {
  position: relative; overflow: hidden; padding: 16px 12px 14px; border-radius: 14px;
  border-color: color-mix(in srgb, var(--acc) 34%, var(--tsq-line));
  background:
    radial-gradient(120% 75% at 50% 0%, color-mix(in srgb, var(--acc) 24%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--acc) 7%, var(--tsq-card)), var(--tsq-card));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--acc) 30%, transparent), 0 0 22px -8px color-mix(in srgb, var(--acc) 55%, transparent);
}
.tsq-perk::before, .tsq-perk::after {
  content: ""; position: absolute; width: 7px; height: 7px; pointer-events: none;
  background: color-mix(in srgb, var(--acc) 70%, var(--on-dark));
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  opacity: .7;
}
.tsq-perk::before { top: 16px; left: 18px; }
.tsq-perk::after { top: 30px; right: 20px; width: 5px; height: 5px; opacity: .5; }
.tsq-perk-ic { width: 56px; height: 56px; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--acc) 55%, transparent)); }
.tsq-perk b { font-size: 14px; }
.tsq-perk--xp b { color: var(--acc); }
.tsq-perk span:last-child { color: var(--game-text-2); }
.tsq-perk:hover { background:
    radial-gradient(120% 75% at 50% 0%, color-mix(in srgb, var(--acc) 32%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--acc) 9%, var(--tsq-card)), var(--tsq-card)); }
/* "Discover the levels →" — an info bubble anchored under the link (caret at top right). */
.tsq-adventure { position: relative; }
.tsq-explainer {
  position: absolute; z-index: 3; top: 44px; right: 10px; width: min(400px, calc(100% - 20px));
  padding: 14px; border-radius: 12px; text-align: left;
  background: var(--game-card-2); border: 1px solid var(--game-line-2); box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
  animation: tsq-bubble .16s ease-out;
}
.tsq-explainer::before {
  content: ""; position: absolute; top: -7px; right: 40px; width: 12px; height: 12px; transform: rotate(45deg);
  background: var(--game-card-2); border-left: 1px solid var(--game-line-2); border-top: 1px solid var(--game-line-2);
}
.tsq-explainer[hidden] { display: none; }
@keyframes tsq-bubble { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.tsq-explainer dl { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.tsq-rule { display: grid; grid-template-columns: 76px 1fr; gap: 10px; align-items: baseline; }
.tsq-rule dt { font-size: 12.5px; font-weight: 800; color: var(--rc); }
.tsq-rule dd { margin: 0; font-size: 12px; line-height: 1.45; color: var(--tsq-text); }
.tsq-rule-xp { display: flex; gap: 7px; align-items: flex-start; margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--tsq-line); font-size: 11.5px; line-height: 1.45; color: var(--tsq-muted); }
.tsq-rule-xp .icon { flex-shrink: 0; margin-top: 2px; background: var(--tsq-orange); }
.tsq-wall-link { margin-top: 8px; border: none; background: none; padding: 0; font-family: inherit; font-size: 12px; color: var(--tsq-muted); cursor: pointer; }
.tsq-wall-link:hover { color: var(--tsq-orange); }
@media (prefers-reduced-motion: reduce) { .tsq-explainer { animation: none; } }
.tsq-rule.tsq-rank--bronze { --rc: #CD8750; }
/* Compact header + an open "adventure" strip: no boxed card, bigger badges, bold arrows between them. */
.tsq-scroll { padding: 22px 24px 14px; gap: 14px; }
.tsq-sub { margin-top: -6px; }
.tsq-desc { margin-top: -8px; }
.tsq-adventure { padding: 2px 0 0; background: none; border: none; border-radius: 0; }
.tsq-adv-head { margin-bottom: 4px; }
.tsq-adv-title { font-size: 15px; }
.tsq-adv-title .icon { width: 16px; height: 16px; }
.tsq-adv-link { font-size: 12.5px; color: var(--tsq-orange); }
.tsq-adv-link:hover { color: var(--game-orange-text); text-decoration: underline; }
.tsq-ranks { gap: 0; }
.tsq-rank { gap: 2px; padding: 4px 0; }
.tsq-rank-badge:has(img) { width: 96px; height: 96px; }
.tsq-rank-name { font-size: 14px; }
.tsq-rank-desc { font-size: 11px; color: var(--game-text-2); }
.tsq-rank-arrow { margin-top: -38px; }
.tsq-rank-arrow .icon { width: 18px; height: 18px; background: var(--tsq-text); }
.tsq-every { margin-top: 6px; }
/* Coffee card — dark with a warm orange rim and glow, bigger cup, orange gradient button with a cup icon. */
.tsq-coffee {
  gap: 16px; padding: 14px 18px 14px 14px; border-radius: 14px; border-color: color-mix(in srgb, var(--game-orange) 70%, transparent);
  background: radial-gradient(90% 140% at 0% 50%, color-mix(in srgb, var(--game-orange) 14%, transparent), transparent 60%), #1A1C22;
  box-shadow: 0 0 22px -6px rgba(255, 146, 63, .45), inset 0 1px 0 rgba(255, 180, 110, .18);
}
.tsq-coffee-art:has(img) { width: 72px; height: 76px; }
.tsq-coffee-txt { gap: 4px; }
.tsq-coffee-txt b { font-size: 15px; }
.tsq-coffee-txt span { font-size: 12.5px; color: var(--game-text-2); }
.tsq-coffee-txt small { font-size: 11px; color: var(--game-muted); margin-top: 2px; }
.tsq-coffee-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 10px;
  background: linear-gradient(180deg, var(--game-orange-hi), var(--game-orange)); color: var(--game-on-gold); font-size: 14px;
  box-shadow: 0 4px 16px -4px rgba(255, 138, 42, .6), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.tsq-coffee-btn .icon { width: 18px; height: 18px; background: var(--game-on-gold); }
.tsq-coffee-btn:hover { background: linear-gradient(180deg, var(--game-orange-hi), #FF9638); }
.tsq-join .icon-community { width: 22px; height: 22px; }
/* Join button — a saturated orange with a soft halo, bigger label + icon; ticks a touch larger. */
.tsq-join {
  height: 52px; border-radius: 12px; gap: 10px; font-size: 16px; font-weight: 800;
  background: linear-gradient(180deg, var(--game-orange), color-mix(in srgb, var(--game-orange) 82%, black));
  box-shadow: 0 6px 22px -6px rgba(255, 111, 18, .65), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.tsq-join .icon-community { width: 28px; height: 28px; }
.tsq-join:hover:not(:disabled) { filter: brightness(1.07); box-shadow: 0 8px 28px -6px rgba(255, 111, 18, .8), inset 0 1px 0 rgba(255, 255, 255, .3); }
.tsq-reassure { gap: 6px 22px; font-size: 12.5px; color: var(--game-text-2); }
.tsq-reassure li { gap: 6px; }
.tsq-reassure .icon { width: 14px; height: 14px; background: var(--game-ok-text); }
/* Perk artwork — a light idle loop per card (gift hops, badge sways, heart beats), the sparkles twinkle;
   staggered so the three never move at once. Hover plays it livelier. Off under reduced motion. */
.tsq-perk-ic img { transform-origin: 50% 70%; }
.tsq-perk--xp .tsq-perk-ic img { animation: tsq-gift 3.6s ease-in-out infinite; }
.tsq-perk--badges .tsq-perk-ic img { transform-origin: 50% 10%; animation: tsq-sway 4s ease-in-out 1.2s infinite; }
.tsq-perk--support .tsq-perk-ic img { transform-origin: 50% 55%; animation: tsq-beat 2.4s ease-in-out .6s infinite; }
.tsq-perk:hover .tsq-perk-ic img { animation-duration: 1.4s; }
.tsq-perk::before { animation: tsq-twinkle 2.8s ease-in-out infinite; }
.tsq-perk::after { animation: tsq-twinkle 2.8s ease-in-out 1.4s infinite; }
@keyframes tsq-gift {
  0%, 62%, 100% { transform: translateY(0) rotate(0); }
  70% { transform: translateY(-5px) rotate(-6deg); }
  78% { transform: translateY(0) rotate(5deg); }
  84% { transform: translateY(-2px) rotate(-2deg); }
  90% { transform: translateY(0) rotate(0); }
}
@keyframes tsq-sway {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(5deg); }
  75% { transform: rotate(-5deg); }
}
@keyframes tsq-beat {
  0%, 40%, 100% { transform: scale(1); }
  10% { transform: scale(1.12); }
  20% { transform: scale(.97); }
  30% { transform: scale(1.08); }
}
@keyframes tsq-twinkle {
  0%, 100% { opacity: .25; transform: scale(.7) rotate(0); }
  50% { opacity: .9; transform: scale(1.15) rotate(45deg); }
}
@media (prefers-reduced-motion: reduce) {
  .tsq-perk-ic img, .tsq-perk::before, .tsq-perk::after { animation: none; }
}
/* Footer row — member count bottom-left, the motto bottom-right. */
.tsq-foot { margin: -4px 0 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tsq-foot > span:only-child { margin: 0 auto; }
.tsq-members { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--game-text-2); }
.tsq-members[hidden] { display: none; }
.tsq-members .icon { width: 16px; height: 16px; background: var(--tsq-orange); }
/* Colour trophy in front of "Your TigerSquad adventure". */
.tsq-adv-trophy { width: 20px; height: 20px; flex-shrink: 0; }
/* Arrows between the levels — bigger, and they light up one after the other, left to right, on a loop. */
.tsq-rank-arrow .icon { width: 24px; height: 24px; background: var(--tsq-text); opacity: .35; animation: tsq-arrow 2.4s ease-in-out infinite; }
.tsq-rank-arrow:nth-child(4) .icon { animation-delay: .4s; }
.tsq-rank-arrow:nth-child(6) .icon { animation-delay: .8s; }
@keyframes tsq-arrow {
  0%, 40%, 100% { opacity: .35; transform: translateX(0); background: var(--tsq-text); }
  15% { opacity: 1; transform: translateX(5px); background: var(--tsq-orange); }
}
@media (prefers-reduced-motion: reduce) { .tsq-rank-arrow .icon { animation: none; opacity: .8; } }
/* Already in the TigerSquad — the member's badge, level and the squad's head count. */
.support-squad--in.support-squad--in { border-color: color-mix(in srgb, var(--sq-a) 55%, var(--border)); background: color-mix(in srgb, var(--sq-a) 8%, transparent); }
.support-squad--in:hover { background: color-mix(in srgb, var(--sq-a) 14%, transparent); }
.support-squad--in b { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.support-squad-tier {
  padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .3px;
  background: linear-gradient(135deg, var(--sq-a), var(--sq-b)); color: var(--sq-ink);
}
.support-squad-n[hidden] { display: none; }
/* Improvements & suggestions — while its side card is open the button turns solid
   orange with white sparkles (collapsed and expanded sidebar alike). */
.sb-community .sb-group > .sb-report-btn.is-on.is-on,
:root[data-theme="dark"] .sb-community .sb-group > .sb-report-btn.is-on.is-on {
  background: var(--primary); border-color: var(--primary); color: var(--on-accent); box-shadow: 0 0 12px color-mix(in srgb, var(--primary) 35%, transparent);
}
.sb-community .sb-group > .sb-report-btn.is-on.is-on { --ic: var(--on-accent); }
.sb-community .sb-group > .sb-report-btn.is-on.is-on > .icon { filter: none; }
/* TigerSquad rankings window (Countries League + makers) — reuses the invite's dark shell. */
.squad-board { width: min(560px, calc(100vw - 32px)); }
.squad-board .tsq-scroll { gap: 12px; padding-top: 26px; }
.sqb-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 12px; background: var(--tsq-bg2); border: 1px solid var(--tsq-line); }
.sqb-tab { flex: 1; height: 36px; border: none; border-radius: 9px; background: none; color: var(--tsq-muted); font-family: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; transition: background .15s, color .15s; }
.sqb-tab:hover { color: var(--tsq-text); }
.sqb-tab.is-on { background: linear-gradient(180deg, var(--game-orange), color-mix(in srgb, var(--game-orange) 82%, black)); color: var(--game-on-gold); }
.sqb-you { margin: 0; font-size: 13px; font-weight: 700; color: var(--tsq-orange); text-align: center; }
.sqb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sqb-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--tsq-card); border: 1px solid var(--tsq-line); }
.sqb-row.is-me { border-color: var(--tsq-orange); background: color-mix(in srgb, var(--game-orange) 10%, var(--tsq-card)); box-shadow: 0 0 14px -6px rgba(255, 146, 63, .6); }
.sqb-rank { width: 34px; flex-shrink: 0; text-align: center; font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 800; color: var(--tsq-muted); }
.sqb-medal-1 .sqb-rank { color: var(--game-gold-text); } .sqb-medal-2 .sqb-rank { color: var(--game-text-2); } .sqb-medal-3 .sqb-rank { color: var(--game-orange-text); }
.sqb-flag { font-size: 24px; line-height: 1; }
.sqb-av { flex-shrink: 0; }
.sqb-avatar { width: 34px; height: 34px; border-radius: 50%; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.sqb-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; font-weight: 700; color: var(--tsq-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sqb-name small { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--tsq-muted); }
.sqb-name small[class*="sq-"] { color: var(--sq-a); }
.sqb-name small img { width: 16px; height: 16px; }
.sqb-mini-flag { font-size: 14px; }
.sqb-xp { flex-shrink: 0; font-size: 14px; font-weight: 800; color: var(--tsq-text); font-variant-numeric: tabular-nums; }
.sqb-empty { padding: 18px; text-align: center; font-size: 13px; color: var(--tsq-muted); }
.sqb-wall { align-self: center; border: none; background: none; color: var(--tsq-muted); font-family: inherit; font-size: 12.5px; cursor: pointer; }
.sqb-wall:hover { color: var(--tsq-orange); text-decoration: underline; }
.sqb-wall[hidden] { display: none; }   /* the global button rule sets display: flex */
.sqb-row { text-align: left; }
.sqb-name { align-items: flex-start; }
.sqb-n1 { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The level badge (Bronze → Platinum art) replaces the heart on avatar corners —
   sidebar, banners, friends' lists. No disc behind it: the artwork is the shape. */
.sb-supporter-badge, .av-squad-heart { background: none; box-shadow: none; border-radius: 0; }
.sb-supporter-badge { width: 22px; height: 22px; right: -6px; bottom: -6px; }
.av-squad-heart { width: 46%; min-width: 16px; max-width: 24px; right: -5px; bottom: -5px; }
.sb-supporter-badge img, .av-squad-heart img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
/* My XP tab — achievements (earned / to unlock) + gains & losses history. */
.sqb-section { margin: 8px 2px 0; font-size: 11.5px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--tsq-muted); text-align: left; }
.sqb-ach .sqb-ach-ic { width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--tsq-bg2); border: 1px solid var(--tsq-line); }
.sqb-ach .sqb-ach-ic .icon { background: var(--tsq-muted); }
.sqb-ach.is-earned .sqb-ach-ic { background: color-mix(in srgb, var(--game-ok) 18%, transparent); border-color: color-mix(in srgb, var(--game-ok) 60%, transparent); }
.sqb-ach.is-earned .sqb-ach-ic .icon { background: var(--game-ok-text); }
.sqb-ach:not(.is-earned) { opacity: .78; }
.sqb-ach:not(.is-earned) .sqb-xp { color: var(--tsq-orange); font-size: 13px; }
.sqb-ach .sqb-name small, .sqb-hist .sqb-name small { white-space: normal; }
.sqb-delta { width: 54px; flex-shrink: 0; text-align: center; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sqb-delta.is-up { color: var(--game-ok-text); }
.sqb-delta.is-down { color: var(--game-danger-text); }
.sqb-hist .sqb-xp { font-size: 12.5px; font-weight: 700; color: var(--tsq-muted); }
/* Friends in the sidebar wear the badge at the same size and spot as my own avatar (40 px avatar, 22 px badge). */
#sbFriendsList .av-squad-heart { width: 22px; min-width: 22px; max-width: 22px; right: -6px; bottom: -6px; }
/* The friends list scrolls, so it clips on x (overflow-x: hidden) — and it was
   exactly as wide as the avatars, so a member's ring + glow and corner badge
   were cut while MY avatar (in .sb-user, which clips nothing) showed whole.
   Room inside the clip box on both sides, cancelled by a negative margin and a
   matching width so the chips do not move by a pixel. */
.sb-friends-list, .sidebar.collapsed .sb-friends-list { padding-left: 8px; padding-right: 8px; margin-left: -8px; margin-right: -8px; width: calc(100% + 16px); box-sizing: border-box; }
/* While the sidebar expands, the name + XP block grows from 0 px wide: the XP
   pill used to wrap onto an extra line (44 → 58 px tall), pushing the avatar
   and the friends list down, then snap back. Never wrap inside it — the block
   keeps its height at every width, so nothing jumps. */
.sb-user-info { overflow: hidden; }
.sb-user-info > .sb-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* Same row height collapsed and expanded (the name + XP block is 44 px tall), so
   the avatar and the friends below never shift when the sidebar folds. */
/* Same row height collapsed and expanded (the name + XP block is ~44 px tall), so
   the avatar and the friends below never shift when the sidebar folds. */
.sb-user-row { min-height: 44px; }
/* Same distance from the left edge folded or unfolded: the rail padding is
   12.5 px in both states and the friend chips add none on the left, so my avatar,
   the buttons and every friend stay put horizontally too. */
.sb-user { padding-left: 12.5px; padding-right: 12.5px; }
.sb-actions button.sb-friend-chip, button.sb-friend-chip { padding-left: 0; }
/* Folded, the action buttons were CENTRED while their width animated 215 → 40 px,
   so the Notifications button slid right then back. Left-anchored, it just narrows. */
.sidebar.collapsed .sb-actions { align-items: flex-start; }
/* The XP chip opens the rankings. */
/* Rankings window: one fixed height (opens at its final size, never grows when
   the data lands or the tab changes) + shimmering skeleton rows while loading. */
.squad-board { height: min(680px, 88vh); }
.squad-board .tsq-scroll { flex: 1; min-height: 0; }
.sqb-skel { pointer-events: none; }
.sqb-skel span, .sqb-skel i { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--ink-06) 25%, var(--ink-12) 50%, var(--ink-06) 75%); background-size: 200% 100%; animation: sqb-shimmer 1.2s ease-in-out infinite; }
.sqb-skel-a { width: 34px; height: 34px; border-radius: 50% !important; flex-shrink: 0; }
.sqb-skel-b { flex: 1; display: flex !important; flex-direction: column; gap: 6px; background: none !important; animation: none !important; }
.sqb-skel-b i:first-child { width: 45%; height: 12px; }
.sqb-skel-b i:last-child { width: 25%; height: 10px; }
.sqb-skel-c { width: 64px; height: 14px; flex-shrink: 0; }
@keyframes sqb-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .sqb-skel span, .sqb-skel i { animation: none; } }
/* World rank chip, next to the XP chip: gold community icon + "#2". */
/* TigerSquad windows (invite + rankings) scroll without a visible scrollbar. */
.squad-invite .tsq-scroll { scrollbar-width: none; }
.squad-invite .tsq-scroll::-webkit-scrollbar { width: 0; height: 0; display: none; }
/* Four tabs on one line: each takes the room its label needs. */
.sqb-tab { flex: 1 1 auto; padding: 0 10px; white-space: nowrap; font-size: 13px; }
/* Next-level explainer at the top of Achievements: current badge → next badge,
   a progress bar when the rule is a count, what to do, and the action. */
.sqb-next { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-radius: 14px; text-align: left;
  border: 1px solid color-mix(in srgb, var(--sq-a) 55%, var(--tsq-line)); background: color-mix(in srgb, var(--sq-a) 9%, var(--tsq-card)); }
.sqb-next-badges { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }
.sqb-next-badges .icon { background: var(--tsq-muted); }
.sqb-next-badge { width: 40px; height: 40px; object-fit: contain; }
.sqb-next-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sqb-next-body b { font-size: 14.5px; color: var(--sq-a); }
.sqb-next-body p { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--game-text-2); }
.sqb-next-alt { color: var(--tsq-muted) !important; font-size: 12px !important; }
.sqb-next-bar { display: block; height: 8px; border-radius: 999px; background: var(--tsq-bg2); overflow: hidden; }
.sqb-next-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--sq-b), var(--sq-a)); transition: width .4s ease-out; }
.sqb-next-count { font-size: 12px; font-weight: 800; color: var(--tsq-text); font-variant-numeric: tabular-nums; }
.sqb-next-cta { align-self: flex-start; height: 32px; padding: 0 14px; border: none; border-radius: 9px; cursor: pointer;
  background: linear-gradient(180deg, var(--game-orange), color-mix(in srgb, var(--game-orange) 82%, black)); color: var(--game-on-gold); font-family: inherit; font-size: 13px; font-weight: 800; }
.sqb-next.sq-platinum { align-items: center; }
/* TigerSquad windows (invite + rankings): a white halo of light so they stand
   out from the app behind — light rim, soft glow, gently breathing. */
.squad-invite {
  border-color: color-mix(in srgb, var(--game-text) 35%, var(--tsq-line));
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .45), 0 0 40px 6px rgba(255, 255, 255, .32), 0 0 160px 40px rgba(255, 255, 255, .16), 0 24px 70px rgba(0, 0, 0, .55);
  animation: tsq-in .24s cubic-bezier(.2, .8, .2, 1), tsq-halo 3.2s ease-in-out .3s infinite;
}
@keyframes tsq-halo {
  0%, 100% { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .45), 0 0 40px 6px rgba(255, 255, 255, .32), 0 0 160px 40px rgba(255, 255, 255, .16), 0 24px 70px rgba(0, 0, 0, .55); }
  50%      { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .6), 0 0 56px 12px rgba(255, 255, 255, .42), 0 0 220px 60px rgba(255, 255, 255, .22), 0 24px 70px rgba(0, 0, 0, .55); }
}
@media (prefers-reduced-motion: reduce) { .squad-invite { animation: none; } }
/* Joining the TigerSquad — the celebration over the invite card. */
.tsq-celebrate {
  position: absolute; inset: 0; z-index: 5; border-radius: inherit; overflow: hidden; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--sq-a) 30%, var(--dark-bg)) 0, var(--dark-bg) 58%); backdrop-filter: blur(8px);
  animation: tsq-cel-in .35s ease-out both;
}
.tsq-cel-rays { position: absolute; left: 50%; top: 42%; width: 900px; height: 900px; margin: -450px 0 0 -450px;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--sq-a) 30%, transparent) 0deg 6deg, transparent 6deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 0, transparent 60%); mask: radial-gradient(circle, #000 0, transparent 60%);
  animation: tsq-cel-spin 9s linear infinite, tsq-cel-in .6s ease-out both; }
.tsq-cel-badge { position: relative; width: 190px; height: 190px; object-fit: contain;
  filter: drop-shadow(0 0 28px color-mix(in srgb, var(--sq-a) 80%, transparent)); animation: tsq-cel-badge .9s cubic-bezier(.2, 1.4, .3, 1) .1s both; }
.tsq-cel-xp { position: relative; font-size: 30px; font-weight: 900; color: var(--game-gold); text-shadow: 0 0 18px rgba(255, 200, 61, .7); animation: tsq-cel-xp 1.6s ease-out .5s both; }
.tsq-cel-title { position: relative; font-size: 22px; font-weight: 800; color: var(--on-dark); animation: tsq-cel-up .5s ease-out .7s both; }
.tsq-cel-tier { position: relative; font-size: 15px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase; color: var(--sq-a); animation: tsq-cel-up .5s ease-out .85s both; }
.tsq-cel-sparks { position: absolute; left: 50%; top: 42%; }
.tsq-cel-sparks i { position: absolute; width: 7px; height: 7px; margin: -3.5px; border-radius: 50%;
  background: radial-gradient(circle, #fff, var(--sq-a) 60%, transparent 70%); opacity: 0;
  animation: tsq-cel-spark 1.3s cubic-bezier(.15, .7, .3, 1) calc(.25s + var(--dl)) both; }
@keyframes tsq-cel-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes tsq-cel-spin { to { transform: rotate(360deg); } }
@keyframes tsq-cel-badge { 0% { transform: scale(.2) rotate(-25deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes tsq-cel-xp { 0% { transform: translateY(16px) scale(.8); opacity: 0; } 25% { transform: translateY(0) scale(1.08); opacity: 1; } 100% { transform: translateY(-6px) scale(1); opacity: 1; } }
@keyframes tsq-cel-up { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tsq-cel-spark { 0% { transform: translate(0, 0) scale(1.4); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(.3); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .tsq-celebrate, .tsq-cel-rays, .tsq-cel-badge, .tsq-cel-xp, .tsq-cel-title, .tsq-cel-tier { animation: none; }
}
/* Level-up window: the celebration plays over it, then fades into the card. */
.squad-levelup { width: min(460px, calc(100vw - 32px)); }
.tsq-levelup-body { padding: 34px 26px 22px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.tsq-levelup-kicker { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: 3px; color: var(--sq-a); }
.tsq-levelup-from { display: flex; align-items: center; gap: 12px; margin: 6px 0; }
.tsq-levelup-from img { width: 72px; height: 72px; object-fit: contain; }
.tsq-levelup-from img:last-child { width: 120px; height: 120px; filter: drop-shadow(0 0 22px color-mix(in srgb, var(--sq-a) 70%, transparent)); }
.tsq-levelup-from .icon { background: var(--tsq-muted); }
.tsq-levelup-text { margin: 0 0 6px; font-size: 14px; line-height: 1.5; color: var(--game-text-2); }
.tsq-celebrate.is-fading { transition: opacity .5s ease; opacity: 0; }
/* Join button — on hover a light runs round its edge (a conic sweep masked to a 2 px ring). */
@property --tsq-join-ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.tsq-join { position: relative; isolation: isolate; }
.tsq-join::before {
  content: ""; position: absolute; inset: -3px; border-radius: 15px; padding: 3px; pointer-events: none;
  background: conic-gradient(from var(--tsq-join-ang), transparent 0 45%, rgba(255, 200, 120, .55) 65%, #FFF6D8 80%, #FFFFFF 84%, transparent 86%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .25s; filter: drop-shadow(0 0 4px #FFF) drop-shadow(0 0 10px rgba(255, 190, 110, .9));
}
.tsq-join:hover:not(:disabled)::before, .tsq-join:focus-visible::before { opacity: 1; animation: tsq-join-spin 1.6s linear infinite; }
@keyframes tsq-join-spin { to { --tsq-join-ang: 360deg; } }
@media (prefers-reduced-motion: reduce) { .tsq-join:hover::before { animation: none; } }
/* A member's level ring (+ glow) reaches ~4 px past the 40 px avatar and the
   badge 6 px past its corner: with the list's 3 px gap, neighbours overlapped
   and a ring cut into the face below. Room enough between chips for both. */
.sb-friends-list { gap: 10px; }
/* TigerSquad notifications: XP gained (orange star) and level climbed (the badge art itself). */
.notif-ic.notif-ic--xp { background: linear-gradient(135deg, var(--game-orange), var(--game-orange-hi)); }
.notif-ic.notif-ic--xp .icon { background: var(--on-accent); }
img.notif-ic.notif-ic--badge { background: none; border: 0; border-radius: 0; object-fit: contain; padding: 0; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35)); }

/* Web build: "Install the app" hint (iOS has no install prompt — it is
   Share → Add to Home Screen, so the button unfolds these words instead). */
.sb-install-hint { margin: 2px 4px 6px; font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.sidebar.collapsed .sb-install-hint { display: none; }
