/*!
 * The free tools (docs/trade-tools.md): /tools and its four pages. Loaded after site.css and built only on its tokens
 * (docs/public-site.md › Look): Inter with IBM Plex Mono for codes, amounts and dates; brand blue for actions;
 * flat white cards with a hairline border; one motion curve (--ease), 150–700ms, transform and opacity only, and
 * every final state shown at once under prefers-reduced-motion. One prefix: tl-.
 */

/* ---------- Page frame ---------------------------------------------------------------------------------------- */
.tl-page { background: var(--bg); }
/* The tools show and hide parts with the hidden attribute; a layout rule must never undo it. */
.tl-page [hidden] { display: none !important; }
.tl-hero { position: relative; padding: clamp(28px, 4vw, 44px) 0 clamp(28px, 4vw, 40px); border-bottom: 1px solid var(--line);
  background-color: #fff;
  background-image: linear-gradient(rgba(11,18,38,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(11,18,38,.035) 1px, transparent 1px);
  background-size: 28px 28px; background-position: -1px -1px; }
.tl-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(255,255,255,0) 40%, #fff 100%); }
.tl-hero > .container { position: relative; z-index: 1; }
.tl-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); margin-bottom: 18px; }
.tl-crumbs a { color: var(--ink); font-weight: 600; }
.tl-crumbs span[aria-hidden] { color: var(--line-strong); }
.tl-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 430px); gap: 28px 48px; align-items: end; }
.tl-kicker { display: inline-flex; align-items: center; gap: 10px; height: 32px; padding: 0 12px 0 4px; border-radius: 999px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-xs); font-size: 13px; font-weight: 600; color: var(--text-2); }
.tl-kicker__ico { width: 24px; height: 24px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--blue); color: #fff; }
.tl-kicker__ico svg { width: 14px; height: 14px; }
.tl-hero h1 { margin-top: 16px; font-size: clamp(30px, 3.5vw, 44px); line-height: 1.12; max-width: 780px; }
.tl-hero .lead { margin-top: 14px; max-width: 760px; }
.tl-facts { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tl-facts li { min-width: 0; padding: 14px 16px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.tl-facts b { display: block; font-family: var(--font-mono); font-weight: 600; font-size: 22px; color: var(--ink); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.tl-facts span { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.35; color: var(--text-3); }
@media (max-width: 1024px) { .tl-hero__grid { grid-template-columns: minmax(0, 1fr); } .tl-facts { max-width: 640px; } }
@media (max-width: 560px) { .tl-facts { gap: 8px; } .tl-facts li { padding: 12px; } .tl-facts b { font-size: 18px; } }

.tl-stage { padding: clamp(20px, 3vw, 32px) 0 clamp(48px, 7vw, 80px); }
.tl-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 13px; line-height: 1.55; color: var(--text-3); }
.tl-note svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }

/* ---------- The app card -------------------------------------------------------------------------------------- */
.tl-app { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 1px 2px rgba(11,18,38,.04), 0 18px 48px rgba(11,18,38,.06); }
.tl-app__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.tl-app__body { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); min-height: 560px; }
.tl-app__list { border-right: 1px solid var(--line); min-width: 0; }
.tl-app__detail { min-width: 0; padding: clamp(18px, 2.4vw, 28px); }
@media (max-width: 900px) {
  .tl-app__body { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .tl-app__list { border-right: 0; border-bottom: 1px solid var(--line); }
}

/* Search field */
.tl-search { position: relative; flex: 1 1 360px; min-width: 0; }
.tl-search > svg { position: absolute; left: 16px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.tl-search input { width: 100%; height: 56px; padding: 0 92px 0 48px; border-radius: 14px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); font: 500 16.5px/1.3 var(--font-sans); transition: border-color .15s, box-shadow .15s; }
.tl-search input::placeholder { color: #94A0B8; }
.tl-search input::-webkit-search-cancel-button, .tl-search input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.tl-search input:focus ~ .tl-search__aside .tl-kbd, .tl-search.has-value .tl-kbd { display: none; }
.tl-search input:focus { outline: none; border-color: var(--blue); box-shadow: var(--ring); }
.tl-search__aside { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 6px; }
.tl-kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 7px; border: 1px solid var(--line-strong); border-bottom-width: 2px; background: var(--bg-soft); font: 600 12px/1 var(--font-mono); color: var(--text-3); }
.tl-clear { width: 32px; height: 32px; border: 0; border-radius: 9px; background: transparent; color: var(--text-3); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.tl-clear:hover { background: var(--bg-soft); color: var(--ink); }
.tl-clear svg { width: 16px; height: 16px; }
.tl-search .tl-busy { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 0 0 14px 14px; overflow: hidden; opacity: 0; transition: opacity .15s; }
.tl-search .tl-busy::after { content: ""; position: absolute; inset: 0; background: var(--blue); transform: translateX(-100%); }
.tl-search.is-busy .tl-busy { opacity: 1; }
.tl-search.is-busy .tl-busy::after { animation: tl-busy 0.7s var(--ease) infinite; }
@keyframes tl-busy { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* Segmented switch (Goods / Services, the exporter, the direction) */
.tl-seg { display: inline-flex; padding: 4px; border-radius: 13px; background: var(--bg-soft); border: 1px solid var(--line); gap: 2px; max-width: 100%; overflow-x: auto; }
.tl-seg button { height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: var(--text-3); font: 600 14px/1 var(--font-sans); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; transition: background .15s, color .15s, box-shadow .15s; }
.tl-seg button:hover { color: var(--ink); }
.tl-seg button[aria-pressed="true"], .tl-seg button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(11,18,38,.08), 0 0 0 1px var(--line); }
.tl-seg button svg { width: 16px; height: 16px; }
.tl-seg small { font: 500 12px/1 var(--font-mono); color: var(--text-3); }

/* Chips row (quick picks) */
.tl-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 16px; }
.tl-chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; color: var(--text-2); font: 600 13px/1 var(--font-sans); cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.tl-chip:hover { border-color: var(--blue-line); color: var(--blue-deep); }
.tl-chip[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-deep); }
.tl-chip .mono { font-size: 12px; color: var(--text-3); }
.tl-chips__label { width: 100%; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }

