:root{
  --bg:#080B12;
  --bg-alt:#0C1120;
  --surface:#111827;
  --surface-2:#161F33;
  --line:#1F2A3D;
  --line-strong:#2E3B52;
  --ink:#E9EDF5;
  --muted:#8B93A7;
  --accent:#4C7CFF;
  --accent-2:#22D3EE;
  --accent-purple:#8B5CF6;
  --success:#22C55E;
  --danger:#F87171;
  --pending:#FBBF24;
  --radius:8px;
  --font-display:'Space Grotesk',sans-serif;
  --font-body:'Inter',sans-serif;
  --font-mono:'JetBrains Mono',monospace;
  --gradient: linear-gradient(135deg, var(--accent), var(--accent-purple));
  --prose:#C7CEDD;
  --prose-strong:#fff;
  --header-bg:rgba(8,11,18,.85);
}

/* ---------------- LIGHT THEME ---------------- */
body.theme-light{
  --bg:#F3F5FA;
  --bg-alt:#EBEEF6;
  --surface:#FFFFFF;
  --surface-2:#F1F3FA;
  --line:#E1E5F0;
  --line-strong:#C9D0E0;
  --ink:#12141A;
  --muted:#5B6272;
  --accent:#3D5FE0;
  --accent-2:#2C46C9;
  --accent-purple:#7A46E0;
  --success:#16A34A;
  --danger:#DC2626;
  --pending:#B45A08;
  --prose:#2A2D36;
  --prose-strong:#0A0C10;
  --header-bg:rgba(255,255,255,.85);
}
body.theme-light .ql-editor.ql-blank::before{color:var(--muted) !important;}

*{box-sizing:border-box; margin:0; padding:0;}
html{scroll-behavior:smooth; height:100%;}
body{
  background:var(--bg);
  color:var(--ink);
  font-family:var(--font-body);
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  display:flex;
  flex-direction:column;
  min-height:100vh;
}
main{flex:1 0 auto;}
header, .ticker-bar, footer{flex-shrink:0;}
.site-bg-canvas{position:fixed; inset:0; width:100vw; height:100vh; z-index:0; opacity:.3; pointer-events:none;}

.reading-progress{position:fixed; top:0; left:0; width:100%; height:3px; z-index:200; pointer-events:none;}
.reading-progress-fill{height:100%; width:0%; background:var(--gradient);}
@media (prefers-reduced-motion: no-preference){ .reading-progress-fill{transition:width .1s linear;} }

.next-article-bar{
  position:fixed; left:50%; bottom:-120px; transform:translateX(-50%);
  width:min(92vw, 420px); background:var(--surface); border:1px solid var(--line-strong); border-radius:14px;
  box-shadow:0 12px 32px rgba(0,0,0,.35); display:flex; align-items:center; gap:12px; padding:10px 12px;
  z-index:150; transition:bottom .35s ease;
}
.next-article-bar.visible{bottom:20px;}

