/* ==========================================================================
   Gignomic Self-Employed Tax Calculator
   All selectors are namespaced under .gig-tc and every property that a
   WordPress theme commonly sets is reset explicitly, so the widget renders
   identically regardless of the surrounding theme.
   ========================================================================== */

.gig-tc,
.gig-tc *,
.gig-tc *::before,
.gig-tc *::after {
  box-sizing: border-box;
}

.gig-tc {
  /* ---- Palette -------------------------------------------------------
     Gignomic dark. Built on the brand colors #5BC236, #121212, #1A1A1A
     and #000000. Every value below was chosen against a measured contrast
     ratio rather than by eye — see the notes on each group.

     One rule worth keeping if you re-theme: white text on #5BC236 measures
     2.28:1 and fails WCAG at any size. Text on a green fill must be dark,
     which is what --gig-on-accent is for.

     Override any of these on .gig-tc to rebrand the whole tool.
  -------------------------------------------------------------------- */

  /* Text ramp — measured against --gig-surface (#121212) */
  --gig-ink: #e2e8e0;         /* 15.0:1  primary text            */
  --gig-ink-2: #9aa098;       /*  7.0:1  secondary text          */
  --gig-ink-3: #7f857d;       /*  4.6:1  labels, hints, captions */

  /* Grounds — the four brand values */
  --gig-paper: #000000;       /* outer frame, matches the site   */
  --gig-surface: #121212;     /* card ground                     */
  --gig-surface-2: #1a1a1a;   /* raised / alternating ground     */

  /* Brand green. Hover goes *lighter*, which is the dark-UI convention. */
  --gig-accent: #5bc236;      /*  8.2:1 on --gig-surface         */
  --gig-accent-deep: #74cb54; /*  9.3:1, hover and active        */
  --gig-accent-wash: #14240e; /* tinted ground under green rules */
  --gig-accent-text: #86d267; /* green text sitting on the wash  */
  --gig-on-accent: #07130a;   /*  9.0:1 on green — never #fff    */

  /* Advisory amber and error red, both lifted for a dark ground */
  --gig-flag: #e8b14a;        /*  9.7:1  rules and icons         */
  --gig-flag-wash: #1f1806;
  --gig-flag-text: #efc87c;   /* 11.0:1 on the wash              */
  --gig-error: #ff7568;       /*  6.4:1                          */
  --gig-error-wash: #240f0d;
  --gig-error-text: #ff9c92;

  /* Rules. --gig-rule-strong clears 3:1 so input edges satisfy
     WCAG 1.4.11 for non-text UI boundaries. */
  --gig-rule: #262626;
  --gig-rule-strong: #646863;

  /* The set-aside headline. Sunk to pure black so it reads as a plate
     set into the card, with the one number that matters in brand green. */
  --gig-headline-bg: #000000;
  --gig-headline-text: #f2f5f1;
  --gig-headline-figure: #5bc236;
  --gig-headline-muted: #8c9689;
  --gig-headline-dim: #aeb6ab;
  --gig-headline-rule: rgba(255, 255, 255, 0.13);
  --gig-headline-chip: rgba(255, 255, 255, 0.3);

  --gig-radius: 6px;
  --gig-radius-lg: 10px;

  /* Sora first, to match the rest of Gignomic. The theme already loads it,
     so this costs no extra request; the system stack behind it covers the
     case where it has not arrived yet. Set this to `inherit` instead if you
     ever want the calculator to follow whatever font the page is using. */
  --gig-sans: "Sora", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --gig-mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono",
    "Roboto Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* ---- Frame -------------------------------------------------------- */
  font-family: var(--gig-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--gig-ink);
  background: var(--gig-paper);
  border: 1px solid var(--gig-rule);
  border-radius: var(--gig-radius-lg);
  max-width: 780px;
  margin: 0 auto 2rem;
  padding: 0;
  text-align: left;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* Wrapping the tag list in :where() drops its specificity to zero, so the
   whole selector weighs the same as a single class. Without it this reset
   scores 0,1,1 and quietly beats every component rule below it — a rule
   like .gig-tc__help {margin-bottom} scores 0,1,0 and loses, collapsing
   the spacing it was meant to set. The reset still stops theme margins
   leaking in; it just no longer outranks the component's own styles. */
.gig-tc :where(p, h2, h3, h4, ul, ol, li, figure, table) {
  margin: 0;
  padding: 0;
}

.gig-tc ul,
.gig-tc ol {
  list-style: none;
}

.gig-tc a {
  color: var(--gig-accent-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.gig-tc a:hover {
  color: var(--gig-ink);
}

/* ---- Visually hidden but available to screen readers ----------------- */
.gig-tc .gig-tc__sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Focus ----------------------------------------------------------- */
.gig-tc :focus-visible {
  outline: 3px solid var(--gig-accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ==========================================================================
   Masthead
   ========================================================================== */

.gig-tc__masthead {
  background: var(--gig-surface);
  border-bottom: 1px solid var(--gig-rule);
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  align-items: baseline;
  justify-content: space-between;
}

.gig-tc__title {
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.012em;
  line-height: 1.3;
  color: var(--gig-ink);
}

.gig-tc__masthead-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.gig-tc__pill {
  font-family: var(--gig-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  background: var(--gig-accent-wash);
  color: var(--gig-accent-deep);
  white-space: nowrap;
}

.gig-tc__pill--quiet {
  background: transparent;
  color: var(--gig-ink-3);
  border: 1px solid var(--gig-rule);
}

/* ==========================================================================
   Form
   ========================================================================== */

.gig-tc__form {
  padding: 0;
  margin: 0;
  border: 0;
}

.gig-tc__section {
  border-bottom: 1px solid var(--gig-rule);
  background: var(--gig-surface);
}

.gig-tc__section-head {
  padding: 1.25rem 1.25rem 0;
}

.gig-tc__eyebrow {
  display: block;
  font-family: var(--gig-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gig-ink-3);
  margin-bottom: 0.3rem;
}

.gig-tc__section-title {
  font-size: 1.12rem;
  font-weight: 650;
  letter-spacing: -0.016em;
  line-height: 1.25;
  color: var(--gig-ink);
}

.gig-tc__section-note {
  font-size: 0.85rem;
  color: var(--gig-ink-2);
  margin-top: 0.35rem;
  max-width: 56ch;
}

.gig-tc__fields {
  padding: 1rem 1.25rem 1.4rem;
  display: grid;
  gap: 1.05rem;
}

@media (min-width: 640px) {
  .gig-tc__fields--two {
    grid-template-columns: 1fr 1fr;
    column-gap: 1.1rem;
  }
  .gig-tc__field--wide {
    grid-column: 1 / -1;
  }
}

/* ---- Field ----------------------------------------------------------- */

.gig-tc__field {
  display: block;
  min-width: 0;
}

.gig-tc__label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.006em;
  color: var(--gig-ink);
  margin-bottom: 0.3rem;
}

/* A label sitting directly on its control needs the same air that a label
   plus help text gets, so the two field shapes line up down the column. */
.gig-tc__label + .gig-tc__money,
.gig-tc__label + input,
.gig-tc__label + select,
.gig-tc__label + .gig-tc__segmented {
  margin-top: 0.55rem;
}

.gig-tc__optional {
  font-weight: 400;
  color: var(--gig-ink-3);
  font-size: 0.82rem;
}

.gig-tc__help {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--gig-ink-2);
  margin-top: 0;
  margin-bottom: 0.7rem;
  max-width: 58ch;
}

.gig-tc__hint {
  font-size: 0.79rem;
  line-height: 1.45;
  color: var(--gig-ink-3);
  margin-top: 0.35rem;
  font-family: var(--gig-mono);
}

/* ---- Inputs ---------------------------------------------------------- */

.gig-tc input[type="text"],
.gig-tc input[type="number"],
.gig-tc select {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0.62rem 0.75rem;
  font-family: var(--gig-sans);
  font-size: 1rem;
  line-height: 1.4;
  color: var(--gig-ink);
  background-color: var(--gig-surface);
  background-image: none;
  border: 1px solid var(--gig-rule-strong);
  border-radius: var(--gig-radius);
  box-shadow: none;
  margin: 0;
  transition: border-color 0.12s ease;
}

.gig-tc input[type="text"]:hover,
.gig-tc select:hover {
  border-color: var(--gig-ink-3);
}

.gig-tc input[type="text"]:focus,
.gig-tc input[type="number"]:focus,
.gig-tc select:focus {
  border-color: var(--gig-accent);
  outline: 3px solid var(--gig-accent-wash);
  outline-offset: 0;
}

.gig-tc select {
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239aa098' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 11px 7px;
  cursor: pointer;
}

/* Money inputs get a currency affix and monospaced figures. */
.gig-tc__money {
  position: relative;
  display: block;
}

.gig-tc__money::before {
  content: "$";
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--gig-mono);
  font-size: 0.95rem;
  color: var(--gig-ink-3);
  pointer-events: none;
}

.gig-tc__money input {
  padding-left: 1.85rem !important;
  font-family: var(--gig-mono) !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.gig-tc input.gig-tc--invalid,
.gig-tc select.gig-tc--invalid {
  border-color: var(--gig-error);
  background-color: var(--gig-error-wash);
}

.gig-tc__error {
  display: none;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--gig-error);
  margin-top: 0.35rem;
  font-weight: 500;
}

.gig-tc__error--on {
  display: block;
}

.gig-tc__error::before {
  content: "\26A0\FE0E";
  margin-right: 0.35rem;
}

/* ---- Segmented control ----------------------------------------------- */

.gig-tc__segmented {
  display: flex;
  border: 1px solid var(--gig-rule-strong);
  border-radius: var(--gig-radius);
  overflow: hidden;
  background: var(--gig-surface);
}

.gig-tc__segmented button {
  -webkit-appearance: none;
  appearance: none;
  flex: 1 1 0;
  min-height: 48px;
  padding: 0.55rem 0.6rem;
  font-family: var(--gig-sans);
  font-size: 0.88rem;
  font-weight: 550;
  line-height: 1.3;
  color: var(--gig-ink-2);
  background: var(--gig-surface);
  border: 0;
  border-right: 1px solid var(--gig-rule);
  cursor: pointer;
  text-align: center;
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
}

.gig-tc__segmented button:last-child {
  border-right: 0;
}

.gig-tc__segmented button[aria-pressed="true"] {
  background: var(--gig-accent);
  color: var(--gig-on-accent);
}

.gig-tc__segmented button:hover:not([aria-pressed="true"]) {
  background: var(--gig-accent-wash);
  color: var(--gig-accent-text);
}

/* ---- Checkbox -------------------------------------------------------- */

.gig-tc__check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  cursor: pointer;
  padding: 0.35rem 0;
  min-height: 44px;
}

.gig-tc__check input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  border: 1px solid var(--gig-rule-strong);
  border-radius: 4px;
  background: var(--gig-surface);
  cursor: pointer;
  position: relative;
}

.gig-tc__check input[type="checkbox"]:checked {
  background: var(--gig-accent);
  border-color: var(--gig-accent);
}

.gig-tc__check input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 11px;
  border: solid var(--gig-on-accent);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(43deg);
}

