/* TET2-VAF-Adjusted CMML Risk Calculator — minimalist styling */

:root {
  --bg: #f7f8fa;
  --card-bg: #ffffff;
  --border: #e1e5eb;
  --text: #1a1f2e;
  --text-muted: #5b6577;
  --primary: #2c5282;
  --primary-hover: #1f3a5f;
  --highlight-bg: #fffbe6;
  --highlight-border: #f0c419;

  /* Risk colors */
  --risk-low: #2e8b57;
  --risk-int: #d97706;
  --risk-int1: #c2a800;
  --risk-int2: #d97706;
  --risk-high: #c0392b;

  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --radius: 6px;
  --maxw: 880px;
}

* { box-sizing: border-box; }

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

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

header {
  text-align: center;
  padding: 1.25rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

header h1 {
  margin: 0 0 0.5rem;
  font-size: 1.65rem;
  color: var(--primary);
  font-weight: 600;
}

header .subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.card h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

/* Form */

.field {
  margin-bottom: 1rem;
  border: none;
  padding: 0;
}

.field label,
.field legend {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

.field select,
.field input[type="number"] {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: #fff;
  color: var(--text);
}

.field select:focus,
.field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.15);
}

.hint {
  display: block;
  margin-top: 0.3rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

label.radio {
  display: inline-flex;
  align-items: center;
  margin-right: 1.2rem;
  font-weight: 400;
  cursor: pointer;
}

label.radio input {
  margin-right: 0.4rem;
}

button.primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.7rem 1.4rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}

button.primary:hover { background: var(--primary-hover); }

/* Output */

.result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.result-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}

.result-row:last-child { border-bottom: none; }

.result-row.big {
  font-size: 1.1rem;
  padding: 0.65rem 0;
}

.result-label {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.result-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.result-value.highlight {
  background: var(--highlight-bg);
  border: 1px solid var(--highlight-border);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
}

/* Risk-category color tags */
.risk-low    { color: white; background: var(--risk-low);  }
.risk-int    { color: white; background: var(--risk-int);  }
.risk-int-1  { color: white; background: var(--risk-int1); }
.risk-int-2  { color: white; background: var(--risk-int2); }
.risk-high   { color: white; background: var(--risk-high); }

.risk-tag {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* KM table */

table.km {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  font-variant-numeric: tabular-nums;
}

table.km th, table.km td {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  text-align: center;
}

table.km thead th {
  background: #f1f3f6;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
}

table.km .row-h {
  text-align: left;
  background: #fafbfc;
  color: var(--text);
}

.km-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-style: italic;
}

/* Notes */

.notes ol {
  padding-left: 1.3rem;
  margin: 0.5rem 0 0.8rem;
  font-size: 0.92rem;
}

.notes ol li {
  margin-bottom: 0.4rem;
}

.caveat {
  background: #fff7ed;
  border-left: 3px solid #d97706;
  padding: 0.6rem 0.8rem;
  font-size: 0.88rem;
  margin: 0.8rem 0 0;
  border-radius: 0 4px 4px 0;
}

footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

footer p { margin: 0.3rem 0; }

footer a {
  color: var(--primary);
  text-decoration: none;
}

footer a:hover { text-decoration: underline; }

/* Responsive */

@media (max-width: 600px) {
  header h1 { font-size: 1.35rem; }
  .result-row { grid-template-columns: 1fr; gap: 0.2rem; }
  .result-row .result-label { font-size: 0.85rem; }
  table.km { font-size: 0.85rem; }
  table.km th, table.km td { padding: 0.35rem 0.4rem; }
}
