.tdcp-wrap,
.tdcp-wrap * {
  box-sizing: border-box;
}

.tdcp-wrap {
  --tdcp-accent: #d21a34;
  --tdcp-text: #17181c;
  --tdcp-muted: #6f7480;
  --tdcp-line: #eceef2;
  --tdcp-soft: #f6f7f9;
  --tdcp-radius: 24px;
  width: 100%;
  color: var(--tdcp-text);
  font-family: inherit;
}

.tdcp-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(28px, 4vw, 54px);
  overflow: hidden;
  border: 1px solid var(--tdcp-line);
  border-radius: 32px;
  background:
    radial-gradient(circle at 8% 10%, color-mix(in srgb, var(--tdcp-accent) 12%, transparent), transparent 36%),
    linear-gradient(135deg, #fff 0%, #f8f8fa 100%);
  box-shadow: 0 18px 55px rgba(20, 22, 30, 0.06);
}

.tdcp-hero::after {
  content: "۷۷۷ پریمیوم";
  position: absolute;
  left: clamp(24px, 5vw, 45px);
  bottom: 136px;
  color: rgba(210, 26, 52, 0.045);
  font-size: clamp(110px, 8vw, 240px);
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.tdcp-hero__content,
.tdcp-update-box {
  position: relative;
  z-index: 1;
}

.tdcp-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 5px 14px;
  color: var(--tdcp-accent);
  border: 1px solid color-mix(in srgb, var(--tdcp-accent) 24%, transparent);
  border-radius: 50px;
  background: color-mix(in srgb, var(--tdcp-accent) 6%, #fff);
  font-size: 13px;
  font-weight: 700;
}

.tdcp-title {
  margin: 14px 0 8px;
  color: var(--tdcp-text);
  font-size: clamp(30px, 3vw, 54px);
  line-height: 1.25;
  font-weight: 900;
}

.tdcp-subtitle {
  margin: 0;
  color: var(--tdcp-muted);
  font-size: clamp(12px, 1.1vw, 15px);
  line-height: 1.9;
}

.tdcp-update-box {
  display: flex;
  min-width: min(100%, 270px);
  flex-direction: column;
  gap: 8px;
  padding: 21px 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background: #17181c;
  color: #fff;
  box-shadow: 0 16px 36px rgba(17, 18, 24, 0.16);
}

.tdcp-update-box__label {
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
}

.tdcp-update-box strong {
  font-size: 15px;
  font-weight: 800;
}

.tdcp-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.tdcp-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 82px;
  padding: 18px 22px;
  border: 1px solid var(--tdcp-line);
  border-radius: 20px;
  background: #fff;
}

.tdcp-stat span {
  color: var(--tdcp-muted);
  font-size: 13px;
}

.tdcp-stat strong {
  color: var(--tdcp-text);
  font-size: clamp(22px, 2vw, 34px);
  font-weight: 900;
}

.tdcp-toolbar {
  position: sticky;
  z-index: 20;
  top: 16px;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--tdcp-line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 40px rgba(20, 22, 30, 0.08);
  backdrop-filter: blur(14px);
}

.tdcp-search {
  position: relative;
  display: flex;
  align-items: center;
}

