@charset "UTF-8";
/* ==========================================================================
   PULSE DESIGN SYSTEM v1.0
   Prediction markets for CIS. Premium dark theme.
   --------------------------------------------------------------------------
   Drop-in replacement for assets/css/flash.css:
   every legacy class name and every legacy CSS variable is preserved,
   so existing Blade templates keep working without edits.

   Layout of this file
   01  Fonts
   02  Design tokens
   03  Legacy token aliases
   04  Reset & base
   05  Ambient background
   06  Typography & text utilities
   07  Layout primitives
   08  Header / navigation
   09  Sub-nav, filters, segmented control
   10  Buttons
   11  Badges, chips, pills, live dot
   12  Forms
   13  Surfaces & cards
   14  Market card (pm-card) & probability visuals
   15  Market rows (event outcomes)
   16  Market detail page
   17  Trade panel & trade sheet
   18  Sidebar modules
   19  Tables & leaderboard
   20  Pagination
   21  Feedback: alerts, toasts, empty, skeleton
   22  Footer
   23  Mobile navigation
   24  Admin (cp) shell
   25  Animations
   26  Responsive
   27  Accessibility & print
   ========================================================================== */

/* ==========================================================================
   01  FONTS
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&family=JetBrains+Mono:wght@500;600;700&display=swap');

/* ==========================================================================
   02  DESIGN TOKENS
   ========================================================================== */
:root {
    /* ---- Foundation: cool near-black, 5 elevation steps ---- */
    --pulse-void:        #06070b;
    --pulse-bg:          #0a0c12;
    --surface-0:         #0d1018;
    --surface-1:         #10131c;
    --surface-2:         #161a26;
    --surface-3:         #1d2231;
    --surface-4:         #262d3f;
    --surface-inset:     rgba(255, 255, 255, 0.028);
    --surface-hover:     rgba(255, 255, 255, 0.055);
    --surface-active:    rgba(255, 255, 255, 0.085);
    --surface-glass:     rgba(16, 19, 28, 0.72);

    /* ---- Borders ---- */
    --border-subtle:     rgba(255, 255, 255, 0.055);
    --border-default:    rgba(255, 255, 255, 0.09);
    --border-strong:     rgba(255, 255, 255, 0.16);
    --border-brand:      rgba(108, 92, 255, 0.38);

    /* ---- Text ---- */
    --text-primary:      #edf1f7;
    --text-body:         rgba(237, 241, 247, 0.72);
    --text-dim:          rgba(237, 241, 247, 0.46);
    --text-faint:        rgba(237, 241, 247, 0.26);
    --text-on-brand:     #ffffff;

    /* ---- Brand: Pulse Violet -> Signal Cyan ---- */
    --brand-300:         #a99dff;
    --brand-400:         #8b7cff;
    --brand-500:         #6c5cff;
    --brand-600:         #5647e0;
    --brand-700:         #4235b8;
    --brand-soft:        rgba(108, 92, 255, 0.12);
    --brand-softer:      rgba(108, 92, 255, 0.06);
    --brand-glow:        rgba(108, 92, 255, 0.34);

    --cyan-400:          #4ae0f5;
    --cyan-500:          #22d3ee;
    --cyan-600:          #0eb3cc;
    --cyan-soft:         rgba(34, 211, 238, 0.12);

    /* ---- Market semantics: YES / NO ---- */
    --yes-400:           #35e6a8;
    --yes-500:           #00d68f;
    --yes-600:           #00b87a;
    --yes-soft:          rgba(0, 214, 143, 0.12);
    --yes-softer:        rgba(0, 214, 143, 0.06);
    --yes-border:        rgba(0, 214, 143, 0.3);
    --yes-glow:          rgba(0, 214, 143, 0.28);

    --no-400:            #ff7189;
    --no-500:            #ff4d6a;
    --no-600:            #e63a56;
    --no-soft:           rgba(255, 77, 106, 0.12);
    --no-softer:         rgba(255, 77, 106, 0.06);
    --no-border:         rgba(255, 77, 106, 0.3);
    --no-glow:           rgba(255, 77, 106, 0.26);

    /* ---- Status ---- */
    --amber-500:         #ffb020;
    --amber-soft:        rgba(255, 176, 32, 0.12);
    --info-500:          #3b9eff;
    --info-soft:         rgba(59, 158, 255, 0.12);
    --gold-500:          #e8c275;
    --gold-soft:         rgba(232, 194, 117, 0.12);

    /* ---- Category accents (subnav taxonomy) ---- */
    --cat-politics:      #ff7a5a;
    --cat-sports:        #00d68f;
    --cat-crypto:        #f7a93b;
    --cat-technology:    #6c5cff;
    --cat-business:      #22d3ee;
    --cat-culture:       #e879f9;
    --cat-fun:           #fb7185;
    --cat-world:         #38bdf8;
    --cat-science:       #a3e635;

    /* ---- Gradients ---- */
    --gradient-brand:    linear-gradient(135deg, #8b7cff 0%, #6c5cff 48%, #22d3ee 130%);
    --gradient-brand-dim:linear-gradient(135deg, rgba(139, 124, 255, 0.16), rgba(34, 211, 238, 0.08));
    --gradient-yes:      linear-gradient(90deg, #00b87a 0%, #35e6a8 100%);
    --gradient-no:       linear-gradient(90deg, #e63a56 0%, #ff7189 100%);
    --gradient-gold:     linear-gradient(135deg, #f4dda8 0%, #e8c275 55%, #c79a4b 100%);
    --gradient-surface:  linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012));
    --gradient-sheen:    linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.07) 50%, transparent 80%);

    /* ---- Radii ---- */
    --r-xs:   8px;
    --r-sm:   12px;
    --r-md:   16px;
    --r-lg:   20px;
    --r-xl:   28px;
    --r-pill: 999px;

    /* ---- Spacing (4px base) ---- */
    --s-1: 4px;   --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
    --s-5: 20px;  --s-6: 24px;  --s-8: 32px;  --s-10: 40px;
    --s-12: 48px; --s-14: 56px; --s-18: 72px;

    /* ---- Elevation ---- */
    --e-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --e-2: 0 4px 16px -4px rgba(0, 0, 0, 0.5);
    --e-3: 0 12px 32px -8px rgba(0, 0, 0, 0.6);
    --e-4: 0 24px 64px -12px rgba(0, 0, 0, 0.72);
    --e-brand: 0 8px 32px -8px var(--brand-glow);
    --e-yes:   0 8px 28px -10px var(--yes-glow);
    --e-no:    0 8px 28px -10px var(--no-glow);
    --ring:    0 0 0 3px rgba(108, 92, 255, 0.32);
    --ring-yes:0 0 0 3px rgba(0, 214, 143, 0.28);
    --ring-no: 0 0 0 3px rgba(255, 77, 106, 0.28);

    /* ---- Typography ---- */
    --font-ui:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    --font-num:     'JetBrains Mono', 'SFMono-Regular', ui-monospace, monospace;

    --fs-micro:   11px;
    --fs-xs:      12px;
    --fs-sm:      13px;
    --fs-base:    14px;
    --fs-md:      15px;
    --fs-lg:      17px;
    --fs-xl:      20px;
    --fs-2xl:     24px;
    --fs-3xl:     30px;
    --fs-4xl:     38px;
    --fs-5xl:     48px;

    /* ---- Motion ---- */
    --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --ease-spring: cubic-bezier(0.34, 1.46, 0.64, 1);
    --t-fast:   130ms;
    --t-base:   200ms;
    --t-slow:   320ms;
    --t-slower: 520ms;

    /* ---- Layout ---- */
    --container:     1400px;
    --header-h:      64px;
    --subnav-h:      52px;
    --mobile-nav-h:  62px;
    --z-base: 1; --z-sticky: 40; --z-header: 60; --z-drawer: 80; --z-modal: 100; --z-toast: 120;
}

/* ==========================================================================
   03  LEGACY TOKEN ALIASES
   Blade templates reference these directly in inline styles. Keep them.
   ========================================================================== */
:root {
    --bg-base:            var(--pulse-bg);
    --bg:                 var(--pulse-bg);
    --bg-raised:          var(--surface-1);
    --bg-panel:           var(--surface-1);
    --bg-panel-strong:    var(--surface-3);
    --bg-soft:            var(--surface-inset);
    --bg-soft-hover:      var(--surface-hover);
    --bg-card:            var(--surface-1);
    --bg-card-hover:      var(--surface-2);

    --border:             var(--border-default);
    --border-soft:        var(--border-subtle);
    --color-border-glass: var(--border-subtle);

    --accent:             var(--brand-500);
    --accent-metal:       var(--brand-400);
    --accent-metal-soft:  var(--brand-300);
    --accent-indigo:      var(--brand-500);
    --accent-indigo-soft: var(--brand-400);
    --accent-emerald:     var(--yes-600);
    --accent-secondary:   var(--cyan-500);

    --success:            var(--yes-500);
    --danger:             var(--no-500);
    --green:              var(--yes-500);
    --red:                var(--no-500);

    --text:               var(--text-primary);
    --text-secondary:     var(--text-body);
    --text-muted:         var(--text-dim);
    --color-text-primary: var(--text-primary);
    --color-cyan:         var(--cyan-500);

    --gradient-primary:   var(--gradient-brand);
    --gradient-accent:    var(--gradient-brand);
    --gradient-secondary: var(--gradient-brand-dim);
    --gradient-success:   var(--gradient-yes);

    --radius-xs:   var(--r-xs);
    --radius-sm:   var(--r-sm);
    --radius-md:   var(--r-md);
    --radius-lg:   var(--r-lg);
    --radius-pill: var(--r-pill);

    --shadow-card: var(--e-3);
    --shadow-soft: var(--e-2);
    --shadow-glow: var(--e-brand);

    --transition:  var(--t-base) var(--ease-out);
    --font:        var(--font-ui);
    --font-heading:var(--font-display);
    --font-mono:   var(--font-num);
}

