/* V2 homepage/category/similar styles.
   Non-destructive migration pass: copied from legacy.css.
   legacy.css remains loaded last, so behavior stays stable.
*/

.home-v2 {
    --v2-max: 1280px;
    --v2-gap: 18px;
    --v2-radius: 16px;
    --v2-border: rgba(120, 120, 120, .25);
    --v2-shadow: 0 8px 22px rgba(0, 0, 0, .07);
    max-width: var(--v2-max);
    margin: 0 auto;
    padding: 6px 0 28px;
    padding-top: 0;
}

.home-v2 a {
    text-decoration: none;
}

.home-v2 a:hover {
    text-decoration: underline;
}

.home-v2 .container,
.home-v2 + .container {
    margin-top: 0;
    padding-top: 0;
}

.home-v2 .breadcrumb,
.home-v2 .breadcrumbs,
.home-v2 nav[aria-label=breadcrumb] {
    margin-bottom: 8px;
}

.home-v2 .live-search-bar,
.home-v2 ~ .live-search-bar {
    margin-bottom: 8px;
}

.v2-grid {
    display: grid;
    gap: var(--v2-gap);
}

.v2-grid--top {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    align-items: start;
}

.v2-main {
    display: grid;
    gap: var(--v2-gap);
}

.v2-side {
    display: grid;
    gap: 12px;
}

.v2-card,
.v2-feature,
.v2-panel,
.v2-sidecard {
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius);
    overflow: hidden;
    background: rgba(255, 255, 255, .02);
    box-shadow: var(--v2-shadow);
}

.v2-panel {
    padding: 14px;
}

.v2-panel--latest {
    padding: 0;
}

.v2-panel--latest .v2-panel__head {
    padding: 14px 14px 10px;
    margin-bottom: 0;
}

.v2-panel--latest .v2-stream {
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 0 0 var(--v2-radius) var(--v2-radius);
}

.v2-panel__head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 10px;
}

.v2-panel__title {
    font-size: 1.05rem;
    margin: 0;
}

.v2-panel__link {
    font-size: .95rem;
    opacity: .85;
}

.v2-rows {
    display: grid;
    gap: 10px;
}

.v2-rows--tight {
    gap: 8px;
}

.v2-row__meta {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: .88rem;
    opacity: .85;
    margin-bottom: 4px;
}

.v2-dot {
    opacity: .65;
}

.v2-row__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 650;
    line-height: 1.2;
}

.v2-feature__media {
    position: relative;
    aspect-ratio: 16/9;
    background: rgba(0, 0, 0, .08);
}

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

.v2-feature__body {
    padding: 14px 16px 16px;
}

.v2-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--v2-gap);
}

.v2-catgrid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--v2-gap);
    align-items: stretch;
}

.v2-catgrid__list {
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius);
    padding: 14px;
    background: rgba(255, 255, 255, .02);
    box-shadow: var(--v2-shadow);
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.v2-latest-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--v2-border);
    align-items: center;
}

.v2-latest-item:last-child {
    border-bottom: none;
}

@media (max-width:980px) {
    .v2-grid--top {
        grid-template-columns: 1fr;
    }

    .v2-side {
        position: static;
    }

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

    .v2-catgrid {
        grid-template-columns: 1fr;
    }
}

@media (max-width:560px) {
    .v2-cards {
        grid-template-columns: 1fr;
    }
}

.v2-catgrid__lead {
    display: flex;
}

.v2-catgrid__lead > .v2-card {
    width: 100%;
}

.v2-catgrid__headlines {
    flex: 1;
}

.v2-cat-rel {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--v2-border);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.v2-cat-rel__card {
    min-width: 0;
}

.v2-cat-rel__link {
    color: inherit;
    text-decoration: none;
    display: block;
}

.v2-cat-rel__media {
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border: 1px solid rgba(0, 0, 0, .08);
    background: rgba(229, 231, 235, .9);
}

