/* ── MultiSoc design tokens (dark, Apple-level polish) ───────────────────── */
:root {
    color-scheme: dark;
    --bg: #000000;
    --bg-elevated: #1c1c1e;
    --bg-soft: #161618;
    --bg-muted: #2c2c2e;
    --text: #f5f5f7;
    --text-secondary: #d2d2d7;
    --muted: #98989d;
    --accent: #0a84ff;
    --accent-hover: #409cff;
    --accent-ink: #64b5ff;
    --accent-soft: rgba(10, 132, 255, 0.16);
    --accent-ring: rgba(10, 132, 255, 0.45);
    --danger: #ff453a;
    --danger-soft: rgba(255, 69, 58, 0.14);
    --warning: #ffd60a;
    --warning-soft: rgba(255, 214, 10, 0.12);
    --success: #30d158;
    --success-soft: rgba(48, 209, 88, 0.14);
    --border: #38383a;
    --border-strong: #48484a;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3);
    --radius: 14px;
    --radius-sm: 12px;
    --radius-lg: 18px;
    --radius-pill: 980px;
    --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
    --font-size-body: 17px;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --nav-h: 3.5rem;
    --shell-max: 1080px;
    --ease-out: cubic-bezier(0.25, 0.1, 0.25, 1);
    --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
    --duration: 0.28s;
    --focus-ring: 0 0 0 3px rgba(10, 132, 255, 0.4);
    --focus-ring-inset: 0 0 0 3px var(--bg-elevated), 0 0 0 6px rgba(10, 132, 255, 0.45);
    --overlay-scrim: rgba(0, 0, 0, 0.68);
    --glass: rgba(28, 28, 30, 0.94);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    color-scheme: dark;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: var(--font-size-body);
    font-optical-sizing: auto;
    font-display: swap;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--text);
    line-height: 1.47059;
    letter-spacing: -0.022em;
    background-color: var(--bg);
    /* Never leave a page-wide blur/filter when the mobile menu is closed */
    filter: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--duration) var(--ease-out);
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
    text-underline-offset: 0.18em;
    text-decoration-thickness: 1px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.skip-link:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    padding: var(--space-3) var(--space-4);
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius-pill);
}

.skip-link:focus {
    left: var(--space-4);
    top: var(--space-4);
}

