/* TiviGlass universal components. Loaded after tokens.css + base.css on every
   page. App-shell / marketing-only / legal-only components live in
   portal.css, marketing.css and legal.css respectively. */

/* Buttons. */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0;
    white-space: nowrap;
    flex: 0 0 auto;
    transition:
        background-color var(--dur-fast) var(--ease-out-soft),
        border-color var(--dur-fast) var(--ease-out-soft),
        color var(--dur-fast) var(--ease-out-soft),
        box-shadow var(--dur-fast) var(--ease-out-soft),
        transform var(--dur-fast) var(--ease-out-soft);
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
    box-shadow: var(--shadow-button);
}

.btn-primary:hover {
    background: var(--accent-bright);
    box-shadow: 0 16px 36px color-mix(in srgb, var(--accent) 34%, transparent);
}

.btn-secondary {
    background: var(--surface-soft);
    color: var(--text);
    border-color: var(--line-strong);
    backdrop-filter: blur(var(--blur-soft));
    -webkit-backdrop-filter: blur(var(--blur-soft));
}

.btn-secondary:hover {
    background: var(--surface-strong);
    border-color: var(--accent);
    color: var(--text);
}

.btn-ghost {
    background: transparent;
    color: var(--text-soft);
    border-color: transparent;
    min-height: 40px;
    padding: 0 14px;
}

.btn-ghost:hover {
    color: var(--text);
    background: var(--surface-soft);
}

/* Premium upgrade button — gold identity. */
.btn-pro {
    background: var(--pro-gradient);
    color: var(--pro-ink);
    box-shadow: 0 12px 28px rgba(224, 142, 31, 0.3);
}

.btn-pro:hover {
    box-shadow: 0 16px 36px rgba(224, 142, 31, 0.42);
}

/* Destructive button. */
.btn-danger {
    background: var(--error-soft);
    color: var(--error);
    border-color: var(--error-line);
}

.btn-danger:hover {
    background: var(--error-soft);
    border-color: var(--error);
}

.btn-sm {
    min-height: 38px;
    padding: 0 16px;
    font-size: 0.88rem;
}

.btn-lg {
    min-height: 54px;
    padding: 0 28px;
    font-size: 1rem;
}

.btn-full {
    width: 100%;
}

/* Inline busy spinner for awaited actions. */
.btn-spinner {
    width: 16px;
    height: 16px;
    margin-right: 10px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-top-color: transparent;
    opacity: 0.85;
    animation: tg-spin 0.7s linear infinite;
}

.btn:not(.is-busy) .btn-spinner {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .btn-spinner {
        animation: none;
    }
}

@keyframes tg-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Generic pill (eyebrow tag). */
.pill,
.eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 14px;
    border-radius: var(--radius-pill);
    background: var(--accent-soft);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

:root[data-theme='light'] .pill,
:root[data-theme='light'] .eyebrow {
    color: var(--accent-link);
}

/* Badge family — status + premium markers. */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 0 10px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--text-soft);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-pro {
    background: var(--pro-soft);
    border-color: var(--pro-line);
    color: var(--pro-from);
}

.badge-status[data-kind='live'] {
    background: var(--live-soft);
    border-color: var(--live-line);
    color: var(--live);
}

.badge-status[data-kind='success'] {
    background: var(--success-soft);
    border-color: var(--success-line);
    color: var(--success);
}

.badge-status[data-kind='warning'] {
    background: var(--warning-soft);
    border-color: var(--warning-line);
    color: var(--warning);
}

.badge-status[data-kind='error'] {
    background: var(--error-soft);
    border-color: var(--error-line);
    color: var(--error);
}

/* Card primitive. */
.card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.card-pad {
    padding: clamp(20px, 3vw, 28px);
}

/* Form fields. */
.field {
    display: grid;
    gap: 8px;
}