.v2-cat-rel__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.v2-cat-rel__title {
    margin: 8px 0 4px;
    font-size: .88rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.v2-cat-rel__summary {
    margin: 0;
    font-size: .82rem;
    line-height: 1.3;
    opacity: .85;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width:980px) {
    .v2-cat-rel {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width:560px) {
    .v2-cat-rel {
        grid-template-columns: 1fr;
    }
}

.v2-latest-thumb-link {
    display: inline-flex;
    text-decoration: none;
    border-radius: 10px;
}

.v2-latest-thumb {
    height: 56px;
    max-width: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 10px;
    background: rgba(229, 231, 235, .9);
    border: 1px solid rgba(0, 0, 0, .05);
}

.v2-latest-thumb img {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
}

.v2-latest-thumb-link:hover .v2-latest-thumb {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, .08);
}

.v2-latest-thumb-link:focus-visible .v2-latest-thumb {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.v2-latest-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.v2-latest-meta {
    font-size: .85rem;
    opacity: .85;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.1;
    min-width: 0;
}

.v2-latest-cat {
    opacity: .95;
    text-decoration: none;
}

.v2-latest-cat:hover {
    text-decoration: underline;
}

.v2-latest-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.25;
    min-width: 0;
}

.v2-latest-title a {
    color: inherit;
    text-decoration: none;
}

.v2-latest-title a:hover {
    text-decoration: underline;
}

.v2-latest-summary {
    margin: 0;
    opacity: .9;
    font-size: .95rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width:980px) {
    .v2-latest-title {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

@media (max-width: 640px) {
  .v2-latest-item {
    grid-template-columns: 56px 1fr;
    gap: .65rem;
    align-items: flex-start;
  }

  .v2-latest-thumb-link,
  .v2-latest-thumb {
    display: block;
  }

  .v2-latest-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    background: #eef1f4;
    flex-shrink: 0;
  }

  .v2-latest-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
  }
}

/* Migration batch: moved from legacy.css */
.v2-cat {
    opacity: .95
}

.v2-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: .9rem;
    opacity: .85;
    margin-bottom: 8px
}

.v2-chip {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 650;
    backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, .45);
    color: #fff
}

.v2-chip--small {
    padding: 5px 9px;
    font-size: .78rem
}

.v2-feature__link {
    display: block;
    color: inherit
}

.v2-feature__title {
    margin: 0 0 8px;
    font-size: clamp(1.35rem, 2.2vw, 2.05rem);
    line-height: 1.1;
    letter-spacing: -.01em
}

.v2-feature__summary {
    margin: 0 0 10px;
    opacity: .9;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden
}

.v2-readmore {
    font-weight: 650;
    opacity: .9
}

.v2-sidecard {
    padding: 14px
}

.v2-sidecard__head {
    margin-bottom: 8px
}

.v2-sidecard__title {
    margin: 0;
    font-size: 1.02rem
}

.v2-sidecard__text {
    margin: 0 0 10px;
    opacity: .9
}

.v2-cta {
    display: inline-flex;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--v2-border);
    font-weight: 650;
    text-decoration: none
}

.v2-section {
    margin-top: 18px
}

.v2-section__head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin: 14px 2px 10px
}

.v2-section__title {
    margin: 0;
    font-size: 1.15rem
}

.v2-section__link {
    font-size: .95rem;
    opacity: .85
}

.v2-stream {
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius);
    overflow: hidden;
    background: rgba(255, 255, 255, .02)
}
.v2-btn {
    display: inline-flex;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--v2-border);
    font-weight: 650
}

.v2-card__link {
    display: block;
    color: inherit
}

.v2-card__media {
    position: relative;
    aspect-ratio: 16/9;
    background: rgba(0, 0, 0, .08)
}

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

.v2-card__body {
    padding: 12px 14px 14px
}

.v2-card__title {
    margin: 0 0 6px;
    font-size: 1.02rem;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden
}

.v2-card__summary {
    margin: 0;
    opacity: .9;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden
}

.v2-catblock {
    margin-top: 18px
}

.v2-count {
    font-size: .85rem;
    opacity: .75;
    margin-left: 8px
}


.v2-cat-head{
  margin-bottom: 1rem;
}