.shell {
    position: relative;
    z-index: 1;
    max-width: var(--shell-max);
    margin: 0 auto;
    padding: 0 var(--space-5) var(--space-12);
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-main {
    flex: 1 1 auto;
    width: 100%;
}

/* ── Top navigation ─────────────────────────────────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    margin: 0 calc(-1 * var(--space-5)) var(--space-8);
    padding: 0 var(--space-5);
    background: rgba(0, 0, 0, 0.78);
    border-bottom: 1px solid rgba(56, 56, 58, 0.9);
    backdrop-filter: saturate(160%) blur(16px);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    min-height: var(--nav-h);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text);
    text-decoration: none;
    line-height: 1;
    flex-shrink: 0;
}

.brand:hover {
    text-decoration: none;
    color: var(--text);
}

.brand:hover .brand-wordmark {
    color: var(--accent-hover);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: 2.35rem;
    max-height: 2.4rem;
    border-radius: 0;
    background: transparent;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    overflow: visible;
    flex-shrink: 0;
}

.brand-logo,
.brand img {
    display: block;
    height: 2.35rem;
    width: auto;
    max-height: 2.4rem;
    max-width: min(10.5rem, 46vw);
    object-fit: contain;
    object-position: left center;
}

.brand-logo.is-missing {
    display: none;
}

.brand-mark-fallback {
    display: inline-grid;
    place-items: center;
    min-width: 2.35rem;
    height: 2.35rem;
    padding: 0 0.35rem;
    border-radius: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.brand-wordmark {
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -0.035em;
    transition: color var(--duration) var(--ease-out);
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-2);
    align-items: center;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.nav-group {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1);
}

.nav-group-secondary {
    margin-left: var(--space-1);
    padding-left: var(--space-3);
    border-left: 1px solid var(--border);
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.3rem;
    margin-left: 0.15rem;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
    vertical-align: middle;
}

.nav-links a:not(.btn) {
    color: var(--text);
    text-decoration: none;
    padding: 0.35rem 0.55rem;
    border-radius: var(--radius-pill);
    opacity: 0.88;
    transition:
        color var(--duration) var(--ease-out),
        background var(--duration) var(--ease-out),
        opacity var(--duration) var(--ease-out);
}

.nav-links a:not(.btn):hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
    opacity: 1;
}

.nav-links a:not(.btn).active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
    opacity: 1;
    font-weight: 500;
}

.nav-links a:not(.btn):focus-visible {
    box-shadow: var(--focus-ring);
}

.nav-logout {
    display: inline;
    margin: 0;
}

.nav-logout button,
.inline-logout button {
    font: inherit;
    font-size: inherit;
    font-weight: inherit;
    color: var(--muted);
    background: none;
    border: none;
    padding: 0.4rem 0.65rem;
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s ease, background 0.15s ease;
}

.nav-logout button:hover,
.inline-logout button:hover {
    color: var(--text);
    background: var(--bg-soft);
}

.nav-logout button:focus-visible,
.inline-logout button:focus-visible {
    box-shadow: var(--focus-ring);
    outline: none;
}

.inline-logout {
    display: inline;
    margin: 0;
}

.inline-logout button {
    padding: 0;
    color: inherit;
    text-decoration: underline;
    background: none;
}

.inline-logout button:hover {
    background: none;
    color: var(--accent-ink);
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg-elevated) 80%, transparent);
    color: var(--text);
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.2s var(--ease-out);
}

.nav-toggle:hover {
    background: var(--bg-soft);
    border-color: var(--border-strong);
}

.nav-toggle:active {
    transform: scale(0.96);
}

.nav-toggle-bars {
    display: block;
    width: 1rem;
    height: 1.5px;
    background: currentColor;
    box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

@media (max-width: 719px) {
    .nav-toggle {
        display: inline-flex;
    }

    .nav-toggle[aria-expanded="true"] .nav-toggle-bars {
        box-shadow: none;
        background: transparent;
        position: relative;
    }

    .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before,
    .nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
        content: "";
        position: absolute;
        left: 0;
        width: 1rem;
        height: 1.5px;
        background: currentColor;
        transition: transform 0.28s var(--ease-out);
    }

    .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
        transform: rotate(45deg);
    }

    .nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
        transform: rotate(-45deg);
    }

    body.nav-open {
        overflow: hidden;
        /* Hard guarantee: never blur the document when menu is open or closed */
        filter: none !important;
    }

    /* Solid dim overlay — no backdrop-filter (avoids iOS Safari stuck blur) */
    body.nav-open::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 40;
        background: var(--overlay-scrim);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        pointer-events: auto;
        animation: nav-scrim-in 0.22s var(--ease-out) both;
    }

    /* Closed state: no pseudo overlay, no blur on body/main */
    body:not(.nav-open)::before {
        content: none !important;
        display: none !important;
    }

    .topbar {
        z-index: 50;
    }

    .nav-links {
        display: flex;
        position: absolute;
        top: calc(var(--nav-h) + 1px);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-3);
        padding: var(--space-3) var(--space-5) var(--space-5);
        background: var(--bg-elevated);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
        max-height: calc(100dvh - var(--nav-h) - 1px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        /* Solid panel — no blur filter that can stick on iOS */
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-8px);
        transition:
            opacity 0.22s var(--ease-out),
            transform 0.28s var(--ease-out),
            visibility 0.28s;
    }

    .nav-links.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    .nav-group {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-1);
        margin: 0;
        padding: 0;
        border: 0;
    }

    .nav-group-secondary {
        padding-top: var(--space-3);
        border-top: 1px solid var(--border);
    }

    .nav-links a:not(.btn) {
        padding: 0.8rem 0.85rem;
        border-radius: var(--radius-sm);
        font-size: 1rem;
    }

    .nav-logout button {
        width: 100%;
        text-align: left;
        padding: 0.8rem 0.85rem;
        border-radius: var(--radius-sm);
        font-size: 1rem;
    }

    .nav-links .btn {
        width: 100%;
        margin-top: var(--space-1);
        justify-content: center;
    }
}

@keyframes nav-scrim-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ── Landing hero (marketing) ───────────────────────────────────────────── */
body.is-landing {
    background-image: none;
}

body.is-landing .shell {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
}

body.is-landing .topbar {
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 0;
    padding-left: max(var(--space-5), calc((100vw - var(--shell-max)) / 2 + var(--space-5)));
    padding-right: max(var(--space-5), calc((100vw - var(--shell-max)) / 2 + var(--space-5)));
}

body.is-landing #main {
    padding: 0;
}

.landing {
    position: relative;
    isolation: isolate;
    display: grid;
    align-items: center;
    min-height: calc(100vh - var(--nav-h) - 1px);
    min-height: calc(100dvh - var(--nav-h) - 1px);
    overflow: hidden;
}

/* Dominant full-bleed visual plane (edge-to-edge; not a card) */
.landing-visual {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    animation: landing-plane-in 1.15s var(--ease-out) both;
}

.landing-visual-plane {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            105deg,
            #000000 0%,
            #0a0a0c 40%,
            transparent 64%
        ),
        linear-gradient(
            180deg,
            #000000 0%,
            #111114 100%
        );
}

.landing-visual-plane::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 55% 70% at 78% 48%, rgba(10, 132, 255, 0.1), transparent 70%),
        radial-gradient(ellipse 40% 45% at 92% 18%, rgba(255, 255, 255, 0.035), transparent 60%),
        radial-gradient(ellipse 50% 40% at 60% 88%, rgba(255, 255, 255, 0.02), transparent 55%);
}

.landing-visual-plane::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.4;
    background:
        radial-gradient(circle at 78% 42%, rgba(28, 28, 30, 0.55) 0%, transparent 45%);
}

.landing-visual-glow {
    position: absolute;
    inset: 18% -8% -10% 42%;
    background:
        radial-gradient(ellipse 70% 55% at 55% 45%, rgba(10, 132, 255, 0.08), transparent 72%);
    filter: blur(28px);
    opacity: 0.9;
    animation: landing-glow-drift 18s var(--ease-out) infinite alternate;
}