.tdcp-search svg {
  position: absolute;
  right: 18px;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: #8a8f99;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.tdcp-search input,
.tdcp-filters select {
  width: 100%;
  min-height: 52px;
  border: 1px solid #e3e5e9;
  outline: none;
  border-radius: 50px;
  background: #fafbfc;
  color: var(--tdcp-text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.tdcp-search input {
  padding: 0 52px 0 44px;
}

.tdcp-search input:focus,
.tdcp-filters select:focus {
  border-color: color-mix(in srgb, var(--tdcp-accent) 55%, #ddd);
  background: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tdcp-accent) 10%, transparent);
}

.tdcp-search-clear {
  position: absolute;
  left: 12px;
  display: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #eceef2;
  color: #555b66;
  cursor: pointer;
  font-size: 20px;
  line-height: 30px;
}

.tdcp-search-clear.is-visible {
  display: block;
}

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

.tdcp-filters label {
  display: grid;
  gap: 7px;
}

.tdcp-filters label > span {
  padding-right: 8px;
  color: var(--tdcp-muted);
  font-size: 11px;
  font-weight: 700;
}

.tdcp-filters select {
  padding: 0 16px 0 38px;
  cursor: pointer;
}

.tdcp-result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 6px 12px;
  color: var(--tdcp-muted);
  font-size: 13px;
}

.tdcp-result-bar strong {
  color: var(--tdcp-text);
}

.tdcp-reset-filters {
  display: none;
  padding: 7px 14px;
  border: 0;
  border-radius: 50px;
  background: #f1f2f4;
  color: #555b65;
  cursor: pointer;
  font-family: inherit;
}

.tdcp-wrap.has-active-filter .tdcp-reset-filters {
  display: inline-flex;
}

.tdcp-table {
  overflow: hidden;
  border: 1px solid var(--tdcp-line);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 16px 48px rgba(22, 24, 33, 0.055);
}

.tdcp-table-head,
.tdcp-row {
  display: grid;
  grid-template-columns: minmax(250px, 1.55fr) minmax(68px, 0.42fr) repeat(4, minmax(145px, 0.9fr));
  align-items: center;
  gap: 14px;
  text-align: center;
}

.tdcp-table-head {
  min-height: 58px;
  padding: 0 24px;
  background: #17181c;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 700;
}

.tdcp-row {
  min-height: 112px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--tdcp-line);
  transition: background 0.2s ease, transform 0.2s ease;
}

.tdcp-row:last-child {
  border-bottom: 0;
}

.tdcp-row:hover {
  background: #fcfcfd;
}

.tdcp-row[hidden] {
  display: none !important;
}

.tdcp-car {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  text-align: right;
}

.tdcp-car__brand {
  color: var(--tdcp-accent);
  font-size: 11px;
  font-weight: 800;
}

.tdcp-car__title {
  overflow: hidden;
  color: var(--tdcp-text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.7;
  text-overflow: ellipsis;
}

.tdcp-car__meta {
  width: fit-content;
  padding: 4px 9px;
  border-radius: 50px;
  background: var(--tdcp-soft);
  color: var(--tdcp-muted);
  font-size: 10px;
}

.tdcp-cell {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.tdcp-cell small {
  color: #969aa2;
  font-size: 10px;
}

.tdcp-year {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 58px;
  min-height: 34px;
  padding: 4px 11px;
  border: 1px solid var(--tdcp-line);
  border-radius: 50px;
  background: #fff;
  font-size: 13px;
  font-weight: 800;
}

.tdcp-price,
.tdcp-difference {
  white-space: nowrap;
  font-size: clamp(12px, 0.95vw, 15px);
  font-weight: 900;
}

.tdcp-price.is-empty,
.tdcp-empty {
  color: #a5a9b1;
  font-weight: 500;
}

.tdcp-difference.is-positive {
  color: #bc5a0a;
}

.tdcp-difference.is-negative {
  color: #12845c;
}

.tdcp-change {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 72px;
  padding: 7px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 900;
}

.tdcp-change.is-up {
  background: #fff0f1;
  color: #c42139;
}

.tdcp-change.is-down {
  background: #e9f8f1;
  color: #147f5b;
}

.tdcp-change.is-flat {
  background: #f2f3f5;
  color: #7a7f88;
}

.tdcp-load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  min-height: 50px;
  margin: 22px auto 0;
  padding: 0 24px;
  border: 0;
  border-radius: 50px;
  background: var(--tdcp-accent);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 12px 30px color-mix(in srgb, var(--tdcp-accent) 25%, transparent);
}

.tdcp-load-more[hidden] {
  display: none;
}

.tdcp-empty-state {
  padding: 58px 20px;
  border: 1px dashed #dfe2e7;
  border-radius: 24px;
  text-align: center;
}

.tdcp-empty-state[hidden] {
  display: none;
}

.tdcp-empty-state__icon {
  margin-bottom: 12px;
  color: var(--tdcp-accent);
  font-size: 44px;
}

.tdcp-empty-state strong {
  display: block;
  font-size: 18px;
}

.tdcp-empty-state p {
  margin: 8px 0 0;
  color: var(--tdcp-muted);
}

.tdcp-footer-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 0 6px;
  color: #8a8f99;
  font-size: 11px;
}

