/*
 * Tfastunlocker public site.
 *
 * Colour comes entirely from tokens.css, which derives it from the admin base
 * colour. Nothing in this file hard-codes a brand hex, so a colour change in
 * the admin panel moves the whole page including dark mode.
 *
 * The page is built from four repeating parts and almost nothing else:
 *
 *   .tf-section          vertical rhythm, one value, everywhere
 *   .tf-section-heading  eyebrow pill, heading, one line of prose, centred
 *   .tf-card             the only raised surface on the site
 *   .tf-button           one shape, two weights (solid, outline)
 *
 * Restraint is the point. A repair tool has to look like something you would
 * trust with a locked handset, and the fastest way to lose that is a page
 * where every section invents its own container.
 */

/* ---------------------------------------------------------------- base -- */

.tf-site {
    background: var(--tf-bg);
    color: var(--tf-text);
    font-family: var(--tf-sans);
    font-size: 1rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

.tf-site *, .tf-site *::before, .tf-site *::after { box-sizing: border-box; }
.tf-site a { color: inherit; text-decoration: none; }
.tf-site img { max-width: 100%; height: auto; }

.tf-site :is(a, button, summary, input, select):focus-visible {
    outline: 2px solid var(--tf-accent);
    outline-offset: 3px;
    border-radius: var(--tf-radius-sm);
}

.tf-site ::selection { background: var(--tf-accent); color: var(--tf-on-accent); }

.tf-site :is(h1, h2, h3, h4) {
    color: var(--tf-strong);
    font-weight: 800;
    letter-spacing: -.025em;
    line-height: 1.15;
    margin: 0;
}

.tf-site h1 { font-size: clamp(2.4rem, 5.2vw, 3.9rem); letter-spacing: -.035em; }
.tf-site h2 { font-size: clamp(1.65rem, 3vw, 2.1rem); }
.tf-site h3 { font-size: 1.15rem; letter-spacing: -.015em; }
.tf-site p  { color: var(--tf-prose); margin: 0; }

.tf-wrap {
    width: min(var(--tf-container), 100% - 2.5rem);
    margin-inline: auto;
}

.tf-section { padding-block: var(--tf-8); }

/* An eyebrow pill, a heading, and at most one line of prose. Centred, because
   every section on the page is a list of peers rather than an argument. */
.tf-section-heading {
    display: grid;
    justify-items: center;
    gap: var(--tf-4);
    text-align: center;
    max-width: 44rem;
    margin: 0 auto var(--tf-6);
}

.tf-section-heading p { font-size: 1.02rem; }

.tf-eyebrow, .tf-tag {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--tf-accent-soft);
    color: var(--tf-accent);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-pill);
    padding: .35rem .9rem;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.tf-centered { text-align: center; }

.tf-text-link {
    color: var(--tf-accent);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.tf-text-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.tf-skip {
    position: absolute;
    left: 1rem;
    top: -6rem;
    z-index: 100;
    background: var(--tf-accent);
    color: var(--tf-on-accent);
    padding: .7rem 1.1rem;
    border-radius: var(--tf-radius-sm);
    font-weight: 600;
}

.tf-skip:focus { top: 1rem; }

/* -------------------------------------------------------------- buttons -- */

.tf-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    background: var(--tf-gradient);
    color: var(--tf-on-accent);
    border: 1px solid transparent;
    border-radius: var(--tf-radius-sm);
    padding: .8rem 1.4rem;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: var(--tf-glow);
    transition: transform .15s var(--tf-ease), box-shadow .2s var(--tf-ease), background .2s var(--tf-ease);
}

.tf-button:hover { transform: translateY(-2px); box-shadow: var(--tf-shadow-lg); }
.tf-button:active { transform: none; }

.tf-button:disabled {
    background: var(--tf-surface-hover);
    color: var(--tf-muted);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* The second button in a pair. Outline, so the primary action stays obvious. */
.tf-button.tf-light {
    background: var(--tf-surface);
    color: var(--tf-text);
    border-color: var(--tf-border-strong);
    box-shadow: var(--tf-shadow-sm);
}

.tf-button.tf-light:hover { background: var(--tf-surface-hover); box-shadow: var(--tf-shadow); }

.tf-actions, .tf-page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--tf-3);
}

/* --------------------------------------------------------------- header -- */

.tf-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: var(--tf-4);
    min-height: 4.25rem;
    background: color-mix(in srgb, var(--tf-bg) 88%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--tf-border);
}

