/* ===================================================================
   RTech News - core stylesheet
   Mobile-first. Most readers arrive on a phone, so every layout starts
   at the narrow width and widens through min-width queries only.
   =================================================================== */

/* ---------- tokens ---------- */
:root {
  --brand:        #c8102e;   /* masthead red */
  --brand-dark:   #9e0c24;
  --brand-tint:   #fdf2f4;

  --ink:          #14161a;
  --ink-2:        #3d434d;
  --ink-3:        #6b7280;
  --line:         #e4e7eb;
  --bg:           #ffffff;
  --bg-2:         #f7f8fa;
  --bg-3:         #eef0f4;

  --accent:       #0b6fd4;   /* links */
  --ok:           #15803d;
  --warn:         #b45309;
  --danger:       #b91c1c;

  --radius:       14px;
  --radius-sm:    9px;
  --shadow:       0 1px 2px rgba(16,24,40,.05), 0 4px 16px rgba(16,24,40,.06);
  --shadow-lg:    0 8px 32px rgba(16,24,40,.12);

  --font:         "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head:    "Playfair Display", Georgia, "Times New Roman", serif;
  --font-hi:      "Noto Sans Devanagari", var(--font);

  --header-h:     56px;
  --maxw:         1320px;
  /* Article text width. Mobile fills the screen; desktop opens up to a
     generous column (set in the article-layout query) rather than the narrow
     68ch this started at, which looked cramped on a large display. */
  --measure:      100%;
  --measure-wide: 860px;
  --sidebar-w:    324px;

  color-scheme: light dark;
}

/* Dark mode: system preference, unless the reader has forced light. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e8eaed; --ink-2: #b6bcc6; --ink-3: #8b929e;
    --line: #2a2f37; --bg: #101216; --bg-2: #171a20; --bg-3: #1f232b;
    --brand-tint: #2a1418; --accent: #6db3ff;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.5);
  }
}
/* ...and an explicit toggle overrides both. */
:root[data-theme="dark"] {
  --ink: #e8eaed; --ink-2: #b6bcc6; --ink-3: #8b929e;
  --line: #2a2f37; --bg: #101216; --bg-2: #171a20; --bg-3: #1f232b;
  --brand-tint: #2a1418; --accent: #6db3ff;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.5);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;   /* stop iOS inflating text in landscape */
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  font-family: var(--font);
  font-size: 16px;                  /* never below 16: iOS zooms on focus */
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;               /* no sideways scroll on phones */
  padding-bottom: env(safe-area-inset-bottom);
}
body[lang="hi"], .lang-hi { font-family: var(--font-hi); }

img, picture, video, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
ul, ol { padding-left: 1.15rem; }

/* Visible focus for keyboard users, suppressed for mouse clicks. */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.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: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--brand); color: #fff; padding: .7rem 1.1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 768px)  { .container { padding-inline: 24px; } }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-bar {
  height: var(--header-h);
  display: flex; align-items: center; gap: 12px;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-head); font-weight: 800; font-size: 1.22rem;
  color: var(--ink); text-decoration: none; letter-spacing: -.02em; flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff; display: grid; place-items: center;
  font-family: var(--font); font-weight: 800; font-size: .95rem;
}
.logo-accent { color: var(--brand); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.icon-btn {
  width: 40px; height: 40px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink-2);
  display: grid; place-items: center; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--bg-3); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }

.lang-switch { display: flex; background: var(--bg-3); border-radius: 9px; padding: 2px; }
.lang-switch a {
  padding: 5px 10px; border-radius: 7px; font-size: .8rem; font-weight: 600;
  color: var(--ink-3); text-decoration: none; line-height: 1.2;
}
.lang-switch a.is-active { background: var(--bg); color: var(--ink); box-shadow: var(--shadow); }
.lang-switch a:hover { text-decoration: none; color: var(--ink); }

/* Desktop nav is hidden on phones; the category rail below covers it. */
.main-nav { display: none; }
@media (min-width: 1024px) {
  .main-nav { display: flex; gap: 2px; margin-left: 14px; overflow: hidden; }
  .main-nav a {
    padding: 7px 11px; border-radius: 8px; font-size: .88rem; font-weight: 550;
    color: var(--ink-2); text-decoration: none; white-space: nowrap;
  }
  .main-nav a:hover { background: var(--bg-3); color: var(--ink); text-decoration: none; }
  .main-nav a.is-active { color: var(--brand); font-weight: 700; }
}

