/* Unseen Identity — 2026 Design System (High-Contrast Dark + Light, Fluid Typography, Accessible Primitives) */
:root {
    color-scheme: light;
    --brand: #059669;
    --brand-hover: #047857;
    --brand-soft: rgba(5, 150, 105, 0.12);
    --brand-text: #FFFFFF;
    --text: #0F172A;
    --muted: #64748B;
    --border: #E2E8F0;
    --error: #DC2626;
    --success: #10B981;
    --bg: #F4F7FB;
    --surface: #FFFFFF;
    --surface-subtle: #F8FAFC;
    --secondary-bg: #F1F5F9;
    --notice-bg: #ECFDF5;
    --notice-border: #A7F3D0;
    --alert-bg: #FEF2F2;
    --alert-border: #FECACA;
    --shadow: 0 12px 32px -12px rgba(15, 23, 42, 0.12), 0 1px 3px rgba(15, 23, 42, 0.05);
}

html.dark {
    color-scheme: dark;
    --brand: #10B981;
    --brand-hover: #059669;
    --brand-soft: rgba(16, 185, 129, 0.16);
    --brand-text: #042F2E;
    --text: #F1F5F9;
    --muted: #94A3B8;
    --border: rgba(148, 163, 184, 0.18);
    --error: #F87171;
    --success: #34D399;
    --bg: #080D17;
    --surface: #0F172A;
    --surface-subtle: #162033;
    --secondary-bg: #1E293B;
    --notice-bg: rgba(16, 185, 129, 0.12);
    --notice-border: rgba(16, 185, 129, 0.35);
    --alert-bg: rgba(244, 63, 94, 0.12);
    --alert-border: rgba(244, 63, 94, 0.35);
    --shadow: 0 20px 45px -16px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

body.auth {
    background:
        radial-gradient(60% 50% at 50% 0%, var(--brand-soft), transparent 70%),
        var(--bg);
}

a { color: var(--brand); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-width: 0; }
.brand-name { font-weight: 800; letter-spacing: -0.02em; font-size: clamp(0.95rem, 1.2vw, 1.05rem); white-space: nowrap; }
.logo { display: block; height: 34px; width: 34px; border-radius: 10px; }
.theme-toggle {
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--secondary-bg);
    color: var(--text);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}
body.auth .topbar { display: none; }