.tf-brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--tf-strong);
    margin-right: auto;
}

.tf-brand-icon { width: 2rem; height: 2rem; flex-shrink: 0; }

.tf-header nav { display: flex; align-items: center; gap: .15rem; }

.tf-header nav a {
    padding: .5rem .8rem;
    border-radius: var(--tf-radius-sm);
    font-size: .92rem;
    font-weight: 500;
    color: var(--tf-prose);
    white-space: nowrap;
    transition: background .15s var(--tf-ease), color .15s var(--tf-ease);
}

.tf-header nav a:hover,
.tf-header nav a[aria-current] { background: var(--tf-accent-soft); color: var(--tf-accent); }

.tf-account-links { display: flex; align-items: center; gap: .5rem; }

.tf-register {
    padding: .5rem .9rem;
    border: 1px solid var(--tf-border-strong);
    border-radius: var(--tf-radius-sm);
    font-size: .9rem;
    font-weight: 600;
    white-space: nowrap;
}

.tf-register:hover { background: var(--tf-surface-hover); }

.tf-login {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--tf-gradient);
    color: var(--tf-on-accent);
    padding: .5rem 1.1rem;
    border-radius: var(--tf-radius-sm);
    font-size: .9rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: var(--tf-glow);
}

.tf-login:hover { transform: translateY(-1px); }

/* Theme switch and the small-screen menu button share a shape. */
.tf-icon-button {
    display: inline-grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    background: var(--tf-surface);
    color: var(--tf-prose);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius-sm);
    font-size: 1.1rem;
    cursor: pointer;
    transition: background .15s var(--tf-ease), color .15s var(--tf-ease);
}

.tf-icon-button:hover { background: var(--tf-surface-hover); color: var(--tf-accent); }
.tf-nav-toggle { display: none; }

/* The theme button shows one glyph at a time; CSS picks which. */
.tf-theme-toggle .tf-theme-dark { display: none; }
[data-theme="dark"] .tf-theme-toggle .tf-theme-dark { display: block; }
[data-theme="dark"] .tf-theme-toggle .tf-theme-light { display: none; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .tf-theme-toggle .tf-theme-dark { display: block; }
    :root:not([data-theme="light"]) .tf-theme-toggle .tf-theme-light { display: none; }
}

/* Secondary row of product links under the main header. */
.tf-product-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .15rem;
    padding-block: .5rem;
    border-bottom: 1px solid var(--tf-border);
    font-size: .88rem;
}

/* nowrap matters on small screens, where the row becomes a horizontal
   scroller: without it the row stops wrapping but each label still breaks
   over two lines, which looks like the row wrapped anyway. */
.tf-product-nav a {
    padding: .4rem .75rem;
    border-radius: var(--tf-radius-sm);
    color: var(--tf-muted);
    font-weight: 500;
    white-space: nowrap;
}

.tf-product-nav a:hover, .tf-product-nav a[aria-current] { background: var(--tf-surface-hover); color: var(--tf-accent); }

/* ----------------------------------------------------------------- hero -- */

/* The wash sits behind the hero only. It reads as depth at the top of the page
   and would read as noise if it repeated further down. */
.tf-hero-band {
    position: relative;
    background:
        radial-gradient(60rem 30rem at 50% -12%, var(--tf-accent-soft), transparent 70%),
        linear-gradient(180deg, var(--tf-bg-2), var(--tf-bg));
    border-bottom: 1px solid var(--tf-border);
    overflow: hidden;
}

.tf-hero {
    display: grid;
    justify-items: center;
    gap: var(--tf-5);
    text-align: center;
    padding-block: var(--tf-8) var(--tf-7);
}

.tf-hero h1 { max-width: 16ch; }

/* The product's one-line positioning statement, directly under the name. */
.tf-hero-lede {
    font-size: clamp(1.2rem, 2.4vw, 1.6rem);
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--tf-accent);
}

.tf-hero > p { max-width: 52ch; font-size: 1.05rem; }
.tf-hero .tf-actions { justify-content: center; }

.tf-release-line {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .85rem;
    color: var(--tf-muted);
}

.tf-release-line i { color: var(--tf-accent); }
.tf-release-line strong { color: var(--tf-text); font-weight: 600; }

/* ------------------------------------------------------ stats and cards -- */

