:root {
  --oil-bg: #071017;
  --oil-bg-deep: #02060a;
  --oil-panel: rgba(9, 20, 28, 0.86);
  --oil-panel-strong: rgba(13, 28, 38, 0.96);
  --oil-line: rgba(117, 179, 206, 0.16);
  --oil-line-strong: rgba(244, 176, 64, 0.24);
  --oil-text: #eef6fb;
  --oil-soft: #96aebb;
  --oil-bright: #79d4ff;
  --oil-gold: #f4b040;
  --oil-green: #49cc87;
  --oil-red: #f25f5c;
  --oil-shadow: 0 24px 50px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body.oilmarket-page {
  margin: 0;
  min-height: 100vh;
  color: var(--oil-text);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(121, 212, 255, 0.16), transparent 24%),
    radial-gradient(circle at 85% 10%, rgba(244, 176, 64, 0.15), transparent 22%),
    linear-gradient(180deg, var(--oil-bg), var(--oil-bg-deep));
}

body.oilmarket-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent);
}

.oilmarket-shell {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.oilmarket-header,
.model-card,
.overview-card {
  border: 1px solid var(--oil-line);
  background: var(--oil-panel);
  box-shadow: var(--oil-shadow);
  backdrop-filter: blur(16px);
}

.oilmarket-header {
  padding: 28px;
  border-radius: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 420px);
  gap: 24px 28px;
  align-items: start;
  margin-bottom: 28px;
  background:
    linear-gradient(135deg, rgba(13, 28, 38, 0.98), rgba(8, 15, 22, 0.92)),
    var(--oil-panel);
}

.oilmarket-back {
  grid-column: 1 / -1;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(121, 212, 255, 0.22);
  color: var(--oil-text);
  text-decoration: none;
  background: rgba(121, 212, 255, 0.08);
}

.oilmarket-copy h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  letter-spacing: 0.02em;
}

.oilmarket-copy p {
  margin: 12px 0 0;
  max-width: 52ch;
  color: var(--oil-soft);
  line-height: 1.55;
  font-size: 1.02rem;
}

.oilmarket-kicker,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--oil-gold);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  font-weight: 700;
}

.oilmarket-overview {
  display: grid;
  gap: 14px;
}

.overview-card {
  border-radius: 22px;
  padding: 18px 20px;
  display: grid;
  gap: 8px;
}

