:root {
  --bg: #0d1117;
  --card: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --dim: #8b949e;
  --accent: #58a6ff;
  --green: #3fb950;
  --red: #f85149;
  --green-bg: rgba(63, 185, 80, 0.15);
  --red-bg: rgba(248, 81, 73, 0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  max-width: 880px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

header { text-align: center; margin-bottom: 2rem; }
header h1 { font-size: 2.4rem; letter-spacing: -0.02em; }
.tagline { font-size: 1.15rem; margin-top: 0.4rem; }
.privacy { color: var(--green); font-size: 0.9rem; margin-top: 0.35rem; }
nav { margin-top: 0.9rem; display: flex; gap: 0.9rem; justify-content: center; align-items: center; flex-wrap: wrap; }
nav a { color: var(--accent); text-decoration: none; }
nav a:hover { text-decoration: underline; }
.pill { background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 0.25rem 0.8rem; font-size: 0.85rem; }

.status { text-align: center; padding: 2.5rem 1rem; color: var(--dim); font-size: 1.05rem; }
.status.error { color: var(--red); }

.spinner {
  width: 40px; height: 40px;
  margin: 0 auto 1.2rem;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status-steps { display: inline-block; text-align: left; }
.step { padding: 0.2rem 0; color: var(--dim); }
.step::before { content: "○  "; }
.step.active { color: var(--text); }
.step.active::before { content: "●  "; color: var(--accent); }
.step.done { color: var(--dim); }
.step.done::before { content: "✓  "; color: var(--green); }

.input-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }

.dropzone {
  flex: 2 1 320px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 2.2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: rgba(88, 166, 255, 0.06); }
.dropzone span { color: var(--dim); font-size: 0.9rem; }

.side-controls { flex: 1 1 200px; display: flex; flex-direction: column; gap: 0.7rem; }
.side-controls label { color: var(--dim); font-size: 0.85rem; }

button.secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem;
  cursor: pointer;
  font-size: 0.95rem;
}
button.secondary:hover { border-color: var(--accent); }
button.secondary small { color: var(--dim); }

select {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem;
  font-size: 0.95rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem;
  margin-bottom: 1.5rem;
}
.card h2 { font-size: 1.1rem; margin-bottom: 0.8rem; }

#verdict-head { font-size: 1.05rem; margin-bottom: 1rem; }
#verdict-head .verdict-line { font-size: 1.5rem; font-weight: 700; margin-top: 0.5rem; display: block; }
.fits { color: var(--green); }
.no-fit { color: var(--red); }

.meter-row { display: flex; align-items: center; gap: 0.7rem; margin: 0.45rem 0; }
.meter-label { width: 3.2rem; font-weight: 600; font-size: 0.9rem; }
.meter { flex: 1; height: 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.meter-fill { height: 100%; width: 0; border-radius: 7px; transition: width 0.5s ease; }
.meter-fill.ok { background: var(--green); }
.meter-fill.over { background: var(--red); }
.meter-text { font-size: 0.85rem; color: var(--dim); min-width: 12rem; text-align: right; }

.dim { color: var(--dim); font-size: 0.85rem; margin-top: 0.7rem; }
.estimate-note { margin-top: 1rem; padding: 0.7rem 0.9rem; border: 1px solid var(--border); border-left: 3px solid #d29922; border-radius: 8px; font-size: 0.88rem; }
.estimate-note.measured { border-left-color: var(--green); }
.estimate-note.measured code { display: inline; white-space: normal; padding: 0.1rem 0.3rem; }
.estimate-note code { display: block; margin: 0.45rem 0; padding: 0.45rem 0.6rem; background: var(--bg); border-radius: 6px; overflow-x: auto; white-space: nowrap; font-size: 0.82rem; }
.estimate-note .dim { margin-top: 0.2rem; display: block; }
.method-note { margin-top: 1rem; }
#suggestions { margin: 0.8rem 0 0 1.2rem; }
#suggestions li { margin: 0.3rem 0; color: var(--accent); }

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border); }
th { color: var(--dim); font-weight: 600; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.highlight { background: rgba(88, 166, 255, 0.08); }

footer { text-align: center; color: var(--dim); font-size: 0.85rem; margin-top: 2rem; }
.why-quote { max-width: 560px; margin: 1.2rem auto; padding: 0.8rem 1.2rem; border-left: 3px solid var(--accent); text-align: left; font-style: italic; }
.why-quote cite { display: block; margin-top: 0.4rem; font-style: normal; }
footer a { color: var(--accent); }
footer p { margin: 0.4rem 0; }

@media (max-width: 600px) {
  .meter-text { min-width: 0; }
  header h1 { font-size: 1.9rem; }
}