/* ---------- Result lists -------------------------------------------------------------------------------------- */
.tl-list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 18px 10px; font-size: 12.5px; color: var(--text-3); }
.tl-list-head b { color: var(--ink); font-weight: 600; }
.tl-results { list-style: none; max-height: 640px; overflow-y: auto; padding: 0 8px 10px; overscroll-behavior: contain; }
.tl-results__sep { padding: 14px 10px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.tl-hit { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; padding: 11px 12px; border: 0; border-radius: 12px; background: transparent; text-align: left; cursor: pointer; color: var(--text); position: relative; transition: background .15s; }
.tl-hit:hover { background: var(--bg-soft); }
.tl-hit[aria-selected="true"], .tl-hit.is-active { background: var(--blue-soft); }
.tl-hit[aria-selected="true"]::before, .tl-hit.is-active::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--blue); }
.tl-hit__code { font: 600 14px/1.35 var(--font-mono); color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-hit__code em { font-style: normal; color: var(--blue-deep); }
.tl-hit__title { font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--ink); overflow-wrap: anywhere; }
.tl-hit__sub { grid-column: 2 / 4; font-size: 12.5px; line-height: 1.4; color: var(--text-3); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tl-hit__tag { justify-self: end; }
.tl-hit mark { background: rgba(47,107,255,.14); color: inherit; border-radius: 3px; padding: 0 1px; }
.tl-empty { padding: 28px 18px; text-align: center; color: var(--text-3); font-size: 14px; line-height: 1.6; }
.tl-empty strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.tl-empty svg { width: 28px; height: 28px; color: var(--blue); margin-bottom: 8px; }

/* Small status dots and tags */
.tl-tag { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: rgba(11,18,38,.06); color: var(--text-2); }
.tl-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tl-tag--ok { background: var(--mint-soft); color: var(--mint-deep); }
.tl-tag--check { background: var(--amber-soft); color: var(--amber); }
.tl-tag--blue { background: var(--blue-soft); color: var(--blue-deep); }
.tl-tag--red { background: var(--red-soft); color: var(--red); }
.tl-tag--plain::before { display: none; }

/* Browse grid (chapters, headings) */
.tl-browse { padding: 6px 16px 16px; }
.tl-sec { margin-top: 14px; }
.tl-sec__title { display: flex; gap: 10px; align-items: baseline; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.tl-sec__title .mono { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.tl-chapters { list-style: none; display: grid; gap: 2px; }
.tl-ch { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 10px; color: var(--text); font-size: 13.5px; line-height: 1.4; }
.tl-ch:hover { background: var(--bg-soft); text-decoration: none; }
.tl-ch__code { font-weight: 600; color: var(--blue-deep); }
.tl-ch__name { color: var(--ink); }
.tl-ch__n { font-size: 11.5px; color: var(--text-3); }

/* ---------- Detail panel -------------------------------------------------------------------------------------- */
.tl-detail-empty { height: 100%; min-height: 420px; display: grid; place-items: center; text-align: center; color: var(--text-3); }
.tl-detail-empty__art { position: relative; width: 220px; height: 120px; margin: 0 auto 18px; }
.tl-detail-empty h3 { font-size: 18px; }
.tl-detail-empty p { margin-top: 6px; max-width: 360px; font-size: 14px; line-height: 1.6; }

.tl-eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); }
.tl-dtitle { margin-top: 10px; font-size: clamp(20px, 2.2vw, 26px); line-height: 1.25; letter-spacing: -.015em; }
.tl-dsub { margin-top: 6px; color: var(--text-2); font-size: 14.5px; line-height: 1.6; }
.tl-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tl-actions .btn svg { width: 16px; height: 16px; }

/* The anatomy of a code: its digits grouped by level, each with what it is. */
.tl-anat { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 18px; }
.tl-anat__g { display: inline-flex; flex-direction: column; gap: 6px; padding: 10px 12px 9px; border-radius: 12px; background: var(--bg-soft); border: 1px solid var(--line); min-width: 64px; }
.tl-anat__g b { font: 600 clamp(26px, 3vw, 34px)/1 var(--font-mono); letter-spacing: .04em; color: var(--ink); }
.tl-anat__g i { font-style: normal; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.tl-anat__g::after { content: ""; display: block; height: 3px; border-radius: 3px; margin-top: 2px; background: var(--g, var(--blue)); transform-origin: left; }
.tl-anat__g.is-1 { --g: #9CB8FF; } .tl-anat__g.is-2 { --g: #6E96FF; } .tl-anat__g.is-3 { --g: #2F6BFF; } .tl-anat__g.is-4 { --g: #1D4ED8; }
.tl-anat__g.is-off b { color: var(--text-3); }
.tl-anat__g.is-off::after { background: var(--line-strong); }
.tl-anat__g.is-now { background: #fff; border-color: var(--blue-line); }

/* The path from chapter to line, as a ladder. */
.tl-ladder { list-style: none; position: relative; margin-top: 18px; }
.tl-ladder::before { content: ""; position: absolute; left: 13px; top: 14px; bottom: 14px; width: 2px; border-radius: 2px; background: var(--line-strong); transform-origin: top; }
.tl-rung { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 7px 0; }
.tl-rung__dot { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--line-strong); font: 600 11px/1 var(--font-mono); color: var(--text-3); }
.tl-rung.is-here .tl-rung__dot { background: var(--blue); border-color: var(--blue); color: #fff; }
.tl-rung__body { min-width: 0; }
.tl-rung__code { display: block; font: 600 13px/1.3 var(--font-mono); color: var(--blue-deep); }
.tl-rung__code a { color: inherit; }
.tl-rung__lvl { margin-left: 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.tl-rung__desc { display: block; margin-top: 2px; font-size: 14px; line-height: 1.5; color: var(--ink); }

/* Blocks inside the detail panel */
.tl-block { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.tl-block__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.tl-block__head h3 { font-size: 16px; display: inline-flex; align-items: center; gap: 8px; }
.tl-block__head h3 svg { width: 18px; height: 18px; color: var(--blue); }
.tl-block__meta { font-size: 12.5px; color: var(--text-3); }
.tl-block__foot { margin-top: 12px; font-size: 12.5px; line-height: 1.55; color: var(--text-3); }
.tl-block__foot a { font-weight: 600; }

/* GST entries */
.tl-gst { display: grid; gap: 8px; }
.tl-gst__row { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 14px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: #fff; }
.tl-rate { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 11px; background: var(--bg-soft); color: var(--ink); min-height: 58px; }
.tl-rate b { font: 600 20px/1 var(--font-mono); }
.tl-rate small { font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.tl-rate.is-nil { background: var(--mint-soft); color: var(--mint-deep); }
.tl-rate.is-low { background: var(--blue-soft); color: var(--blue-deep); }
.tl-rate.is-std { background: rgba(11,18,38,.06); }
.tl-rate.is-high { background: var(--red-soft); color: var(--red); }
.tl-rate.is-spec { background: var(--amber-soft); color: var(--amber); }
.tl-gst__desc { font-size: 14px; line-height: 1.5; color: var(--ink); }
.tl-gst__meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--text-3); }
.tl-gst__meta .mono { font-size: 11.5px; }
.tl-more { margin-top: 8px; border: 0; background: none; padding: 6px 0; font: 600 13px/1.3 var(--font-sans); color: var(--blue-deep); cursor: pointer; }

/* Export incentives on a code */
.tl-inc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.tl-inc__card { position: relative; display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 4px 20px; align-items: start; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: #fff; min-width: 0; }
.tl-inc__head { min-width: 0; }
.tl-inc__main { min-width: 0; }
@media (max-width: 640px) { .tl-inc__card { grid-template-columns: minmax(0, 1fr); } }
.tl-inc__card.is-none { background: var(--bg-soft); }
.tl-inc__name { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.tl-inc__rate { margin-top: 6px; font: 600 26px/1.05 var(--font-mono); color: var(--ink); letter-spacing: -.01em; }
.tl-inc__rate small { font-size: 13px; color: var(--text-3); margin-left: 2px; }
.tl-inc__cap { margin-top: 4px; font-size: 12.5px; color: var(--text-2); }
.tl-inc__ref { margin-top: 8px; font-size: 11.5px; line-height: 1.5; color: var(--text-3); overflow-wrap: anywhere; }
.tl-inc__none { font-size: 13px; line-height: 1.5; color: var(--text-2); }
.tl-items { margin-top: 8px; list-style: none; display: grid; gap: 4px; max-height: 260px; overflow-y: auto; }
.tl-items li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 6px 8px; border-radius: 8px; background: var(--bg-soft); font-size: 12.5px; }
.tl-items .mono { font-size: 11.5px; color: var(--blue-deep); }
.tl-items b { font: 600 12.5px/1 var(--font-mono); color: var(--ink); white-space: nowrap; }

/* Key–value list of what follows from a code */
.tl-kv { display: grid; gap: 0; margin-top: 4px; }
.tl-kv > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; padding: 11px 0; border-bottom: 1px dashed var(--line-strong); font-size: 14px; line-height: 1.5; }
.tl-kv > div:last-child { border-bottom: 0; }
.tl-kv dt { color: var(--text-3); font-weight: 500; }
.tl-kv dd { margin: 0; color: var(--ink); font-weight: 600; }
@media (max-width: 560px) { .tl-kv > div { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

/* ---------- Forms (calculators) ------------------------------------------------------------------------------- */
.tl-calc { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
.tl-calc__form { padding: clamp(18px, 2.6vw, 30px); border-right: 1px solid var(--line); min-width: 0; }
.tl-calc__out { padding: clamp(18px, 2.6vw, 30px); min-width: 0; background: linear-gradient(180deg, var(--bg-soft), #fff 220px); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }
@media (max-width: 960px) {
  .tl-calc { grid-template-columns: minmax(0, 1fr); }
  .tl-calc__form { border-right: 0; border-bottom: 1px solid var(--line); }
  .tl-calc__out { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
}
.tl-step { display: flex; align-items: center; gap: 10px; margin: 22px 0 12px; font-size: 13px; font-weight: 600; color: var(--ink); }
.tl-step:first-child { margin-top: 0; }
.tl-step__n { width: 24px; height: 24px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--ink); color: #fff; font: 600 12px/1 var(--font-mono); }
.tl-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tl-fields .field--full { grid-column: 1 / -1; }
@media (max-width: 560px) { .tl-fields { grid-template-columns: minmax(0, 1fr); } }
.tl-page .field input[type="date"] { font-family: var(--font-mono); font-size: 14.5px; }
.tl-page .field input.mono { font-family: var(--font-mono); }
.tl-check { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 14px; line-height: 1.45; color: var(--ink); }
.tl-check input { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--blue); flex: none; }
.tl-check small { display: block; color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.tl-check:has(input:checked) { border-color: var(--blue-line); background: var(--blue-soft); }

/* The HS code picker inside a calculator */
.tl-combo { position: relative; }
.tl-combo__list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); list-style: none; max-height: 360px; overflow-y: auto; padding: 6px; border-radius: 14px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.tl-combo__list[hidden] { display: none; }
.tl-picked { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px; border-radius: 14px; border: 1px solid var(--blue-line); background: var(--blue-soft); }
.tl-picked__code { font: 600 18px/1.2 var(--font-mono); color: var(--ink); }
.tl-picked__desc { margin-top: 4px; font-size: 13.5px; line-height: 1.5; color: var(--text-2); }

/* ---------- Results of a calculator --------------------------------------------------------------------------- */
.tl-total__label { font-size: 13px; font-weight: 600; color: var(--text-3); }
.tl-total__value { margin-top: 6px; font: 600 clamp(36px, 4.4vw, 52px)/1 var(--font-mono); letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.tl-total__sub { margin-top: 8px; font-size: 13.5px; color: var(--text-2); }
.tl-stack { display: flex; height: 12px; margin-top: 18px; border-radius: 999px; background: rgba(11,18,38,.06); overflow: hidden; }
.tl-stack span { display: block; height: 100%; transform-origin: left; transition: flex-grow .5s var(--ease), transform .5s var(--ease); }
.tl-stack .is-dbk { background: #1D4ED8; } .tl-stack .is-rodtep { background: #6E96FF; } .tl-stack .is-rosctl { background: #0E9C76; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.tl-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tl-scheme { margin-top: 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: #fff; }
.tl-scheme__top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: baseline; }
.tl-scheme__name { font-size: 15px; font-weight: 600; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.tl-scheme__name i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tl-scheme__amt { font: 600 18px/1 var(--font-mono); color: var(--ink); }
.tl-scheme__math { margin-top: 8px; font: 500 12.5px/1.6 var(--font-mono); color: var(--text-2); overflow-wrap: anywhere; }
.tl-scheme__note { margin-top: 8px; font-size: 12.5px; line-height: 1.5; color: var(--text-3); }
.tl-scheme__note a { font-weight: 600; }
.tl-scheme.is-none .tl-scheme__amt { color: var(--text-3); }

/* A due date */
.tl-due__label { font-size: 13px; font-weight: 600; color: var(--text-3); }
.tl-due__date { margin-top: 6px; font: 600 clamp(32px, 4vw, 46px)/1.05 var(--font-mono); letter-spacing: -.02em; color: var(--ink); }
.tl-due__day { margin-top: 6px; font-size: 14px; color: var(--text-2); }
.tl-count { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; height: 32px; padding: 0 12px; border-radius: 999px; font: 600 13px/1 var(--font-sans); white-space: nowrap; background: var(--mint-soft); color: var(--mint-deep); }
.tl-count svg { width: 16px; height: 16px; flex: none; }
.tl-count b { font-family: var(--font-mono); }
.tl-count.is-soon { background: var(--amber-soft); color: var(--amber); }
.tl-count.is-overdue, .tl-count.is-today { background: var(--red-soft); color: var(--red); }

/* A timeline of milestones */
.tl-time { position: relative; margin: 22px 8px 10px; height: 106px; }
.tl-time__track { position: absolute; left: 0; right: 0; top: 48px; height: 6px; border-radius: 999px; background: rgba(11,18,38,.08); overflow: hidden; }
.tl-time__fill { position: absolute; inset: 0; background: var(--blue); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform .7s var(--ease); }
.tl-time__fill.is-over { background: var(--red); }
.tl-mk { position: absolute; top: 0; bottom: 0; width: 0; }
.tl-mk__dot { position: absolute; top: 43px; left: -8px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--blue); }
.tl-mk.is-due .tl-mk__dot { border-color: var(--ink); background: var(--ink); }
.tl-mk.is-limit .tl-mk__dot { border-color: var(--red); }
.tl-mk.is-mark .tl-mk__dot { border-color: var(--text-3); }
.tl-mk.is-today .tl-mk__dot { top: 40px; left: -2px; width: 4px; height: 22px; border: 0; border-radius: 2px; background: var(--ink); }
.tl-mk__lbl { position: absolute; white-space: nowrap; text-align: center; font-size: 11.5px; line-height: 1.3; color: var(--text-2); }
.tl-mk__lbl b { display: block; font: 600 11.5px/1.3 var(--font-mono); color: var(--ink); }
.tl-mk.is-up .tl-mk__lbl { top: 2px; } .tl-mk:not(.is-up) .tl-mk__lbl { top: 70px; }
.tl-mk.is-first .tl-mk__lbl { left: -8px; text-align: left; } .tl-mk.is-last .tl-mk__lbl { right: -8px; text-align: right; }
.tl-mk:not(.is-first):not(.is-last) .tl-mk__lbl { left: 0; transform: translateX(-50%); }

/* The rule's bands, the one that applies marked */
.tl-bands { list-style: none; display: grid; gap: 6px; margin-top: 8px; }
.tl-bands li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 13.5px; position: relative; }
.tl-bands li.is-on { border-color: var(--blue-line); background: var(--blue-soft); }
.tl-bands li.is-on::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--blue); }
.tl-bands b { color: var(--ink); font-weight: 600; }
.tl-bands .mono { font-weight: 600; color: var(--ink); }
.tl-bands small { grid-column: 1 / -1; color: var(--text-3); font-size: 12px; }
.tl-bands small a { font-weight: 600; }
.tl-notes { list-style: none; display: grid; gap: 8px; margin-top: 8px; }
.tl-notes li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.tl-notes li svg { width: 16px; height: 16px; margin-top: 3px; color: var(--blue); }
.tl-sources { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12.5px; }
.tl-sources a { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.tl-sources a svg { width: 13px; height: 13px; }
.tl-sources span { color: var(--text-3); }

/* Tabs of the deadline calculator */
.tl-tabs { display: flex; gap: 4px; padding: 10px 10px 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tl-tabs::-webkit-scrollbar { display: none; }
.tl-tab { position: relative; flex: none; display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; border: 0; border-radius: 12px 12px 0 0; background: transparent; color: var(--text-3); font: 600 14px/1 var(--font-sans); cursor: pointer; transition: color .15s, background .15s; }
.tl-tab:hover { color: var(--ink); background: var(--bg-soft); }
.tl-tab svg { width: 17px; height: 17px; }
.tl-tab[aria-selected="true"] { color: var(--ink); }
.tl-tab::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--blue); transform: scaleX(0); transition: transform .25s var(--ease); }
.tl-tab[aria-selected="true"]::after { transform: scaleX(1); }

/* The statutory calendar */
.tl-cal { list-style: none; display: grid; gap: 4px; }
.tl-cal__month { margin-top: 14px; padding: 0 2px 4px; font-size: 12px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.tl-cal__month:first-child { margin-top: 0; }
.tl-cal__item { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.tl-cal__day { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 52px; border-radius: 10px; background: var(--bg-soft); }
.tl-cal__day b { font: 600 20px/1 var(--font-mono); color: var(--ink); }
.tl-cal__day small { margin-top: 3px; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.tl-cal__item.is-soon .tl-cal__day { background: var(--amber-soft); }
.tl-cal__title { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.tl-cal__detail { margin-top: 2px; font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.tl-cal__ref { margin-top: 4px; font-size: 11.5px; color: var(--text-3); }
.tl-switches { display: grid; gap: 8px; }

/* ---------- The /tools hub ------------------------------------------------------------------------------------- */
.tl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 860px) { .tl-grid { grid-template-columns: minmax(0, 1fr); } }
.tl-card { display: flex; flex-direction: column; border-radius: var(--radius-lg); border: 1px solid var(--line); background: #fff; color: var(--text); overflow: hidden; box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s; }
.tl-card:hover { text-decoration: none; border-color: var(--blue-line); box-shadow: var(--shadow); }
.tl-card__art { position: relative; height: 210px; border-bottom: 1px solid var(--line); background-color: var(--bg-soft);
  background-image: linear-gradient(rgba(11,18,38,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(11,18,38,.04) 1px, transparent 1px); background-size: 22px 22px; overflow: hidden; }
.tl-card__body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tl-card__body h2 { font-size: 21px; letter-spacing: -.015em; }
.tl-card__body p { font-size: 14.5px; line-height: 1.6; color: var(--text-2); }
.tl-card__go { margin-top: auto; padding-top: 10px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; color: var(--blue-deep); }
.tl-card__go svg { width: 18px; height: 18px; transition: transform .15s var(--ease); }
.tl-card:hover .tl-card__go svg { transform: translateX(3px); }
.tl-card__meta { display: flex; flex-wrap: wrap; gap: 6px; }

/* Mini scenes on the hub cards: static pictures of each tool, eased in once when seen. */
.tl-mini { position: absolute; inset: 18px 22px; display: flex; flex-direction: column; gap: 8px; }
.tl-mini__search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line-strong); font-size: 13px; color: var(--ink); box-shadow: var(--shadow-xs); }
.tl-mini__search svg { width: 15px; height: 15px; color: var(--text-3); }
.tl-mini__caret { width: 1.5px; height: 16px; background: var(--blue); }
.tl-mini__row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); }
.tl-mini__row b { font: 600 12.5px/1 var(--font-mono); color: var(--ink); }
.tl-mini__row.is-on { border-color: var(--blue-line); box-shadow: 0 0 0 3px rgba(47,107,255,.08); }
.tl-mini__big { font: 600 30px/1 var(--font-mono); color: var(--ink); letter-spacing: -.02em; }
.tl-mini__bars { display: grid; gap: 6px; }
.tl-mini__bar { height: 10px; border-radius: 999px; background: rgba(11,18,38,.07); overflow: hidden; }
.tl-mini__bar span { display: block; height: 100%; border-radius: inherit; transform-origin: left; }
.tl-mini__track { position: relative; height: 6px; margin: 26px 4px 0; border-radius: 999px; background: rgba(11,18,38,.08); }
.tl-mini__track span { position: absolute; inset: 0; border-radius: inherit; background: var(--blue); transform-origin: left; transform: scaleX(.62); }
.tl-mini__pin { position: absolute; top: -5px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); transform: translateX(-50%); }
.tl-mini__lbls { display: flex; justify-content: space-between; margin-top: 14px; font: 600 11.5px/1.3 var(--font-mono); color: var(--text-2); }
.tl-mini__code { display: flex; gap: 6px; }
.tl-mini__code span { padding: 6px 8px 5px; border-radius: 8px; background: #fff; border: 1px solid var(--line); font: 600 18px/1 var(--font-mono); color: var(--ink); box-shadow: inset 0 -3px 0 var(--g, var(--blue)); }

/* Provenance table on the hub and each page */
.tl-prov { width: 100%; border-collapse: collapse; font-size: 14px; }
.tl-prov th, .tl-prov td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tl-prov th { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); background: var(--bg-soft); }
.tl-prov td:first-child { font-weight: 600; color: var(--ink); }
.tl-prov .mono { font-size: 13px; }
.tl-related { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tl-related a { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: #fff; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.tl-related a:hover { text-decoration: none; border-color: var(--blue-line); box-shadow: var(--shadow-sm); }
.tl-related .ico { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--blue-soft); color: var(--blue-deep); }
.tl-related .ico svg { width: 20px; height: 20px; }
.tl-related b { display: block; color: var(--ink); font-size: 15px; }
.tl-related span span { font-size: 13px; color: var(--text-3); }
@media (max-width: 860px) { .tl-related { grid-template-columns: minmax(0, 1fr); } }
.tl-explain { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tl-explain .glass h3 { font-size: 16px; margin-top: 2px; }
.tl-explain .glass p { margin-top: 8px; font-size: 14.5px; line-height: 1.65; color: var(--text-2); }
@media (max-width: 960px) { .tl-explain { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Motion ----------------------------------------------------------------------------------------------- */
@keyframes tl-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes tl-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tl-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes tl-drop { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes tl-pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .tl-in { animation: tl-rise .42s var(--ease) both; animation-delay: calc(min(var(--i, 0), 12) * 28ms); }
  .tl-swap { animation: tl-fade .3s var(--ease) both; }
  .tl-anat__g { animation: tl-rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
  .tl-anat__g::after { animation: tl-grow .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms + 120ms); }
  .tl-ladder.is-new::before { animation: tl-drop .6s var(--ease) both; }
  .tl-ladder.is-new .tl-rung { animation: tl-rise .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms + 80ms); }
  .tl-mk { animation: tl-fade .35s var(--ease) both; animation-delay: calc(var(--i, 0) * 90ms + 250ms); }
  .tl-mk__dot { animation: tl-pop .35s var(--ease) both; animation-delay: calc(var(--i, 0) * 90ms + 250ms); }
  .tl-stack span { animation: tl-grow .6s var(--ease) both; }
  /* Hub scenes, when the card comes into view (.reveal from site.js) */
  .tl-card__art.reveal .tl-mini > * { opacity: 0; transform: translateY(8px); transition: opacity .45s var(--ease), transform .45s var(--ease); }
  .tl-card__art.reveal.is-visible .tl-mini > * { opacity: 1; transform: none; }
  .tl-card__art.reveal.is-visible .tl-mini > :nth-child(2) { transition-delay: .12s; } .tl-card__art.reveal.is-visible .tl-mini > :nth-child(3) { transition-delay: .24s; }
  .tl-card__art.reveal.is-visible .tl-mini > :nth-child(4) { transition-delay: .36s; } .tl-card__art.reveal.is-visible .tl-mini > :nth-child(5) { transition-delay: .48s; }
  .tl-card__art.reveal .tl-mini__bar span, .tl-card__art.reveal .tl-mini__track span { transform: scaleX(0); transition: transform .7s var(--ease) .3s; }
  .tl-card__art.reveal.is-visible .tl-mini__bar span { transform: scaleX(1); }
  .tl-card__art.reveal.is-visible .tl-mini__track span { transform: scaleX(.62); }
}
@media (prefers-reduced-motion: reduce) {
  .tl-search.is-busy .tl-busy::after { animation: none; transform: none; }
  .tl-time__fill, .tl-stack span, .tl-tab::after { transition: none; }
}
/* The "/" shortcut means nothing on a touch screen. */
@media (hover: none), (max-width: 640px) { .tl-kbd { display: none; } .tl-search input { padding-right: 48px; } }