/* ==========================================================================
   04  RESET & BASE
   ========================================================================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    color-scheme: dark;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    min-height: 100dvh;
    background: var(--pulse-bg);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: var(--fs-base);
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: -0.006em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'cv05' 1, 'ss03' 1;
    overflow-x: hidden;
    position: relative;
    padding-bottom: env(safe-area-inset-bottom);
}

/* Hard lock to dark: never let the OS flip us to light */
@media (prefers-color-scheme: light) {
    html, body { background: var(--pulse-bg) !important; color: var(--text-primary) !important; }
    input, select, textarea {
        background: var(--surface-inset) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-default) !important;
    }
}
input, select, textarea, button { color-scheme: dark; font-family: inherit; }

a { color: inherit; text-decoration: none; transition: color var(--t-fast) var(--ease-out); }
a:hover { color: var(--brand-300); }
button { border: none; background: none; color: inherit; cursor: pointer; font: inherit; }
img, svg, video { display: block; max-width: 100%; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }
hr { border: none; border-top: 1px solid var(--border-subtle); margin: var(--s-5) 0; }

::selection { background: var(--brand-500); color: #fff; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--surface-4) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--surface-4);
    border-radius: var(--r-pill);
    border: 3px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); background-clip: content-box; }
.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* ==========================================================================
   05  AMBIENT BACKGROUND
   Two soft brand auroras + a fine grid. Fixed, GPU-cheap, never scrolls.
   ========================================================================== */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(58rem 34rem at 12% -8%, rgba(108, 92, 255, 0.17), transparent 62%),
        radial-gradient(46rem 30rem at 96% 4%, rgba(34, 211, 238, 0.09), transparent 60%),
        radial-gradient(60rem 40rem at 50% 118%, rgba(0, 214, 143, 0.07), transparent 62%),
        linear-gradient(180deg, #0b0e16 0%, var(--pulse-void) 100%);
}
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.5;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(80% 60% at 50% 0%, #000 0%, transparent 78%);
    -webkit-mask-image: radial-gradient(80% 60% at 50% 0%, #000 0%, transparent 78%);
}

/* ==========================================================================
   06  TYPOGRAPHY & TEXT UTILITIES
   ========================================================================== */
h1, h2, h3, h4, h5 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: var(--text-primary);
}
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }

.font-heading { font-family: var(--font-display); letter-spacing: -0.025em; }
.font-num, .num {
    font-family: var(--font-num);
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum' 1, 'zero' 1;
    letter-spacing: -0.02em;
}
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.eyebrow, .section-kicker {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--brand-300);
    margin-bottom: var(--s-2);
}
.section-kicker { color: var(--text-dim); }

.page-title {
    font-family: var(--font-display);
    font-size: var(--fs-2xl);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: var(--s-2);
}

.text-gradient {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.text-gradient-gold {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-green  { color: var(--yes-500) !important; }
.text-red    { color: var(--no-500) !important; }
.text-cyan   { color: var(--cyan-500) !important; }
.text-brand  { color: var(--brand-400) !important; }
.text-gold   { color: var(--gold-500) !important; }
.text-amber  { color: var(--amber-500) !important; }
.text-secondary { color: var(--text-body); }
.text-muted     { color: var(--text-dim); }
.text-faint     { color: var(--text-faint); }

.text-micro { font-size: var(--fs-micro); }
.text-xs    { font-size: var(--fs-xs); }
.text-sm    { font-size: var(--fs-sm); }
.text-lg    { font-size: var(--fs-lg); }
.text-center{ text-align: center; }
.text-right { text-align: right; }
.uppercase  { text-transform: uppercase; letter-spacing: 0.1em; }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ==========================================================================
   07  LAYOUT PRIMITIVES
   ========================================================================== */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--s-4);
}
.page-container { padding-block: var(--s-6) var(--s-12); }
.main-shell { min-height: 60vh; padding-bottom: var(--s-18); }

.page-layout { display: grid; grid-template-columns: 1fr; gap: var(--s-6); align-items: start; }
.section-shell { margin-bottom: var(--s-10); }

.section-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--s-4);
    margin: var(--s-10) 0 var(--s-5);
}
.section-heading h2 {
    font-size: var(--fs-xl);
    letter-spacing: -0.03em;
}
.section-heading + .section-heading { margin-top: var(--s-6); }

/* Headline / hero strip */
.headline-shell {
    position: relative;
    display: grid;
    gap: var(--s-6);
    padding: var(--s-8) var(--s-6);
    margin-bottom: var(--s-8);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-xl);
    background:
        radial-gradient(34rem 20rem at 0% 0%, rgba(108, 92, 255, 0.14), transparent 60%),
        radial-gradient(30rem 18rem at 100% 100%, rgba(34, 211, 238, 0.08), transparent 60%),
        var(--surface-1);
    box-shadow: var(--e-3);
    overflow: hidden;
}
.headline-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-surface);
    pointer-events: none;
}
.headline-title {
    font-family: var(--font-display);
    font-size: clamp(26px, 4.4vw, var(--fs-4xl));
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.06;
    margin-bottom: var(--s-3);
}
.headline-copy {
    max-width: 62ch;
    font-size: var(--fs-md);
    color: var(--text-body);
    line-height: 1.65;
}
.headline-metrics { display: flex; flex-wrap: wrap; gap: var(--s-3); position: relative; }

.metric-pill {
    flex: 1 1 140px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--s-3) var(--s-4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-md);
    background: var(--surface-inset);
    backdrop-filter: blur(12px);
    transition: border-color var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out);
}
.metric-pill:hover { border-color: var(--border-brand); transform: translateY(-2px); }
.metric-pill span {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-dim);
}
.metric-pill strong {
    font-family: var(--font-num);
    font-size: var(--fs-xl);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}

/* Flex / grid utilities (legacy names) */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.grid { display: grid; }
.w-full { width: 100%; }
.gap-xs { gap: var(--s-1); }
.gap-sm { gap: var(--s-2); }
.gap-md { gap: var(--s-4); }
.gap-lg { gap: var(--s-6); }
.mb-xs { margin-bottom: var(--s-1); }
.mb-sm { margin-bottom: var(--s-2); }
.mb-md { margin-bottom: var(--s-4); }
.mb-lg { margin-bottom: var(--s-6); }
.mt-sm { margin-top: var(--s-2); }
.mt-md { margin-top: var(--s-4); }
.mt-lg { margin-top: var(--s-6); }
.ml-sm { margin-left: var(--s-2); }
.p-lg { padding: var(--s-6); }
.is-gap { gap: var(--s-2); }
.rounded-sm { border-radius: var(--r-xs); }
.rounded    { border-radius: var(--r-sm); }
.rounded-lg { border-radius: var(--r-md); }
.rounded-xl { border-radius: var(--r-lg); }

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--s-3);
}
.markets-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-4);
}

/* ==========================================================================
   08  HEADER / NAVIGATION
   ========================================================================== */
.header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    background: rgba(10, 12, 18, 0.72);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle);
}
.header::after {
    content: '';
    position: absolute;
    inset-inline: 0;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-brand), transparent);
    opacity: 0.7;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: var(--s-5);
    height: var(--header-h);
}

.header-logo {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    flex-shrink: 0;
}
.header-logo > span {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--gradient-brand);
    box-shadow: 0 4px 18px -6px var(--brand-glow);
    overflow: hidden;
}
.header-logo-symbol { width: 22px; height: 22px; object-fit: contain; }
.header-logo strong {
    font-family: var(--font-display);
    font-size: var(--fs-lg);
    font-weight: 700;
    letter-spacing: -0.03em;
    text-transform: uppercase;
}
.header-logo:hover strong { color: var(--text-primary); }

.header-nav { display: none; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.header-nav a {
    position: relative;
    padding: 8px 12px;
    border-radius: var(--r-xs);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-dim);
    white-space: nowrap;
    transition: color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
.header-nav a:hover { color: var(--text-primary); background: var(--surface-hover); }
.header-nav a.active { color: var(--text-primary); background: var(--surface-active); }
.header-nav a.active::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -13px;
    height: 2px;
    border-radius: 2px;
    background: var(--gradient-brand);
}

.header-actions { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; }

.header-search { position: relative; display: none; }
.header-search::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 50%;
    width: 14px;
    height: 14px;
    transform: translateY(-50%);
    opacity: 0.42;
    background: currentColor;
    -webkit-mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
    mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
}
.header-search input {
    width: 210px;
    height: 36px;
    padding: 0 var(--s-3) 0 34px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-pill);
    background: var(--surface-inset);
    color: var(--text-primary);
    font-size: var(--fs-sm);
    outline: none;
    transition: width var(--t-slow) var(--ease-out), border-color var(--t-base), box-shadow var(--t-base), background var(--t-base);
}
.header-search input::placeholder { color: var(--text-faint); }
.header-search input:focus {
    width: 300px;
    background: var(--surface-2);
    border-color: var(--border-brand);
    box-shadow: var(--ring);
}

.icon-button {
    position: relative;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border-subtle);
    background: var(--surface-inset);
    color: var(--text-body);
    font-size: var(--fs-md);
    transition: all var(--t-base) var(--ease-out);
}
.icon-button:hover {
    background: var(--surface-2);
    border-color: var(--border-strong);
    color: var(--text-primary);
    transform: translateY(-1px);
}
.icon-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: grid;
    place-items: center;
    border-radius: var(--r-pill);
    background: var(--no-500);
    color: #fff;
    font-family: var(--font-num);
    font-size: 10px;
    font-weight: 700;
    box-shadow: 0 0 0 2px var(--pulse-bg), 0 0 14px -2px var(--no-glow);
    animation: badge-pop var(--t-slow) var(--ease-spring);
}

.wallet-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border-radius: var(--r-pill);
    background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
                var(--gradient-brand) border-box;
    border: 1px solid transparent;
    font-family: var(--font-num);
    font-size: var(--fs-sm);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    transition: box-shadow var(--t-base) var(--ease-out);
}
.wallet-pill::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--yes-500);
    box-shadow: 0 0 8px var(--yes-glow);
}
.wallet-pill:hover { box-shadow: var(--e-brand); }

/* ==========================================================================
   09  SUB-NAV, FILTERS, SEGMENTED CONTROL
   ========================================================================== */