.overview-label {
  color: var(--oil-soft);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.overview-value {
  font-size: clamp(1.3rem, 3vw, 2rem);
}

.overview-note {
  color: var(--oil-soft);
  font-size: 0.9rem;
}

.oilmarket-main {
  display: grid;
  gap: 20px;
}

.insight-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.insight-card {
  border-radius: 22px;
  border: 1px solid var(--oil-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    var(--oil-panel);
  box-shadow: var(--oil-shadow);
  padding: 16px 18px;
  display: grid;
  gap: 8px;
}

.insight-label {
  color: var(--oil-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.insight-value {
  font-size: clamp(1.1rem, 2vw, 1.65rem);
}

.insight-note {
  color: var(--oil-soft);
  font-size: 0.88rem;
}

.insight-card.is-warning {
  border-color: rgba(244, 176, 64, 0.34);
}

.insight-card.is-live {
  border-color: rgba(73, 204, 135, 0.24);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.section-head h2 {
  margin: 4px 0 0;
  font-size: clamp(1.4rem, 2.8vw, 2.1rem);
}

.section-note {
  margin: 0;
  color: var(--oil-soft);
  max-width: 34ch;
  text-align: right;
}

.oilmarket-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--oil-line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--oil-soft);
  font-size: 0.84rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.legend-dot-live {
  background: var(--oil-green);
}

.legend-dot-waiting {
  background: var(--oil-gold);
}

.legend-dot-horizon-1 {
  background: #79d4ff;
}

.legend-dot-horizon-6 {
  background: #7de2a2;
}

.legend-dot-horizon-24 {
  background: #ff7b5b;
}

.oilmarket-groups {
  display: grid;
  gap: 22px;
}

.horizon-group {
  display: grid;
  gap: 16px;
}

.horizon-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.horizon-title {
  margin: 4px 0 0;
  font-size: clamp(1.2rem, 2.4vw, 1.8rem);
}

.horizon-note {
  color: var(--oil-soft);
  max-width: 38ch;
  text-align: right;
  font-size: 0.92rem;
}

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

.model-card {
  border-radius: 26px;
  overflow: hidden;
  min-height: 420px;
  display: flex;
  flex-direction: column;
}

.model-card--missing {
  opacity: 0.92;
}

.model-card--best {
  border-color: rgba(73, 204, 135, 0.28);
  box-shadow: 0 24px 52px rgba(0, 0, 0, 0.36), 0 0 0 1px rgba(73, 204, 135, 0.12);
}

.model-card::before {
  content: "";
  display: block;
  height: 5px;
  background: linear-gradient(90deg, rgba(121, 212, 255, 0.85), rgba(244, 176, 64, 0.85));
}

.model-card--horizon-1::before {
  background: linear-gradient(90deg, #79d4ff, #94efff);
}

.model-card--horizon-6::before {
  background: linear-gradient(90deg, #7de2a2, #f4b040);
}

.model-card--horizon-24::before {
  background: linear-gradient(90deg, #f4b040, #ff7b5b);
}

.model-card-body {
  padding: 18px 18px 20px;
  display: grid;
  gap: 18px;
  height: 100%;
}

.model-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.model-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.model-title {
  margin: 0;
  font-size: 1.35rem;
}

.model-subtitle {
  margin: 6px 0 0;
  color: var(--oil-soft);
  font-size: 0.92rem;
}

.model-window {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--oil-line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.84rem;
  white-space: nowrap;
}

.model-status-pill,
.model-rank-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.76rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 700;
}

.model-status-pill.live {
  background: rgba(73, 204, 135, 0.15);
  color: #a6f4c4;
}

.model-status-pill.waiting {
  background: rgba(244, 176, 64, 0.15);
  color: #ffd898;
}

.model-rank-pill {
  background: rgba(121, 212, 255, 0.12);
  color: #9ddeff;
}

.latest-call {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  background: var(--oil-panel-strong);
  border: 1px solid var(--oil-line);
}

.call-row,
.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.call-label,
.stat-label {
  color: var(--oil-soft);
  font-size: 0.88rem;
}

.direction-pill,
.verdict-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.direction-pill.up {
  background: rgba(73, 204, 135, 0.16);
  color: #9df4bf;
}

.direction-pill.down {
  background: rgba(242, 95, 92, 0.16);
  color: #ffb0ae;
}

.verdict-pill.correct {
  background: rgba(73, 204, 135, 0.16);
  color: #9df4bf;
}

.verdict-pill.wrong {
  background: rgba(242, 95, 92, 0.16);
  color: #ffb0ae;
}

.verdict-pill.pending {
  background: rgba(244, 176, 64, 0.16);
  color: #ffd898;
}

.call-probability {
  font-size: 2rem;
  font-weight: 700;
}

.accuracy-block {
  display: grid;
  gap: 10px;
}

.accuracy-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.accuracy-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #79d4ff, #7de2a2);
}

.history-block {
  display: grid;
  gap: 10px;
}

.history-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.history-title {
  margin: 0;
  font-size: 1rem;
}

.history-note {
  color: var(--oil-soft);
  font-size: 0.82rem;
}

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

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.history-table th,
.history-table td {
  padding: 10px 12px;
  text-align: left;
}

.history-table th {
  background: rgba(255, 255, 255, 0.05);
  color: var(--oil-soft);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.history-table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

.muted {
  color: var(--oil-soft);
}

.empty-state {
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  color: var(--oil-soft);
  line-height: 1.5;
}

.model-card-loading .model-card-body {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--oil-soft);
}

@media (max-width: 1080px) {
  .oilmarket-header {
    grid-template-columns: 1fr;
  }

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

  .horizon-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
    align-items: start;
  }

  .horizon-head {
    flex-direction: column;
    align-items: start;
  }

  .section-note {
    text-align: left;
  }

  .horizon-note {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .oilmarket-shell {
    width: min(100% - 20px, 1280px);
    padding-top: 18px;
  }

  .oilmarket-header {
    padding: 18px;
    border-radius: 24px;
  }

  .insight-strip {
    grid-template-columns: 1fr;
  }

  .model-card-body {
    padding: 16px;
  }

  .history-table th,
  .history-table td {
    padding: 9px 10px;
    font-size: 0.82rem;
  }
}
