/*
(c) Spacehubs Africa. All rights reserved.
Licensed under the Proprietary License found in the LICENSE file
in the root directory of this source tree.
*/

/* ── Pan-African palette ───────────────────────────────────────────────────
   CSS custom properties consumed directly via var(--color-sha-*) in this file
   and across the app.

   The same palette is mirrored in two other places that have different
   consumers and cannot read this file at the relevant time:
     • tailwind.config.js  theme.extend.colors  → generates the sha-* utility
       classes for the production build.
     • templates/base.html <style type="text/tailwindcss"> @theme → dev-only
       mirror for the Tailwind browser CDN (used when DEBUG).

   To add or change a colour: update it HERE, in tailwind.config.js, and in
   templates/base.html — keeping all three identical. `scripts/check_palette_sync.py`
   enforces this and fails if they drift.
────────────────────────────────────────────────────────────────────────── */
/* ── Typeface ───────────────────────────────────────────────────────────────
   Inter, self-hosted (CSP font-src allows SELF only — no external CDN). The
   variable woff2 covers weights 100–900 in one file. The Tailwind `font-sans`
   stack (tailwind.config.js + base.html @theme mirror) lists Inter first; this
   body rule guarantees it applies even before/independent of the compiled CSS.
────────────────────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-variable.260c81a4759b.woff2") format('woff2');
}

body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif,
    'Apple Color Emoji', 'Segoe UI Emoji';
}

:root {
  --color-sha-indigo-bg:     #EEF0F8;
  --color-sha-indigo-text:   #2C3E7A;
  --color-sha-indigo-border: #7A90D4;
  --color-sha-indigo:        #4A62B8;
  --color-sha-gold-bg:       #FDF6DC;
  --color-sha-gold-text:     #7A4500;
  --color-sha-gold-border:   #E8B82A;
  --color-sha-gold:          #946800;
  --color-sha-green-bg:      #E8F7EF;
  --color-sha-green-text:    #1A7A4A;
  --color-sha-green-border:  #5DC98A;
  --color-sha-green:         #1B8350;
  --color-sha-red-bg:        #FAE8E7;
  --color-sha-red-text:      #C0392B;
  --color-sha-red-border:    #E05444;
  --color-sha-red:           #E05444;
  --color-sha-teal-bg:       #E5F6F9;
  --color-sha-teal-text:     #0A6A78;
  --color-sha-teal-border:   #5DC4D4;
  --color-sha-teal:          #12A8BD;
  --color-sha-purple-bg:     #F3EEF8;
  --color-sha-purple-text:   #5C2E8A;
  --color-sha-purple-border: #B08AD4;
  --color-sha-purple:        #8B4DC8;
  --color-sha-orange-bg:     #FEF0E0;
  --color-sha-orange-text:   #B5520A;
  --color-sha-orange-border: #D97820;
  --color-sha-orange:        #D97820;
  --color-sha-stone-bg:      #F5F5F0;
  --color-sha-stone-text:    #6B6B5E;
  --color-sha-stone-border:  #9A9A88;
  --color-sha-stone:         #9A9A88;
  --color-sha-sky-bg:        #E0F5FB;
  --color-sha-sky-text:      #075985;
  --color-sha-sky-border:    #0EA5E9;
  --color-sha-sky:           #0EA5E9;

  --surface:                 #ffffff;
  --surface-raised:          #ffffff;
  --surface-muted:           #f8fafc;
  --surface-subtle:          #f1f5f9;
  --surface-disabled:        #f3f4f6;
  --surface-inverse:         #111827;
  --text-primary:            #0f172a;
  --text-secondary:          #334155;
  --text-muted:              #64748b;
  --text-subtle:             #94a3b8;
  --text-disabled:           #9ca3af;
  --text-inverse:            #ffffff;
  --border:                  #e2e8f0;
  --border-subtle:           #f1f5f9;
  --border-strong:           #cbd5e1;
  --border-input:            #d1d5db;
  --focus-ring:              rgba(74, 98, 184, 0.2);
  --focus-ring-strong:       rgba(74, 98, 184, 0.3);
  --overlay-surface:         rgba(255, 255, 255, 0.78);
  --shadow-sm:               rgba(0, 0, 0, 0.04);
  --shadow-md:               rgba(0, 0, 0, 0.10);
  --scrollbar-thumb:         rgba(0, 0, 0, 0.28);
  --scrollbar-thumb-hover:   rgba(0, 0, 0, 0.42);
}

html.dark {
  /* SHA palette dark overrides — deep tints that work on dark surfaces.
     Only the -bg, -text, and -border variants change; the base accent
     colours (sha-indigo, sha-gold, etc.) are vibrant enough to read on
     both light and dark backgrounds and are left unchanged. */
  --color-sha-indigo-bg:     #1a2545;
  --color-sha-indigo-text:   #8ba4e8;
  --color-sha-indigo-border: #3d5599;
  --color-sha-gold-bg:       #2a1e04;
  --color-sha-gold-text:     #d4901a;
  --color-sha-gold-border:   #7a5200;
  --color-sha-green-bg:      #0d2218;
  --color-sha-green-text:    #4acc8a;
  --color-sha-green-border:  #1a6038;
  --color-sha-red-bg:        #280f0f;
  --color-sha-red-text:      #f07060;
  --color-sha-red-border:    #903030;
  --color-sha-teal-bg:       #0a1e22;
  --color-sha-teal-text:     #2bbccc;
  --color-sha-teal-border:   #1a6878;
  --color-sha-purple-bg:     #1e1230;
  --color-sha-purple-text:   #a060d8;
  --color-sha-purple-border: #603090;
  --color-sha-orange-bg:     #281600;
  --color-sha-orange-text:   #d07820;
  --color-sha-orange-border: #804a08;
  --color-sha-stone-bg:      #1c1c18;
  --color-sha-stone-text:    #a8a898;
  --color-sha-stone-border:  #606050;
  --color-sha-sky-bg:        #0a1e28;
  --color-sha-sky-text:      #38b8e0;
  --color-sha-sky-border:    #0d5a80;

  --surface:                 #0f172a;
  --surface-raised:          #1e293b;
  --surface-muted:           #0b1120;
  --surface-subtle:          #1e293b;
  --surface-disabled:        #374151;
  --surface-inverse:         #f8fafc;
  --text-primary:            #f1f5f9;
  --text-secondary:          #cbd5e1;
  --text-muted:              #94a3b8;
  --text-subtle:             #64748b;
  --text-disabled:           #6b7280;
  --text-inverse:            #0f172a;
  --border:                  #334155;
  --border-subtle:           #1e293b;
  --border-strong:           #475569;
  --border-input:            #4b5563;
  --focus-ring:              rgba(74, 98, 184, 0.3);
  --focus-ring-strong:       rgba(74, 98, 184, 0.4);
  --overlay-surface:         rgba(15, 23, 42, 0.82);
  --shadow-sm:               rgba(0, 0, 0, 0.25);
  --shadow-md:               rgba(0, 0, 0, 0.50);
  --scrollbar-thumb:         rgba(255, 255, 255, 0.18);
  --scrollbar-thumb-hover:   rgba(255, 255, 255, 0.32);
}