.user-menu { position: relative; }
.user-menu summary { display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 10px; cursor: pointer; list-style: none; border: 1px solid var(--border); background: var(--surface); }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover, .user-menu[open] summary { background: var(--secondary-bg); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; color: var(--brand-text); background: var(--brand); font-weight: 700; font-size: 0.85rem; }
.user-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.875rem; font-weight: 600; }
.user-menu-items { position: absolute; right: 0; z-index: 20; min-width: 190px; margin-top: 6px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.user-menu-items a { display: block; padding: 9px 12px; color: var(--text); border-radius: 8px; text-decoration: none; font-size: 0.875rem; font-weight: 500; }
.user-menu-items a:hover { background: var(--secondary-bg); }

.content { flex: 1; display: flex; justify-content: center; align-items: flex-start; padding: clamp(24px, 5vw, 56px) 16px; }
body.auth .content { align-items: center; }

.card {
    width: 100%;
    max-width: 440px;
    padding: clamp(24px, 4vw, 36px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.card-logo { display: block; height: 48px; width: 48px; margin: 0 auto 20px; border-radius: 14px; }
body.auth .card h1 { text-align: center; }
.card h1 { margin: 0 0 12px; font-size: clamp(1.35rem, 2.2vw, 1.65rem); font-weight: 800; letter-spacing: -0.02em; }
.card h2 { margin: 24px 0 8px; font-size: 1.05rem; font-weight: 700; }

.scopes { margin: 0; padding: 0; list-style: none; }
.scopes li { margin-bottom: 10px; }
.scopes label { margin: 0; }
.scopes p { margin: 2px 0 0 26px; font-size: .85rem; }

label { display: block; margin: 16px 0 6px; font-weight: 600; font-size: 0.85rem; color: var(--text); }
label.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }

input:not([type]), input[type=text], input[type=password], input[type=email], input[type=tel], input[type=number], textarea, select {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-top: 4px;
    padding: 11px 14px;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
    outline: none;
}
textarea { min-height: 80px; resize: vertical; }

.actions { display: flex; gap: 10px; margin-top: 24px; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    font: inherit;
    font-size: 0.925rem;
    font-weight: 700;
    color: var(--brand-text);
    background: var(--brand);
    border: 1px solid transparent;
    border-radius: 12px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 150ms ease, transform 100ms ease;
}
.button:hover { background: var(--brand-hover); }
.button.secondary { color: var(--text); background: var(--secondary-bg); border-color: var(--border); }
.button.secondary:hover { filter: brightness(0.96); }
.auth .actions .button:first-child { flex: 1; text-align: center; }
.passkey-button { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border: 1px solid var(--border); }
.passkey-button svg { flex: none; }
.or-divider { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; color: var(--muted); font-size: .82rem; font-weight: 600; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

.alert, .validation-summary-errors { color: var(--error); font-size: 0.875rem; }
p.alert, div.alert.validation-summary-errors { padding: 12px 14px; background: var(--alert-bg); border: 1px solid var(--alert-border); border-radius: 12px; }
.validation-summary-valid { display: none; }
.field-error { color: var(--error); font-size: .8rem; margin-top: 4px; display: block; }
.notice { padding: 12px 14px; background: var(--notice-bg); border: 1px solid var(--notice-border); border-radius: 12px; font-size: 0.875rem; }
.muted { color: var(--muted); font-size: 0.875rem; }
.signout-frame { display: none; }

.footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 24px; padding: 18px 16px; color: var(--muted); font-size: .82rem; }
.language { display: inline-flex; gap: 10px; }
.language button { padding: 0; color: var(--brand); background: none; border: 0; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

[hidden] { display: none !important; }

.manage { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start; width: 100%; max-width: 980px; }
.manage-content { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.manage-content .card, .card.wide { max-width: none; }
.manage-nav { display: flex; flex-direction: column; gap: 4px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.manage-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: var(--text); border-radius: 10px; text-decoration: none; font-size: 0.875rem; font-weight: 500; }
.manage-nav a svg { flex: none; color: var(--muted); }
.manage-nav a:hover { background: var(--secondary-bg); }
.manage-nav a.active { font-weight: 700; color: var(--brand); background: var(--brand-soft); }
.manage-nav a.active svg { color: var(--brand); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; border: 1px solid transparent; }
.badge-on { color: var(--success); background: var(--notice-bg); border-color: var(--notice-border); }
.badge-off { color: var(--muted); background: var(--surface-subtle); border-color: var(--border); }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
@media (max-width: 720px) {
    .content { padding: 20px 14px; }
    .card { padding: 24px 18px; border-radius: 16px; }
    .manage { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .manage-nav { flex-direction: row; overflow-x: auto; }
    .manage-nav a { flex: none; white-space: nowrap; }
    .user-name { display: none; }
}
.profile { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0 0 16px; font-size: 0.9rem; }
.profile dt { font-weight: 600; color: var(--muted); }
.profile dd { margin: 0; font-weight: 500; }
.steps { padding-left: 20px; }
.steps li { margin-bottom: 16px; }
.qr-code { display: block; width: 200px; height: 200px; margin: 12px 0; image-rendering: pixelated; border-radius: 12px; background: #fff; padding: 8px; }
kbd { padding: 2px 6px; font-family: Consolas, monospace; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 6px; }
.recovery-codes ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 12px 0; padding: 0; list-style: none; }
.recovery-codes kbd { display: block; padding: 8px 10px; text-align: center; }
.links { padding-left: 20px; }
.links li { margin-bottom: 8px; }
.grant { padding: 16px 0; border-top: 1px solid var(--border); }
.grant h2 { margin: 0 0 4px; }
.grant p { margin: 4px 0; }
.grant form { margin-top: 8px; }
.passkeys, .linked-accounts, .sessions { margin: 0 0 16px; padding: 0; list-style: none; }
.passkeys li, .linked-accounts li, .sessions li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 8px; padding: 12px 16px; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 12px; }
.sessions li.current { border-color: var(--notice-border); }
.passkey-name, .linked-provider, .session-browser { font-weight: 700; }
.passkeys form { margin-left: auto; }
.linked-accounts li > form, .linked-accounts li > p, .sessions li > form, .sessions li > p { flex-basis: 100%; margin: 8px 0 0; }
.linked-accounts form .button, .sessions form .button, .link-form .button, #close-other-sessions .button { margin-top: 12px; }
.link-form { margin-bottom: 16px; }
.portal { width: 100%; max-width: 920px; }
.portal h1 { margin: 0 0 8px; font-size: clamp(1.4rem, 2.5vw, 1.8rem); font-weight: 800; letter-spacing: -0.02em; }
.portal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin: 24px 0; }
.portal-card { display: flex; flex-direction: column; gap: 6px; padding: 22px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; text-decoration: none; box-shadow: var(--shadow); transition: border-color 150ms ease, transform 150ms ease; }
.portal-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.portal-icon { color: var(--brand); }
.portal-title { font-weight: 700; font-size: 1.05rem; }
.portal-help { color: var(--muted); font-size: .85rem; }
.passkey-login, .external-login { margin-top: 24px; }
.external-button { display: flex; width: 100%; margin-bottom: 8px; border: 1px solid var(--border); text-align: center; }
.developers { max-width: 1200px; }
.developer-toc { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; }
.developer-toc a { font-size: .875rem; }
.developer-toc a.guide-switch { font-weight: 700; color: var(--brand); border-bottom: 1px solid var(--border); }
.developer-guide { line-height: 1.65; overflow-wrap: break-word; }
.developer-guide h1 { margin: 0 0 16px; font-size: 1.6rem; }
.developer-guide h2 { margin: 36px 0 12px; padding-top: 16px; font-size: 1.25rem; border-top: 1px solid var(--border); scroll-margin-top: 76px; }
.developer-guide h3 { margin: 24px 0 8px; font-size: 1.05rem; scroll-margin-top: 76px; }
.developer-guide table { display: block; max-width: 100%; overflow-x: auto; margin: 12px 0 16px; border-collapse: collapse; font-size: .9rem; }
.developer-guide th, .developer-guide td { padding: 8px 12px; text-align: left; border: 1px solid var(--border); }
.developer-guide th { background: var(--surface-subtle); }
.developer-guide code { padding: 2px 6px; font-family: Consolas, monospace; font-size: .85em; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 6px; }
.developer-guide pre { margin: 12px 0 16px; padding: 14px 16px; overflow-x: auto; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 12px; line-height: 1.5; }
.developer-guide pre code { padding: 0; background: none; border: 0; }
.developer-guide blockquote { margin: 16px 0; padding: 12px 16px; background: var(--alert-bg); border: 1px solid var(--alert-border); border-radius: 12px; }
.account-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.account-item { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface-subtle); }
.account-item[hidden] { display: none; }
.account-choose-form { flex: 1; min-width: 0; margin: 0; }
.account-choose { flex: 1; width: 100%; min-width: 0; display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; background: none; border: 0; padding: 0; font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.account-forget { margin: 0; }
.link-button { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font: inherit; font-size: 0.8rem; text-decoration: underline; }
.remember-login { margin: 16px 0 0; }


/* --- 2026 Modern Consumer Auth & Portal Enhancements --- */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    color: var(--muted);
    background: var(--secondary-bg);
    border: 1px solid var(--border);
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    white-space: nowrap;
}

.topbar-pill:hover {
    color: var(--text);
    border-color: var(--brand);
}

.topbar-pill.accent {
    color: var(--brand);
    background: var(--brand-soft);
    border-color: color-mix(in srgb, var(--brand) 35%, transparent);
}

.auth-card {
    max-width: 430px;
    width: 100%;
    padding: 32px 28px;
    border-radius: 24px;
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--brand) 12%, transparent);
}