.landing-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 38rem;
    justify-self: start;
    padding:
        clamp(2.5rem, 8vh, 5.5rem)
        max(var(--space-5), calc((100vw - var(--shell-max)) / 2 + var(--space-5)));
}

.hero-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: 0 0 var(--space-6);
    color: var(--text);
}

.hero-brand-logo {
    display: block;
    width: auto;
    height: clamp(2.25rem, 5vw, 3.25rem);
    border-radius: 0;
    flex-shrink: 0;
    background: transparent;
    object-fit: contain;
}

.hero-brand-name {
    font-family: var(--font-display);
    font-size: clamp(3.2rem, 10vw, 5.5rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1.05;
}

.hero-headline {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin: 0 0 var(--space-4);
    color: var(--text);
    max-width: 18ch;
}

.hero-lede {
    font-size: clamp(1.0625rem, 1.8vw, 1.1875rem);
    color: var(--muted);
    max-width: 30rem;
    margin: 0 0 var(--space-8);
    line-height: 1.47059;
    letter-spacing: -0.011em;
    font-weight: 400;
}

.landing-actions .btn {
    min-height: 2.75rem;
    padding-inline: 1.35rem;
}

.landing-actions .btn-primary:hover:not(:disabled):not(.is-loading) {
    box-shadow: none;
}

.landing-actions .btn-ghost:hover:not(:disabled):not(.is-loading) {
    transform: none;
}

@media (max-width: 719px) {
    .landing-content {
        max-width: none;
        padding-top: clamp(2rem, 6vh, 3rem);
        padding-bottom: clamp(3rem, 10vh, 4.5rem);
    }

    .hero-brand {
        gap: var(--space-2);
        margin-bottom: var(--space-5);
    }

    .hero-headline {
        max-width: 16ch;
    }

    .landing-visual-glow {
        inset: 35% -20% 0 10%;
        opacity: 0.85;
    }

    .landing-visual-plane::after {
        opacity: 0.2;
    }

    .landing-actions {
        width: 100%;
    }

    .landing-actions .btn {
        flex: 1 1 auto;
    }
}

@keyframes landing-plane-in {
    from {
        opacity: 0;
        transform: scale(1.035);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes landing-glow-drift {
    from {
        transform: translate3d(0, 0, 0) scale(1);
    }
    to {
        transform: translate3d(-2%, 3%, 0) scale(1.04);
    }
}

/* Post-hero landing bands (outside first viewport) */
.landing-band {
    position: relative;
    z-index: 1;
    padding: clamp(3rem, 8vh, 5.5rem)
        max(var(--space-5), calc((100vw - var(--shell-max)) / 2 + var(--space-5)));
    background: var(--bg);
}

.landing-band-alt {
    background: var(--bg-soft);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.landing-band-inner {
    max-width: 40rem;
}

.landing-band h2 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 1.875rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin: 0 0 var(--space-3);
    color: var(--text);
}

.landing-band-lede {
    margin: 0 0 var(--space-8);
    color: var(--muted);
    font-size: 1.0625rem;
    line-height: 1.5;
    max-width: 32rem;
}

.landing-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-6);
}

.landing-steps li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-4);
    align-items: start;
}

.landing-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    margin-top: 0.1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--accent-ink);
    border: 1px solid rgba(10, 132, 255, 0.35);
    border-radius: 50%;
    background: var(--accent-soft);
}

.landing-steps strong {
    display: block;
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-1);
    color: var(--text);
}

.landing-steps p {
    margin: 0;
    color: var(--muted);
    font-size: 0.975rem;
    line-height: 1.5;
}

.landing-band-inner--platforms {
    max-width: 56rem;
}

.landing-band-inner--platforms .landing-band-lede {
    max-width: 36rem;
}

.landing-platform-groups {
    display: grid;
    gap: var(--space-8);
}

.landing-platform-group-label {
    margin: 0 0 var(--space-4);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.landing-platform-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
    gap: 0.85rem 1.25rem;
}

.landing-platform-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.landing-platform-name {
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: -0.015em;
    color: var(--text-secondary);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.platform-logo {
    display: block;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    object-fit: contain;
}

.platform-logo-sm {
    width: 18px;
    height: 18px;
}

.platform-logo-lg {
    width: 28px;
    height: 28px;
}

.landing-platform-item .platform-logo {
    width: 26px;
    height: 26px;
}

body.is-landing .site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg);
}

/* Reveal animations */
[data-reveal] {
    opacity: 0;
    transform: translateY(12px);
}

[data-reveal].is-visible {
    animation: reveal-up 0.7s var(--ease-out) both;
}

[data-reveal-delay="1"].is-visible { animation-delay: 0.08s; }
[data-reveal-delay="2"].is-visible { animation-delay: 0.16s; }
[data-reveal-delay="3"].is-visible { animation-delay: 0.24s; }
[data-reveal-delay="4"].is-visible { animation-delay: 0.32s; }

