/* "What does your tax code mean?" (essay.js). Bento tiles in the site's ink: a 2px ballpoint outline and a hard offset shadow
   (the neo-brutalist references in references/calculator), JetBrains Mono for codes, inputs and numbers, Zen Kurenaido for the
   explanations, Mochiy for the one popped answer. Colour keeps the essay's meaning: green = tax-free, red = Income Tax,
   orange = what differs, blue = the usual / what matches. */
.tc { --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace; --tile: #fffdf6; --edge: 2px solid var(--ink); --hard: 4px 4px 0 var(--ink);
  --amber: #f3c969; --amber-bg: #fdf3d8; --green-bg: #eaf3e2; --red-bg: #fbe6e1; --blue-bg: #e6eef9;
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 28px; align-items: start; margin-top: 28px; }
.tc .tile { background: var(--tile); border: var(--edge); border-radius: 18px; box-shadow: var(--hard); padding: 18px 20px; }

/* ---- labels: small mono caps, like the references' "TIME TO DESTINATION" */
.tc-lab { display: block; margin: 0 0 10px; font: 600 0.72rem/1.2 var(--mono); letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-2); }
.tc-help { margin: 8px 0 0; font: 400 1.02rem/1.35 var(--hand); -webkit-text-stroke: 0.02em currentColor; color: var(--ink-2); }
.tc-mini { font: 600 0.68rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); align-self: center; margin-right: 2px; }