.toolbar-shell {
    position: sticky;
    top: var(--header-h);
    z-index: var(--z-sticky);
    padding-block: var(--s-2);
    background: rgba(10, 12, 18, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    max-width: 100%;
}
.toolbar-shell > * + * { margin-top: 6px; }

/* Категории + триггер фильтров в одной строке; триггер и лист — только на мобиле */
.subnav-row { display: flex; align-items: center; gap: var(--s-2); }
.subnav-row .subnav { flex: 1 1 auto; min-width: 0; }
.filters-trigger { display: none; }
.filters-sheet { display: none; }
.filters-overlay { display: none; }
.toolbar-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); }

/* Меню пользователя (аватар-дропдаун в шапке) */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu[open] > summary { box-shadow: var(--ring); }
.user-menu-panel {
    position: absolute; top: calc(100% + 10px); right: 0; z-index: var(--z-drawer);
    display: grid; min-width: 210px; padding: 6px;
    border: 1px solid var(--border-default); border-radius: var(--r-md);
    background: var(--surface-glass); backdrop-filter: blur(20px);
    box-shadow: var(--e-4); animation: slide-down var(--t-base) var(--ease-out);
}
.user-menu-panel a, .user-menu-panel button {
    padding: 9px 12px; border-radius: var(--r-xs); text-align: left;
    font-size: var(--fs-sm); font-weight: 500; color: var(--text-body);
    transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.user-menu-panel a:hover, .user-menu-panel button:hover { background: var(--surface-hover); color: var(--text-primary); }
.user-menu-panel form { display: grid; margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border-subtle); }
.user-menu-panel .danger:hover { background: var(--no-soft); color: var(--no-400); }

/* Онбординг-баннер для гостя */
.onboard-banner {
    position: fixed; left: var(--s-4); right: var(--s-4); bottom: calc(var(--mobile-nav-h) + var(--s-4));
    z-index: var(--z-toast); display: flex; flex-wrap: wrap; align-items: center;
    justify-content: space-between; gap: var(--s-4);
    max-width: 620px; margin-inline: auto; padding: var(--s-4) var(--s-5);
    border: 1px solid var(--border-brand); border-radius: var(--r-lg);
    background: var(--surface-glass); backdrop-filter: blur(22px);
    box-shadow: var(--e-4), var(--e-brand);
    animation: toast-in var(--t-slow) var(--ease-spring);
}
.onboard-banner p { font-size: var(--fs-xs); color: var(--text-dim); margin-top: 2px; }
@media (min-width: 900px) { .onboard-banner { bottom: var(--s-6); } }

.subnav {
    display: flex;
    align-items: center;
    gap: var(--s-1);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent 100%);
}
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
    padding: 7px 13px;
    border-radius: var(--r-pill);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-dim);
    white-space: nowrap;
    text-transform: capitalize;
    transition: all var(--t-fast) var(--ease-out);
}
.subnav a:hover { color: var(--text-primary); background: var(--surface-hover); }
.subnav a.active {
    color: var(--text-on-brand);
    background: var(--brand-500);
    box-shadow: 0 4px 16px -6px var(--brand-glow);
}

.filters {
    display: flex;
    align-items: center;
    gap: var(--s-1);
    padding-top: var(--s-1);
    overflow-x: auto;
    scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-xs);
    background: transparent;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--text-dim);
    white-space: nowrap;
    transition: all var(--t-fast) var(--ease-out);
}
.filter-btn:hover { color: var(--text-primary); border-color: var(--border-strong); background: var(--surface-hover); }
.filter-btn.active {
    color: var(--text-primary);
    background: var(--brand-soft);
    border-color: var(--border-brand);
}

/* Segmented control — feed mode, timeframes, tabs */
.segmented {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-sm);
    background: var(--surface-inset);
}
.segmented > * {
    padding: 6px 14px;
    border-radius: var(--r-xs);
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--text-dim);
    white-space: nowrap;
    transition: all var(--t-base) var(--ease-out);
}
.segmented > *:hover { color: var(--text-primary); }
.segmented > .active {
    color: var(--text-primary);
    background: var(--surface-3);
    box-shadow: var(--e-1);
}

/* Country tabs with flags */
.country-tabs { display: flex; gap: var(--s-1); overflow-x: auto; scrollbar-width: none; }
.country-tabs::-webkit-scrollbar { display: none; }
.country-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-pill);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-dim);
    white-space: nowrap;
    transition: all var(--t-fast) var(--ease-out);
}
.country-tab .flag { font-size: var(--fs-md); line-height: 1; }
.country-tab:hover { color: var(--text-primary); background: var(--surface-hover); }
.country-tab.active {
    color: var(--text-primary);
    background: var(--surface-2);
    border-color: var(--border-brand);
    box-shadow: inset 0 0 0 1px var(--brand-softer);
}

/* Tabs (event page) */
.event-tabs, .tabs {
    display: flex;
    gap: var(--s-1);
    border-bottom: 1px solid var(--border-subtle);
    overflow-x: auto;
    scrollbar-width: none;
    margin-bottom: var(--s-4);
}
.event-tabs::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
.event-tab, .tab, .sibling-tab {
    position: relative;
    padding: 10px 14px;
    border: none;
    background: transparent;
    font-family: var(--font-ui);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-dim);
    white-space: nowrap;
    cursor: pointer;
    transition: color var(--t-fast) var(--ease-out);
}
.event-tab:hover, .tab:hover, .sibling-tab:hover { color: var(--text-primary); }
.event-tab.active, .tab.active, .sibling-tab.active { color: var(--text-primary); }
.event-tab.active::after, .tab.active::after, .sibling-tab.active::after {
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: var(--gradient-brand);
}
.tab-count {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: var(--r-pill);
    background: var(--surface-hover);
    font-family: var(--font-num);
    font-size: 10px;
    color: var(--text-dim);
}
.event-tab-content { padding-top: var(--s-2); }

/* ==========================================================================
   10  BUTTONS
   ========================================================================== */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 42px;
    padding: 0 var(--s-5);
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    font-family: var(--font-ui);
    font-size: var(--fs-sm);
    font-weight: 600;
    letter-spacing: -0.008em;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    overflow: hidden;
    transition: transform var(--t-fast) var(--ease-out),
                box-shadow var(--t-base) var(--ease-out),
                background var(--t-base) var(--ease-out),
                border-color var(--t-base) var(--ease-out),
                color var(--t-base) var(--ease-out);
}
.btn:active { transform: translateY(1px) scale(0.985); }
.btn:disabled, .btn.is-disabled { opacity: 0.42; pointer-events: none; }

/* Sheen sweep on hover — subtle premium cue */
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-sheen);
    transform: translateX(-120%);
    transition: transform var(--t-slower) var(--ease-out);
    pointer-events: none;
}
.btn:hover::after { transform: translateX(120%); }

.btn-primary {
    background: var(--gradient-brand);
    color: var(--text-on-brand);
    box-shadow: 0 6px 22px -10px var(--brand-glow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 32px -10px var(--brand-glow), inset 0 1px 0 rgba(255, 255, 255, 0.22); color: #fff; }

.btn-outline {
    background: var(--surface-inset);
    border-color: var(--border-default);
    color: var(--text-body);
}
.btn-outline:hover {
    background: var(--surface-2);
    border-color: var(--border-strong);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.btn-ghost { background: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text-primary); }

.btn-yes {
    background: var(--yes-soft);
    border-color: var(--yes-border);
    color: var(--yes-400);
}
.btn-yes:hover { background: var(--yes-500); border-color: var(--yes-500); color: #04140d; box-shadow: var(--e-yes); }
.btn-no {
    background: var(--no-soft);
    border-color: var(--no-border);
    color: var(--no-400);
}
.btn-no:hover { background: var(--no-500); border-color: var(--no-500); color: #1c0409; box-shadow: var(--e-no); }

.btn-danger { background: var(--no-500); color: #fff; }
.btn-danger:hover { background: var(--no-600); color: #fff; }

.btn-gold {
    background: var(--gradient-gold);
    color: #241a08;
    box-shadow: 0 6px 22px -10px rgba(232, 194, 117, 0.5);
}

.btn-lg { height: 50px; padding: 0 var(--s-6); font-size: var(--fs-md); border-radius: var(--r-md); }
.btn-sm { height: 36px; padding: 0 var(--s-4); font-size: var(--fs-xs); }
.btn-xs { height: 30px; padding: 0 var(--s-3); font-size: var(--fs-micro); border-radius: var(--r-xs); }
.btn-icon { width: 42px; padding: 0; }

.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.28);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ==========================================================================
   11  BADGES, CHIPS, PILLS, LIVE DOT
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.5;
    white-space: nowrap;
}
.badge-accent { background: var(--brand-soft); border-color: var(--border-brand); color: var(--brand-300); }
.badge-purple { background: rgba(232, 121, 249, 0.12); border-color: rgba(232, 121, 249, 0.3); color: #f0a5fb; }
.badge-green  { background: var(--yes-soft); border-color: var(--yes-border); color: var(--yes-400); }
.badge-red    { background: var(--no-soft); border-color: var(--no-border); color: var(--no-400); }
.badge-cyan   { background: var(--cyan-soft); border-color: rgba(34, 211, 238, 0.3); color: var(--cyan-400); }
.badge-amber  { background: var(--amber-soft); border-color: rgba(255, 176, 32, 0.3); color: var(--amber-500); }
.badge-gold   { background: var(--gold-soft); border-color: rgba(232, 194, 117, 0.32); color: var(--gold-500); }
.badge-neutral{ background: var(--surface-hover); border-color: var(--border-subtle); color: var(--text-dim); }
.badge-live {
    background: var(--no-soft);
    border-color: var(--no-border);
    color: var(--no-400);
}
.badge-live::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--no-500);
    animation: pulse-dot 1.8s var(--ease-in-out) infinite;
}
.badge-count {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: var(--r-pill);
    background: var(--surface-hover);
    font-family: var(--font-num);
    font-size: 10px;
    color: var(--text-dim);
}

/* Category-tinted badge: <span class="badge cat-crypto"> */
.cat-politics   { background: rgba(255, 122, 90, 0.12);  border-color: rgba(255, 122, 90, 0.3);  color: var(--cat-politics); }
.cat-sports     { background: var(--yes-soft);           border-color: var(--yes-border);        color: var(--cat-sports); }
.cat-crypto     { background: rgba(247, 169, 59, 0.12);  border-color: rgba(247, 169, 59, 0.3);  color: var(--cat-crypto); }
.cat-technology { background: var(--brand-soft);         border-color: var(--border-brand);      color: var(--brand-300); }
.cat-business   { background: var(--cyan-soft);          border-color: rgba(34, 211, 238, 0.3);  color: var(--cat-business); }
.cat-culture    { background: rgba(232, 121, 249, 0.12); border-color: rgba(232, 121, 249, 0.3); color: var(--cat-culture); }
.cat-fun        { background: rgba(251, 113, 133, 0.12); border-color: rgba(251, 113, 133, 0.3); color: var(--cat-fun); }
.cat-world      { background: rgba(56, 189, 248, 0.12);  border-color: rgba(56, 189, 248, 0.3);  color: var(--cat-world); }
.cat-science    { background: rgba(163, 230, 53, 0.12);  border-color: rgba(163, 230, 53, 0.3);  color: var(--cat-science); }

.stat-chip, .chart-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-pill);
    background: var(--surface-inset);
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--text-body);
    white-space: nowrap;
}
.chart-chip { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

.stat-countdown {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--r-pill);
    background: var(--amber-soft);
    border: 1px solid rgba(255, 176, 32, 0.26);
    font-family: var(--font-num);
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--amber-500);
}
.stat-countdown.is-urgent {
    background: var(--no-soft);
    border-color: var(--no-border);
    color: var(--no-400);
    animation: soft-blink 2s var(--ease-in-out) infinite;
}

