/* Paycheck Book — everyday U.S. money UI. Independent tokens. */
:root {
  --navy: #16324a;
  --navy-mid: #1e3d59;
  --paper: #f3f6f8;
  --paper-deep: #e6eef3;
  --cream: #ffffff;
  --ink: #1b2834;
  --ink-soft: #4a5b6a;
  --rule: #d5dee6;
  --teal: #0b7a64;
  --teal-deep: #086352;
  --teal-soft: #e6f5f1;
  --copper: #0b7a64;
  --copper-deep: #086352;
  --gold: #0b7a64;
  --forest: #0b7a64;
  --forest-soft: #109278;
  --warn: #b42318;
  --warn-bg: #fef3f2;
  --result-bg: #ffffff;
  --focus: #0b7a64;
  --max: 72rem;
  --label: 0.92rem;
  --body: 1.05rem;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(22, 50, 74, 0.07);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #eaf3f1 0, var(--paper) 16rem);
  color: var(--ink);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: var(--body);
  line-height: 1.55;
}

img {
  max-width: 100%;
}

a {
  color: var(--teal-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--teal);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: var(--teal);
  color: #fff;
  padding: 0.45rem 0.75rem;
  z-index: 8;
}

.skip:focus {
  top: 0.75rem;
}

.mast {
  background: #fff;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
}

.mast-inner,
.wrap,
.foot-inner {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

.mast-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1.5rem;
  padding: 0.85rem 0 0.9rem;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.55rem 0.7rem;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.wordmark strong {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.28rem;
  font-weight: 700;
}

.wordmark strong::before {
  content: "";
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 6px;
  background: var(--teal);
  box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 4px var(--teal);
}

.wordmark span {
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 500;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
}

.nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 0.48rem 0.62rem;
  border-radius: 8px;
}

.nav a:hover {
  color: var(--teal-deep);
  background: var(--teal-soft);
}

.nav a[aria-current="page"] {
  color: var(--teal-deep);
  background: var(--teal-soft);
  box-shadow: inset 0 -2px 0 var(--teal);
}

.learn {
  border-top: 1px solid var(--rule);
  background: #eef4f2;
}

.learn-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.15rem;
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
  padding: 0.35rem 0 0.5rem;
}

.learn-lbl {
  margin: 0 0.65rem 0 0;
  color: var(--teal-deep);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.learn a {
  color: var(--ink);
  text-decoration: none;
  padding: 0.4rem 0.62rem;
  border-radius: 8px;
}

.learn a:hover {
  color: var(--teal-deep);
  background: #fff;
}

.learn a[aria-current="page"] {
  color: var(--teal-deep);
  box-shadow: inset 0 -2px 0 var(--teal);
}

.mast :focus-visible {
  outline-color: var(--teal);
}

#main {
  scroll-margin-top: 0.75rem;
}

.hero {
  padding: 1.75rem 0 0.35rem;
}

.kicker {
  margin: 0 0 0.45rem;
  color: var(--teal-deep);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

h1,
h2,
h3,
.display {
  font-family: inherit;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
}

.lede,
.prose p,
.faq p,
.note p {
  max-width: 44rem;
}

.lede {
  margin: 0 0 1.15rem;
  color: var(--ink-soft);
  font-size: 1.1rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 0 0.35rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  margin: 0;
  padding: 0.95rem 1rem 1rem 2.7rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0.85rem;
  top: 0.95rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4rem;
  text-align: center;
}

.steps strong {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--ink);
  font-size: 1.02rem;
}

.try {
  margin: 0 0 0.55rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1.05rem;
}

.chip {
  appearance: none;
  border: 1px solid #c5d4ce;
  background: var(--teal-soft);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.42rem 0.75rem;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--teal);
  background: #fff;
  color: var(--teal-deep);
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  gap: 1.35rem;
  align-items: start;
  margin: 1.35rem 0 2.1rem;
}