.auth-header {
    text-align: center;
    margin-bottom: 22px;
}

.auth-header .card-logo {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    margin: 0 auto 12px;
    display: block;
    object-fit: contain;
}

.auth-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--muted);
}

.label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.label-link {
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.label-link:hover {
    text-decoration: underline;
}

.alt-login-stack {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alt-login-form {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.external-button,
.passkey-button {
    width: 100%;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 12px;
    font-weight: 600;
}

.google-button {
    background: var(--surface-subtle);
    border: 1px solid var(--border);
}

.google-button:hover {
    border-color: var(--brand);
}

.auth-footer-links {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}

.auth-footer-links a {
    text-decoration: none;
}

.auth-footer-links a:hover {
    text-decoration: underline;
}

.auth-footer-links .muted-link {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
}

.auth-sub-link {
    margin: 8px 0 0;
    text-align: center;
    font-size: 12px;
}

.portal-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.portal-avatar-lg {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: var(--brand-soft);
    color: var(--brand);
    border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    flex-shrink: 0;
}

.portal-hero h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.portal-hero .muted {
    margin: 2px 0 0;
}

.portal-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.portal-card-admin {
    border-color: color-mix(in srgb, var(--brand) 40%, transparent);
    background: linear-gradient(135deg, var(--brand-soft), var(--surface));
}

.portal-actions {
    margin-top: 24px;
}

.footer .language {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.footer .language button {
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    opacity: 0.72;
    transition: opacity 0.15s, background 0.15s;
}

.footer .language button:hover,
.footer .language button.active-lang {
    opacity: 1;
    background: var(--brand-soft);
    color: var(--brand);
}

@media (max-width: 640px) {
    .topbar {
        padding: 10px 14px;
    }
    .topbar-pill span {
        display: none;
    }
    .auth-card {
        padding: 24px 18px;
        border-radius: 20px;
    }
    .portal-hero {
        gap: 12px;
    }
    .portal-avatar-lg {
        width: 46px;
        height: 46px;
        font-size: 18px;
    }
    .portal-hero h1 {
        font-size: 21px;
    }
    .manage-layout {
        grid-template-columns: 1fr;
    }
    .manage-nav {
        display: flex;
        overflow-x: auto;
        gap: 6px;
        padding: 8px;
    }
    .manage-nav a {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* Per-client branding polish & Caps Lock indicator */
.auth-card {
    position: relative;
    overflow: hidden;
}
.auth-card.has-client::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 65%, white));
}
.card-logo-wrap {
    width: 56px;
    height: 56px;
    margin: 0 auto 0.75rem;
    border-radius: 16px;
    background: var(--brand-soft);
    border: 1px solid color-mix(in srgb, var(--brand) 32%, transparent);
    display: grid;
    place-items: center;
    box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--brand) 55%, transparent);
}
.card-logo-wrap .card-logo {
    width: 34px;
    height: 34px;
    margin: 0;
    object-fit: contain;
    border-radius: 8px;
}
.auth-app-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.65rem;
    margin-bottom: 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--brand);
    background: var(--brand-soft);
    border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
}
.caps-lock-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.4rem;
    padding: 0.3rem 0.65rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #b45309;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.35);
}
html.dark .caps-lock-hint {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(251, 191, 36, 0.32);
}
.caps-lock-hint[hidden] {
    display: none;
}