.gig-tc__check-text {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--gig-ink);
  padding-top: 1px;
}

.gig-tc__check-text small {
  display: block;
  font-size: 0.8rem;
  color: var(--gig-ink-2);
  margin-top: 0.1rem;
}

/* ---- Disclosure ------------------------------------------------------ */

.gig-tc__disclosure {
  border-top: 1px solid var(--gig-rule);
}

.gig-tc__disclosure:first-child {
  border-top: 0;
}

.gig-tc__disclosure-btn {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--gig-surface);
  border: 0;
  cursor: pointer;
  text-align: left;
  font-family: var(--gig-sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.008em;
  color: var(--gig-ink);
  min-height: 52px;
  margin: 0;
  text-transform: none;
}

.gig-tc__disclosure-btn:hover {
  background: var(--gig-surface-2);
}

.gig-tc__disclosure-btn small {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--gig-ink-2);
  margin-top: 0.1rem;
}

.gig-tc__chev {
  flex: 0 0 auto;
  width: 12px;
  height: 8px;
  transition: transform 0.15s ease;
}

.gig-tc__disclosure-btn[aria-expanded="true"] .gig-tc__chev {
  transform: rotate(180deg);
}

.gig-tc__disclosure-panel[hidden] {
  display: none;
}

/* ==========================================================================
   Submit
   ========================================================================== */