.panel,
.ledger {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  padding: 1.25rem 1.2rem 1.35rem;
  border-top: 4px solid var(--teal);
}

fieldset.panel {
  margin: 0 0 1rem;
  min-width: 0;
}

legend.display {
  padding: 0 0.4rem;
  font-size: 1.2rem;
}

.ledger {
  position: relative;
  padding: 1.3rem 1.3rem 1.45rem;
  min-height: 22rem;
  border-top: 4px solid var(--forest);
  background:
    linear-gradient(180deg, var(--teal-soft), #fff 6.5rem);
}

.panel h2,
.ledger h2 {
  margin: 0 0 0.85rem;
  font-size: 1.22rem;
}

.field {
  margin: 0 0 0.95rem;
}

.field label,
.field .lbl {
  display: block;
  margin-bottom: 0.28rem;
  font-size: var(--label);
  font-weight: 600;
}

.hint {
  display: block;
  margin: 0.28rem 0 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.field input,
.field select {
  width: 100%;
  min-height: 2.8rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #b7c4cc;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(11, 122, 100, 0.18);
  outline: none;
}

.field input:user-invalid,
.field.is-bad input,
.field.is-bad select {
  border-color: var(--warn);
  background: var(--warn-bg);
}

.err {
  display: none;
  margin: 0.3rem 0 0;
  color: var(--warn);
  font-size: 0.9rem;
}

.field.is-bad .err {
  display: block;
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.05rem;
  margin-top: 0.35rem;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.go:hover {
  background: var(--teal-deep);
  border-color: var(--teal-deep);
}

.go:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.amount {
  margin: 0 0 0.35rem;
  color: var(--forest);
  font-size: clamp(2.1rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.amount-sub {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}

.amount.is-negative {
  color: var(--warn);
}

.amount.is-date {
  font-size: clamp(1.3rem, 3vw, 1.85rem);
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.mix {
  margin: 0 0 1.1rem;
}

.mix[hidden] {
  display: none;
}

.mix-label {
  margin: 0 0 0.45rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.mix-track {
  display: flex;
  overflow: hidden;
  height: 0.85rem;
  border-radius: 999px;
  background: var(--paper-deep);
}

.mix-seg {
  display: block;
  min-width: 0;
  height: 100%;
}

.mix-seg.is-net {
  background: var(--forest);
}

.mix-seg.is-fica {
  background: #2b6cb0;
}

.mix-seg.is-fed {
  background: #c05621;
}

.mix-seg.is-state {
  background: #6b5b2e;
}

.mix-seg.is-pretax {
  background: #64748b;
}

.mix-key {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  margin: 0.55rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.mix-key li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.mix-key i {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
}

.mix-key .is-net {
  background: var(--forest);
}

.mix-key .is-fica {
  background: #2b6cb0;
}

.mix-key .is-fed {
  background: #c05621;
}

.mix-key .is-state {
  background: #6b5b2e;
}

.mix-key .is-pretax {
  background: #64748b;
}

.ledger-follow {
  margin: 0 0 2rem;
}

.lines {
  margin: 0;
  padding: 0;
}

.lines div {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--rule);
}

.lines dt,
.lines .k {
  color: var(--ink-soft);
}

.lines dd,
.lines .v {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.sentence {
  margin: 1rem 0 0;
}

.assumptions {
  margin: 1rem 0 0;
  padding-left: 1.15rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.muted {
  color: var(--ink-soft);
}

.note {
  margin: 0 0 1.7rem;
  padding: 1rem 1.1rem;
  border: 1px solid #f0d0b8;
  border-radius: var(--radius);
  background: #fff7f0;
}

.note strong {
  display: block;
  margin-bottom: 0.3rem;
  color: #9a4b1f;
  font-size: 1.05rem;
}

.prose,
.faq {
  margin: 0 0 2rem;
}

.prose h2,
.faq h2 {
  margin: 0 0 0.7rem;
  font-size: 1.4rem;
}

.faq h3 {
  margin: 1.2rem 0 0.35rem;
  font-size: 1.08rem;
}

.tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.9rem;
  margin: 0.4rem 0 2.2rem;
}

.tools a {
  display: block;
  padding: 1rem 1.05rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(22, 50, 74, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.tools a:hover {
  transform: translateY(-2px);
  border-color: #9cc4b8;
  box-shadow: var(--shadow);
  color: inherit;
}

.tools a strong {
  display: block;
  margin-bottom: 0.28rem;
  color: var(--teal-deep);
  font-size: 1.1rem;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.foot {
  border-top: 1px solid var(--rule);
  background: #fff;
  padding: 1.6rem 0 2.1rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.foot a {
  color: var(--teal-deep);
}

.foot a:hover {
  color: var(--teal);
}

.foot p {
  max-width: 52rem;
}

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  margin: 0 0 0.95rem;
  padding: 0;
  list-style: none;
}

@media (max-width: 820px) {
  .stage,
  .pair,
  .split,
  .steps {
    grid-template-columns: 1fr;
  }

  .ledger {
    min-height: 16rem;
  }

  .nav,
  .learn-inner {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar,
  .learn-inner::-webkit-scrollbar {
    display: none;
  }

  .nav {
    width: 100%;
  }

  .nav a,
  .learn a {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0.48rem 0.55rem;
    font-size: 0.94rem;
  }
}

@media (max-width: 420px) {
  .mast-inner,
  .wrap,
  .foot-inner {
    width: min(var(--max), calc(100% - 1.25rem));
  }

  .field input,
  .field select,
  .go {
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .tools a,
  .field input,
  .field select {
    transition: none;
  }

  .tools a:hover {
    transform: none;
  }
}

@media print {
  .mast,
  .nav,
  .skip,
  .go,
  .foot-nav,
  .tools,
  .chips,
  .steps,
  .try,
  .learn,
  .copy-row {
    display: none !important;
  }

  body {
    background: #fff;
    color: #111;
  }

  .panel,
  .ledger,
  .note {
    box-shadow: none;
    border-color: #bbb;
  }
}

.field.is-bad input:focus-visible,
.field.is-bad select:focus-visible {
  outline-color: var(--warn);
}

.crumbs {
  margin: 1.15rem 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.crumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.35rem;
  color: #9aa8b3;
}

.crumbs [aria-current="page"] {
  color: var(--ink);
}

.continue {
  margin: 0 0 2rem;
}

.continue h2 {
  margin: 0 0 0.7rem;
  font-size: 1.4rem;
}

.copy-row {
  margin: 0 0 0.85rem;
}

.copy {
  appearance: none;
  border: 1px solid var(--rule);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.copy:hover {
  border-color: var(--teal);
  color: var(--teal-deep);
  background: var(--teal-soft);
}

.stub-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 1.35rem;
  align-items: start;
  margin: 1.35rem 0 2.1rem;
}

.stub {
  margin: 0;
  padding: 1.15rem 1.2rem 1.25rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 4px solid var(--navy);
}

.stub-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.9rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed var(--rule);
}

.stub-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.stub-head strong {
  display: block;
  color: var(--ink);
  font-size: 1.15rem;
}

.stub-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.35rem;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.stub-line:hover,
.stub-line[aria-expanded="true"] {
  background: var(--teal-soft);
}

.stub-line b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stub-line.is-net {
  margin-top: 0.35rem;
  border-bottom: 0;
  color: var(--forest);
  font-size: 1.15rem;
}

.stub-explain {
  margin: 0;
  min-height: 16rem;
}

@media (max-width: 820px) {
  .stub-stage {
    grid-template-columns: 1fr;
  }
}

.noscript {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--warn);
  background: var(--warn-bg);
  border-radius: var(--radius);
}