/* Modern Unseen Consumer Account Hub & Horizontal Manage Tabs (Non-Corporate Redesign) */
.hub-shell {
    max-width: 780px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.hub-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.5rem 1.75rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    background:
        radial-gradient(80% 120% at 0% 0%, var(--brand-soft), transparent 65%),
        var(--surface);
    box-shadow: var(--shadow);
}
.hub-banner-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}
.hub-avatar {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--brand-text);
    background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #0f172a));
    box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--brand) 65%, transparent);
    flex-shrink: 0;
}
.hub-kicker {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand);
    margin-bottom: 0.15rem;
}
.hub-banner-meta h1 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.2;
}
.hub-banner-meta p {
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
}
.hub-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.hub-banner-actions .button {
    width: auto;
    padding: 0.55rem 1rem;
    font-size: 0.86rem;
}

.hub-list-card {
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.hub-row {
    display: flex;
    align-items: center;
    gap: 0.95rem;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
}
.hub-row:last-child {
    border-bottom: 0;
}
.hub-row:hover {
    background: var(--brand-soft);
}
.hub-row-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--brand-soft);
    color: var(--brand);
    flex-shrink: 0;
}
.hub-row-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.hub-row-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}
.hub-row-desc {
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.35;
}
.hub-row-chevron {
    color: var(--muted);
    flex-shrink: 0;
    transition: transform 0.15s ease, color 0.15s ease;
}
.hub-row:hover .hub-row-chevron {
    color: var(--brand);
    transform: translateX(3px);
}