.gig-tc__actions {
  padding: 1.15rem 1.25rem;
  background: var(--gig-surface-2);
  border-bottom: 1px solid var(--gig-rule);
  display: grid;
  gap: 0.7rem;
}

.gig-tc__btn {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 0.85rem 1.25rem;
  font-family: var(--gig-sans);
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.008em;
  line-height: 1.3;
  color: var(--gig-on-accent);
  background: var(--gig-accent);
  border: 1px solid var(--gig-accent);
  border-radius: var(--gig-radius);
  cursor: pointer;
  text-align: center;
  text-transform: none;
  margin: 0;
  box-shadow: none;
  transition: background-color 0.12s ease;
}

.gig-tc__btn:hover {
  background: var(--gig-accent-deep);
  border-color: var(--gig-accent-deep);
  color: var(--gig-on-accent);
}

.gig-tc__btn--ghost {
  background: transparent;
  color: var(--gig-ink-2);
  border-color: var(--gig-rule-strong);
  min-height: 44px;
  font-size: 0.88rem;
  font-weight: 550;
}

.gig-tc__btn--ghost:hover {
  background: var(--gig-surface);
  color: var(--gig-ink);
  border-color: var(--gig-ink-3);
}

.gig-tc__privacy {
  font-size: 0.8rem;
  color: var(--gig-ink-2);
  text-align: center;
  line-height: 1.5;
}

