/* US Tax Calculator — base styles */

.ustax-wrap {
  max-width: 680px;
  margin: 0 auto;
  font-family: inherit;
}

.ustax-title { margin-bottom: 0.5rem; }

.ustax-lead {
  margin: 0 0 1.25rem;
  color: #555;
  font-size: 0.95rem;
}

/* Form */
.ustax-form {
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 1.5rem;
}

.ustax-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 480px) {
  .ustax-grid { grid-template-columns: 1fr; }
}

.ustax-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.ustax-grid .ustax-field { margin-bottom: 0; }

.ustax-field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #333;
}

.ustax-field select,
.ustax-field input[type="number"],
.ustax-field input[type="text"] {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}

.ustax-field select[multiple] { height: auto; padding: 0.25rem; }

.ustax-field select:focus,
.ustax-field input:focus {
  outline: 2px solid #0073aa;
  border-color: #0073aa;
}

/* Advanced section */
.ustax-advanced {
  margin-bottom: 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  background: #fff;
}

.ustax-advanced summary {
  cursor: pointer;
  font-size: 0.875rem;
  color: #555;
  user-select: none;
}

.ustax-advanced .ustax-field { margin-top: 0.75rem; margin-bottom: 0; }

/* Submit button */
.ustax-btn {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: #0073aa;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.ustax-btn:hover  { background: #005177; }
.ustax-btn:active { background: #003d57; }
.ustax-btn:disabled { background: #aaa; cursor: not-allowed; }

/* Result panel */
.ustax-result {
  margin-top: 1.5rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
}

.ustax-result__hero {
  background: #0073aa;
  color: #fff;
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ustax-result__hero-label  { font-size: 0.9rem; opacity: 0.9; }
.ustax-result__hero-amount { font-size: 1.75rem; font-weight: 700; }

.ustax-result__eff {
  margin: 0;
  padding: 0.625rem 1.5rem;
  background: #e8f4fb;
  font-size: 0.9rem;
  color: #005177;
}

.ustax-result__ratenote {
  margin: 0;
  padding: 0.5rem 1.5rem;
  background: #f4f7f9;
  border-bottom: 1px solid #e2e8ec;
  font-size: 0.85rem;
  color: #50575e;
}

.ustax-result__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.ustax-result__table thead th {
  padding: 0.5rem 1.5rem;
  text-align: right;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #666;
  border-bottom: 1px solid #ddd;
  background: #fafafa;
}

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

.ustax-result__table td {
  padding: 0.55rem 1.5rem;
  border-bottom: 1px solid #eee;
  text-align: right;
}

.ustax-result__table td:first-child { text-align: left; }

.ustax-result__total td {
  font-weight: 600;
  border-top: 2px solid #ddd;
  background: #fafafa;
}

.ustax-result__net td {
  font-weight: 700;
  font-size: 1.05rem;
  color: #1a7a1a;
}

.ustax-result__marginal {
  padding: 0.625rem 1.5rem;
  margin: 0;
  font-size: 0.85rem;
  color: #666;
  background: #fafafa;
  border-top: 1px solid #eee;
}

.ustax-error {
  padding: 1rem 1.5rem;
  color: #c00;
  background: #fff0f0;
  margin: 0;
}

/* Comparison table */
.ustax-cmp-scroll {
  margin-top: 1.5rem;
  overflow-x: auto;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.ustax-cmp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 420px;
}

.ustax-cmp-table th,
.ustax-cmp-table td {
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid #eee;
  text-align: right;
  white-space: nowrap;
}

.ustax-cmp-table thead th {
  background: #0073aa;
  color: #fff;
  font-weight: 600;
}

.ustax-cmp-table th:first-child,
.ustax-cmp-table td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: #f7f7f7;
  font-weight: 600;
}

.ustax-cmp-table thead th:first-child { background: #005177; }

.ustax-cmp-table .ustax-cmp-total td {
  font-weight: 600;
  border-top: 2px solid #ddd;
  background: #fafafa;
}

.ustax-cmp-table .ustax-cmp-total td:first-child { background: #f0f0f0; }

.ustax-cmp-table .ustax-cmp-net td { font-weight: 700; color: #1a7a1a; }

.ustax-cmp-table .ustax-cmp-rate td { color: #555; font-style: italic; }

/* Static / SEO table */
.ustax-static__title { margin: 0 0 0.5rem; }

.ustax-static .ustax-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.ustax-static .ustax-table caption {
  font-weight: 600;
  text-align: left;
  margin-bottom: 0.5rem;
  color: #333;
}

.ustax-static .ustax-table th,
.ustax-static .ustax-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #eee;
  text-align: left;
}

.ustax-static .ustax-table td { text-align: right; }

.ustax-static .ustax-row--total th,
.ustax-static .ustax-row--total td {
  font-weight: 700;
  border-top: 2px solid #ccc;
}

.ustax-static .ustax-row--net th,
.ustax-static .ustax-row--net td {
  font-weight: 700;
  color: #1a7a1a;
  font-size: 1.05rem;
}

/* ── Premium "How we got this number" breakdown ───────────────────────── */
.ustax-explain {
  margin-top: 1.25rem;
  border: 1px solid #e2e6ea;
  border-radius: 8px;
  background: #fafbfc;
  overflow: hidden;
}

.ustax-explain__summary {
  cursor: pointer;
  padding: 0.85rem 1rem;
  font-weight: 700;
  color: #1f3b57;
  background: #eef3f8;
  list-style: none;
}

.ustax-explain__summary::-webkit-details-marker { display: none; }
.ustax-explain__summary::before { content: '\25B6'; font-size: 0.7em; margin-right: 0.5rem; color: #6b7a89; }
.ustax-explain[open] .ustax-explain__summary::before { content: '\25BC'; }

.ustax-explain__body { padding: 0.5rem 1rem 1rem; }

.ustax-explain__basis {
  font-size: 0.85rem;
  color: #6b7a89;
  font-style: italic;
  margin: 0.5rem 0 0.75rem;
}

.ustax-explain__section {
  padding: 0.9rem 0;
  border-bottom: 1px solid #eceff2;
}
.ustax-explain__section:last-child { border-bottom: none; }

.ustax-explain__step {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: #1f3b57;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.ustax-explain__amt {
  font-variant-numeric: tabular-nums;
  color: #b23b3b;
  font-weight: 700;
}

.ustax-explain__section--total .ustax-explain__step { color: #1a7a1a; }

.ustax-explain__list {
  margin: 0.25rem 0 0.5rem;
  padding-left: 1.25rem;
}
.ustax-explain__list li { margin: 0.35rem 0; line-height: 1.5; }

.ustax-explain__note {
  margin: 0.5rem 0;
  line-height: 1.55;
  color: #333;
}

.ustax-explain__brackets {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0;
  font-size: 0.9rem;
}
.ustax-explain__brackets th,
.ustax-explain__brackets td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid #eceff2;
  text-align: right;
}
.ustax-explain__brackets th:nth-child(2),
.ustax-explain__brackets td:nth-child(2) { text-align: left; }
.ustax-explain__brackets thead th {
  background: #f2f5f8;
  color: #55636f;
  font-weight: 600;
}
.ustax-explain__brackets tfoot th,
.ustax-explain__brackets tfoot td {
  font-weight: 700;
  border-top: 2px solid #d7dee4;
}

/* Locked teaser (paywall placeholder) */
.ustax-explain--locked {
  text-align: center;
  padding: 1.5rem 1.25rem;
  background: linear-gradient(180deg, #fafbfc 0%, #f0f4f8 100%);
}
.ustax-explain__lockicon { font-size: 1.75rem; margin-bottom: 0.35rem; }
.ustax-explain__title { margin: 0 0 0.35rem; color: #1f3b57; font-size: 1.1rem; }
.ustax-explain__blurb { margin: 0 auto 0.75rem; max-width: 34rem; color: #55636f; line-height: 1.5; }
.ustax-explain__badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: #1f3b57;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Caveat notes: state figure estimated via single-filer bracket fallback */
.ustax-fallback-note,
.ustax-explain__note--caveat {
  margin: 0.5rem 0;
  padding: 0.6rem 0.9rem;
  background: #fff8e1;
  border-left: 4px solid #e6a817;
  color: #5c4a12;
  line-height: 1.5;
  font-size: 0.92rem;
}

/* ── Tax-rate lister (information-page reference tables) ─────────────── */
.ustax-lister { margin: 1.5rem 0; }

.ustax-lister__title { margin: 0 0 0.75rem; }

.ustax-tablewrap {
  overflow-x: auto;
  border: 1px solid #e2e6ea;
  border-radius: 6px;
  margin: 0 0 0.75rem;
}

.ustax-lister__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.ustax-lister__table caption {
  caption-side: top;
  text-align: left;
  font-weight: 700;
  color: #1f3b57;
  padding: 0.65rem 0.9rem;
  background: #eef3f8;
  border-bottom: 1px solid #e2e6ea;
}

.ustax-lister__table th,
.ustax-lister__table td {
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid #eee;
  text-align: right;
  white-space: nowrap;
}

.ustax-lister__table thead th {
  background: #0073aa;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

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

.ustax-lister__table tbody th[scope="row"] {
  text-align: left;
  font-weight: 600;
  background: #fafafa;
  color: #333;
}

.ustax-lister__table tbody tr:nth-child(even) td { background: #fafbfc; }

.ustax-lister__table tbody tr:last-child th,
.ustax-lister__table tbody tr:last-child td { border-bottom: none; }

.ustax-lister__rate { font-variant-numeric: tabular-nums; }

/* Cells holding sentences, not single numbers (specificity must beat the
   .ustax-lister__table td nowrap rule above) */
.ustax-lister__table .ustax-lister__cell--wrap {
  white-space: normal;
  min-width: 14rem;
  text-align: left;
}

.ustax-lister__cell--net { color: #1a7a1a; font-weight: 600; }

/* Highlighted combined / effective-rate column */
.ustax-lister__table thead th.ustax-lister__col--combined { background: #005177; }
.ustax-lister__table td.ustax-lister__col--combined {
  font-weight: 700;
  color: #1f3b57;
  background: #eef3f8;
}
.ustax-lister__table tbody tr:nth-child(even) td.ustax-lister__col--combined { background: #e4edf5; }

/* No-tax / flat-tax statement */
.ustax-lister__callout {
  margin: 0 0 0.75rem;
  padding: 0.75rem 1rem;
  background: #e8f4fb;
  border-left: 4px solid #0073aa;
  color: #1f3b57;
  line-height: 1.55;
}

/* Explanatory footnote under a table */
.ustax-lister__note {
  margin: 0.25rem 0 1rem;
  font-size: 0.875rem;
  color: #666;
  line-height: 1.55;
}

/* State-deviation rules list (federal-tax deduction, pre-tax addbacks) */
.ustax-lister__rules {
  margin: 0.25rem 0 1rem;
  padding-left: 1.25rem;
}
.ustax-lister__rules li {
  margin: 0.4rem 0;
  line-height: 1.55;
  color: #333;
  font-size: 0.9rem;
}

/* "Data verified — Source" freshness footnote */
.ustax-lister__meta {
  margin: 0.25rem 0 1rem;
  font-size: 0.8rem;
  color: #888;
  font-style: italic;
}
.ustax-lister__meta a { color: #667; }