.live-dot {
    display: inline-block;
    position: relative;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--yes-500);
    flex-shrink: 0;
    transition: opacity var(--t-slow) var(--ease-out);
}
.live-dot::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1.5px solid var(--yes-500);
    animation: ripple 2s var(--ease-out) infinite;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-2);
    padding: var(--s-5) 0 var(--s-3);
    font-size: var(--fs-xs);
    color: var(--text-dim);
}
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--brand-300); }

/* ==========================================================================
   12  FORMS
   ========================================================================== */
.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--text-body);
}
.form-hint { margin-top: 5px; font-size: var(--fs-micro); color: var(--text-dim); }
.form-error { margin-top: 5px; font-size: var(--fs-micro); color: var(--no-400); }
.form-group { margin-bottom: var(--s-4); }

.form-input, .trade-input,
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="search"], input[type="tel"],
input[type="date"], input[type="datetime-local"], select, textarea {
    width: 100%;
    min-height: 44px;
    padding: 11px 14px;
    border: 1px solid var(--border-default);
    border-radius: var(--r-sm);
    background: var(--surface-inset);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: var(--fs-base);
    outline: none;
    transition: border-color var(--t-base) var(--ease-out),
                box-shadow var(--t-base) var(--ease-out),
                background var(--t-base) var(--ease-out);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
.form-input:focus, .trade-input:focus,
input:focus, select:focus, textarea:focus {
    border-color: var(--brand-500);
    background: var(--surface-2);
    box-shadow: var(--ring);
}
input[type="number"] {
    font-family: var(--font-num);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }
textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
select {
    appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23edf1f7' stroke-width='2.2' stroke-linecap='round' opacity='.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}
input:-webkit-autofill, input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-primary);
    -webkit-box-shadow: 0 0 0 1000px var(--surface-2) inset;
    caret-color: var(--text-primary);
}
.input-affix { position: relative; }
.input-affix .suffix {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--text-dim);
    pointer-events: none;
}

/* Checkbox / radio / switch */
input[type="checkbox"], input[type="radio"] {
    width: 18px;
    height: 18px;
    min-height: 0;
    padding: 0;
    accent-color: var(--brand-500);
    cursor: pointer;
}
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span {
    position: absolute;
    inset: 0;
    border-radius: var(--r-pill);
    background: var(--surface-3);
    border: 1px solid var(--border-default);
    transition: all var(--t-base) var(--ease-out);
}
.switch span::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-dim);
    transition: all var(--t-base) var(--ease-spring);
}
.switch input:checked + span { background: var(--brand-500); border-color: var(--brand-500); }
.switch input:checked + span::before { transform: translateX(18px); background: #fff; }

/* Quick amount chips */
.quick-amounts { display: flex; gap: 6px; margin-bottom: var(--s-3); }
.quick-amounts button {
    flex: 1;
    height: 34px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-xs);
    background: var(--surface-inset);
    font-family: var(--font-num);
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--text-body);
    transition: all var(--t-fast) var(--ease-out);
}
.quick-amounts button:hover {
    background: var(--brand-soft);
    border-color: var(--border-brand);
    color: var(--brand-300);
    transform: translateY(-1px);
}

/* ==========================================================================
   13  SURFACES & CARDS
   ========================================================================== */
.surface-panel, .detail-panel, .chart-panel, .sidebar-block, .glass {
    position: relative;
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
    background: var(--surface-1);
    box-shadow: var(--e-2);
}
.glass {
    background: var(--surface-glass);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
}
.surface-panel, .detail-panel, .chart-panel { padding: var(--s-5); }

.panel-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    margin-bottom: var(--s-4);
    padding-bottom: var(--s-3);
    border-bottom: 1px solid var(--border-subtle);
}
.panel-title {
    font-family: var(--font-display);
    font-size: var(--fs-md);
    font-weight: 600;
    letter-spacing: -0.02em;
}
.panel-subtitle { font-size: var(--fs-xs); color: var(--text-dim); }

/* --- Base card ------------------------------------------------------------ */
.market-card, .card-hover {
    position: relative;
    display: block;
    padding: var(--s-4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-md);
    background: var(--surface-1);
    color: inherit;
    text-decoration: none;
    box-shadow: var(--e-1);
    isolation: isolate;
    transition: transform var(--t-base) var(--ease-out),
                border-color var(--t-base) var(--ease-out),
                box-shadow var(--t-base) var(--ease-out),
                background var(--t-base) var(--ease-out);
}
.market-card::before, .card-hover::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: var(--gradient-brand);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity var(--t-base) var(--ease-out);
    pointer-events: none;
    z-index: 1;
}
.market-card:hover, .card-hover:hover {
    transform: translateY(-3px);
    background: var(--surface-2);
    box-shadow: var(--e-3);
}
.market-card:hover::before, .card-hover:hover::before { opacity: 0.55; }

.market-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); }

.card-header {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin-bottom: var(--s-2);
    min-height: 20px;
}
.card-header .text-muted { margin-left: auto; font-family: var(--font-num); }

.card-title {
    font-size: var(--fs-base);
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -0.014em;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-summary { font-size: var(--fs-xs); color: var(--text-dim); line-height: 1.55; }

.card-media {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--r-sm);
    overflow: hidden;
    margin-bottom: var(--s-3);
    background: var(--surface-2);
    position: relative;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slower) var(--ease-out); }
.market-card:hover .card-media img { transform: scale(1.045); }
.card-media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(6, 7, 11, 0.6) 100%);
}

.card-footer {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    margin-top: var(--s-3);
    padding-top: var(--s-3);
    border-top: 1px solid var(--border-subtle);
    font-size: var(--fs-micro);
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}
.card-footer-item { display: inline-flex; align-items: center; gap: 4px; }
.card-footer > :last-child { margin-left: auto; }

.card-prices { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.card-price-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 2px;
}
.card-price-yes, .card-price-no {
    font-family: var(--font-num);
    font-size: var(--fs-xl);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}
.card-price-yes { color: var(--yes-500); }
.card-price-no  { color: var(--no-500); }

.card-change-up, .card-change-down {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-family: var(--font-num);
    font-size: var(--fs-micro);
    font-weight: 600;
}
.card-change-up { color: var(--yes-500); }
.card-change-down { color: var(--no-500); }
.card-change-up::before { content: '▲'; font-size: 8px; }
.card-change-down::before { content: '▼'; font-size: 8px; }

.card-sparkline { width: 100%; height: 34px; margin: var(--s-2) 0; opacity: 0.85; }
.market-card:hover .card-sparkline { opacity: 1; }

.card-news-block {
    display: flex;
    gap: var(--s-3);
    align-items: flex-start;
    padding: var(--s-3);
    margin-top: var(--s-3);
    border: 1px solid var(--border-subtle);
    border-left: 2px solid var(--brand-500);
    border-radius: var(--r-sm);
    background: var(--surface-inset);
    font-size: var(--fs-xs);
    color: var(--text-body);
    line-height: 1.55;
}
.card-news-icon {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: var(--r-xs);
    background: var(--brand-soft);
    color: var(--brand-300);
    font-size: var(--fs-sm);
}
.detail-news-block {
    display: flex;
    gap: var(--s-4);
    align-items: flex-start;
    margin-top: var(--s-4);
    padding: var(--s-4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-md);
    background: var(--surface-inset);
}

/* --- Metric card --------------------------------------------------------- */
.metric-card {
    padding: var(--s-3) var(--s-4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-sm);
    background: var(--surface-inset);
}
.metric-number {
    font-family: var(--font-num);
    font-size: var(--fs-2xl);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.035em;
    line-height: 1.1;
}