/* ==========================================================================
   Results
   ========================================================================== */

.gig-tc__results[hidden] {
  display: none;
}

.gig-tc__results {
  background: var(--gig-paper);
}

.gig-tc__block {
  background: var(--gig-surface);
  border-bottom: 1px solid var(--gig-rule);
  padding: 1.35rem 1.25rem;
}

.gig-tc__block--quiet {
  background: var(--gig-surface-2);
}

/* ---- The set-aside headline ------------------------------------------ */

.gig-tc__headline {
  background: var(--gig-headline-bg);
  color: var(--gig-headline-text);
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--gig-rule);
}

.gig-tc__headline-eyebrow {
  font-family: var(--gig-mono);
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--gig-headline-muted);
  display: block;
  margin-bottom: 0.5rem;
}

.gig-tc__headline-rate {
  font-family: var(--gig-mono);
  font-size: clamp(2.6rem, 13vw, 4rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.95;
  color: var(--gig-headline-figure);
  font-variant-numeric: tabular-nums;
  display: block;
}

.gig-tc__headline-of {
  font-size: 0.95rem;
  color: var(--gig-headline-dim);
  margin-top: 0.55rem;
  max-width: 46ch;
  line-height: 1.5;
}

.gig-tc__headline-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 1.35rem;
  border-top: 1px solid var(--gig-headline-rule);
}

.gig-tc__headline-cell {
  padding: 0.9rem 0.6rem 0;
  border-right: 1px solid var(--gig-headline-rule);
}

