/* US corporate tax calculator. Tokens, header and footer come from the site stylesheet. */
.intro h1 { font-size: 22px; margin: 0 0 12px; }

/* Two halves: the form on the left, the result on the right, kept in view while you scroll the form.
   One column on narrow screens, the result under the form. */
.narrow.calc-page { max-width: 1160px; }
.calc-page > .guide { max-width: 820px; margin-left: auto; margin-right: auto; }
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 8px; }
/* The result column: the result, then its links (API, Bookmark, Copy link) under it, both in view. */
.calc .side { position: sticky; top: calc(var(--top-h, 53px) + 16px); }
.calc .out { max-height: calc(100vh - var(--top-h, 53px) - 70px); overflow: auto; margin: 0; }
.footnote { font-size: 13px; }
@media (max-width: 1000px) {
  .calc { grid-template-columns: minmax(0, 1fr); }
  .calc .side { position: static; }
  .calc .out { max-height: none; }
}

/* Each field spans three shared rows (caption, control, hint), so controls line up across a row
   whether or not a neighbour's caption wraps or has a hint under it. */
.fields { display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 12px; row-gap: 0; margin: 12px 0 4px; }
.fields label { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 6px; padding-bottom: 16px; min-width: 0; font-weight: 600; }
.fields label > :first-child { align-self: end; }
.fields label.wide { grid-column: 1 / -1; }
.inputs > .fields:first-child { margin-top: 0; }
.fields .field-hint { font-size: 12px; font-weight: 400; line-height: 1.35; color: var(--muted); }
.fields label .muted { font-weight: 400; }
.fields input, .fields select {
  width: 100%; min-width: 0; font: inherit; font-size: 15px; min-height: 43px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text);
}
.fields input { font-size: 17px; font-variant-numeric: tabular-nums; }
.fields input:focus, .fields select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.fields input[aria-invalid="true"] { border-color: var(--err); }
.group-title { font-size: 15px; margin: 10px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.group-title .muted { font-weight: 400; }

.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; margin: 12px 0; }

.out { margin: 0 0 16px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.out .hint { margin: 0; }
.out .err { color: var(--err); }
.net { display: flex; flex-direction: column; gap: 2px; }
.net strong { font-size: 32px; font-weight: 700; color: var(--ok); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.verdict { margin: 10px 0 0; font-weight: 600; }

.breakdown { width: 100%; margin-top: 14px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.breakdown th, .breakdown td { padding: 7px 0; border-top: 1px solid var(--line); vertical-align: baseline; }
.breakdown thead th { border-top: 0; padding-top: 0; font-size: 12.5px; font-weight: 500; color: var(--muted); text-align: right; padding-left: 14px; }
.breakdown thead th:first-child { text-align: left; color: var(--text); font-weight: 650; font-size: 14px; padding-left: 0; }
.breakdown tbody th { text-align: left; font-weight: 500; padding-right: 12px; }
.breakdown td { text-align: right; white-space: nowrap; padding-left: 14px; }
.breakdown tr.sum th, .breakdown tr.sum td { font-weight: 650; }
.breakdown tr.net-row td { color: var(--ok); }
.breakdown tr.cost-row td { color: var(--text); }
.breakdown.carry { margin-top: 22px; }
.out .note { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

/* The effective tax rate, highlighted under the headline (as on German Gross to Net). */
.rates { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.rates li {
  padding: 5px 11px; border-radius: 999px; font-size: 13px; color: var(--muted); cursor: help;
  background: var(--bg); border: 1px solid var(--line);
}
.rates strong { font-size: 16px; color: var(--text); font-variant-numeric: tabular-nums; }
.rates .rate-tax { background: color-mix(in srgb, var(--amber) 22%, var(--panel)); border-color: color-mix(in srgb, var(--amber) 70%, var(--line)); color: var(--text); }