/* --- Featured hero card / carousel --------------------------------------- */
.carousel { position: relative; margin-bottom: var(--s-8); }
.carousel-track {
    display: flex;
    gap: var(--s-4);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2px 2px var(--s-2);
    -webkit-overflow-scrolling: touch;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track > * { scroll-snap-align: start; }

.carousel-nav {
    position: absolute;
    top: 50%;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    transform: translateY(-50%);
    border: 1px solid var(--border-default);
    border-radius: 50%;
    background: var(--surface-glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: var(--text-primary);
    font-size: var(--fs-xl);
    line-height: 1;
    box-shadow: var(--e-2);
    opacity: 0;
    transition: all var(--t-base) var(--ease-out);
}
.carousel:hover .carousel-nav { opacity: 1; }
.carousel-nav:hover { background: var(--brand-500); border-color: var(--brand-500); color: #fff; }
.carousel-nav.prev { left: -14px; }
.carousel-nav.next { right: -14px; }

.hero-card {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 0 0 300px;
    min-width: 300px;
    padding: var(--s-4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
    background:
        radial-gradient(22rem 14rem at 100% 0%, rgba(108, 92, 255, 0.13), transparent 62%),
        var(--surface-1);
    box-shadow: var(--e-2);
    color: inherit;
    overflow: hidden;
    transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out), border-color var(--t-base);
}
.hero-card:hover { transform: translateY(-4px); border-color: var(--border-brand); box-shadow: var(--e-3), var(--e-brand); }
.hero-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); }

/* --- Category background auras (legacy .market-bg-*) -------------------- */
.market-bg-politics,
.market-bg-sports,
.market-bg-crypto,
.market-bg-tech,
.market-bg-uzbekistan,
.market-bg-kazakhstan { position: relative; }
.market-bg-politics::after,
.market-bg-sports::after,
.market-bg-crypto::after,
.market-bg-tech::after,
.market-bg-uzbekistan::after,
.market-bg-kazakhstan::after {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    filter: blur(52px);
    opacity: 0.2;
    pointer-events: none;
    z-index: -1;
    transition: opacity var(--t-slow) var(--ease-out);
}
.market-card:hover::after { opacity: 0.34; }
.market-bg-politics::after   { background: var(--cat-politics); }
.market-bg-sports::after     { background: var(--cat-sports); }
.market-bg-crypto::after     { background: var(--cat-crypto); }
.market-bg-tech::after       { background: var(--cat-technology); }
.market-bg-uzbekistan::after { background: var(--cyan-500); }
.market-bg-kazakhstan::after { background: var(--info-500); }

/* ==========================================================================
   14  MARKET CARD (PM-CARD) & PROBABILITY VISUALS
   ========================================================================== */
.pm-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: var(--s-4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-md);
    background: var(--surface-1);
    box-shadow: var(--e-1);
    transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out), border-color var(--t-base);
}
.pm-card:hover { transform: translateY(-3px); border-color: var(--border-default); box-shadow: var(--e-3); }
.pm-card-header { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-2); }
.pm-card-badge {
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--brand-soft);
    color: var(--brand-300);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.pm-card-title {
    font-size: var(--fs-base);
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: var(--s-3);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pm-card-volume {
    margin-left: auto;
    font-family: var(--font-num);
    font-size: var(--fs-micro);
    color: var(--text-dim);
}
.pm-card-bars { display: flex; flex-direction: column; gap: var(--s-3); margin-top: auto; }
.pm-card-footer {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    margin-top: var(--s-3);
    padding-top: var(--s-3);
    border-top: 1px solid var(--border-subtle);
    font-size: var(--fs-micro);
    color: var(--text-dim);
}

/* --- Pulse bar: the signature YES/NO row -------------------------------- */
.pm-bar { display: grid; gap: 6px; }
.pm-bar-info { display: flex; align-items: baseline; justify-content: space-between; }
.pm-bar-label {
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: -0.01em;
}
.pm-bar-pct {
    font-family: var(--font-num);
    font-size: var(--fs-md);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}
.pm-bar-track, .pm-bar {
    --track-h: 6px;
}
.pm-bar-track {
    position: relative;
    height: var(--track-h);
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}
.pm-bar-fill {
    position: relative;
    height: 100%;
    border-radius: var(--r-pill);
    transition: width var(--t-slower) var(--ease-out);
}
.pm-bar-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: translateX(-100%);
    animation: pulse-sweep 3.2s var(--ease-in-out) infinite;
}
.pm-bar-fill-yes { background: var(--gradient-yes); box-shadow: 0 0 12px -2px var(--yes-glow); }
.pm-bar-fill-no  { background: var(--gradient-no);  box-shadow: 0 0 12px -2px var(--no-glow); }

.pm-bar-btn, .card-trade-btn {
    width: 100%;
    height: 38px;
    border: 1px solid transparent;
    border-radius: var(--r-xs);
    font-family: var(--font-ui);
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-out);
}
.pm-bar-btn-yes, .card-trade-yes {
    background: var(--yes-soft);
    border-color: var(--yes-border);
    color: var(--yes-400);
}
.pm-bar-btn-yes:hover, .card-trade-yes:hover {
    background: var(--yes-500);
    color: #04140d;
    box-shadow: var(--e-yes);
    transform: translateY(-1px);
}
.pm-bar-btn-no, .card-trade-no {
    background: var(--no-soft);
    border-color: var(--no-border);
    color: var(--no-400);
}
.pm-bar-btn-no:hover, .card-trade-no:hover {
    background: var(--no-500);
    color: #1c0409;
    box-shadow: var(--e-no);
    transform: translateY(-1px);
}
.card-trade-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }

/* --- Split probability bar ---------------------------------------------- */
.card-probability-bar {
    display: flex;
    height: 30px;
    border-radius: var(--r-pill);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    margin: var(--s-3) 0;
}
.card-prob-yes, .card-prob-no {
    display: grid;
    place-items: center;
    height: 100%;
    font-family: var(--font-num);
    font-size: var(--fs-xs);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    transition: width var(--t-slower) var(--ease-out);
}
.card-prob-yes { background: var(--gradient-yes); color: #04140d; }
.card-prob-no  { background: var(--gradient-no);  color: #1c0409; }

/* --- Probability ring --------------------------------------------------- */
.probability-ring {
    --value: 50;
    --ring: 128px;
    --thick: 10px;
    position: relative;
    width: var(--ring);
    height: var(--ring);
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        conic-gradient(from 180deg,
            var(--yes-500) 0,
            var(--yes-400) calc(var(--value) * 1%),
            rgba(255, 255, 255, 0.07) calc(var(--value) * 1%),
            rgba(255, 255, 255, 0.07) 100%);
    transition: background var(--t-slower) var(--ease-out);
}
.probability-ring::before {
    content: '';
    position: absolute;
    inset: var(--thick);
    border-radius: 50%;
    background: var(--surface-1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.probability-ring::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--yes-glow) 0%, transparent 68%);
    opacity: 0.4;
    z-index: -1;
    filter: blur(6px);
}
.probability-ring__inner {
    position: relative;
    display: grid;
    place-items: center;
    gap: 1px;
    text-align: center;
    line-height: 1.1;
}
.probability-ring__inner span {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
}
.probability-ring__inner strong {
    font-family: var(--font-num);
    font-size: var(--fs-2xl);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.04em;
}
.probability-ring--sm { --ring: 72px; --thick: 7px; }
.probability-ring--sm .probability-ring__inner strong { font-size: var(--fs-md); }
.probability-ring--sm .probability-ring__inner span { display: none; }

/* Chart shell */
.chart-panel { padding: var(--s-5); }
.chart-footer {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    margin-top: var(--s-3);
    padding-top: var(--s-3);
    border-top: 1px solid var(--border-subtle);
}
.apexcharts-tooltip, .apexcharts-tooltip.apexcharts-theme-dark {
    background: var(--surface-3) !important;
    border: 1px solid var(--border-default) !important;
    border-radius: var(--r-xs) !important;
    box-shadow: var(--e-3) !important;
    font-family: var(--font-num) !important;
}
.apexcharts-tooltip-title { background: var(--surface-4) !important; border-color: var(--border-subtle) !important; }
.apexcharts-xaxistooltip, .apexcharts-yaxistooltip {
    background: var(--surface-3) !important;
    border-color: var(--border-default) !important;
    color: var(--text-body) !important;
}

/* ==========================================================================
   15  MARKET ROWS (event outcomes list)
   ========================================================================== */
.market-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-3);
    border-radius: var(--r-sm);
    border: 1px solid transparent;
    transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.market-row:hover { background: var(--surface-inset); border-color: var(--border-subtle); }
.market-row + .market-row { border-top: 1px solid var(--border-subtle); border-radius: var(--r-sm); }
.market-row-header { display: flex; align-items: center; gap: var(--s-2); }
.market-row-title {
    font-size: var(--fs-sm);
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
}
.market-row-label { font-size: var(--fs-micro); color: var(--text-dim); }
.market-row-volume { font-family: var(--font-num); font-size: var(--fs-micro); color: var(--text-dim); }
.market-row-prob {
    font-family: var(--font-num);
    font-size: var(--fs-lg);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 54px;
    text-align: right;
    letter-spacing: -0.03em;
}
.market-row-price { font-family: var(--font-num); font-size: var(--fs-xs); color: var(--text-dim); }
.market-row-side { display: flex; align-items: center; gap: var(--s-2); }
.market-row-bar {
    height: 5px;
    margin-top: 6px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}