/* Category rail - horizontally scrollable, snapping, no visible scrollbar. */
.cat-rail {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px;
  border-bottom: 1px solid var(--line); background: var(--bg);
  scrollbar-width: none; -ms-overflow-style: none;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.cat-rail::-webkit-scrollbar { display: none; }
.cat-rail a {
  flex: 0 0 auto; scroll-snap-align: start;
  padding: 7px 14px; border-radius: 999px; background: var(--bg-3);
  font-size: .85rem; font-weight: 600; color: var(--ink-2); text-decoration: none;
}
.cat-rail a:hover { text-decoration: none; }
.cat-rail a.is-active { background: var(--brand); color: #fff; }
@media (min-width: 1024px) { .cat-rail { display: none; } }

/* ---------- breaking ticker ---------- */
.ticker { background: var(--brand); color: #fff; overflow: hidden; }
.ticker-inner { display: flex; align-items: center; gap: 10px; height: 38px; }
.ticker-tag {
  flex-shrink: 0; font-size: .7rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; background: rgba(0,0,0,.22);
  padding: 4px 9px; border-radius: 5px;
}
.ticker-track { flex: 1; overflow: hidden; white-space: nowrap; }
.ticker-move { display: inline-block; padding-left: 100%; animation: ticker 42s linear infinite; }
.ticker-move a { color: #fff; font-size: .85rem; margin-right: 2.6rem; }
.ticker:hover .ticker-move { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-100%); } }

/* ---------- section heads ---------- */
.section { padding: 26px 0; }
.section-head {
  display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px;
  padding-bottom: 9px; border-bottom: 2px solid var(--ink);
}
.section-title {
  font-family: var(--font-head); font-size: clamp(1.2rem, 4.4vw, 1.6rem);
  font-weight: 800; letter-spacing: -.02em;
}
.section-more { margin-left: auto; font-size: .84rem; font-weight: 600; white-space: nowrap; }

/* ---------- cards ---------- */
.card { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.card-media {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--bg-3); aspect-ratio: 16 / 9;
}
.card-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .45s cubic-bezier(.2,.7,.3,1);
}
.card:hover .card-media img { transform: scale(1.045); }
.card-title {
  font-family: var(--font-head); font-weight: 700; letter-spacing: -.015em;
  font-size: 1.02rem; line-height: 1.32; color: var(--ink);
}
.card a.card-link { color: inherit; text-decoration: none; }
.card a.card-link:hover .card-title { color: var(--brand); }
.card-excerpt {
  font-size: .9rem; color: var(--ink-2); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: .76rem; color: var(--ink-3);
}
.chip {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  background: var(--brand-tint); color: var(--brand);
  font-size: .7rem; font-weight: 750; text-transform: uppercase; letter-spacing: .045em;
}
.chip:hover { text-decoration: none; }

/* Lead story: stacked on mobile, side-by-side from tablet up. */
.lead { display: grid; gap: 14px; margin-bottom: 26px; }
@media (min-width: 768px) {
  .lead { grid-template-columns: 1.35fr 1fr; gap: 24px; align-items: center; }
}
.lead .card-title { font-size: clamp(1.45rem, 5.6vw, 2.5rem); line-height: 1.16; }
.lead .card-excerpt { font-size: 1rem; -webkit-line-clamp: 4; }
.lead .card-media { aspect-ratio: 16 / 10; }

.grid { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 560px)  { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px)  { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1140px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }

/* Compact horizontal rows for "more stories" lists. */
.row-list { display: flex; flex-direction: column; }
.row {
  display: grid; grid-template-columns: 96px 1fr; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start;
}
.row:last-child { border-bottom: 0; }
.row-media { border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 1; background: var(--bg-3); }
.row-media img { width: 100%; height: 100%; object-fit: cover; }
.row-title { font-weight: 650; font-size: .95rem; line-height: 1.35; color: var(--ink); }
.row a { color: inherit; text-decoration: none; }
.row a:hover .row-title { color: var(--brand); }
@media (min-width: 768px) { .row { grid-template-columns: 120px 1fr; } }

/* ---------- article ----------
   One column on a phone. From 1080px the article splits into a wide main
   column and a sticky sidebar, which both gives the copy the width it was
   missing and creates the space the ad units need. */
.article-wrap { padding: 20px 0 40px; }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }

