/* Reset + base */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0e1116;
  color: #e6edf3;
  line-height: 1.4;
}
header {
  padding: 1.25rem 1.5rem 0.5rem;
  border-bottom: 1px solid #1f2733;
}
header h1 { margin: 0; font-size: 1.4rem; }
header .sub { margin: 0.25rem 0 0; color: #8b96a8; font-size: 0.9rem; }

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

footer { color: #6f7a8a; font-size: 0.8rem; margin-top: 0.5rem; }

/* Buy Me a Coffee */
.bmc-row { margin-top: 0.75rem; }
.bmc-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  background: #ffdd00;
  color: #111;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 6px;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.bmc-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 221, 0, 0.25);
}

/* Cards */
.card {
  background: #161b22;
  border: 1px solid #1f2733;
  border-radius: 8px;
  padding: 1rem 1.25rem;
}
.card h2 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.hint { color: #8b96a8; font-size: 0.85rem; margin: 0 0 0.5rem; }
code { background: #0e1116; padding: 0 4px; border-radius: 3px; }

/* Layout helpers */
.row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: stretch; }
.row.controls { margin-top: 0.75rem; align-items: center; }
.row.controls label { display: flex; flex-direction: column; font-size: 0.8rem; color: #8b96a8; gap: 0.25rem; }
.row.controls label.checkbox { flex-direction: row; align-items: center; gap: 0.4rem; }
.row.controls select, .row.controls input[type="number"] {
  background: #0e1116;
  color: #e6edf3;
  border: 1px solid #2a3340;
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
}

/* Buttons */
button {
  background: #1f6feb;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  cursor: pointer;
}
button:hover { background: #2f7ff5; }
button.ghost {
  background: transparent;
  border: 1px solid #2a3340;
  color: #c4cdda;
}
button.ghost:hover { border-color: #4a5566; }

/* Drop zones */
.drop-zone {
  flex: 1 1 280px;
  border: 2px dashed #2a3340;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}
.drop-zone.secondary { opacity: 0.85; }
.drop-zone.dragover { background: #1f2733; border-color: #1f6feb; }
.drop-zone strong { display: block; margin-bottom: 0.25rem; }
.drop-zone p { margin: 0.25rem 0 0.5rem; color: #8b96a8; font-size: 0.85rem; }
.drop-zone input[type="file"] {
  color: #c4cdda;
  font-size: 0.85rem;
}
.file-info {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: #8b96a8;
  text-align: left;
}
.file-info b { color: #e6edf3; }

/* Columns */
.columns-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.4rem;
}
.col-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.5rem;
  background: #0e1116;
  border: 1px solid #1f2733;
  border-radius: 4px;
}
.col-row .swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}
.col-row input[type="color"].color-picker {
  width: 22px;
  height: 22px;
  padding: 1px;
  border: 1px solid #2a3340;
  border-radius: 3px;
  cursor: pointer;
  flex-shrink: 0;
  background: none;
}
.col-row input[type="color"].color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.col-row input[type="color"].color-picker::-webkit-color-swatch { border: none; border-radius: 2px; }
.col-row input[type="color"].color-picker::-moz-color-swatch { border: none; border-radius: 2px; }
.col-row .name { flex: 1; font-size: 0.85rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-row input[type="number"] {
  width: 70px;
  background: #161b22;
  color: #e6edf3;
  border: 1px solid #2a3340;
  border-radius: 3px;
  padding: 0.15rem 0.3rem;
  font-size: 0.8rem;
}

/* Time window */
.time-window { display: flex; flex-direction: column; gap: 0.5rem; }
.slider-row { display: flex; align-items: center; gap: 0.75rem; }
.slider-row input[type="range"] { flex: 1; }
.slider-row span:first-child { width: 40px; font-size: 0.85rem; color: #8b96a8; }
.slider-row span:last-child { width: 110px; font-size: 0.8rem; text-align: right; color: #c4cdda; font-variant-numeric: tabular-nums; }

/* Chart */
.chart-wrap {
  position: relative;
  height: 460px;
}
@media (max-width: 700px) {
  .chart-wrap { height: 360px; }
}

/* Stats */
.stats-table {
  display: grid;
  grid-template-columns: 1fr repeat(3, minmax(70px, auto));
  font-size: 0.85rem;
  gap: 0.25rem 1rem;
}
.stats-table .head { color: #8b96a8; font-weight: 600; border-bottom: 1px solid #1f2733; padding-bottom: 0.25rem; }
.stats-table .name { display: flex; align-items: center; gap: 0.4rem; }
.stats-table .num { font-variant-numeric: tabular-nums; }
