/* Login only: desktop app install modal (Chrome-style hero, store CTAs). */
.tb-login-desktop-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: rgba(15, 23, 42, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.tb-login-desktop-overlay[hidden] {
    display: none;
}

.tb-login-desktop-dialog {
    width: 100%;
    max-width: 440px;
    background: var(--tb-surface, #fff);
    color: var(--tb-text, #0f172a);
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
    border: 1px solid var(--tb-border, #e2e8f0);
    padding: 28px 24px 22px;
    position: relative;
}

.tb-login-desktop-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--tb-text-muted, #64748b);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tb-login-desktop-close:hover {
    background: var(--tb-hr, #f1f5f9);
    color: var(--tb-text, #0f172a);
}

.tb-login-desktop-hero {
    text-align: center;
    margin-bottom: 10px;
}

.tb-login-desktop-hero h2 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin: 0 0 8px;
    color: var(--tb-text, #0f172a);
}

.tb-login-desktop-lead {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--tb-text-muted, #64748b);
    text-align: center;
    margin: 0 0 22px;
}

.tb-login-desktop-cta-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

/* Direct .exe / .dmg when THERABEE_DESKTOP_INSTALLER_URL_* is set (primary CTA). */
.tb-login-desktop-direct-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #fff;
    background: #2c5f6f;
    border: 1px solid #244f5d;
    border-radius: 999px;
    padding: 10px 22px;
    font-size: 0.9375rem;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
    transition: transform 0.15s ease, filter 0.15s ease;
    max-width: 100%;
}

.tb-login-desktop-direct-link:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
    text-decoration: none;
    color: #fff;
}

.tb-login-desktop-direct-link:focus-visible {
    outline: 3px solid rgba(44, 95, 111, 0.45);
    outline-offset: 2px;
}

/* Pill button: icon + label (store logos are decorative; label carries meaning). */
.tb-login-desktop-store-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--tb-text, #0f172a);
    background: var(--tb-control-bg, #f8fafc);
    border: 1px solid var(--tb-border, #e2e8f0);
    border-radius: 999px;
    padding: 10px 20px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    max-width: 100%;
}

.tb-login-desktop-store-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
    background: var(--tb-hr, #f1f5f9);
}

.tb-login-desktop-store-link:focus-visible {
    outline: 3px solid var(--tb-primary-focus-ring, rgba(59, 130, 246, 0.45));
    outline-offset: 2px;
}

.tb-login-desktop-store-link-inner {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.tb-login-desktop-icon-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.tb-login-desktop-icon-slot img {
    display: block;
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* Theme-aware icons inside slot */
.tb-login-desktop-icon-slot .tb-login-desktop-badge-light {
    display: block;
}

.tb-login-desktop-icon-slot .tb-login-desktop-badge-dark {
    display: none;
}

@media (prefers-color-scheme: dark) {
    .tb-login-desktop-icon-slot .tb-login-desktop-badge-light {
        display: none;
    }

    .tb-login-desktop-icon-slot .tb-login-desktop-badge-dark {
        display: block;
    }
}

.tb-login-desktop-store-label {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
    color: inherit;
}

.tb-login-desktop-secondary {
    font-size: 0.8125rem;
    color: var(--tb-text-muted, #64748b);
    text-align: center;
}

.tb-login-desktop-secondary a {
    color: var(--tb-teal-link, #0d9488);
    font-weight: 600;
    text-decoration: none;
}

.tb-login-desktop-secondary a:hover {
    text-decoration: underline;
}

.tb-login-desktop-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--tb-border, #e2e8f0);
    text-align: center;
}

.tb-login-desktop-skip {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--tb-text-muted, #64748b);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    padding: 6px 10px;
    border-radius: 8px;
}

.tb-login-desktop-skip:hover {
    color: var(--tb-text, #0f172a);
}

.tb-login-desktop-panel[data-platform] {
    display: none;
}

.tb-login-desktop-panel.is-active {
    display: block;
}

/* Dashboard: desktop required modal — scoped by #id so rules win over generic .tb-login-* and survive asset cache confusion. */
#tb-dashboard-desktop-required-modal .tb-dashboard-desktop-modal-dialog {
    max-width: 460px;
    padding: 44px 28px 36px;
}

#tb-dashboard-desktop-required-modal .tb-dashboard-desktop-modal-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.35rem;
    width: 100%;
}

#tb-dashboard-desktop-required-modal .tb-dashboard-desktop-modal-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0;
}

#tb-dashboard-desktop-required-modal .tb-dashboard-desktop-modal-logo img {
    width: 56px;
    height: 56px;
    max-width: 56px;
    margin: 0 auto;
    object-fit: contain;
    display: block;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

#tb-dashboard-desktop-required-modal .tb-dashboard-desktop-modal-title {
    font-size: clamp(1.2rem, 3.5vw, 1.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.28;
    margin: 0;
    width: 100%;
    max-width: 20rem;
    text-align: center;
    color: var(--tb-text, #0f172a);
}

#tb-dashboard-desktop-required-modal .tb-dashboard-desktop-modal-subtitle {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--tb-text-muted, #64748b);
    margin: 0;
    width: 100%;
    max-width: 24rem;
    text-align: center;
}

#tb-dashboard-desktop-required-modal .tb-dashboard-desktop-modal-cta.tb-login-desktop-cta-wrap {
    width: 100%;
    max-width: 320px;
    margin: 4px auto 0;
    gap: 18px;
}

#tb-dashboard-desktop-required-modal .tb-dashboard-desktop-modal-cta .tb-login-desktop-direct-link,
#tb-dashboard-desktop-required-modal .tb-dashboard-desktop-modal-cta .tb-login-desktop-store-link {
    width: 100%;
    justify-content: center;
    min-height: 50px;
    padding: 14px 22px;
    font-size: 1rem;
}

#tb-dashboard-desktop-required-modal .tb-login-desktop-store-link-inner {
    justify-content: center;
    width: 100%;
}

#tb-dashboard-desktop-required-modal .tb-login-desktop-store-label {
    text-align: center;
}

/* Match recording CTAs (e.g. .recording-start): primary fill + white label/icon — same tokens as light/dark in therabee-web-variables.css */
#tb-dashboard-desktop-required-modal .tb-dashboard-desktop-modal-cta .tb-login-desktop-direct-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    border-radius: 999px;
    background: var(--tb-primary);
    border: 1px solid var(--tb-primary-hover);
    color: var(--tb-on-primary);
    box-shadow: 0 4px 14px var(--tb-primary-focus-ring, rgba(177, 123, 126, 0.25));
}