/* ---- the inputs */
.tc-in { display: grid; gap: 26px; background: var(--tile); border: var(--edge); border-radius: 22px; box-shadow: var(--hard); padding: 24px; }
.tc-code { width: 100%; box-sizing: border-box; padding: 12px 16px; border: var(--edge); border-radius: 14px; background: #fff; color: var(--ink);
  font: 700 2rem/1.1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.tc-code:focus-visible, .tc-money:focus-within { outline: 3px solid var(--blue); outline-offset: 2px; }
.tc-code.bad, .tc-money.bad { border-color: var(--red); background: var(--red-bg); }
.tc-try { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.tc-try button { padding: 7px 11px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; color: var(--ink); box-shadow: 2px 2px 0 var(--ink);
  font: 600 0.88rem var(--mono); cursor: pointer; transition: transform 0.12s, box-shadow 0.12s; }
.tc-try button:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.tc-try button:active, .tc-try button[aria-pressed="true"] { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); background: var(--yellow); }
.tc-payrow { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.tc-money { display: flex; align-items: center; gap: 6px; flex: 1 1 170px; padding: 8px 14px; border: var(--edge); border-radius: 14px; background: #fff;
  font: 700 1.5rem var(--mono); color: var(--ink); }
.tc-money input { width: 100%; min-width: 0; border: 0; background: none; font: inherit; color: inherit; padding: 0; }
.tc-money input:focus { outline: none; }
.tc-range { width: 100%; margin-top: 16px; }

/* segmented pills (the references' DAILY / WEEKLY / MONTHLY) */
.seg { display: inline-flex; padding: 3px; gap: 3px; border: var(--edge); border-radius: 999px; background: #fff; }
.seg button { padding: 7px 14px; border: 0; border-radius: 999px; background: none; color: var(--ink); font: 600 0.9rem var(--mono); cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--card); }
.seg4 { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; box-sizing: border-box; border-radius: 16px; }
.seg4 button { padding: 9px 4px; border-radius: 12px; font-size: 0.84rem; }
.tc-reset { justify-self: start; padding: 8px 14px; border: 2px dashed var(--ink-3); border-radius: 12px; background: none; color: var(--ink-2); font: 600 0.82rem var(--mono); cursor: pointer; }
.tc-reset:hover { border-color: var(--ink); color: var(--ink); }

/* ---- the results */
.tc-out { display: grid; gap: 18px; }
.tc-out.stale > :not(.tc-notes) { opacity: 0.35; }
.tc-hero { background: var(--green-bg); }
.tc-hero.taxed { background: var(--red-bg); }
.tc-big { margin: 0; font-size: clamp(2.6rem, 6vw, 3.6rem); line-height: 1.05; }
.tc-sub { margin: 6px 0 0; font: 400 1.15rem/1.35 var(--hand); -webkit-text-stroke: 0.02em currentColor; color: var(--ink); }
.tc-sub b, .tc-say b, .tc-parts b { font: 700 0.95em var(--mono); -webkit-text-stroke: 0; }

/* the code, piece by piece: one row per part */
.tc-parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tc-parts li { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding-bottom: 10px; border-bottom: 1.5px dashed var(--line); }
.tc-parts li:last-child { border-bottom: 0; padding-bottom: 0; }
.tc-parts .what { font: 400 1.12rem/1.3 var(--hand); -webkit-text-stroke: 0.02em currentColor; }
.tc-parts .what small { display: block; font-size: 0.92em; color: var(--ink-2); }
.tc-chip { display: inline-block; min-width: 2.4em; text-align: center; padding: 5px 10px; border: 2px solid var(--ink); border-radius: 9px; background: #fff;
  font: 700 1.05rem var(--mono); letter-spacing: 0.06em; color: var(--ink); }
.tc-chip.num { background: var(--green-bg); }
.tc-chip.let { background: var(--blue-bg); }
.tc-chip.pre { background: var(--amber-bg); }
.tc-chip.em { background: var(--red-bg); }
.tc-chip.k, .tc-chip.flat { background: var(--red-bg); }

/* three stat tiles */
.tc-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tc-stat { padding: 14px 16px; }
.tc-stat .tc-lab { margin-bottom: 6px; font-size: 0.66rem; }
.tc-num { margin: 0; font: 700 1.45rem/1.1 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }

/* how the pay is split: one stacked bar + a legend of rows */
.tc-bar { display: flex; height: 30px; border: var(--edge); border-radius: 10px; overflow: hidden; background: #fff; }
.tc-bar span { display: block; min-width: 3px; border-right: 2px solid var(--ink); }
.tc-bar span:last-child { border-right: 0; }
.tc-bar .free { background: var(--green); }
.tc-bar .b0 { background: #f2b6a8; } .tc-bar .b1 { background: #e98a74; } .tc-bar .b2 { background: var(--red); } .tc-bar .b3 { background: #c4452c; } .tc-bar .b4 { background: #a8331d; } .tc-bar .b5 { background: #85240f; }
.tc-legend .sw-free { background: var(--green); } .tc-legend .sw-b0 { background: #f2b6a8; } .tc-legend .sw-b1 { background: #e98a74; } .tc-legend .sw-b2 { background: var(--red); } .tc-legend .sw-b3 { background: #c4452c; } .tc-legend .sw-b5 { background: #85240f; }
.tc-legend { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.tc-legend li { display: grid; grid-template-columns: 14px 1fr auto auto; gap: 10px; align-items: center; font: 400 1.05rem var(--hand); -webkit-text-stroke: 0.02em currentColor; }
.tc-legend i { width: 14px; height: 14px; border: 2px solid var(--ink); border-radius: 4px; box-sizing: border-box; }
.tc-legend .amt { font: 600 0.92rem var(--mono); -webkit-text-stroke: 0; text-align: right; font-variant-numeric: tabular-nums; }
.tc-legend .tax { font: 600 0.92rem var(--mono); -webkit-text-stroke: 0; color: var(--red-text); min-width: 6.5em; text-align: right; font-variant-numeric: tabular-nums; }
.tc-legend .tax.none { color: var(--green-dk); }

/* against the usual code: the usual code's chip, a delta pill (the references' "−23 pts vs Platform"), one sentence */
.tc-vsrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tc-vs .tc-chip { background: var(--blue-bg); }
.tc-delta { padding: 5px 12px; border-radius: 999px; font: 700 0.95rem var(--mono); border: 2px solid currentColor; }
.tc-delta.more { color: var(--red-text); background: var(--red-bg); }
.tc-delta.less { color: var(--green-dk); background: var(--green-bg); }
.tc-delta.same { color: var(--green-dk); background: var(--green-bg); }
.tc-say { margin: 12px 0 0; font: 400 1.12rem/1.4 var(--hand); -webkit-text-stroke: 0.02em currentColor; }

/* notes: one card per thing to know, with a mark and a title */
.tc-notes { display: grid; gap: 12px; }
.tc-note { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; padding: 14px 16px; border: var(--edge); border-radius: 14px; background: var(--amber-bg); box-shadow: 3px 3px 0 var(--ink); }
.tc-note.info { background: var(--blue-bg); }
.tc-note.bad { background: var(--red-bg); }
.tc-note .ic { width: 30px; height: 30px; border: 2px solid var(--ink); border-radius: 50%; display: grid; place-items: center; font: 700 1rem var(--mono); background: #fff; }
.tc-note h4 { margin: 2px 0 4px; font: 700 0.95rem/1.3 var(--ui); }
.tc-note p { margin: 0; font: 400 1.05rem/1.35 var(--hand); -webkit-text-stroke: 0.02em currentColor; }

.tc-covers { margin-top: 26px; }
.tc-covers summary { font: 600 0.82rem var(--mono); letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; }
.tc-covers p { font-size: 0.95rem; }

@media (max-width: 860px) {
  .tc { grid-template-columns: 1fr; }
  .tc-in { padding: 18px; }
  .tc-stats { gap: 10px; }
  .tc-stat { padding: 12px; }
  .tc-num { font-size: 1rem; }
  .tc-stat .tc-lab { font-size: 0.6rem; letter-spacing: 0.05em; }
  .seg4 button { font-size: 0.78rem; }
}

/* "The calculator" kicker sits right over its heading, in full ink (it's a label, not prose the reading band dims) */
.tool-sec .prose > .kicker { margin-bottom: 4px; }
.tool-sec .prose > .kicker.rd { opacity: 1; color: var(--ink); }
.tool-sec .prose > .kicker + h2 { margin-top: 0; }