.tf-card {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius-lg);
    padding: var(--tf-5);
    box-shadow: var(--tf-shadow);
}

/* Four numbers that say how big the product is. Auto-fit so it degrades to
   two-up and then one-up without a breakpoint for each. */
.tf-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: var(--tf-4);
    padding-bottom: var(--tf-8);
}

.tf-stat {
    display: grid;
    justify-items: center;
    gap: .35rem;
    text-align: center;
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius-lg);
    padding: var(--tf-5) var(--tf-4);
    box-shadow: var(--tf-shadow);
    transition: transform .2s var(--tf-ease), box-shadow .2s var(--tf-ease);
}

.tf-stat:hover { transform: translateY(-3px); box-shadow: var(--tf-shadow-lg); }
.tf-stat i { color: var(--tf-accent); font-size: 1.5rem; }
.tf-stat strong { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; color: var(--tf-strong); line-height: 1.1; }
.tf-stat span { font-size: .85rem; color: var(--tf-muted); }

/* The generic card grid: services, models, guides, resellers all use it. */
.tf-features, .tf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: var(--tf-4);
}

.tf-features article {
    display: grid;
    align-content: start;
    gap: var(--tf-2);
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius-lg);
    padding: var(--tf-5);
    box-shadow: var(--tf-shadow);
    transition: transform .2s var(--tf-ease), box-shadow .2s var(--tf-ease), border-color .2s var(--tf-ease);
}

.tf-features article:hover {
    transform: translateY(-3px);
    border-color: var(--tf-border-strong);
    box-shadow: var(--tf-shadow-lg);
}

.tf-features p { font-size: .94rem; }

/* A status word such as "Available" or "Beta", set apart from the prose. */
.tf-features article > span:last-child {
    justify-self: start;
    margin-top: .35rem;
    background: var(--tf-accent-soft);
    color: var(--tf-accent);
    border-radius: var(--tf-pill);
    padding: .2rem .7rem;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.tf-service-icon {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    background: var(--tf-gradient);
    color: var(--tf-on-accent);
    border-radius: var(--tf-radius);
    font-size: 1.4rem;
    box-shadow: var(--tf-glow);
    margin-bottom: var(--tf-2);
}

/* ---------------------------------------------------- numbered sequence -- */

.tf-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: var(--tf-4);
    counter-reset: tf-step;
}

.tf-step {
    position: relative;
    display: grid;
    align-content: start;
    gap: var(--tf-2);
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius-lg);
    padding: var(--tf-5);
    box-shadow: var(--tf-shadow);
}

.tf-step::before {
    counter-increment: tf-step;
    content: counter(tf-step);
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    background: var(--tf-gradient);
    color: var(--tf-on-accent);
    border-radius: var(--tf-pill);
    font-size: 1rem;
    font-weight: 800;
    box-shadow: var(--tf-glow);
    margin-bottom: var(--tf-2);
}

/* ---------------------------------------------------------- status list -- */

.tf-status-band { background: var(--tf-bg-2); border-block: 1px solid var(--tf-border); }

.tf-status-list {
    max-width: 48rem;
    margin-inline: auto;
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius-lg);
    box-shadow: var(--tf-shadow);
    overflow: hidden;
}

.tf-status-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--tf-4);
    padding: var(--tf-4) var(--tf-5);
    border-bottom: 1px solid var(--tf-border);
    font-size: .95rem;
}

.tf-status-list > div:last-child { border-bottom: 0; }

/* A dot next to the state reads faster than the word alone.
 *
 * The dot is deliberately the accent colour, not green. The status text is
 * free-form CMS content, so it can just as easily say "Not connected" as
 * "Operational", and a green dot beside "Not connected" would assert a health
 * claim the page cannot actually stand behind. */
.tf-status-list strong {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--tf-accent);
    text-align: right;
}

.tf-status-list strong::before {
    content: "";
    width: .5rem;
    height: .5rem;
    border-radius: var(--tf-pill);
    background: currentColor;
    box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent);
}

.tf-status-note { font-size: .85rem; text-align: center; margin-top: var(--tf-4); }

/* ------------------------------------------------------------ faq, help -- */

.tf-support { display: grid; grid-template-columns: 1fr 1.15fr; gap: var(--tf-7); align-items: start; }
.tf-support > div > p { margin: var(--tf-3) 0; }

.tf-faq { display: grid; gap: var(--tf-3); }

