:root {
  --color-ink:    #1a1a1a;  /* primary text, borders, dark backgrounds */
  --color-bg:     #f4f1eb;  /* page background, inverted text */
  --color-alt:    #eae6de;  /* alternating slab row background */
}

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

body {
  font-family: Georgia, serif;
  background: var(--color-bg);
  color: var(--color-ink);
  min-height: 100vh;
  padding: 2rem 1rem;
}

.container { max-width: 760px; margin: 0 auto; }

h1 {
  font-size: 1.6rem;
  font-weight: normal;
  border-bottom: 2px solid var(--color-ink);
  padding-bottom: 0.5rem;
  margin-bottom: 0.4rem;
}

/* Doubles as the toggle link between the two calculators */
.nav-link {
  display: inline-block;
  font-size: 0.85rem;
  color: #555;
  text-decoration: none;
  margin-bottom: 1.8rem;
  border-bottom: 1px dashed #999;
}
.nav-link:hover { color: var(--color-ink); }

label { display: block; font-size: 0.9rem; margin-bottom: 0.3rem; color: #444; }

input[type="number"] {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 1rem;
  font-family: Georgia, serif;
  border: 1px solid #ccc;
  background: #fff;
  outline: none;
  margin-bottom: 1rem;
}
input[type="number"]:focus {
  border-color: var(--color-ink);
  outline: 2px solid var(--color-ink);
  outline-offset: 1px;
}

button {
  padding: 0.6rem 1.6rem;
  font-size: 0.95rem;
  font-family: Georgia, serif;
  background: var(--color-ink);
  color: var(--color-bg);
  border: none;
  cursor: pointer;
}
button:hover:not(:disabled) { background: #333; }
button:disabled { background: #999; cursor: not-allowed; }

/* Error and diagnostic messages */
.msg-error { margin-top: 1rem; color: #c0392b; font-size: 0.9rem; }
.msg-warn  { margin-top: 1rem; color: #c07000; font-size: 0.9rem; }
.msg-info  { margin-top: 0.6rem; font-size: 0.82rem; color: #666; font-style: italic; }

.result-section { margin-top: 2rem; }

/* Label showing which slab set was applied */
.set-label { font-size: 0.85rem; color: #555; margin-bottom: 0.5rem; font-style: italic; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 0.4rem;
}

thead th {
  text-align: left;
  padding: 0.5rem 0.6rem;
  background: var(--color-ink);
  color: var(--color-bg);
  font-weight: normal;
  font-size: 0.85rem;
}

/* Slab grouping: alternating background per slab-group, not per row.
   JS stamps data-slab-index on each row; CSS uses that to alternate. */
tbody tr[data-slab-index]          { background: #fff; }
tbody tr[data-slab-index].slab-alt { background: var(--color-alt); }

tbody td { padding: 0.45rem 0.6rem; border-bottom: 1px solid #d5d0c8; }

/* Fixed-charge rows are visually distinct within their slab group */
.fixed-row td { font-style: italic; color: #555; }

.total-row td {
  padding: 0.55rem 0.6rem;
  font-weight: bold;
  background: var(--color-ink);
  color: var(--color-bg);
  border: none;
}

.big-total { margin-top: 1rem; font-size: 1.3rem; }

/* Multiple-candidate blocks shown in reverse calc when ambiguous */
.candidates { margin-top: 1.2rem; }
.candidate-block { margin-bottom: 1.6rem; border-left: 3px solid #ccc; padding-left: 1rem; }