/* Tablet and small laptop: no sidebar yet, so centre the copy on a readable
   measure instead of letting it stretch the full container. */
@media (min-width: 700px) and (max-width: 1079px) {
  .article-main > *,
  .article-main .article-header,
  .article-main .article-body,
  .article-main .ai-summary,
  .article-main .faq,
  .article-main .sources,
  .article-main .share,
  .article-main .disclosure { max-width: 720px; margin-inline: auto; }
}

/* Single-column pages with no sidebar (about, policy) keep a reading measure
   at every width. */
.page-narrow .article-title,
.page-narrow .article-body { max-width: 760px; margin-inline: auto; }

@media (min-width: 1080px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
    gap: 44px;
    align-items: start;
  }
  /* Inside the grid the shared blocks stop centring on a narrow measure and
     take the full column width. */
  .article-main .article-header,
  .article-main .article-body,
  .article-main .ai-summary,
  .article-main .faq,
  .article-main .sources,
  .article-main .share,
  .article-main .disclosure,
  .article-main .article-figure { max-width: var(--measure-wide); margin-inline: 0; }

  /* Larger type keeps the line length readable as the column widens. */
  .article-main .article-body { font-size: 1.13rem; line-height: 1.78; }
}

.article-aside { display: none; }
@media (min-width: 1080px) {
  .article-aside { display: block; position: sticky; top: calc(var(--header-h) + 18px); }
}
.aside-block { margin-bottom: 22px; }
.aside-title {
  font-size: .73rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .09em; color: var(--ink-3);
  padding-bottom: 8px; margin-bottom: 11px; border-bottom: 2px solid var(--ink);
}
.breadcrumb { font-size: .8rem; color: var(--ink-3); margin-bottom: 14px; }
.breadcrumb ol { list-style: none; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.breadcrumb li:not(:last-child)::after { content: "/"; margin-left: 6px; color: var(--line); }

.article-header { max-width: var(--measure); margin-inline: auto; }
.article-title {
  font-family: var(--font-head); font-weight: 800; letter-spacing: -.025em;
  font-size: clamp(1.65rem, 6.4vw, 2.85rem); line-height: 1.14;
  margin: 10px 0 12px;
}
.article-standfirst { font-size: clamp(1rem, 3.6vw, 1.16rem); color: var(--ink-2); line-height: 1.55; margin-bottom: 16px; }
.article-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: .82rem; color: var(--ink-3);
  padding: 12px 0; border-block: 1px solid var(--line); margin-bottom: 18px;
}
.article-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); }

.article-figure { margin: 0 0 20px; }
.article-figure img { width: 100%; border-radius: var(--radius); background: var(--bg-3); }
.article-figure figcaption { font-size: .78rem; color: var(--ink-3); padding-top: 8px; }

/* AI summary - deliberately the most prominent block on the page. It is what
   a hurried reader reads and what an AI assistant is most likely to quote. */
.ai-summary {
  max-width: var(--measure); margin: 0 auto 26px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius); padding: 16px 18px;
}
.ai-summary-heading {
  font-family: var(--font); font-size: .74rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .09em; color: var(--brand);
  margin-bottom: 9px; display: flex; align-items: center; gap: 7px;
}
.ai-summary-body p { font-size: 1rem; line-height: 1.62; color: var(--ink); }
.ai-summary-label {
  font-size: .72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .07em; color: var(--ink-3); margin: 13px 0 6px;
}
.ai-summary-body ul { margin: 0; padding-left: 1.15rem; }
.ai-summary-body li { font-size: .92rem; line-height: 1.5; margin-bottom: 5px; color: var(--ink-2); }

.article-body { max-width: var(--measure); margin-inline: auto; font-size: 1.07rem; line-height: 1.75; }
.article-body > * + * { margin-top: 1.1em; }
.article-body p { color: var(--ink); }
.article-body h2 {
  font-family: var(--font-head); font-size: clamp(1.25rem, 4.6vw, 1.62rem);
  font-weight: 800; line-height: 1.24; letter-spacing: -.02em; margin-top: 1.9em;
}
.article-body h3 { font-size: clamp(1.08rem, 3.9vw, 1.26rem); font-weight: 750; margin-top: 1.6em; }
.article-body ul, .article-body ol { padding-left: 1.35rem; }
.article-body li + li { margin-top: .45em; }
.article-body strong { font-weight: 680; }
.article-body blockquote {
  border-left: 3px solid var(--brand); padding: 4px 0 4px 16px;
  font-family: var(--font-head); font-size: 1.14rem; font-style: italic; color: var(--ink-2);
}
.article-body a { text-decoration: underline; text-underline-offset: 2px; }
.article-body img { border-radius: var(--radius); margin-block: 1.4em; }