.tf-faq details {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    padding: var(--tf-3) var(--tf-4);
    box-shadow: var(--tf-shadow-sm);
    transition: border-color .2s var(--tf-ease);
}

.tf-faq details[open] { border-color: var(--tf-border-strong); box-shadow: var(--tf-shadow); }

.tf-faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--tf-4);
    cursor: pointer;
    font-weight: 600;
    color: var(--tf-strong);
    list-style: none;
}

.tf-faq summary::-webkit-details-marker { display: none; }

.tf-faq summary::after {
    content: "\f107";
    font-family: 'Line Awesome Free', 'Font Awesome 5 Free';
    font-weight: 900;
    color: var(--tf-accent);
    transition: transform .2s var(--tf-ease);
}

.tf-faq details[open] summary::after { transform: rotate(180deg); }
.tf-faq p { margin-top: var(--tf-3); font-size: .94rem; }

/* ------------------------------------------------------------------ cta -- */

.tf-cta {
    display: grid;
    justify-items: center;
    gap: var(--tf-4);
    text-align: center;
    background: linear-gradient(135deg, var(--tf-accent-soft), var(--tf-bg-2));
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius-xl);
    padding: var(--tf-7) var(--tf-5);
}

.tf-cta p { max-width: 48ch; }

/* -------------------------------------------------------- product pages -- */

.tf-page-hero {
    background:
        radial-gradient(50rem 22rem at 50% -30%, var(--tf-accent-soft), transparent 70%),
        var(--tf-bg-2);
    border-bottom: 1px solid var(--tf-border);
    padding-block: var(--tf-7);
    text-align: center;
}

.tf-page-hero h1 { margin: var(--tf-4) 0 var(--tf-3); }
.tf-page-hero p { max-width: 60ch; margin-inline: auto; }
.tf-page-hero .tf-text-link { font-size: .88rem; }

.tf-product-page { max-width: 62rem; display: grid; gap: var(--tf-5); }

.tf-guide-row {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-left: 3px solid var(--tf-accent);
    border-radius: var(--tf-radius);
    padding: var(--tf-5);
    box-shadow: var(--tf-shadow-sm);
}

.tf-guide-row h2 { font-size: 1.2rem; margin-bottom: var(--tf-2); }
.tf-guide-row p { white-space: pre-line; font-size: .95rem; }

.tf-empty {
    display: grid;
    justify-items: center;
    gap: var(--tf-3);
    text-align: center;
    background: var(--tf-surface);
    border: 1px dashed var(--tf-border-strong);
    border-radius: var(--tf-radius-lg);
    padding: var(--tf-7) var(--tf-5);
}

.tf-empty h2 { font-size: 1.3rem; }

.tf-page-notice {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: var(--tf-warn-bg);
    color: var(--tf-warn) !important;
    border: 1px solid color-mix(in srgb, var(--tf-warn) 30%, transparent);
    border-radius: var(--tf-radius);
    padding: var(--tf-3) var(--tf-4);
    font-size: .9rem;
}

.tf-model-search { display: grid; gap: var(--tf-2); }
.tf-model-search label { font-weight: 600; color: var(--tf-strong); }
.tf-model-search > div { display: flex; gap: var(--tf-2); }

.tf-site :is(.tf-model-search input, .tf-tool-auth input, .tf-tool-auth select) {
    min-width: 0;
    flex: 1;
    background: var(--tf-surface);
    color: var(--tf-text);
    border: 1px solid var(--tf-border-strong);
    border-radius: var(--tf-radius-sm);
    padding: .75rem .9rem;
    font: inherit;
}

.tf-release-panel {
    display: grid;
    justify-items: start;
    gap: var(--tf-3);
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius-lg);
    padding: var(--tf-5);
    box-shadow: var(--tf-shadow);
}

/* -------------------------------------------------- tool account screens -- */

.tf-tool-auth { max-width: 32rem; margin-inline: auto; }
.tf-tool-auth form { display: grid; gap: var(--tf-3); margin: var(--tf-5) 0; }
.tf-tool-auth label { font-weight: 600; color: var(--tf-strong); }

.tf-table-wrap {
    overflow-x: auto;
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius-lg);
    box-shadow: var(--tf-shadow);
}

.tf-api-table { width: 100%; border-collapse: collapse; font-size: .92rem; }

.tf-api-table :is(th, td) {
    text-align: left;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--tf-border);
    white-space: nowrap;
}