.market-row-bar-inner, .market-row-fill {
    height: 100%;
    border-radius: var(--r-pill);
    background: var(--gradient-brand);
    transition: width var(--t-slower) var(--ease-out);
}
.market-row-fill-yes { background: var(--gradient-yes); }
.market-row-fill-no  { background: var(--gradient-no); }
.market-row-buy { display: flex; gap: 6px; }
.market-row-buy-yes, .market-row-yes {
    min-width: 74px;
    height: 34px;
    padding: 0 var(--s-3);
    border: 1px solid var(--yes-border);
    border-radius: var(--r-xs);
    background: var(--yes-soft);
    color: var(--yes-400);
    font-family: var(--font-num);
    font-size: var(--fs-xs);
    font-weight: 700;
    transition: all var(--t-fast) var(--ease-out);
}
.market-row-buy-yes:hover, .market-row-yes:hover { background: var(--yes-500); color: #04140d; }
.market-row-buy-no, .market-row-no {
    min-width: 74px;
    height: 34px;
    padding: 0 var(--s-3);
    border: 1px solid var(--no-border);
    border-radius: var(--r-xs);
    background: var(--no-soft);
    color: var(--no-400);
    font-family: var(--font-num);
    font-size: var(--fs-xs);
    font-weight: 700;
    transition: all var(--t-fast) var(--ease-out);
}
.market-row-buy-no:hover, .market-row-no:hover { background: var(--no-500); color: #1c0409; }

.event-compact-markets { display: flex; flex-direction: column; gap: 2px; }

/* ==========================================================================
   16  MARKET DETAIL / EVENT PAGES
   ========================================================================== */
.market-detail { padding-bottom: var(--s-12); }

.detail-hero, .event-hero {
    position: relative;
    padding: var(--s-6);
    margin-bottom: var(--s-6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-xl);
    background:
        radial-gradient(36rem 20rem at 0% 0%, rgba(108, 92, 255, 0.12), transparent 58%),
        var(--surface-1);
    box-shadow: var(--e-3);
    overflow: hidden;
}
.detail-hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-6);
    align-items: start;
}
.event-hero-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--s-6);
    align-items: start;
}
.market-detail-title, .event-hero-title {
    font-family: var(--font-display);
    font-size: clamp(20px, 3vw, var(--fs-3xl));
    font-weight: 700;
    line-height: 1.14;
    letter-spacing: -0.032em;
    margin: var(--s-3) 0;
}
.market-detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-2);
    font-family: var(--font-num);
    font-size: var(--fs-xs);
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}
.market-detail-meta > span:not(.badge) { display: inline-flex; align-items: center; }
.market-detail-copy {
    max-width: 72ch;
    margin-top: var(--s-3);
    font-size: var(--fs-sm);
    color: var(--text-body);
    line-height: 1.68;
}
.event-hero-info { min-width: 0; }
.event-hero-desc { font-size: var(--fs-sm); color: var(--text-body); line-height: 1.65; margin-top: var(--s-2); }
.event-hero-badges { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.event-hero-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-soft);
    flex-shrink: 0;
    margin-top: var(--s-2);
}

.detail-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-2);
    margin-top: var(--s-4);
}
.detail-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--s-3);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-sm);
    background: var(--surface-inset);
    text-align: center;
}
.detail-stat span {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
}
.detail-stat strong {
    font-family: var(--font-num);
    font-size: var(--fs-md);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.025em;
}

.detail-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    padding: var(--s-3) 0;
    border-top: 1px solid var(--border-subtle);
    font-size: var(--fs-sm);
}
.detail-list-item:first-child { border-top: none; }

/* Comment thread */
.comment { padding: var(--s-3) 0; border-top: 1px solid var(--border-subtle); }
.comment:first-of-type { border-top: none; }
.comment-head { display: flex; align-items: center; gap: var(--s-2); margin-bottom: 5px; }
.comment-author { font-size: var(--fs-sm); font-weight: 600; }
.comment-time { font-size: var(--fs-micro); color: var(--text-faint); }
.comment-body { font-size: var(--fs-sm); color: var(--text-body); line-height: 1.6; }
.avatar {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--gradient-brand);
    color: #fff;
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
}
.avatar-lg { width: 60px; height: 60px; font-size: var(--fs-xl); }

/* ==========================================================================
   17  TRADE PANEL & TRADE SHEET
   ========================================================================== */
.trade-panel {
    position: relative;
    padding: var(--s-5);
    border: 1px solid var(--border-default);
    border-radius: var(--r-lg);
    background:
        radial-gradient(24rem 14rem at 100% 0%, rgba(108, 92, 255, 0.1), transparent 60%),
        var(--surface-1);
    box-shadow: var(--e-3);
}
.trade-panel::before {
    content: '';
    position: absolute;
    inset-inline: var(--s-5);
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--brand-500), transparent);
}

.trade-side-btn, .trade-price-option {
    display: grid;
    gap: 2px;
    padding: var(--s-3);
    border: 1px solid var(--border-default);
    border-radius: var(--r-sm);
    background: var(--surface-inset);
    text-align: center;
    cursor: pointer;
    transition: all var(--t-base) var(--ease-out);
}
.trade-side-btn:hover, .trade-price-option:hover { border-color: var(--border-strong); background: var(--surface-2); }
.trade-side-btn .label, .trade-price-option .label {
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.trade-side-btn .price, .trade-price-option .price {
    font-family: var(--font-num);
    font-size: var(--fs-2xl);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.04em;
    line-height: 1.15;
}
.trade-price-option .est, .trade-side-btn .est { font-size: 10px; color: var(--text-dim); font-family: var(--font-num); }

.selected-yes {
    background: var(--yes-soft) !important;
    border-color: var(--yes-500) !important;
    box-shadow: var(--ring-yes);
}
.selected-no {
    background: var(--no-soft) !important;
    border-color: var(--no-500) !important;
    box-shadow: var(--ring-no);
}

.trade-price-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); margin-bottom: var(--s-3); }
.trade-input-row { display: flex; gap: var(--s-2); margin-bottom: var(--s-2); }
.trade-input-row input { flex: 1; }
.trade-input {
    font-family: var(--font-num);
    font-size: var(--fs-lg);
    font-weight: 700;
    text-align: right;
}

.trade-submit {
    width: 100%;
    height: 48px;
    margin-top: var(--s-2);
    border: none;
    border-radius: var(--r-sm);
    font-family: var(--font-ui);
    font-size: var(--fs-md);
    font-weight: 700;
    color: #04140d;
    cursor: pointer;
    transition: all var(--t-base) var(--ease-out);
}
.trade-submit.buy-yes, .buy-yes { background: var(--gradient-yes); color: #04140d; box-shadow: var(--e-yes); }
.trade-submit.buy-no,  .buy-no  { background: var(--gradient-no);  color: #1c0409; box-shadow: var(--e-no); }
.trade-submit:hover { transform: translateY(-1px); filter: brightness(1.06); }
.trade-submit:active { transform: translateY(1px); }

.trade-info {
    margin-top: var(--s-3);
    padding: var(--s-3);
    border-radius: var(--r-sm);
    background: var(--surface-inset);
    font-family: var(--font-num);
    font-size: var(--fs-micro);
    color: var(--text-body);
    text-align: center;
    line-height: 1.6;
}
.fee-breakdown {
    display: grid;
    gap: 5px;
    padding: var(--s-3);
    margin-bottom: var(--s-3);
    border-radius: var(--r-sm);
    background: var(--surface-inset);
    font-size: var(--fs-micro);
    color: var(--text-body);
}
.fee-breakdown .flex-between > span:last-child { font-family: var(--font-num); font-weight: 600; }

/* Modal / bottom sheet */
.trade-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--s-4);
    background: rgba(4, 5, 8, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.trade-overlay.active { display: flex; animation: fade-in var(--t-base) var(--ease-out); }
.trade-modal {
    width: 100%;
    max-width: 400px;
    max-height: 92dvh;
    overflow-y: auto;
    padding: var(--s-6);
    border: 1px solid var(--border-default);
    border-radius: var(--r-xl);
    background:
        radial-gradient(24rem 14rem at 50% 0%, rgba(108, 92, 255, 0.12), transparent 62%),
        var(--surface-1);
    box-shadow: var(--e-4);
    animation: modal-in var(--t-slow) var(--ease-spring);
}
.trade-modal h3 {
    font-size: var(--fs-md);
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: var(--s-4);
    padding-right: var(--s-8);
}
.trade-close {
    position: absolute;
    top: var(--s-4);
    right: var(--s-4);
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: var(--r-xs);
    background: var(--surface-hover);
    color: var(--text-dim);
    font-size: var(--fs-sm);
    transition: all var(--t-fast) var(--ease-out);
}
.trade-close:hover { background: var(--no-soft); color: var(--no-400); }

/* Sticky YES/NO CTA — only rendered as a bar below the desktop breakpoint */
.trade-sticky { display: none; }

/* ==========================================================================
   18  SIDEBAR MODULES
   ========================================================================== */
.sidebar { display: flex; flex-direction: column; gap: var(--s-4); }
.sidebar-block { padding: var(--s-4); }

/* Инсайт-виджеты главной: 2 колонки на десктопе (было 3 — под 3-й виджет,
   который дублировал метрики hero и удалён). Мобильную раскладку см. в media. */
.home-insights-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sidebar-block h3 {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin-bottom: var(--s-3);
    padding-bottom: var(--s-2);
    border-bottom: 1px solid var(--border-subtle);
    font-family: var(--font-display);
    font-size: var(--fs-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-body);
}

.breaking-item {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-2);
    margin-inline: calc(var(--s-2) * -1);
    border-radius: var(--r-sm);
    transition: background var(--t-fast) var(--ease-out);
}
.breaking-item:hover { background: var(--surface-hover); }
.breaking-pct {
    display: grid;
    place-items: center;
    min-width: 46px;
    height: 34px;
    border-radius: var(--r-xs);
    background: var(--yes-soft);
    border: 1px solid var(--yes-border);
    color: var(--yes-400);
    font-family: var(--font-num);
    font-size: var(--fs-sm);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.breaking-title {
    font-size: var(--fs-xs);
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-body);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.breaking-time { font-family: var(--font-num); font-size: 10px; color: var(--text-faint); }

.hot-topic {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    padding: var(--s-2) 0;
    border-top: 1px solid var(--border-subtle);
}
.hot-topic:first-of-type { border-top: none; }
.hot-topic-name { font-size: var(--fs-xs); font-weight: 600; text-transform: capitalize; }
.hot-topic-vol { font-family: var(--font-num); font-size: var(--fs-micro); color: var(--text-dim); }

/* Live ticker (optional module) */
.ticker {
    display: flex;
    gap: var(--s-6);
    padding: var(--s-2) 0;
    overflow: hidden;
    border-block: 1px solid var(--border-subtle);
    mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.ticker-track { display: flex; gap: var(--s-6); flex-shrink: 0; animation: ticker 42s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-num);
    font-size: var(--fs-xs);
    color: var(--text-dim);
    white-space: nowrap;
}

/* ==========================================================================
   19  TABLES & LEADERBOARD
   ========================================================================== */
.table-wrap {
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-md);
    background: var(--surface-1);
    overflow-x: auto;
}
.data-table { width: 100%; font-size: var(--fs-sm); }
.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: var(--s-3) var(--s-4);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    text-align: left;
    white-space: nowrap;
}
.data-table tbody td {
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-body);
    vertical-align: middle;
}
.data-table tbody tr { transition: background var(--t-fast) var(--ease-out); }
.data-table tbody tr:hover { background: var(--surface-inset); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .num, .data-table .td-num {
    font-family: var(--font-num);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.rank-badge {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: var(--r-xs);
    background: var(--surface-hover);
    font-family: var(--font-num);
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--text-dim);
}
.rank-1 { background: var(--gradient-gold); color: #241a08; box-shadow: 0 4px 16px -6px rgba(232, 194, 117, 0.6); }
.rank-2 { background: linear-gradient(135deg, #e8ecf3, #a8b1c1); color: #171b22; }
.rank-3 { background: linear-gradient(135deg, #e0a172, #b0713f); color: #1b1005; }

.leaderboard-row {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-3);
    border-radius: var(--r-sm);
    transition: background var(--t-fast) var(--ease-out);
}
.leaderboard-row:hover { background: var(--surface-inset); }
.leaderboard-row.is-me {
    background: var(--brand-soft);
    box-shadow: inset 0 0 0 1px var(--border-brand);
}

/* ==========================================================================
   20  PAGINATION
   ========================================================================== */
.pagination-shell { display: flex; justify-content: center; margin-top: var(--s-8); }
.pagination-list { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1); }
.pagination-link {
    display: grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    padding: 0 var(--s-3);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-xs);
    background: var(--surface-inset);
    font-family: var(--font-num);
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--text-body);
    transition: all var(--t-fast) var(--ease-out);
}
.pagination-link:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text-primary); }
.pagination-link.is-current {
    background: var(--brand-500);
    border-color: var(--brand-500);
    color: #fff;
    box-shadow: 0 4px 16px -6px var(--brand-glow);
}
.pagination-link.is-disabled { opacity: 0.3; pointer-events: none; }