/* ── SHA palette opacity utilities ─────────────────────────────────────────
   Tailwind cannot apply opacity modifiers to CSS-variable color values, so
   opacity variants are defined here via color-mix(). The solid sha-* classes
   (bg/text/border) are generated by Tailwind using var(--color-sha-*) and
   automatically pick up dark-mode overrides from html.dark { ... } above. */

.bg-sha-indigo-bg\/30  { background-color: color-mix(in srgb, var(--color-sha-indigo-bg) 30%, transparent) !important; }
.bg-sha-indigo-bg\/60  { background-color: color-mix(in srgb, var(--color-sha-indigo-bg) 60%, transparent) !important; }
.bg-sha-indigo-bg\/80  { background-color: color-mix(in srgb, var(--color-sha-indigo-bg) 80%, transparent) !important; }
.bg-sha-gold-bg\/60    { background-color: color-mix(in srgb, var(--color-sha-gold-bg) 60%, transparent) !important; }
.bg-sha-gold-bg\/70    { background-color: color-mix(in srgb, var(--color-sha-gold-bg) 70%, transparent) !important; }
.bg-sha-red-bg\/60     { background-color: color-mix(in srgb, var(--color-sha-red-bg) 60%, transparent) !important; }
.bg-sha-teal-bg\/40    { background-color: color-mix(in srgb, var(--color-sha-teal-bg) 40%, transparent) !important; }
.bg-sha-teal-bg\/60    { background-color: color-mix(in srgb, var(--color-sha-teal-bg) 60%, transparent) !important; }
.bg-sha-purple-bg\/60  { background-color: color-mix(in srgb, var(--color-sha-purple-bg) 60%, transparent) !important; }
.bg-sha-orange-bg\/40  { background-color: color-mix(in srgb, var(--color-sha-orange-bg) 40%, transparent) !important; }
.bg-sha-orange-bg\/60  { background-color: color-mix(in srgb, var(--color-sha-orange-bg) 60%, transparent) !important; }

