:root {
  --cot-bg: #f3f7fb;
  --cot-surface: #ffffff;
  --cot-surface-soft: #f7fbff;
  --cot-ink: #0b1b2b;
  --cot-muted: #5b7387;
  --cot-line: #d7e5f1;
  --cot-shadow: 0 14px 28px rgba(9, 30, 53, 0.08), 0 5px 14px rgba(9, 30, 53, 0.05);
  --cot-radius: 18px;
  --cot-bull: #128261;
  --cot-bear: #c33a4d;
  --cot-warn: #c17a19;
  --cot-neutral: #35577a;
}

.cot-main {
  background:
    radial-gradient(circle at 3% 2%, #e9f7ff 0%, transparent 36%),
    radial-gradient(circle at 94% 16%, #f2fff8 0%, transparent 33%),
    var(--cot-bg);
  min-height: 100dvh;
  padding-top: clamp(6.2rem, 9vw, 7.4rem);
  padding-bottom: 3rem;
}

.cot-wrap {
  width: min(1180px, 94%);
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}

.cot-panel {
  background: var(--cot-surface);
  border: 1px solid var(--cot-line);
  border-radius: var(--cot-radius);
  box-shadow: var(--cot-shadow);
  padding: clamp(1rem, 2.6vw, 1.45rem);
}

.cot-title {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
}

.cot-subtitle {
  margin-top: 0.4rem;
  margin-bottom: 0;
  color: var(--cot-muted);
}

.cot-head {
  display: grid;
  grid-template-columns: 1.2fr auto;
  gap: 1rem;
  align-items: start;
}

.cot-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  width: fit-content;
}

.cot-badge.bullish {
  background: rgba(18, 130, 97, 0.12);
  color: var(--cot-bull);
}

.cot-badge.bearish {
  background: rgba(195, 58, 77, 0.12);
  color: var(--cot-bear);
}

.cot-badge.warning {
  background: rgba(193, 122, 25, 0.14);
  color: var(--cot-warn);
}

.cot-badge.neutral {
  background: rgba(53, 87, 122, 0.1);
  color: var(--cot-neutral);
}

.cot-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 0.65rem;
}

.cot-filters label {
  display: grid;
  gap: 0.38rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #284867;
  letter-spacing: 0.02em;
}

.cot-select {
  border-radius: 11px;
  border: 1px solid var(--cot-line);
  padding: 0.58rem 0.75rem;
  background: #fff;
  color: var(--cot-ink);
  font-weight: 600;
}

.cot-meta {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 0.6rem;
}

.cot-meta-strip {
  margin-top: 0.95rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 0.62rem;
}

