:root {
  --bg: #0f1216;
  --panel: #171b21;
  --border: #2a2f38;
  --text: #e6e9ef;
  --muted: #9aa4b2;
  --accent: #4f8cff;
  --ok: #3ecf8e;
  --watch: #e0c341;
  --atrisk: #e08a3e;
  --critical: #e0503e;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f8fa;
    --panel: #ffffff;
    --border: #dde1e7;
    --text: #14171c;
    --muted: #5c6470;
  }
}

* { box-sizing: border-box; }

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

.masthead {
  padding: 2rem 1.5rem 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.masthead h1 { margin: 0 0 0.25rem; font-size: 1.6rem; }
.tagline { color: var(--muted); margin: 0; }

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

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
}

.input-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

textarea {
  width: 100%;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.85rem;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem;
}

button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
}

button#loadSampleBtn {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.status { color: var(--muted); min-height: 1.2em; }

.notice {
  background: rgba(224, 195, 65, 0.12);
  border: 1px solid var(--watch);
  color: var(--text);
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.summary {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.summary .chip {
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th, td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th { color: var(--muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; }

.risk-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #14171c;
  white-space: nowrap;
}

.risk-OK { background: var(--ok); }
.risk-Watch { background: var(--watch); }
.risk-AtRisk { background: var(--atrisk); }
.risk-Critical { background: var(--critical); color: white; }

.reasons { margin: 0; padding-left: 1.1rem; color: var(--muted); }

.warnings { margin-top: 1rem; color: var(--watch); font-size: 0.85rem; }

.site-footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

@media (max-width: 600px) {
  table, thead, tbody, th, td, tr { display: block; }
  thead { display: none; }
  td {
    border: none;
    padding: 0.2rem 0;
  }
  tr { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
  td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.7rem;
    color: var(--muted);
    text-transform: uppercase;
  }
}