.tf-api-table th {
    background: var(--tf-surface-2);
    color: var(--tf-accent);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tf-api-table tbody tr:last-child :is(th, td) { border-bottom: 0; }
.tf-api-table tbody tr:hover { background: var(--tf-surface-hover); }

/* --------------------------------------------------------- tool preview -- */

/* A mock of the desktop application window. It is decoration, so it is the one
   place allowed a little more detail than the rest of the page. */
.tf-preview {
    width: min(46rem, 100%);
    margin-inline: auto;
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius-lg);
    padding: var(--tf-3);
    box-shadow: var(--tf-shadow-lg);
    text-align: left;
}

.tf-window-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--tf-3);
    padding-bottom: .6rem;
    font-size: .78rem;
    color: var(--tf-muted);
}

.tf-window-title span:first-child { display: inline-flex; align-items: center; gap: .4rem; color: var(--tf-text); font-weight: 600; }
.tf-preview-icon { width: 1.1rem; height: 1.1rem; }

.tf-toolbar {
    display: flex;
    justify-content: space-between;
    gap: var(--tf-3);
    background: var(--tf-surface-2);
    border: 1px solid var(--tf-border);
    border-bottom: 0;
    border-radius: var(--tf-radius-sm) var(--tf-radius-sm) 0 0;
    padding: .5rem .7rem;
    font-size: .72rem;
    color: var(--tf-muted);
}

.tf-toolbar > span { color: var(--tf-accent); font-weight: 600; }

.tf-window-body {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    min-height: 14rem;
    border: 1px solid var(--tf-border);
}

.tf-console { padding: var(--tf-3); font-family: var(--tf-mono); font-size: .72rem; min-width: 0; }
.tf-console > p { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--tf-muted); }
.tf-console dl { margin: var(--tf-3) 0 0; }
.tf-console dt { color: var(--tf-muted); }
.tf-console dd { margin: 0 0 .5rem; color: var(--tf-accent); }

.tf-options { border-left: 1px solid var(--tf-border); padding: var(--tf-3); font-size: .74rem; }
.tf-options > strong { display: block; margin-bottom: .7rem; color: var(--tf-strong); }

.tf-options > span {
    display: block;
    background: var(--tf-surface-2);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius-sm);
    padding: .45rem .55rem;
    margin-bottom: .4rem;
    color: var(--tf-prose);
}

.tf-options > p { font-size: .68rem; margin-top: .7rem; }

.tf-window-footer {
    display: flex;
    justify-content: space-between;
    gap: var(--tf-3);
    background: var(--tf-surface-2);
    border: 1px solid var(--tf-border);
    border-top: 0;
    border-radius: 0 0 var(--tf-radius-sm) var(--tf-radius-sm);
    padding: .5rem .7rem;
    font-size: .7rem;
    color: var(--tf-muted);
}

.tf-highlights { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--tf-5); }
.tf-highlights > div { display: grid; justify-items: center; gap: .1rem; text-align: center; }
.tf-highlights strong { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; color: var(--tf-accent); }
.tf-highlights span { font-size: .8rem; color: var(--tf-muted); }

/* --------------------------------------------------------------- footer -- */

.tf-footer { background: var(--tf-bg-2); border-top: 1px solid var(--tf-border); }

/* Explicit tracks rather than auto-fit: the brand column is a different width
   from the three link columns, and mixing an auto-repeat with a wider leading
   track collapses the whole row to one column. */
.tf-footer-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr 1fr 1fr;
    gap: var(--tf-6);
    padding-block: var(--tf-7) var(--tf-6);
}

.tf-footer-grid > div { display: grid; align-content: start; gap: var(--tf-3); }
.tf-footer-grid p { font-size: .9rem; max-width: 34ch; }

.tf-footer h4 {
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--tf-muted);
}

.tf-footer-links { display: grid; gap: .55rem; font-size: .9rem; }

/* align-items:start keeps the icon on the first line when a long address wraps,
   instead of stranding it on a line of its own. */
.tf-footer-links a {
    display: inline-flex;
    align-items: start;
    gap: .4rem;
    color: var(--tf-prose);
    overflow-wrap: anywhere;
}

.tf-footer-links a:hover { color: var(--tf-accent); }
.tf-footer-links a i { line-height: 1.55; flex-shrink: 0; }

