:root {
  --bg: #f5f4ef;
  --paper: #ffffff;
  --ink: #101318;
  --muted: #5b6570;
  --line: #d9dee6;
  --accent: #cb1f28;
  --accent-soft: #fde9ea;
  --chip: #edf1f7;
  --deep: #0e1624;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Noto Sans Devanagari", sans-serif;
}

.container {
  width: min(1320px, calc(100% - 24px));
  margin: 0 auto;
}

.top-strip {
  background: var(--deep);
  color: #e7edf8;
}

.top-strip-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 13px;
}

.top-strip-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff3d4d;
  box-shadow: 0 0 0 4px rgba(255, 61, 77, 0.2);
}

.pipe {
  opacity: 0.5;
}

.market-strip {
  background: #0d1320;
  border-bottom: 1px solid #1f2b42;
}

.market-strip-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
}

.market-label {
  color: #9bd8ff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.market-ticker {
  display: inline-flex;
  gap: 12px;
  overflow: hidden;
  white-space: nowrap;
}

.market-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #24334f;
  border-radius: 999px;
  padding: 6px 10px;
  color: #e9f1ff;
  background: #121d2e;
  font-size: 12px;
}

.market-chip strong {
  color: #cae6ff;
}

.market-chip.up {
  color: #3ad486;
}

.market-chip.down {
  color: #ff7171;
}

.market-updated {
  color: #89a0bf;
  font-size: 12px;
}

.brand-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 3000;
}

.brand-header-inner {
  padding: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--line);
}

.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-text {
  font-family: "Merriweather", "Noto Sans Devanagari", serif;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 900;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.epaper-btn {
  text-decoration: none;
  border: 1px solid #f0bdbe;
  background: #fff5f5;
  color: #a0141b;
  border-radius: 999px;
  font-size: 12px;
  padding: 10px 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.search-wrap {
  display: flex;
  align-items: center;
  background: #f6f8fb;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  min-width: min(560px, 60vw);
}

.search-wrap input {
  border: 0;
  outline: 0;
  width: 100%;
  background: transparent;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--ink);
}

.search-wrap button {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 12px 14px;
  color: #616b76;
  font-weight: 700;
}

.menu-toggle {
  border: 1px solid #d4dbe7;
  background: #ffffff;
  color: #162033;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  display: none;
}

.category-nav {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.fixed-nav {
  border-bottom: 0;
}

.category-nav-inner {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 0;
}

.single-line-nav {
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  overflow: visible;
}

.category-main-line {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  flex: 1 1 auto;
  min-width: 0;
}

.category-more {
  position: relative;
  flex: 0 0 auto;
}

.more-btn {
  min-width: 72px;
}

/* Legacy category bars from older templates are intentionally hidden */
#categoryFilterBar,
#categoryFilters,
.category-filter-row,
.category-filter-bar,
.top-category-filter,
.legacy-category-row {
  display: none !important;
}

.more-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  min-width: 220px;
  display: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(15, 22, 35, 0.12);
  padding: 8px;
  max-height: 320px;
  overflow: auto;
}

.more-menu.open {
  display: grid;
  gap: 6px;
}

.more-item {
  border: 1px solid var(--line);
  background: #fff;
  color: #25303d;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}

.more-item.active {
  background: var(--accent-soft);
  border-color: #efbec1;
  color: #951117;
}

.pill {
  border: 1px solid var(--line);
  background: #fff;
  color: #25303d;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 700;
}

.pill.active {
  background: var(--accent-soft);
  border-color: #efbec1;
  color: #951117;
}

.fixed-nav .pill {
  font-weight: 800;
}

.trending-strip {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.trending-strip-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
}

.trending-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #8a1720;
  font-weight: 800;
}

.trending-tags {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 2px;
}

.trending-tags .pill {
  flex: 0 0 auto;
}

.breaking-strip {
  background: #151e2f;
  color: #f2f5fb;
}

.breaking-strip-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  padding: 10px 0;
}

.breaking-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 800;
  color: #ff8790;
}

.breaking-ticker {
  overflow: hidden;
}

.breaking-track {
  display: inline-flex;
  gap: 22px;
  white-space: nowrap;
  animation: ticker 30s linear infinite;
}

.breaking-chip {
  font-size: 13px;
}

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.page-main {
  padding: 16px 0 24px;
  display: grid;
  gap: 16px;
}

.toi-layout {
  grid-template-columns: 280px minmax(0, 1fr) 340px;
  align-items: start;
}

.toi-left-rail,
.toi-center-feed,
.toi-right-rail {
  display: grid;
  gap: 16px;
  align-content: start;
}