.cot-meta-chip {
  border: 1px solid #d8e6f2;
  border-radius: 12px;
  background: linear-gradient(180deg, #f9fcff 0%, #f3f8fd 100%);
  padding: 0.62rem 0.68rem;
}

.cot-meta-chip small {
  color: #5f778d;
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.cot-meta-chip strong {
  display: block;
  margin-top: 0.2rem;
  color: #173a5a;
  font-size: 0.92rem;
}

.cot-asset-links {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.48rem;
}

.cot-asset-link {
  border: 1px solid #d4e3f0;
  background: #f5faff;
  color: #234361;
  border-radius: 999px;
  padding: 0.34rem 0.62rem;
  font-size: 0.76rem;
  font-weight: 700;
}

.cot-asset-link:hover {
  background: #ebf5ff;
}

.cot-asset-link.is-active {
  color: #0f3658;
  background: #ddeefe;
  border-color: #c2ddf6;
}

.cot-meta-item {
  border-radius: 12px;
  background: var(--cot-surface-soft);
  border: 1px solid #e2ecf5;
  padding: 0.58rem 0.62rem;
}

.cot-meta-item small {
  color: var(--cot-muted);
  font-weight: 600;
}

.cot-meta-title {
  display: flex;
  align-items: center;
  gap: 0.42rem;
}

.cot-meta-icon {
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  color: #1c4768;
  background: #e5f0fa;
  border: 1px solid #cddff0;
  flex-shrink: 0;
}

.cot-meta-item strong {
  display: block;
  color: #183452;
  font-size: 0.89rem;
}

.cot-summary {
  border-radius: 16px;
  border: 1px solid #d8e8f4;
  background: linear-gradient(145deg, #f8fbff, #eef7ff);
  padding: 0.95rem 1rem;
}

.cot-summary h2 {
  font-size: 1.06rem;
  margin: 0 0 0.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.cot-summary p {
  margin: 0;
  color: #284867;
}

.cot-info-icon {
  width: 1.12rem;
  height: 1.12rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
  color: #1a496f;
  background: #e6f1fb;
  border: 1px solid #cfe1f2;
  cursor: help;
}

.cot-grid {
  display: grid;
  gap: 1rem;
}

.cot-grid.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cot-card {
  border: 1px solid #dfebf5;
  border-radius: 15px;
  padding: 0.82rem;
  background: #fff;
}

.cot-card h3 {
  margin: 0;
  font-size: 0.82rem;
  color: #3f607d;
  font-weight: 700;
}

.cot-value {
  margin-top: 0.42rem;
  font-size: 1.28rem;
  font-weight: 800;
  color: #122f4b;
}

.cot-delta {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.cot-delta.up {
  color: var(--cot-bull);
}

.cot-delta.down {
  color: var(--cot-bear);
}

.cot-delta.flat {
  color: var(--cot-neutral);
}

.cot-pill {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.25rem 0.52rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.cot-pill.bullish {
  background: rgba(18, 130, 97, 0.12);
  color: var(--cot-bull);
}

.cot-pill.bearish {
  background: rgba(195, 58, 77, 0.12);
  color: var(--cot-bear);
}

.cot-pill.warning {
  background: rgba(193, 122, 25, 0.14);
  color: var(--cot-warn);
}

.cot-pill.neutral {
  background: rgba(53, 87, 122, 0.1);
  color: var(--cot-neutral);
}

.cot-panel h2,
.cot-panel h3 {
  margin-top: 0;
}

.chart-block {
  min-height: 340px;
}

.chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.chart-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
}

.chart-actions h2 {
  margin: 0;
  font-size: 1rem;
}

.chart-actions select {
  border-radius: 10px;
  border: 1px solid #cdddea;
  padding: 0.4rem 0.56rem;
  min-height: 2.15rem;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.insight-card {
  border: 1px solid #dce7f2;
  border-radius: 14px;
  padding: 0.8rem;
}

.insight-card h3 {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
}

.insight-card p {
  margin: 0;
  font-size: 0.9rem;
}

.insight-card.warning {
  border-color: #f1d8b2;
  background: #fff8ec;
}

.insight-card.bullish {
  border-color: #b7e5d5;
  background: #f0fcf7;
}

.insight-card.neutral {
  border-color: #d6e4f2;
  background: #f6faff;
}

.cot-table-wrap {
  overflow-x: auto;
  border: 1px solid #d9e7f3;
  border-radius: 14px;
}

.cot-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
  font-size: 0.86rem;
}

.cot-table th,
.cot-table td {
  padding: 0.63rem 0.58rem;
  border-bottom: 1px solid #e3edf6;
  text-align: right;
}

.cot-table th:first-child,
.cot-table td:first-child {
  text-align: left;
}

.cot-table th {
  position: sticky;
  top: 0;
  background: #f4f9ff;
  z-index: 2;
  cursor: pointer;
  color: #2a4b68;
}

.cot-table tbody tr:hover {
  background: #f8fcff;
}

.cot-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.82rem;
}

.cot-stat {
  border: 1px solid #dae8f4;
  border-radius: 14px;
  padding: 0.8rem;
  background: #fff;
}

.cot-stat small {
  display: block;
  color: #5a7287;
}

.cot-stat strong {
  display: block;
  margin-top: 0.23rem;
  color: #183452;
}

.cot-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.cot-term {
  background: #eff6fd;
  border: 1px solid #d7e6f3;
  border-radius: 999px;
  padding: 0.35rem 0.62rem;
  font-size: 0.78rem;
  color: #224160;
}

.cot-term abbr {
  text-decoration: none;
  border-bottom: 1px dotted #507392;
  cursor: help;
}

.cot-bias-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.cot-bias-item {
  border: 1px solid #d7e6f3;
  border-radius: 14px;
  padding: 0.75rem;
  background: #fff;
}

.cot-bias-item small {
  color: #5d7387;
  display: block;
}

.cot-bias-item strong {
  color: #163553;
}

.cot-list {
  margin: 0.5rem 0 0;
  padding-left: 1rem;
}

.cot-list li {
  margin-bottom: 0.32rem;
}

.cot-disclaimer {
  background: #fff8ee;
  border: 1px solid #efd6b8;
  color: #7d5622;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
}

.sticky-summary {
  position: sticky;
  top: 86px;
}

.cot-empty {
  text-align: center;
  padding: 3.4rem 1rem;
}

.cot-empty p {
  max-width: 62ch;
  margin: 0.8rem auto 0;
}

@media (max-width: 1100px) {
  .cot-grid.metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cot-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cot-meta-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 900px) {
  .cot-head {
    grid-template-columns: 1fr;
  }

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

  .chart-row {
    grid-template-columns: 1fr;
  }

  .cot-stats,
  .cot-bias-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sticky-summary {
    position: static;
  }
}

@media (max-width: 640px) {
  .cot-filters,
  .cot-meta,
  .cot-meta-strip,
  .cot-stats,
  .cot-bias-grid,
  .insight-grid,
  .cot-grid.metrics {
    grid-template-columns: 1fr;
  }

  .cot-main {
    padding-top: 5.8rem;
  }

  .chart-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .chart-actions select {
    width: 100%;
  }

  .chart-block {
    min-height: 250px;
  }

  .cot-asset-links {
    gap: 0.4rem;
  }

  .cot-asset-link {
    width: 100%;
    text-align: center;
    padding: 0.5rem 0.7rem;
  }
}

@media (max-width: 760px) {
  .cot-table-wrap {
    border: 0;
    overflow: visible;
  }

  .cot-table {
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.55rem;
  }

  .cot-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .cot-table tbody,
  .cot-table tr,
  .cot-table td {
    display: block;
    width: 100%;
  }

  .cot-table tbody tr {
    background: #fff;
    border: 1px solid #dce9f5;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(13, 35, 57, 0.05);
    padding: 0.35rem 0.55rem;
    margin-bottom: 0.55rem;
  }

  .cot-table td {
    text-align: right !important;
    border-bottom: 1px solid #ebf1f7;
    padding: 0.56rem 0.42rem;
    font-size: 0.84rem;
  }

  .cot-table td:last-child {
    border-bottom: 0;
  }

  .cot-table td::before {
    content: attr(data-label);
    float: left;
    color: #4b657d;
    font-weight: 700;
    text-align: left;
    max-width: 54%;
    padding-right: 0.6rem;
  }
}