/* Smaller category hero image */
.v2-cat-hero{
  margin: .6rem 0 .8rem;
}
.v2-cat-hero img{
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}

/* Admin toolbar inside stream */
/* Make category stream items compact like "Latest News" */
.v2-stream--category .v2-latest-item{
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: .85rem;
  align-items: start;
}

/* Thumbnail box */
.v2-stream--category .v2-latest-thumb{
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  background: #f2f2f2;
  display: block;
}

/* If image missing, keep box but no broken layout */
.v2-stream--category .v2-latest-thumb img[src=""],
.v2-stream--category .v2-latest-thumb img:not([src]){
  display: none;
}

/* Body sizing */
/* Tighten typography a bit */
.v2-stream--category .v2-latest-title{
  margin: .15rem 0 .2rem;
  font-size: 1rem;
  line-height: 1.25;
}
/* Readmore line spacing */
/* Optional: ensure sidecards align nicely */
.v2-side .v2-sidecard{
  margin-bottom: 1rem;
}
/* ===== Category V2 tweaks ===== */

.v2-category .v2-cat-hero img{
  height: 200px;          /* smaller than before */
  object-fit: cover;
  border-radius: 14px;
  display: block;
}

/* Admin toolbar should not break grid flow */
/* If no image exists, show a subtle placeholder square */
.v2-thumb-placeholder{
  width: 100%;
  height: 100%;
  background: #eef1f4;
  border-radius: 10px;
}

/* Tighten category list spacing a bit */
.v2-stream--category .v2-latest-item{
  padding-top: .2rem;
  padding-bottom: .2rem;
}
/* =========================================
   Category V2
   ========================================= */

.v2-category .v2-cat-hero{
  margin: .5rem 0 .75rem;
}

.v2-category .v2-cat-hero img{
  width: 100%;
  height: 200px;            /* smaller hero */
  object-fit: cover;
  border-radius: 14px;
  display: block;
}

/* Force compact "Latest News" style rows */
.v2-stream--category .v2-latest-item{
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: .75rem;
  align-items: start;
}

/* Admin toolbar should not steal a grid column */
/* Thumbnail wrapper */
.v2-stream--category .v2-latest-thumb{
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  background: #f2f4f7;
}

/* Thumbnail image */
.v2-stream--category .v2-latest-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Placeholder when no image exists */
.v2-stream--category .v2-thumb-placeholder{
  display: block;
  width: 100%;
  height: 100%;
  background: #eef1f4;
}

/* Prevent text overflow issues */
.v2-stream--category .v2-latest-body{
  min-width: 0;
}

.v2-stream--category .v2-latest-title{
  margin: .15rem 0 .2rem;
  font-size: 1rem;
}

.v2-stream--category .v2-latest-summary{
  margin: 0;
  font-size: .9rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.v2-cat-keywords {
  margin: .3rem 0 .05rem;
}

.v2-side {
  background: transparent;
}

/* Sidebar cards: flatten + soften */
.v2-side .v2-sidecard {
  background: #ffffff; /* force clean white */
  border: 1px solid rgba(120, 120, 120, 0.18); /* slightly lighter border */
  box-shadow: 
    0 3px 10px rgba(0, 0, 0, 0.04); /* flatter than dev */
}

/* Remove any accidental stacking depth */
.v2-side .v2-sidecard:not(:last-child) {
  margin-bottom: 0;
}

/* Headings slightly less heavy */
.v2-sidecard__title {
  font-weight: 600;
}

/* Body text softer */
.v2-sidecard__text {
  color: #475569; /* slate-600-ish */
}

/* CTA button: flatter, prod-like */
.v2-side .v2-cta {
  background: transparent;
  border: 1px solid rgba(120, 120, 120, 0.25);
  box-shadow: none;
}

/* Crypto strip chips – flatten */
.v2-side .crypto-chip {
  background: #fff;
  border: 1px solid rgba(120, 120, 120, 0.18);
  box-shadow: none;
}

/* Prevent parent contrast from exaggerating shadows */
.v2-grid,
.v2-grid--top {
  background: transparent;
}

/* Make v2 panels match the flatter "prod" feel (opt-in) */
.v2-panel.v2-panel--flat {
  box-shadow: none !important;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.92);
}