@keyframes reveal-up {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes panel-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel[data-reveal].is-visible,
.stack > [data-reveal].is-visible {
    animation-name: panel-in;
    animation-duration: 0.45s;
}

/* ── Actions & buttons ──────────────────────────────────────────────────── */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    padding: 0.7rem 1.35rem;
    min-height: 2.75rem;
    font: inherit;
    font-size: 1.0625rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.17648;
    cursor: pointer;
    text-decoration: none;
    transition:
        transform var(--duration) var(--ease-spring),
        background var(--duration) var(--ease-out),
        border-color var(--duration) var(--ease-out),
        box-shadow var(--duration) var(--ease-out),
        color var(--duration) var(--ease-out),
        opacity var(--duration) var(--ease-out);
}

.btn:hover {
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled,
.btn[disabled],
.btn.is-loading {
    opacity: 0.56;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    pointer-events: none;
}

.btn.is-loading::before {
    content: "";
    width: 0.85em;
    height: 0.85em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: none;
}

.btn-primary:hover:not(:disabled):not(.is-loading) {
    background: var(--accent-hover);
    color: #fff;
}

.btn-primary:focus-visible {
    box-shadow: var(--focus-ring-inset);
}

.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--accent);
    box-shadow: none;
}

.btn-ghost:hover:not(:disabled):not(.is-loading) {
    border-color: var(--border-strong);
    color: var(--accent-hover);
    background: rgba(255, 255, 255, 0.04);
}

.btn-danger {
    background: transparent;
    border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
    color: var(--danger);
}

.btn-danger:hover:not(:disabled):not(.is-loading) {
    background: var(--danger-soft);
    color: var(--danger);
}

.btn-sm {
    padding: 0.45rem 1rem;
    min-height: 2.25rem;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

/* ── Page chrome ────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4) var(--space-6);
    margin-bottom: var(--space-8);
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0 0 var(--space-2);
    line-height: 1.1;
}

.page-header .lede,
.page-lede {
    margin: 0;
    color: var(--muted);
    font-size: 1.0625rem;
    line-height: 1.47059;
    letter-spacing: -0.011em;
    max-width: 40rem;
}

.page-header-tight {
    margin-bottom: var(--space-4);
}

.page-header-tight h1 {
    font-size: clamp(1.45rem, 2.6vw, 1.75rem);
}

.panel {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-5);
    box-shadow: var(--shadow-xs);
    color: var(--text);
}

.form-panel {
    max-width: 40rem;
}

.panel h1,
.panel h2 {
    font-family: var(--font-display);
    margin: 0 0 var(--space-3);
    letter-spacing: -0.025em;
    font-weight: 600;
    color: var(--text);
}

.panel h1 {
    font-size: 1.75rem;
}

.panel h2 {
    font-size: 1.25rem;
}

.panel-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.panel-header h2 {
    margin: 0;
}

.muted {
    color: var(--muted);
}

.stack {
    display: grid;
    gap: var(--space-5);
}

.grid-2 {
    display: grid;
    gap: var(--space-5);
}

@media (min-width: 720px) {
    .grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

/* ── Forms ──────────────────────────────────────────────────────────────── */
label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--space-2);
    letter-spacing: -0.01em;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="datetime-local"],
input[type="file"],
textarea,
select {
    width: 100%;
    border: 1px solid var(--border);
    background: #0a0a0a;
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    min-height: 3rem;
    font: inherit;
    font-size: var(--font-size-body);
    letter-spacing: -0.022em;
    transition:
        border-color var(--duration) var(--ease-out),
        box-shadow var(--duration) var(--ease-out),
        background var(--duration) var(--ease-out);
}

input[type="email"]:hover,
input[type="password"]:hover,
input[type="text"]:hover,
input[type="datetime-local"]:hover,
textarea:hover,
select:hover {
    border-color: var(--border-strong);
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus,
input[type="datetime-local"]:focus,
input[type="file"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
}

textarea {
    resize: vertical;
    min-height: 6rem;
}

.form-row {
    margin-bottom: var(--space-5);
}

.form-row:last-of-type {
    margin-bottom: var(--space-6);
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 400;
    color: var(--text-secondary);
    cursor: pointer;
    min-height: 2.75rem;
}

.form-check input {
    width: auto;
    min-height: auto;
    accent-color: var(--accent);
}

.form-error,
.flash {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    margin-bottom: var(--space-4);
    font-size: 0.9375rem;
    line-height: 1.45;
    letter-spacing: -0.011em;
    transition:
        opacity var(--duration) var(--ease-out),
        transform var(--duration) var(--ease-out);
}

.flash-message {
    margin: 0;
    flex: 1 1 auto;
}

.flash-dismiss {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    margin: -0.25rem -0.2rem -0.25rem 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.55;
    transition:
        opacity var(--duration) var(--ease-out),
        background var(--duration) var(--ease-out);
}

.flash-dismiss:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
}

.flash.is-dismissing {
    opacity: 0;
    transform: translateY(-4px);
}

.flash-success {
    background: var(--success-soft);
    border: 1px solid color-mix(in srgb, var(--success) 28%, transparent);
    color: var(--success);
}

.flash-error,
.form-error {
    background: var(--danger-soft);
    border: 1px solid color-mix(in srgb, var(--danger) 28%, transparent);
    color: var(--danger);
}