.field span,
.field > label {
    color: var(--text-soft);
    font-size: 0.9rem;
    font-weight: 600;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 54px;
    padding: 14px 18px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    color: var(--text);
    font-size: 1rem;
    transition:
        border-color var(--dur-fast) var(--ease-out-soft),
        box-shadow var(--dur-fast) var(--ease-out-soft),
        background-color var(--dur-fast) var(--ease-out-soft);
}

/* Checkboxes/radios must not inherit the full-width 54px text-input sizing. */
.field input[type='checkbox'],
.field input[type='radio'] {
    width: auto;
    min-height: 0;
    inline-size: 18px;
    block-size: 18px;
    padding: 0;
    accent-color: var(--pro-from);
    cursor: pointer;
    flex: 0 0 auto;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
    border-color: var(--line-strong);
    background: var(--surface);
}

.field input::placeholder,
.field textarea::placeholder {
    color: var(--text-faint);
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled {
    background: var(--surface-soft);
    color: var(--text-faint);
    cursor: not-allowed;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface-strong);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

/* Invalid state (set by components.js validators). */
.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea {
    border-color: var(--error);
    box-shadow: 0 0 0 4px var(--error-soft);
}

.field-error {
    margin: 2px 0 0;
    color: var(--error);
    font-size: 0.84rem;
    line-height: 1.45;
    display: none;
}

.field.is-invalid .field-error {
    display: block;
}

.field-hint {
    margin: 6px 0 0;
    color: var(--text-faint);
    font-size: 0.88rem;
    line-height: 1.55;
    display: block;
}

.field-hint.is-warning {
    color: var(--warning);
}

/* Password field with show/hide toggle. */
.field-password {
    position: relative;
}

.field-password input {
    padding-right: 52px;
}

.field-password-toggle {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-faint);
    transition:
        color var(--dur-fast) var(--ease-out-soft),
        background-color var(--dur-fast) var(--ease-out-soft);
}

.field-password-toggle:hover {
    color: var(--text);
    background: var(--surface-soft);
}

.consent-field {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
}

.consent-field input {
    width: 18px;
    height: 18px;
    margin: 3px 0 0;
    accent-color: var(--accent);
}

.consent-copy {
    color: var(--text-soft);
    font-size: 0.92rem;
    line-height: 1.62;
}

.consent-copy strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
    font-size: 0.94rem;
}

.consent-copy a,
.utility-legal-links a,
.legal-card a {
    color: var(--accent);
    font-weight: 600;
    transition: color var(--dur-fast) var(--ease-out-soft);
}

:root[data-theme='light'] .consent-copy a,
:root[data-theme='light'] .utility-legal-links a,
:root[data-theme='light'] .legal-card a {
    color: var(--accent-link);
}

.consent-copy a:hover,
.utility-legal-links a:hover,
.legal-card a:hover {
    color: var(--accent-bright);
}

.consent-disclosure {
    margin: 0;
    color: var(--text-faint);
    font-size: 0.88rem;
    line-height: 1.58;
}

/* Status banner (inline messaging). */
.status-banner {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--text-soft);
}