.v2-section.v2-panel--flat {
  box-shadow: none !important;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.92);
}

/* Migration batch: moved from legacy.css (pass 2) */
.v2-grid--top > .v2-side {
  position: sticky !important;
  top: calc(var(--topbar-height, 60px) + 52px) !important; /* top-bar + category/live-search area */
  align-self: start;
  height: fit-content;
}

.home-v2,
.v2-grid,
.v2-grid--top {
  overflow: visible;
}

/* 4) Keep it non-sticky on smaller screens (optional, adjust breakpoint) */
@media (max-width: 980px) {
  .v2-grid--top > .v2-side {
    position: static !important;
    top: auto !important;
  }
}
/* Keep thumbnails visible on mobile for category/similar/index pages */
@media (max-width: 640px) {
  #content.home-v2.v2-category .v2-cat-hero img{
    height: auto !important;
    max-height: 240px;
    object-fit: contain !important;
    background: #eef1f4;
  }

  #content.home-v2.v2-category .v2-stream--category .v2-latest-item,
  #content.home-v2.v2-similar .v2-stream--category .v2-latest-item {
    grid-template-columns: 64px 1fr !important;
  }
}

.v2-finance-label{
  font-size: 12px;
  opacity: 0.70;
  margin-bottom: 4px;
}