.tf-footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--tf-3);
    border-top: 1px solid var(--tf-border);
    padding-block: var(--tf-4);
    font-size: .82rem;
    color: var(--tf-muted);
}

.tf-footer-bottom nav { display: flex; flex-wrap: wrap; gap: var(--tf-4); }
.tf-footer-bottom a:hover { color: var(--tf-accent); }

.tf-credit a { color: var(--tf-accent); font-weight: 600; }
.tf-credit a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ----------------------------------------------------------- responsive -- */

@media (max-width: 900px) {
    .tf-support { grid-template-columns: 1fr; gap: var(--tf-5); }
    .tf-footer-grid { grid-template-columns: 1fr 1fr; gap: var(--tf-5); }
    .tf-window-body { grid-template-columns: 1fr; }
    .tf-options { border-left: 0; border-top: 1px solid var(--tf-border); }
}

@media (max-width: 780px) {
    .tf-nav-toggle { display: inline-grid; }
    .tf-header { flex-wrap: wrap; padding-block: .6rem; }

    /* Collapsed by default; the toggle sets [data-open] on the header. */
    .tf-header nav,
    .tf-header .tf-account-links { display: none; width: 100%; }

    .tf-header[data-open] nav {
        display: grid;
        gap: .1rem;
        padding-top: .5rem;
        border-top: 1px solid var(--tf-border);
    }

    .tf-header[data-open] .tf-account-links { display: flex; padding-bottom: .5rem; }
    .tf-header[data-open] .tf-account-links > * { flex: 1; justify-content: center; text-align: center; }

    .tf-product-nav { gap: .1rem; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
    .tf-product-nav::-webkit-scrollbar { display: none; }

    .tf-section { padding-block: var(--tf-7); }
    .tf-hero { padding-block: var(--tf-7) var(--tf-6); }
    .tf-hero .tf-actions > .tf-button { flex: 1 1 12rem; }
}

@media (max-width: 560px) {
    .tf-wrap { width: calc(100% - 2rem); }
    .tf-footer-grid { grid-template-columns: 1fr; }
    .tf-status-list > div { flex-direction: column; align-items: flex-start; gap: .3rem; }
    .tf-model-search > div { flex-direction: column; }
    .tf-cta { padding: var(--tf-6) var(--tf-4); }
}

@media (prefers-reduced-motion: reduce) {
    .tf-site *, .tf-site *::before, .tf-site *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
    .tf-site :is(.tf-button, .tf-stat, .tf-features article):hover { transform: none; }
}

/* -------------------------------------------------- checkout and invoice -- */

/*
 * Buying credits is the one flow on the site that takes money, so it gets the
 * plainest layout on the site: what you are buying, what it costs, how you are
 * paying, one button. Nothing else competes for attention.
 */
.tf-checkout { max-width: 42rem; display: grid; gap: var(--tf-5); }

.tf-order {
    display: grid;
    gap: var(--tf-4);
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius-lg);
    padding: var(--tf-5);
    box-shadow: var(--tf-shadow);
}

.tf-order h2 { font-size: 1.15rem; }
.tf-order-rows { display: grid; gap: 0; }

.tf-order-rows > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--tf-4);
    padding: .6rem 0;
    border-bottom: 1px solid var(--tf-border);
    font-size: .95rem;
}

.tf-order-rows > div > span { color: var(--tf-muted); }
.tf-order-rows > div > strong { color: var(--tf-strong); text-align: right; }
.tf-order-fee strong { color: var(--tf-prose) !important; font-weight: 500 !important; }

/* The number the customer is agreeing to. It should be the largest thing in
   the block, and it should never sit on a border. */
.tf-order-total {
    border-bottom: 0 !important;
    padding-top: var(--tf-3) !important;
}

.tf-order-total > span { color: var(--tf-text) !important; font-weight: 600; }
.tf-order-total > strong { font-size: 1.35rem; letter-spacing: -.02em; }

.tf-order-target {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--tf-ok-bg);
    color: var(--tf-ok) !important;
    border: 1px solid color-mix(in srgb, var(--tf-ok) 30%, transparent);
    border-radius: var(--tf-radius);
    padding: var(--tf-3) var(--tf-4);
    font-size: .9rem;
}

.tf-order-target strong { color: inherit; }
.tf-order-note { font-size: .82rem; color: var(--tf-muted); }

/* ---- method picker ---- */