.gig-tc__headline-cell:first-child {
  padding-left: 0;
}

.gig-tc__headline-cell:last-child {
  border-right: 0;
}

.gig-tc__headline-cell-label {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gig-headline-muted);
  font-family: var(--gig-mono);
  display: block;
  margin-bottom: 0.2rem;
}

.gig-tc__headline-cell-value {
  font-family: var(--gig-mono);
  font-size: clamp(1rem, 4.4vw, 1.3rem);
  font-weight: 550;
  letter-spacing: -0.025em;
  color: var(--gig-headline-text);
  font-variant-numeric: tabular-nums;
  display: block;
}

.gig-tc__cushion {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.35rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--gig-headline-rule);
}

.gig-tc__cushion-label {
  font-size: 0.8rem;
  color: var(--gig-headline-dim);
  margin-right: 0.2rem;
}

.gig-tc__cushion button {
  -webkit-appearance: none;
  appearance: none;
  font-family: var(--gig-mono);
  font-size: 0.78rem;
  padding: 0.4rem 0.7rem;
  min-height: 38px;
  border-radius: 4px;
  border: 1px solid var(--gig-headline-chip);
  background: transparent;
  color: var(--gig-headline-text);
  cursor: pointer;
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
}

.gig-tc__cushion button[aria-pressed="true"] {
  background: var(--gig-accent);
  color: var(--gig-on-accent);
  border-color: var(--gig-accent);
  font-weight: 600;
}

.gig-tc__cushion button:hover:not([aria-pressed="true"]) {
  border-color: var(--gig-accent);
  color: var(--gig-accent-text);
}

/* ---- Summary rows ---------------------------------------------------- */

.gig-tc__block-title {
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.014em;
  color: var(--gig-ink);
  margin-bottom: 0.85rem;
}

.gig-tc__rows {
  display: block;
  width: 100%;
}

.gig-tc__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gig-rule);
}

.gig-tc__row:last-child {
  border-bottom: 0;
}

.gig-tc__row--total {
  border-top: 2px solid var(--gig-ink);
  border-bottom: 0;
  margin-top: 0.35rem;
  padding-top: 0.75rem;
}

.gig-tc__row--sub .gig-tc__row-label {
  padding-left: 1.1rem;
  color: var(--gig-ink-2);
  font-size: 0.88rem;
  position: relative;
}

.gig-tc__row--sub .gig-tc__row-label::before {
  content: "";
  position: absolute;
  left: 0.3rem;
  top: 0.72em;
  width: 0.5rem;
  height: 1px;
  background: var(--gig-rule-strong);
}

.gig-tc__row-label {
  font-size: 0.92rem;
  color: var(--gig-ink);
  line-height: 1.4;
  min-width: 0;
}

.gig-tc__row-label small {
  display: block;
  font-size: 0.78rem;
  color: var(--gig-ink-3);
  font-family: var(--gig-mono);
  line-height: 1.4;
}

.gig-tc__row-value {
  font-family: var(--gig-mono);
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--gig-ink);
  white-space: nowrap;
  text-align: right;
  flex: 0 0 auto;
}

.gig-tc__row--total .gig-tc__row-label {
  font-weight: 650;
  font-size: 1rem;
}

.gig-tc__row--total .gig-tc__row-value {
  font-weight: 650;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.gig-tc__row-value--credit {
  color: var(--gig-accent);
}

.gig-tc__row-value--muted {
  color: var(--gig-ink-3);
}

/* ---- Two headline figures -------------------------------------------- */

.gig-tc__pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--gig-rule);
  border: 1px solid var(--gig-rule);
  border-radius: var(--gig-radius);
  overflow: hidden;
  margin-top: 1rem;
}

.gig-tc__pair-cell {
  background: var(--gig-surface-2);
  padding: 0.85rem 0.9rem;
}