/* Contextual rail accent — set via data-accent on a rail root so rail chrome
   themes from the shared SHA token pipeline instead of a hardcoded indigo.
   Defaults to indigo; collaboration/satellite contexts read teal. */
[data-accent] {
  --rail-accent:        var(--color-sha-indigo);
  --rail-accent-bg:     var(--color-sha-indigo-bg);
  --rail-accent-border: var(--color-sha-indigo-border);
  --rail-accent-text:   var(--color-sha-indigo-text);
}
[data-accent="collabs"],
[data-accent="satellites"] {
  --rail-accent:        var(--color-sha-teal);
  --rail-accent-bg:     var(--color-sha-teal-bg);
  --rail-accent-border: var(--color-sha-teal-border);
  --rail-accent-text:   var(--color-sha-teal-text);
}
[data-accent="companies"] {
  --rail-accent:        var(--color-sha-gold);
  --rail-accent-bg:     var(--color-sha-gold-bg);
  --rail-accent-border: var(--color-sha-gold-border);
  --rail-accent-text:   var(--color-sha-gold-text);
}
[data-accent="agencies"] {
  --rail-accent:        var(--color-sha-red);
  --rail-accent-bg:     var(--color-sha-red-bg);
  --rail-accent-border: var(--color-sha-red-border);
  --rail-accent-text:   var(--color-sha-red-text);
}
[data-accent="academia"] {
  --rail-accent:        var(--color-sha-purple);
  --rail-accent-bg:     var(--color-sha-purple-bg);
  --rail-accent-border: var(--color-sha-purple-border);
  --rail-accent-text:   var(--color-sha-purple-text);
}
[data-accent="nonprofits"] {
  --rail-accent:        var(--color-sha-orange);
  --rail-accent-bg:     var(--color-sha-orange-bg);
  --rail-accent-border: var(--color-sha-orange-border);
  --rail-accent-text:   var(--color-sha-orange-text);
}
[data-accent="clubs"] {
  --rail-accent:        var(--color-sha-stone);
  --rail-accent-bg:     var(--color-sha-stone-bg);
  --rail-accent-border: var(--color-sha-stone-border);
  --rail-accent-text:   var(--color-sha-stone-text);
}

.bg-surface { background-color: var(--surface); }
.bg-surface\/55 { background-color: color-mix(in srgb, var(--surface) 55%, transparent); }
.bg-surface\/95 { background-color: color-mix(in srgb, var(--surface) 95%, transparent); }
.bg-surface-raised { background-color: var(--surface-raised); }
.bg-surface-muted { background-color: var(--surface-muted); }
.bg-surface-subtle { background-color: var(--surface-subtle); }
.bg-surface-disabled { background-color: var(--surface-disabled); }
.bg-surface-inverse { background-color: var(--surface-inverse); }
.hover\:bg-surface-muted:hover { background-color: var(--surface-muted); }
.hover\:bg-surface-subtle:hover { background-color: var(--surface-subtle); }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-subtle { color: var(--text-subtle); }
.text-disabled { color: var(--text-disabled); }
.text-inverse { color: var(--text-inverse); }
.hover\:text-secondary:hover { color: var(--text-secondary); }
.hover\:text-muted:hover { color: var(--text-muted); }
.border-border { border-color: var(--border); }
.border-border-subtle { border-color: var(--border-subtle); }
.border-border-strong { border-color: var(--border-strong); }
.border-input { border-color: var(--border-input); }
.divide-border > :not([hidden]) ~ :not([hidden]) { border-color: var(--border); }
.divide-border-strong > :not([hidden]) ~ :not([hidden]) { border-color: var(--border-strong); }
.ring-border { --tw-ring-color: var(--border); }
.ring-border-strong { --tw-ring-color: var(--border-strong); }
.placeholder-muted::placeholder { color: var(--text-subtle); }

