/* Tool Cloud design system (2026-11 redesign). Tokens, tiled page frame, header, footer and shared components.
   Page files: tc-home.css (home), tc-tool.css (tool pages), tc-pages.css (category, docs, contact, legal, errors, settings).
   Motion: static/js/tc-motion.js (data attributes, documented there).

   Components (markup contracts)
   - Row (P1):        <section class="tc-row"><div>…tiles…</div></section>   rails come from ::before/::after (≥768px)
                      <div class="tc-row tc-row--rails"><div class="tc-rail">…</div><div>…</div><div class="tc-rail">…</div></div>
   - Tile:            <div class="tc-tile">…</div>          dark surfaces: wrap rows in <div class="tc-dark">
   - Spacer (P2):     <div class="tc-tile tc-spacer" aria-hidden="true"></div>   (.tc-spacer--sm = 80px everywhere)
   - Masthead (P3):   <div class="tc-tile tc-masthead"><p class="tc-eyebrow"><span class="s">// </span><span class="n">01 / </span><span class="c">LABEL</span><span class="s"> //</span></p><h2>Title</h2><p class="tc-masthead__sub">…</p></div>
   - Mono label:      <span class="tc-mono-label">YOUR FILE. YOUR FORMAT.</span>
   - Buttons (P24):   <a class="tc-btn tc-btn--primary">Label <svg class="tc-btn__arrow">…</svg></a>  --outline, --ghost, --lg, --sm, --block
   - Arrow link:      <a class="tc-arrow-link">Label <svg class="tc-arrow" viewBox="0 0 16 16"><g><path class="tc-arrow-tail" d="M3 8h9"/><path d="M8.5 4.5 12 8l-3.5 3.5"/></g></svg></a>
   - Proof pill (P5): <p class="tc-proof"><svg…/><span class="tc-proof__div"></span>Text</p>
   - Chips:           <ul class="tc-chips"><li>…</li></ul>  badge: <span class="tc-badge">2 credits</span> <span class="tc-badge tc-badge--free">Free</span>
   - Sliding pills:   <div class="tc-pills" data-pills role="group"><span class="tc-pills__ind" aria-hidden="true"></span><button class="tc-pill" aria-pressed="true"><span data-label="Image 53">Image 53</span></button>…</div>
   - Tool grid:       <div class="tc-tools"><a class="tc-tool" href>{% cat_icon %}<span class="tc-tool__body"><strong>Name</strong><small>…</small></span><svg class="tc-tool__chev"/></a></div>  (.tc-tools--wide: 3 cols, with descriptions)
   - Breadcrumb:      <nav class="tc-crumbs" aria-label>…<a>Tools</a><span aria-hidden="true">/</span><span aria-current="page">X</span></nav>
   - Intro tile:      <div class="tc-tile tc-intro">crumbs, art, h1, lead (.tc-intro__lead), chips</div>
   - FAQ:             <div class="tc-faq"><details class="tc-faq__item" open><summary><h3>Q</h3><span class="tc-faq__icon"></span></summary><p>A</p></details></div>
   - Code editor:     <div class="tc-editor" data-code-tabs><div class="tc-editor__head"><div class="tc-pills tc-pills--dark" data-pills>…</div><button class="tc-copy">…</button></div><div class="tc-editor__body"><pre data-code-panel="curl">…</pre></div></div>
   - Closing CTA:     <div class="tc-tile tc-closing"><div class="tc-glyphs" data-glyphs=".jpg .svg"></div><div class="tc-closing__clear"></div><div class="tc-closing__content">…</div></div>
   - Emblem (P22):    <div class="tc-emblem" data-tilt><span class="tc-emblem__art">…</span></div>
   - Form controls:   .tc-field (label wrapper) .tc-input .tc-select .tc-textarea ; segmented: .tc-pills
   - Reveal (P23):    data-reveal on a container: its direct children rise in once.
*/

@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin-var.260c81a4759b.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/jetbrains-mono-latin-400-normal.caf0dfde4e44.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500 700; font-display: swap; src: url("../fonts/jetbrains-mono-latin-500-normal.a21e038a03f7.woff2") format("woff2"); }

/* 1. Tokens */
:root {
  --tc-blue-600: #2672c4; --tc-blue-700: #1f5da3; --tc-blue-50: #eff6fd; --tc-blue-100: #dbeafa;
  --tc-sky: #61ace3; --tc-sky-200: #8cc0ee;
  --tc-ink-900: #141518; --tc-ink-800: #1f2126;
  --tc-surface: #f4f5f7; --tc-card: #fff; --tc-line: #e6e8ec; --tc-line-strong: #d5d9e0;
  --tc-text: #16181d; --tc-muted: #5b6170; --tc-faint: #7c8492;
  --tc-success: #059669; --tc-warning: #b77913; --tc-danger: #cc4545;
  --tc-cat-image: #2672c4; --tc-cat-video: #7c3aed; --tc-cat-audio: #db2777; --tc-cat-text: #059669; --tc-cat-vector: #ea580c; --tc-cat-general: #475569; --tc-cat-dev: #0f766e;
  --tc-radius: 10px; --tc-radius-lg: 20px;
  --tc-shadow-card: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.08);
  --tc-shadow-instrument: 0 0 44px rgba(0,0,0,.02), 0 88px 56px -20px rgba(0,0,0,.03), 0 56px 56px -20px rgba(0,0,0,.02), 0 32px 32px -20px rgba(0,0,0,.03), 0 16px 24px -12px rgba(0,0,0,.03), 0 0 0 1px rgba(0,0,0,.05), 0 0 0 10px var(--surface-2);
  --tc-ease-out: cubic-bezier(.16,1,.3,1);
  --tc-font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tc-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* contextual surface set (light) */
  --bg: var(--tc-surface); --surface: #fff; --surface-2: #fafbfc; --border: var(--tc-line); --border-strong: var(--tc-line-strong);
  --text: var(--tc-text); --muted: var(--tc-muted); --faint: #949baa; --accent: var(--tc-blue-600); --glyph: var(--tc-blue-600);
  --code-bg: #171a21; --code-text: #c4d8ed;
}
.tc-dark {
  --bg: var(--tc-ink-900); --surface: var(--tc-ink-900); --surface-2: var(--tc-ink-800); --border: #303239; --border-strong: #424651;
  --text: #fff; --muted: #a6acb8; --faint: #737b8b; --glyph: #5498da;
  background: var(--tc-ink-900); color: #fff;
}