/* Laravel default pagination markup fallback */
nav[role="navigation"] svg { width: 16px; height: 16px; }

/* ==========================================================================
   21  FEEDBACK: alerts, toasts, empty, skeleton
   ========================================================================== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    margin-bottom: var(--s-4);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--brand-500);
    border-radius: var(--r-sm);
    background: var(--surface-1);
    font-size: var(--fs-sm);
    box-shadow: var(--e-2);
    animation: slide-down var(--t-slow) var(--ease-out);
}
.alert-success { border-left-color: var(--yes-500); background: linear-gradient(90deg, var(--yes-softer), var(--surface-1) 40%); color: var(--yes-400); }
.alert-error   { border-left-color: var(--no-500);  background: linear-gradient(90deg, var(--no-softer), var(--surface-1) 40%);  color: var(--no-400); }
.alert-warning { border-left-color: var(--amber-500); color: var(--amber-500); }
.alert-info    { border-left-color: var(--info-500); color: var(--info-500); }

.toast-stack {
    position: fixed;
    right: var(--s-4);
    bottom: calc(var(--mobile-nav-h) + var(--s-4));
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    width: min(340px, calc(100vw - var(--s-8)));
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    padding: var(--s-3) var(--s-4);
    border: 1px solid var(--border-default);
    border-radius: var(--r-sm);
    background: var(--surface-glass);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--e-4);
    font-size: var(--fs-sm);
    animation: toast-in var(--t-slow) var(--ease-spring);
}

.empty-state {
    display: grid;
    place-items: center;
    gap: var(--s-3);
    padding: var(--s-12) var(--s-5);
    border: 1px dashed var(--border-default);
    border-radius: var(--r-lg);
    background: var(--surface-inset);
    text-align: center;
}
.empty-state .icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: var(--r-md);
    background: var(--brand-soft);
    color: var(--brand-300);
    font-size: var(--fs-2xl);
}
.empty-state h3 { font-size: var(--fs-md); }
.empty-state p { max-width: 42ch; font-size: var(--fs-sm); color: var(--text-dim); }

.skeleton {
    position: relative;
    border-radius: var(--r-xs);
    background: var(--surface-2);
    overflow: hidden;
}
.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-sheen);
    transform: translateX(-100%);
    animation: shimmer 1.5s var(--ease-in-out) infinite;
}
.skeleton-text { height: 12px; margin-bottom: 8px; }
.skeleton-card { height: 210px; border-radius: var(--r-md); }

/* Price flash — hook these from the Reverb listener */
.flash-up   { animation: flash-up   var(--t-slower) var(--ease-out); }
.flash-down { animation: flash-down var(--t-slower) var(--ease-out); }

/* ==========================================================================
   22  FOOTER
   ========================================================================== */
.footer {
    margin-top: var(--s-18);
    padding: var(--s-10) 0 var(--s-8);
    border-top: 1px solid var(--border-subtle);
    background: linear-gradient(180deg, transparent, rgba(6, 7, 11, 0.6));
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--s-6);
    margin-bottom: var(--s-8);
}
.footer-col { display: flex; flex-direction: column; gap: var(--s-2); }
.footer-col h4 {
    margin-bottom: var(--s-1);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-dim);
    font-family: var(--font-ui);
}
.footer-col a { font-size: var(--fs-sm); color: var(--text-body); }
.footer-col a:hover { color: var(--brand-300); }
.footer-bottom {
    padding-top: var(--s-5);
    border-top: 1px solid var(--border-subtle);
    font-size: var(--fs-xs);
    color: var(--text-faint);
}
.footer-bottom a { color: var(--text-dim); }

/* Payment method strip (local CIS rails) */
.pay-strip { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.pay-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-xs);
    background: var(--surface-inset);
    font-size: var(--fs-micro);
    font-weight: 600;
    color: var(--text-dim);
    filter: grayscale(1);
    opacity: 0.7;
    transition: all var(--t-base) var(--ease-out);
}
.pay-chip:hover { filter: none; opacity: 1; border-color: var(--border-default); color: var(--text-body); }

/* ==========================================================================
   23  MOBILE NAVIGATION
   ========================================================================== */
.mobile-nav {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: var(--z-header);
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(10, 12, 18, 0.86);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    border-top: 1px solid var(--border-subtle);
}
.mobile-nav-inner {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    align-items: center;
    height: var(--mobile-nav-h);
    max-width: 560px;
    margin-inline: auto;
}
.mobile-nav a {
    display: grid;
    place-items: center;
    gap: 3px;
    height: 100%;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-faint);
    transition: color var(--t-fast) var(--ease-out);
}
.mobile-nav a .nav-icon { display: grid; place-items: center; height: 24px; }
.mobile-nav a.active { color: var(--brand-300); }
.mobile-nav a.active .nav-icon { filter: drop-shadow(0 0 8px var(--brand-glow)); }
.mobile-nav a:active { transform: scale(0.94); }

/* Floating action button for /markets/create on mobile */
.fab {
    position: fixed;
    right: var(--s-4);
    bottom: calc(var(--mobile-nav-h) + var(--s-4) + env(safe-area-inset-bottom));
    z-index: var(--z-sticky);
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--gradient-brand);
    color: #fff;
    font-size: var(--fs-xl);
    box-shadow: var(--e-3), 0 8px 28px -8px var(--brand-glow);
    transition: transform var(--t-base) var(--ease-spring);
}
.fab:hover { transform: scale(1.06) rotate(90deg); color: #fff; }

/* ==========================================================================
   24  ADMIN (CP) SHELL
   ========================================================================== */
.admin-topbar {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    height: 56px;
    padding-inline: var(--s-5);
    background: rgba(10, 12, 18, 0.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border-subtle);
}
.admin-topbar h2 { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.025em; }
.admin-topbar-actions { display: flex; align-items: center; gap: var(--s-3); }

.admin-shell { display: flex; min-height: calc(100dvh - 56px); }
.admin-sidebar {
    position: sticky;
    top: 56px;
    flex-shrink: 0;
    width: 236px;
    height: calc(100dvh - 56px);
    padding: var(--s-4) 0;
    overflow-y: auto;
    background: var(--surface-0);
    border-right: 1px solid var(--border-subtle);
}
.admin-sidebar-section {
    padding: var(--s-3) var(--s-5) var(--s-1);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-faint);
}
.admin-sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px var(--s-5);
    border-left: 2px solid transparent;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-body);
    transition: all var(--t-fast) var(--ease-out);
}
.admin-sidebar a:hover { background: var(--surface-hover); color: var(--text-primary); }
.admin-sidebar a.active {
    background: var(--brand-softer);
    border-left-color: var(--brand-500);
    color: var(--brand-300);
}
.admin-content { flex: 1; min-width: 0; padding: var(--s-6); }
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: var(--s-4);
    margin-bottom: var(--s-6);
}
.kpi-card {
    padding: var(--s-4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-md);
    background: var(--surface-1);
}
.kpi-card .label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-dim);
}
.kpi-card .value {
    font-family: var(--font-num);
    font-size: var(--fs-2xl);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.035em;
}

/* ==========================================================================
   25  ANIMATIONS
   ========================================================================== */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}
@keyframes slide-down {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: none; }
}
@keyframes modal-in {
    from { opacity: 0; transform: translateY(18px) scale(0.97); }
    to   { opacity: 1; transform: none; }
}
@keyframes sheet-in {
    from { transform: translateY(100%); }
    to   { transform: none; }
}
@keyframes toast-in {
    from { opacity: 0; transform: translateX(24px) scale(0.96); }
    to   { opacity: 1; transform: none; }
}
@keyframes badge-pop {
    0%   { transform: scale(0.4); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes pulse-sweep {
    0%, 62%  { transform: translateX(-100%); }
    100%     { transform: translateX(100%); }
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}
@keyframes soft-blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.6; }
}
@keyframes ripple {
    0%   { transform: scale(0.7); opacity: 0.8; }
    100% { transform: scale(1.9); opacity: 0; }
}
@keyframes ticker {
    from { transform: translateX(0); }
    to   { transform: translateX(-100%); }
}
@keyframes flash-up {
    0%   { background-color: var(--yes-soft); color: var(--yes-400); }
    100% { background-color: transparent; }
}
@keyframes flash-down {
    0%   { background-color: var(--no-soft); color: var(--no-400); }
    100% { background-color: transparent; }
}

.fade-in-up { animation: fade-in-up var(--t-slower) var(--ease-out) both; }
.fade-in    { animation: fade-in var(--t-slow) var(--ease-out) both; }