/* FAQ - native <details>, so it works with zero JavaScript. */
.faq { max-width: var(--measure); margin: 32px auto 0; }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 9px; background: var(--bg-2); }
.faq-item summary {
  padding: 13px 15px; font-weight: 650; font-size: .97rem; cursor: pointer;
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.3rem; color: var(--brand); font-weight: 400; line-height: 1; }
.faq-item[open] summary::after { content: "\2013"; }
.faq-item .faq-a { padding: 0 15px 14px; font-size: .95rem; line-height: 1.62; color: var(--ink-2); }

/* Sources - shown, not hidden. The site synthesises other outlets' reporting,
   so the provenance belongs on the page. */
.sources { max-width: var(--measure); margin: 30px auto 0; padding-top: 18px; border-top: 1px solid var(--line); }
.sources h2 { font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-3); margin-bottom: 10px; }
.sources ol { padding-left: 1.2rem; }
.sources li { font-size: .88rem; margin-bottom: 6px; color: var(--ink-2); }
.sources .src-name { color: var(--ink-3); font-size: .8rem; }

.share { display: flex; gap: 8px; flex-wrap: wrap; max-width: var(--measure); margin: 26px auto 0; }
.share a, .share button {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink-2); font-size: .85rem; font-weight: 600;
  text-decoration: none;
}
.share a:hover, .share button:hover { background: var(--bg-3); color: var(--ink); text-decoration: none; }
.share svg { width: 16px; height: 16px; }

.disclosure {
  max-width: var(--measure); margin: 26px auto 0; padding: 13px 15px;
  background: var(--bg-2); border-radius: var(--radius-sm);
  font-size: .81rem; color: var(--ink-3); line-height: 1.55;
}

/* ---------- advertising ----------
   Each slot reserves the exact height the unit will occupy, so switching real
   ads on causes no reflow and no Cumulative Layout Shift penalty. The label is
   required: ad units must be distinguishable from editorial content. */
.ad-slot { margin: 22px auto; text-align: center; }
.ad-label {
  display: block; font-size: .62rem; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 5px;
}
.ad-box {
  display: grid; place-items: center; margin-inline: auto;
  background: var(--bg-2); border: 1px dashed var(--line); border-radius: var(--radius-sm);
  color: var(--ink-3); font-size: .78rem; font-variant-numeric: tabular-nums;
  overflow: hidden;
}
.ad-slot ins.adsbygoogle { display: block; margin-inline: auto; }

/* Leaderboard: a phone banner that becomes a full leaderboard on desktop. */
.ad-leaderboard .ad-box { width: 100%; max-width: 320px; height: 100px; }
@media (min-width: 768px)  { .ad-leaderboard .ad-box { max-width: 728px; height: 90px; } }
@media (min-width: 1200px) { .ad-leaderboard .ad-box { max-width: 970px; height: 90px; } }

/* In-article: responsive rectangle, always inside the reading column. */
.ad-inarticle { margin: 30px auto; max-width: var(--measure-wide); }
.ad-inarticle .ad-box { width: 100%; max-width: 336px; height: 280px; }
@media (min-width: 768px) { .ad-inarticle .ad-box { max-width: 580px; height: 250px; } }

/* Sidebar units. */
.ad-rectangle .ad-box { width: 300px; height: 250px; }
.ad-vertical  .ad-box { width: 300px; height: 600px; }

/* Footer banner. */
.ad-footer { margin: 26px auto 0; }
.ad-footer .ad-box { width: 100%; max-width: 320px; height: 100px; }
@media (min-width: 768px) { .ad-footer .ad-box { max-width: 728px; height: 90px; } }

/* The top leaderboard sits between header and content on every page. */
.ad-strip { background: var(--bg-2); border-bottom: 1px solid var(--line); }
.ad-strip .ad-slot { margin: 12px auto; }

/* Ads inside a card grid occupy one cell and stay the height of a card. */
.ad-incard { grid-column: 1 / -1; }

@media print { .ad-slot, .ad-strip { display: none !important; } }