/* 2. Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body { margin: 0; font-family: var(--tc-font); font-size: 16px; line-height: 1.6; color: var(--tc-text); background: var(--tc-surface); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -.035em; line-height: 1.15; margin: 0; color: inherit; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button, a, input, select, label, summary { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--tc-sky); outline-offset: 3px; }
code, kbd, pre, samp { font-family: var(--tc-mono); }
.sr-only, .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; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--tc-blue-600); color: #fff; padding: 10px 16px; border-radius: var(--tc-radius); font-weight: 600; font-size: 14px; }
.skip-link:focus { top: 12px; }
.tc-muted { color: var(--muted); }
.tc-accent { color: var(--accent); }
.tc-dark .tc-accent, .tc-dark .tc-sky { color: var(--tc-sky); }
[hidden] { display: none !important; }

/* 3. Tiled canvas (P1) and tiles */
.tc-row { display: grid; grid-template-columns: minmax(0,1fr); }
.tc-row > * { min-width: 0; }
.tc-rail { display: none; }
.tc-tile { border: 1px solid var(--border); border-radius: var(--tc-radius); background: var(--surface); }
.tc-stack { display: flex; flex-direction: column; }
.tc-spacer { height: 80px; }
.tc-spacer--sm { height: 64px; }
@media (min-width: 640px) { .tc-spacer { height: 128px; } .tc-spacer--sm { height: 80px; } }
@media (min-width: 768px) {
  .tc-row { container-type: inline-size; grid-template-columns: minmax(0,1fr) minmax(0,80px) repeat(8,minmax(0,145px)) minmax(0,80px) minmax(0,1fr); }
  .tc-row > * { grid-column: 3 / 11; grid-row: 1; }
  /* Every tile gets its own pair of rail tiles (P1): drawn outside it, as wide as the gutter */
  .tc-row:not(.tc-row--rails) > *, .tc-stack > * { position: relative; }
  .tc-row:not(.tc-row--rails) > :not(.tc-stack)::before, .tc-row:not(.tc-row--rails) > :not(.tc-stack)::after,
  .tc-stack > ::before, .tc-stack > ::after { content: ""; position: absolute; top: -1px; bottom: -1px; width: calc((100cqw - 100% - 2px) / 2); right: calc(100% + 1px); border: 1px solid var(--border); border-radius: var(--tc-radius); pointer-events: none; }
  .tc-row:not(.tc-row--rails) > :not(.tc-stack)::after, .tc-stack > ::after { right: auto; left: calc(100% + 1px); }
  .tc-stack > :not(.tc-tile)::before, .tc-stack > :not(.tc-tile)::after { top: 0; bottom: 0; }
  .tc-row--rails > .tc-rail { display: flex; align-items: center; justify-content: center; grid-column: 1 / 3; border: 1px solid var(--border); border-radius: var(--tc-radius); }
  .tc-row--rails > .tc-rail:last-child { grid-column: 11 / 13; }
}