.tf-methods { display: grid; gap: var(--tf-2); }

.tf-method {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: var(--tf-surface-2);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    padding: var(--tf-3) var(--tf-4);
    cursor: pointer;
    transition: border-color .15s var(--tf-ease), background .15s var(--tf-ease);
}

.tf-method:hover { border-color: var(--tf-border-strong); }

/* The whole row is the target, not just the dot. */
.tf-method input { accent-color: var(--tf-accent); width: 1.1rem; height: 1.1rem; flex-shrink: 0; }
.tf-method:has(input:checked) { border-color: var(--tf-accent); background: var(--tf-accent-soft); }
.tf-method span { display: grid; gap: .1rem; min-width: 0; }
.tf-method strong { font-size: .95rem; color: var(--tf-strong); }
.tf-method small { font-size: .8rem; color: var(--tf-muted); }

.tf-order-alt summary { cursor: pointer; font-weight: 600; color: var(--tf-accent); }
.tf-order-alt p { margin: var(--tf-3) 0; font-size: .9rem; }

/* ---- invoice ---- */

.tf-invoice-page { max-width: 48rem; display: grid; gap: var(--tf-4); }

.tf-invoice-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--tf-4);
    flex-wrap: wrap;
}

.tf-invoice {
    display: grid;
    gap: var(--tf-5);
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius-lg);
    padding: var(--tf-6);
    box-shadow: var(--tf-shadow);
}

.tf-invoice > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--tf-5);
    flex-wrap: wrap;
    padding-bottom: var(--tf-4);
    border-bottom: 1px solid var(--tf-border);
}

.tf-invoice > header > div { display: grid; gap: .2rem; }
.tf-invoice > header strong { font-size: 1.05rem; color: var(--tf-strong); }
.tf-invoice > header span { font-size: .85rem; color: var(--tf-muted); }
.tf-invoice-meta { text-align: right; justify-items: end; }
.tf-invoice-meta h1 { font-size: 1.5rem; }

.tf-invoice-state {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border-radius: var(--tf-pill);
    padding: .15rem .6rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.tf-invoice-state::before {
    content: "";
    width: .45rem;
    height: .45rem;
    border-radius: var(--tf-pill);
    background: currentColor;
}

.tf-invoice-state.is-paid { background: var(--tf-ok-bg); color: var(--tf-ok); }
.tf-invoice-state.is-pending { background: var(--tf-warn-bg); color: var(--tf-warn); }
.tf-invoice-state.is-open { background: var(--tf-accent-soft); color: var(--tf-accent); }
.tf-invoice-state.is-failed { background: var(--tf-bad-bg); color: var(--tf-bad); }

.tf-invoice-parties { display: grid; grid-template-columns: 1fr 1fr; gap: var(--tf-5); }
.tf-invoice-parties h4 { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--tf-muted); margin-bottom: .4rem; }
.tf-invoice-parties p { font-size: .9rem; line-height: 1.6; }
.tf-invoice-ok { color: var(--tf-ok); font-weight: 600; }

.tf-invoice .tf-api-table tfoot th { background: var(--tf-surface-2); color: var(--tf-strong); font-size: .95rem; }
.tf-right { text-align: right !important; }

.tf-invoice > footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--tf-4);
    flex-wrap: wrap;
    padding-top: var(--tf-4);
    border-top: 1px solid var(--tf-border);
}

.tf-invoice > footer h4 { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--tf-muted); }
.tf-invoice > footer p { font-size: .95rem; color: var(--tf-strong); }
.tf-invoice-credit { font-size: .78rem; text-align: center; color: var(--tf-muted); }
.tf-invoice-credit a { color: var(--tf-accent); font-weight: 600; }

@media (max-width: 600px) {
    .tf-invoice { padding: var(--tf-4); }
    .tf-invoice-parties { grid-template-columns: 1fr; gap: var(--tf-4); }
    .tf-invoice-meta { text-align: left; justify-items: start; }
}

/* An invoice is a document people print. Everything that is not the document
   itself comes off the page. */
@media print {
    .tf-header, .tf-product-nav, .tf-footer, .tf-invoice-actions, .cookies-card { display: none !important; }
    .tf-invoice { border: 0; box-shadow: none; padding: 0; }
    .tf-invoice-page { max-width: none; }
    .tf-site { background: #fff; }
}

.tf-invoice-warn { color: var(--tf-warn); font-weight: 600; }