/* ---------- footer ---------- */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--line); margin-top: 40px; padding: 32px 0 84px; }
@media (min-width: 1024px) { .site-footer { padding-bottom: 32px; } }
.footer-grid { display: grid; gap: 26px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-col h3 { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-3); margin-bottom: 11px; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: 7px; }
.footer-col a { font-size: .88rem; color: var(--ink-2); }
.footer-about { font-size: .88rem; color: var(--ink-2); line-height: 1.6; max-width: 42ch; }
.footer-bottom {
  margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line);
  font-size: .8rem; color: var(--ink-3);
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between;
}

/* ---------- mobile bottom nav ----------
   Phone readers navigate with their thumb; a bottom bar is reachable where a
   top nav is not. Hidden from 1024px where the header nav takes over. */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 99;
  display: flex; background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 2px; font-size: .66rem; font-weight: 600;
  color: var(--ink-3); text-decoration: none;
}
.bottom-nav a.is-active { color: var(--brand); }
.bottom-nav svg { width: 21px; height: 21px; }
@media (min-width: 1024px) { .bottom-nav { display: none; } }

/* ---------- search ---------- */
.search-panel {
  position: fixed; inset: 0; z-index: 150; background: var(--bg);
  display: none; flex-direction: column; padding: 16px;
}
.search-panel.is-open { display: flex; }
.search-top { display: flex; gap: 10px; align-items: center; }
.search-input {
  flex: 1; font-size: 1rem; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--bg-2); color: var(--ink);
}
.search-results { margin-top: 18px; overflow-y: auto; }
.search-empty { color: var(--ink-3); font-size: .9rem; padding: 20px 0; }

/* ---------- chat widget ---------- */
.chat-fab {
  position: fixed; right: 16px; bottom: 74px; z-index: 98;
  width: 52px; height: 52px; border-radius: 50%; border: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff; box-shadow: var(--shadow-lg); display: grid; place-items: center;
}
@media (min-width: 1024px) { .chat-fab { bottom: 22px; } }
.chat-fab svg { width: 24px; height: 24px; }

.chat-panel {
  position: fixed; z-index: 151; background: var(--bg);
  display: none; flex-direction: column;
  inset: 0;                                   /* full screen on phones */
}
.chat-panel.is-open { display: flex; }
@media (min-width: 640px) {
  .chat-panel {
    inset: auto 16px 16px auto; width: 382px; height: min(620px, 82vh);
    border-radius: var(--radius); border: 1px solid var(--line);
    box-shadow: var(--shadow-lg); overflow: hidden;
  }
}
.chat-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 15px;
  border-bottom: 1px solid var(--line); background: var(--bg-2);
}
.chat-head strong { font-size: .95rem; }
.chat-head .chat-sub { font-size: .74rem; color: var(--ink-3); }
.chat-log { flex: 1; overflow-y: auto; padding: 15px; display: flex; flex-direction: column; gap: 11px; }
.msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: .92rem; line-height: 1.55; }
.msg-user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg-bot { align-self: flex-start; background: var(--bg-3); color: var(--ink); border-bottom-left-radius: 4px; }
.msg-bot a { text-decoration: underline; }
.chat-form { display: flex; gap: 8px; padding: 11px; border-top: 1px solid var(--line); }
.chat-form input {
  flex: 1; font-size: 1rem; padding: 10px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--ink);
}
.chat-form button {
  width: 42px; height: 42px; border-radius: 50%; border: 0;
  background: var(--brand); color: #fff; display: grid; place-items: center; flex-shrink: 0;
}
.chat-form button:disabled { opacity: .5; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: blink 1.3s infinite; }
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%,60%,100% { opacity: .28; } 30% { opacity: 1; } }

/* ---------- utility ---------- */
.empty-state { text-align: center; padding: 50px 16px; color: var(--ink-3); }
.empty-state h2 { font-family: var(--font-head); font-size: 1.3rem; color: var(--ink); margin-bottom: 8px; }
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 30px; }
.pagination a, .pagination span {
  padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  font-size: .88rem; font-weight: 600; color: var(--ink-2); text-decoration: none;
}
.pagination .is-current { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Print: drop the furniture, keep the story. */
@media print {
  .site-header, .cat-rail, .ticker, .bottom-nav, .chat-fab, .share, .site-footer { display: none !important; }
  body { font-size: 11pt; }
  .article-body { max-width: none; }
  a::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
}