/* iOS Safari auto-zooms when a focused field's font-size is < 16px. Force a
   16px minimum on small screens across all text-entry controls. The !important
   is needed to override Tailwind utility classes (e.g. text-sm) and component
   classes (.form-input) that set a smaller size on these inputs. */
@media (max-width: 639px) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* Keep scrollbars subtle but still easy to grab. */

* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover);
    border-radius: 999px;
    cursor: pointer;
}

/* While the cookie consent banner occupies the bottom of the viewport, hide
   bottom-anchored floating UI (the database speed-dial FAB) so the two don't
   overlap. The body class is toggled by the consent banner script. */
body.sha-consent-open #mobileQuickActions {
    display: none;
}

/* Auth pages + empty states use this as a subtle background wash. */
.gradient-bg {
    background:
        radial-gradient(1200px circle at 20% 10%, color-mix(in srgb, var(--color-sha-indigo) 10%, transparent), transparent 40%),
        radial-gradient(900px circle at 80% 30%, color-mix(in srgb, var(--color-sha-sky) 10%, transparent), transparent 40%),
        linear-gradient(180deg, var(--surface-muted), var(--surface) 40%);
}

.hover-opacity-85:hover {
    opacity: 0.85;
}

.hover-bg-sha-indigo-text:hover {
    background-color: var(--color-sha-indigo-text);
}

.sha-green-cta {
    background-color: var(--color-sha-green);
}

.sha-green-cta:hover {
    background-color: var(--color-sha-green-text);
}

.sha-gold-cta {
    background-color: var(--color-sha-gold);
}

.sha-gold-cta:hover {
    background-color: var(--color-sha-gold-text);
}

/* ── Mobile nav drawer ──────────────────────────────────────────────────────
   The drawer overlay (#mobileNavDrawer) is toggled via the `hidden` class by
   the shared initDropdown() helper. These animations play each time the panel
   is revealed (display:none → block restarts CSS animations). The panel sits on
   the inline-end side, so it slides in from the end; RTL flips the direction. */
@keyframes sha-drawer-in {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}
@keyframes sha-drawer-in-rtl {
    from { transform: translateX(-100%); }
    to   { transform: translateX(0); }
}
@keyframes sha-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.sha-drawer-panel { animation: sha-drawer-in 0.22s ease-out; will-change: transform; }
[dir="rtl"] .sha-drawer-panel { animation-name: sha-drawer-in-rtl; }
.sha-drawer-backdrop { animation: sha-fade-in 0.22s ease-out; }

@media (prefers-reduced-motion: reduce) {
    .sha-drawer-panel, .sha-drawer-backdrop { animation: none; }
}

/* Arabic (ar) RTL overrides
   The <html dir="rtl"> attribute is set by base.html when LANGUAGE_CODE == 'ar'.
   Browsers handle inline text direction automatically. These rules fix the
   structural elements that use physical (left/right) CSS properties.
*/

/* Desktop user-menu dropdown: re-anchor to the left edge in RTL */
[dir="rtl"] #user-menu {
    right: auto;
    left: 0;
}

/* ── Shared component styles ────────────────────────────────────────────────── */

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 42px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: var(--border); transition: .2s; border-radius: 9999px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 2px; top: 2px; background: var(--surface); transition: .2s; border-radius: 9999px; box-shadow: 0 1px 2px color-mix(in srgb, var(--surface-inverse) 20%, transparent); }
.switch input:checked + .slider { background: var(--color-sha-indigo); }
.switch input:checked + .slider:before { transform: translateX(20px); }