.gig-tc__pair-label {
  font-size: 0.75rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  color: var(--gig-ink-3);
  font-family: var(--gig-mono);
  display: block;
  margin-bottom: 0.25rem;
  line-height: 1.35;
}

.gig-tc__pair-value {
  font-family: var(--gig-mono);
  font-size: clamp(1.15rem, 5.2vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.032em;
  color: var(--gig-ink);
  font-variant-numeric: tabular-nums;
  display: block;
  line-height: 1.15;
}

/* ---- Worked calculation sheet (the signature element) ----------------- */

.gig-tc__sheet {
  font-family: var(--gig-mono);
  font-size: 0.83rem;
  line-height: 1.5;
  margin-top: 0.9rem;
  border-top: 1px solid var(--gig-rule);
}

.gig-tc__sheet-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.42rem 0;
  border-bottom: 1px solid var(--gig-rule);
}

.gig-tc__sheet-line:last-child {
  border-bottom: 0;
}

.gig-tc__sheet-desc {
  min-width: 0;
  color: var(--gig-ink-2);
}

.gig-tc__sheet-desc b {
  display: block;
  color: var(--gig-ink);
  font-weight: 600;
  font-family: var(--gig-sans);
  font-size: 0.88rem;
  letter-spacing: -0.006em;
  line-height: 1.4;
}

.gig-tc__sheet-op {
  color: var(--gig-ink-3);
  font-size: 0.78rem;
  display: block;
  margin-top: 0.05rem;
}

.gig-tc__sheet-val {
  flex: 0 0 auto;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--gig-ink);
  font-size: 0.95rem;
}

.gig-tc__sheet-line--result {
  border-top: 1.5px solid var(--gig-ink);
  border-bottom: 0;
  padding-top: 0.6rem;
  margin-top: 0.15rem;
}

.gig-tc__sheet-line--result .gig-tc__sheet-desc b {
  font-weight: 650;
}

.gig-tc__sheet-line--result .gig-tc__sheet-val {
  font-weight: 650;
  font-size: 1.08rem;
}

.gig-tc__sheet-line--zero .gig-tc__sheet-val {
  color: var(--gig-ink-3);
}

/* ---- Notes ----------------------------------------------------------- */

.gig-tc__note {
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--gig-ink-2);
  background: var(--gig-surface-2);
  border-left: 3px solid var(--gig-rule-strong);
  padding: 0.7rem 0.85rem;
  border-radius: 0 var(--gig-radius) var(--gig-radius) 0;
  margin-top: 0.9rem;
}

.gig-tc__note--flag {
  background: var(--gig-flag-wash);
  border-left-color: var(--gig-flag);
  color: var(--gig-flag-text);
}

.gig-tc__note--accent {
  background: var(--gig-accent-wash);
  border-left-color: var(--gig-accent);
  color: var(--gig-accent-text);
}

.gig-tc__note strong {
  font-weight: 650;
}

.gig-tc__note + .gig-tc__note {
  margin-top: 0.5rem;
}

/* ---- Scenario tools --------------------------------------------------- */

.gig-tc__stepper {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.gig-tc__stepper .gig-tc__money {
  flex: 1 1 auto;
  min-width: 0;
}

.gig-tc__step-btn {
  -webkit-appearance: none;
  appearance: none;
  flex: 0 0 auto;
  width: 52px;
  min-height: 48px;
  font-family: var(--gig-mono);
  font-size: 1.3rem;
  line-height: 1;
  font-weight: 400;
  color: var(--gig-ink);
  background: var(--gig-surface);
  border: 1px solid var(--gig-rule-strong);
  border-radius: var(--gig-radius);
  cursor: pointer;
  margin: 0;
  padding: 0;
}

.gig-tc__step-btn:hover {
  background: var(--gig-accent-wash);
  border-color: var(--gig-accent);
  color: var(--gig-accent-deep);
}

.gig-tc input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  background: transparent;
  margin: 0.4rem 0 0;
  padding: 0;
  border: 0;
  cursor: pointer;
  display: block;
}

