:root {
  --bg: #0b1220;
  --panel: #131c30;
  --panel-2: #182440;
  --line: #263453;
  --text: #e8eef7;
  --muted: #9db0c9;
  --accent: #38bdf8;
  --drop: #34d399;
  --warn: #fbbf24;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

.site-header {
  padding: 28px 18px 8px;
  text-align: center;
}

.logo {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.tagline {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.honest-banner {
  margin: 16px auto 0;
  max-width: 640px;
  padding: 10px 16px;
  text-align: center;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.45);
  border-radius: 999px;
  color: var(--drop);
  font-weight: 600;
  font-size: 0.95rem;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 18px 14px 8px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-bottom: 18px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 1.2rem;
}

.hint {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 10px 0 0;
}

.track-form {
  display: grid;
  gap: 12px;
}

.track-form label {
  display: grid;
  gap: 5px;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}

.track-form input,
.threshold-row input {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 12px;
  font-size: 1rem;
  width: 100%;
}

.track-form input:focus,
.threshold-row input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.btn-primary {
  background: var(--accent);
  color: #06283d;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary:active { transform: scale(0.99); }

.card-list {
  display: grid;
  gap: 14px;
}

.route-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.route-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.route-name {
  font-size: 1.1rem;
  font-weight: 700;
}

.route-month {
  color: var(--muted);
  font-size: 0.85rem;
}

.drop-badge {
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.5);
  color: var(--drop);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

.up-badge {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: var(--warn);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

.sparkline {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 56px;
  margin: 14px 0 4px;
}

.spark-bar {
  flex: 1;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  min-height: 6px;
  opacity: 0.55;
}

.spark-bar:last-child { opacity: 1; }

.spark-dates {
  display: flex;
  gap: 6px;
}

.spark-dates span {
  flex: 1;
  text-align: center;
  font-size: 0.66rem;
  color: var(--muted);
}

.true-total {
  margin: 12px 0 2px;
  font-size: 1.7rem;
  font-weight: 800;
}

.true-total small {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.breakdown {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
}

.breakdown li {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px dashed var(--line);
}

.breakdown li:last-child {
  border-bottom: none;
  font-weight: 700;
}

.threshold-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

.threshold-row label {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}

.threshold-row input { width: 110px; }

.btn-small {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 9px;
  padding: 9px 13px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-track {
  margin-top: 12px;
  width: 100%;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-track:disabled {
  color: var(--muted);
  border-color: var(--line);
  cursor: default;
}

.btn-remove {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.threshold-status {
  margin-top: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

.threshold-status.hit { color: var(--drop); }
.threshold-status.waiting { color: var(--muted); }

.btn-flex {
  margin-top: 12px;
  width: 100%;
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.flex-box {
  margin-top: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}

.flex-title {
  margin: 0 0 10px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--muted);
}

.flex-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.flex-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  text-align: center;
}

.flex-cell.center { border-color: var(--accent); }
.flex-cell.lowest {
  border-color: var(--drop);
  background: rgba(52, 211, 153, 0.14);
}

.flex-day { font-size: 0.68rem; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.flex-date { font-size: 0.72rem; color: var(--muted); }
.flex-price { font-size: 0.95rem; font-weight: 800; }
.flex-cell.lowest .flex-price { color: var(--drop); }
.flex-sample { font-size: 0.58rem; letter-spacing: 0.6px; color: var(--warn); font-weight: 700; }
.flex-low-tag { font-size: 0.62rem; font-weight: 800; color: var(--drop); text-transform: uppercase; }
.flex-picked { font-size: 0.62rem; font-weight: 700; color: var(--accent); }

.flex-summary { margin: 10px 0 0; font-size: 0.9rem; font-weight: 600; color: var(--drop); }
.flex-note { margin: 6px 0 0; font-size: 0.8rem; color: var(--muted); }
.version-stamp { font-size: 0.8rem; }

@media (max-width: 520px) {
  .flex-grid { grid-template-columns: repeat(4, 1fr); }
}

.site-footer {
  max-width: 640px;
  margin: 0 auto;
  padding: 6px 18px 30px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}