.rail-card {
  height: fit-content;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.hero-story {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  overflow: hidden;
}

.hero-copy {
  padding: 18px;
}

.kicker {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #7e8791;
  font-size: 11px;
  font-weight: 800;
}

.hero-copy h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4.4vw, 52px);
  line-height: 1.08;
  font-family: "Merriweather", "Noto Sans Devanagari", serif;
}

.hero-copy p {
  margin: 0 0 12px;
  color: #43515f;
  line-height: 1.7;
}

.meta-line {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: #667481;
  font-size: 12px;
}

.hero-media {
  min-height: 340px;
  background: linear-gradient(140deg, #dae3f2, #f0f4fb);
}

.hero-media img,
.hero-media video,
.thumb img,
.thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-side {
  padding: 14px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.card-head h2,
.card-head h3 {
  margin: 0;
  font-family: "Merriweather", "Noto Sans Devanagari", serif;
}

.list {
  display: grid;
  gap: 10px;
}

.list-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
}

.list-item h4 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.3;
  font-family: "Merriweather", "Noto Sans Devanagari", serif;
}

.list-item p {
  margin: 0;
  color: #4b5967;
  line-height: 1.6;
}

.section {
  padding: 14px;
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.story-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
}

.thumb {
  min-height: 180px;
  background: linear-gradient(140deg, #dae3f2, #f0f4fb);
}

.story-copy {
  padding: 12px;
}

.story-copy h3 {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.22;
  font-family: "Merriweather", "Noto Sans Devanagari", serif;
}

.story-copy p {
  margin: 0 0 8px;
  color: #495767;
  line-height: 1.65;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 370px;
  gap: 14px;
}

.stream-list {
  display: grid;
  gap: 10px;
}

.stream-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
}

.stream-card h3 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.24;
  font-family: "Merriweather", "Noto Sans Devanagari", serif;
}

.stream-card p {
  margin: 0 0 8px;
  color: #4b5967;
  line-height: 1.64;
}

.quick-brief-card h3 {
  font-size: 18px;
  margin-bottom: 6px;
  line-height: 1.35;
}

.quick-brief-card p {
  font-size: 14px;
  line-height: 1.55;
}

.rail-tags {
  overflow-x: visible;
  overflow-y: auto;
  max-height: 320px;
  align-content: start;
  flex-wrap: wrap;
}

.section-actions {
  padding-top: 10px;
}

.btn-secondary {
  border: 1px solid #c4ccd8;
  background: #eef2f8;
  color: #273341;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}

.metric span {
  display: block;
  color: #6f7a85;
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 25px;
  font-family: "Merriweather", "Noto Sans Devanagari", serif;
}

#categorySections {
  display: grid;
  gap: 12px;
}

.category-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.category-block h3 {
  margin: 0 0 10px;
  font-family: "Merriweather", "Noto Sans Devanagari", serif;
}

.category-story-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mini-story {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
}

.mini-story h4 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.3;
}

.ad-strip {
  margin-top: 12px;
}

.ad-inline-section {
  margin-top: 14px;
}

.ad-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.ad-link {
  display: block;
  line-height: 0;
}

.ad-card img,
.ad-side-item img {
  width: 100%;
  height: auto;
  display: block;
}

.ad-top img {
  max-height: 160px;
  object-fit: cover;
}

.ad-inline img {
  max-height: 220px;
  object-fit: cover;
}

.ad-side-item {
  padding: 0;
  overflow: hidden;
}

.site-footer {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  background: #ecf1f8;
}

.footer-inner {
  padding: 18px 0;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 12px;
}

.footer-inner h4,
.footer-inner h5 {
  margin: 0 0 8px;
}

.footer-inner p {
  margin: 0;
  color: #4e5e6e;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.footer-links a {
  color: #3d4f63;
  text-decoration: none;
  font-weight: 600;
}

.footer-links a:hover {
  text-decoration: underline;
}

.social-links {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.social-links a {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #bcc8d8;
  border-radius: 50%;
  color: #25384b;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  background: #fff;
}

.social-links a:hover {
  background: #edf2f8;
}

.article-modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 18, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 9000;
}

.article-modal.show {
  display: flex;
}