/* Site-wide signup-promo banner (injected by components.js on marketing pages). */
.promo-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 12px 20px;
    background: var(--pro-gradient, linear-gradient(135deg, #f59e0b, #d97706));
    color: #1a1206;
    font-size: 0.95rem;
    text-align: center;
}

.promo-banner-text {
    max-width: 90ch;
}

.promo-banner-cta {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.promo-banner-close {
    background: transparent;
    border: 0;
    color: inherit;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
}

.status-banner[data-kind='success'] {
    border-color: var(--success-line);
    background: var(--success-soft);
    color: var(--success);
}

.status-banner[data-kind='warning'] {
    border-color: var(--warning-line);
    background: var(--warning-soft);
    color: var(--warning);
}

.status-banner[data-kind='error'] {
    border-color: var(--error-line);
    background: var(--error-soft);
    color: var(--error);
}

.status-banner[data-kind='loading'] {
    display: flex;
    align-items: center;
    gap: 10px;
    border-color: var(--accent-strong);
    background: var(--accent-soft);
    color: var(--accent);
}

.status-banner[data-kind='loading']::before {
    content: '';
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-top-color: transparent;
    animation: tg-spin 0.7s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    .status-banner[data-kind='loading']::before {
        animation: none;
    }
}

/* Toast host (transient feedback, injected/used by components.js tgToast). */
.toast-host {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 1200;
    display: grid;
    gap: 10px;
    width: min(100% - 32px, 420px);
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--surface-strong);
    backdrop-filter: blur(var(--blur-strong));
    -webkit-backdrop-filter: blur(var(--blur-strong));
    color: var(--text);
    box-shadow: var(--shadow-soft);
    font-size: 0.92rem;
    line-height: 1.5;
    animation: tg-toast-in var(--dur-med) var(--ease-out-soft);
}

.toast[data-kind='success'] {
    border-color: var(--success-line);
    color: var(--success);
}

.toast[data-kind='warning'] {
    border-color: var(--warning-line);
    color: var(--warning);
}

.toast[data-kind='error'] {
    border-color: var(--error-line);
    color: var(--error);
}

@keyframes tg-toast-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .toast {
        animation: none;
    }
}

/* Segmented control (Sign in / Create account, Xtream / M3U, etc.). */
.mode-switch {
    display: inline-grid;
    grid-auto-flow: column;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface-soft);
}

.mode-switch-button {
    min-height: 38px;
    padding: 0 18px;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-soft);
    font-size: 0.9rem;
    font-weight: 600;
    transition:
        background-color var(--dur-xfast) var(--ease-out-soft),
        color var(--dur-xfast) var(--ease-out-soft);
}

.mode-switch-button.is-active,
.mode-switch-button[aria-pressed='true'] {
    background: var(--accent);
    color: var(--accent-ink);
}

/* Underline tabs (admin detail sections). */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-bottom: 1px solid var(--line);
}

.tab {
    position: relative;
    padding: 12px 16px;
    border: 0;
    background: transparent;
    color: var(--text-soft);
    font-size: 0.92rem;
    font-weight: 600;
    transition: color var(--dur-xfast) var(--ease-out-soft);
}

.tab[aria-selected='true'] {
    color: var(--text);
}

.tab[aria-selected='true']::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
}

.tab-panel {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

/* FAQ accordion (native <details>). */
.faq {
    display: grid;
    gap: 12px;
}

.faq-item {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    overflow: hidden;
}

.faq-item > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.faq-item > summary::-webkit-details-marker {
    display: none;
}

.faq-item > summary::after {
    content: '';
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-right: 2px solid var(--text-faint);
    border-bottom: 2px solid var(--text-faint);
    transform: rotate(45deg) translateY(-2px);
    transition: transform var(--dur-fast) var(--ease-out-soft);
}

.faq-item[open] > summary::after {
    transform: rotate(225deg) translateY(-2px);
}

.faq-answer {
    padding: 0 20px 18px;
    color: var(--text-soft);
    line-height: 1.66;
}

/* Native dialog / modal. */
.tg-dialog {
    width: min(100% - 32px, 460px);
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-strong);
    backdrop-filter: blur(var(--blur-strong));
    -webkit-backdrop-filter: blur(var(--blur-strong));
    color: var(--text);
    box-shadow: var(--shadow-strong);
}

.tg-dialog::backdrop {
    background: rgba(2, 6, 15, 0.62);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.tg-dialog-panel {
    display: grid;
    gap: 16px;
    padding: clamp(20px, 3vw, 28px);
}

.tg-dialog-head h2 {
    margin: 0 0 6px;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0;
}

.tg-dialog-head p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.6;
}

.tg-dialog-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

@media (prefers-reduced-motion: no-preference) {
    .tg-dialog[open] {
        animation: tg-dialog-in var(--dur-med) var(--ease-out-soft);
    }
}

@keyframes tg-dialog-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
}

/* Connected progress stepper (phone flows). */
.stepper {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    align-items: start;
    gap: 0;
}