.cookie-banner{
  position:fixed; left:0; right:0; bottom:-200px; z-index:300; background:var(--surface);
  border-top:1px solid var(--line-strong); box-shadow:0 -8px 24px rgba(0,0,0,.25); transition:bottom .3s ease;
}
.cookie-banner.visible{bottom:0;}
.cookie-banner-inner{display:flex; align-items:center; justify-content:space-between; gap:20px; padding:16px 24px; flex-wrap:wrap;}
.cookie-banner-inner p{font-size:13px; color:var(--muted); max-width:620px; line-height:1.5; margin:0;}
.cookie-banner-actions{display:flex; align-items:center; gap:16px; flex-shrink:0;}
.cookie-banner-actions a{font-size:13px; color:var(--accent-2); text-decoration:underline; white-space:nowrap;}
@media (max-width:640px){ .cookie-banner-inner{padding:14px 16px;} }
.next-article-bar img{width:48px; height:48px; border-radius:9px; object-fit:cover; flex-shrink:0; background:var(--bg-alt);}
.next-article-info{flex:1; cursor:pointer; min-width:0;}
.next-article-label{font-family:var(--font-mono); font-size:10px; color:var(--accent-2); text-transform:uppercase; letter-spacing:.06em;}
.next-article-info h5{font-size:13.5px; font-weight:600; line-height:1.35; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.next-article-close{background:none; border:none; color:var(--muted); font-size:19px; cursor:pointer; flex-shrink:0; padding:4px; line-height:1;}
.next-article-close:hover{color:var(--ink);}
@media (max-width:640px){ .next-article-bar{width:94vw;} }
header, .ticker-bar, .crypto-strip-wrap, main, footer, .overlay{position:relative; z-index:1;}
a{color:inherit; text-decoration:none;}
img{display:block; max-width:100%;}
button, input, select, textarea{font-family:inherit; font-size:inherit; color:inherit;}
:focus-visible{outline:2px solid var(--accent-2); outline-offset:2px;}
.wrap{max-width:1320px; margin:0 auto; padding:0 24px;}

/* ---------------- HEADER ---------------- */
header{position:sticky; top:0; z-index:40; background:var(--header-bg); backdrop-filter:blur(10px); border-bottom:1px solid var(--line);}
.header-inner{display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:72px; flex-wrap:wrap; padding:10px 0;}
.logo{font-family:var(--font-display); font-weight:700; font-size:22px; letter-spacing:-0.02em; display:flex; align-items:center; gap:8px; flex-shrink:0;}
.logo-icon{width:26px; height:26px; border-radius:6px; object-fit:cover; flex-shrink:0;}
nav.main-nav{display:flex; gap:4px; overflow-x:auto; scroll-behavior:smooth; scrollbar-width:none; -ms-overflow-style:none; flex:1; min-width:0;}
nav.main-nav::-webkit-scrollbar{display:none;}
nav.main-nav button{background:none; border:none; padding:8px 14px; border-radius:var(--radius); font-size:14px; font-weight:500; color:var(--muted); cursor:pointer; transition:background .15s, color .15s; white-space:nowrap; flex-shrink:0;}
nav.main-nav button:hover{background:var(--surface); color:var(--ink);}
nav.main-nav button.active{background:rgba(76,124,255,.15); color:var(--accent-2);}
.nav-scroll-wrap{display:flex; align-items:center; gap:6px; flex:1; min-width:0;}
.nav-arrow{flex-shrink:0; width:26px; height:26px; border-radius:50%; border:1px solid var(--line-strong); background:none; color:var(--muted); font-size:15px; line-height:1; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:.15s;}
.nav-arrow:hover{border-color:var(--accent); color:var(--ink);}
@media (max-width:920px){ .nav-arrow{display:none;} }
.header-actions{display:flex; align-items:center; gap:10px; flex-shrink:0;}

.theme-toggle{
  width:34px; height:34px; border-radius:50%; border:1px solid var(--line-strong); background:var(--surface);
  display:flex; align-items:center; justify-content:center; cursor:pointer; font-size:15px; transition:.15s; flex-shrink:0;
}
.theme-toggle:hover{border-color:var(--accent);}

.search-bar{background:var(--surface); border-bottom:1px solid var(--line); max-height:0; overflow:hidden; transition:max-height .2s ease;}
.search-bar.open{max-height:80px;}
.search-bar-inner{display:flex; gap:10px; padding:14px 24px;}
.search-input{flex:1; border:1px solid var(--line-strong); border-radius:var(--radius); background:var(--bg-alt); color:var(--ink); padding:10px 14px; font-size:14px;}
.search-input:focus{border-color:var(--accent);}

.lang-switch{display:flex; border:1px solid var(--line-strong); border-radius:100px; padding:2px; gap:2px;}
.lang-switch button{display:flex; align-items:center; gap:5px; border:none; background:none; padding:6px 10px 6px 8px; border-radius:100px; font-size:12px; font-weight:600; letter-spacing:.03em; color:var(--muted); cursor:pointer;}
.lang-switch button .flag{font-size:14px; line-height:1;}
.lang-switch button.active{background:var(--surface-2); color:var(--ink);}

.btn{font-size:14px; font-weight:500; padding:9px 16px; border-radius:var(--radius); border:1px solid var(--line-strong); background:var(--surface); color:var(--ink); cursor:pointer; transition:border-color .15s, background .15s; white-space:nowrap;}
.btn:hover{border-color:var(--accent);}
.btn-primary{background:var(--gradient); border-color:transparent; color:#fff;}
.btn-primary:hover{filter:brightness(1.1);}
.btn-signal{background:var(--gradient); border-color:transparent; color:#fff;}
.btn-signal:hover{filter:brightness(1.1);}
.btn-ghost{background:none; border-color:var(--line-strong);}
.btn-danger-outline{border-color:var(--danger); color:var(--danger); background:none;}
.btn-success-outline{border-color:var(--success); color:var(--success); background:none;}
.btn-sm{padding:6px 12px; font-size:13px;}
.btn-block{width:100%; padding:12px;}
.btn[disabled]{opacity:.5; cursor:default;}
.user-chip{display:flex; align-items:center; gap:8px; font-size:13px; color:var(--muted); font-family:var(--font-mono);}
.user-chip b{color:var(--ink); font-family:var(--font-body); font-weight:600;}
.admin-badge{background:var(--gradient); color:#fff; font-size:10px; font-weight:700; padding:2px 7px; border-radius:100px; letter-spacing:.04em;}
.menu-toggle{display:none; background:none; border:none; cursor:pointer; padding:8px;}
.menu-toggle span, .menu-toggle span::before, .menu-toggle span::after{content:''; display:block; width:20px; height:2px; background:var(--ink); position:relative;}
.menu-toggle span::before{position:absolute; top:-6px;}
.menu-toggle span::after{position:absolute; top:6px;}

/* ---------------- TICKER ---------------- */
.ticker-bar{background:var(--bg-alt); color:var(--ink); overflow:hidden; position:relative; height:36px; display:flex; align-items:center; border-bottom:1px solid var(--line);}
.ticker-label{display:flex; align-items:center; gap:6px; font-family:var(--font-mono); font-size:11px; letter-spacing:.06em; background:var(--gradient); color:#fff; height:100%; padding:0 14px; flex-shrink:0; z-index:2; position:relative;}
.ticker-label .pulse{width:6px; height:6px; border-radius:50%; background:#fff; animation:pulse 1.4s infinite;}
@keyframes pulse{0%,100%{opacity:1;} 50%{opacity:.3;}}
.ticker-track-wrap{overflow:hidden; flex:1; height:100%; display:flex; align-items:center;}
.ticker-track{display:flex; gap:48px; white-space:nowrap; font-family:var(--font-mono); font-size:12.5px; padding-left:24px; animation:scroll-left 32s linear infinite;}
.ticker-track span{color:var(--muted);}
.ticker-track span b{color:var(--ink); font-weight:600;}
@keyframes scroll-left{from{transform:translateX(0);} to{transform:translateX(-50%);}}
@media (prefers-reduced-motion: reduce){ .ticker-track{animation:none; overflow-x:auto;} .ticker-label .pulse{animation:none;} }

/* ---------------- CRYPTO WIDGET (right column) ---------------- */
.crypto-widget{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:16px; margin-bottom:20px;}
.crypto-widget-title{font-family:var(--font-mono); font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.08em; margin-bottom:12px; display:flex; align-items:center; gap:6px;}
.crypto-widget-title .pulse{width:6px; height:6px; border-radius:50%; background:var(--success); animation:pulse 1.4s infinite;}
.crypto-row{display:flex; align-items:center; justify-content:space-between; padding:9px 0; border-bottom:1px solid var(--line); font-family:var(--font-mono);}
.crypto-row:last-child{border-bottom:none;}
.crypto-row .sym{font-size:12.5px; color:var(--ink); font-weight:600;}
.crypto-row .right{text-align:right;}
.crypto-row .price{font-size:13px; color:var(--ink); display:block;}
.crypto-row .chg{font-size:11px; font-weight:600;}
.crypto-row .chg.up{color:var(--success);}
.crypto-row .chg.down{color:var(--danger);}
.crypto-widget.skeleton .crypto-row .price::before{content:"···"; color:var(--muted);}
.crypto-widget-err{font-size:12px; color:var(--muted); text-align:center; padding:8px 0;}

/* ---------------- LIKES ---------------- */
.like-btn{display:inline-flex; align-items:center; gap:6px; background:var(--surface); border:1px solid var(--line-strong); border-radius:100px; padding:7px 14px; font-size:14px; cursor:pointer; transition:border-color .15s, background .15s, color .15s; color:var(--ink);}
.like-btn:hover{border-color:var(--danger);}
.like-btn.liked{background:rgba(248,113,113,.12); border-color:var(--danger); color:var(--danger);}
.like-btn span{font-family:var(--font-mono); font-size:13px;}
.like-btn .like-icon{font-family:var(--font-body); display:inline-block;}
.like-btn.like-pop .like-icon{animation:likePop .4s ease;}
@keyframes likePop{
  0%{transform:scale(1);}
  35%{transform:scale(1.35) rotate(-6deg);}
  60%{transform:scale(0.92);}
  100%{transform:scale(1);}
}
.like-particle{
  position:fixed; pointer-events:none; color:var(--danger); z-index:500; line-height:1;
  animation:likeFloat .85s ease-out forwards;
}
@keyframes likeFloat{
  0%{opacity:1; transform:translate(0,0) rotate(0) scale(.6);}
  100%{opacity:0; transform:translate(var(--dx,0), -70px) rotate(var(--rot,0)) scale(1.15);}
}
.likes-tag{display:flex; align-items:center; gap:4px;}

.view-fade{animation:viewFadeIn .28s ease;}
@keyframes viewFadeIn{
  from{opacity:0; transform:translateY(8px);}
  to{opacity:1; transform:translateY(0);}
}
@media (prefers-reduced-motion: reduce){ .view-fade{animation:none;} }

.card, .related-card, .popular-card{opacity:0; transform:translateY(16px); transition:opacity .5s ease, transform .5s ease, border-color .15s, box-shadow .15s;}
.card.reveal-visible, .related-card.reveal-visible, .popular-card.reveal-visible{opacity:1; transform:translateY(0);}
.card.reveal-visible:hover{transform:translateY(-2px);}
.related-card.reveal-visible:hover{transform:translateY(-2px);}
@media (prefers-reduced-motion: reduce){
  .card, .related-card, .popular-card{opacity:1 !important; transform:none !important; transition:none !important;}
}

/* ---------------- ADMIN STATS ---------------- */
.stats-grid{display:grid; grid-template-columns:repeat(6, 1fr); gap:14px; margin-bottom:32px;}
.stat-card{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:18px 16px; text-align:center;}
.stat-card .num{font-family:var(--font-display); font-size:26px; font-weight:700; color:var(--accent-2); display:block; margin-bottom:4px;}
.stat-card .lbl{font-family:var(--font-mono); font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.05em;}
.stats-summary{display:flex; gap:14px; margin-bottom:32px; flex-wrap:wrap;}
.stats-summary .stat-card{flex:1; min-width:160px;}
.stats-columns{display:grid; grid-template-columns:1fr 1fr; gap:24px;}
.stats-col-title{font-family:var(--font-display); font-size:16px; font-weight:700; margin-bottom:14px;}
.stats-list-row{display:flex; align-items:center; gap:12px; padding:10px 0; border-bottom:1px solid var(--line);}
.stats-list-row:last-child{border-bottom:none;}
.stats-list-row .rank{font-family:var(--font-mono); font-size:12px; color:var(--line-strong); width:18px; flex-shrink:0;}
.stats-list-row .title{flex:1; font-size:13.5px; font-weight:500; line-height:1.35;}
.stats-list-row .val{font-family:var(--font-mono); font-size:13px; color:var(--accent-2); flex-shrink:0;}
@media (max-width:920px){
  .stats-grid{grid-template-columns:repeat(3, 1fr);}
  .stats-columns{grid-template-columns:1fr;}
}
@media (max-width:640px){
  .stats-grid{grid-template-columns:repeat(2, 1fr);}
}

/* ---------------- HERO / ANIMATED BACKGROUND ---------------- */
.hero{position:relative; padding:56px 0 44px; border-bottom:1px solid var(--line); overflow:hidden;}
.hero-bg-canvas{position:absolute; inset:0; width:100%; height:100%; opacity:.35; pointer-events:none;}
.hero-bg-fade{position:absolute; inset:0; background:linear-gradient(180deg, transparent 0%, var(--bg) 92%); pointer-events:none;}
.hero-grid{position:relative; display:grid; grid-template-columns:1.6fr 1fr; gap:40px; z-index:1;}
.hero-grid-single{grid-template-columns:1fr; max-width:320px; margin-left:auto;}
.eyebrow{font-family:var(--font-mono); font-size:12px; color:var(--accent-2); font-weight:500; letter-spacing:.08em; text-transform:uppercase; margin-bottom:12px; display:block;}
.hero-feat{cursor:pointer;}
.media-frame{position:relative; width:100%; aspect-ratio:16/8.5; border-radius:var(--radius); background:var(--surface); border:1px solid var(--line); margin-bottom:20px; overflow:hidden;}
.media-frame-bg{position:absolute; inset:0; width:100%; height:100%; object-fit:cover; filter:blur(28px) brightness(.55) saturate(1.3); transform:scale(1.15);}
.media-frame-fg{position:relative; width:100%; height:100%; object-fit:contain; display:block;}
.media-frame .video-badge{position:absolute; top:12px; left:12px; background:rgba(0,0,0,.6); color:#fff; font-size:11px; font-weight:600; padding:4px 10px; border-radius:100px; display:flex; align-items:center; gap:4px; z-index:2; pointer-events:none;}
.hero-feat h1{font-family:var(--font-display); font-size:34px; line-height:1.14; font-weight:700; letter-spacing:-0.01em; margin-bottom:12px;}
.hero-feat:hover h1{color:var(--accent-2);}
.hero-feat p.excerpt{color:var(--muted); font-size:16px; line-height:1.6; max-width:60ch;}
.meta-line{display:flex; align-items:center; gap:10px; font-family:var(--font-mono); font-size:12.5px; color:var(--muted); margin-top:16px; flex-wrap:wrap;}
.cat-pill{font-family:var(--font-body); font-size:11.5px; font-weight:600; padding:4px 10px; border-radius:100px; background:rgba(76,124,255,.15); color:var(--accent-2); text-transform:uppercase; letter-spacing:.02em;}
.pending-pill{font-family:var(--font-body); font-size:11px; font-weight:600; padding:3px 9px; border-radius:100px;}
.pending-pill.pending{background:rgba(251,191,36,.15); color:var(--pending);}
.pending-pill.rejected{background:rgba(248,113,113,.15); color:var(--danger);}
.pending-pill.published{background:rgba(34,197,94,.15); color:var(--success);}
.pending-pill.scheduled{background:rgba(76,124,255,.15); color:var(--accent-2);}
.views-tag{display:flex; align-items:center; gap:4px;}
.read-tag{display:flex; align-items:center; gap:4px;}

.side-list{position:relative; z-index:1; display:flex; flex-direction:column;}
.side-list-title{font-family:var(--font-mono); font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.08em; padding-bottom:14px; border-bottom:1px solid var(--line); margin-bottom:6px;}
.side-item{display:flex; gap:12px; padding:16px 0; border-bottom:1px solid var(--line); cursor:pointer;}
.side-item:last-child{border-bottom:none;}
.side-item .idx{font-family:var(--font-mono); font-size:13px; color:var(--line-strong); flex-shrink:0; padding-top:2px;}
.side-item h3{font-size:15px; font-weight:600; line-height:1.35; margin-bottom:6px;}
.side-item:hover h3{color:var(--accent-2);}
.side-item .meta-line{margin-top:0; font-size:11.5px;}

/* ---------------- POPULAR WIDGET ---------------- */
.popular-section{padding:8px 0 8px;}
.popular-grid{display:grid; grid-template-columns:repeat(5,1fr); gap:16px;}
.popular-card{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:16px; cursor:pointer; transition:.15s; position:relative;}
.popular-card:hover{border-color:var(--accent); transform:translateY(-2px);}
.popular-card .rank{position:absolute; top:12px; right:14px; font-family:var(--font-display); font-size:22px; font-weight:700; color:var(--line-strong);}
.popular-card h4{font-size:13.5px; font-weight:600; line-height:1.35; margin:6px 30px 10px 0;}
.popular-card .views-tag{font-family:var(--font-mono); font-size:11px; color:var(--accent-2);}

/* ---------------- SECTION / FILTERS ---------------- */
.section-head{display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:16px; padding:40px 0 20px;}
.section-head h2{font-family:var(--font-display); font-size:22px; font-weight:700;}
.filters{display:flex; gap:8px; flex-wrap:wrap;}
.filters button{background:var(--surface); border:1px solid var(--line); padding:7px 14px; border-radius:100px; font-size:13px; font-weight:500; color:var(--muted); cursor:pointer; transition:.15s;}
.filters button:hover{border-color:var(--accent);}
.filters button.active{background:var(--gradient); border-color:transparent; color:#fff;}

/* ---------------- GRID ---------------- */
.grid{display:grid; grid-template-columns:repeat(3, 1fr); gap:24px; padding-bottom:56px;}
.card{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; cursor:pointer; transition:border-color .15s, transform .15s; display:flex; flex-direction:column;}
.card:hover{border-color:var(--accent); transform:translateY(-2px);}
.thumb-wrap{position:relative; overflow:hidden;}
.thumb-wrap .video-badge{position:absolute; top:8px; left:8px; background:rgba(0,0,0,.6); color:#fff; font-size:10px; font-weight:600; padding:3px 8px; border-radius:100px; z-index:2; pointer-events:none;}
.card .thumb{width:100%; aspect-ratio:16/10; object-fit:cover; background:var(--bg-alt); transition:transform .4s ease;}
.card:hover .thumb{transform:scale(1.06);}
.card-body{padding:18px 18px 20px; display:flex; flex-direction:column; gap:10px; flex:1;}
.card-body h3{font-size:17px; font-weight:600; line-height:1.35;}
.card:hover .card-body h3{color:var(--accent-2);}
.card-body p{font-size:13.5px; color:var(--muted); line-height:1.55; flex:1;}
.card-foot{display:flex; align-items:center; justify-content:space-between; margin-top:4px; flex-wrap:wrap; gap:6px;}
.card-top-row{display:flex; align-items:center; justify-content:space-between; gap:8px;}

.empty-state{text-align:center; padding:80px 24px; color:var(--muted);}
.empty-state h3{font-family:var(--font-display); font-size:20px; color:var(--ink); margin-bottom:8px;}
.empty-state p{font-size:14px; margin-bottom:20px;}
.loading-state{text-align:center; padding:80px 24px; color:var(--muted); font-family:var(--font-mono); font-size:13px;}

.ad-slot{
  min-height:100px; border:1.5px dashed var(--line-strong); border-radius:var(--radius);
  display:flex; align-items:center; justify-content:center; margin:24px 0;
  background:repeating-linear-gradient(135deg, var(--surface), var(--surface) 10px, var(--bg-alt) 10px, var(--bg-alt) 20px);
}
.ad-slot-label{font-family:var(--font-mono); font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.06em;}

/* Лівий бічний рекламний блок ("skyscraper"). Прихований, поки в app.js
   не увімкнено ADS_ENABLED = true — і навіть тоді показується лише на
   дуже широких екранах, щоб ніколи не перекривати основний контент. */
.ad-skyscraper{
  display:none; position:fixed; top:140px; left:20px; width:150px; min-height:560px;
  border:1.5px dashed var(--line-strong); border-radius:var(--radius); z-index:5;
  align-items:center; justify-content:center; text-align:center; padding:12px;
  background:repeating-linear-gradient(135deg, var(--surface), var(--surface) 10px, var(--bg-alt) 10px, var(--bg-alt) 20px);
}
@media (min-width:1680px){
  .ad-skyscraper.enabled{display:flex;}
}

/* ---------------- SIDE RAILS (categories/stats left, crypto/latest right) ----------------
   З'являються лише на дуже широких екранах, де інакше просто порожні поля обабіч контенту.
   NB: якщо пізніше увімкнете ADS_ENABLED — лівий рекламний блок (.ad-skyscraper) займає
   ту саму ліву смугу, що й .rail-left. Тоді один із двох варто буде змістити нижче/вбік. */
.side-rail{
  display:none; position:fixed; top:140px; width:200px; max-height:calc(100vh - 180px);
  overflow-y:auto; z-index:4;
}
.side-rail::-webkit-scrollbar{width:4px;}
.side-rail::-webkit-scrollbar-thumb{background:var(--line-strong); border-radius:4px;}
.rail-left{left:20px;}
.rail-right{right:20px;}
@media (min-width:1820px){ .side-rail{display:block;} }

.rail-widget{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:16px; margin-bottom:16px;}
.rail-widget-title{font-family:var(--font-mono); font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; margin-bottom:12px;}
.rail-cat-item{
  display:flex; align-items:center; justify-content:space-between; width:100%; background:none; border:none;
  padding:8px 6px; border-radius:6px; font-size:13px; color:var(--muted); cursor:pointer; text-align:left;
}
.rail-cat-item:hover{background:var(--bg-alt); color:var(--ink);}
.rail-cat-item.active{background:rgba(76,124,255,.15); color:var(--accent-2); font-weight:600;}
.rail-cat-item .cnt{font-family:var(--font-mono); font-size:11px; color:var(--line-strong);}
.rail-cat-item.active .cnt{color:var(--accent-2);}
.rail-stat-row{display:flex; align-items:center; justify-content:space-between; padding:7px 0; border-bottom:1px solid var(--line); font-size:12.5px; color:var(--muted);}
.rail-stat-row:last-child{border-bottom:none;}
.rail-stat-row b{color:var(--ink); font-family:var(--font-mono); font-weight:600;}
.rail-latest-item{display:block; padding:10px 0; border-bottom:1px solid var(--line); cursor:pointer;}
.rail-latest-item:last-child{border-bottom:none;}
.rail-latest-item h5{font-size:12.5px; font-weight:600; line-height:1.4; margin-bottom:4px; color:var(--ink);}
.rail-latest-item:hover h5{color:var(--accent-2);}
.rail-latest-item span{font-family:var(--font-mono); font-size:10.5px; color:var(--muted);}

.currency-amount{
  width:100%; border:1px solid var(--line-strong); border-radius:6px; background:var(--bg-alt); color:var(--ink);
  padding:8px 10px; font-size:14px; font-family:var(--font-mono); margin-bottom:10px;
}
.currency-row{display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:6px; margin-bottom:12px;}
.currency-select{
  width:100%; border:1px solid var(--line-strong); border-radius:6px; background:var(--bg-alt); color:var(--ink);
  padding:7px 4px; font-size:12.5px; font-family:var(--font-mono); text-align:center;
}
.currency-swap{
  width:26px; height:26px; border-radius:50%; border:1px solid var(--line-strong); background:none; color:var(--muted);
  cursor:pointer; font-size:13px; display:flex; align-items:center; justify-content:center; flex-shrink:0; transition:.15s;
}
.currency-swap:hover{border-color:var(--accent); color:var(--accent-2);}
.currency-result{
  font-family:var(--font-display); font-size:18px; font-weight:700; color:var(--accent-2);
  text-align:center; padding-top:4px; border-top:1px dashed var(--line);
}

.hero-crypto-mobile-only{display:block;}
@media (min-width:1820px){ .hero-crypto-mobile-only{display:none;} }

/* ---------------- NEWSLETTER ---------------- */
.newsletter{margin:16px 24px 56px; max-width:1132px; margin-left:auto; margin-right:auto; border-radius:16px; padding:36px; background:linear-gradient(135deg, rgba(76,124,255,.12), rgba(139,92,246,.12)); border:1px solid var(--line-strong); display:flex; align-items:center; justify-content:space-between; gap:24px; flex-wrap:wrap;}
.newsletter h3{font-family:var(--font-display); font-size:20px; margin-bottom:6px;}
.newsletter p{color:var(--muted); font-size:13.5px;}
.newsletter form{display:flex; gap:8px; flex-wrap:wrap;}
.newsletter input{border:1px solid var(--line-strong); background:var(--surface); border-radius:var(--radius); padding:10px 14px; font-size:14px; min-width:220px;}
.newsletter .ok{color:var(--success); font-size:13px; font-weight:600;}

/* ---------------- FOOTER ---------------- */
footer{border-top:1px solid var(--line); padding:32px 0 28px; margin-top:20px;}
.footer-inner{display:flex; flex-direction:column; gap:20px;}
.footer-top{display:flex; align-items:center; gap:20px; flex-wrap:wrap;}
footer .logo{font-size:18px; flex-shrink:0;}
footer p{font-size:13px; color:var(--muted); margin:0;}
.footer-bottom{display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; padding-top:18px; border-top:1px solid var(--line);}
.footer-links{display:flex; gap:8px; flex-wrap:wrap;}
.footer-social{display:flex; gap:8px; flex-wrap:wrap;}
.social-link{font-size:13px; font-weight:500; padding:8px 16px; border-radius:100px; border:1px solid var(--line-strong); color:var(--ink); transition:.15s;}
.social-link:hover{border-color:var(--accent); color:var(--accent-2);}
.social-link-icon{display:inline-flex; align-items:center; gap:7px;}
.social-icon{width:16px; height:16px; border-radius:4px; flex-shrink:0;}

/* ---------------- MODALS ---------------- */
.overlay{position:fixed; inset:0; background:rgba(3,5,10,.75); z-index:100; display:none; align-items:flex-start; justify-content:center; padding:6vh 20px; overflow-y:auto;}
.overlay.open{display:flex;}
.modal{background:var(--surface); border:1px solid var(--line); border-radius:14px; width:100%; max-width:440px; padding:32px; position:relative; animation:pop .18s ease-out;}
.modal.wide{max-width:820px;}
@keyframes pop{from{opacity:0; transform:translateY(8px);} to{opacity:1; transform:translateY(0);}}
.modal-close{position:absolute; top:18px; right:18px; background:none; border:none; cursor:pointer; font-size:20px; color:var(--muted); line-height:1; padding:4px;}
.modal-close:hover{color:var(--ink);}
.modal h2{font-family:var(--font-display); font-size:22px; font-weight:700; margin-bottom:6px;}
.modal .sub{font-size:13.5px; color:var(--muted); margin-bottom:24px;}
.tabs{display:flex; gap:4px; background:var(--bg-alt); padding:4px; border-radius:var(--radius); margin-bottom:24px;}
.tabs button{flex:1; background:none; border:none; padding:9px; border-radius:6px; font-size:13.5px; font-weight:500; color:var(--muted); cursor:pointer;}
.tabs button.active{background:var(--surface-2); color:var(--ink);}

.lang-tabs{display:flex; gap:8px; margin:24px 0 16px; border-bottom:1px solid var(--line);}
.lang-tabs button{display:flex; align-items:center; gap:6px; background:none; border:none; padding:10px 4px; font-size:14px; font-weight:600; color:var(--muted); cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-1px;}
.lang-tabs button .flag{font-size:15px;}
.lang-tabs button.active{color:var(--ink); border-bottom-color:var(--accent-2);}

.field{margin-bottom:16px;}
.field label{display:block; font-size:13px; font-weight:500; margin-bottom:6px; color:var(--ink);}
.field .hint{font-size:12px; color:var(--muted); margin-top:5px;}
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=datetime-local], .field select, .field textarea{width:100%; border:1px solid var(--line-strong); border-radius:var(--radius); padding:10px 12px; background:var(--bg-alt); color:var(--ink); font-size:14px;}
.field input:focus, .field select:focus, .field textarea:focus{border-color:var(--accent);}
.field textarea{resize:vertical; min-height:90px; font-family:inherit; line-height:1.55;}
.form-error{background:rgba(248,113,113,.12); color:var(--danger); font-size:13px; padding:10px 12px; border-radius:var(--radius); margin-bottom:16px; display:none;}
.form-error.show{display:block;}
.form-note{background:var(--bg-alt); color:var(--muted); font-size:12px; padding:10px 12px; border-radius:var(--radius); margin-top:20px; line-height:1.5;}

.draft-banner{
  display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap;
  background:rgba(76,124,255,.1); border:1px solid rgba(76,124,255,.35); border-radius:var(--radius);
  padding:12px 16px; margin-bottom:16px; font-size:13px; color:var(--ink);
}
.draft-banner-actions{display:flex; gap:8px; flex-shrink:0;}

.editor-grid{display:grid; grid-template-columns:1fr 1fr; gap:0 20px;}
.editor-grid .field.full{grid-column:1/-1;}
.image-drop{border:1.5px dashed var(--line-strong); border-radius:var(--radius); padding:20px; text-align:center; cursor:pointer; transition:.15s; position:relative; overflow:hidden; background:var(--bg-alt);}
.image-drop:hover{border-color:var(--accent);}
.image-drop input{position:absolute; inset:0; opacity:0; cursor:pointer;}
.image-drop p{font-size:13px; color:var(--muted);}
.image-drop.has-img{padding:0; border-style:solid;}
.image-drop.has-img img{width:100%; aspect-ratio:16/9; object-fit:cover; display:block;}
.image-drop.has-img video{width:100%; aspect-ratio:16/9; object-fit:contain; background:#000; display:block;}

/* ---------------- QUILL EDITOR (dark theme) ---------------- */
.quill-editor{background:var(--bg-alt); border:1px solid var(--line-strong); border-radius:var(--radius); overflow:hidden;}
.ql-toolbar.ql-snow{border:none; border-bottom:1px solid var(--line-strong); background:var(--surface-2); padding:8px;}
.ql-container.ql-snow{border:none; font-family:var(--font-body); font-size:14.5px;}
.quill-editor .ql-editor{min-height:200px; color:var(--ink) !important; line-height:1.6;}
.quill-editor .ql-editor.ql-blank::before{color:var(--muted) !important; font-style:normal;}
.quill-editor .ql-editor p, .quill-editor .ql-editor li, .quill-editor .ql-editor h2, .quill-editor .ql-editor h3{color:inherit;}
.ql-snow .ql-stroke{stroke:var(--muted);}
.ql-snow .ql-fill, .ql-snow .ql-stroke.ql-fill{fill:var(--muted);}
.ql-snow .ql-picker{color:var(--muted);}
.ql-snow .ql-picker-options{background:var(--surface); border:1px solid var(--line-strong); box-shadow:0 6px 16px rgba(0,0,0,.4);}
.ql-snow .ql-picker-item{color:var(--ink);}
.ql-snow .ql-picker-item:hover, .ql-snow .ql-picker-label:hover{color:var(--accent-2);}
.ql-snow .ql-picker-label:hover .ql-stroke{stroke:var(--accent-2);}
.ql-snow.ql-toolbar button:hover, .ql-snow .ql-toolbar button:hover{color:var(--accent-2);}
.ql-snow.ql-toolbar button:hover .ql-stroke, .ql-snow .ql-toolbar button:hover .ql-stroke{stroke:var(--accent-2);}
.ql-snow.ql-toolbar button.ql-active .ql-stroke, .ql-snow .ql-toolbar button.ql-active .ql-stroke{stroke:var(--accent-2);}
.ql-snow.ql-toolbar button.ql-active, .ql-snow .ql-toolbar button.ql-active{color:var(--accent-2);}
.ql-snow .ql-tooltip{background:var(--surface); border:1px solid var(--line-strong); color:var(--ink); box-shadow:0 6px 16px rgba(0,0,0,.4);}
.ql-snow .ql-tooltip input[type=text]{background:var(--bg-alt); border:1px solid var(--line-strong); color:var(--ink); outline:none;}
.ql-snow .ql-tooltip a.ql-action::after, .ql-snow .ql-tooltip a.ql-remove::before{color:var(--accent-2);}

/* Форматований текст статті на сторінці читання (та сама типографіка, що й у редакторі) */
.article-body.ql-editor-display{padding:0; border:none;}
.article-body.ql-editor-display h2{font-family:var(--font-display); font-size:24px; font-weight:700; margin:24px 0 12px; color:var(--ink);}
.article-body.ql-editor-display h3{font-family:var(--font-display); font-size:19px; font-weight:700; margin:20px 0 10px; color:var(--ink);}
.article-body.ql-editor-display p{margin-bottom:18px;}
.article-body.ql-editor-display ul, .article-body.ql-editor-display ol{margin:0 0 18px 22px;}
.article-body.ql-editor-display li{margin-bottom:6px;}
.article-body.ql-editor-display a{color:var(--accent-2); text-decoration:underline;}
.article-body.ql-editor-display blockquote{border-left:3px solid var(--accent); padding-left:16px; color:var(--muted); margin:0 0 18px; font-style:italic;}
.article-body.ql-editor-display strong{color:var(--prose-strong);}

/* ---------------- ARTICLE VIEW ---------------- */
.article-hero-img.media-frame{aspect-ratio:16/8; border-radius:12px; margin-bottom:28px;}
.article-cat{margin-bottom:14px; display:flex; gap:8px; align-items:center; flex-wrap:wrap;}
.article-title{font-family:var(--font-display); font-size:36px; font-weight:700; line-height:1.16; letter-spacing:-0.01em; margin-bottom:16px;}
.article-meta{display:flex; align-items:center; gap:14px; font-family:var(--font-mono); font-size:13px; color:var(--muted); padding-bottom:28px; border-bottom:1px solid var(--line); margin-bottom:28px; flex-wrap:wrap;}
.article-body{font-size:17px; line-height:1.8; color:var(--prose); max-width:70ch;}
.article-body p{margin-bottom:20px; white-space:pre-wrap;}
.back-link{display:inline-flex; align-items:center; gap:6px; font-size:14px; font-weight:500; color:var(--muted); margin-bottom:24px; cursor:pointer;}
.back-link:hover{color:var(--accent-2);}
.article-admin{display:flex; gap:8px; margin-top:28px; flex-wrap:wrap;}

.share-row{display:flex; align-items:center; gap:8px; margin-top:14px;}
.share-label{font-family:var(--font-mono); font-size:12px; color:var(--muted);}
.share-btn{
  width:32px; height:32px; border-radius:50%; border:1px solid var(--line-strong); background:var(--surface);
  display:flex; align-items:center; justify-content:center; font-size:14px; cursor:pointer; transition:.15s; color:var(--ink);
}
.share-btn:hover{border-color:var(--accent); color:var(--accent-2);}
.share-icon{width:16px; height:16px; border-radius:4px;}

.related-section{margin-top:36px; padding-top:24px; border-top:1px solid var(--line);}
.related-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-top:14px;}
.related-card{cursor:pointer; border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; background:var(--surface); transition:.15s;}
.related-card:hover{border-color:var(--accent); transform:translateY(-2px);}
.related-card img{width:100%; aspect-ratio:16/10; object-fit:cover;}
.related-card h4{font-size:13px; font-weight:600; padding:10px 12px; line-height:1.35;}
@media (max-width:640px){ .related-grid{grid-template-columns:1fr;} }

/* ---------------- ADMIN / MINE VIEWS ---------------- */
.admin-header{display:flex; align-items:center; justify-content:space-between; padding:36px 0 12px; flex-wrap:wrap; gap:12px;}
.admin-header h2{font-family:var(--font-display); font-size:24px; font-weight:700;}
.admin-tabs{display:flex; gap:6px; margin-bottom:24px; flex-wrap:wrap;}
.admin-tabs button{background:var(--surface); border:1px solid var(--line); padding:8px 16px; border-radius:100px; font-size:13px; font-weight:500; color:var(--muted); cursor:pointer;}
.admin-tabs button.active{background:var(--gradient); border-color:transparent; color:#fff;}
.bulk-toolbar{display:flex; align-items:center; gap:16px; padding:12px 16px; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); margin-bottom:14px; flex-wrap:wrap;}
.bulk-select-all{display:flex; align-items:center; gap:8px; font-size:13px; color:var(--muted); cursor:pointer;}
.admin-row{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:16px 18px; display:flex; gap:16px; align-items:center; margin-bottom:10px; flex-wrap:wrap;}
.admin-row input[type=checkbox]{width:17px; height:17px; flex-shrink:0; accent-color:var(--accent);}
.admin-row img{width:70px; height:52px; object-fit:cover; border-radius:6px; flex-shrink:0; background:var(--bg-alt);}
.admin-row .info{flex:1; min-width:200px;}
.admin-row .info h4{font-size:14.5px; font-weight:600; margin-bottom:4px;}
.admin-row .info .meta-line{margin-top:2px; font-size:11.5px;}
.admin-row .actions{display:flex; gap:6px; flex-wrap:wrap;}

/* ---------------- RESPONSIVE ---------------- */
@media (max-width:920px){
  nav.main-nav{display:none;}
  .menu-toggle{display:block;}
  .hero-grid{grid-template-columns:1fr;}
  .grid{grid-template-columns:repeat(2,1fr);}
  .popular-grid{grid-template-columns:repeat(2,1fr);}
}
@media (max-width:640px){
  .header-inner{height:auto; flex-wrap:wrap; padding:12px 0;}
  .btn span.label{display:none;}
  .hero-feat h1{font-size:26px;}
  .grid{grid-template-columns:1fr;}
  .popular-grid{grid-template-columns:1fr 1fr;}
  .editor-grid{grid-template-columns:1fr;}
  .article-title{font-size:26px;}
  .modal{padding:24px;}
  .lang-switch button{padding:6px 8px 6px 6px;}
  .newsletter{padding:24px; margin-left:16px; margin-right:16px;}
}
nav.main-nav.mobile-open{display:flex; position:absolute; top:72px; left:0; right:0; background:var(--surface); border-bottom:1px solid var(--line); flex-direction:column; overflow-x:visible; padding:8px 16px 16px; z-index:39;}
nav.main-nav.mobile-open button{text-align:left;}