.article-dialog {
  width: min(860px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 14px;
}

.modal-close {
  margin-left: auto;
  display: block;
  border: 1px solid #c4ccd8;
  background: #eef2f8;
  color: #24303d;
  border-radius: 10px;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 700;
}

.modal-kicker {
  margin: 10px 0 8px;
  color: #7e8791;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 800;
}

.article-dialog h2 {
  margin: 0 0 10px;
  font-size: clamp(26px, 3.6vw, 42px);
  line-height: 1.12;
  font-family: "Merriweather", "Noto Sans Devanagari", serif;
}

.modal-meta {
  margin: 0;
  color: #5a6978;
}

.modal-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-link {
  color: #213347;
}

.modal-media {
  margin-top: 12px;
  min-height: 0;
  background: linear-gradient(140deg, #dae3f2, #f0f4fb);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
}

.modal-media img,
.modal-media video {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(45vh, 420px);
  object-fit: contain;
}

.modal-body {
  margin-top: 14px;
  line-height: 1.95;
  font-size: 17px;
  color: #1b2530;
  white-space: pre-wrap;
  font-family: "Noto Sans Devanagari", "Inter", sans-serif;
}

.modal-audio {
  margin-top: 14px;
}

.modal-audio audio {
  width: 100%;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 14px;
  color: #5f6973;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 12px 0;
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: -320px;
  width: min(320px, 88vw);
  height: 100vh;
  background: #fff;
  border-left: 1px solid var(--line);
  z-index: 9500;
  padding: 14px;
  transition: right 0.25s ease;
  overflow: auto;
}

.mobile-menu.show {
  right: 0;
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.mobile-menu-header h3 {
  margin: 0;
}

.mobile-menu-header button {
  border: 1px solid #c4ccd8;
  background: #eef2f8;
  color: #24303d;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-weight: 700;
}

.mobile-category-list {
  display: grid;
  gap: 8px;
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 14, 24, 0.48);
  z-index: 9400;
  display: none;
}

.menu-backdrop.show {
  display: block;
}

.back-to-top-btn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid #c8d1de;
  background: #ffffff;
  color: #111c2b;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(10, 17, 30, 0.15);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9200;
}

.back-to-top-btn.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.skeleton-block {
  border-radius: 12px;
  background: linear-gradient(90deg, #ebeff5 25%, #f7f9fc 37%, #ebeff5 63%);
  background-size: 400% 100%;
  animation: newsSkeleton 1.2s ease infinite;
  border: 1px solid #d8dee8;
}

.skeleton-lg {
  min-height: 260px;
}

.skeleton-md {
  min-height: 86px;
  margin-bottom: 8px;
}

.skeleton-card {
  min-height: 290px;
}

.skeleton-row {
  min-height: 130px;
  margin-bottom: 10px;
}

@keyframes newsSkeleton {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

.story-main {
  grid-template-columns: minmax(0, 1fr) 350px;
  align-items: start;
}

.story-article,
.story-side {
  padding: 18px;
}

.story-meta {
  margin: 0 0 14px;
  color: #4f6174;
  font-size: 15px;
}

.story-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  z-index: 9600;
  background: linear-gradient(90deg, #cd2030, #ff5573);
}

.story-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.story-tools .btn-secondary {
  padding: 8px 12px;
  border-radius: 999px;
}

.story-cover-wrap {
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(140deg, #dae3f2, #f0f4fb);
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.story-cover-wrap img,
.story-cover-wrap video {
  width: 100%;
  max-height: min(62vh, 560px);
  object-fit: contain;
  display: block;
}

.story-body {
  color: #172535;
  line-height: 1.95;
  font-size: 18px;
  white-space: normal;
}

.story-body p {
  margin: 0 0 14px;
}

.story-audio-wrap {
  margin-bottom: 14px;
}

.story-audio-wrap audio {
  width: 100%;
}

.story-related-wrap {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.story-related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 1140px) {
  .toi-layout {
    grid-template-columns: 1fr;
  }

  .toi-center-feed {
    order: 1;
  }

  .toi-left-rail {
    order: 2;
  }

  .toi-right-rail {
    order: 3;
  }

  .hero-grid,
  .content-grid,
  .story-main {
    grid-template-columns: 1fr;
  }

  .hero-story {
    grid-template-columns: 1fr;
  }

  .story-grid,
  .category-story-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .search-wrap {
    min-width: 300px;
  }
}

@media (max-width: 760px) {
  .top-strip-inner,
  .brand-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .brand-header-inner {
    gap: 10px;
  }

  .market-strip-inner,
  .breaking-strip-inner,
  .trending-strip-inner {
    grid-template-columns: 1fr;
  }

  .header-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .search-wrap {
    min-width: 100%;
    width: 100%;
    order: 3;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .category-nav {
    display: none;
  }

  .story-grid,
  .category-story-grid,
  .metric-grid,
  .story-related-grid {
    grid-template-columns: 1fr;
  }

  .rail-tags {
    max-height: none;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .article-dialog {
    width: min(94vw, 860px);
    padding: 12px;
  }

  .article-dialog h2 {
    font-size: clamp(24px, 6vw, 34px);
  }
}
