/* ════════════════════════════════════════════════════════════
   AIblink — Premium World-Class News Design System
   ════════════════════════════════════════════════════════════ */

/* ── Design Tokens ──────────────────────────────────────────── */
:root {
  /* Brand */
  --acc:       #dc2626;
  --acc-d:     #b91c1c;
  --acc-light: rgba(220,38,38,.1);
  --acc-glow:  rgba(220,38,38,.2);

  /* Surfaces */
  --bg:    #f0f2f5;
  --surf:  #ffffff;
  --surf2: #f8f9fa;
  --surf3: #eff1f4;

  /* Text */
  --txt:  #0f172a;
  --txt2: #334155;
  --txt3: #64748b;
  --txt4: #94a3b8;

  /* Borders */
  --bdr:  #e2e8f0;
  --bdr2: #cbd5e1;

  /* Shadows */
  --sh-xs: 0 1px 2px rgba(0,0,0,.05);
  --sh-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 8px rgba(0,0,0,.04);
  --sh-md: 0 4px 16px rgba(0,0,0,.09), 0 1px 4px rgba(0,0,0,.05);
  --sh-lg: 0 12px 36px rgba(0,0,0,.12), 0 3px 10px rgba(0,0,0,.06);
  --sh-xl: 0 24px 64px rgba(0,0,0,.16), 0 6px 20px rgba(0,0,0,.08);

  /* Radii */
  --r-xs: 4px;
  --r-sm: 6px;
  --r:    10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;

  /* Layout */
  --hdr-h: 64px;
  --nav-h: 48px;
  --max-w: 1360px;
}

