:root {
  --bg: #f3f4f6;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --card: #ffffff;
  --accent: #e11d2e;
  --on-accent: #ffffff;
  --header: #1a1a1a;
  --header-ink: #ffffff;
  --soft: #fff1f2;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Nirmala UI", "Noto Sans Devanagari", "Mangal", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  padding-bottom: calc(68px + env(safe-area-inset-bottom));
  -webkit-user-select: none;
  user-select: none;
}
body.nm-nocopy,
body.nm-nocopy *:not(input):not(textarea):not(select):not([contenteditable="true"]) {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none;
}
input, textarea, select, [contenteditable="true"] {
  -webkit-user-select: text !important;
  user-select: text !important;
  font-family: inherit;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3 { font-weight: 700; }

.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header);
  color: var(--header-ink);
}
.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
}
.header-left, .header-actions { display: flex; align-items: center; gap: 8px; min-width: 0; }
.logo { display: flex; align-items: center; min-width: 0; font-weight: 800; font-size: 20px; letter-spacing: 0.01em; color: var(--header-ink); }
.logo-text { line-height: 1; }
.logo img {
  height: 40px;
  width: auto;
  max-width: 210px;
  object-fit: contain;
  object-position: left center;
  background: #fff;
  border-radius: 10px;
  padding: 4px 10px;
}
.hamburger, .icon-btn, .city-btn {
  border: 0;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
}
.hamburger {
  flex-direction: column;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,.14);
  border-radius: 12px;
}
.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0;
  background: #fff;
  border-radius: 2px;
}
.city-btn { border: 1px solid rgba(255,255,255,.28); border-radius: 999px; padding: 0 10px; font-size: 13px; font-weight: 600; }
.icon-btn { border-radius: 999px; }

