:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #d8e0eb;
  --accent: #d97735;
  --accent-dark: #b95e22;
  --up: #147a45;
  --down: #b42318;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  font-family: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  display: grid;
  grid-template-columns: 292px 1fr;
}

.sidebar {
  background: #eef2f7;
  border-right: 1px solid var(--border);
  min-height: 100vh;
}

.sidebar-inner {
  position: sticky;
  top: 0;
  padding: 28px 20px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 1.35rem;
  margin-bottom: 22px;
}

h2 {
  font-size: 1.1rem;
  margin: 24px 0 12px;
}

label {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  margin: 14px 0 8px;
}

textarea,
select,
button {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  font: inherit;
}

textarea,
select {
  background: #ffffff;
  color: var(--text);
  padding: 10px 11px;
}

textarea {
  resize: vertical;
}

button {
  min-height: 52px;
  border: 0;
  background: linear-gradient(90deg, #f5ae68, var(--accent));
  color: #ffffff;
  font-weight: 760;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

button:hover {
  background: linear-gradient(90deg, #ee9d54, var(--accent-dark));
}

.status-text {
  min-height: 20px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.status-text.error {
  color: var(--down);
}

.content {
  padding: 26px;
  max-width: 1360px;
  width: 100%;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card,
.panel,
.toolbar {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat-card {
  min-height: 92px;
  padding: 16px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-top: 9px;
  font-size: 1.32rem;
  overflow-wrap: anywhere;
}

.stat-card strong.positive {
  color: var(--up);
}

.stat-card strong.negative {
  color: var(--down);
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.toolbar label {
  margin: 0 0 7px;
}

.toolbar select {
  width: 180px;
}

.generated-at {
  color: var(--muted);
  font-size: 0.88rem;
  text-align: right;
}

.panel {
  padding: 18px;
  margin-bottom: 18px;
}

.price-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 16px;
}

.price-head h2 {
  margin: 0;
}

.price-head span {
  color: var(--muted);
  font-size: 0.9rem;
}

.bins {
  display: grid;
  grid-template-columns: repeat(8, minmax(82px, 1fr));
  gap: 10px;
  align-items: end;
}

.bin {
  min-height: 112px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  background: #f8fafc;
}

.bin.up {
  border-color: rgba(20, 122, 69, 0.28);
  background: #f0fbf5;
}

.bin.down {
  border-color: rgba(180, 35, 24, 0.24);
  background: #fff4f2;
}

.bin-direction {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.bin-price {
  font-size: 1rem;
  font-weight: 760;
  margin-top: 3px;
}

.bin-change {
  color: var(--muted);
  font-size: 0.82rem;
}

.bin-label {
  margin-top: 5px;
  font-size: 0.82rem;
}

.bin-prob {
  margin-top: 8px;
  font-size: 1.12rem;
  font-weight: 800;
}

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

.ranking-list {
  display: grid;
  gap: 8px;
}

.ranking-row {
  display: grid;
  grid-template-columns: 72px 64px 1fr 76px;
  gap: 10px;
  align-items: center;
  min-height: 30px;
  font-size: 0.92rem;
}

.ranking-row strong {
  font-size: 1rem;
}

.ranking-row .bar {
  height: 9px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.ranking-row .fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.ranking-row .positive {
  color: var(--up);
}

.ranking-row .negative {
  color: var(--down);
}

@media (max-width: 900px) {
  body {
    display: block;
  }

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-inner {
    position: static;
    padding: 18px;
  }

  .content {
    padding: 16px;
  }

  .stats,
  .rankings {
    grid-template-columns: 1fr;
  }

  .toolbar {
    display: block;
  }

  .toolbar select {
    width: 100%;
  }

  .generated-at {
    display: block;
    text-align: left;
    margin-top: 10px;
  }

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

  .ranking-row {
    grid-template-columns: 64px 56px 1fr;
  }

  .ranking-row .note {
    display: none;
  }
}