/* Category colour tokens — cascade via var(--cat-c) */
.cat-ai    { --cat-c: #7c3aed; }
.cat-tech  { --cat-c: #2563eb; }
.cat-biz   { --cat-c: #059669; }
.cat-ent   { --cat-c: #ea580c; }
.cat-sport { --cat-c: #0891b2; }
.cat-sci   { --cat-c: #6d28d9; }
.cat-hlth  { --cat-c: #16a34a; }
.cat-life  { --cat-c: #be185d; }
.cat-india { --cat-c: #dc2626; }
.cat-world { --cat-c: #475569; }

/* ── Dark Mode ──────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:    #0d0f14;
  --surf:  #161b27;
  --surf2: #1e2336;
  --surf3: #1a1f30;

  --txt:  #f1f5f9;
  --txt2: #cbd5e1;
  --txt3: #94a3b8;
  --txt4: #64748b;

  --bdr:  #252d42;
  --bdr2: #2e3a56;

  --sh-xs: 0 1px 3px rgba(0,0,0,.3);
  --sh-sm: 0 1px 4px rgba(0,0,0,.35), 0 1px 10px rgba(0,0,0,.2);
  --sh-md: 0 4px 18px rgba(0,0,0,.4), 0 2px 6px rgba(0,0,0,.25);
  --sh-lg: 0 12px 40px rgba(0,0,0,.5), 0 4px 12px rgba(0,0,0,.3);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--txt);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  /* Stop the WebView's native overscroll/glow from fighting our pull-to-refresh. */
  overscroll-behavior-y: contain;
}
a  { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
img { display: block; max-width: 100%; height: auto; }
input, textarea { font: inherit; }
svg {
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  width: 20px; height: 20px; flex-shrink: 0;
  pointer-events: none;
}

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 200;
  height: var(--hdr-h);
  background: var(--surf);
  border-bottom: 1px solid var(--bdr);
  box-shadow: var(--sh-sm);
}
.header-inner {
  max-width: var(--max-w); margin: 0 auto;
  padding: 0 22px; height: 100%;
  display: flex; align-items: center; gap: 16px;
}

/* Logo */
.logo {
  display: flex; align-items: center; gap: 9px;
  flex-shrink: 0; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.logo-img {
  width: 34px; height: 34px; border-radius: 9px;
  object-fit: contain; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(220,38,38,.28);
}
.logo-text {
  font-size: 1.22rem; font-weight: 400; letter-spacing: -.3px;
  color: var(--txt); white-space: nowrap;
}
.logo-text b { font-weight: 900; color: var(--acc); }

/* Search */
.search-wrap { flex: 1; max-width: 500px; }
.search-bar {
  display: flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 16px;
  background: var(--surf2); border: 1.5px solid var(--bdr);
  border-radius: 999px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.search-bar:focus-within {
  border-color: var(--acc);
  box-shadow: 0 0 0 3px var(--acc-glow);
  background: var(--surf);
}
.search-icon { width: 17px; height: 17px; color: var(--txt3); }
#searchInput {
  flex: 1; border: none; background: none; outline: none;
  font-size: 14px; color: var(--txt); min-width: 0;
}
#searchInput::placeholder { color: var(--txt4); }
.search-clear {
  display: none; padding: 3px 8px; border-radius: 99px;
  font-size: 11.5px; color: var(--txt3);
  transition: background .15s, color .15s;
}
.search-clear:hover { background: var(--bdr); color: var(--txt); }
#searchInput:not(:placeholder-shown) ~ .search-clear { display: block; }

/* Header actions */
.header-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; margin-left: auto; }
.hdr-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--txt2); transition: background .15s, color .15s;
}
.hdr-btn:hover { background: var(--surf2); color: var(--txt); }
.hdr-btn svg { width: 20px; height: 20px; }
.icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun  { display: block; }

/* ── Category Nav ───────────────────────────────────────────── */
.cat-nav {
  position: sticky; top: var(--hdr-h); z-index: 190;
  height: var(--nav-h);
  background: var(--surf);
  border-bottom: 1px solid var(--bdr);
}
.cat-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 22px;
  height: 100%; display: flex; align-items: center; gap: 4px;
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
}
.cat-inner::-webkit-scrollbar { display: none; }
.cat-tab {
  display: inline-flex; align-items: center; gap: 5px;
  height: 34px; padding: 0 13px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  color: var(--txt2); transition: background .15s, color .15s;
}
.cat-tab svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.cat-tab:hover { background: var(--surf2); color: var(--txt); }
.cat-tab.active { background: var(--acc); color: #fff; }

/* ── Site Main ──────────────────────────────────────────────── */
.site-main { max-width: var(--max-w); margin: 0 auto; padding: 22px; }
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 308px;
  gap: 24px; align-items: start;
}

/* ── Breaking Ticker ────────────────────────────────────────── */
.breaking-bar {
  display: flex; align-items: center;
  background: var(--acc);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 22px;
  height: 42px;
  box-shadow: var(--sh-sm);
}
.breaking-label {
  flex-shrink: 0; padding: 0 14px;
  font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase;
  color: #fff; height: 100%;
  display: flex; align-items: center; gap: 7px;
  background: rgba(0,0,0,.22);
  border-right: 1px solid rgba(255,255,255,.2);
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #fff;
  animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(.8); }
}
.ticker-overflow { flex: 1; overflow: hidden; height: 100%; display: flex; align-items: center; }
.ticker {
  display: inline-flex; white-space: nowrap;
  animation: ticker-scroll 55s linear infinite;
}
.ticker:hover { animation-play-state: paused; }
.ticker-item {
  font-size: 13px; font-weight: 500; color: #fff;
  padding-right: 52px; cursor: pointer;
}
.ticker-item:hover { text-decoration: underline; text-underline-offset: 2px; }
@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Hero Editorial ─────────────────────────────────────────── */
.hero-editorial {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 12px;
  margin-bottom: 28px;
}

/* Main hero feature */
.hero-feature {
  border-radius: var(--r-lg); overflow: hidden;
  cursor: pointer; box-shadow: var(--sh-md);
  position: relative;
}
.hf-media {
  position: relative; height: clamp(260px, 30vw, 360px);
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}
.hf-media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .55s cubic-bezier(.25,.46,.45,.94);
}
.hero-feature:hover .hf-media img { transform: scale(1.04); }
.hf-media-ph {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--acc) 0%, #7c3aed 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem; opacity: .9;
}
.hf-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,.9)  0%,
    rgba(0,0,0,.65) 35%,
    rgba(0,0,0,.2)  65%,
    transparent     100%
  );
}
.hf-badge-wrap {
  position: absolute; top: 16px; left: 16px;
  display: flex; gap: 6px;
}
.hf-badge {
  font-size: 9.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  background: var(--cat-c, var(--acc)); color: #fff;
  padding: 3px 9px; border-radius: var(--r-xs);
}
.hf-content {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 22px 22px 20px;
}
.hf-title {
  font-size: clamp(1.2rem, 1.7vw, 1.6rem);
  font-weight: 800; line-height: 1.22; letter-spacing: -.4px;
  color: #fff; margin-bottom: 11px;
  word-break: break-word; overflow-wrap: break-word;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 6px rgba(0,0,0,.5);
}
.hf-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px; color: rgba(255,255,255,.92);
}
.hf-src { font-weight: 700; }
.hf-dot { opacity: .45; font-size: 10px; }
.hf-readmore {
  margin-left: auto; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; color: #fff;
  padding: 5px 14px; border-radius: 99px;
  border: 1.5px solid rgba(255,255,255,.6);
  transition: background .18s, color .18s, border-color .18s;
}
.hf-readmore:hover { background: #fff; color: #111; border-color: #fff; }

/* Hero side stack */
.hero-side {
  display: flex; flex-direction: column;
  background: var(--surf); border-radius: var(--r-lg);
  box-shadow: var(--sh-md); overflow: hidden;
}
.hs-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 15px 15px; flex: 1;
  cursor: pointer; border-bottom: 1px solid var(--bdr);
  transition: background .15s;
}
.hs-item:last-child { border-bottom: none; }
.hs-item:hover { background: var(--surf2); }
.hs-body { flex: 1; min-width: 0; }
.hs-cat {
  font-size: 9px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase;
  color: var(--cat-c, var(--acc));
  display: block; margin-bottom: 5px;
}
.hs-title {
  font-size: 13.5px; font-weight: 700; line-height: 1.4; color: var(--txt);
  word-break: break-word; overflow-wrap: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hs-meta {
  font-size: 11px; color: var(--txt3); margin-top: 7px;
  display: flex; align-items: center; gap: 4px;
}
.hs-dot { opacity: .4; }
.hs-thumb {
  width: 78px; height: 78px; flex-shrink: 0;
  border-radius: var(--r-sm); object-fit: cover; background: var(--surf3);
}

/* ── Section ────────────────────────────────────────────────── */
.news-section { margin-bottom: 30px; }
.sec-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 15px; padding-bottom: 12px;
  border-bottom: 1.5px solid var(--bdr);
}
.sec-title {
  font-size: 1rem; font-weight: 800; letter-spacing: -.2px; color: var(--txt);
  display: flex; align-items: center; gap: 9px;
}
.sec-title::before {
  content: ''; display: block;
  width: 4px; height: 19px;
  background: var(--acc); border-radius: 2px;
}
.sec-more {
  margin-left: auto; font-size: 12.5px; font-weight: 700;
  color: var(--acc); padding: 5px 14px; border-radius: 99px;
  border: 1.5px solid var(--acc-light);
  transition: background .15s, color .15s, border-color .15s;
}
.sec-more:hover { background: var(--acc); color: #fff; border-color: var(--acc); }

/* ── Cards grid (vertical) ──────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.card-span2 { grid-column: span 2; }

/* ── Vertical news card ─────────────────────────────────────── */
.news-card {
  background: var(--surf); border-radius: var(--r-md);
  box-shadow: var(--sh-sm); overflow: hidden;
  cursor: pointer; display: flex; flex-direction: column;
  transition: transform .22s cubic-bezier(.25,.46,.45,.94), box-shadow .22s ease;
}
.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-md);
}
.card-img-wrap {
  position: relative; overflow: hidden; background: var(--surf3);
  flex-shrink: 0;
}
.news-card:not(.card-span2) .card-img-wrap { height: 178px; }
.card-span2 .card-img-wrap { height: 226px; }
.card-img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s cubic-bezier(.25,.46,.45,.94);
}
.news-card:hover .card-img { transform: scale(1.06); }
.card-img-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
}
.card-cat {
  position: absolute; top: 10px; left: 10px;
  font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase;
  background: var(--cat-c, var(--acc)); color: #fff;
  padding: 3px 8px; border-radius: var(--r-xs);
}
.card-bk {
  position: absolute; top: 8px; right: 8px;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.4); backdrop-filter: blur(4px);
  font-size: 13px; opacity: 0;
  transition: opacity .18s, background .18s;
}
.news-card:hover .card-bk { opacity: 1; }
.card-bk.on { opacity: 1; background: var(--acc); }