/* 4. Eyebrows, mastheads (P3), proof pill (P5) */
.tc-mono-label, .tc-eyebrow { font-family: var(--tc-mono); font-size: 10px; font-weight: 500; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.tc-dark .tc-mono-label { color: var(--tc-sky); }
.tc-masthead { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px; text-align: center; min-height: 200px; padding: 45px 26px; }
.tc-masthead--left { align-items: flex-start; text-align: left; }
.tc-masthead .tc-eyebrow { font-size: 14px; letter-spacing: .04em; color: var(--text); }
.tc-masthead .tc-eyebrow .s { opacity: .1; }
.tc-masthead .tc-eyebrow .n { opacity: .25; }
.tc-masthead .tc-eyebrow .c { color: var(--accent); }
.tc-masthead h2 { font-size: 30px; line-height: 38px; font-weight: 800; max-width: 760px; }
.tc-masthead h2 .tc-accent { color: var(--accent); }
.tc-masthead__sub { max-width: 612px; font-size: 16px; line-height: 24px; color: var(--muted); }
@media (min-width: 640px) { .tc-masthead h2 { font-size: 32px; line-height: 40px; } }
@media (max-width: 639px) { .tc-masthead { padding: 35px 22px; min-height: 180px; } .tc-masthead h2 { font-size: 28px; line-height: 1.25; } .tc-masthead .tc-eyebrow { font-size: 12px; } .tc-masthead__sub { font-size: 14px; line-height: 1.6; } }
.tc-proof { display: inline-flex; align-items: center; gap: 12px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 11px; line-height: 1.4; color: var(--text); }
.tc-proof svg { width: 15px; height: 15px; color: var(--tc-sky); flex: none; }
.tc-proof__div { width: 1px; height: 10px; background: var(--border-strong); flex: none; }

/* 5. Buttons (P24) and arrow links */
.tc-btn { position: relative; isolation: isolate; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 0 19px; border: 1px solid var(--border-strong); border-radius: var(--tc-radius); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600; line-height: 1; white-space: nowrap; text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.tc-btn::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(#fff, transparent); opacity: 0; transition: opacity 150ms; pointer-events: none; }
.tc-btn:hover::after { opacity: .2; }
.tc-btn svg { width: 15px; height: 15px; flex: none; }
.tc-btn--primary { background: var(--tc-blue-600); border-color: var(--tc-blue-600); color: #fff; }
.tc-btn--primary:hover { background: var(--tc-blue-700); border-color: var(--tc-blue-700); color: #fff; }
.tc-btn--outline { background: #fff; color: var(--tc-blue-600); border-color: var(--tc-line-strong); }
.tc-btn--outline:hover { background: var(--tc-blue-50); border-color: var(--tc-blue-600); }
.tc-btn--outline::after { display: none; }
.tc-dark .tc-btn--outline { background: transparent; color: #fff; border-color: var(--border-strong); }
.tc-dark .tc-btn--outline:hover { background: var(--tc-ink-800); border-color: var(--tc-sky); }
.tc-btn--ghost { background: transparent; border-color: transparent; color: var(--accent); }
.tc-btn--ghost:hover { background: var(--tc-blue-50); }
.tc-btn--danger { background: #fff; color: var(--tc-danger); border-color: #f0c9c9; }
.tc-btn--danger:hover { background: #fdf2f2; border-color: var(--tc-danger); }
.tc-btn--lg { min-height: 48px; padding: 0 22px; font-size: 14px; }
.tc-btn--sm { min-height: 34px; padding: 0 12px; font-size: 12px; gap: 6px; }
.tc-btn--block { width: 100%; }
.tc-btn:disabled, .tc-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.tc-btn:disabled::after { display: none; }
.tc-btn .tc-spinner { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: tc-spin .7s linear infinite; }
.tc-arrow-link { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--accent); }
.tc-dark .tc-arrow-link { color: var(--tc-sky); }
.tc-arrow { width: 16px; height: 16px; opacity: .6; transition: opacity 150ms; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tc-arrow g { transition: transform 150ms; }
.tc-arrow-tail { stroke-dasharray: 9; stroke-dashoffset: 9; transition: stroke-dashoffset 200ms; }
.tc-arrow-link:is(:hover,:focus-visible) .tc-arrow { opacity: 1; }
.tc-arrow-link:is(:hover,:focus-visible) .tc-arrow g { transform: translateX(2px); }
.tc-arrow-link:is(:hover,:focus-visible) .tc-arrow-tail { stroke-dashoffset: 0; }

/* 6. Badges, chips */
.tc-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--tc-blue-50); color: var(--tc-blue-700); font-size: 11px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.tc-badge--free { background: #e6f7ef; color: #047857; }
.tc-badge--new { background: #e6f7ef; color: #047857; font-size: 10px; font-weight: 700; padding: 1px 7px; margin-left: 6px; vertical-align: middle; }
.tc-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tc-chips > li, .tc-chips > span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--tc-blue-100); border-radius: 20px; background: var(--tc-blue-50); color: var(--tc-blue-600); font-size: 12px; font-weight: 600; line-height: 1.3; }
.tc-chips svg { width: 14px; height: 14px; flex: none; }

/* 7. Sliding pills (P12) */
.tc-pills { position: relative; display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); white-space: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tc-pills::-webkit-scrollbar { display: none; }
.tc-pills__ind { position: absolute; left: 0; top: 4px; bottom: 4px; width: 0; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); box-shadow: var(--tc-shadow-card); transition: transform 300ms cubic-bezier(.2,.8,.2,1), width 300ms cubic-bezier(.2,.8,.2,1); pointer-events: none; }
.tc-pills:not(.is-ready) .tc-pills__ind { display: none; }
.tc-pill { position: relative; z-index: 1; flex: none; border: 1px solid transparent; border-radius: 999px; background: none; padding: 9px 14px; font-size: 12px; font-weight: 500; color: var(--muted); line-height: 1.2; transition: color .15s; }
.tc-pill:hover { color: var(--text); }
.tc-pill[aria-pressed="true"], .tc-pill[aria-selected="true"], .tc-pill.is-active { color: var(--text); font-weight: 600; }
.tc-pills:not(.is-ready) .tc-pill:is([aria-pressed="true"],[aria-selected="true"],.is-active) { background: var(--surface); border-color: var(--border-strong); }
.tc-pill > span { display: inline-block; }
.tc-pill > span[data-label]::after { content: attr(data-label); display: block; height: 0; overflow: hidden; visibility: hidden; font-weight: 600; }
.tc-pill .tc-pill__count { opacity: .55; margin-left: 4px; font-variant-numeric: tabular-nums; }
.tc-pills--dark { --surface-2: rgba(255,255,255,.06); --surface: rgba(255,255,255,.12); --border: rgba(255,255,255,.12); --border-strong: rgba(255,255,255,.22); --text: #fff; --muted: #a6acb8; }

/* 8. Header (P25) + credits chip (§6) */
.tc-header-wrap { position: sticky; top: 0; z-index: 50; background: var(--tc-ink-900); }
.tc-header { position: relative; display: flex; align-items: center; gap: 16px; min-height: 68px; padding: 12px 16px; }
@media (min-width: 1024px) { .tc-header { height: 86px; padding: 0 16px 0 20px; } }
.tc-rail .tc-ornament { width: 52px; height: 52px; color: var(--tc-blue-600); }
.tc-logo { display: inline-flex; align-items: center; gap: 9px; margin-right: auto; color: #fff; font-size: 25px; letter-spacing: -1px; line-height: 1; white-space: nowrap; min-width: 0; }
.tc-logo img { width: 32px; height: 32px; flex: none; }
.tc-logo__name { font-weight: 400; }
.tc-logo__name b { font-weight: 800; }
.tc-nav { display: none; align-items: center; gap: 24px; }
.tc-nav__item { position: relative; }
.tc-nav__trigger, .tc-nav__link { display: inline-flex; align-items: center; gap: 4px; padding: 12px 0; border: 0; background: none; color: #e7e9ee; font-size: 14px; font-weight: 500; line-height: 1; }
.tc-nav__trigger svg { width: 14px; height: 14px; opacity: .6; transition: transform .16s var(--tc-ease-out); }
.tc-nav__item.is-open .tc-nav__trigger svg { transform: rotate(180deg); }
.tc-nav__trigger:hover, .tc-nav__link:hover, .tc-nav__item.is-open .tc-nav__trigger { color: var(--tc-sky-200); }
.tc-header__actions { display: flex; align-items: center; gap: 10px; }
.tc-header__actions .tc-btn { min-height: 44px; height: 44px; }
.tc-credits { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 44px; padding: 0 16px; border: 1px solid #354459; border-radius: 10px; background: #1a2230; color: #c9dbf0; font-size: 13px; font-weight: 600; line-height: 1; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.tc-credits svg { width: 14px; height: 14px; flex: none; color: var(--tc-sky); }
.tc-credits b { font-weight: 800; color: #fff; }
.tc-credits__full, .tc-credits__short { display: inline-flex; align-items: center; gap: 6px; line-height: 1; }
.tc-credits__short { display: none; }
.tc-credits__sep { color: #5d6b80; }
.tc-credits:hover { background: #223049; border-color: var(--tc-sky); color: #fff; }
.tc-credits:focus-visible { outline: 3px solid var(--tc-blue-600); outline-offset: 2px; border-color: var(--tc-sky); }
.tc-credits:active { background: #17202f; border-color: var(--tc-blue-600); }
.tc-burger { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 1px solid #303239; border-radius: 8px; background: none; color: #fff; }
.tc-burger svg { width: 22px; height: 22px; }
.tc-burger .i-close, .tc-header-wrap.is-menu-open .tc-burger .i-open { display: none; }
.tc-header-wrap.is-menu-open .tc-burger .i-close { display: block; }
/* Mega menu: positioned before it's shown, then fades in with a 4px drop (§4.4) */
.tc-menu { position: absolute; z-index: 60; top: calc(100% + 6px); left: -80px; width: min(640px, calc(100vw - 24px)); padding: 0; border: 1px solid #303239; border-radius: var(--tc-radius); background: var(--tc-ink-900); box-shadow: 0 16px 40px rgba(0,0,0,.35); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity 160ms var(--tc-ease-out), transform 160ms var(--tc-ease-out), visibility 0s 160ms; }
.tc-nav__item.is-open .tc-menu { opacity: 1; visibility: visible; transform: none; transition: opacity 160ms var(--tc-ease-out), transform 160ms var(--tc-ease-out), visibility 0s; }
.tc-menu__grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; padding: 24px; }
.tc-menu__item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; color: #fff; transition: background-color 150ms ease-out; }
.tc-menu__item:hover, .tc-menu__item:focus-visible { background: rgba(255,255,255,.07); }
.tc-menu__item strong { display: block; font-size: 13px; font-weight: 600; line-height: 1.3; transition: color 150ms ease-out; }
.tc-menu__item:hover strong, .tc-menu__item:focus-visible strong { color: var(--tc-sky-200); }
.tc-menu__desc { display: block; margin-top: 4px; font-size: 11px; line-height: 1.35; color: #737b8b; transition: color 150ms ease-out; }
.tc-menu__item:hover .tc-menu__desc { color: #a6acb8; }
.tc-menu__new { font-style: normal; font-size: 10px; font-weight: 700; color: #34d399; background: rgba(5,150,105,.16); border-radius: 10px; padding: 2px 7px; margin-left: 6px; vertical-align: middle; }
/* User menu */
.tc-user { position: relative; }
.tc-user__button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid #354459; background: #1a2230; color: #fff; font-weight: 700; font-size: 15px; }
.tc-user__button:hover { border-color: var(--tc-sky); }
.tc-user__menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 230px; padding: 8px; border: 1px solid #303239; border-radius: var(--tc-radius); background: var(--tc-ink-900); box-shadow: 0 16px 40px rgba(0,0,0,.35); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity 160ms var(--tc-ease-out), transform 160ms var(--tc-ease-out), visibility 0s 160ms; }
.tc-user.is-open .tc-user__menu { opacity: 1; visibility: visible; transform: none; transition: opacity 160ms var(--tc-ease-out), transform 160ms var(--tc-ease-out), visibility 0s; }
.tc-user__summary { padding: 10px 12px 12px; border-bottom: 1px solid #303239; margin-bottom: 6px; }
.tc-user__summary strong { display: block; color: #fff; font-size: 14px; }
.tc-user__summary span { display: block; margin-top: 3px; color: #a6acb8; font-size: 12px; }
.tc-user__menu a, .tc-user__menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-radius: 8px; background: none; color: #e7e9ee; font-size: 13px; font-weight: 500; }
.tc-user__menu a:hover, .tc-user__menu button:hover { background: rgba(255,255,255,.07); color: var(--tc-sky-200); }
.tc-user__menu .is-danger { color: #f19a9a; }
.tc-logout-form { margin: 0; }
/* Mobile panel */
.tc-mobile { position: fixed; inset: 68px 0 0; z-index: 49; display: none; flex-direction: column; gap: 22px; padding: 24px max(20px, env(safe-area-inset-left)) max(24px, env(safe-area-inset-bottom)); overflow: auto; background: var(--tc-ink-900); color: #fff; border-top: 1px solid #303239; }
.tc-mobile.is-open { display: flex; }
.tc-mobile__label { font-family: var(--tc-mono); font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: #737b8b; }
.tc-mobile__grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; }
.tc-mobile__cat { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid #303239; border-radius: 10px; font-size: 14px; font-weight: 600; }
.tc-mobile__cat:hover { background: rgba(255,255,255,.07); color: var(--tc-sky-200); }
.tc-mobile__links { display: grid; border-top: 1px solid #303239; }
.tc-mobile__links a, .tc-mobile__links button { display: block; width: 100%; text-align: left; padding: 14px 4px; border: 0; border-bottom: 1px solid #303239; background: none; color: #fff; font-size: 15px; font-weight: 500; }
.tc-mobile__credits { font-size: 14px; color: #c9dbf0; }
.tc-mobile__credits b { color: #fff; }
.tc-mobile__cta { margin-top: auto; }
@media (min-width: 1024px) { .tc-nav { display: flex; } .tc-burger, .tc-mobile, .tc-mobile.is-open { display: none; } }
@media (max-width: 859px) {
  .tc-header { gap: 8px; padding-inline: 12px; }
  .tc-logo { font-size: 20px; gap: 6px; }
  .tc-logo img { width: 28px; height: 28px; }
  .tc-header__actions { gap: 6px; }
  .tc-credits { height: 38px; padding: 0 10px; gap: 5px; font-size: 12px; border-radius: 19px; }
  .tc-credits__full { display: none; }
  .tc-credits__short { display: inline-flex; }
  .tc-header__actions .tc-btn { min-height: 38px; height: 38px; padding: 0 12px; font-size: 12px; }
  .tc-header__actions .tc-btn svg { display: none; }
  .tc-user__button { width: 38px; height: 38px; font-size: 14px; }
}
@media (max-width: 380px) { .tc-logo__name { font-size: 18px; } .tc-header__actions .tc-btn { padding: 0 10px; } }
@media (max-width: 1023px) { .tc-header__actions .tc-btn--signup-desk { display: inline-flex; } }

/* 9. Four-square ornament (P26) */
.tc-ornament g { transform-origin: 26px 26px; animation: tc-quarter 6.667s ease-in-out infinite; }
.tc-ornament rect { transform-box: fill-box; transform-origin: center; animation: tc-square 6.667s ease-in-out infinite; }
.tc-ornament rect:nth-child(2) { animation-delay: 67ms; } .tc-ornament rect:nth-child(3) { animation-delay: 134ms; } .tc-ornament rect:nth-child(4) { animation-delay: 201ms; }
@keyframes tc-square { 0%,4.5%,17%,100% { transform: scale(1); rx: 5px; } 8.5% { transform: scale(.4); rx: 7.5px; } 21% { rx: 0; } 25% { rx: 5px; } }
@keyframes tc-quarter { 0%,8.5% { transform: rotate(0); } 12.5%,17% { transform: rotate(45deg); } 21%,100% { transform: rotate(90deg); } }

/* 10. Glyph field (P6/P20) */
.tc-glyphs { position: absolute; inset: 0; overflow: hidden; pointer-events: none; color: var(--glyph); animation: tc-fade-in 2s ease-out both; }
.tc-glyphs pre { position: absolute; inset: 0; margin: 0; width: 100%; height: 100%; font-family: var(--tc-mono); font-size: 8px; line-height: 9.6px; letter-spacing: 0; white-space: pre; overflow: hidden; user-select: none; opacity: .55; }
@keyframes tc-fade-in { from { opacity: 0; } }

/* 11. Reveal (P23): content is visible without JS; JS marks pending children before they enter view */
[data-reveal] > * { transition: opacity 620ms var(--tc-ease-out), transform 620ms var(--tc-ease-out); }
[data-reveal] > .is-pending { opacity: 0; transform: translateY(12px); }

/* 12. Tool grid tiles (home, category, related) */
.tc-tools { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); border-top: 1px solid var(--border); }
.tc-tool { position: relative; display: flex; align-items: center; gap: 10px; min-height: 118px; padding: 17px 14px; background: var(--surface); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); color: var(--text); text-align: left; transition: background .15s; }
.tc-tool:hover { background: var(--tc-blue-50); }
.tc-tool:focus-visible { outline-offset: -3px; }
.tc-tool__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.tc-tool__name { display: block; font-size: 13px; line-height: 1.4; font-weight: 650; letter-spacing: -.01em; }
.tc-tool__desc { display: block; font-size: 12px; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tc-tool__meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tc-tool__chev { width: 16px; height: 16px; flex: none; color: #9da7b6; transition: transform .15s, color .15s; }
.tc-tool:hover .tc-tool__chev { color: var(--accent); transform: translateX(2px); }
.tc-tools--wide { grid-template-columns: repeat(3, minmax(0,1fr)); }
.tc-tools--wide .tc-tool { align-items: flex-start; min-height: 132px; padding: 20px 18px; }
/* 3D icon partial (components/cat_icon.html) */
.tc-ico3d { position: relative; display: block; flex: none; width: 42px; height: 42px; }
.tc-ico3d > img { display: block; width: 100%; height: 100%; object-fit: contain; }
.tc-ico3d--sm { width: 30px; height: 30px; }
.tc-ico3d__badge { position: absolute; right: -6px; bottom: -3px; padding: 3px 4px; border-radius: 5px; background: var(--tc-blue-600); color: #fff; font-size: 8px; font-weight: 800; line-height: 1; letter-spacing: .02em; }
.tc-ico { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 10px; background: var(--tc-blue-50); color: var(--tc-blue-600); }
.tc-ico svg { width: 60%; height: 60%; }
.tc-ico--video { background: #f3effe; color: var(--tc-cat-video); } .tc-ico--audio { background: #fdf0f6; color: var(--tc-cat-audio); }
.tc-ico--text { background: #e9f8f2; color: var(--tc-cat-text); } .tc-ico--vector { background: #fff2e9; color: var(--tc-cat-vector); }
.tc-ico--general { background: #eef1f5; color: var(--tc-cat-general); } .tc-ico--dev { background: #e8f6f4; color: var(--tc-cat-dev); }
.tc-fmt--mp4, .tc-fmt--mov, .tc-fmt--webm, .tc-fmt--avi, .tc-fmt--mkv, .tc-fmt--gif { background: var(--tc-cat-video); }
.tc-fmt--mp3, .tc-fmt--wav, .tc-fmt--flac, .tc-fmt--aac, .tc-fmt--ogg, .tc-fmt--m4a { background: var(--tc-cat-audio); }
.tc-fmt--svg, .tc-fmt--eps, .tc-fmt--ai { background: var(--tc-cat-vector); }
.tc-fmt--pdf { background: #dc2626; }
@media (max-width: 1000px) { .tc-tools { grid-template-columns: repeat(3, minmax(0,1fr)); } .tc-tools--wide { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 640px) {
  .tc-tools { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tc-tool { min-height: 112px; padding: 12px 10px; gap: 8px; }
  .tc-tool .tc-ico3d { width: 33px; height: 33px; }
  .tc-tool__name { font-size: 12px; }
  .tc-tool__chev { display: none; }
  .tc-tools--wide { grid-template-columns: 1fr; }
  .tc-tools--wide .tc-tool { min-height: 0; }
}

/* 13. Breadcrumb, intro tile */
.tc-crumbs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; font-size: 12px; color: var(--faint); }
.tc-crumbs a { color: var(--muted); }
.tc-crumbs a:hover { color: var(--accent); text-decoration: underline; }
.tc-crumbs [aria-current] { color: var(--text); font-weight: 600; }
.tc-intro { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 40px 28px 34px; text-align: center; }
.tc-intro h1 { max-width: 820px; margin-top: 4px; font-size: 44px; line-height: 1.12; letter-spacing: -.045em; }
.tc-intro h1 .tc-accent { color: var(--accent); }
.tc-intro__lead { max-width: 640px; font-size: 15px; line-height: 1.7; color: var(--muted); }
.tc-intro__art { width: 64px; height: 64px; }
.tc-intro__art--lg { width: 150px; height: 150px; object-fit: contain; }
@media (max-width: 640px) { .tc-intro { padding: 30px 20px 26px; } .tc-intro h1 { font-size: 30px; } .tc-intro__lead { font-size: 14px; } .tc-intro__art--lg { width: 110px; height: 110px; } }

/* 14. FAQ accordion */
.tc-faq { padding: 10px 60px 30px; }
.tc-faq__item { border-bottom: 1px solid var(--border); }
.tc-faq__item summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0; cursor: pointer; list-style: none; }
.tc-faq__item summary::-webkit-details-marker { display: none; }
.tc-faq__item summary h3 { font-size: 14px; font-weight: 600; letter-spacing: -.01em; line-height: 1.5; }
.tc-faq__item summary:hover h3 { color: var(--accent); }
.tc-faq__icon { position: relative; width: 14px; height: 14px; flex: none; color: var(--accent); }
.tc-faq__icon::before, .tc-faq__icon::after { content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .2s var(--tc-ease-out); }
.tc-faq__icon::after { transform: rotate(90deg); }
.tc-faq__item[open] .tc-faq__icon::after { transform: rotate(0); }
.tc-faq__item > p, .tc-faq__item > div { max-width: 800px; margin: -6px 0 0; padding: 0 0 22px; font-size: 13px; line-height: 1.85; color: var(--muted); }
@media (max-width: 640px) { .tc-faq { padding: 0 20px 22px; } .tc-faq__item summary h3 { font-size: 13px; } .tc-faq__item > p { font-size: 13px; } }

/* 15. Code editor (P13/P14) */
.tc-editor { min-width: 0; display: flex; flex-direction: column; background: var(--code-bg); color: var(--code-text); }
.tc-editor__head { display: flex; align-items: center; gap: 8px; min-height: 72px; padding: 0 16px; border-bottom: 1px solid rgba(255,255,255,.1); }
.tc-editor__head .tc-pills { flex: 0 1 auto; }
.tc-editor__title { flex: 1; min-width: 0; font-family: var(--tc-mono); font-size: 11px; color: #859bb3; }
.tc-copy { margin-left: auto; flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; background: none; color: #c4d8ed; transition: transform 150ms, background .15s; }
.tc-copy:hover { background: rgba(255,255,255,.08); }
.tc-copy:active { transform: scale(.9); }
.tc-copy svg { width: 16px; height: 16px; }
.tc-copy .i-check { display: none; color: #34d399; }
.tc-copy.is-copied .i-copy { display: none; }
.tc-copy.is-copied .i-check { display: block; animation: tc-check 300ms ease-out; }
.tc-editor__body { flex: 1; padding: 18px 20px 24px; overflow-x: auto; }
.tc-editor__body pre, pre.tc-code { margin: 0; font-family: var(--tc-mono); font-size: 12.5px; line-height: 1.85; white-space: pre; tab-size: 2; color: var(--code-text); }
.tc-editor .c, .tc-code .c { color: #859bb3; } .tc-editor .s, .tc-code .s { color: #8cd6a8; } .tc-editor .k, .tc-code .k { color: #8cc0ee; } .tc-editor .n, .tc-code .n { color: #f0b37e; }
pre.tc-code { padding: 18px 20px; border-radius: var(--tc-radius); background: var(--code-bg); overflow-x: auto; }
@keyframes tc-check { 0% { transform: scale(.5); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }

/* 16. Closing CTA (P20), emblems (P22) */
.tc-closing { position: relative; display: grid; place-items: center; padding: 64px 20px; }
.tc-closing .tc-glyphs { opacity: .24; }
.tc-closing__clear { position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(ellipse 65% 75% at 50% 50%, var(--surface) 45%, transparent 100%); }
.tc-closing__content { position: relative; z-index: 1; max-width: 664px; display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.tc-closing h2 { font-size: 48px; line-height: 1.12; letter-spacing: -.045em; }
.tc-closing p { font-size: 13px; color: var(--muted); }
@media (min-width: 1024px) { .tc-closing { padding: 96px 32px; } }
@media (max-width: 640px) { .tc-closing h2 { font-size: 34px; } }
.tc-emblems { display: flex; justify-content: center; flex-wrap: wrap; gap: 80px; padding: 32px; }
.tc-emblem { width: 200px; max-width: 45%; min-height: 132px; padding: 20px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--tc-radius); overflow: hidden; perspective: 600px; }
.tc-emblem__art { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; transition: transform 400ms var(--tc-ease-out); transform: perspective(600px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)); }
.tc-emblem:hover .tc-emblem__art { transform: perspective(600px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)) translateY(-3px) scale(1.05); transition: transform 250ms cubic-bezier(.22,1,.36,1); }
.tc-emblem__art img { width: 65px; height: 65px; }
.tc-emblem__art span { font-size: 11px; color: var(--muted); text-align: center; }
.tc-emblem__art::after { content: ""; position: absolute; top: 0; bottom: 0; left: -200%; width: 14%; background: #fff; opacity: .35; transform: skewX(-30deg); pointer-events: none; }
.tc-emblem:hover .tc-emblem__art::after { animation: tc-shine 700ms ease-in-out; }
@keyframes tc-shine { from { left: -200%; } to { left: 800%; } }
@media (max-width: 640px) { .tc-emblems { gap: 14px; padding: 24px 8px; } .tc-emblem__art span { font-size: 10px; } }

/* 17. Footer (P21) */
.tc-footer-brand { display: flex; align-items: center; gap: 70px; padding: 45px 48px; }
.tc-footer-brand p { max-width: 520px; font-size: 12px; line-height: 1.8; color: var(--muted); }
.tc-directory { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); align-items: start; }
.tc-directory__col { display: grid; }
.tc-directory h2, .tc-directory a { display: flex; align-items: center; height: 70px; padding: 0 20px; border: 1px solid var(--border); border-radius: var(--tc-radius); }
.tc-directory h2 { font-family: var(--tc-mono); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #fff; }
.tc-directory a { font-size: 14px; color: #e7e9ee; transition: background .15s, color .15s; }
.tc-directory a:hover { background: var(--surface-2); color: var(--tc-sky-200); }
.tc-lang { position: relative; color: #e7e9ee; }
.tc-lang summary { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 8px; cursor: pointer; list-style: none; font-size: 12px; }
.tc-lang summary::-webkit-details-marker { display: none; }
.tc-lang summary:hover { background: rgba(255,255,255,.07); }
.tc-lang summary svg { width: 15px; height: 15px; }
.tc-lang .tc-lang__chev { width: 13px; height: 13px; transition: transform .16s; }
.tc-lang[open] .tc-lang__chev { transform: rotate(180deg); }
.tc-lang__menu { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 20; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 2px; min-width: 18rem; max-height: min(70vh, 26rem); overflow-y: auto; margin: 0; padding: 8px; list-style: none; border: 1px solid #303239; border-radius: var(--tc-radius); background: var(--tc-ink-800); box-shadow: 0 16px 40px rgba(0,0,0,.4); }
.tc-lang__menu a { display: block; padding: 8px 10px; border-radius: 8px; font-size: 13px; color: #e7e9ee; }
.tc-lang__menu a:hover { background: rgba(255,255,255,.07); color: var(--tc-sky-200); }
.tc-lang__menu .is-current { font-weight: 700; color: var(--tc-sky); }
@media (max-width: 640px) {
  .tc-footer-brand { flex-direction: column; align-items: flex-start; gap: 20px; padding: 30px 24px; }
  .tc-directory h2 { height: 52px; padding: 0 12px; font-size: 10px; }
  .tc-directory a { height: 58px; padding: 0 12px; font-size: 12px; }
}

/* Footer bottom bar. Desktop: one row on the directory's 20px text inset (copyright left, notice centred, language right).
   Tablet: copyright + language on top, the notice below. Phone: a stack with a full-width language control.
   The language menu opens upward (the bar is the last thing on the page), within the viewport, and scrolls if it must. */
.tc-footer-bottom { display: grid; grid-template-columns: auto minmax(0,1fr) auto; grid-template-areas: "copy note lang"; align-items: center; gap: 10px 32px; padding: 16px 20px; font-size: 11px; line-height: 1.6; color: #c4c9d3; }
.tc-footer-bottom__copy { grid-area: copy; white-space: nowrap; }
.tc-footer-bottom__note { grid-area: note; text-align: center; }
.tc-footer-bottom .tc-lang { grid-area: lang; justify-self: end; }
.tc-footer-bottom .tc-lang summary { min-height: 36px; padding: 0 12px; border: 1px solid #303239; border-radius: 8px; white-space: nowrap; }
.tc-footer-bottom .tc-lang[open] summary { border-color: #4a4f5a; background: rgba(255,255,255,.05); }
@media (max-width: 1023px) {
  .tc-footer-bottom { grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "copy lang" "note note"; gap: 6px 24px; }
  .tc-footer-bottom__note { text-align: left; }
}
@media (max-width: 640px) {
  .tc-footer-bottom { grid-template-columns: minmax(0,1fr); grid-template-areas: "copy" "note" "lang"; gap: 4px; padding: 20px; }
  .tc-footer-bottom__copy { white-space: normal; }
  .tc-footer-bottom .tc-lang { justify-self: stretch; margin-top: 14px; }
  .tc-footer-bottom .tc-lang summary { min-height: 44px; padding: 0 14px; font-size: 13px; }
  .tc-footer-bottom .tc-lang__chev { margin-left: auto; }
  .tc-footer-bottom .tc-lang__menu { left: 0; right: 0; min-width: 0; }
}

/* 18. Forms */
.tc-field { display: grid; gap: 7px; min-width: 0; }
.tc-field > span, .tc-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.tc-input, .tc-select, .tc-textarea { width: 100%; min-height: 44px; padding: 0 13px; border: 1px solid var(--tc-line-strong); border-radius: var(--tc-radius); background: #fff; color: var(--tc-text); font-size: 14px; transition: border-color .15s, box-shadow .15s; }
.tc-textarea { padding: 12px 14px; min-height: 140px; line-height: 1.6; resize: vertical; }
.tc-input:hover, .tc-select:hover, .tc-textarea:hover { border-color: #9da7b6; }
.tc-input:focus-visible, .tc-select:focus-visible, .tc-textarea:focus-visible { outline: 3px solid var(--tc-sky); outline-offset: 0; border-color: var(--tc-blue-600); }
.tc-field__hint { font-size: 12px; color: var(--faint); }
.tc-field__error { font-size: 12px; color: var(--tc-danger); font-weight: 600; }
.tc-callout { padding: 14px 16px; border: 1px solid var(--tc-line); border-radius: var(--tc-radius); background: #fff; font-size: 14px; line-height: 1.6; }
.tc-callout--success { border-color: #b7e4cf; background: #ecfaf3; color: #065f46; }
.tc-callout--error { border-color: #f2c4c4; background: #fdf2f2; color: #9b1c1c; }
.tc-callout--info { border-color: var(--tc-blue-100); background: var(--tc-blue-50); color: var(--tc-blue-700); }

/* 19. Shared section building blocks */
.tc-pad { padding: 36px 32px; }
.tc-prose { font-size: 14px; line-height: 1.85; color: var(--muted); }
.tc-prose p + p { margin-top: 14px; }
.tc-prose h2 { font-size: 22px; margin: 28px 0 10px; color: var(--text); }
.tc-prose h3 { font-size: 16px; margin: 22px 0 8px; color: var(--text); letter-spacing: -.02em; }
.tc-prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.tc-prose ul, .tc-prose ol { padding-left: 20px; margin: 10px 0; }
.tc-prose li + li { margin-top: 6px; }
.tc-prose code { font-size: .9em; padding: 1px 5px; border-radius: 5px; background: #eef1f5; color: var(--tc-text); }
.tc-check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.tc-check-list li { display: flex; gap: 9px; align-items: flex-start; }
.tc-check-list svg { width: 16px; height: 16px; flex: none; margin-top: 3px; color: var(--accent); }
.tc-cards { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); }
.tc-cards--2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.tc-cards--4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.tc-card { padding: 28px; display: grid; gap: 10px; align-content: start; }
.tc-card h3 { font-size: 16px; letter-spacing: -.02em; line-height: 1.35; }
.tc-card p { font-size: 13px; line-height: 1.75; color: var(--muted); }
.tc-icon-frame { width: 48px; height: 48px; padding: 3px; border: 1px solid var(--border); border-radius: 11.25px; background: var(--surface-2); }
.tc-icon-frame > span { display: grid; place-items: center; width: 100%; height: 100%; border: 1.5px solid var(--border-strong); border-radius: 8px; background: var(--surface); box-shadow: 0 0 22.5px 3px rgba(16,24,40,.08); color: var(--accent); }
.tc-icon-frame svg { width: 20px; height: 20px; }
.tc-step-num { align-self: start; justify-self: start; padding: 4px 8px; border-radius: 6px; background: var(--tc-blue-50); color: var(--accent); font-family: var(--tc-mono); font-size: 12px; }
@media (max-width: 1000px) { .tc-cards, .tc-cards--4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 640px) { .tc-pad { padding: 28px 20px; } .tc-cards, .tc-cards--2 { grid-template-columns: 1fr; } .tc-card { padding: 22px 20px; } }

@keyframes tc-spin { to { transform: rotate(360deg); } }

/* 20. Reduced motion: final states, no loops */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0s !important; scroll-behavior: auto !important; }
  .tc-btn .tc-spinner { animation-duration: 1.4s !important; animation-iteration-count: infinite !important; }
  [data-reveal] > .is-pending { opacity: 1; transform: none; }
  .tc-ornament g, .tc-ornament rect { animation: none !important; }
}
/* Long "Sign up free" translations: keep the row on one line at phone widths by dropping the wordmark (logo stays) */
@media (max-width: 430px) { .tc-header--long .tc-logo__name { display: none; } }
@media (max-width: 360px) { .tc-header .tc-logo__name { display: none; } }
.tc-directory__col { min-width: 0; }
.tc-directory h2, .tc-directory a { min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
@media (max-width: 767px) { .tc-directory { grid-template-columns: repeat(2, minmax(0,1fr)); } }
/* Footer directory with the Apps column: 4 groups on desktop (shared by the site and the blog chrome) */
@media (min-width: 768px) { .tc-directory--apps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* 21. From -> To picker (§5) */
.tc-picker { width: 100%; max-width: 680px; margin: 0; padding: 18px 18px 16px; text-align: left; background: #fff; color: var(--tc-text); border-radius: 16px; box-shadow: 0 0 0 10px rgba(255,255,255,.035), 0 24px 45px rgba(0,0,0,.4), 0 60px 70px -30px rgba(38,114,196,.2); transition: box-shadow .2s; }
.tc-picker:focus-within { box-shadow: 0 0 0 10px rgba(38,114,196,.15), 0 24px 45px rgba(0,0,0,.4); }
.tc-picker__caption { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-family: var(--tc-mono); font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--tc-blue-600); }
.tc-picker__caption svg { width: 15px; height: 15px; }
.tc-picker__controls { display: grid; grid-template-columns: minmax(0,1fr) 44px minmax(0,1fr) auto; gap: 10px; align-items: end; }
.tc-picker__field { display: grid; gap: 6px; min-width: 0; }
.tc-picker__field > span { font-size: 11px; font-weight: 600; color: var(--tc-muted); }
.tc-picker__swap { display: grid; place-items: center; width: 44px; height: 48px; padding: 0; border: 1px solid var(--tc-line-strong); border-radius: 10px; background: #fff; color: var(--tc-blue-600); transition: background .15s, border-color .15s; }
.tc-picker__swap svg { width: 18px; height: 18px; }
.tc-picker__swap:hover:not(:disabled) { background: var(--tc-blue-50); border-color: var(--tc-blue-600); }
.tc-picker__swap:active:not(:disabled) { background: var(--tc-blue-100); }
.tc-picker__swap:disabled { color: #b4bcc9; background: var(--tc-surface); cursor: not-allowed; }
.tc-picker__go { height: 48px; }
.tc-picker__note { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; font-size: 12px; }
.tc-picker__note b { font-family: var(--tc-mono); font-weight: 600; color: var(--tc-text); white-space: nowrap; }
.tc-picker__note span { color: #6b7280; text-align: right; }
@media (max-width: 640px) {
  .tc-picker { padding: 14px; }
  .tc-picker__controls { grid-template-columns: minmax(0,1fr) 44px minmax(0,1fr); }
  .tc-picker__go { grid-column: 1 / -1; width: 100%; }
  .tc-picker__note { flex-direction: column; gap: 4px; }
  .tc-picker__note span { text-align: left; }
}
/* On light tiles (category pages) the instrument uses the light depth shadow */
.tc-intro .tc-picker { margin-top: 10px; box-shadow: var(--tc-shadow-instrument); }
.tc-intro .tc-picker:focus-within { box-shadow: 0 0 0 10px rgba(38,114,196,.15), 0 24px 45px -20px rgba(28,64,108,.25); }

/* 22. Picker tiles (open the format popup) */
.tc-picker__field > span { font-size: 11px; font-weight: 600; color: var(--tc-muted); }
.tc-picker__tile { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; height: 48px; padding: 0 12px 0 14px; border: 1px solid var(--tc-line-strong); border-radius: 10px; background: #fafbfc; color: var(--tc-text); font-size: 15px; font-weight: 700; text-align: left; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.tc-picker__tile:hover { border-color: #9da7b6; background: #fff; }
.tc-picker__tile:focus-visible { outline: 3px solid var(--tc-sky); outline-offset: 0; border-color: var(--tc-blue-600); }
.tc-picker__tile[aria-expanded="true"] { border-color: var(--tc-blue-600); box-shadow: 0 0 0 3px rgba(38,114,196,.15); }
.tc-picker__value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-picker__tile svg { width: 12px; height: 12px; flex: none; color: var(--tc-muted); }
.tc-picker__go:disabled { opacity: .6; }

/* 23. Format popup (P4 dialog): fade + scale on open, full-screen sheet on phones */
.tc-formats[hidden] { display: none !important; }
.tc-formats { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(12,13,16,.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity 180ms var(--tc-ease-out); overscroll-behavior: contain; font-family: var(--tc-font); }
.tc-formats.is-open { opacity: 1; }
.tc-formats__dialog { display: flex; flex-direction: column; width: min(760px, 100%); height: min(580px, calc(100dvh - 32px)); overflow: hidden; border: 1px solid var(--tc-line); border-radius: var(--tc-radius-lg); background: #fff; color: var(--tc-text); box-shadow: 0 40px 80px -20px rgba(0,0,0,.45), 0 0 0 10px rgba(255,255,255,.06); transform: translateY(8px) scale(.96); transition: transform 220ms var(--tc-ease-out); outline: none; text-align: left; }
.tc-formats.is-open .tc-formats__dialog { transform: none; }
.tc-formats__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 22px 14px 24px; }
.tc-formats__head .tc-mono-label { margin-bottom: 6px; }
.tc-formats__head h2 { font-size: 22px; letter-spacing: -.035em; color: var(--tc-text); }
.tc-formats__head p:not(.tc-mono-label) { margin-top: 4px; font-size: 13px; color: var(--tc-muted); }
.tc-formats__close { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: 1px solid var(--tc-line); border-radius: 10px; background: #fff; color: var(--tc-muted); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.tc-formats__close:hover { background: var(--tc-surface); border-color: var(--tc-line-strong); color: var(--tc-text); }
.tc-formats__close svg { width: 18px; height: 18px; }
.tc-formats__search { position: relative; display: block; margin: 0 24px 16px; }
.tc-formats__search svg { position: absolute; left: 13px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: #9da7b6; pointer-events: none; }
.tc-formats__search input { width: 100%; height: 46px; padding: 0 14px 0 40px; border: 1px solid var(--tc-line-strong); border-radius: 10px; background: #fafbfc; font-size: 14px; color: var(--tc-text); }
.tc-formats__search input:focus-visible { outline: 3px solid var(--tc-sky); outline-offset: 0; border-color: var(--tc-blue-600); background: #fff; }
.tc-formats__body { display: flex; flex: 1; min-height: 0; border-top: 1px solid var(--tc-line); }
.tc-formats__tabs { display: flex; flex-direction: column; gap: 2px; width: 168px; flex: none; padding: 12px; overflow: auto; border-right: 1px solid var(--tc-line); background: #fafbfc; }
.tc-formats__tabs[hidden] { display: none; }
.tc-formats__tab { padding: 9px 12px; border: 1px solid transparent; border-radius: 999px; background: none; color: var(--tc-muted); font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; transition: background .15s, color .15s; }
.tc-formats__tab:hover { background: #fff; color: var(--tc-text); }
.tc-formats__tab.is-active { background: #fff; border-color: var(--tc-line-strong); color: var(--tc-text); box-shadow: var(--tc-shadow-card); }
.tc-formats__tab:focus-visible, .tc-formats__card:focus-visible { outline: 3px solid var(--tc-sky); outline-offset: 1px; }
.tc-formats__main { flex: 1; min-width: 0; padding: 16px 20px 20px; overflow: auto; }
.tc-formats__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; align-content: start; }
.tc-formats__grid--ops { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.tc-formats__group { margin: 18px 0 8px; font-family: var(--tc-mono); font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--tc-blue-600); }
.tc-formats__card { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 8px; border: 1px solid var(--tc-line); border-radius: 10px; background: #fff; color: var(--tc-text); font-size: 13px; font-weight: 700; letter-spacing: .02em; text-align: center; cursor: pointer; transition: border-color .15s, background .15s, color .15s; animation: tc-card-in 260ms var(--tc-ease-out) both; }
.tc-formats__card:hover { border-color: var(--tc-blue-600); background: var(--tc-blue-50); color: var(--tc-blue-700); }
.tc-formats__card.is-current { border-color: var(--tc-blue-600); box-shadow: inset 0 0 0 1px var(--tc-blue-600); }
.tc-formats__card--op { justify-content: flex-start; padding: 8px 14px; font-weight: 600; letter-spacing: 0; text-align: left; }
.tc-formats__msg { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--tc-surface); font-size: 13px; color: var(--tc-muted); }
@keyframes tc-card-in { from { opacity: 0; transform: translateY(4px); } }
@media (max-width: 640px) {
  .tc-formats { padding: 0; align-items: stretch; }
  .tc-formats__dialog { width: 100%; height: 100dvh; max-height: none; border: 0; border-radius: 0; transform: translateY(24px); }
  .tc-formats__head { padding: max(16px, env(safe-area-inset-top)) 16px 12px 18px; }
  .tc-formats__search { margin: 0 16px 12px; }
  .tc-formats__body { flex-direction: column; }
  .tc-formats__tabs { flex-direction: row; width: auto; padding: 10px 12px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--tc-line); scrollbar-width: none; }
  .tc-formats__tab { flex: none; white-space: nowrap; }
  .tc-formats__main { padding: 14px 16px max(20px, env(safe-area-inset-bottom)); }
  .tc-formats__grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  .tc-formats__grid--ops { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .tc-formats__dialog, .tc-formats.is-open .tc-formats__dialog { transform: none; } .tc-formats__card { animation: none; } }

/* Sliding pills stay on one line: the row scrolls sideways, and the edges fade where there are more pills */
.tc-pills { flex-wrap: nowrap; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }
.tc-pills.has-more-end { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
.tc-pills.has-more-start { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px); mask-image: linear-gradient(to right, transparent, #000 40px); }
.tc-pills.has-more-start.has-more-end { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
.tc-pill { white-space: nowrap; }

/* Mobile footer directory: one group per row (heading across the top, links in two even columns, an odd last link
   spans both), so the groups never leave ragged holes; cells grow with long translations instead of clipping. */
@media (max-width: 767px) {
  .tc-directory { grid-template-columns: 1fr; }
  .tc-directory__col { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tc-directory__col > h2 { grid-column: 1 / -1; height: auto; min-height: 48px; }
  .tc-directory__col > a { height: auto; min-height: 56px; padding: 12px; line-height: 1.35; }
  .tc-directory__col > a:last-child:nth-child(even) { grid-column: 1 / -1; }
  .tc-footer-brand { padding: 28px 20px; }
}

/* Buttons inside prose (docs, legal) keep their own colours: ".tc-prose a" (link blue + underline) used to win over
   the button class and painted blue text on the blue primary button. Every state is pinned. */
.tc-prose a.tc-btn, .tc-prose a.tc-btn:is(:link, :visited, :hover, :focus, :focus-visible, :active) { text-decoration: none; }
.tc-prose a:is(.tc-btn--primary, .tc-btn-primary), .tc-prose a:is(.tc-btn--primary, .tc-btn-primary):is(:link, :visited, :hover, :focus, :focus-visible, :active) { color: #fff; }
.tc-prose a:is(.tc-btn--primary, .tc-btn-primary):hover { background: var(--tc-blue-700); border-color: var(--tc-blue-700); }
.tc-prose a:is(.tc-btn--outline, .tc-btn-secondary), .tc-prose a:is(.tc-btn--outline, .tc-btn-secondary):is(:link, :visited, :hover, :focus, :focus-visible, :active) { color: var(--tc-blue-700); }
.tc-prose a.tc-btn:focus-visible { outline: 3px solid var(--tc-sky); outline-offset: 3px; }
.tc-prose .tc-btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
@media (max-width: 480px) { .tc-prose .tc-btn-row .tc-btn { flex: 1 1 100%; } }