/* amCharts export menu */
.am5-exporting-menu { z-index: 1000 !important; background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: 8px !important; padding: 4px !important; box-shadow: 0 10px 15px -3px var(--shadow-md) !important; }
.am5-exporting-icon { width: 24px !important; height: 24px !important; padding: 4px !important; opacity: 0.6 !important; transition: opacity 0.2s !important; }
.am5-exporting-icon:hover { opacity: 1 !important; background: var(--surface-subtle) !important; border-radius: 4px !important; }
.am5-exporting-list { list-style: none !important; margin: 0 !important; padding: 0 !important; }
.am5-exporting-item { padding: 8px 12px !important; font-size: 13px !important; color: var(--text-muted) !important; cursor: pointer !important; border-radius: 4px !important; }
.am5-exporting-item:hover { background: var(--color-sha-indigo-bg) !important; color: var(--color-sha-indigo) !important; }

/* ── RTL overrides ──────────────────────────────────────────────────────────── */

/* Toggle switch knob: start from the right side */
[dir="rtl"] .slider:before {
    left: auto;
    right: 2px;
}

/* Toggle switch: knob slides left (negative) in RTL */
[dir="rtl"] input:checked + .slider:before {
    transform: translateX(-18px);
}

/* Form text inputs: right-align text for Arabic */
[dir="rtl"] input[type="text"],
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="password"],
[dir="rtl"] input[type="search"],
[dir="rtl"] textarea,
[dir="rtl"] select {
    text-align: right;
    direction: rtl;
}

/* ── Skeleton Screens ───────────────────────────────────────────────────────── */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.skeleton {
    background-color: var(--surface-disabled);
    border-radius: 0.75rem;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    position: relative;
    overflow: hidden;
}

/* Specific skeleton variants */
.skeleton-chart { min-height: 10rem; width: 100%; }
.skeleton-card { min-height: 10rem; width: 100%; }

/* For amCharts containers: hide skeleton once .loaded is added */
.chart-skeleton {
    background-color: var(--surface-muted);
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    border-radius: 0.5rem;
}

.chart-skeleton.loaded {
    background-color: transparent;
    animation: none;
}

/* ── Premium lock overlay (country detail + analytics) ─────────────────── */
.premium-lock-overlay {
    position: absolute; inset: 0; z-index: 20;
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 3.5rem;
}
.premium-lock-overlay-bg {
    position: absolute; inset: 0;
    background: var(--overlay-surface);
    backdrop-filter: blur(3px);
    border-radius: 0.75rem;
}
.premium-lock-card {
    position: relative; z-index: 10;
    text-align: center;
    background: var(--surface-raised);
    border: 1px solid var(--color-sha-gold-border);
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px color-mix(in srgb, var(--surface-inverse) 8%, transparent), 0 8px 10px -6px color-mix(in srgb, var(--surface-inverse) 5%, transparent);
    padding: 2rem 2rem 1.75rem;
    max-width: 22rem;
    margin: 0 1rem;
}
.premium-lock-icon {
    display: flex; align-items: center; justify-content: center;
    width: 3.5rem; height: 3.5rem;
    border-radius: 9999px;
    background: var(--color-sha-gold-bg);
    border: 1px solid var(--color-sha-gold-border);
    margin: 0 auto 1rem;
}
.premium-lock-skeleton-bg {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2.5rem;
    pointer-events: none;
    user-select: none;
    filter: blur(3px);
    opacity: 0.25;
}
.tab-content-blurred {
    pointer-events: none;
    user-select: none;
    filter: blur(3px);
    opacity: 0.2;
}

/* ── Chart-upsell card: single consolidated component ───────────────────────
   Shared across country tabs and the database overview upsell. Two tiers via
   modifier classes: --premium (paywall, gold/crown) and --free (sign-in,
   indigo). Palette tokens only; no fabricated chart previews. */