.tdcp-footer-note a {
  color: var(--tdcp-accent);
  text-decoration: none;
}

@media (max-width: 1100px) {
  .tdcp-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tdcp-table-head,
  .tdcp-row {
    grid-template-columns: minmax(220px, 1.4fr) 70px repeat(4, minmax(130px, 0.85fr));
  }

  .tdcp-table {
    overflow-x: auto;
  }

  .tdcp-table-head,
  .tdcp-row {
    min-width: 1030px;
  }
}

@media (max-width: 767px) {
  .tdcp-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 26px 20px;
    border-radius: 24px;
  }

  .tdcp-update-box {
    min-width: 0;
  }

  .tdcp-stats {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .tdcp-stat {
    min-height: 66px;
    padding: 14px 17px;
    border-radius: 17px;
  }

  .tdcp-toolbar {
    position: static;
    padding: 12px;
    border-radius: 20px;
  }

  .tdcp-filters {
    grid-template-columns: 1fr 1fr;
  }

  .tdcp-search input,
  .tdcp-filters select {
    min-height: 48px;
    font-size: 12px;
  }

  .tdcp-table {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .tdcp-table-head {
    display: none;
  }

  .tdcp-row {
    display: grid;
    min-width: 0;
    min-height: 0;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin-bottom: 12px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--tdcp-line);
    border-radius: 21px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(20, 22, 30, 0.05);
  }

  .tdcp-car {
    grid-column: 1 / -1;
    padding: 18px;
    border-bottom: 1px solid var(--tdcp-line);
    background: linear-gradient(145deg, #fff, #fafafb);
  }

  .tdcp-cell {
    position: relative;
    min-height: 92px;
    justify-content: flex-end;
    padding: 30px 15px 14px;
    border-bottom: 1px solid var(--tdcp-line);
  }

  .tdcp-cell:nth-of-type(even) {
    border-left: 1px solid var(--tdcp-line);
  }

  .tdcp-cell::before {
    content: attr(data-label);
    position: absolute;
    top: 12px;
    right: 15px;
    color: #979ba4;
    font-size: 9px;
    font-weight: 700;
  }

  .tdcp-year {
    min-width: 52px;
    min-height: 30px;
  }

  .tdcp-price,
  .tdcp-difference {
    white-space: normal;
    font-size: 12px;
    line-height: 1.6;
  }

  .tdcp-footer-note {
    align-items: flex-start;
    flex-direction: column;
  }

  .tdcp-hero::after {
    left: clamp(24px, 5vw, 45px);
    bottom: 225px;
    font-size: clamp(42px, 8vw, 240px);
  }
}

@media (max-width: 480px) {
  .tdcp-filters {
    grid-template-columns: 1fr;
  }

  .tdcp-result-bar {
    align-items: flex-start;
    flex-direction: column;
  }
}

.tdcp-car__title {
  text-decoration: none;
}

.tdcp-car__title:hover {
  color: var(--tdcp-accent);
}

.tdcp-detail-page,
.tdcp-detail-page * {
  box-sizing: border-box;
}

.tdcp-detail-page {
  --tdcp-accent: #d21a34;
  --tdcp-text: #17181c;
  --tdcp-muted: #717680;
  --tdcp-line: #e9ebef;
  padding: clamp(28px, 5vw, 72px) 16px;
  background: #f6f7f9;
  color: var(--tdcp-text);
  font-family: inherit;
}

.tdcp-detail-container {
  width: min(1280px, 100%);
  margin: 0 auto;
}

.tdcp-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: #888d96;
  font-size: 12px;
}

.tdcp-breadcrumb a {
  color: #666b74;
  text-decoration: none;
}