.nav { display: none; background: #fff; border-bottom: 1px solid var(--border); }
.nav-inner { max-width: 1180px; margin: 0 auto; display: flex; gap: 2px; overflow-x: auto; padding: 0 8px; scrollbar-width: none; }
.nav-inner::-webkit-scrollbar { display: none; }
.nav a { flex: none; padding: 12px 10px; font-size: 14px; font-weight: 600; color: #374151; white-space: nowrap; }
.nav a.active, .nav a:hover { color: var(--accent); }

.layout { max-width: 1180px; margin: 0 auto; padding: 12px; }
.home, .cat-page, .search-page, .author-page, .static-page, article { min-width: 0; }

.home-chips, .pills, .mnav-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.home-chips::-webkit-scrollbar, .pills::-webkit-scrollbar { display: none; }
.home-chips a, .pills a, .mnav-chips a {
  flex: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
}
.home-chips a:hover, .pills a:hover { border-color: var(--accent); color: var(--accent); }

.breaking {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  background: var(--soft);
  border-radius: 12px;
  padding: 8px;
}
.breaking-tag {
  flex: none;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  padding: 4px 8px;
}
.breaking-track { display: flex; gap: 16px; overflow-x: auto; scrollbar-width: none; }
.breaking-track::-webkit-scrollbar { display: none; }
.breaking-track a { flex: none; font-weight: 700; font-size: 14px; }

.hero { display: grid; gap: 14px; }
.hero-lead {
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  color: var(--text);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}
.hero-photo {
  display: block;
  width: 100%;
  background: #f3f4f6;
}
.hero-photo img, .hero-ph {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
}
.hero-copy { display: block; padding: 14px 16px 18px; }
.hero-copy h2 {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 22px;
  line-height: 1.4;
}
.hero-side {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}
.hero-side .list-item {
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid var(--border);
}
.hero-side .list-item:last-child { border-bottom: 0; }
.hero-side .list-item:hover { transform: none; }
.card-kicker { display: inline-block; color: var(--accent); font-size: 12px; font-weight: 800; }
.card-kicker--on { color: #fff; background: var(--accent); border-radius: 999px; padding: 2px 8px; }

.list-item, .card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 10px;
  align-items: center;
  background: var(--card);
  border: 0;
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px rgba(15, 23, 42, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover, .list-item:hover, .cat-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.1);
}
.list-item + .list-item { margin-top: 8px; }
.hero-side .list-item,
.hero-side .list-item + .list-item { margin-top: 0; }
.hero-side .list-item h3 {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  font-size: 14px;
  line-height: 1.45;
}
.hero-side .fit--sm {
  width: 120px;
  height: 90px;
  background: #f3f4f6;
}
.hero-side .fit--sm img {
  object-fit: contain;
  object-position: center;
  transform: none;
}
.list-item h3, .card h3 {
  margin: 2px 0;
  font-size: 15px;
  line-height: 1.45;
}
.card h3, .cat-tile h3 {
  display: block;
  overflow: visible;
}
.card, .cat-tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}
.fit {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f3f4f6;
  flex: none;
}
.fit img,
.fit .ph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center top;
  border-radius: 0;
}
.card .fit,
.cat-tile .fit,
.topic-feature .fit {
  aspect-ratio: auto;
  height: auto;
  overflow: hidden;
}
.card .fit img,
.cat-tile .fit img,
.topic-feature .fit img,
.card .fit .ph,
.cat-tile .fit .ph,
.topic-feature .fit .ph {
  position: static;
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
}
.list-item { grid-template-columns: 128px minmax(0, 1fr); }
.fit--sm { width: 128px; height: 96px; aspect-ratio: auto; border-radius: 10px; }
.list-copy { grid-column: 2; grid-row: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.card-body, .cat-tile-text { padding: 12px 14px 14px; min-width: 0; }
.news-date { color: var(--muted); font-size: 12px; }
.ph { background: #e5e7eb; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 28px 0 12px; }
.section-head h2, .cat-h1, .h1 { margin: 0; font-size: 22px; line-height: 1.3; }
.section-head h1,
.section-head h2 { display: flex; align-items: center; gap: 8px; font-size: 22px; }
.section-head h1::before,
.section-head h2::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 4px;
  background: var(--accent);
}
.more { color: var(--accent); font-weight: 700; font-size: 14px; white-space: nowrap; }
.cards, .cat-tiles { display: flex; flex-direction: column; gap: 10px; }
.topic-empty { color: var(--muted); }

.trend-news-row, .shorts-rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 6px;
}
.trend-news-row::-webkit-scrollbar, .shorts-rail::-webkit-scrollbar { display: none; }
.trend-news-row .card {
  flex: 0 0 78%;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}
.trend-news-row .card-body { padding: 10px 12px 12px; }

.shorts-thumb { display: block; width: 118px; aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: #111; scroll-snap-align: start; }
.shorts-card { flex: none; scroll-snap-align: start; }
.shorts-thumb img { width: 100%; height: 100%; object-fit: cover; }

.topic-feature { display: block; margin-bottom: 10px; }
.topic-feature .fit { border-radius: 16px; }
.topic-feature h3 { margin: 8px 0 0; font-size: 18px; line-height: 1.35; }
.pills { margin: 8px 0 12px; }

.cat-tile {
  background: #fff;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px rgba(15, 23, 42, 0.06);
}
.cat-tile h3 { margin: 2px 0; font-size: 15px; line-height: 1.4; }
.cat-intro, .static-page-lead, .summary {
  color: #374151;
  background: var(--soft);
  border-radius: 12px;
  padding: 12px 14px;
}
.pager { display: flex; gap: 8px; margin-top: 16px; }
.pager a { background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 8px 14px; font-weight: 700; }

.search-form { display: flex; gap: 8px; margin: 12px 0 16px; }
.search-form input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
}
.search-form button {
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0 16px;
  font-weight: 800;
}