.gig-tc input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--gig-rule-strong);
  border-radius: 2px;
}

.gig-tc input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -11px;
  border-radius: 50%;
  background: var(--gig-accent);
  border: 3px solid var(--gig-surface);
  box-shadow: 0 0 0 1px var(--gig-rule-strong);
  cursor: pointer;
}

.gig-tc input[type="range"]::-moz-range-track {
  height: 4px;
  background: var(--gig-rule-strong);
  border-radius: 2px;
  border: 0;
}

.gig-tc input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gig-accent);
  border: 3px solid var(--gig-surface);
  box-shadow: 0 0 0 1px var(--gig-rule-strong);
  cursor: pointer;
}

.gig-tc__scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--gig-mono);
  font-size: 0.72rem;
  color: var(--gig-ink-3);
  margin-top: -0.15rem;
}

.gig-tc__delta {
  margin-top: 1rem;
  border: 1px solid var(--gig-rule);
  border-radius: var(--gig-radius);
  overflow: hidden;
}

.gig-tc__delta-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--gig-rule);
  background: var(--gig-surface);
}

.gig-tc__delta-line:last-child {
  border-bottom: 0;
}

.gig-tc__delta-line--em {
  background: var(--gig-accent-wash);
}

.gig-tc__delta-label {
  font-size: 0.87rem;
  color: var(--gig-ink-2);
}

.gig-tc__delta-values {
  font-family: var(--gig-mono);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-align: right;
  color: var(--gig-ink);
}

.gig-tc__delta-from {
  color: var(--gig-ink-3);
}

.gig-tc__delta-arrow {
  color: var(--gig-ink-3);
  padding: 0 0.28rem;
}

.gig-tc__delta-line--em .gig-tc__delta-values,
.gig-tc__delta-line--em .gig-tc__delta-label {
  font-weight: 650;
  color: var(--gig-accent-text);
}

/* ---- Quarterly schedule ---------------------------------------------- */

.gig-tc__quarters {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--gig-rule);
  border: 1px solid var(--gig-rule);
  border-radius: var(--gig-radius);
  overflow: hidden;
  margin-top: 0.9rem;
}

@media (min-width: 560px) {
  .gig-tc__quarters {
    grid-template-columns: repeat(4, 1fr);
  }
}

.gig-tc__quarter {
  background: var(--gig-surface);
  padding: 0.8rem 0.7rem;
}

.gig-tc__quarter-q {
  font-family: var(--gig-mono);
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  color: var(--gig-accent-deep);
  display: block;
  font-weight: 600;
}

.gig-tc__quarter-date {
  font-size: 0.76rem;
  color: var(--gig-ink-3);
  display: block;
  margin: 0.1rem 0 0.35rem;
  line-height: 1.35;
}

.gig-tc__quarter-amt {
  font-family: var(--gig-mono);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.028em;
  font-variant-numeric: tabular-nums;
  color: var(--gig-ink);
  display: block;
}

/* ---- Interpretation --------------------------------------------------- */

.gig-tc__reading p {
  font-size: 0.94rem;
  line-height: 1.62;
  color: var(--gig-ink);
  margin-bottom: 0.7rem;
  max-width: 62ch;
}

.gig-tc__reading p:last-child {
  margin-bottom: 0;
}

.gig-tc__reading b {
  font-weight: 650;
}

/* ---- Parameter table -------------------------------------------------- */

.gig-tc__params {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.85rem;
  font-size: 0.82rem;
}

.gig-tc__params caption {
  text-align: left;
  font-size: 0.82rem;
  color: var(--gig-ink-2);
  margin-bottom: 0.6rem;
  line-height: 1.5;
}