.tdcp-detail-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(28px, 4vw, 52px);
  overflow: hidden;
  border-radius: 30px;
  background: linear-gradient(135deg, #fff, #f0f1f4);
  box-shadow: 0 20px 60px rgba(21, 23, 31, .07);
}

.tdcp-detail-hero::after {
  content: "۷۷۷ پریمیوم";
  position: absolute;
  left: clamp(24px, 5vw, 45px);
  bottom: 136px;
  color: rgba(210, 26, 52, .045);
  font-size: clamp(110px, 8vw, 240px);
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.tdcp-detail-hero > * {
  position: relative;
  z-index: 1;
}

.tdcp-detail-hero h1 {
  margin: 14px 0 9px;
  font-size: clamp(28px, 4vw, 54px);
  line-height: 1.4;
}

.tdcp-detail-hero p {
  margin: 0;
  color: var(--tdcp-muted);
}

.tdcp-detail-prices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.tdcp-detail-price-card {
  display: flex;
  min-height: 170px;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--tdcp-line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 35px rgba(20, 22, 30, .04);
}

.tdcp-detail-price-card > span {
  color: var(--tdcp-muted);
  font-size: 13px;
  font-weight: 700;
}

.tdcp-detail-price-card > strong {
  color: var(--tdcp-text);
  font-size: clamp(22px, 2.2vw, 36px);
  font-weight: 900;
  line-height: 1.4;
}

.tdcp-detail-price-card small {
  color: #8b9099;
  font-size: 11px;
}

.tdcp-detail-price-card b {
  padding: 4px 8px;
  border-radius: 50px;
}

.tdcp-detail-price-card b.is-up { background: #fff0f1; color: #c42139; }
.tdcp-detail-price-card b.is-down { background: #e9f8f1; color: #147f5b; }
.tdcp-detail-price-card b.is-flat { background: #f1f2f4; color: #777c85; }
.tdcp-detail-price-card.is-market { border-top: 4px solid var(--tdcp-accent); }
.tdcp-detail-price-card.is-factory { border-top: 4px solid #17181c; }
.tdcp-detail-price-card.is-difference { border-top: 4px solid #d58b18; }

.tdcp-detail-panel {
  margin-top: 18px;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--tdcp-line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(20, 22, 30, .04);
}

.tdcp-detail-panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.tdcp-detail-panel-head span {
  color: var(--tdcp-accent);
  font-size: 11px;
  font-weight: 800;
}

.tdcp-detail-panel-head h2 {
  margin: 5px 0 0;
  font-size: clamp(19px, 2vw, 28px);
}

.tdcp-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.tdcp-chart-legend span {
  position: relative;
  padding-right: 16px;
  color: #6e737d;
  font-size: 11px;
}

.tdcp-chart-legend span::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  transform: translateY(-50%);
}

.tdcp-chart-legend .is-market::before { background: var(--tdcp-accent); }
.tdcp-chart-legend .is-factory::before { background: #17181c; }

.tdcp-chart {
  position: relative;
  height: clamp(230px, 32vw, 390px);
  padding: 10px 0 34px;
}

.tdcp-chart svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.tdcp-chart-grid {
  stroke: #eceef2;
  stroke-width: 1;
}

.tdcp-chart-line {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.tdcp-chart-line--market { stroke: var(--tdcp-accent); }
.tdcp-chart-line--factory { stroke: #17181c; }

.tdcp-chart-range {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: space-between;
  color: #959aa3;
  font-size: 10px;
}

.tdcp-chart-empty,
.tdcp-no-history {
  padding: 50px 20px;
  border: 1px dashed #dadee4;
  border-radius: 18px;
  color: #858a94;
  text-align: center;
}

.tdcp-history-table {
  overflow: hidden;
  border: 1px solid var(--tdcp-line);
  border-radius: 18px;
}

.tdcp-history-head,
.tdcp-history-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  gap: 15px;
  min-height: 58px;
  padding: 10px 18px;
}

.tdcp-history-head {
  background: #17181c;
  color: rgba(255,255,255,.68);
  font-size: 11px;
  font-weight: 700;
}

.tdcp-history-row {
  border-bottom: 1px solid var(--tdcp-line);
}

.tdcp-history-row:last-child { border-bottom: 0; }
.tdcp-history-row time { color: #777c85; font-size: 11px; }
.tdcp-history-row strong { font-size: 13px; }

.tdcp-detail-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 17px 20px;
  border-radius: 17px;
  background: #17181c;
  color: rgba(255,255,255,.68);
  font-size: 11px;
  line-height: 1.8;
}

.tdcp-detail-note a {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 50px;
  background: #fff;
  color: #17181c;
  text-decoration: none;
  font-weight: 800;
}

@media (max-width: 800px) {
  .tdcp-detail-hero {
    align-items: stretch;
    flex-direction: column;
    border-radius: 24px;
  }

  .tdcp-detail-prices {
    grid-template-columns: 1fr;
  }

  .tdcp-detail-price-card {
    min-height: 145px;
  }

  .tdcp-detail-panel-head,
  .tdcp-detail-note {
    align-items: flex-start;
    flex-direction: column;
  }

  .tdcp-history-head,
  .tdcp-history-row {
    grid-template-columns: 1.2fr 1fr 1fr;
    padding: 10px 12px;
  }

  .tdcp-history-row strong {
    font-size: 11px;
  }
}

/* ===== Brand-grouped multi-source layout (v1.2) ===== */
.tdcp-stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.tdcp-brand-groups {
  display: grid;
  gap: 24px;
}

.tdcp-brand-section[hidden] {
  display: none !important;
}

.tdcp-brand-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
  padding: 14px 18px;
  border: 1px solid var(--tdcp-line);
  border-radius: 22px;
  background: linear-gradient(135deg, #fff, #fafafb);
  box-shadow: 0 10px 30px rgba(20, 22, 30, .045);
}

.tdcp-brand-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 13px;
}

.tdcp-brand-logo,
.tdcp-detail-brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  overflow: hidden;
  border: 1px solid var(--tdcp-line);
  border-radius: 17px;
  background: #fff;
  color: var(--tdcp-accent);
  font-size: 21px;
  font-weight: 900;
}

.tdcp-brand-logo img,
.tdcp-detail-brand-logo img {
  display: block;
  width: 78%;
  height: 78%;
  object-fit: contain;
}

.tdcp-brand-identity > div > span {
  display: block;
  margin-bottom: 2px;
  color: var(--tdcp-muted);
  font-size: 10px;
  font-weight: 700;
}

.tdcp-brand-identity h3 {
  margin: 0;
  color: var(--tdcp-text);
  font-size: clamp(18px, 1.6vw, 25px);
  line-height: 1.5;
  font-weight: 900;
}

.tdcp-brand-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  min-height: 36px;
  padding: 5px 13px;
  border-radius: 50px;
  background: color-mix(in srgb, var(--tdcp-accent) 7%, #fff);
  color: var(--tdcp-muted);
  font-size: 11px;
  font-weight: 700;
}

.tdcp-brand-count b {
  color: var(--tdcp-accent);
  font-size: 14px;
}

.tdcp-source-cell small {
  line-height: 1.65;
}

.tdcp-detail-title-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
}

.tdcp-detail-prices--sources {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tdcp-detail-price-card.is-karnameh { border-top: 4px solid #e33b2f; }
.tdcp-detail-price-card.is-bama { border-top: 4px solid #3478d4; }
.tdcp-detail-price-card.is-hamrah { border-top: 4px solid #1b9b71; }
.tdcp-detail-price-card.is-factory { border-top: 4px solid #17181c; }

.tdcp-chart-legend .is-karnameh::before { background: #e33b2f; }
.tdcp-chart-legend .is-bama::before { background: #3478d4; }
.tdcp-chart-legend .is-hamrah::before { background: #1b9b71; }
.tdcp-chart-legend .is-factory::before { background: #17181c; }

.tdcp-chart-line--karnameh { stroke: #e33b2f; }
.tdcp-chart-line--bama { stroke: #3478d4; }
.tdcp-chart-line--hamrah { stroke: #1b9b71; }
.tdcp-chart-line--factory { stroke: #17181c; }

.tdcp-history-table--sources {
  overflow-x: auto;
}

.tdcp-history-table--sources .tdcp-history-head,
.tdcp-history-table--sources .tdcp-history-row {
  grid-template-columns: minmax(150px, 1.2fr) repeat(4, minmax(130px, 1fr));
  min-width: 760px;
}

@media (max-width: 1250px) {
  .tdcp-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tdcp-detail-prices--sources {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .tdcp-stats {
    grid-template-columns: 1fr 1fr;
  }

  .tdcp-brand-groups {
    gap: 19px;
  }

  .tdcp-brand-heading {
    padding: 12px 13px;
    border-radius: 19px;
  }

  .tdcp-brand-logo,
  .tdcp-detail-brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .tdcp-brand-identity h3 {
    font-size: 17px;
  }

  .tdcp-detail-title-wrap {
    align-items: flex-start;
  }

  .tdcp-detail-prices--sources {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .tdcp-stats {
    grid-template-columns: 1fr;
  }

  .tdcp-brand-heading {
    align-items: flex-start;
  }

  .tdcp-brand-count {
    padding: 4px 9px;
  }
}


/* ===== Complete titles, ordered sources and sticky table headers ===== */
.tdcp-brand-identity > div > span {
  display: none;
}

.tdcp-table {
  position: relative;
}

.tdcp-table-head {
  position: sticky;
  top: 122px;
  z-index: 12;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08), 0 10px 22px rgba(0, 0, 0, .12);
  border-radius: 25px 25px 0px 0px;
}

.tdcp-rows {
  position: relative;
}

.tdcp-load-more {
  display: none !important;
}

/* ===== v1.5: non-sticky search, floating return button, page-linked tables ===== */
.tdcp-toolbar {
  position: relative;
  top: auto;
  z-index: 5;
  scroll-margin-block: 18vh;
}

.tdcp-search-jump {
  position: fixed;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--tdcp-accent, #d21a34);
  box-shadow: 0 14px 34px rgba(22, 24, 33, .24);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(16px) scale(.9);
  transition: opacity .2s ease, visibility .2s ease, transform .2s ease, box-shadow .2s ease;
}

.tdcp-search-jump:hover {
  box-shadow: 0 17px 42px rgba(22, 24, 33, .32);
  transform: translateY(-2px) scale(1);
}

.tdcp-search-jump:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--tdcp-accent) 28%, #fff);
  outline-offset: 4px;
}

.tdcp-search-jump.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.tdcp-search-jump svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
}

.tdcp-search-jump span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Vertical movement belongs to the document, not to each brand table. */
.tdcp-table {
  max-height: none !important;
  overflow-y: visible !important;
  overscroll-behavior: auto !important;
  scrollbar-gutter: auto;
  touch-action: auto;
}

@media (min-width: 1101px) {
  .tdcp-table {
    overflow: visible !important;
  }
}

@media (min-width: 768px) and (max-width: 1100px) {
  .tdcp-table {
    overflow-x: auto !important;
    max-height: none !important;
  }
}

@media (max-width: 767px) {
  .tdcp-search-jump {
    left: max(14px, env(safe-area-inset-left));
    bottom: max(16px, env(safe-area-inset-bottom));
    width: 52px;
    height: 52px;
  }

  .tdcp-search-jump svg {
    width: 22px;
    height: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tdcp-search-jump {
    transition: none;
  }
}


/* ===== v1.6: merged custom design + v1.5 interaction model ===== */
.tdcp-toolbar {
  position: relative !important;
  top: auto !important;
}

.tdcp-table {
  max-height: none !important;
  overflow-y: visible !important;
  overscroll-behavior-y: auto !important;
  scrollbar-gutter: auto !important;
  touch-action: auto !important;
}

@media (min-width: 1101px) {
  .tdcp-table {
    overflow: visible !important;
  }
}

@media (min-width: 768px) and (max-width: 1100px) {
  .tdcp-table {
    overflow-x: auto !important;
    overflow-y: visible !important;
  }
}

.tdcp-detail-note a{
    display:none;
}