/* Personal Net Worth Calculator — content styles.
   Prefix: --nw-  /  .nw-

   Reference point: two side-by-side category panels (assets, liabilities)
   feed a single hero net-worth figure, backed by a 10-row combined
   breakdown table showing every category's share of its own side (assets
   share of total assets, liabilities share of total liabilities) — not
   mixed together, since comparing a mortgage's share of debt to cash's
   share of assets would conflate two different totals.

   THIS FILE STYLES THE CONTENT AREA ONLY. Chrome is owned by chrome.css. */

:root {
  --nw-surface: #ffffff;
  --nw-panel:   #f6f5f3;
  --nw-line:    #e0dcd4;
  --nw-text:    #191510;
  --nw-muted:   #6b6459;
  --nw-good:    #1c7a4c;
  --nw-bad:     #b3261e;
  --nw-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}

.nw-wrap {
  width: 100%;
  max-width: 38rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ── Input panels ────────────────────────────────────────────────────────── */

.nw-panel {
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--nw-line);
  border-radius: 2px;
  background: var(--nw-surface);
}

.nw-panel-title {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--nw-text);
}

.nw-field {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.nw-field:last-of-type { margin-bottom: 0; }

.nw-field label {
  font-size: 0.8125rem;
  color: var(--nw-muted);
}

.nw-field input {
  width: 9rem;
  box-sizing: border-box;
  padding: 0.5rem 0.625rem;
  font-family: var(--nw-mono);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--nw-text);
  background: var(--nw-surface);
  border: 1px solid var(--nw-line);
  border-radius: 2px;
}

.nw-field input:focus-visible {
  outline: 2px solid var(--tf-accent);
  outline-offset: -1px;
}

@media (max-width: 26rem) {
  .nw-field { grid-template-columns: 1fr; }
  .nw-field input { width: 100%; text-align: left; }
}

.nw-error {
  margin: 0.75rem 0 0;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--nw-bad);
  background: rgba(179, 38, 30, 0.06);
  border: 1px solid var(--nw-bad);
  border-radius: 2px;
}

/* ── Primary action button ──────────────────────────────────────────────── */

.nw-btn {
  display: block;
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--tf-accent-ink);
  background: var(--tf-accent);
  border: 1px solid var(--tf-accent);
  border-radius: 2px;
  cursor: pointer;
  margin-bottom: 1.5rem;
}

.nw-btn:hover  { background: var(--tf-accent-hover);  border-color: var(--tf-accent-hover); }
.nw-btn:active { background: var(--tf-accent-active); border-color: var(--tf-accent-active); }

.nw-btn:focus-visible {
  outline: 2px solid var(--tf-accent);
  outline-offset: 2px;
}

/* ── Hero + metrics ──────────────────────────────────────────────────────── */

.nw-hero {
  padding: 1.5rem;
  margin-bottom: 1rem;
  text-align: center;
  border: 1px solid var(--nw-line);
  border-radius: 2px;
  background: var(--nw-surface);
}

.nw-hero-label {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--nw-muted);
}

.nw-hero-value {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--tf-accent);
}

.nw-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

@media (max-width: 30rem) {
  .nw-grid { grid-template-columns: 1fr; }
}

.nw-metric {
  padding: 1rem 0.75rem;
  border: 1px solid var(--nw-line);
  border-radius: 2px;
  background: var(--nw-panel);
  text-align: center;
}

.nw-metric-label {
  margin: 0 0 0.375rem;
  font-size: 0.75rem;
  color: var(--nw-muted);
}

.nw-metric-value {
  margin: 0;
  font-size: 1.1875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--nw-text);
}

/* ── Breakdown table ─────────────────────────────────────────────────────── */

.nw-table {
  display: grid;
  border: 1px solid var(--nw-line);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.nw-row {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr 0.7fr;
  gap: 0.5rem;
  padding: 0.5625rem 1rem;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--nw-line);
  background: var(--nw-surface);
}

.nw-row:last-child { border-bottom: none; }

.nw-row-head {
  background: var(--nw-panel);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--nw-muted);
}

.nw-row--liability { background: rgba(179, 38, 30, 0.03); }

.nw-note {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--nw-muted);
}

/* ── Ad slots ───────────────────────────────────────────────────────────── */

.nw-ad {
  min-height: 280px;
  margin: 2rem auto 0;
  max-width: 38rem;
  padding-inline: 1.5rem;
}

@media (max-width: 26rem) {
  .nw-wrap,
  .nw-ad { padding-inline: 1rem; }
  .nw-panel { padding: 1.25rem; }
  .nw-row { grid-template-columns: 1.3fr 0.8fr 0.6fr; font-size: 0.8125rem; }
}

/* tf:dark-palette — generated by migrate_chrome.py */
/* Neutrals inherit the shared chrome tokens so all tools share one
   ground; brand hues are kept and lightened, never inverted. */
[data-theme="dark"] {
  --nw-surface: var(--tf-surface);
  --nw-panel: var(--tf-surface);
  --nw-line: var(--tf-rule);
  --nw-text: var(--tf-ink);
  --nw-muted: var(--tf-ink-soft);
  --nw-good: #5fd099;
  --nw-bad: #da8581;
}
