body {
  max-width: 720px;
  margin: 2rem auto;
  padding: 0 1rem 3rem;
}

h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

body > p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-top: 0.3rem;
  margin-bottom: 1.5rem;
}

section {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  margin-top: 0.9rem;
  color: var(--color-text);
}

label:first-child {
  margin-top: 0;
}

input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  font-family: var(--font-family-mono);
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--color-accent-1);
}

.error {
  color: var(--color-error);
  min-height: 1.2em;
  font-size: 0.9rem;
  margin-top: 0.6rem;
}

.capacity-message {
  color: var(--color-error);
  min-height: 1.2em;
  font-size: 0.9rem;
}

.result-line {
  margin-top: 0.6rem;
  color: var(--color-text-subtle);
}

.result-line span:first-child {
  font-weight: 600;
  color: var(--color-text);
}

.result-value {
  font-family: var(--font-family-mono);
  color: var(--color-accent-1);
}

.assumptions-note {
  margin-top: 0.6rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

.rounding-note {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

#save-scenario-button {
  margin-top: 1rem;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
}

#save-scenario-button:hover:not(:disabled) {
  border-color: var(--color-accent-1);
}

#save-scenario-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#clear-history-button {
  margin-bottom: 1rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--color-error);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
}

#clear-history-button:hover {
  border-color: var(--color-error);
}

#history-table button {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--color-error);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  cursor: pointer;
}

.table-wrapper {
  max-height: 480px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-family-mono);
  font-size: 0.85rem;
}

thead th {
  position: sticky;
  top: 0;
  background: var(--color-card-bg);
  color: var(--color-text);
  text-align: right;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--color-border);
}

thead th:first-child {
  text-align: left;
}

tbody td {
  text-align: right;
  padding: 0.4rem 0.6rem;
  color: var(--color-text-subtle);
  border-bottom: 1px solid var(--color-border);
}

tbody td:first-child {
  text-align: left;
  color: var(--color-text-muted);
}