/* Stagger helper: add .stagger to a grid, children animate in sequence */
.stagger > * { animation: fade-in-up var(--t-slower) var(--ease-out) both; }
.stagger > *:nth-child(1) { animation-delay: 0.02s; }
.stagger > *:nth-child(2) { animation-delay: 0.06s; }
.stagger > *:nth-child(3) { animation-delay: 0.1s; }
.stagger > *:nth-child(4) { animation-delay: 0.14s; }
.stagger > *:nth-child(5) { animation-delay: 0.18s; }
.stagger > *:nth-child(6) { animation-delay: 0.22s; }
.stagger > *:nth-child(7) { animation-delay: 0.26s; }
.stagger > *:nth-child(8) { animation-delay: 0.3s; }
.stagger > *:nth-child(n+9) { animation-delay: 0.34s; }

/* ==========================================================================
   26  RESPONSIVE
   Mobile-safe base; progressive enhancement at 640 / 900 / 1100 / 1400.
   ========================================================================== */

/* --- Mobile + tablet (<= 899px): bottom nav is visible here ------------- */
@media (max-width: 899px) {
    /* Bottom nav overlays content — reserve room for it */
    body { padding-bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom)); }

    .header-inner { gap: var(--s-3); }
    /* "+ Рынок" уходит в FAB, «Пригласить» — в меню пользователя */
    .header-actions .btn-outline.btn-sm, .header-actions .btn-xs { display: none; }
    .wallet-pill { height: 32px; padding: 0 10px; font-size: var(--fs-xs); }

    .headline-shell { padding: var(--s-5) var(--s-4); border-radius: var(--r-lg); }
    .detail-hero, .event-hero { padding: var(--s-4); border-radius: var(--r-lg); }
    .surface-panel, .detail-panel, .chart-panel, .trade-panel { padding: var(--s-4); }

    .section-heading { margin: var(--s-8) 0 var(--s-4); }
    .section-heading h2 { font-size: var(--fs-lg); }
    .section-heading > .text-sm { display: none; }

    .carousel-nav { display: none; }

    .detail-stat-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .detail-stat { padding: var(--s-2); }
    .probability-ring { --ring: 104px; --thick: 9px; }

    /* Trade modal becomes a native-feeling bottom sheet */
    .trade-overlay { align-items: flex-end; padding: 0; }
    .trade-modal {
        max-width: none;
        max-height: 88dvh;
        padding: var(--s-5) var(--s-4) calc(var(--s-5) + env(safe-area-inset-bottom));
        border-radius: var(--r-xl) var(--r-xl) 0 0;
        border-bottom: none;
        animation: sheet-in var(--t-slow) var(--ease-out);
    }
    .trade-modal::before {
        content: '';
        display: block;
        width: 38px;
        height: 4px;
        margin: 0 auto var(--s-4);
        border-radius: var(--r-pill);
        background: var(--border-strong);
    }

    /* Sticky trade CTA on market detail */
    .trade-sticky {
        position: fixed;
        inset-inline: 0;
        bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom));
        z-index: var(--z-sticky);
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--s-2);
        padding: var(--s-3) var(--s-4);
        background: var(--surface-glass);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        border-top: 1px solid var(--border-subtle);
    }

    .footer { margin-top: var(--s-12); padding-bottom: var(--s-6); }

    .data-table thead th, .data-table tbody td { padding: 10px var(--s-3); font-size: var(--fs-xs); }

    /* Инсайт-виджеты главной: не стекуем во всю ширину (было — длинный «хвост»
       под лентой), а превращаем в горизонтальный свайп-стрип как у категорий. */
    .home-insights-grid {
        display: flex;
        gap: var(--s-3);
        margin-inline: calc(var(--s-4) * -1);
        padding-inline: var(--s-4);
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .home-insights-grid::-webkit-scrollbar { display: none; }
    .home-insights-grid .sidebar-block {
        flex: 0 0 82vw;
        scroll-snap-align: start;
    }

    /* Comfortable touch targets */
    .btn-xs { height: 34px; }
    .filter-btn, .subnav a { min-height: 34px; }

    /* ── Тулбар: сорт/режим уходят в bottom-sheet, в строке — только категории ── */
    .toolbar-row { display: none; }

    .filters-trigger {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        flex: 0 0 auto;
        min-height: 34px;
        padding: 7px 13px;
        border: 1px solid var(--border-subtle);
        border-radius: var(--r-pill);
        background: var(--surface-inset);
        font-size: var(--fs-xs);
        font-weight: 600;
        color: var(--text-body);
    }
    .filters-trigger .dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--brand-400);
        box-shadow: 0 0 8px var(--brand-glow);
    }

    .filters-overlay {
        position: fixed;
        inset: 0;
        z-index: var(--z-drawer);
        background: rgba(4, 5, 8, 0.6);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }
    .filters-overlay.is-open { display: block; animation: fade-in var(--t-base) var(--ease-out); }

    .filters-sheet {
        display: flex;
        flex-direction: column;
        gap: var(--s-4);
        position: fixed;
        inset-inline: 0;
        bottom: 0;
        z-index: var(--z-modal);
        max-height: 82dvh;
        overflow-y: auto;
        padding: var(--s-3) var(--s-4) calc(var(--s-5) + env(safe-area-inset-bottom));
        background: var(--surface-glass);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-default);
        border-radius: var(--r-xl) var(--r-xl) 0 0;
        box-shadow: var(--e-4);
        transform: translateY(100%);
        visibility: hidden;
        /* visibility скрывается только ПОСЛЕ слайда наружу, чтобы анимация была видна */
        transition: transform var(--t-base) var(--ease-out), visibility 0s linear var(--t-base);
    }
    .filters-sheet.is-open {
        transform: translateY(0);
        visibility: visible;
        /* при открытии visibility включается сразу — слайд виден */
        transition: transform var(--t-base) var(--ease-out), visibility 0s;
    }
    .filters-sheet::before {
        content: '';
        align-self: center;
        width: 38px;
        height: 4px;
        border-radius: var(--r-pill);
        background: var(--border-strong);
    }
    .filters-sheet-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-family: var(--font-display);
        font-weight: 600;
        font-size: var(--fs-md);
    }
    .filters-sheet-close {
        display: grid;
        place-items: center;
        width: 30px;
        height: 30px;
        border-radius: var(--r-sm);
        background: var(--surface-2);
        color: var(--text-dim);
    }
    .filters-sheet .filters { flex-wrap: wrap; overflow: visible; padding-top: 0; }
    .filters-sheet .filter-btn { padding: 9px 14px; }
    .filters-sheet .segmented { align-self: stretch; }
    .filters-sheet .segmented > * { flex: 1; text-align: center; }
}

/* --- Phones only (<= 639px) -------------------------------------------- */
@media (max-width: 639px) {
    .hero-card { flex: 0 0 84vw; min-width: 84vw; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: var(--s-5); }
    .headline-title { font-size: 26px; }
    .trade-price-row, .card-prices { gap: 6px; }
}

/* --- >= 480px ---------------------------------------------------------- */
@media (min-width: 480px) {
    .markets-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

/* --- >= 640px ---------------------------------------------------------- */
@media (min-width: 640px) {
    .container { padding-inline: var(--s-5); }
    .headline-shell { padding: var(--s-8); }
    .headline-metrics { flex-wrap: nowrap; }
    .footer-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}

/* --- >= 900px : desktop chrome ---------------------------------------- */
@media (min-width: 900px) {
    .header-nav { display: flex; }
    .header-search { display: block; }
    .mobile-nav, .fab, .trade-sticky { display: none; }

    .headline-shell { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr); align-items: center; }
    .headline-metrics { flex-direction: column; }
    .metric-pill { width: 100%; flex: none; }

    .detail-hero-grid { grid-template-columns: minmax(0, 1fr) 260px; }
    .event-hero-grid  { grid-template-columns: 1fr auto; }

    .markets-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
    .market-row { grid-template-columns: 1fr auto auto; }
}

/* --- >= 1100px : two-column page shell ------------------------------- */
@media (min-width: 1100px) {
    .page-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s-6); }
    .page-layout > .sidebar { position: sticky; top: calc(var(--header-h) + var(--subnav-h) + var(--s-4)); }
    .container { padding-inline: var(--s-6); }
}

/* --- >= 1400px : breathing room ------------------------------------- */
@media (min-width: 1400px) {
    .markets-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s-5); }
    .page-layout { grid-template-columns: minmax(0, 1fr) 340px; }
    :root { --fs-base: 14px; }
}

/* --- Admin responsive ------------------------------------------------- */
@media (max-width: 900px) {
    .admin-sidebar { display: none; }
    .admin-content { padding: var(--s-4); }
}

/* ==========================================================================
   27  ACCESSIBILITY & PRINT
   ========================================================================== */
:focus-visible {
    outline: 2px solid var(--brand-400);
    outline-offset: 2px;
    border-radius: var(--r-xs);
}
:focus:not(:focus-visible) { outline: none; }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
.skip-link {
    position: fixed;
    top: -60px;
    left: var(--s-4);
    z-index: var(--z-toast);
    padding: 10px 16px;
    border-radius: var(--r-xs);
    background: var(--brand-500);
    color: #fff;
    font-size: var(--fs-sm);
    font-weight: 600;
    transition: top var(--t-base) var(--ease-out);
}
.skip-link:focus { top: var(--s-4); color: #fff; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .market-card:hover, .pm-card:hover, .hero-card:hover, .btn:hover { transform: none; }
}

@media (prefers-contrast: more) {
    :root {
        --border-subtle: rgba(255, 255, 255, 0.18);
        --border-default: rgba(255, 255, 255, 0.28);
        --text-body: rgba(237, 241, 247, 0.9);
        --text-dim: rgba(237, 241, 247, 0.68);
    }
}

@media print {
    body::before, body::after,
    .header, .toolbar-shell, .mobile-nav, .footer, .trade-overlay, .fab { display: none !important; }
    body { background: #fff; color: #000; }
    .market-card, .surface-panel { border: 1px solid #ccc; box-shadow: none; background: #fff; }
}