#tb-dashboard-desktop-required-modal .tb-dashboard-desktop-modal-cta .tb-login-desktop-direct-link:hover {
    filter: none;
    background: var(--tb-primary-hover);
    border-color: var(--tb-primary-hover);
    color: var(--tb-on-primary);
}

#tb-dashboard-desktop-required-modal .tb-dashboard-desktop-modal-cta .tb-login-desktop-direct-link:focus-visible {
    outline: 3px solid var(--tb-primary-focus-ring, rgba(177, 123, 126, 0.35));
    outline-offset: 2px;
}

#tb-dashboard-desktop-required-modal .tb-dashboard-desktop-modal-cta .tb-login-desktop-direct-link::before {
    content: '';
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    background-color: var(--tb-on-primary);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v10M8 11l4 4 4-4M5 19h14'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v10M8 11l4 4 4-4M5 19h14'/%3E%3C/svg%3E") center / contain no-repeat;
}

#tb-dashboard-desktop-required-modal .tb-dashboard-desktop-modal-cta .tb-login-desktop-store-link {
    background: var(--tb-primary);
    border: 1px solid var(--tb-primary-hover);
    color: var(--tb-on-primary);
    box-shadow: 0 4px 14px var(--tb-primary-focus-ring, rgba(177, 123, 126, 0.25));
}

#tb-dashboard-desktop-required-modal .tb-dashboard-desktop-modal-cta .tb-login-desktop-store-link:hover {
    background: var(--tb-primary-hover);
    border-color: var(--tb-primary-hover);
    color: var(--tb-on-primary);
    transform: translateY(-1px);
}

#tb-dashboard-desktop-required-modal .tb-dashboard-desktop-modal-cta .tb-login-desktop-store-link:focus-visible {
    outline: 3px solid var(--tb-primary-focus-ring, rgba(177, 123, 126, 0.35));
    outline-offset: 2px;
}

#tb-dashboard-desktop-required-modal .tb-dashboard-desktop-modal-cta .tb-login-desktop-store-label {
    color: var(--tb-on-primary);
}

#tb-dashboard-desktop-required-modal .tb-dashboard-desktop-modal-cta .tb-login-desktop-icon-slot img {
    filter: brightness(0) invert(1);
}
