/* ── tools.css ───────────────────────────────────────────────────────────────────────────────────────
   The free tool pages (/tools/{slug}), drawn by Components/Pages/Tools/ToolPage.razor. Static HTML: nothing here depends on a
   script, so the page works with JavaScript off. Everything is under .tt-wrap and prefixed tt- so no other page is touched.

   Modes are switched in CSS: every field, result block and sticky-bar line that belongs to some modes carries .tt-bound plus a
   .tt-m-{mode} class, and the page emits one rule per mode (in a <style> block, from the descriptor) that shows the ones of the
   checked radio. Both halves need :has(), so the hiding rule below sits inside @supports. Without :has() support nothing is hidden: every
   mode shows, which is still usable because the server only reads the chosen mode's fields. */

.tt-wrap { max-width: 1040px; margin: 0 auto; padding: 0 1.25rem 4rem; font-family: var(--font-sans, 'Plus Jakarta Sans', system-ui, sans-serif); color: #1f2a24; }
.tt-wrap [hidden] { display: none !important; }
@supports selector(:has(*)) { .tt-bound { display: none; } }

.tt-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.tt-hero { text-align: center; padding: 2.75rem 0 1.5rem; }
.tt-eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 700; color: var(--accent-strong, #b8501f); margin-bottom: .6rem; }
.tt-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; line-height: 1.12; margin: 0 auto .9rem; color: #16281d; text-wrap: balance; }
.tt-lede { max-width: 60ch; margin: 0 auto; font-size: 1.06rem; line-height: 1.55; color: #43514a; }
.tt-country { margin: .9rem 0 0; font-size: 13.5px; color: #43514a; }

.tt-panel { background: #fff; border: 1px solid #e7e1d6; border-radius: 12px; padding: 2rem; box-shadow: 0 8px 30px rgba(27,61,42,.06); margin-bottom: 1.25rem; }
.tt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.tt-grid > * { min-width: 0; }
@media (max-width: 720px) { .tt-panel { padding: 1.1rem; } .tt-grid { grid-template-columns: 1fr; gap: 1.4rem; } }

/* The mode switch: a radio group that looks like a segmented control and works without a script. */
.tt-modes { border: 0; padding: 0; margin: 0 0 1.2rem; min-width: 0; }
.tt-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid #cfd8d2; border-radius: 8px; overflow: hidden; }
.tt-seg label { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: 8px 16px; font-weight: 700; font-size: 14px; color: #3d4a43; background: #fff; cursor: pointer; }
.tt-seg label:has(input:checked) { background: #1b3d2a; color: #fff; }
.tt-seg label:focus-within { outline: 2px solid var(--accent, #d97746); outline-offset: -2px; }
.tt-seg input { accent-color: var(--accent-strong, #b8501f); width: 16px; height: 16px; margin: 0; }

.tt-fields-title { font-size: 12px; font-weight: 700; color: #55605a; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 .8rem; }
.tt-field { margin-bottom: 1rem; }
.tt-field label { display: block; font-size: 13.5px; font-weight: 600; color: #2f3d36; margin-bottom: .35rem; }
.tt-input { position: relative; display: flex; align-items: center; }
.tt-input input { font-size: 1.05rem; min-height: 44px; padding: 10px 12px; border: 1px solid #cfd8d2; border-radius: 6px; font-family: inherit; font-variant-numeric: tabular-nums; width: 100%; box-sizing: border-box; background: #fff; color: #1f2a24; }
.tt-input input::placeholder { color: #6b7a72; }
.tt-input input:focus { outline: 2px solid var(--accent, #d97746); outline-offset: 1px; border-color: transparent; }
.tt-input input[aria-invalid="true"], .tt-input input.is-invalid { border-color: #b3261e; }
.tt-affix { position: absolute; color: #56665e; font-size: 1.05rem; pointer-events: none; }
.tt-affix-start { left: 12px; }
.tt-affix-end { right: 12px; }
.tt-input.has-start input { padding-left: 28px; }
.tt-input.has-end input { padding-right: 30px; }
.tt-field-error { color: #b3261e; font-size: 13px; line-height: 1.4; margin: .3rem 0 0; }
/* K4: a cited reference figure under its field: the figure, then who said it and when. */
.tt-field-ref { margin: .3rem 0 0; font-size: 13px; line-height: 1.4; color: #43514a; }
.tt-field-ref .tt-ref-value { display: block; font-weight: 600; }
.tt-field-ref a { color: inherit; text-decoration: underline; }
/* K3: an Enum drawn as a segmented group (up to four choices) or a select, and a weight with its unit beside it. */
.tt-field-label { display: block; font-size: 13.5px; font-weight: 600; color: #2f3d36; margin-bottom: .35rem; }
.tt-field .tt-seg label { display: inline-flex; margin-bottom: 0; font-size: 14px; font-weight: 700; color: #3d4a43; }
.tt-field .tt-seg label:has(input:checked) { color: #fff; }
.tt-input select { font-size: 1.05rem; min-height: 44px; padding: 10px 12px; border: 1px solid #cfd8d2; border-radius: 6px; font-family: inherit; width: 100%; box-sizing: border-box; background: #fff; color: #1f2a24; }
.tt-input select:focus { outline: 2px solid var(--accent, #d97746); outline-offset: 1px; border-color: transparent; }
.tt-input select[aria-invalid="true"], .tt-input select.is-invalid { border-color: #b3261e; }
.tt-input.has-unit input { padding-right: 44px; }
.tt-units { margin-bottom: 1rem; }
.tt-submit { margin-top: .4rem; }

/* The result */
.tt-result { border: 1px solid #d9e0da; border-radius: 10px; padding: 1.1rem 1.2rem; background: #eef4ef; border-color: #d9e6dd; container-type: inline-size; }
.tt-result-title { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #1b5e2f; margin: 0 0 .2rem; }
.tt-flag { font-size: 13.5px; font-weight: 700; color: #2f3d36; margin: .4rem 0 0; }
/* A figure never breaks across lines (owner feedback 2026-10-18): the headline shrinks with its box instead, a row's label wraps, and when the label would
   get narrower than 12ch the value drops below it. A Code (.tt-words) is words, not a figure, and may wrap. */
.tt-big { font-size: clamp(1.6rem, 11cqi, 2.6rem); font-weight: 800; color: #16281d; line-height: 1.1; margin: .1rem 0 .3rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* A long figure (money goes up to a billion) steps the size down by its length (fitClass, set by the page and by the page script), so it always fits its box. */
.tt-big.fit12 { font-size: min(9.5cqi, 2.6rem); }
.tt-big.fit14 { font-size: min(8.2cqi, 2.6rem); }
.tt-big.fit16 { font-size: min(6.8cqi, 2.6rem); }
.tt-big.fit19 { font-size: min(5.4cqi, 2.6rem); }
.tt-big.fit23 { font-size: min(4cqi, 2.6rem); }
.tt-status { font-size: 14px; line-height: 1.5; color: #43514a; margin: .6rem 0 0; }
.tt-kv { margin: .8rem 0 0; }
.tt-kv > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .15rem 1rem; padding: .45rem 0; border-bottom: 1px solid #dfe6e0; font-size: 14px; }
.tt-kv dt { color: #43514a; flex: 1 1 12ch; min-width: 0; font-weight: 400; overflow-wrap: break-word; }
.tt-kv dd { margin: 0; margin-inline-start: auto; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; flex: 0 0 auto; max-width: 100%; white-space: nowrap; }
.tt-kv dd.tt-words { flex: 1 1 12ch; min-width: 0; margin-inline-start: 0; text-align: left; white-space: normal; overflow-wrap: break-word; font-variant-numeric: normal; }
.tt-flagnote { margin: .7rem 0 0; padding: .55rem .8rem; border-radius: 8px; background: #fff6e8; border: 1px solid #f1dcb4; font-size: 13.5px; font-weight: 600; color: #5c3b00; }
.tt-note { font-size: 13px; line-height: 1.5; color: #43514a; margin: .6rem 0 0; }

/* Share, under the result */
.tt-share { margin-top: 1rem; padding: 1rem; border: 1px solid #e7e1d6; border-radius: 10px; background: #fff; font-size: 14px; }
.tt-share h2 { font-size: 1rem; font-weight: 800; margin: 0 0 .6rem; color: #16281d; }
.tt-share-include { display: flex; align-items: center; gap: .6rem; min-height: 44px; font-weight: 600; }
.tt-share-include input { width: 20px; height: 20px; accent-color: var(--accent-strong, #b8501f); }
.tt-share-notice { font-size: 13px; line-height: 1.5; color: #43514a; margin: .2rem 0 .7rem; }
.tt-share input[type="text"] { width: 100%; box-sizing: border-box; min-height: 44px; padding: 8px 10px; font-size: 14px; border: 1px solid #cfd8d2; border-radius: 6px; background: #f6f7f5; color: #1f2a24; font-family: inherit; }
.tt-share-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: .7rem 0 0; }
.tt-share-bare { margin: .9rem 0 0; font-size: 13px; color: #43514a; }
.tt-share-bare label { display: block; margin-bottom: .3rem; }

/* Embed (EMBED-WAVE.md section 2). The button is a link to #embed and the panel is closed, so with scripts off :target shows it; once the page script has taken the
   panel over it adds .tt-js, and the open state is .tt-open alone. (Not the hidden attribute: ".tt-wrap [hidden]" above is !important and would beat :target.) */

/* Feedback (owner decision Q44). The bar is hidden until the page script runs. The dialog is a native <dialog>: the browser traps focus in it, closes it on Escape and
   returns focus to the button. Styled like the Portal's modal (ModalShell): one width, a sheet on a phone, no hand-rolled backdrop. */
.tt-feedback-bar { margin-top: 1rem; }
.tt-fb { width: min(520px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 1px solid #e7e1d6; border-radius: 12px; background: #fff; color: #1f2a24; box-shadow: 0 18px 48px rgba(22, 40, 29, .28); overflow: auto; }
.tt-fb::backdrop { background: rgba(22, 40, 29, .45); }
.tt-fb-form { padding: 1.25rem 1.4rem 1.2rem; font-size: 14px; }
.tt-fb h2 { font-size: 1.1rem; font-weight: 800; margin: 0 0 .8rem; color: #16281d; }
.tt-fb label { display: block; margin: 0 0 .3rem; font-weight: 700; }
.tt-fb textarea { display: block; width: 100%; box-sizing: border-box; min-height: 8.5em; padding: 8px 10px; font: inherit; line-height: 1.45; border: 1px solid #cfd8d2; border-radius: 6px; background: #fff; color: #1f2a24; resize: vertical; }
.tt-fb textarea:focus-visible { outline: 3px solid #1b3d2a; outline-offset: 1px; }
.tt-fb-count { margin: .3rem 0 0; font-size: 12.5px; color: #43514a; text-align: right; font-variant-numeric: tabular-nums; }
.tt-fb-count.tt-fb-over { color: #8a1f11; font-weight: 700; }
.tt-fb-note { margin: .5rem 0 0; font-size: 13px; line-height: 1.5; color: #43514a; }
.tt-fb-status { margin: .8rem 0 0; padding: .6rem .8rem; border-radius: 8px; background: #eef6f0; border: 1px solid #cfe3d5; font-size: 14px; font-weight: 600; color: #16281d; }
.tt-fb-status.tt-fb-bad { background: #fff6e8; border-color: #f1dcb4; color: #5c3b00; }
/* The honeypot: a field a person never sees or reaches. Positioned away, not display:none, which a bot may skip. */
.tt-fb-hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
@media (max-width: 767.98px) {
    .tt-fb { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 14px 14px 0 0; }
    .tt-fb .tt-share-actions > * { flex: 1 1 100%; }
}
.tt-embed { display: none; margin-top: 1rem; padding: 1rem; border: 1px solid #e7e1d6; border-radius: 10px; background: #fff; font-size: 14px; min-width: 0; }
.tt-embed:target:not(.tt-js), .tt-embed.tt-open { display: block; }
.tt-embed h2 { font-size: 1rem; font-weight: 800; margin: 0 0 .6rem; color: #16281d; }
.tt-embed h3, .ep-builder h3 { font-size: .9rem; font-weight: 800; margin: .9rem 0 .4rem; color: #16281d; }
.tt-embed-row { margin: 0 0 .8rem; padding: 0; border: 0; min-width: 0; }
.tt-embed-row > label, .tt-embed-row > legend { display: block; margin: 0 0 .3rem; padding: 0; font-size: 14px; font-weight: 700; }
.tt-embed-row select { width: 100%; box-sizing: border-box; min-height: 44px; padding: 8px 10px; font-size: 14px; border: 1px solid #cfd8d2; border-radius: 6px; background: #fff; color: #1f2a24; font-family: inherit; }
.tt-embed-themes label { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; margin: 0 1rem 0 0; font-weight: 400; }
.tt-embed-themes input, .tt-embed-check input { width: 20px; height: 20px; accent-color: var(--accent-strong, #b8501f); }
.tt-embed-accent input[type="color"] { width: 56px; height: 44px; padding: 2px; border: 1px solid #cfd8d2; border-radius: 6px; background: #fff; vertical-align: middle; }
.tt-embed-accent .tt-embed-check { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; margin: 0 0 0 .8rem; font-weight: 400; }
.tt-embed .tt-share-include[disabled], .tt-embed .tt-share-include:has(input:disabled), .ep-lock:has(input:disabled) { opacity: .6; }
.tt-embed-code-label { display: block; margin: 0 0 .3rem; font-weight: 700; }
.tt-embed textarea, .ep-builder textarea { display: block; width: 100%; max-width: 100%; box-sizing: border-box; min-height: 9.5em; padding: 8px 10px; font: 13px/1.45 ui-monospace, Consolas, monospace; border: 1px solid #cfd8d2; border-radius: 6px; background: #f6f7f5; color: #1f2a24; white-space: pre-wrap; overflow-wrap: anywhere; resize: vertical; }
.tt-embed-preview { margin-top: .8rem; padding-top: .2rem; border-top: 1px solid #e7e1d6; overflow-x: auto; }
.tt-embed-note { margin: .8rem 0 0; font-size: 13px; line-height: 1.5; color: #43514a; }
.tt-embed-more { margin: .5rem 0 0; font-size: 13px; }
.tt-embed-more a { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; }
.tt-cta { margin-top: 1rem; padding: 1rem; border: 1px solid #e7e1d6; border-radius: 10px; background: #fbfdfb; font-size: 14px; }
.tt-cta p { margin: 0 0 .8rem; line-height: 1.5; }
.tt-btn-primary { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; background: var(--accent-strong, #b8501f); color: #fff; font-weight: 700; font-size: 15px; padding: 10px 22px; border-radius: 4px; text-decoration: none; transition: background .12s, transform .1s; }
.tt-btn-primary:hover { background: var(--accent-hover, #c0612e); color: #fff; transform: translateY(-1px); }
.tt-btn-primary:focus-visible { outline: 3px solid #1b3d2a; outline-offset: 2px; }

/* How this is worked out: the part search engines and AI answers quote. */
.tt-how { max-width: 70ch; margin: 2rem auto 0; }
.tt-how h2 { font-size: 1.35rem; font-weight: 800; color: #16281d; margin: 0 0 .7rem; }
.tt-how h3 { font-size: 1.05rem; font-weight: 800; color: #16281d; margin: 1.4rem 0 .5rem; }
.tt-how p { line-height: 1.65; color: #2f3d36; margin: 0 0 .9rem; }
.tt-how a, .tt-others a, .tt-covers a { color: #1b3d2a; font-weight: 600; }
.tt-others { max-width: 70ch; margin: 2rem auto 0; }
.tt-others h2 { font-size: 1.15rem; font-weight: 800; color: #16281d; margin: 0 0 .7rem; }
.tt-others ul, .tt-covers ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.tt-others li { border: 1px solid #e7e1d6; border-radius: 10px; padding: .7rem .9rem; background: #fff; }
.tt-others li span { display: block; font-size: 13.5px; color: #43514a; margin-top: .15rem; }
.tt-covers { max-width: 60ch; margin: 0 auto; padding: 2rem 0; text-align: center; }
.tt-covers h1 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); font-weight: 800; color: #16281d; margin: 0 0 1rem; text-wrap: balance; }
.tt-covers p { line-height: 1.55; color: #43514a; }
.tt-covers ul { text-align: left; margin-top: .8rem; }
.tt-foot { font-size: 12.5px; line-height: 1.5; color: #56665e; max-width: 70ch; margin: 2rem auto 0; text-align: center; }

/* Phones: a compact result bar stays at the bottom once any field has a value (CSS only: an input whose placeholder is not showing
   has text in it). It repeats the headline, so it is hidden from assistive technology and holds nothing focusable. */
.tt-sticky { display: none; }
@media (max-width: 767.98px) {
  .tt-wrap:has(.tt-form input[type="text"]:not(:placeholder-shown)) .tt-sticky {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    min-height: 44px; padding: .55rem 1rem; box-sizing: border-box;
    background: #1b3d2a; color: #fff; box-shadow: 0 -6px 18px rgba(0,0,0,.25);
  }
  /* The line for the checked mode is shown as a flex row by the page's per-mode rule; the others stay hidden. */
  .tt-sticky-line { flex: 1; align-items: baseline; justify-content: space-between; gap: .75rem; min-width: 0; }
  .tt-sticky-label { font-size: 13px; opacity: .9; min-width: 0; overflow-wrap: break-word; }
  .tt-sticky-value { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; flex: none; white-space: nowrap; }
  .tt-wrap { padding-bottom: 6rem; }
}

@media (prefers-reduced-motion: reduce) { .tt-btn-primary { transition: none; } }

/* The Portal's shared button, drawn for the public pages: white on the plain accent is 3.1:1, so the primary uses the darker accent that
   clears 4.5:1 (the same fix the site header's sign-up button carries), and text is 15px like the page's other calls to action. */
.tt-wrap .btn { font-size: 15px; }
.tt-wrap .btn-primary { background: var(--accent-strong, #b8501f); border-color: var(--accent-strong, #b8501f); color: #fff; }
.tt-wrap .btn-primary:hover, .tt-wrap .btn-primary:focus-visible { background: #9f4418; border-color: #9f4418; color: #fff; }

/* ── W2: tool page polish ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
   The action row, the info button on the Result heading, the back links and THE sheet (one native <dialog> wearing ModalShell's header, body and footer from
   portal-ui.css, filled by src/dom/sheet.ts). Markup contract: docs/design/free-tools-specs/W2-TOOL-PAGE-POLISH.md section 7. */

/* Back to all calculators: above the hero and at the foot. The guide link beside the foot one is hidden while the How section (which holds its own) is in the page. */
.tt-back { margin: 1rem 0 -1.5rem; }
.tt-back a, .tt-links a { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; color: #1b3d2a; font-weight: 700; font-size: 14px; text-decoration: none; }
.tt-back a:hover, .tt-links a:hover { text-decoration: underline; }
.tt-links { max-width: 70ch; margin: 1.6rem auto 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .2rem 1.8rem; }
.tt-wrap:has(.tt-how) .tt-links .tt-guide-foot { display: none; }

/* The info button on the Result heading. */
.tt-result-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 0 0 .2rem; }
.tt-result-head .tt-result-title { margin: 0; }
.tt-result-head .btn { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 50%; font-size: 18px; background: #fff; }

/* The action row: one row of equal buttons under the result (two when there is no AI button). */
.tt-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .6rem; margin-top: 1rem; }
.tt-actions > .cc-tip-host, .tt-actions .btn { width: 100%; }
/* The right-most button's tooltip hangs from its right edge, so a hidden tooltip never widens the page. */
.tt-actions > .cc-tip-host:last-child > .cc-tip, .tt-result-head > .cc-tip-host:last-child > .cc-tip { left: auto; right: 0; transform: none; }
.tt-actions > .cc-tip-host:last-child > .cc-tip::after, .tt-result-head > .cc-tip-host:last-child > .cc-tip::after { left: auto; right: 11px; }
.tt-actions .btn { justify-content: center; font-size: 14.5px; padding-left: .5rem; padding-right: .5rem; white-space: nowrap; }
@media (max-width: 767.98px) {
  .tt-actions { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
  .tt-actions > .cc-tip-host:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* The sign-up button's icon is the TallyTill logo. */
.tt-btn-primary .tt-logo { width: 20px; height: 20px; border-radius: 5px; flex: none; box-shadow: 0 0 0 1px rgba(255,255,255,.55); }

/* The sections the sheet shows. With scripts off :target reveals them (the script adds .tt-js to a section it has taken over, and .tt-open shows it in the page). #how is not
   one of these: it is in the page's normal flow. */
.tt-sheet-sec { display: none; margin-top: 1rem; }
.tt-sheet-sec:target:not(.tt-js), .tt-sheet-sec.tt-open { display: block; }
.tt-ai { padding: 1rem; border: 1px solid #e7e1d6; border-radius: 10px; background: #fff; font-size: 14px; min-width: 0; }
.tt-ai h2 { font-size: 1rem; font-weight: 800; margin: 0 0 .6rem; color: #16281d; }

/* THE sheet: a centred 640px modal on a desktop and a full-screen sheet below 768px. */
.tt-dlg { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: var(--radius-lg, 12px); background: var(--card-bg, #fff); color: var(--text-primary, #1f2a24); box-shadow: var(--cc-shadow-modal); overflow: clip; font-family: var(--font-sans, 'Plus Jakarta Sans', system-ui, sans-serif); }
.tt-dlg[open] { display: flex; flex-direction: column; }
.tt-dlg [hidden] { display: none !important; }
.tt-dlg::backdrop { background: var(--cc-scrim, rgba(17,26,20,.5)); }
/* The dialog is overflow: clip, not hidden: a hidden box can still be scrolled by focus, find-in-page or the keyboard, which pushed the header off the top and left a blank band under the footer. Only the body scrolls. */
.tt-dlg .cc-modal-h, .tt-dlg .cc-modal-f { flex: 0 0 auto; }
.tt-dlg .cc-modal-b { font-size: 14px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; scroll-padding-top: 24px; }
/* A button the script has not revealed (copy, the device's share menu) is hidden, but its tooltip wrapper is not: without this the wrapper takes a gap in the row and its tip widens the sheet. */
.tt-dlg .cc-tip-host:has(> [hidden]), .tt-sheet-sec .cc-tip-host:has(> [hidden]) { display: none; }
.tt-dlg .cc-modal-b .btn { font-size: 14px; }
.tt-dlg [data-sheet-own-heading] { display: none; }
/* The header ✕ is a PortalButton (.btn) wearing the modal's .cc-x look: the .btn box (padding, border, inline-flex) gives way to the 36px round-cornered square. */
.tt-dlg .cc-x.btn { width: 36px; height: 36px; min-height: 0; padding: 0; border: 0; background: none; display: grid; place-items: center; color: var(--text-muted); font-size: 18px; line-height: 1; }
.tt-dlg .cc-x.btn:hover { background: var(--content-bg); color: var(--text-primary); }
.tt-dlg .tt-sheet-sec { display: block; margin: 0; padding: 0; border: 0; background: none; }
.tt-dlg .tt-share, .tt-dlg .tt-embed { margin: 0; padding: 0; border: 0; background: none; }
.tt-dlg .tt-how { max-width: none; margin: 0; }
.tt-dlg .tt-sr { position: absolute; }
.tt-dlg h3 { font-size: .95rem; font-weight: 800; color: #16281d; margin: 1.1rem 0 .45rem; }
.tt-dlg .tt-how h3 { font-size: .95rem; margin: 1.1rem 0 .45rem; }
.tt-dlg .cc-modal-b p { line-height: 1.6; }
.tt-dlg .tt-guide, .tt-ai .tt-guide { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; color: #1b3d2a; font-weight: 700; }
.tt-dlg .tt-share input[type="text"] { width: 100%; box-sizing: border-box; min-height: 44px; padding: 8px 10px; font-size: 14px; border: 1px solid #cfd8d2; border-radius: 6px; background: #f6f7f5; color: #1f2a24; font-family: inherit; }
.tt-steps { margin: .2rem 0 .4rem; padding-left: 1.3rem; line-height: 1.6; }
.tt-steps li { margin: 0 0 .3rem; padding-left: .15rem; }
.tt-ai-app { margin: .6rem 0 0; }
.tt-ai h3 + .tt-ai-app { margin-top: 0; }
.tt-addr { display: flex; gap: .5rem; align-items: stretch; margin: .3rem 0 .2rem; }
.tt-addr input { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 8px 10px; font: 13.5px/1.4 ui-monospace, Consolas, monospace; border: 1px solid #cfd8d2; border-radius: 6px; background: #f6f7f5; color: #1f2a24; }
.tt-try { margin: .3rem 0 0; padding: .7rem .9rem; border-radius: 8px; background: #eef4ef; border: 1px solid #d9e6dd; font-weight: 600; color: #16281d; }
.tt-see { margin: .2rem 0 0; padding-left: 1.2rem; line-height: 1.6; }
.tt-small { font-size: 13px; color: #43514a; }
@media (max-width: 767.98px) {
  /* Below 768px the sheet fills the screen (PORTAL_UI_STANDARD section 2), with full-width 44px buttons (portal-ui.css already stacks .cc-modal-f). */
  .tt-dlg { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .tt-dlg .cc-modal-h { padding: 14px 16px 8px; }
  .tt-dlg .cc-modal-b { padding: 4px 16px 12px; }
  .tt-addr { flex-direction: column; }
}

/* ── The hub (/tools) and category pages: Components/Pages/Tools/ToolsHub.razor ─────────────────────────────────────────────────────
   Plain links and a plain GET form: nothing here needs a script. The script (hub.ts) only toggles [hidden] on the cards and moves them. */
.th-search { max-width: 720px; margin: 0 auto 1.1rem; }
.th-search-row { display: flex; gap: .6rem; align-items: stretch; }
.th-input { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.th-input > i { position: absolute; left: 14px; color: #56665e; pointer-events: none; }
.th-input input { width: 100%; box-sizing: border-box; min-height: 44px; padding: 10px 12px 10px 40px; font-size: 1.05rem; font-family: inherit; border: 1px solid #cfd8d2; border-radius: 6px; background: #fff; color: #1f2a24; }
.th-input input::placeholder { color: #6b7a72; }
.th-input input:focus { outline: 2px solid var(--accent, #d97746); outline-offset: 1px; border-color: transparent; }

.th-chips { list-style: none; padding: 0; margin: 0 0 1.4rem; display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.th-chip { display: inline-flex; align-items: center; min-height: 44px; padding: .35rem 1rem; border: 1px solid #cfd8d2; border-radius: 999px; background: #fff; color: #1b3d2a; font-weight: 700; font-size: 14px; text-decoration: none; }
.th-chip:hover { border-color: #1b3d2a; }
.th-chip[aria-current="true"] { background: #1b3d2a; border-color: #1b3d2a; color: #fff; }
.th-chip:focus-visible, .th-card:focus-visible { outline: 3px solid var(--accent, #d97746); outline-offset: 2px; }

.th-empty { max-width: 60ch; margin: 0 auto 1.2rem; padding: 1.1rem 1.2rem; text-align: center; background: #fff; border: 1px solid #e7e1d6; border-radius: 12px; }
.th-empty p { margin: 0 0 .7rem; font-size: 1.05rem; font-weight: 700; color: #16281d; }
.th-empty p i { color: #56665e; margin-right: .3rem; }

.th-grid { list-style: none; padding: 0; margin: 0 0 1.4rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.th-grid > li { min-width: 0; }
.th-card { display: flex; flex-direction: column; gap: .45rem; height: 100%; box-sizing: border-box; padding: 1rem 1.1rem; background: #fff; border: 1px solid #e7e1d6; border-left: 4px solid #1b3d2a; border-radius: 10px; box-shadow: 0 4px 16px rgba(27,61,42,.05); color: #1f2a24; text-decoration: none; }
.th-card:hover { box-shadow: 0 8px 24px rgba(27,61,42,.12); transform: translateY(-1px); }
.th-card-head { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.02rem; color: #16281d; }
.th-card-icon { color: var(--accent-strong, #b8501f); font-size: 1.15rem; }
.th-card-title { min-width: 0; overflow-wrap: anywhere; }
.th-card-go { margin-left: auto; color: #1b3d2a; }
.th-card-q { font-size: 13.5px; line-height: 1.45; color: #43514a; }

.th-browse { margin: 0 0 1.4rem; }
.th-browse h2 { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #55605a; margin: 0 0 .7rem; }
.th-browse ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.th-browse li { display: flex; flex-wrap: wrap; gap: .2rem .8rem; align-items: baseline; }
.th-browse a { color: #1b3d2a; font-weight: 700; }
.th-browse span { font-size: 13.5px; color: #43514a; }

.th-band { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin: 0 0 .9rem; padding: 1.1rem 1.3rem; background: #fff; border: 1px solid #e7e1d6; border-radius: 12px; }
.th-band p { margin: 0; flex: 1 1 22rem; max-width: 62ch; font-size: 14px; line-height: 1.5; color: #43514a; }
.th-band strong { color: #16281d; }
.th-ai { scroll-margin-top: 84px; margin: 0 0 .9rem; }
.th-ai h3 { margin-top: 1.6rem; }

@media (max-width: 720px) { .th-grid { grid-template-columns: minmax(0, 1fr); } .th-band { padding: 1rem; } }
@media (prefers-reduced-motion: reduce) { .th-card:hover { transform: none; } }
.th-note { margin: .5rem 0 0; font-size: 13px; line-height: 1.45; color: #43514a; }

/* The embed page (/tools/embed, EMBED-WAVE.md section 3): sections stacked in a column, the builder reusing the tool pages' Embed panel's controls (.tt-embed-*). */
.ep-section { margin: 0 0 1.4rem; padding: 1.4rem 1.5rem; background: #fff; border: 1px solid #e7e1d6; border-radius: 12px; min-width: 0; }
.ep-section h2 { font-size: 1.15rem; font-weight: 800; margin: 0 0 .7rem; color: #16281d; }
.ep-section p { line-height: 1.55; color: #43514a; }
.ep-steps, .ep-list { margin: 0; padding-left: 1.3rem; line-height: 1.7; color: #1f2a24; }
.ep-steps li, .ep-list li { padding-left: .2rem; }
.ep-picker { display: flex; flex-wrap: wrap; gap: .8rem; align-items: end; margin: 0 0 1rem; }
.ep-picker .tt-embed-row { flex: 1 1 18rem; margin: 0; }
.ep-options { margin: 0 0 1rem; }
.ep-presets { margin: .4rem 0 1rem; padding-top: .2rem; border-top: 1px solid #e7e1d6; }
.ep-preset { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: .8rem; align-items: end; }
.ep-preset > label:first-child { grid-column: 1 / -1; }
.ep-preset input[type="text"], .ep-preset select { width: 100%; min-width: 0; box-sizing: border-box; min-height: 44px; padding: 8px 10px; font-size: 14px; border: 1px solid #cfd8d2; border-radius: 6px; background: #fff; color: #1f2a24; font-family: inherit; }
.ep-lock { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; font-weight: 600; }
.ep-lock input { width: 20px; height: 20px; accent-color: var(--accent-strong, #b8501f); }
.ep-fallback { margin: 1rem 0 0; font-size: 14px; }
.ep-fallback p { margin: 0 0 .3rem; font-weight: 700; color: #16281d; }
.ep-fallback ul { margin: 0; padding-left: 1.2rem; columns: 2 16rem; }
.ep-fallback a { display: inline-block; min-height: 32px; padding: 4px 0; }
.ep-platforms { list-style: none; margin: 0 0 .8rem; padding: 0; display: grid; gap: .6rem; }
.ep-platforms li { padding: .7rem .9rem; border: 1px solid #e7e1d6; border-radius: 8px; background: #fbfdfb; line-height: 1.5; }
.ep-platforms strong { display: block; color: #16281d; }
.ep-platforms span { color: #43514a; font-size: 14px; }
.ep-tell { margin: 0; font-size: 14px; }
.ep-mcp { display: block; width: 100%; box-sizing: border-box; min-height: 44px; padding: 8px 10px; font: 13px/1.45 ui-monospace, Consolas, monospace; border: 1px solid #cfd8d2; border-radius: 6px; background: #f6f7f5; color: #1f2a24; }
.ep-cta { margin-top: 0; }
@media (max-width: 720px) { .ep-section { padding: 1.1rem; } }