.flash-warning {
    background: var(--warning-soft);
    border: 1px solid color-mix(in srgb, var(--warning) 28%, transparent);
    color: var(--warning);
}

.form-error {
    display: block;
}

.field-label {
    display: block;
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.form-row-nested {
    margin-bottom: var(--space-3) !important;
}

.flash code,
.hint code {
    font-size: 0.85em;
    padding: 0.1em 0.35em;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
}

.platform-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    list-style: none;
    padding: 0;
    margin: var(--space-2) 0 0;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-pill);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--text-secondary);
}

.chip-platform {
    gap: 0.45rem;
    padding-inline-start: 0.4rem;
}

.platform-cell {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.checkbox-grid {
    display: grid;
    gap: var(--space-2);
}

.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--text);
    font-size: 1.0625rem;
    font-weight: 400;
    margin: 0;
    padding: 0.7rem 0.9rem;
    min-height: 3rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    cursor: pointer;
    transition:
        border-color var(--duration) var(--ease-out),
        background var(--duration) var(--ease-out),
        box-shadow var(--duration) var(--ease-out);
}

.checkbox-grid label:hover {
    border-color: var(--border-strong);
    background: var(--bg-soft);
}

.checkbox-grid input {
    width: auto;
    min-height: auto;
    accent-color: var(--accent);
}

/* ── Platform cards & picker ────────────────────────────────────────────── */
.platform-card-grid {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .platform-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 960px) {
    .platform-card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.platform-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-5);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition:
        border-color var(--duration) var(--ease-out),
        box-shadow var(--duration) var(--ease-spring);
}

.platform-card.is-connected {
    border-color: color-mix(in srgb, var(--success) 35%, var(--border));
}

.platform-card.is-unconfigured {
    opacity: 0.92;
}