.premium-teaser {
    border: 1px solid transparent; border-radius: 1rem;
    padding: 1.25rem 1.5rem;
}
.premium-teaser__body { display: flex; flex-direction: column; gap: 1.25rem; }
@media (min-width: 640px) {
  .premium-teaser__body { flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 1.5rem; }
}
.premium-teaser__eyebrow { font-size: 0.8125rem; font-weight: 600; margin: 0 0 0.35rem; }
.premium-teaser__title { font-size: 1.25rem; line-height: 1.25; font-weight: 700; color: var(--text-primary); margin: 0; }
.premium-teaser__desc { margin: 0.5rem 0 0; font-size: 0.875rem; color: var(--text-secondary); max-width: 44rem; }
.premium-teaser__chips { list-style: none; margin: 0.9rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.premium-teaser__chip {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.25rem 0.65rem; border-radius: 9999px;
    font-size: 0.75rem; font-weight: 500;
    border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary);
}
.premium-teaser__chip-icon { font-size: 0.6875rem; }
.premium-teaser__context { margin: 0.9rem 0 0; font-size: 0.75rem; opacity: 0.85; }
.premium-teaser__cta {
    display: inline-flex; align-items: center; flex-shrink: 0;
    color: var(--text-inverse);
    padding: 0.6rem 1.1rem; border-radius: 0.6rem;
    font-size: 0.875rem; font-weight: 600; text-decoration: none;
    white-space: nowrap; transition: opacity 0.15s;
}
.premium-teaser__cta:hover { opacity: 0.9; }

/* Premium tier — gold (paywall → Upgrade) */
.premium-teaser--premium { background: linear-gradient(135deg, var(--color-sha-gold-bg), var(--surface) 72%); border-color: var(--color-sha-gold-border); }
.premium-teaser--premium .premium-teaser__eyebrow { color: var(--color-sha-gold-text); }
.premium-teaser--premium .premium-teaser__chip-icon { color: var(--color-sha-gold); }
.premium-teaser--premium .premium-teaser__context { color: var(--color-sha-gold-text); }
.premium-teaser--premium .premium-teaser__cta { background: var(--color-sha-gold); }

/* Free tier — indigo (sign-in → Free Member) */
.premium-teaser--free { background: linear-gradient(135deg, var(--color-sha-indigo-bg), var(--surface) 72%); border-color: var(--color-sha-indigo-border); }
.premium-teaser--free .premium-teaser__eyebrow { color: var(--color-sha-indigo-text); }
.premium-teaser--free .premium-teaser__chip-icon { color: var(--color-sha-indigo); }
.premium-teaser--free .premium-teaser__context { color: var(--color-sha-indigo-text); }
.premium-teaser--free .premium-teaser__cta { background: var(--color-sha-indigo); }

/* Stacked/narrow variant — for rails (lg:w-96). Vertical body, full-width CTA,
   never switches to the side-by-side layout regardless of viewport width. */
.premium-teaser--stacked { padding: 1.25rem; }
.premium-teaser--stacked .premium-teaser__body { flex-direction: column; align-items: stretch; gap: 1rem; }
.premium-teaser--stacked .premium-teaser__title { font-size: 1.125rem; }
.premium-teaser--stacked .premium-teaser__cta { width: 100%; justify-content: center; }

/* ── Ranked bar rows ── used in chartsPane, collab rail, country rail */
.chart-rank-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.chart-rank-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  border-radius: 0.5rem;
  padding: 0.375rem 0.5rem;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

a.chart-rank-row:hover,
a.chart-rank-row:focus {
  background: var(--rail-accent-bg, var(--surface-subtle));
  outline: none;
}

a.chart-rank-row:focus-visible {
  box-shadow: 0 0 0 3px var(--focus-ring-strong);
}

.chart-rank-label {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-rank-label--media {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.chart-rank-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.chart-rank-share,
.chart-rank-index {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.chart-rank-value {
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.chart-rank-bar {
  height: 0.25rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
  margin-top: 0.375rem;
}

.chart-rank-fill {
  display: block;
  height: 100%;
  min-width: 0.25rem;
  border-radius: inherit;
  background: var(--color-sha-indigo);
}

.chart-rank-empty {
  display: flex;
  min-height: 4rem;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
  border-radius: 0.75rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: center;
}