.card-body {
  padding: 14px 15px 14px; flex: 1;
  display: flex; flex-direction: column; gap: 7px;
}
.card-title {
  font-size: 13.5px; font-weight: 700; line-height: 1.4; color: var(--txt);
  word-break: break-word; overflow-wrap: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-span2 .card-title { font-size: 15px; -webkit-line-clamp: 2; }
.card-summary {
  font-size: 12.5px; color: var(--txt3); line-height: 1.52;
  word-break: break-word; overflow-wrap: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-span2 .card-summary { -webkit-line-clamp: 3; }
.card-footer {
  margin-top: auto; padding-top: 9px;
  display: flex; align-items: center; gap: 7px;
  border-top: 1px solid var(--bdr);
}
.card-src { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; overflow: hidden; }
.src-dot {
  width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0;
  background: var(--cat-c, var(--acc)); color: #fff;
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  display: flex; align-items: center; justify-content: center; letter-spacing: .04em;
}
.src-info { min-width: 0; overflow: hidden; }
.src-name { font-size: 11.5px; font-weight: 700; color: var(--txt2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-time { font-size: 10.5px; color: var(--txt3); }
.card-acts { display: flex; align-items: center; gap: 1px; flex-shrink: 0; }
.act-btn {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--txt3); font-size: 15px;
  transition: background .15s, color .15s;
}
.act-btn:hover { background: var(--surf2); color: var(--txt); }
.act-btn svg { width: 15px; height: 15px; }
.read-time { font-size: 10.5px; color: var(--txt4); white-space: nowrap; }

/* ── Horizontal card (Google News style) ────────────────────── */
.hcards-list {
  background: var(--surf); border-radius: var(--r-md);
  box-shadow: var(--sh-sm); overflow: hidden;
}
.h-card {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 15px 17px;
  border-bottom: 1px solid var(--bdr);
  cursor: pointer; transition: background .15s;
}
.h-card:last-child { border-bottom: none; }
.h-card:hover { background: var(--surf2); }
.h-card-body { flex: 1; min-width: 0; }
.h-card-src {
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
}
.h-card-dot {
  width: 20px; height: 20px; border-radius: 5px; flex-shrink: 0;
  background: var(--cat-c, var(--acc)); color: #fff;
  font-size: 9px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.h-card-src-name { font-size: 11.5px; font-weight: 700; color: var(--txt2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-card-time { font-size: 11px; color: var(--txt3); margin-left: auto; flex-shrink: 0; }
.h-card-title {
  font-size: 14px; font-weight: 700; line-height: 1.38; color: var(--txt);
  word-break: break-word; overflow-wrap: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.h-card-cat {
  margin-top: 5px;
  font-size: 9px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase;
  color: var(--cat-c, var(--acc));
}
.h-card-thumb {
  width: 90px; height: 90px; flex-shrink: 0;
  border-radius: var(--r-sm); object-fit: cover; background: var(--surf3);
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  display: flex; flex-direction: column; gap: 16px;
  position: sticky;
  top: calc(var(--hdr-h) + var(--nav-h) + 22px);
}
.widget {
  background: var(--surf); border-radius: var(--r-md);
  box-shadow: var(--sh-sm); overflow: hidden;
}
.widget-head {
  font-size: 10.5px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase;
  color: var(--txt2); padding: 13px 16px;
  border-bottom: 1px solid var(--bdr);
  display: flex; align-items: center; gap: 7px;
}
.widget-head svg { width: 14px; height: 14px; fill: var(--acc); stroke: none; flex-shrink: 0; }

/* Trending items */
.widget-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--bdr);
  cursor: pointer; transition: background .15s;
}
.widget-item:last-child { border-bottom: none; }
.widget-item:hover { background: var(--surf2); }
.wi-num {
  font-size: 20px; font-weight: 900; letter-spacing: -.8px;
  line-height: 1; flex-shrink: 0; width: 24px; padding-top: 1px;
  font-style: italic;
}
.wi-num-1 { color: var(--acc); }
.wi-num-2 { color: #ea580c; }
.wi-num-3 { color: #ca8a04; }
.wi-num-4, .wi-num-5, .wi-num-6, .wi-num-7 { color: var(--txt4); font-size: 17px; }
.wi-body { flex: 1; min-width: 0; }
.wi-title {
  font-size: 12.5px; font-weight: 600; line-height: 1.38; color: var(--txt);
  word-break: break-word; overflow-wrap: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wi-meta { font-size: 10.5px; color: var(--txt3); margin-top: 3px; }
.wi-thumb { width: 50px; height: 50px; border-radius: 7px; object-fit: cover; flex-shrink: 0; background: var(--surf3); }

/* AI picks */
.ai-pick {
  padding: 12px 16px; border-bottom: 1px solid var(--bdr);
  cursor: pointer; transition: background .15s;
}
.ai-pick:last-child { border-bottom: none; }
.ai-pick:hover { background: var(--surf2); }
.ai-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff; padding: 2px 9px 2px 7px; border-radius: 99px;
  margin-bottom: 6px;
}
.ai-title {
  font-size: 12.5px; font-weight: 600; line-height: 1.38; color: var(--txt);
  word-break: break-word; overflow-wrap: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ai-meta { font-size: 10.5px; color: var(--txt3); margin-top: 3px; }

/* ── New stories pill ───────────────────────────────────────── */
.newpill {
  position: fixed;
  top: calc(var(--hdr-h) + var(--nav-h) + 14px);
  left: 50%; transform: translateX(-50%);
  z-index: 300;
  display: flex; align-items: center; gap: 7px;
  padding: 9px 20px; border-radius: 99px;
  background: var(--txt); color: var(--surf);
  font-size: 13px; font-weight: 700;
  box-shadow: var(--sh-lg);
  transition: background .18s;
}
.newpill:hover { background: var(--acc); }
.newpill svg { width: 16px; height: 16px; }
.newpill[hidden] { display: none; }

/* ── Pull-to-refresh indicator ──────────────────────────────── */
.ptr {
  position: fixed;
  top: calc(var(--hdr-h) + 4px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translate(-50%, 0);
  z-index: 320;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surf); box-shadow: var(--sh-lg);
  opacity: 0; pointer-events: none;
  transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .22s ease;
}
.ptr.show { opacity: 1; }
.ptr.dragging { transition: opacity .22s ease; }   /* follow the finger while pulling */
.ptr.ready { background: var(--acc); }
.ptr-spin {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid var(--bdr); border-top-color: var(--acc);
}
.ptr.ready .ptr-spin { border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; }
.ptr.refreshing .ptr-spin { animation: spin .8s linear infinite; }

/* ── Bottom nav (mobile) ────────────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: var(--surf); border-top: 1px solid var(--bdr);
  box-shadow: 0 -4px 20px rgba(0,0,0,.08);
  grid-template-columns: repeat(4, 1fr);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bnav-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 10px 4px;
  font-size: 10px; font-weight: 600; color: var(--txt3);
  transition: color .15s;
}
.bnav-btn svg { width: 22px; height: 22px; }
.bnav-btn.active { color: var(--acc); }

/* ── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 86px; left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: 500; padding: 10px 22px;
  background: rgba(15,23,42,.92); backdrop-filter: blur(8px);
  color: #fff; font-size: 13.5px; font-weight: 500;
  border-radius: 99px; pointer-events: none;
  opacity: 0; white-space: nowrap;
  transition: opacity .22s, transform .22s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Skeleton loaders ───────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -800px 0; }
  100% { background-position:  800px 0; }
}
.skel {
  background: linear-gradient(90deg, var(--surf3) 25%, var(--bdr) 50%, var(--surf3) 75%);
  background-size: 1000px 100%;
  animation: shimmer 1.6s infinite;
  border-radius: 6px;
}
.skel-card { background: var(--surf); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--sh-sm); }
.skel-img  { height: 178px; border-radius: 0; }
.skel-lg   { height: 18px; margin: 14px 14px 8px; }
.skel-md   { height: 13px; margin: 0 14px 8px; width: 80%; }
.skel-sm   { height: 11px; margin: 0 14px 14px; width: 45%; }

/* ── Fade-up animation ──────────────────────────────────────── */
.fade-up { opacity: 0; transform: translateY(16px); transition: opacity .42s ease, transform .42s ease; }
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ── Empty / error state ────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 70px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 13px;
}
.empty-icon { font-size: 2.8rem; }
.empty-state h3 { font-size: 1.1rem; font-weight: 800; color: var(--txt); }
.empty-state p { font-size: 14px; color: var(--txt3); max-width: 280px; line-height: 1.6; }
.retry-btn {
  margin-top: 6px; padding: 11px 28px; border-radius: 99px;
  background: var(--acc); color: #fff; font-size: 14px; font-weight: 700;
  transition: background .15s, transform .15s;
}
.retry-btn:hover { background: var(--acc-d); transform: translateY(-1px); }

/* ── Offline banner ─────────────────────────────────────────── */
.offline-top {
  text-align: center; padding: 9px 20px;
  background: #b45309; color: #fff;
  font-size: 12.5px; font-weight: 600;
}

/* ── Load spinner ───────────────────────────────────────────── */
.load-spinner { display: flex; justify-content: center; padding: 28px 0; }
.spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--bdr);
  border-top-color: var(--acc);
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Search overlay ─────────────────────────────────────────── */
.search-overlay {
  display: none; position: fixed; inset: 0; z-index: 150;
  padding-top: calc(var(--hdr-h) + var(--nav-h));
  background: rgba(9,14,28,.55); backdrop-filter: blur(4px);
}
.search-overlay.open { display: block; }
.search-overlay-inner {
  background: var(--surf);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  max-width: 760px; margin: 0 auto;
  padding: 18px 22px 22px;
  max-height: 76vh; overflow-y: auto;
  box-shadow: var(--sh-xl);
}
.search-label { font-size: 13px; font-weight: 600; color: var(--txt3); margin-bottom: 14px; }
.search-results-grid {
  display: flex; flex-direction: column;
  background: var(--surf); border-radius: var(--r);
  overflow: hidden; border: 1px solid var(--bdr);
}
.search-empty { text-align: center; padding: 32px; color: var(--txt3); font-size: 14px; }

/* ── Ad cards ───────────────────────────────────────────────── */
.ad-card { border: 1.5px dashed var(--bdr2); opacity: .92; }
.ad-chip-badge {
  position: absolute; top: 10px; left: 10px;
  font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  background: rgba(0,0,0,.6); color: #fff;
  padding: 3px 8px; border-radius: var(--r-xs);
}
.ad-banner-web {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 400;
  background: var(--surf); border-top: 1px solid var(--bdr);
  display: flex; align-items: center; gap: 10px; padding: 10px 18px;
  box-shadow: 0 -6px 20px rgba(0,0,0,.1);
}
.ad-tag { font-size: 9px; font-weight: 800; background: var(--bdr); padding: 2px 6px; border-radius: 3px; color: var(--txt3); flex-shrink: 0; }
.ad-thumb { width: 42px; height: 42px; border-radius: var(--r-sm); object-fit: cover; flex-shrink: 0; }
.ad-hl { flex: 1; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-close { width: 28px; height: 28px; border-radius: 50%; background: var(--surf2); display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--txt3); flex-shrink: 0; }

/* fullscreen ad */
.ad-full-web { position: fixed; inset: 0; z-index: 600; background: #000; display: flex; align-items: center; justify-content: center; }
.ad-full-media { max-width: 100%; max-height: 100%; width: 100%; object-fit: contain; }
.ad-full-tag-web { position: absolute; top: 16px; left: 16px; font-size: 9px; font-weight: 800; background: rgba(0,0,0,.6); color: #fff; padding: 3px 9px; border-radius: 4px; letter-spacing: .06em; text-transform: uppercase; }
.ad-full-mute-web { position: absolute; bottom: 110px; right: 18px; font-size: 22px; background: rgba(0,0,0,.5); padding: 6px 8px; border-radius: 50%; }
.ad-full-x-web { position: absolute; top: 14px; right: 14px; font-size: 13px; font-weight: 700; color: #fff; background: rgba(255,255,255,.2); padding: 7px 16px; border-radius: 99px; backdrop-filter: blur(6px); }
.ad-full-x-web:disabled { opacity: .5; cursor: not-allowed; }
.ad-full-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 28px 24px; background: linear-gradient(to top, rgba(0,0,0,.9), transparent); color: #fff; }
.ad-full-h { font-size: 1.3rem; font-weight: 800; margin-bottom: 7px; word-break: break-word; }
.ad-full-b { font-size: 13.5px; margin-bottom: 14px; opacity: .85; word-break: break-word; }
.ad-full-cta { display: inline-block; padding: 11px 24px; border-radius: 99px; background: var(--acc); color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; }

/* ── Modals ─────────────────────────────────────────────────── */
.modal-wrap {
  position: fixed; inset: 0; z-index: 700;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-back { position: absolute; inset: 0; background: rgba(0,0,0,.48); backdrop-filter: blur(2px); }
.modal-sheet {
  position: relative; width: 100%; max-width: 480px;
  background: var(--surf); border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 16px);
  box-shadow: var(--sh-xl); max-height: 82vh; overflow-y: auto;
}
.modal-grip { width: 36px; height: 4px; border-radius: 2px; background: var(--bdr2); margin: 13px auto 18px; }
.modal-title { font-size: 1.05rem; font-weight: 800; padding: 0 22px 12px; color: var(--txt); }
.modal-desc { font-size: 13.5px; color: var(--txt3); padding: 0 22px 16px; }
.menu-item {
  display: flex; align-items: center; gap: 15px;
  padding: 14px 22px; width: 100%;
  font-size: 14.5px; font-weight: 500; color: var(--txt);
  text-decoration: none; border-bottom: 1px solid var(--bdr);
  transition: background .15s;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: var(--surf2); }
.menu-item.cancel { color: var(--acc); font-weight: 700; }
.menu-item svg { width: 20px; height: 20px; color: var(--txt3); fill: none; flex-shrink: 0; }
.adcon-row { display: flex; align-items: center; gap: 15px; padding: 14px 22px; border-bottom: 1px solid var(--bdr); font-size: 14.5px; color: var(--txt); text-decoration: none; transition: background .15s; }
.adcon-row:hover { background: var(--surf2); }
.adcon-ico { font-size: 20px; }
.adcon-label { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--txt3); }
.modal-row { display: flex; align-items: center; gap: 8px; padding: 0 22px 14px; }
.modal-input { flex: 1; padding: 10px 14px; background: var(--surf2); border: 1.5px solid var(--bdr); border-radius: var(--r); font: inherit; font-size: 14px; color: var(--txt); outline: none; transition: border-color .2s, box-shadow .2s; }
.modal-input:focus { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-glow); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 0 22px; }
.modal-btn-ghost { padding: 9px 17px; border-radius: var(--r); font-size: 13.5px; font-weight: 600; color: var(--txt2); border: 1.5px solid var(--bdr); transition: all .15s; }
.modal-btn-ghost:hover { border-color: var(--bdr2); background: var(--surf2); }
.modal-btn-primary { padding: 9px 20px; border-radius: var(--r); font-size: 13.5px; font-weight: 700; background: var(--acc); color: #fff; transition: background .15s, transform .15s; }
.modal-btn-primary:hover { background: var(--acc-d); transform: translateY(-1px); }
.modal-btn-primary:disabled { opacity: .5; transform: none; cursor: not-allowed; }

/* ── Preview mode ───────────────────────────────────────────── */
.preview-mode .site-header,
.preview-mode .cat-nav,
.preview-mode .sidebar,
.preview-mode .bottom-nav,
.preview-mode .newpill,
.preview-mode .breaking-bar { display: none !important; }
.preview-mode .content-grid { grid-template-columns: 1fr; }
.preview-mode .site-main { padding: 0; }

/* ── Responsive: Tablet (hide sidebar) ─────────────────────── */
@media (max-width: 1100px) {
  .content-grid { grid-template-columns: minmax(0, 820px); justify-content: center; }
  .sidebar { display: none; }
}

/* ── Responsive: Small tablet ───────────────────────────────── */
@media (max-width: 900px) {
  .hero-editorial { grid-template-columns: 1fr; }
  .hero-side { display: none; }
  .hf-media { height: 300px; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .card-span2 .card-img-wrap { height: 200px; }
}

/* ── Responsive: Mobile ─────────────────────────────────────── */
@media (max-width: 640px) {
  :root { --hdr-h: 58px; --nav-h: 44px; }
  .site-main { padding: 14px 14px 90px; }
  .header-inner { padding: 0 14px; gap: 10px; }
  .cat-inner { padding: 0 14px; }
  .search-wrap { display: none; }
  .breaking-bar { margin-bottom: 16px; }
  .cards-grid { grid-template-columns: 1fr; }
  .card-span2 { grid-column: unset; }
  .card-span2 .card-img-wrap { height: 190px; }
  .hf-media { height: 260px; }
  .hf-title { font-size: 1.1rem; }
  .hf-readmore { display: none; }
  .bottom-nav { display: grid; }
  .toast { bottom: 72px; }
  .h-card-thumb { width: 76px; height: 76px; }
}

@media (max-width: 380px) {
  .logo-text { display: none; }
  .cat-tab { padding: 0 10px; font-size: 12px; }
}
