* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #0b1220;
  color: #e5e7eb;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.refresh-btn {
  border: 1px solid #2563eb;
  background: #1d4ed8;
  color: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}

.refresh-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.data-status {
  margin: 0 0 10px;
  font-size: 12px;
  color: #93c5fd;
}

.subtitle {
  margin: 0 0 20px;
  color: #9ca3af;
}

.dashboard-panel {
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 14px;
}

.chart-title {
  margin: 0;
  text-align: center;
  font-size: 14px;
  color: #cbd5e1;
}

.chart-context {
  margin: 6px 0 0;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 8px;
  font-size: 12px;
  color: #94a3b8;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
}

.legend-duration {
  background: #22c55e;
}

.legend-monthly {
  background: #3b82f6;
}

.chart-bars {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.bar-col {
  border: 1px solid #1f2937;
  border-radius: 8px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #0b1220;
  position: relative;
}

.bar-rank {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 10px;
  color: #e2e8f0;
  background: #1e293b;
  border-radius: 999px;
  padding: 2px 6px;
}

.bar-area {
  height: 120px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}

.bar {
  width: 16px;
  border-radius: 6px 6px 2px 2px;
  min-height: 2px;
}

.bar.duration {
  background: #22c55e;
}

.bar.monthly {
  background: #3b82f6;
}

.bar-provider {
  margin-top: 8px;
  text-align: center;
  font-size: 11px;
  line-height: 1.25;
  color: #cbd5e1;
}

.bar-values {
  text-align: center;
  font-size: 10px;
  color: #94a3b8;
  margin-top: 4px;
}

.slider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.slider-control {
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 10px;
  padding: 10px;
}

.slider-control label {
  font-size: 13px;
  color: #d1d5db;
}

.slider-value {
  margin: 4px 0 8px;
  font-size: 14px;
  color: #e5e7eb;
}

.slider-control input[type="range"] {
  padding: 0;
  height: 24px;
}

.slider-control select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #374151;
  background: #0b1220;
  color: #f3f4f6;
  border-radius: 10px;
  font-size: 14px;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.preset-btn {
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
}

.preset-btn:hover {
  border-color: #2563eb;
}

.preset-btn.active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}

.card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: #d1d5db;
}

input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #374151;
  background: #0f172a;
  color: #f3f4f6;
  border-radius: 10px;
  font-size: 14px;
}

input:focus {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

.note {
  margin: 12px 0 0;
  font-size: 13px;
  color: #9ca3af;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 740px;
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #1f2937;
  font-size: 13px;
  vertical-align: top;
}

th {
  color: #9ca3af;
  font-weight: 600;
}

td.total {
  font-weight: 700;
}

tr.cheapest {
  background: rgba(16, 185, 129, 0.12);
}

.small {
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.4;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.info-item {
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 10px;
  padding: 12px;
}

.info-item h3,
.source-block h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.info-item ul,
.source-block ul {
  margin: 0;
  padding-left: 16px;
  color: #cbd5e1;
}

.info-item li,
.source-block li {
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.4;
}

.source-block {
  margin-top: 14px;
}

a {
  color: #93c5fd;
}