.platform-card-top {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.platform-card-title {
    min-width: 0;
    flex: 1;
}

.platform-card-title h2 {
    margin: 0 0 var(--space-2);
    font-size: 1.05rem;
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.platform-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

.platform-card-note {
    margin: 0;
    font-size: 0.85rem;
}

.platform-card-actions {
    margin-top: auto;
    padding-top: var(--space-1);
}

.chip-account {
    gap: 0.35rem;
}

.chip-account form {
    display: inline;
    margin: 0;
}

.platform-icon {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
}

.platform-icon .platform-logo {
    width: 1.15rem;
    height: 1.15rem;
}

.platform-icon-sm {
    width: 1.65rem;
    height: 1.65rem;
    font-size: 0.7rem;
}

.platform-icon-sm .platform-logo {
    width: 0.95rem;
    height: 0.95rem;
}

.platform-icon-lg {
    width: 2.75rem;
    height: 2.75rem;
}

.platform-icon-lg .platform-logo {
    width: 1.4rem;
    height: 1.4rem;
}

.platform-icon--youtube { background: rgba(255, 0, 0, 0.16); color: #ff6961; }
.platform-icon--tiktok { background: rgba(255, 255, 255, 0.08); color: #f5f5f7; }
.platform-icon--instagram { background: rgba(225, 48, 108, 0.18); color: #f472b6; }
.platform-icon--facebook { background: rgba(24, 119, 242, 0.18); color: #74a9ff; }
.platform-icon--linkedin { background: rgba(10, 102, 194, 0.18); color: #6cb2ff; }
.platform-icon--twitter { background: rgba(255, 255, 255, 0.08); color: #f5f5f7; }
.platform-icon--threads { background: rgba(255, 255, 255, 0.08); color: #f5f5f7; }
.platform-icon--bluesky { background: rgba(0, 133, 255, 0.18); color: #64b5ff; }
.platform-icon--pinterest { background: rgba(230, 0, 35, 0.16); color: #ff6b6b; }
.platform-icon--snapchat { background: rgba(255, 252, 0, 0.12); color: #ffe566; }
.platform-icon--telegram { background: rgba(34, 158, 217, 0.18); color: #6ec1e4; }
.platform-icon--line { background: rgba(6, 199, 85, 0.16); color: #4ade80; }
.platform-icon--whatsapp { background: rgba(18, 140, 126, 0.18); color: #4ade80; }
.platform-icon--discord { background: rgba(88, 101, 242, 0.2); color: #a5b4fc; }
.platform-icon--slack { background: rgba(74, 21, 75, 0.35); color: #f9a8d4; }
.platform-icon--mastodon { background: rgba(99, 100, 255, 0.2); color: #c4b5fd; }
.platform-icon--google_business { background: rgba(52, 168, 83, 0.16); color: #86efac; }
.platform-icon--vk { background: rgba(0, 119, 255, 0.18); color: #74a9ff; }
.platform-icon--vimeo { background: rgba(26, 183, 234, 0.16); color: #67e8f9; }
.platform-icon--dailymotion { background: rgba(0, 102, 220, 0.18); color: #93c5fd; }
.platform-icon--tumblr { background: rgba(54, 70, 93, 0.45); color: #cbd5e1; }
.platform-icon--teams { background: rgba(80, 89, 201, 0.22); color: #a5b4fc; }
.platform-icon--google_chat { background: rgba(0, 172, 71, 0.16); color: #86efac; }
.platform-icon--mattermost { background: rgba(0, 80, 140, 0.22); color: #7ebcf0; }
.platform-icon--rocketchat { background: rgba(245, 69, 92, 0.18); color: #f87171; }
.platform-icon--messenger { background: rgba(0, 132, 255, 0.18); color: #74a9ff; }
.platform-icon--viber { background: rgba(115, 96, 242, 0.2); color: #b39ddb; }
.platform-icon--matrix { background: rgba(255, 255, 255, 0.08); color: #f5f5f7; }

.redirect-hint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    background: var(--bg-muted);
    border: 1px solid var(--border);
    font-size: 0.75rem;
}

.redirect-hint-label {
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.redirect-hint-code {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.72rem;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
}

.platform-picker {
    display: grid;
    gap: var(--space-2);
    grid-template-columns: 1fr;
}

@media (min-width: 520px) {
    .platform-picker {
        grid-template-columns: repeat(2, 1fr);
    }
}

.platform-pick {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-muted);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.platform-pick:hover:not(.is-disabled) {
    border-color: var(--border-strong);
    background: var(--bg-elevated);
}

.platform-pick:has(input:checked) {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
    background: var(--accent-soft);
}

.platform-pick.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.platform-pick input {
    width: auto;
    margin: 0;
    accent-color: var(--accent);
}

.platform-pick-label {
    min-width: 0;
    line-height: 1.25;
}

.callback-list {
    display: grid;
    gap: var(--space-2);
    margin: var(--space-4) 0 var(--space-6);
}

.callback-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-muted);
}

.callback-meta {
    flex: 1;
    min-width: 12rem;
    display: grid;
    gap: 0.2rem;
}

.callback-meta strong {
    font-size: 0.85rem;
    text-transform: capitalize;
}

.admin-platform-group {
    margin-top: var(--space-6);
    padding-top: var(--space-5);
    border-top: 1px solid var(--border);
}

.admin-platform-group-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.admin-platform-group h3 {
    margin: 0;
    font-size: 1.05rem;
}

.callback-list--compact {
    margin: 0 0 var(--space-4);
}

.connector-readiness {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-2);
}

.connector-readiness li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.btn.is-copied {
    color: var(--success);
}

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    margin: 0 calc(-1 * var(--space-1));
    border-radius: var(--radius-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
    letter-spacing: -0.011em;
}

th,
td {
    text-align: left;
    padding: 0.85rem 0.7rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tbody tr {
    transition: background var(--duration) var(--ease-out);
}

tbody tr:hover {
    background: var(--bg-soft);
}

tbody tr:last-child td {
    border-bottom: none;
}

th {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-top: 0.4rem;
    padding-bottom: 0.6rem;
}

td a {
    font-weight: 550;
}

.data-table {
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th {
    background: color-mix(in srgb, var(--bg-muted) 80%, transparent);
    border-bottom-color: var(--border-strong);
}

.data-table tbody tr:nth-child(even) {
    background: color-mix(in srgb, var(--bg-muted) 55%, transparent);
}

.data-table tbody tr:hover {
    background: var(--bg-soft);
}

.cell-truncate {
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chip-compact {
    font-size: 0.72rem;
    padding: 0.15rem 0.45rem;
    margin: 0.1rem 0.15rem 0.1rem 0;
}

.page-count {
    font-family: var(--font-body);
    font-size: 0.55em;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0;
}

.is-unread {
    color: var(--accent-ink);
}

.admin-nav-grid {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .admin-nav-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.admin-nav-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-5);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    transition:
        border-color 0.15s ease,
        box-shadow 0.18s ease,
        transform 0.18s var(--ease-out);
}

.admin-nav-card:hover {
    text-decoration: none;
    color: inherit;
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.admin-nav-card:focus-visible {
    box-shadow: var(--focus-ring);
}

.admin-nav-card-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
}

.admin-nav-card-desc {
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.4;
}

.admin-settings-form {
    margin-top: var(--space-5);
    padding-top: var(--space-5);
    border-top: 1px solid var(--border);
}

/* ── Status pills ───────────────────────────────────────────────────────── */
.status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.015em;
    text-transform: capitalize;
    border: 1px solid transparent;
    background: var(--bg-soft);
    color: var(--text-secondary);
    line-height: 1.2;
    white-space: nowrap;
}

.status::before {
    content: "";
    width: 0.38rem;
    height: 0.38rem;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.9;
    flex-shrink: 0;
}

.status-success,
.status-scheduled {
    color: var(--success);
    background: var(--success-soft);
    border-color: color-mix(in srgb, var(--success) 22%, transparent);
}

.status-failed {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: color-mix(in srgb, var(--danger) 22%, transparent);
}

.status-partial,
.status-queued,
.status-pending {
    color: var(--warning);
    background: var(--warning-soft);
    border-color: color-mix(in srgb, var(--warning) 22%, transparent);
}

/* ── Empty states ───────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: var(--space-10) var(--space-5);
    border: 1px dashed color-mix(in srgb, var(--border-strong) 80%, transparent);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--bg-muted) 85%, var(--bg-elevated));
}

.empty-state-inset {
    border: none;
    background: transparent;
    padding: var(--space-8) var(--space-3);
}

.empty-state-icon {
    display: inline-grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    margin: 0 auto var(--space-4);
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 1.15rem;
    font-weight: 700;
    font-family: var(--font-display);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent);
}

.empty-state h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 var(--space-2);
    letter-spacing: -0.025em;
}

.empty-state p {
    margin: 0 auto var(--space-5);
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 28rem;
}

.empty-state p:last-child {
    margin-bottom: 0;
}

.empty-state .actions {
    justify-content: center;
}

/* ── Auth ───────────────────────────────────────────────────────────────── */
body.is-auth .topbar {
    margin-bottom: var(--space-4);
}

body.is-auth .site-footer {
    margin-top: auto;
}

.auth-shell {
    display: grid;
    place-items: center;
    min-height: calc(100dvh - var(--nav-h) - 8rem);
    padding: var(--space-4) 0 var(--space-8);
}

.auth-box {
    width: 100%;
    max-width: 26rem;
    margin: 0 auto;
    padding: var(--space-8) var(--space-6);
    border-radius: var(--radius-lg);
    box-shadow: none;
    animation: panel-in 0.55s var(--ease-out) both;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: var(--space-6);
}

.auth-brand .brand-mark {
    width: auto;
    height: 2.5rem;
    border-radius: 0;
    font-size: 0.7rem;
    background: transparent;
}

.auth-brand .brand-logo {
    height: 2.5rem;
    max-height: 2.5rem;
    max-width: 8rem;
}

.auth-brand .brand-wordmark {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.035em;
    color: var(--text);
}

.auth-box h1 {
    margin-bottom: var(--space-2);
    font-size: clamp(1.6rem, 3vw, 1.9rem);
    letter-spacing: -0.03em;
}

.auth-sub {
    margin: 0 0 var(--space-6);
    color: var(--muted);
    font-size: 0.975rem;
    line-height: 1.45;
}

.auth-box .btn-primary {
    width: 100%;
    justify-content: center;
    margin-top: var(--space-1);
}

.auth-secondary-form {
    margin-top: var(--space-3);
}

.auth-footer {
    margin-top: var(--space-6);
    padding-top: var(--space-5);
    border-top: 1px solid var(--border);
    font-size: 0.925rem;
    text-align: center;
}

.otp-input {
    font-size: 1.45rem !important;
    font-weight: 600;
    letter-spacing: 0.4em;
    text-align: center;
    font-variant-numeric: tabular-nums;
    padding-left: 0.9rem !important;
    padding-right: 0.5rem !important;
}

.hint {
    font-size: 0.825rem;
    color: var(--muted);
    margin-top: var(--space-5);
    line-height: 1.5;
}

.form-row .hint {
    margin-top: var(--space-2);
}

.form-divider-or {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-2) 0 var(--space-4);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.form-divider-or::before,
.form-divider-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.breadcrumb {
    margin: 0 0 var(--space-2);
    font-size: 0.825rem;
}

.breadcrumb a {
    color: var(--muted);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--accent-ink);
}

.account-hub {
    max-width: 36rem;
}

.account-hub-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.account-hub-list > li + li {
    border-top: 1px solid var(--border);
}

.account-hub-list a,
.account-hub-locale {
    display: grid;
    gap: 0.25rem;
    padding: var(--space-4) var(--space-2);
    margin: 0 calc(-1 * var(--space-2));
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}

.account-hub-list a:hover {
    background: var(--bg-muted);
    text-decoration: none;
}

.account-hub-list a:hover .account-hub-label {
    color: var(--accent-ink);
}

.account-hub-label {
    font-weight: 600;
    font-size: 1.02rem;
    letter-spacing: -0.01em;
}

.account-hub-desc {
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.45;
}

.account-hub-locales {
    margin: var(--space-2) 0 0;
    padding: 0;
    border: 0;
}

/* ── Locale / footer / cookie ───────────────────────────────────────────── */
.locale-switcher {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.locale-switcher a {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--muted) !important;
    padding: 0.35rem 0.65rem !important;
    border-radius: var(--radius-pill);
    text-decoration: none !important;
    border: 1px solid transparent;
}

.locale-switcher a:hover,
.locale-switcher a.active {
    color: var(--accent-ink) !important;
    background: var(--accent-soft) !important;
}

.locale-switcher a.active {
    border-color: rgba(10, 132, 255, 0.35);
}

/* Floating language switcher */
.locale-floating {
    position: fixed;
    z-index: 90;
    left: max(var(--space-3), env(safe-area-inset-left));
    bottom: max(var(--space-3), env(safe-area-inset-bottom));
    font-size: 0.875rem;
}

body:has(.cookie-banner) .locale-floating {
    bottom: max(7.5rem, calc(env(safe-area-inset-bottom) + 6.5rem));
}

.locale-floating-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.45rem 0.7rem 0.45rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--glass);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition:
        border-color var(--duration) var(--ease-out),
        box-shadow var(--duration) var(--ease-out),
        background var(--duration) var(--ease-out);
}

.locale-floating-trigger:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}

.locale-floating-trigger:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.locale-floating-globe {
    display: flex;
    flex-shrink: 0;
    color: var(--accent);
}

.locale-floating-label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
    text-align: left;
}

.locale-floating-title {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.locale-floating-current {
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.locale-floating-chevron {
    display: flex;
    flex-shrink: 0;
    opacity: 0.55;
    transition: transform var(--duration) var(--ease-out);
}

.locale-floating.is-open .locale-floating-chevron {
    transform: rotate(180deg);
}

.locale-floating-panel {
    position: absolute;
    left: 0;
    bottom: calc(100% + 10px);
    display: flex;
    flex-direction: column;
    min-width: min(16.5rem, calc(100vw - 1.5rem));
    max-width: min(20rem, calc(100vw - 1.5rem));
    max-height: min(70vh, 22rem);
    overflow: hidden;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    animation: panel-in 0.28s var(--ease-spring) both;
}

.locale-floating-panel[hidden] {
    display: none !important;
}

.locale-floating-list {
    list-style: none;
    margin: 0;
    padding: 0.35rem 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.locale-floating-list > li {
    margin: 0;
}

.locale-floating-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 1rem;
    color: var(--text-secondary) !important;
    font-weight: 500;
    text-decoration: none !important;
    transition: background 0.15s var(--ease-out), color 0.15s var(--ease-out);
}

.locale-floating-option:hover,
.locale-floating-option:focus-visible {
    background: var(--accent-soft);
    color: var(--text) !important;
    outline: none;
}

.locale-floating-option.is-current {
    color: var(--accent-ink) !important;
    font-weight: 600;
}

.locale-floating-option-label {
    line-height: 1.25;
}

.locale-floating-check {
    flex-shrink: 0;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.95rem;
}

html[dir="rtl"] .locale-floating {
    left: auto;
    right: max(var(--space-3), env(safe-area-inset-right));
}

html[dir="rtl"] .locale-floating-panel {
    left: auto;
    right: 0;
}

html[dir="rtl"] .locale-floating-label {
    align-items: flex-end;
    text-align: right;
}

html[dir="rtl"] .footer-brand {
    margin-right: 0;
    margin-left: auto;
}

.site-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3) var(--space-5);
    margin-top: var(--space-10);
    padding-top: var(--space-5);
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    margin-right: auto;
}

.footer-brand img {
    display: block;
    height: 2.25rem;
    width: auto;
    background: transparent;
    object-fit: contain;
}

.footer-brand:hover {
    text-decoration: none;
    opacity: 0.85;
}

.footer-copy {
    color: var(--muted);
    margin-left: auto;
}

.site-footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-5);
}

.site-footer a {
    color: var(--muted);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

body.is-landing .site-footer {
    position: relative;
    z-index: 1;
    margin-top: 0;
    padding: var(--space-5)
        max(var(--space-5), calc((100vw - var(--shell-max)) / 2 + var(--space-5)))
        var(--space-6);
}

.cookie-banner {
    position: fixed;
    z-index: 80;
    left: var(--space-4);
    right: auto;
    bottom: var(--space-4);
    max-width: 22rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    animation: panel-in 0.4s var(--ease-spring) both;
}

.cookie-banner p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.cookie-banner-actions {
    display: flex;
    justify-content: flex-end;
}

.cookie-banner-actions .btn {
    min-width: 8.5rem;
}

html[dir="rtl"] .cookie-banner {
    left: auto;
    right: var(--space-4);
}

@media (max-width: 719px) {
    .cookie-banner {
        left: var(--space-3);
        right: var(--space-3);
        max-width: none;
        bottom: var(--space-3);
    }

    html[dir="rtl"] .cookie-banner {
        left: var(--space-3);
        right: var(--space-3);
    }

    body:has(.cookie-banner) .locale-floating {
        bottom: max(9rem, calc(env(safe-area-inset-bottom) + 8rem));
    }
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
    align-items: center;
    margin: var(--space-3) 0 var(--space-5);
    font-size: 0.875rem;
    color: var(--muted);
}

.caption-body {
    font-size: 1rem;
    line-height: 1.55;
    margin: 0 0 var(--space-5);
    white-space: pre-wrap;
}

/* Legal / privacy docs — explicit light ink on dark panels (never inherit black) */
.privacy-doc {
    color: var(--text);
}

.privacy-doc h1,
.privacy-doc h2,
.privacy-doc h3,
.privacy-doc strong {
    color: var(--text);
}

.privacy-doc h2 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: var(--space-6) 0 var(--space-3);
}

.privacy-doc p,
.privacy-doc li {
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 46rem;
}

.privacy-doc a {
    color: var(--accent);
}

.privacy-doc a:hover {
    color: var(--accent-hover);
}

.privacy-doc .muted {
    color: var(--muted);
}

/* No-JS / failed Stimulus: never leave legal content at opacity 0 */
@media (scripting: none) {
    [data-reveal] {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
    }

    .landing-visual,
    .landing-visual-glow {
        animation: none !important;
        opacity: 1;
        transform: none;
        filter: none;
    }

    .btn.is-loading::before {
        animation: none !important;
        border-right-color: currentColor;
        opacity: 0.5;
    }
}
