:root { color-scheme: light dark; }
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.4;
}
.container {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 16px;
}
h1 { font-size: 24px; margin: 0; }
.header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.header-actions { display: inline-flex; align-items: center; gap: 8px; }
.icon-btn { border: 1px solid rgba(127,127,127,0.35); background: transparent; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.icon-btn:hover { background: rgba(127,127,127,0.1); }
.toast-message { position: fixed; top: 12px; right: 16px; background: rgba(0,0,0,0.8); color: #fff; padding: 6px 10px; border-radius: 6px; font-size: 12px; z-index: 1000; }
.card.test-results { margin-top: 12px; }
.card.test-results table { width: 100%; border-collapse: collapse; }
.card.test-results table th, .card.test-results table td { padding: 8px; font-size: 12px; }
.card.test-results table td { text-align: left; }
.left-column-card { grid-column: 1; }
.full-width-card { grid-column: 1 / -1; }
.card.test-results table th:nth-child(2),
.card.test-results table td:nth-child(2) { text-align: center; }
.card.test-results table td.num, .card.test-results table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.card.test-results table td.highlight { background: rgba(0, 160, 0, 0.18); font-weight: 700; }
h2 { font-size: 18px; margin: 0 0 12px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.card {
  border: 1px solid rgba(127,127,127,0.3);
  border-radius: 8px;
  padding: 16px;
  background: rgba(127,127,127,0.05);
}

.card.solvent { background: rgba(0, 200, 0, 0.08); }
.card.insolvent { background: rgba(220, 20, 60, 0.08); }
.card.sold-house { background: rgba(255, 215, 0, 0.18); }
.card details summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 8px;
}
.card details[open] summary { margin-bottom: 12px; }


.form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}

.form label { display: grid; gap: 6px; font-size: 13px; }
.form-sub { grid-column: 1 / -1; font-weight: 700; font-size: 12px; text-transform: uppercase; border-bottom: 1px solid rgba(127,127,127,0.35); padding: 6px 0 4px; margin-top: 4px; }
.form .inline { display: inline-flex; gap: 12px; align-items: center; }
.row-inline { grid-column: 1 / -1; display: flex; gap: 16px; align-items: center; flex-wrap: nowrap; }
.row-inline .inline { white-space: nowrap; }
.row-inline .inline.tight { white-space: nowrap; }
.rent-radio-group { grid-column: 1 / -1; display: grid; gap: 6px; margin-top: -4px; }
.rent-radio-group .radio { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.input-narrow { width: 88px; max-width: 88px; }
.form label.tight { gap: 4px; }
.form input[type="number"] {
  width: 100%;
  padding: 8px;
  border: 1px solid rgba(127,127,127,0.35);
  border-radius: 6px;
}
.form label.inline { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 8px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; font-size: 13px; }
th { width: 60%; font-weight: 600; }
tr:nth-child(odd) td, tr:nth-child(odd) th { background: rgba(127,127,127,0.05); }

.results .card table td { text-align: right; font-variant-numeric: tabular-nums; }
.results .card table th.sub { background: transparent; color: inherit; font-weight: 700; text-transform: uppercase; font-size: 14px; letter-spacing: .04em; border-bottom: 2px solid rgba(127,127,127,0.35); padding-top: 14px; }

.tabs { display: flex; gap: 8px; margin: 8px 0 12px; }
.tab-btn { border: 1px solid rgba(127,127,127,0.35); background: transparent; padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.tab-btn.active { background: rgba(127,127,127,0.15); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.scenario-select select {
  min-width: 320px;
  padding: 8px;
  border: 1px solid rgba(127,127,127,0.35);
  border-radius: 6px;
  background: transparent;
}

footer { margin-top: 12px; color: rgba(127,127,127,0.9); }