.stepper-step {
    display: grid;
    justify-items: center;
    gap: 8px;
    position: relative;
    text-align: center;
    padding: 0 8px;
}

.stepper-step::before {
    content: '';
    position: absolute;
    top: 15px;
    left: -50%;
    width: 100%;
    height: 2px;
    background: var(--line-strong);
    z-index: 0;
}

.stepper-step:first-child::before {
    display: none;
}

.stepper-bubble {
    position: relative;
    z-index: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-strong);
    background: var(--surface-soft);
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 600;
}

.stepper-label {
    font-size: 0.82rem;
    color: var(--text-faint);
    line-height: 1.3;
}

.stepper-step[data-state='current'] .stepper-bubble {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.stepper-step[data-state='current'] .stepper-label {
    color: var(--text);
}

.stepper-step[data-state='done'] .stepper-bubble {
    border-color: var(--success-line);
    background: var(--success-soft);
    color: var(--success);
}

.stepper-step[data-state='done']::before,
.stepper-step[data-state='current']::before {
    background: var(--accent);
}

.stepper-compact {
    display: none;
    font-family: var(--font-mono);
    font-size: var(--fs-mono-eyebrow);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--accent);
}

/* Large mono pairing-code input + echoed code chip. */
.code-input input {
    text-align: center;
    font-family: var(--font-mono);
    font-size: 1.6rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
}

.code-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.3em;
}

/* Slim top bar used on utility/legal pages.
   Hosts the brand, a "Home" link, and the theme toggle. */
.utility-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 14px 0;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(var(--blur-strong)) saturate(140%);
    -webkit-backdrop-filter: blur(var(--blur-strong)) saturate(140%);
    border-bottom: 1px solid var(--line);
}

.utility-topbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.utility-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition:
        background-color var(--dur-fast) var(--ease-out-soft),
        border-color var(--dur-fast) var(--ease-out-soft),
        transform var(--dur-fast) var(--ease-out-soft);
}

.theme-toggle:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    background: var(--surface-strong);
}

.theme-icon {
    transition: opacity var(--dur-fast) var(--ease-out-soft);
}
.theme-icon-sun {
    display: none;
}
.theme-icon-moon {
    display: block;
}
:root[data-theme='light'] .theme-icon-sun {
    display: block;
}
:root[data-theme='light'] .theme-icon-moon {
    display: none;
}

@media (max-width: 640px) {
    .utility-topbar {
        padding: 10px 0;
    }
}

/* Utility-page scaffold (account / device-login / billing-checkout). */
.utility-page {
    min-height: 100vh;
}

.utility-shell {
    padding: 24px 0 32px;
}

.utility-grid {
    display: grid;
    grid-template-columns: minmax(300px, 0.92fr) minmax(0, 1.08fr);
    gap: 24px;
    align-items: stretch;
}

.utility-rail,
.utility-card {
    padding: clamp(24px, 3vw, 34px);
}

.utility-rail {
    display: grid;
    gap: 28px;
    background:
        linear-gradient(135deg, rgba(36, 199, 183, 0.12), transparent 38%),
        linear-gradient(315deg, rgba(245, 158, 11, 0.12), transparent 42%),
        linear-gradient(180deg, var(--panel-dark-soft) 0%, var(--panel-dark) 100%);
    color: var(--text-on-dark);
    box-shadow: var(--shadow-strong);
    border: 1px solid var(--line);
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
}

.utility-rail::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 78%, rgba(0, 0, 0, 0.35) 100%);
}

.utility-rail > * {
    position: relative;
    z-index: 1;
}

.utility-card {
    display: grid;
    gap: 20px;
    align-content: start;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
}

.utility-title {
    margin: 18px 0 0;
    font-size: clamp(2rem, 4.2vw, 3.2rem);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: 0;
    color: var(--text-on-dark);
}

.utility-copy {
    margin: 16px 0 0;
    color: var(--text-on-dark-soft);
    font-size: 1rem;
    line-height: 1.72;
}