.article-kicker, .meta-row, .byline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.byline-link { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.article-kicker { justify-content: space-between; margin-bottom: 6px; }
.crumb a { color: var(--accent); font-weight: 700; }
.news-title { font-size: 26px; margin: 8px 0 12px; }
.meta-row { justify-content: space-between; margin-bottom: 12px; }
.byline-avatar, .byline-avatar img, .author-box img {
  width: 44px; height: 44px; border-radius: 999px; object-fit: cover; background: var(--soft);
}
.byline-avatar-fallback {
  width: 44px; height: 44px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--on-accent); font-weight: 800;
}
.byline-author, .byline-desk { margin: 0; }
.byline-desk, .author-kicker { color: var(--muted); font-size: 13px; }
.share-actions { display: flex; gap: 8px; }
.share-btn {
  width: 36px; height: 36px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
.share-btn--fb { background: #1877f2; }
.share-btn--x { background: #111; }
.share-btn--wa { background: #25d366; }
.article-lead { margin: 12px 0; }
.article-lead img { width: 100%; border-radius: 16px; height: auto; max-height: none; object-fit: contain; background: #f3f4f6; }
.caption { color: var(--muted); font-size: 13px; margin-top: 6px; }
.body { font-size: 17.5px; line-height: 1.75; }
.body p { margin: 0 0 0.9em; }
.body img { border-radius: 12px; margin: 12px auto; }
.body div { margin-bottom: 0.75em; }
.story-end { margin: 16px 0; }
.story-views {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--soft); border-radius: 999px; padding: 8px 12px; font-weight: 700;
}
.related h2 { font-size: 20px; margin: 18px 0 8px; }
.related-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 84px;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.related-item h3 { margin: 0; font-size: 15px; line-height: 1.4; }
.related-item img { width: 84px; height: 64px; object-fit: cover; border-radius: 8px; }
.num { color: var(--accent); font-weight: 800; }
.author-box {
  display: flex; gap: 12px; align-items: center;
  margin-top: 18px; padding: 14px; border-radius: 16px; background: var(--soft);
}
.author-box h3 { margin: 0 0 4px; }
.author-box a { color: var(--accent); font-weight: 700; }

.rail { display: none; }
.cat-rail {
  background: #fff;
  border-radius: 18px;
  padding: 16px 14px 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  max-height: calc(100vh - 140px);
  overflow: auto;
}
.cat-rail h3 {
  margin: 0 0 8px;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cat-rail h3::before {
  content: "";
  width: 4px;
  height: 16px;
  border-radius: 4px;
  background: var(--accent);
}
.cat-rail-list { list-style: none; margin: 0; padding: 0; }
.cat-rail-item + .cat-rail-item { border-top: 1px solid var(--border); }
.cat-rail-parent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 2px;
  font-weight: 800;
  font-size: 14px;
}
.cat-rail-parent:hover,
.cat-rail-parent.is-on { color: var(--accent); }
.cat-rail-go { color: var(--muted); font-size: 18px; line-height: 1; }
.cat-rail-subs { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 12px; }
.cat-rail-subs a {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}
.cat-rail-subs a:hover,
.cat-rail-subs a.is-on { background: var(--accent); color: var(--on-accent); }

.footer { background: var(--header); color: var(--header-ink); text-align: center; padding: 28px 16px 20px; margin-top: 18px; }
.footer-logo { height: 48px; width: auto; max-width: 240px; object-fit: contain; margin: 0 auto 14px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; }
.footer-links a { font-size: 14px; }
.footer-socials { display: flex; justify-content: center; gap: 10px; margin: 16px 0; }
.footer-social {
  width: 36px; height: 36px; border-radius: 999px; background: rgba(255,255,255,.14);
  display: inline-flex; align-items: center; justify-content: center;
}
.copy { font-size: 13px; opacity: .8; margin: 0; }

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a, .tabbar button {
  flex: 1;
  border: 0;
  background: transparent;
  color: #6b7280;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 56px;
  font-size: 11px;
  font-weight: 700;
}
.tabbar .is-on { color: var(--accent); }

.mnav-backdrop, .modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 70; }
.mnav {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: min(340px, 90vw);
  background: #fff;
  z-index: 80;
  overflow: auto;
  padding: 14px;
}
.mnav-head, .modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mnav-brand img { height: 36px; }
.mnav-close, .modal-close { border: 0; background: var(--soft); width: 32px; height: 32px; border-radius: 999px; }
.mnav-city, .mnav-install, .mnav-links a {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--border); width: 100%;
  background: transparent; border-left: 0; border-right: 0; border-top: 0; text-align: left; font-size: 16px;
}
.mnav-city small, .mnav-install small { display: block; color: var(--muted); font-size: 12px; }
.mnav-chev { margin-left: auto; color: var(--muted); }
.mnav-label { margin: 16px 0 8px; font-size: 12px; font-weight: 800; color: var(--muted); }
.modal { display: flex; align-items: flex-end; justify-content: center; }
.modal-box { background: #fff; width: min(640px, 100%); max-height: 86vh; border-radius: 18px 18px 0 0; display: flex; flex-direction: column; }
.modal-head, .modal-tools { padding: 14px 14px 0; }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-search { width: 100%; border: 1px solid var(--border); border-radius: 12px; padding: 12px; font-size: 16px; margin: 10px 0; }
.modal-body { overflow: auto; padding: 0 14px 18px; }
.city-letter { font-weight: 800; color: var(--accent); margin-top: 14px; font-size: 14px; }
.city-letter a:hover { text-decoration: underline; }
.city-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.city-grid a { background: var(--soft); border-radius: 999px; padding: 6px 10px; font-size: 14px; }

.trend-float {
  position: fixed;
  right: 10px;
  bottom: calc(74px + env(safe-area-inset-bottom));
  z-index: 60;
  width: 132px;
  background: #0f172a;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(15, 23, 42, .35);
}
.trend-float-bar { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 8px; color: #fff; }
.trend-float-bar strong { flex: 1; font-size: 11px; white-space: nowrap; }
.trend-live { width: 7px; height: 7px; border-radius: 999px; background: #fb7185; box-shadow: 0 0 0 3px rgba(251,113,133,.25); }
.trend-float-x, .trend-float-next {
  width: 22px; height: 22px; border: 0; border-radius: 999px;
  background: rgba(255,255,255,.16); color: #fff; padding: 0; line-height: 1;
}
.trend-frame { container-type: inline-size; position: relative; aspect-ratio: 9 / 16; overflow: hidden; background: #000; }
.trend-frame iframe {
  position: absolute; top: 0; left: 0; width: 267px; height: 476px; border: 0;
  transform-origin: top left; transform: scale(calc(100cqw / 267px)); pointer-events: none;
}
.trend-frame.is-on iframe { pointer-events: auto; }
.trend-tap { position: absolute; inset: 0; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; }
.trend-tap span {
  width: 36px; height: 36px; border-radius: 999px; background: rgba(255,255,255,.94);
  display: flex; align-items: center; justify-content: center;
}
.trend-frame.is-on .trend-tap { display: none; }

.db-error { background: #fef2f2; border: 1px solid #fecaca; border-radius: 12px; padding: 16px; }
.db-error pre { white-space: pre-wrap; font-size: 13px; }

@media (max-width: 699px) {
  .logo img { height: 34px; max-width: 148px; padding: 3px 8px; }
  .header-inner { min-height: 58px; padding: 8px 10px; }
  .header-actions { gap: 2px; }
}
@media (max-width: 420px) {
  .city-btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

@media (min-width: 800px) {
  .news-title { font-size: 34px; }
  .hero { grid-template-columns: 1.4fr .95fr; align-items: stretch; }
  .hero-copy h2 { font-size: 24px; }
  .cards--home, .cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .trend-news-row .card { flex-basis: 260px; }
  .topic-split { display: grid; grid-template-columns: 1.3fr .9fr; gap: 16px; }
  .modal { align-items: center; }
  .modal-box { border-radius: 18px; max-height: 80vh; }
}

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .tabbar, .home-chips { display: none; }
  .hamburger { display: none; }
  .nav { display: block; position: sticky; top: 64px; z-index: 30; }
  .trend-float { width: 168px; right: 20px; bottom: 20px; }
}

@media (min-width: 1024px) {
  .layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 22px; align-items: start; }
  .rail { display: block; position: sticky; top: 120px; }
  .cards--home, .cat-tiles { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}