/* Horizontal Segmented Manage Layout (replaces corporate left sidebar) */
.manage {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 1.15rem !important;
    max-width: 820px !important;
    margin: 0 auto !important;
}
.manage-nav {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0.35rem !important;
    width: 100% !important;
    padding: 0.4rem !important;
    border-radius: 16px !important;
    border: 1px solid var(--border) !important;
    background: var(--surface) !important;
    overflow-x: auto !important;
    scrollbar-width: none;
}
.manage-nav::-webkit-scrollbar { display: none; }
.manage-nav a {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    padding: 0.55rem 0.9rem !important;
    border-radius: 11px !important;
    font-size: 0.84rem !important;
    gap: 0.45rem !important;
}
.manage-nav a svg {
    width: 16px;
    height: 16px;
}
.manage-content {
    width: 100% !important;
    max-width: none !important;
}
.manage-content > .card.wide {
    max-width: none !important;
    border-radius: 20px !important;
}

/* Redesigned Profile Card */
.profile-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}
.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--brand-text);
    background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #0f172a));
    flex-shrink: 0;
}
.profile-head-meta h1 {
    margin: 0;
    font-size: 1.3rem;
}
.profile-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.25rem;
}
.profile-handle {
    font-size: 0.84rem;
    color: var(--muted);
    font-weight: 600;
}
.profile-status {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
}
.profile-status.is-ok {
    color: #10b981;
    background: rgba(16, 185, 129, 0.14);
}
.profile-status.is-warn {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.14);
}
.profile-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}
.profile-tile {
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 60%, var(--bg));
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.profile-tile-label {
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.profile-tile-value {
    font-size: 0.94rem;
    font-weight: 600;
    color: var(--text);
    word-break: break-word;
}
@media (max-width: 600px) {
    .profile-tiles {
        grid-template-columns: 1fr;
    }
    .hub-banner {
        padding: 1.25rem;
    }
}

/* Password input right-edge Caps Lock icon & show/hide eye */
.pw-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.pw-input-wrap input {
    width: 100%;
    padding-right: 4.4rem !important;
    margin-bottom: 0;
}
.pw-controls {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.pw-caps-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    color: #b45309;
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.45);
}
html.dark .pw-caps-badge {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(251, 191, 36, 0.4);
}
.pw-caps-badge[hidden] {
    display: none;
}
.pw-eye-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}
.pw-eye-btn:hover {
    color: var(--text);
    background: var(--brand-soft);
}

/* Avatar images & uploader + full-fit desktop tabs */
.manage {
    max-width: 940px !important;
}
.manage-nav a {
    padding: 0.48rem 0.75rem !important;
    font-size: 0.82rem !important;
    gap: 0.4rem !important;
}
.avatar-img,
.hub-avatar-img,
.profile-avatar-img {
    object-fit: cover;
    display: block;
}
.profile-avatar-block {
    flex-shrink: 0;
}
.profile-avatar-picker {
    position: relative;
    display: block;
    width: 72px;
    height: 72px;
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    margin: 0;
}
.profile-avatar-picker .profile-avatar,
.profile-avatar-picker .profile-avatar-img {
    width: 72px;
    height: 72px;
    border-radius: 18px;
}
.profile-avatar-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, 0.56);
    color: #fff;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.profile-avatar-picker:hover .profile-avatar-overlay {
    opacity: 1;
}
.profile-avatar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.65rem;
}
.inline-form {
    display: inline-flex;
    margin: 0;
}
.btn-xs {
    width: auto !important;
    padding: 0.35rem 0.75rem !important;
    font-size: 0.78rem !important;
    line-height: 1.2;
    margin: 0 !important;
}

/* Smooth STS navigation, card & menu transitions */
@view-transition {
    navigation: auto;
}
@keyframes unseenFadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes unseenDropIn {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.card,
.hub-banner,
.hub-list-card {
    animation: unseenFadeUp 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.user-menu[open] .user-menu-items {
    animation: unseenDropIn 0.16s cubic-bezier(0.16, 1, 0.3, 1) both;
    transform-origin: top right;
}
.manage-nav a,
.button,
.topbar-pill,
.theme-toggle,
.profile-tile,
.hub-row {
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.16s ease, box-shadow 0.18s ease;
}
.button:active {
    transform: scale(0.985);
}
.manage-nav a:hover:not(.active) {
    background: var(--brand-soft);
    color: var(--text);
}
.profile-tile:hover {
    border-color: color-mix(in srgb, var(--brand) 38%, var(--border));
}
@media (prefers-reduced-motion: reduce) {
    .card, .hub-banner, .hub-list-card, .user-menu[open] .user-menu-items {
        animation: none;
    }
}