.gig-tc__params th,
.gig-tc__params td {
  text-align: left;
  padding: 0.45rem 0.6rem 0.45rem 0;
  border-bottom: 1px solid var(--gig-rule);
  vertical-align: top;
  line-height: 1.45;
}

.gig-tc__params th {
  font-weight: 600;
  color: var(--gig-ink);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gig-ink-3);
  font-family: var(--gig-mono);
}

.gig-tc__params td:nth-child(2) {
  font-family: var(--gig-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-right: 0.9rem;
}

.gig-tc__params td:last-child {
  color: var(--gig-ink-2);
  font-size: 0.79rem;
  padding-right: 0;
}

/* ---- Source list ------------------------------------------------------ */

.gig-tc__sources li {
  padding: 0.42rem 0;
  border-bottom: 1px solid var(--gig-rule);
  font-size: 0.86rem;
  line-height: 1.5;
}

.gig-tc__sources li:last-child {
  border-bottom: 0;
}

/* ---- Disclaimer ------------------------------------------------------- */

.gig-tc__disclaimer {
  padding: 1.15rem 1.25rem;
  background: var(--gig-paper);
  font-size: 0.81rem;
  line-height: 1.6;
  color: var(--gig-ink-2);
}

.gig-tc__disclaimer strong {
  color: var(--gig-ink);
  font-weight: 650;
}

.gig-tc__verified {
  font-family: var(--gig-mono);
  font-size: 0.74rem;
  color: var(--gig-ink-3);
  margin-top: 0.6rem;
  letter-spacing: 0.01em;
}

/* ---- Print ------------------------------------------------------------ */

@media print {
  /* The screen theme is dark. Browsers drop background colours when printing
     but keep text colours, so printing the dark palette straight would put
     near-white text on white paper. Reassigning the variables flips the whole
     tool to ink-on-paper in one place — every rule below inherits it. */
  .gig-tc {
    --gig-ink: #000000;
    --gig-ink-2: #333333;
    --gig-ink-3: #555555;
    --gig-paper: #ffffff;
    --gig-surface: #ffffff;
    --gig-surface-2: #ffffff;

    --gig-accent: #1c6b12;
    --gig-accent-deep: #14500d;
    --gig-accent-wash: #ffffff;
    --gig-accent-text: #14500d;
    --gig-on-accent: #ffffff;

    --gig-flag: #6b4400;
    --gig-flag-wash: #ffffff;
    --gig-flag-text: #4a2f00;
    --gig-error: #8c2216;
    --gig-error-wash: #ffffff;
    --gig-error-text: #8c2216;

    --gig-rule: #bbbbbb;
    --gig-rule-strong: #777777;

    --gig-headline-bg: #ffffff;
    --gig-headline-text: #000000;
    --gig-headline-figure: #000000;
    --gig-headline-muted: #444444;
    --gig-headline-dim: #333333;
    --gig-headline-rule: #bbbbbb;
    --gig-headline-chip: #777777;

    border: 0;
    max-width: none;
    color: #000000;
    background: #ffffff;
  }

  /* Interactive controls carry no meaning on paper. */
  .gig-tc__actions,
  .gig-tc__cushion,
  .gig-tc__stepper,
  .gig-tc input[type="range"],
  .gig-tc__scale {
    display: none !important;
  }

  /* Print the worked calculations even if collapsed on screen. */
  .gig-tc__disclosure-panel[hidden] {
    display: block !important;
  }

  .gig-tc__headline {
    border-bottom: 2px solid #000000;
  }

  /* Spell out link targets, which are otherwise lost on paper. */
  .gig-tc__sources a::after,
  .gig-tc__param-table a::after {
    content: " (" attr(href) ")";
    font-size: 0.72em;
    word-break: break-all;
  }

  .gig-tc__disclosure,
  .gig-tc__quarters {
    break-inside: avoid;
  }
}

/* ---- Reduced motion --------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .gig-tc *,
  .gig-tc *::before,
  .gig-tc *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
