/* ── Wrapper override (same as cpi_hierarchy) ── */
body.horizontal .wrapper.d-flex.flex-column.min-vh-100 {
  overflow:hidden;
  height:100vh !important;
  max-height:100vh;
  padding-top:calc(var(--topnav-height, 3.7688rem) - .8375rem) !important;
}
/* Fixed full-viewport background image LAYER (works on mobile + dark mode, unlike
   background-attachment:fixed). body + wrapper transparent so the layer shows. */
body.horizontal::before {
  content:""; position:fixed; inset:0; z-index:-1; pointer-events:none;
  background-repeat:no-repeat; background-position:center top; background-size:cover;
}
html[data-mode="light"] body.horizontal::before {
  background-image:linear-gradient(rgba(244,246,249,0.9),rgba(244,246,249,0.9)),
    url("../../assets/images/cbu-bg-pic-3.2ec7ebae08c6.jpg");
}
html[data-mode="dark"] body.horizontal::before {
  background-image:linear-gradient(rgba(26,29,33,0.93),rgba(26,29,33,0.93)),
    url("../../assets/images/cbu-bg-pic-3.2ec7ebae08c6.jpg");
}
html[data-mode="light"] body.horizontal,
html[data-mode="dark"] body.horizontal,
html[data-mode="light"] body.horizontal .wrapper,
html[data-mode="dark"] body.horizontal .wrapper { background:transparent !important; }
html[data-mode="light"] { background:#f4f6f9; }
html[data-mode="dark"]  { background:#1a1d21; }

/* ── Page shell ──────────────────────────────── */
/* height = full viewport minus topnav */
.ts-page {
  display:flex; flex-direction:column;
  width:100%; flex:1;
  overflow:hidden; min-height:0;
  box-sizing:border-box;
}

/* ── Big title (full-width centered) ─────────── */
.ts-big-title {
  flex-shrink:0;
  padding:.5025rem .5863rem .2513rem;
}
.ts-title-bar {
  /* same columns and gap as the body grid (44fr | 28fr | 28fr): the four
     selectors above the cards column, the title across the other two */
  display:grid; grid-template-columns:44fr 28fr 28fr; gap:.4188rem;
  align-items:center; padding:.2513rem clamp(.5025rem, 1.2vw, .8375rem);
}
@media (min-width: 992px) { .ts-title-bar { padding: .2513rem clamp(.5025rem, .804vw, .8375rem); } }
.ts-title-sep { display:none; }
/* the two pairs sit on the cards grid's own columns (1fr 1fr, gap 8px) */
.ts-filter-group { display:grid; grid-template-columns:1fr 1fr; gap:.335rem; min-width:0; }
.ts-title-bar > .ts-title-text { grid-column:2 / -1; align-self:end; }   /* level with the selectors */
/* plain label + selector pairs, no box around each pair */
.ts-filters.ts-filters-inline {
  display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); align-items:center; gap:.335rem .4188rem;
  padding:0; min-width:0;
}
.ts-filters-inline .ts-filter-row {
  display:flex; flex-direction:column; align-items:stretch; gap:.1256rem;   /* label above, like the landing filters */
}
/* the selector (custom dropdown) takes the rest of its column */
.ts-filters-inline .ts-filter-row > .csel { flex:1 1 auto; min-width:0; }
.ts-filters-inline .ts-filter-row > .csel .csel-button { width:100%; }
.ts-filters-inline label {
  font-size:.4606rem; font-weight:800; letter-spacing:.5px;
  text-transform:uppercase; margin:0; white-space:nowrap; flex-shrink:0;
}
.ts-filters-inline select {
  font-size:.5863rem; font-weight:600; min-width:7.5375rem;
  padding:0 1.2563rem 0 0; border:none; background-color:transparent;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%231A2B4B' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right .2513rem center;
  appearance:none; -webkit-appearance:none; cursor:pointer; outline:none;
}
.ts-title-sep {
  width:.0419rem; height:1.34rem; flex-shrink:0;
  background:rgba(128,128,128,.30);
}
.ts-title-text {
  flex:1; min-width:0;
  display:flex; align-items:center; justify-content:center;
  box-sizing:border-box; height:var(--ctl-h, 1.4238rem);   /* same height as the selectors */
  font-size:.7538rem; font-weight:800; letter-spacing:.5px; text-transform:uppercase;
  text-align:center; line-height:1.2;
  background:none; border:0; padding:0 .67rem;   /* plain heading, no box */
}
html[data-mode="dark"]  .ts-big-title { background:transparent; color:#eaeaea; }
html[data-mode="light"] .ts-big-title { background:transparent; color:#1a2e6c; }

/* ── Filters (top of left column, side by side) ── */
.ts-filters {
  display:flex; flex-direction:row; align-items:center; gap:.335rem; flex-shrink:0;
  padding:.2513rem .1675rem .335rem;
}
.ts-filter-row {
  display:flex; flex-direction:column; gap:.0838rem; flex:1;
}
.ts-filters label {
  font-size:.5444rem; font-weight:800; margin:0; opacity:.55; white-space:nowrap;
  letter-spacing:.5px; text-transform:uppercase;
}
.ts-filters select {
  font-size:.67rem; padding:.1675rem .335rem; border-radius:.2931rem; cursor:pointer;
  border:.0628rem solid rgba(128,128,128,.3);
  font-weight:600; width:100%;
  transition:border-color .15s;
}
.ts-filters select:focus { outline:none; border-color:#4f8ef7; }
html[data-mode="dark"]  .ts-filters select { background:rgba(255,255,255,.08); color:#e0e0e0; border-color:rgba(255,255,255,.20); backdrop-filter:blur(.1675rem); }
html[data-mode="dark"]  .ts-filters select option { background:#2a2a2a; color:#e0e0e0; }
html[data-mode="light"] .ts-filters select { background:rgba(255,255,255,.55); color:#1a1a1a; border-color:rgba(0,0,0,.18); backdrop-filter:blur(.1675rem); }
html[data-mode="light"] .ts-filters select option { background:#ffffff; color:#1a1a1a; }

/* ── 3-col body ──────────────────────────────── */
.ts-body {
  display:grid; grid-template-columns:44fr 28fr 28fr;
  gap:.4188rem; padding:.4188rem clamp(.5025rem, 1.2vw, .8375rem); flex:1; overflow:hidden; min-height:0;
}
@media (min-width: 992px) { .ts-body { padding: .4188rem clamp(.5025rem, .804vw, .8375rem); } }

/* ── Box base ────────────────────────────────── */
.ts-box { border-radius:.5025rem; overflow:hidden; display:flex; flex-direction:column; min-height:0; flex:1; }
/* Box transparency matched to kutilmalar (.box-card): light = solid white panel,
   dark = subtle translucent so the bg image shows through. */
html[data-mode="dark"]  .ts-box { background:rgba(255,255,255,0.04); border:.0419rem solid rgba(127,127,127,.18); }
html[data-mode="light"] .ts-box { background:#ffffff; box-shadow:0 .0419rem .0838rem rgba(0,0,0,.04),0 .1675rem .5025rem rgba(0,0,0,.06); border:.0419rem solid #e5e7eb; }
.ts-box-title {
  font-size:.7538rem; font-weight:700; padding:.3769rem .5863rem .335rem; flex-shrink:0;
  display:flex; align-items:center; justify-content:space-between;
  background:#1A2B4B;
  color:#fff;
}
.ts-fs-btn {
  background:none; border:.0419rem solid rgba(255,255,255,.25); border-radius:.2094rem;
  color:#fff; cursor:pointer; padding:.0419rem .2931rem; font-size:.6281rem; line-height:1.4;
  opacity:.7; flex-shrink:0; margin-left:.335rem;
}
html[data-mode="dark"] .ts-fs-btn { color:#93c5fd; border-color:rgba(147,197,253,.3); }
.ts-fs-btn:hover { opacity:1; background:rgba(255,255,255,.12); }

/* ══ LEFT: Cards ══════════════════════════════ */
.ts-left { display:flex; flex-direction:column; overflow:hidden; min-height:0; gap:.2513rem; }
.ts-left-header {
  font-size:.9213rem; font-weight:800; text-transform:uppercase; letter-spacing:.5px;
  padding:.2094rem .1256rem .1675rem; flex-shrink:0; opacity:.65; text-align:center;
}
/* outer: fixed height reference for cqh */
.ts-cards-scroll {
  flex:1; min-height:0; overflow:hidden;
  container-type:size;
}
/* inner: actual scroll */
.ts-cards-scroll-inner {
  height:100%; overflow-y:scroll;
  scrollbar-width:thin;
}
.ts-cards-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  grid-auto-rows: auto;
  gap:.335rem;
  align-items: start;
}

/* ── Legend ──────────────────────────────────── */
.ts-legend { display:flex; gap:.8375rem; padding:.1675rem .1256rem; flex-shrink:0; align-items:center; }
.leg-item { font-size:.8375rem; display:flex; align-items:center; gap:.2931rem; }
.leg-dot { width:.5025rem; height:.5025rem; border-radius:50%; flex-shrink:0; }
.leg-dot.up { background:#e53935; }
.leg-dot.nc { background:#9e9e9e; }
.leg-dot.dn { background:#43a047; }
/* legend moved into the left header (right side) — compact, normal case */
.ts-legend-inline { gap:.5863rem; padding:0; text-transform:none; letter-spacing:0; flex-shrink:0; }
.ts-legend-inline .leg-item { font-size:.7119rem; font-weight:600; }
.ts-legend-inline .leg-dot { width:.5025rem; height:.5025rem; }
/* top/bottom fades on the product cards — shown only when there is more content
   in that direction, with a smooth opacity transition */
.ts-cards-fade { position:absolute; left:0; right:0; height:1.2563rem; pointer-events:none; z-index:5; opacity:0; transition:opacity .25s ease; }
.ts-cards-fade.is-on { opacity:1; }
.ts-cards-fade-top { top:0; }
.ts-cards-fade-bot { bottom:0; }
html[data-mode="light"] .ts-cards-fade-bot { background:linear-gradient(to bottom, rgba(244,246,249,0), rgba(244,246,249,0.96)); }
html[data-mode="light"] .ts-cards-fade-top { background:linear-gradient(to top,    rgba(244,246,249,0), rgba(244,246,249,0.96)); }
html[data-mode="dark"]  .ts-cards-fade-bot { background:linear-gradient(to bottom, rgba(26,29,33,0), rgba(26,29,33,0.96)); }
html[data-mode="dark"]  .ts-cards-fade-top { background:linear-gradient(to top,    rgba(26,29,33,0), rgba(26,29,33,0.96)); }
/* selectors fill their half-column */
.ts-filters-inline select { min-width:0; width:100%; }
.ts-filters-inline .ts-filter-row { min-width:0; }


/* ══ CENTER: Charts ═══════════════════════════ */
.ts-center { display:flex; flex-direction:column; gap:.4188rem; overflow:hidden; min-height:0; }
.ts-center-top  { flex:1 1 0; display:flex; flex-direction:column; min-height:0; }
.ts-center-bot  { flex:1 1 0; display:flex; flex-direction:column; min-height:0; }
.ts-chart-box   { flex:1; min-height:0; }
.ts-chart-meta  { display:flex; gap:.5025rem; padding:.2513rem .5863rem .2513rem; flex-shrink:0; align-items:center; flex-wrap:wrap; }
.ts-meta-pill {
  font-size:.6281rem; padding:.1256rem .4606rem; border-radius:.2513rem; display:flex; align-items:center; gap:.2094rem;
}
html[data-mode="dark"]  .ts-meta-pill { background:rgba(255,255,255,.08); color:#ccc; }
html[data-mode="light"] .ts-meta-pill { background:rgba(0,0,0,.06); color:#555; }
.ts-meta-select {
  font-size:.6281rem; padding:.1256rem 1.2563rem .1256rem .4606rem; border-radius:.2513rem;
  border:.0419rem solid rgba(255,255,255,.20); cursor:pointer; outline:none;
  background:rgba(255,255,255,.08) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23aaa' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right .4188rem center;
  color:#e0e0e0; backdrop-filter:blur(.1675rem);
  -webkit-appearance:none; appearance:none;
}
.ts-meta-select option { background:#2a2a2a; color:#e0e0e0; }
html[data-mode="light"] .ts-meta-select {
  background:rgba(255,255,255,.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23555' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right .4188rem center;
  color:#1a1a1a; border-color:rgba(0,0,0,.18);
}
html[data-mode="light"] .ts-meta-select option { background:#ffffff; color:#1a1a1a; }

/* ══ RIGHT panel ══════════════════════════════ */
.ts-right { display:flex; flex-direction:column; gap:.4188rem; overflow:hidden; min-height:0; }
.ts-map-box  { flex:1 1 0; display:flex; flex-direction:column; min-height:0; }
.ts-news-box { flex:1 1 0; display:flex; flex-direction:column; min-height:0; overflow:hidden; }

/* ── Map inner ───────────────────────────────── */
.ts-map-inner { flex:1; min-height:0; display:flex; flex-direction:column; }
/* soft fade while a new selection loads (no layout change: opacity only) */
#tsCards, #tsRankChart, #tsDynChart { transition: opacity .22s ease; }
#tsCards.ts-is-loading, #tsRankChart.ts-is-loading, #tsDynChart.ts-is-loading { opacity:.55; }
@media (prefers-reduced-motion: reduce) {
  #tsCards, #tsRankChart, #tsDynChart { transition: none; }
}
.ts-map-inner > div { flex:1; min-height:0; }

/* ── News digest ─────────────────────────────── */
.ts-news-header {
  display:flex; justify-content:space-between; align-items:center;
  font-size:.7119rem; font-weight:700; padding:.3769rem .5863rem .2931rem; flex-shrink:0;
  border-bottom:.0419rem solid rgba(128,128,128,.15);
}
.ts-news-pause {
  background:rgba(128,128,128,.15); border:none; border-radius:.2094rem;
  color:inherit; cursor:pointer; padding:.0838rem .3769rem; font-size:.5863rem;
  opacity:.6; transition:opacity .2s; line-height:1.6; flex-shrink:0;
}
.ts-news-pause:hover { opacity:1; }
.ts-cards-ctrl { background:transparent; border:.0419rem solid rgba(127,127,127,.35); border-radius:.1675rem; color:inherit; padding:.0838rem .335rem; font-size:.5025rem; opacity:.75; cursor:pointer; }
.ts-cards-ctrl:hover { opacity:1; }
.ts-digest-viewport {
  flex:1; min-height:0; overflow:hidden; position:relative;
  --ts-dbg:#242424;
}
.ts-digest-viewport::before,
.ts-digest-viewport::after {
  content:""; position:absolute; left:0; right:0;
  height:25%; min-height:2.0938rem; max-height:3.7688rem; z-index:2; pointer-events:none;
}
.ts-digest-viewport::before {
  top:0;
  background:linear-gradient(to bottom, var(--ts-dbg) 0%, transparent 100%);
}
.ts-digest-viewport::after {
  bottom:0;
  background:linear-gradient(to top, var(--ts-dbg) 0%, transparent 100%);
}
html[data-mode="light"] .ts-digest-viewport { --ts-dbg:#fff; }
html[data-mode="light"] .ts-digest-viewport::before {
  background:linear-gradient(to bottom, #fff 0%, transparent 100%);
}
html[data-mode="light"] .ts-digest-viewport::after {
  background:linear-gradient(to top, #fff 0%, transparent 100%);
}
.ts-digest-list {
  list-style:none; padding:0 .335rem; margin:0;
  transition:transform 0.6s ease;
}
.ts-digest-item {
  height:3.1825rem; display:flex; align-items:center; gap:.5025rem;
  padding:.2513rem .5025rem; box-sizing:border-box;
  border-radius:.1675rem; font-size:.8794rem; font-weight:600; line-height:1.35;
  color:#94a3b8;
  transition:all .4s ease; cursor:default;
}
html[data-mode="light"] .ts-digest-item { color:#475569; }
.ts-digest-item.ts-active {
  background-color:rgba(31,111,235,.10);
  box-shadow:inset .1256rem 0 0 #1f6feb;
}
html[data-mode="light"] .ts-digest-item.ts-active { background-color:rgba(31,111,235,.08); }
.ts-digest-item.up .d-icon,
.ts-digest-item.up b, .ts-digest-item.up strong { color:#f87171; }
.ts-digest-item.down .d-icon,
.ts-digest-item.down b, .ts-digest-item.down strong { color:#4ade80; }
html[data-mode="light"] .ts-digest-item.up .d-icon,
html[data-mode="light"] .ts-digest-item.up b,
html[data-mode="light"] .ts-digest-item.up strong { color:#dc2626; }
html[data-mode="light"] .ts-digest-item.down .d-icon,
html[data-mode="light"] .ts-digest-item.down b,
html[data-mode="light"] .ts-digest-item.down strong { color:#16a34a; }
.ts-digest-item .d-icon {
  flex-shrink:0; width:.9213rem; height:.9213rem; font-size:.7119rem;
  display:flex; align-items:center; justify-content:center;
  transition:transform .4s;
}
.ts-digest-item.ts-active .d-icon { transform:scale(1.2); }

/* ── Skeleton shimmer ────────────────────── */
@keyframes tsSpin { to { transform:rotate(360deg); } }
@keyframes ts-skel-shine {
  0%   { background-position:200% 0; }
  100% { background-position:-200% 0; }
}
.ts-skel {
  border-radius:.1675rem;
  background:linear-gradient(90deg,#ddd 25%,#ebebeb 50%,#ddd 75%);
  background-size:200% 100%;
  animation:ts-skel-shine 1.4s linear infinite;
}
html[data-mode="dark"] .ts-skel {
  background:linear-gradient(90deg,#2d2d2d 25%,#3c3c3c 50%,#2d2d2d 75%);
  background-size:200% 100%;
}
.ts-card-skel { pointer-events:none; }
.ts-skel-row { display:flex; justify-content:space-between; align-items:center; margin-bottom:.2931rem; }
.ts-skel-block { display:block; }
.ts-skel-fill { width:100%; height:100%; min-height:2.5125rem; border-radius:.1675rem; }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */

/* ── ≥1720px: larger fonts for right panel & chart titles ── */
@media (min-width:1720px) {
  .ts-box-title      { font-size:1.0888rem; padding:.4606rem .67rem .3769rem; }
  .ts-news-header    { font-size:1.0888rem; padding:.4606rem .67rem .3769rem; }
  .ts-digest-item    { font-size:1.005rem; height:3.7688rem; }
  .ts-digest-item .d-icon { width:1.1725rem; height:1.1725rem; font-size:.9213rem; }
  .ts-meta-select    { font-size:.7956rem; padding:.1675rem 1.4238rem .1675rem .5444rem; }
  .ts-big-title      { font-size:1.7588rem; }
  .ts-filters label  { font-size:.7538rem; }
  .ts-filters select { font-size:.9213rem; padding:.2513rem .5025rem; }
}

/* ── Below 1720px: revert card fonts to medium sizes ── */
@media (max-width:1719px) {
  .ts-left-header        { font-size:.7119rem; }
  .leg-item              { font-size:.67rem; }
  .ts-box-title          { font-size:.7119rem; }
}

/* ── Notebook: 1500px and below — reduce card metric fonts to prevent overflow ── */
@media (max-width:1500px) {
}

/* ── Tablet: 1200px and below — 2-col, right goes full-row below ── */
@media (max-width:1199px) {
  body.horizontal .wrapper.d-flex.flex-column.min-vh-100 {
    overflow:auto;
    height:auto !important;
    max-height:none;
  }
  .ts-page { overflow:auto; min-height:auto; }
  /* body has two columns here: selectors above the cards, title above the charts */
  .ts-title-bar { grid-template-columns:1fr 1fr; }
  .ts-body {
    grid-template-columns:1fr 1fr;
    grid-template-rows:auto auto;
    overflow:visible;
  }
  .ts-left   { grid-column:1; grid-row:1; min-height:21.775rem; }
  .ts-center { grid-column:2; grid-row:1; min-height:21.775rem; }
  .ts-right  { grid-column:1/-1; grid-row:2; flex-direction:row; gap:.4188rem; min-height:13.4rem; }
  .ts-map-box  { flex:1 1 0; height:auto; }
  .ts-news-box { flex:1 1 0; height:auto; }
  /* cards: fixed height so cqh works */
  .ts-cards-scroll { height:15.9125rem; }
  /* chart sections: fixed height */
  .ts-center-top, .ts-center-bot { flex:none; height:10.4688rem; }
}

/* ── Tablets (768-1199px): map + news side by side at a fixed height, the
   news list scrolling in its box instead of stretching the row (and the map
   with it); the two charts keep the site's standard box height (as on
   phones) and the product cards next to them grow to the same height ── */
@media (min-width:768px) and (max-width:1199px) {
  .ts-right    { height:26rem; min-height:0; }
  .ts-map-box  { height:100%; min-height:0; }
  .ts-news-box { height:100%; min-height:0; }
  .ts-center-top, .ts-center-bot { flex:none; height:27.2188rem; }
}

/* ══════════════════════════════════════════════
   MOBILE  ≤ 767px
   ══════════════════════════════════════════════ */
@media (max-width:767px) {

  /* ── 1. Unlock wrapper scroll ── */
  body.horizontal .wrapper.d-flex.flex-column.min-vh-100 {
    overflow-x:hidden;
    overflow-y:auto;
    height:auto       !important;
    max-height:none;
    padding-top:calc(var(--topnav-height, 2.5125rem) + .2513rem) !important;
  }

  /* ── 2. Page shell: leave flex-column, but natural height ── */
  .ts-page {
    overflow:visible;
    height:auto      !important;
    min-height:auto;
    flex:none;
  }

  /* ── 3. Title bar ── */
  .ts-big-title {
    font-size:.5863rem; padding:.2094rem .4188rem;
    letter-spacing:0; line-height:1.3;
  }
  .ts-title-bar {
    grid-template-columns:1fr;
    gap:.2513rem; padding:.2513rem .4188rem;
  }
  .ts-title-bar > .ts-title-text { grid-column:auto; }
  .ts-filter-group { grid-template-columns:1fr; gap:.335rem; }
  .ts-title-text {
    order:-1;
    font-size:.6281rem; padding:0 .5025rem;
    text-align:center; letter-spacing:0;
  }
  .ts-filters.ts-filters-inline {
    order:0;
    grid-template-columns:1fr 1fr;
    gap:.335rem .4188rem;
  }
  .ts-filters-inline .ts-filter-row {
    width:100%; box-sizing:border-box;
    flex-direction:column; align-items:stretch; gap:.1256rem;   /* label above the selector */
  }
  .ts-filters-inline label { font-size:.4606rem; }
  .ts-filters-inline select { font-size:.6281rem; }

  /* ── 4. Body → single column ── */
  .ts-body {
    display:flex;
    flex-direction:column;
    gap:.4188rem;
    padding:.335rem;
    overflow:visible;
    flex:none;
  }
  .ts-left {
    overflow:visible;
    overflow-x:visible;
    min-height:auto;
    flex:none;
  }
  .ts-center, .ts-right {
    overflow:visible;
    min-height:auto;
    flex:none;
  }

  /* ── 5. Filters: side-by-side (stays compact) ── */
  .ts-filters { flex-direction:row; gap:.2513rem; padding:.2513rem .1675rem .335rem; }
  .ts-filter-row { flex:1; }
  .ts-filters label  { font-size:.4188rem; }
  .ts-filters select { font-size:.5444rem; padding:.2094rem .335rem; }

  /* ── 6. Left header & legend ── stack so the title + 3-colour legend always fit ── */
  .ts-left-header { font-size:.5025rem; padding:.1256rem; flex-direction:column; align-items:stretch !important; gap:.1675rem !important; }
  /* left-align the box title ("mahsulotlar narxi va narx o'zgarishi"), like the legend */
  .ts-left-header > span { align-self:flex-start; text-align:left; width:100%; }
  .ts-legend      { gap:.4188rem .5863rem; flex-wrap:wrap; width:100% !important; padding:.1256rem; justify-content:flex-start; }
  .ts-legend .leg-item, .ts-legend-inline .leg-item { font-size:.4606rem; gap:.2094rem; flex:0 0 auto; }
  .leg-dot  { width:.3769rem; height:.3769rem; }

  /* ── 7. Cards: horizontal snap carousel ── */
  .ts-cards-scroll {
    overflow-x:auto;
    overflow-y:hidden;
    height:auto          !important;
    container-type:normal;
    flex:none;
    scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
    padding-bottom:.2513rem;
  }
  .ts-cards-scroll::-webkit-scrollbar { display:none; }
  .ts-cards-scroll-inner {
    height:auto     !important;
    overflow:visible;
  }
  .ts-cards-grid {
    display:flex;
    flex-direction:row;
    flex-wrap:nowrap;
    grid-template-columns:unset;
    gap:.335rem;
    padding:.0838rem .335rem .1675rem;
    width:max-content;
  }
  .ts-card {
    width:calc(80vw - .67rem);
    flex-shrink:0;
    scroll-snap-align:start;
    min-height:auto; height:auto;
  }

  /* ── 8. Box chrome ── */
  .ts-box-title { font-size:.5444rem; padding:.2513rem .4188rem .2094rem; }
  .ts-fs-btn    { display:none; }

  /* ── 9. Center: stacked charts ── */
  .ts-center     { gap:.335rem; overflow:visible; min-height:auto; }
  .ts-center-top { flex:none; height:27.2188rem; }   /* match kutilmalar box height */
  .ts-center-bot { flex:none; height:27.2188rem; }
  .ts-chart-meta { padding:.335rem .335rem .1675rem; gap:.2513rem; flex-wrap:wrap; }
  /* width hugs the text; keep room for the arrow so it doesn't sit on the text;
     padding-top above gives the selectors a gap from the box-title border. */
  .ts-meta-select { font-size:.4606rem; padding:.1256rem .9213rem .1256rem .3769rem; width:auto; flex:0 0 auto;
    background-position:right .2931rem center; }

  /* ── 10. Right: map + news stacked ── */
  .ts-right   { flex-direction:column; gap:.335rem; overflow:visible; }
  .ts-map-box { flex:none; height:27.2188rem; }    /* match kutilmalar box height */
  .ts-news-box{ flex:none; height:27.2188rem; min-height:27.2188rem; }

  /* ── 11. News ── */
  .ts-news-header { font-size:.5444rem; padding:.2513rem .4188rem .2094rem; }
  .ts-news-pause  { font-size:.4606rem; padding:.0838rem .2513rem; }
  .ts-cards-controls { display:flex !important; }
  .ts-cards-ctrl { font-size:.4606rem; padding:.0838rem .2931rem; }
  .ts-digest-item { font-size:.5444rem; height:2.5125rem; gap:.335rem; padding:.2094rem .4188rem; }
  .ts-digest-item .d-icon { width:.67rem; height:.67rem; font-size:.5444rem; }
}

/* ── Product cards ───────────────────────────────────────────────────────
   Same panel as the page's boxes. */
.ts-card {
  position: relative;
  display: flex; flex-direction: column; gap: .5025rem;
  padding: .7538rem;
  border-radius: .5025rem;
  border: .0419rem solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 .0419rem .0838rem rgba(0,0,0,.04), 0 .1675rem .5025rem rgba(0,0,0,.06);
  overflow: hidden;
  transition: box-shadow .15s ease, transform .15s ease;
}
.ts-card:hover { transform: translateY(-.0838rem); box-shadow: 0 .2513rem .7538rem rgba(26,43,75,.14); }
.ts-card hr { border: none; border-top: .0419rem solid rgba(128,128,128,.2); margin: .0838rem 0; }
html[data-mode="dark"] .ts-card {
  background: rgba(255,255,255,.04);
  border-color: rgba(127,127,127,.18);
  box-shadow: none;
  -webkit-font-smoothing: antialiased;
}
html[data-mode="dark"] .ts-card:hover { background: rgba(255,255,255,.07); box-shadow: 0 .1675rem .5863rem rgba(0,0,0,.30); }

/* name + unit: the name is a navy tag (6px corners, like the supermarket badges) */
.ts-card-name-row {
  align-self: flex-start;
  max-width: calc(100% - 3.015rem);     /* room for the unit badge */
  padding: .2094rem .4188rem; border-radius: .2513rem;
  font-size: .7956rem; font-weight: 700; line-height: 1.2;
  background: #1A2B4B; color: #ffffff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* dark: neutral light tag (green/red already mean down/up on the card) */
html[data-mode="dark"] .ts-card-name-row { background: rgba(255,255,255,.12); color: #ffffff; box-shadow: inset 0 0 0 .0419rem rgba(255,255,255,.14); }
.ts-unit-badge {
  position: absolute; top: .8375rem; right: .7538rem;
  font-size: .5444rem; font-weight: 700; line-height: 1.2;
  padding: .1256rem .335rem; border-radius: .2513rem;
  background: #f1f5f9; color: #334155; border: .0419rem solid #e2e8f0;
  pointer-events: none;
}
html[data-mode="dark"] .ts-unit-badge { background: rgba(255,255,255,.08); color: #e2e8f0; border-color: rgba(255,255,255,.12); }

/* price */
.ts-card-price-row {
  display: flex; align-items: baseline; gap: .335rem;
  padding-bottom: .5025rem; border-bottom: .0419rem solid #eef2f6;
}
html[data-mode="dark"] .ts-card-price-row { border-bottom-color: rgba(255,255,255,.08); }
.ts-card-price { font-size: 1.2563rem; font-weight: 800; line-height: 1; color: #0f172a; }
html[data-mode="dark"] .ts-card-price { color: #f1f5f9; }
.ts-card-unit-block { display: flex; flex-direction: column; line-height: 1.3; }
.ts-card-unit { font-size: .67rem; font-weight: 600; color: #475569; }
html[data-mode="dark"] .ts-card-unit { color: #cbd5e1; }

/* trend icon (inline SVG — the old ↗ ↘ → characters turned into emoji on iOS) */
.ts-trend-ico { width: .8em; height: .8em; flex: 0 0 auto; }

/* weekly / year-to-date */
.ts-card-pills { display: grid; grid-template-columns: 1fr 1fr; gap: .4188rem; }
.ts-mpill {
  display: flex; flex-direction: column; gap: .1675rem;
  padding: .4188rem .5025rem; border-radius: .335rem;
  border: .0419rem solid #e2e8f0; background: #f8fafc;
}
.ts-mpill-up { background: #fef2f2; border-color: #fecaca; }
.ts-mpill-dn { background: #f0fdf4; border-color: #bbf7d0; }
html[data-mode="dark"] .ts-mpill    { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.10); }
html[data-mode="dark"] .ts-mpill-up { background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.28); }
html[data-mode="dark"] .ts-mpill-dn { background: rgba(74,222,128,.10);  border-color: rgba(74,222,128,.26); }
.ts-mpill-lbl { font-size: .6281rem; font-weight: 600; color: #475569; }
html[data-mode="dark"] .ts-mpill-lbl { color: #cbd5e1; }
.ts-mpill-val { display: inline-flex; align-items: center; gap: .2513rem; font-size: .8794rem; font-weight: 800; color: #475569; }
.ts-mpill-up .ts-mpill-val { color: #dc2626; }
.ts-mpill-dn .ts-mpill-val { color: #16a34a; }
html[data-mode="dark"] .ts-mpill-val { color: #cbd5e1; }
html[data-mode="dark"] .ts-mpill-up .ts-mpill-val { color: #f87171; }
html[data-mode="dark"] .ts-mpill-dn .ts-mpill-val { color: #4ade80; }

/* deviation from the cheapest price (always >= 0: red when above, gray at 0);
   same tile as the weekly / year-to-date ones */
.ts-card-comp { display: flex; flex-direction: column; gap: .335rem; }
.ts-comp-item {
  display: flex; flex-direction: column; gap: .1675rem;
  padding: .4188rem .5025rem; border-radius: .335rem;
  border: .0419rem solid #e2e8f0; background: #f8fafc;
}
.ts-comp-up { background: #fef2f2; border-color: #fecaca; }
.ts-comp-dn { background: #f0fdf4; border-color: #bbf7d0; }
html[data-mode="dark"] .ts-comp-item { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.10); }
html[data-mode="dark"] .ts-comp-up { background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.28); }
html[data-mode="dark"] .ts-comp-dn { background: rgba(74,222,128,.10);  border-color: rgba(74,222,128,.26); }
.ts-comp-label { font-size: .5863rem; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: #475569; }
html[data-mode="dark"] .ts-comp-label { color: #cbd5e1; }
.ts-comp-bottom { display: flex; align-items: baseline; gap: .335rem; flex-wrap: wrap; }
.ts-comp-val { display: inline-flex; align-items: center; gap: .2513rem; font-size: .8794rem; font-weight: 800; color: #475569; }
.ts-comp-val-up { color: #dc2626; }
.ts-comp-val-dn { color: #16a34a; }
html[data-mode="dark"] .ts-comp-val { color: #cbd5e1; }
html[data-mode="dark"] .ts-comp-val-up { color: #f87171; }
html[data-mode="dark"] .ts-comp-val-dn { color: #4ade80; }
.ts-comp-nom { font-size: .6281rem; color: #475569; }
html[data-mode="dark"] .ts-comp-nom { color: #cbd5e1; }
.ts-card .ts-nom { display: none; }

@media (max-width: 767px) {
  .ts-card { padding: .5863rem; gap: .4188rem; }
  .ts-unit-badge { top: .5863rem; right: .5863rem; }
}

/* ── Print / PDF ── */
@page { size:A4 landscape; margin:8mm; }
@media print {
  *{-webkit-print-color-adjust:exact;print-color-adjust:exact;}
  body{background:#f3f4f6 !important;}
  body.horizontal .wrapper{padding-top:0 !important;height:auto !important;overflow:visible;}
  nav.navbar{display:none;}
  footer{display:none;}
  .ts-page{display:block;overflow:visible;height:auto !important;}
  .ts-filters-inline{display:none;}
  .ts-body{display:grid;grid-template-columns:42% 29% 29%;gap:.2513rem;overflow:visible;height:auto !important;min-height:0;}
  .ts-left,.ts-center,.ts-right{overflow:visible;height:auto !important;}
  .ts-cards-scroll{overflow:visible;height:auto !important;container-type:normal;}
  .ts-cards-scroll-inner{overflow:visible;height:auto !important;}
  .ts-cards-grid{grid-template-columns:1fr 1fr;grid-auto-rows:auto;gap:.2094rem;}
  .ts-card{break-inside:avoid;page-break-inside:avoid;}
  .ts-box{overflow:visible;height:auto !important;break-inside:avoid;}
  .ts-chart-box,.ts-map-inner>div{height:9.2125rem !important;}
  .ts-center-top,.ts-center-bot{height:auto !important;flex:none;}
  .ts-map-box{height:auto !important;flex:none;}
  .ts-news-box{height:10.4688rem !important;overflow:hidden;}
  .ts-digest-viewport{height:8.375rem !important;}
  button,.ts-fs-btn,.ts-news-pause,.ts-cards-ctrl,#tsPdfBtn{display:none !important;}
  .ts-legend{padding:.0838rem .1256rem;}
}

/* ── JS PDF capture mode ── */
body.ts-pdf-mode .wrapper.d-flex.flex-column.min-vh-100{padding-top:0 !important;height:auto !important;overflow:visible !important;max-height:none !important;}
body.ts-pdf-mode nav.navbar{display:none !important;}
body.ts-pdf-mode .ts-page{display:block !important;overflow:visible !important;height:auto !important;}
body.ts-pdf-mode .ts-filters-inline{display:none !important;}
body.ts-pdf-mode .ts-body{display:grid !important;grid-template-columns:42% 29% 29% !important;gap:.2513rem !important;overflow:visible !important;height:auto !important;min-height:0 !important;}
body.ts-pdf-mode .ts-left,body.ts-pdf-mode .ts-center,body.ts-pdf-mode .ts-right{overflow:visible !important;height:auto !important;}
body.ts-pdf-mode .ts-cards-scroll{overflow:visible !important;height:auto !important;container-type:normal;}
body.ts-pdf-mode .ts-cards-scroll-inner{overflow:visible !important;height:auto !important;}
body.ts-pdf-mode .ts-cards-grid{grid-template-columns:1fr 1fr !important;grid-auto-rows:auto;gap:.2094rem !important;}
body.ts-pdf-mode .ts-box{overflow:visible !important;height:auto !important;}
body.ts-pdf-mode .ts-chart-box,body.ts-pdf-mode .ts-map-inner>div{height:9.2125rem !important;}
body.ts-pdf-mode .ts-center-top,body.ts-pdf-mode .ts-center-bot{height:auto !important;flex:none !important;}
body.ts-pdf-mode .ts-map-box{height:auto !important;flex:none !important;}
body.ts-pdf-mode .ts-news-box{height:10.4688rem !important;overflow:hidden !important;}
body.ts-pdf-mode .ts-digest-viewport{height:8.375rem !important;overflow:hidden !important;}
body.ts-pdf-mode #tsDigestList{transform:none !important;transition:none !important;}
body.ts-pdf-mode .ts-digest-item{height:auto !important;min-height:1.8425rem !important;overflow:hidden !important;transition:none !important;border-bottom:.0419rem solid rgba(128,128,128,.10) !important;}
body.ts-pdf-mode .ts-digest-viewport::before,body.ts-pdf-mode .ts-digest-viewport::after{display:none !important;}
body.ts-pdf-mode button,body.ts-pdf-mode .ts-fs-btn,body.ts-pdf-mode .ts-news-pause,body.ts-pdf-mode .ts-cards-ctrl,body.ts-pdf-mode #tsPdfBtn{display:none !important;}
body.ts-pdf-mode .ts-legend{padding:.0838rem .1256rem !important;}

/* ━━━ TYPOGRAPHY STANDARD ━━━ */
html[data-mode="light"]{--ts-ink:#1e293b;--ts-ink2:#475569;--ts-ink3:#64748b;--ts-accent:#1A2B4B;}
html[data-mode="dark"] {--ts-ink:#e2e8f0;--ts-ink2:#94a3b8;--ts-ink3:#64748b;--ts-accent:#93c5fd;}
html[data-mode="light"] .ts-box-title,html[data-mode="light"] .ts-news-header{font-size:.8794rem;font-weight:700;color:#fff;letter-spacing:.3px;}
html[data-mode="dark"]  .ts-box-title,html[data-mode="dark"]  .ts-news-header{font-size:.8794rem;font-weight:700;color:var(--ts-ink);}
.ts-big-title  {font-size:.9213rem;font-weight:800;}
.ts-title-text {font-size:.9213rem;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.ts-left-header{font-size:.7538rem;font-weight:700;}
html[data-mode="light"] .ts-left-header{color:var(--ts-ink);}
html[data-mode="dark"]  .ts-left-header{color:var(--ts-ink);}

/* Dark mode: product-card texts + section header/legend in white (were grey) */
html[data-mode="dark"] .ts-left-header,
html[data-mode="dark"] .ts-left-header span,
html[data-mode="dark"] .ts-legend .leg-item span { color:#ffffff; opacity:1; }
.ts-digest-item{font-size:.7956rem;font-weight:500;}
.ts-meta-pill  {font-size:.67rem;}
.ts-meta-select{font-size:.67rem;}
html[data-mode="light"] #tsRankTitle,html[data-mode="light"] #tsDynTitle{font-size:.7538rem;font-weight:700;color:#ffffff;}
html[data-mode="dark"]  #tsRankTitle,html[data-mode="dark"]  #tsDynTitle{font-size:.7538rem;font-weight:700;}
.ts-filters-inline label {font-size:.5444rem;}
.ts-filters-inline select{font-size:.6281rem;padding-right:1.2563rem;appearance:none;-webkit-appearance:none;}
html[data-mode="light"] .ts-filters-inline label {color:#1A2B4B;}
html[data-mode="light"] .ts-filters-inline select{color:#1A2B4B;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%231A2B4B' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right .335rem center;}
html[data-mode="light"] .ts-title-text{color:#1A2B4B;}
html[data-mode="dark"] .ts-filters-inline select{color:#e0e0e0;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23e0e0e0' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right .335rem center;}
html[data-mode="light"] body.horizontal .wrapper{background:transparent !important;}  /* bg image from fixed ::before layer */
html[data-mode="light"] .ts-big-title{color:#1A2B4B;}
html[data-mode="light"] .ts-box{background:#ffffff;border:.0419rem solid #e5e7eb;box-shadow:0 .0419rem .0838rem rgba(0,0,0,.04),0 .1675rem .5025rem rgba(0,0,0,.06);}
html[data-mode="light"] .ts-box-title{background:#1A2B4B;color:#ffffff;border-bottom:.0419rem solid rgba(255,255,255,.12);}
html[data-mode="light"] .ts-fs-btn{border-color:rgba(255,255,255,.30);color:rgba(255,255,255,.80);}
html[data-mode="light"] .ts-fs-btn:hover{background:rgba(255,255,255,.18) !important;opacity:1 !important;}
html[data-mode="light"] .ts-news-header{background:#1A2B4B;color:#ffffff;border-bottom:.0419rem solid rgba(255,255,255,.12);opacity:1;}
html[data-mode="light"] .ts-news-pause{background:rgba(255,255,255,.15);color:rgba(255,255,255,.85);}
html[data-mode="light"] .ts-news-pause:hover{background:rgba(255,255,255,.25) !important;}
.ts-filters select:focus{border-color:#2D4F8A !important;}
html[data-mode="light"] .ts-filters select:focus{border-color:#1A2B4B !important;}
.ts-digest-item.ts-active{background-color:rgba(26,43,75,.10);box-shadow:inset .1256rem 0 0 #1A2B4B;}
html[data-mode="light"] .ts-digest-item.ts-active{background-color:rgba(26,43,75,.08);box-shadow:inset .1256rem 0 0 #1A2B4B;}
html[data-mode="light"] .ts-digest-item:hover{background:rgba(26,43,75,.06) !important;color:#1A2B4B !important;}
html[data-mode="light"] .ts-meta-pill{background:rgba(26,43,75,.07);color:#1A2B4B;}
/* dark mode digest active */
html[data-mode="dark"] .ts-digest-item.ts-active{background-color:rgba(76,175,80,.12);box-shadow:inset .1256rem 0 0 #4caf50;color:#ffffff;}
/* active: gray text -> white, but keep up/down numbers colored */
html[data-mode="dark"] .ts-digest-item.ts-active.up b,html[data-mode="dark"] .ts-digest-item.ts-active.up strong,html[data-mode="dark"] .ts-digest-item.ts-active.up .d-icon{color:#f87171;}
html[data-mode="dark"] .ts-digest-item.ts-active.down b,html[data-mode="dark"] .ts-digest-item.ts-active.down strong,html[data-mode="dark"] .ts-digest-item.ts-active.down .d-icon{color:#4ade80;}
html[data-mode="dark"] .ts-digest-item:hover{background:rgba(76,175,80,.07) !important;}

/* ━━━ DARK MODE — transparent wrapper + translucent boxes (kutilmalar kabi) ━━━ */
html[data-mode="dark"] body.horizontal .wrapper {
  background:transparent !important;   /* bg image comes from the fixed ::before layer */
}
/* box transparency matched to kutilmalar (.box-card dark) so the bg image shows through */
html[data-mode="dark"] .ts-box {
  background:rgba(255,255,255,0.04);
  border:.0419rem solid rgba(127,127,127,.18);
  box-shadow:none;
}
/* box title — dark: transparent header like the landing page's boxes */
html[data-mode="dark"] .ts-box-title,
html[data-mode="dark"] .ts-news-header {
  background:transparent;
  color:#e0e0e0;
  border-bottom:.0419rem solid rgba(255,255,255,.08);
}
/* tsRankTitle, tsDynTitle text color */
html[data-mode="dark"] #tsRankTitle,
html[data-mode="dark"] #tsDynTitle { color:#e0e0e0; }
/* title bar */
html[data-mode="dark"] .ts-big-title { color:#f0f0f0; }
html[data-mode="dark"] .ts-title-text { color:#f1f5f9; }
/* meta pills / selects */
html[data-mode="dark"] .ts-meta-pill {
  background:#2a2a2a; color:#bbb;
  border:.0419rem solid rgba(255,255,255,.12);
}
html[data-mode="dark"] .ts-meta-select {
  background:#2a2a2a; color:#e0e0e0;
  border-color:rgba(255,255,255,.18);
}
/* filter labels */
html[data-mode="dark"] .ts-filters-inline label { color:#e2e8f0; }
html[data-mode="dark"] .ts-filters-inline select { color:#e0e0e0; }
/* digest items */
html[data-mode="dark"] .ts-digest-item { color:#d1d5db; }
/* fs button */
html[data-mode="dark"] .ts-fs-btn { color:#ccc; border-color:rgba(255,255,255,.25); }
html[data-mode="dark"] .ts-fs-btn:hover { background:rgba(255,255,255,.12) !important; }
/* news pause/play */
html[data-mode="dark"] .ts-news-pause { background:rgba(255,255,255,.10); color:#ccc; }
/* scrollbar */
html[data-mode="dark"] .ts-cards-scroll::-webkit-scrollbar-thumb { background:rgba(255,255,255,.18); }


/* ── moved from inline style attributes ── */
.ts-left-header.is-split { display:flex; justify-content:space-between; align-items:center; gap:.335rem; }
.ts-left-title { display:flex; align-items:center; gap:.5863rem; }
.ts-cards-controls.has-gap { gap:.2094rem; }
.ts-cards-scroll.is-layered { position:relative; isolation:isolate; }
.ts-cards-empty { grid-column:1/-1; text-align:center; padding:1.2563rem; opacity:.35; font-size:.5025rem; }
.ts-cards-spinner { position:absolute; inset:0; z-index:20; background:rgba(0,0,0,.45); border-radius:.2513rem; align-items:center; justify-content:center; }
.ts-spinner { width:1.8425rem; height:1.8425rem; border:.2094rem solid rgba(255,255,255,.3); border-top-color:#fff; border-radius:50%; animation:tsSpin .7s linear infinite; }
.ts-box.ts-box-fill { flex:1; min-height:0; }
.ts-box.ts-box-fill-col { flex:1; min-height:0; display:flex; flex-direction:column; }
.ts-news-actions { display:flex; gap:.2094rem; }