.utility-points {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.utility-points li {
    padding: 16px 18px;
    border: 1px solid var(--line-dark);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-on-dark-soft);
    font-size: 0.95rem;
    line-height: 1.58;
    transition:
        background-color var(--dur-fast) var(--ease-out-soft),
        border-color var(--dur-fast) var(--ease-out-soft),
        transform var(--dur-fast) var(--ease-out-soft);
}

.utility-points li:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(36, 199, 183, 0.42);
    transform: translateY(-1px);
}

.utility-points strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-on-dark);
    font-size: 0.95rem;
}

.summary-card,
.actions-card,
.success-card {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-soft);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.summary-grid.secondary {
    margin-top: 16px;
}

.summary-block {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
}

.summary-label {
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.summary-value {
    margin-top: 8px;
    font-size: 1.32rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    color: var(--text);
}

.summary-value.secondary {
    font-size: 1rem;
}

.summary-description {
    margin-top: 8px;
    color: var(--text-soft);
    font-size: 0.94rem;
}

.success-card {
    text-align: center;
}

.success-card h2 {
    margin: 14px 0 8px;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0;
}

.success-card p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.66;
}

.success-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--accent-ink);
    background: var(--success);
    box-shadow: 0 12px 28px rgba(0, 230, 118, 0.36);
}

.step-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.step-card {
    display: grid;
    gap: 8px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    transition:
        border-color var(--dur-med) var(--ease-out-soft),
        background-color var(--dur-med) var(--ease-out-soft),
        box-shadow var(--dur-med) var(--ease-out-soft),
        transform var(--dur-med) var(--ease-out-soft);
}

.step-card[data-state='current'] {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.step-card[data-state='current'] .step-index {
    color: var(--accent);
}

.step-card[data-state='done'] {
    border-color: var(--success-line);
    background: var(--success-soft);
}

.step-card[data-state='done'] .step-index {
    color: var(--success);
}

.step-index {
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.step-copy {
    display: grid;
    gap: 3px;
}

.step-copy strong {
    font-size: 0.95rem;
    line-height: 1.28;
    color: var(--text);
}

.step-copy span {
    color: var(--text-soft);
    font-size: 0.88rem;
    line-height: 1.5;
}

.help-card {
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-soft);
}

.help-card h3 {
    margin: 0 0 8px;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0;
    color: var(--text);
}

.help-card p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.62;
}

.legal-card {
    display: grid;
    gap: 12px;
}

.utility-legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.help-list {
    display: grid;
    gap: 10px;
    margin: 12px 0 0;
    padding-left: 18px;
    color: var(--text-soft);
}

.help-list li {
    line-height: 1.6;
}

/* Stack list (saved items, devices, generic rows) — used by pricing.js host
   and the portal device/playlist lists. */
.stack-list {
    display: grid;
    gap: 12px;
}

.stack-item {
    display: grid;
    gap: 6px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
}

.item-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.item-meta {
    color: var(--text-soft);
    font-size: 0.9rem;
    line-height: 1.5;
}

.item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

/* Responsive. */
@media (max-width: 960px) {
    .utility-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .utility-card {
        order: 1;
    }

    .utility-rail {
        order: 2;
    }
}

/* Keep the stepper visible and legible on phones (these flows are mobile-first). */
@media (max-width: 520px) {
    .stepper-label {
        font-size: 0.72rem;
    }

    .stepper-bubble {
        width: 28px;
        height: 28px;
    }

    .stepper-step::before {
        top: 13px;
    }
}