.v2-finance-hero{
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.v2-finance-stats{
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
}

.v2-finance-stat{
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 16px;
  background: rgba(255,255,255,0.92);
  padding: 12px 14px;
  min-height: 82px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.v2-finance-value{
  font-size: 16px;
  font-weight: 700;
}

.v2-finance-delta{
  font-size: 16px;
  font-weight: 800;
}

.v2-finance-delta.is-up{ color: #0a8f3c; }    /* green */
.v2-finance-delta.is-down{ color: #c62828; }  /* red */

/* Chart modern look */
.v2-chart-wrap{
  width:100%;
  overflow:hidden;
  border-radius:18px;
  background: rgba(0,0,0,0.03);   /* subtle panel behind chart */
  padding: 10px;
}

.v2-chart-img{
  display:block;
  width:100%;
  height:auto;
  max-height: 420px;
  object-fit: contain;

  /* remove “image border look” */
  border: 0;
  outline: 0;
  box-shadow: none;
  border-radius: 14px; /* subtle rounding only */
}

/* Mobile: make stat cards full width-ish */
@media (max-width: 640px){
  .v2-finance-stats{
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
  .v2-finance-stat{ min-width: 44%; }
  .v2-chart-img{ max-height: 320px; }
}
/* Overview container spacing */
.v2-finance-overview{
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Card header */
.v2-finance-card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding: 14px 16px 0 16px;
}

.v2-finance-card-title .v2-h2{
  margin: 0;
}

.v2-finance-card-grid{
  display:grid;
  grid-template-columns: 1fr 340px; /* chart | side stats */
  gap: 14px;
  padding: 12px 16px 16px 16px;
  align-items: start;
}

/* Chart area in overview */
.v2-chart-wrap--overview{
  padding: 10px;
}

.v2-chart-img--overview{
  max-height: 260px;
}

/* Right side */
.v2-finance-side{
  display:flex;
  flex-direction: column;
  gap: 10px;
}

.v2-finance-stats--overview{
  grid-template-columns: repeat(2, minmax(120px, 1fr));
}

.v2-finance-updated{
  font-size: 13px;
}

/* Make the chart clickable but keep it looking like content */
.v2-finance-chart{
  text-decoration:none;
  color: inherit;
  display:block;
}

/* Responsive: stack chart above stats on mobile */
@media (max-width: 900px){
  .v2-finance-card-grid{
    grid-template-columns: 1fr;
  }
  .v2-chart-img--overview{
    max-height: 320px;
  }
  .v2-finance-stat{
    min-width: 46%;
  }
}
.v2-chart-toolbar{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom: 10px;
}

.v2-chart-tab{
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
}

.v2-chart-tab.is-active{
  background: rgba(0,0,0,0.06);
}

.v2-chart-img.is-loading{
  opacity: 0.65;
  transition: opacity 120ms ease;
}

.v2-richtext table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 1rem 0;
  font-size: 0.95rem;
  line-height: 1.35;

  border: 1px solid rgba(0,0,0,.12);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.v2-richtext th {
  text-align: left;
  font-weight: 700;
  padding: 0.75rem 0.85rem;
  background: rgba(0,0,0,.05);
  border-bottom: 1px solid rgba(0,0,0,.12);
  white-space: nowrap;
}

.v2-richtext td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid rgba(0,0,0,.08);
  vertical-align: top;
}

.v2-richtext tbody tr:nth-child(even) td {
  background: rgba(0,0,0,.02);
}

.v2-richtext tbody tr:hover td {
  background: rgba(0,0,0,.04);
}

/* Override ugly LLM attributes like border=1 */
.v2-richtext table,
.v2-richtext th,
.v2-richtext td {
  border-color: rgba(0,0,0,.12);
}
/* Base list reset */
.v2-richtext ul,
.v2-richtext ol {
  margin: 0.75rem 0;      /* less vertical space */
  padding-left: 0;
}

/* List items tighter */
.v2-richtext li {
  margin: 0.25rem 0;      /* tighter vertical spacing */
  line-height: 1.45;      /* slightly compact */
}

/* ---------- BULLETS ---------- */

.v2-richtext ul {
  list-style: none;
}

.v2-richtext ul li {
  position: relative;
  padding-left: 1.1rem;
}

.v2-richtext ul li::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0.1rem;
  font-weight: 600;
  opacity: 0.6;
  font-size: 0.9em;
}

/* ---------- NUMBERED LIST ---------- */

.v2-richtext ol {
  counter-reset: ic-counter;
  list-style: none;
}

.v2-richtext ol li {
  counter-increment: ic-counter;
  position: relative;
  padding-left: 1.6rem;
}

.v2-richtext ol li::before {
  content: counter(ic-counter) ".";
  position: absolute;
  left: 0;
  top: 0.05rem;
  font-weight: 600;
  opacity: 0.7;
  font-size: 0.9em;
}
.v2-richtext ul li::before,
.v2-richtext ol li::before {
  color: var(--accent-color, #2a5c8a);
}
/* Prevent any rich content from pushing the layout wider */
.v2-main,
.v2-richtext {
  max-width: 100%;
  overflow-x: hidden; /* optional but helps stop page-level sideways scroll */
}

/* The scrolling container */
.v2-richtext .v2-table-wrap {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0;
  border-radius: 12px;
}

/* Table can be wide, but only inside the wrapper */
.v2-richtext .v2-table-wrap > table {
  border-collapse: collapse;
  margin: 0;
  width: max-content; /* natural table width */
  min-width: 100%;    /* but never smaller than container */
}

@media (max-width: 720px) {
  .v2-richtext .v2-table-wrap {
    position: relative;
  }

  .v2-richtext .v2-table-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 34px;
    height: 100%;
    pointer-events: none;

    /* JS sets this between 0 and 1 */
    opacity: var(--ic-scrollhint, 0);
    transition: opacity .15s ease;

    background: linear-gradient(to right,
      rgba(255,255,255,0),
      rgba(255,255,255,0.92)
    );
  }
}

@media (prefers-color-scheme: dark) and (max-width: 720px) {
  .v2-richtext .v2-table-wrap::after {
    background: linear-gradient(to right,
      rgba(0,0,0,0),
      rgba(0,0,0,0.65)
    );
  }
}
/* Keep main column card aligned and not too wide */
.v2-grid .v2-main {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,.04);
  max-width: 100%;
}

/* If your grid uses gap, this helps avoid touching edges on small screens */
@media (max-width: 720px) {
  .v2-grid .v2-main {
    padding: 12px;
    border-radius: 14px;
  }
}

.search-serp {
  padding: 18px 18px 12px;
}

.search-serp__head {
  margin-bottom: 8px;
}

.search-serp__title {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.2;
}

.search-serp__meta {
  margin: 8px 0 0;
  font-size: .95rem;
  opacity: .82;
}

.search-serp__list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.search-serp__item {
  padding: 12px 0;
  border-top: 1px solid rgba(0, 0, 0, .08);
}

.search-serp__item:first-child {
  border-top: 0;
}

.search-serp__row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.search-serp__thumb-link {
  display: block;
  text-decoration: none;
}

.search-serp__thumb {
  width: 132px;
  height: 84px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, .08);
  display: block;
}

.search-serp__body {
  min-width: 0;
}

.search-serp__url {
  display: inline-block;
  font-size: .84rem;
  color: #166534;
  text-decoration: none;
  margin-bottom: 4px;
  word-break: break-all;
}

.search-serp__item-title {
  margin: 0 0 6px;
  font-size: 1.18rem;
  line-height: 1.28;
}

.search-serp__item-title a {
  text-decoration: none;
  color: inherit;
}

.search-serp__item-title a:hover {
  text-decoration: underline;
}

.search-serp__snippet {
  margin: 0 0 6px;
  font-size: .98rem;
  line-height: 1.45;
  opacity: .92;
}

.search-serp__item-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: .84rem;
  opacity: .78;
}

