
:root{
  --bg: #0f1217;
  --card: #151a22;
  --text: #e6e8ec;
  --muted: #9aa3af;
  --green: #27ae60;
  --red: #e74c3c;
  --gray: #6b7280;
  --accent: #3b82f6;
  --border: #212734;
}

*{box-sizing:border-box}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font:16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji","Segoe UI Emoji";
}
header{
  padding:24px 16px 8px;
  max-width:1100px;
  margin:0 auto;
}
h1{margin:0 0 4px;font-size:24px}
.subtitle{margin:0;color:var(--muted)}

.controls{
  max-width:1100px;
  margin:16px auto;
  padding:12px 16px;
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}
.control{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:12px;
}
label{display:block;margin-bottom:6px;color:var(--muted)}
textarea{
  width:100%;min-height:120px;border-radius:12px;border:1px solid var(--border);
  background:#0c0f14;color:var(--text);padding:10px;resize:vertical;
}
input[type="text"]{
  width:100%;border-radius:12px;border:1px solid var(--border);
  background:#0c0f14;color:var(--text);padding:10px;
}
.row{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
button{
  background:#1d2635;color:var(--text);border:1px solid var(--border);
  padding:10px 14px;border-radius:12px;cursor:pointer;
}
button.primary{background:var(--accent);border-color:var(--accent);color:white}
button.ghost{background:transparent}
.small{color:var(--muted);margin-top:8px}

#chart{
  max-width:1100px;
  margin:8px auto 0;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:8px;
  height:520px;
}
#legend{
  max-width:1100px;margin:8px auto;color:var(--muted);display:flex;align-items:center;gap:16px;padding:0 8px
}
.legend-item{display:flex;align-items:center;gap:6px}
.swatch{display:inline-block;width:14px;height:14px;border-radius:50%}
.swatch.red{background:#e74c3c}
.swatch.green{background:#27ae60}
.swatch.gray{background:#6b7280}
.legend-note{margin-left:auto}

.table-wrap{
  max-width:1100px;margin:12px auto;background:var(--card);border:1px solid var(--border);
  border-radius:16px;overflow:hidden
}
table{width:100%;border-collapse:collapse}
th, td{padding:10px;border-bottom:1px solid var(--border);text-align:left;font-variant-numeric:tabular-nums}
thead th{background:#10151d;color:#9aa3af}
tbody tr:hover{background:#121a25}