@media (max-width: 720px) {
    .utility-shell {
        padding-top: 12px;
        padding-bottom: 24px;
    }

    .utility-rail,
    .utility-card {
        padding: 20px;
        border-radius: var(--radius-lg);
    }

    .utility-grid {
        gap: 14px;
    }

    .utility-title {
        margin-top: 14px;
        font-size: clamp(1.8rem, 10vw, 2.6rem);
        line-height: 1;
    }

    .utility-copy {
        margin-top: 14px;
        font-size: 0.98rem;
        line-height: 1.64;
    }

    .utility-points {
        gap: 10px;
    }

    .utility-points li {
        padding: 14px 15px;
    }

    .summary-card,
    .actions-card,
    .success-card {
        padding: 16px;
        border-radius: 18px;
    }

    .step-card {
        padding: 12px 14px;
        border-radius: 16px;
    }

    .consent-field {
        padding: 14px;
        border-radius: 16px;
    }

    .help-card {
        padding: 16px;
        border-radius: 18px;
    }
}

@media (max-width: 640px) {
    .utility-topbar-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .utility-topbar-actions {
        min-width: 0;
        justify-content: end;
    }

    .utility-topbar-actions .btn {
        max-width: 100%;
    }

    .utility-topbar-actions .btn-ghost {
        display: none;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .step-strip {
        grid-template-columns: 1fr;
    }

    .utility-legal-links {
        display: grid;
        grid-template-columns: 1fr;
    }
}

/* ===== Skeleton loading placeholders ===== */
.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--surface-soft);
    border-radius: var(--radius-xs);
}

.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
    animation: tg-shimmer 1.3s linear infinite;
}

.skeleton-line {
    height: 14px;
    margin: 10px 0;
}

.skeleton-line.short {
    width: 45%;
}

@keyframes tg-shimmer {
    to {
        transform: translateX(100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .skeleton::after {
        animation: none;
    }
}

/* ===== Site footer (injected by components.js on every page) ===== */
.site-footer {
    padding: clamp(56px, 8vw, 100px) 0 28px;
    border-top: 1px solid var(--line);
    margin-top: clamp(40px, 7vw, 80px);
    background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--surface-soft) 58%, transparent));
}

.footer-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
    gap: 40px;
    align-items: start;
}

.footer-brand {
    display: grid;
    gap: 14px;
    align-content: start;
}

.footer-tagline {
    margin: 0;
    color: var(--text-soft);
    max-width: 40ch;
    line-height: 1.6;
}

.footer-compliance {
    margin: 0;
    color: var(--text-faint);
    font-size: 0.86rem;
    line-height: 1.55;
    max-width: 44ch;
}

.footer-social {
    justify-self: start;
    gap: 9px;
    margin-top: 2px;
}

.footer-social svg {
    color: #5865f2;
    flex: 0 0 auto;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}

.footer-col {
    display: grid;
    gap: 10px;
    align-content: start;
}

.footer-col h3 {
    margin: 0;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.footer-col nav {
    display: grid;
    gap: 10px;
}

.footer-col a {
    color: var(--text-soft);
    font-size: 0.94rem;
    transition: color var(--dur-fast) var(--ease-out-soft);
}

.footer-col a:hover {
    color: var(--text);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    color: var(--text-faint);
    font-size: 0.86rem;
}

.footer-copy {
    margin: 0;
    color: var(--text-faint);
}

@media (max-width: 920px) {
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-links {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
}

/* ===== Floating WhatsApp click-to-chat button =====
   Injected on every page (bar the admin console) by components.js. Sits
   bottom-LEFT so it never collides with the bottom-right assistant launcher.
   WhatsApp brand green is a fixed brand asset — intentionally not themed. */

.tg-whatsapp {
    position: fixed;
    left: clamp(12px, 3vw, 28px);
    bottom: clamp(12px, 3vw, 28px);
    z-index: 1190;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-pill);
    background: #25d366;
    color: #fff;
    box-shadow: var(--shadow-strong);
    text-decoration: none;
    transition:
        transform 140ms ease,
        box-shadow 140ms ease;
}

.tg-whatsapp:hover,
.tg-whatsapp:focus-visible {
    transform: translateY(-2px);
    color: #fff;
}

.tg-whatsapp:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .tg-whatsapp {
        transition: none;
    }
    .tg-whatsapp:hover,
    .tg-whatsapp:focus-visible {
        transform: none;
    }
}