.search-serp__pager {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, .08);
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.search-serp__pages {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.search-serp__pagebtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 999px;
  text-decoration: none;
  color: inherit;
  font-size: .9rem;
  background: #fff;
}

.search-serp__pagebtn.is-current {
  font-weight: 700;
  border-color: rgba(0, 0, 0, .35);
}

.search-serp__pagebtn.is-disabled {
  opacity: .45;
  pointer-events: none;
}

.search-serp__empty {
  margin: 16px 0 4px;
  opacity: .8;
}

@media (max-width: 720px) {
  .search-serp__row {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
  }

  .search-serp__thumb {
    width: 88px;
    height: 64px;
    border-radius: 8px;
  }
}

/* Extra-small mobile tuning (mini phone views) */
@media (max-width: 430px) {
  .home-v2 {
    --v2-gap: 12px;
  }

  .v2-feature__title {
    font-size: 1.2rem;
    line-height: 1.2;
  }

  .v2-section__title,
  .v2-panel__title,
  .v2-sidecard__title,
  .v2-latest-title,
  .v2-card__title {
    font-size: 1rem;
    line-height: 1.25;
  }

  .v2-meta,
  .v2-row__meta,
  .v2-latest-meta,
  .v2-sidecard__text,
  .v2-lead {
    font-size: .84rem;
    line-height: 1.35;
  }

  .search-serp {
    padding: 12px 12px 8px;
  }

  .search-serp__title {
    font-size: 1.2rem;
  }

  .search-serp__item-title {
    font-size: 1.02rem;
    line-height: 1.28;
  }

  .search-serp__snippet {
    font-size: .9rem;
    line-height: 1.4;
  }

  .v2-finance-value,
  .v2-finance-delta {
    font-size: 15px;
  }
}

@media (max-width: 768px) {
  .v2-feature__title {
    font-size: 1.1rem !important;
    line-height: 1.22 !important;
  }

  .v2-feature__summary {
    font-size: .92rem !important;
    line-height: 1.4 !important;
  }

  .v2-card__title,
  .v2-latest-title,
  .v2-stream--category .v2-latest-title,
  .v2-cat-rel__title {
    font-size: .98rem !important;
    line-height: 1.26 !important;
  }

  .v2-card__summary,
  .v2-latest-summary,
  .v2-stream--category .v2-latest-summary,
  .v2-cat-rel__summary {
    font-size: .86rem !important;
    line-height: 1.38 !important;
  }

  .v2-meta,
  .v2-row__meta,
  .v2-latest-meta,
  .v2-section__link {
    font-size: .78rem !important;
  }

  .v2-chip {
    font-size: .72rem !important;
    padding: 5px 8px !important;
  }

  .v2-chip--small {
    font-size: .68rem !important;
    padding: 4px 7px !important;
  }

  .v2-cta,
  .v2-btn {
    font-size: .9rem;
  }
}
