.bd-auth-wrapper {
    direction: rtl;
    padding: 28px 16px 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 88vh;
    background:
        radial-gradient(ellipse at 15% 20%, rgba(37, 99, 235, 0.14), transparent 50%),
        radial-gradient(ellipse at 85% 10%, rgba(15, 118, 110, 0.13), transparent 48%),
        radial-gradient(ellipse at 50% 80%, rgba(99, 102, 241, 0.08), transparent 60%),
        linear-gradient(160deg, var(--bd-bg-start, #eef4ff) 0%, var(--bd-bg-end, #f4f8ff) 55%, #ffffff 100%);
}

.bd-auth-shell {
    width: min(1020px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr);
    gap: 20px;
    align-items: stretch;
}

.bd-auth-brand {
    position: relative;
    overflow: hidden;
    padding: 28px 26px;
    border-radius: 24px;
    color: #fff;
    background:
        linear-gradient(155deg, rgba(7, 20, 34, 0.94), rgba(15, 53, 80, 0.92)),
        linear-gradient(135deg, var(--bd-primary, #0f766e), var(--bd-secondary, #2563eb));
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.bd-auth-brand::after {
    content: "";
    position: absolute;
    inset: auto -20% -30% auto;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 68%);
    pointer-events: none;
}

.bd-auth-brand-badge {
    display: inline-flex;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.4px;
}

.bd-auth-brand-title {
    margin: 16px 0 10px;
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
    line-height: 1.55;
    color: #fff;
}

.bd-auth-brand-copy {
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 14px;
    line-height: 1.95;
}

.bd-auth-brand-list {
    list-style: none;
    margin: 22px 0 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.bd-auth-brand-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    line-height: 1.8;
}

.bd-auth-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    flex-shrink: 0;
}

.bd-auth-brand-icon svg {
    width: 12px;
    height: 12px;
    display: block;
}

.bd-auth-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 26px;
    box-shadow: 0 28px 70px rgba(18, 32, 64, 0.13), 0 4px 16px rgba(18, 32, 64, 0.06);
    padding: 32px 30px 28px;
    border: 1px solid rgba(220, 230, 245, 0.98);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.bd-auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--bd-primary, #0f766e), var(--bd-secondary, #2563eb));
    border-radius: 26px 26px 0 0;
}

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

.bd-auth-title {
    margin: 16px 0 6px;
    font-size: clamp(1.2rem, 2vw, 1.45rem);
    color: #0f172a;
    line-height: 1.45;
}

.bd-auth-subtitle {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.8;
}

.bd-auth-tabs {
    display: flex;
    gap: 6px;
    background: rgba(241, 245, 249, 0.95);
    padding: 5px;
    border-radius: 16px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.04);
}

.bd-auth-tab {
    border: none;
    background: transparent;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    color: #64748b;
    border-radius: 12px;
    transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
    letter-spacing: 0.01em;
    min-height: 40px;
}

.bd-auth-tab.is-active {
    background: linear-gradient(135deg, var(--bd-primary, #0f766e), var(--bd-secondary, #2563eb));
    color: #fff;
    box-shadow: 0 8px 20px rgba(15, 118, 110, 0.26), 0 2px 6px rgba(15, 118, 110, 0.14);
}

.bd-auth-body {
    display: grid;
    gap: 18px;
}

.bd-auth-panel {
    display: none;
    animation: bdFadeIn 0.35s ease;
}

.bd-auth-panel.is-active {
    display: grid;
    gap: 14px;
}

.bd-auth-field {
    display: grid;
    gap: 8px;
}

.bd-auth-panel label,
.bd-auth-field label {
    font-weight: 700;
    font-size: 13px;
    color: #334155;
}

.bd-auth-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1.5px solid #dbe3ef;
    border-radius: 14px;
    background: #f8fafc;
    transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
    min-height: 50px;
}

.bd-auth-input-wrap:focus-within {
    border-color: rgba(15, 118, 110, 0.6);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1), 0 2px 8px rgba(15, 118, 110, 0.08);
}

.bd-auth-input-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    opacity: 0.8;
    flex-shrink: 0;
}

.bd-auth-input-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.bd-auth-panel input,
.bd-auth-passkey-row input {
    width: 100%;
    border: none;
    background: transparent;
    border-radius: 0;
    padding: 13px 0;
    font-size: 15px;
    color: #0f172a;
    letter-spacing: 0.01em;
}

.bd-auth-panel input[type="tel"],
.bd-auth-panel input[name*="phone"] {
    direction: ltr;
    text-align: right;
    font-size: 15px;
    letter-spacing: 0.03em;
}

.bd-auth-panel input:focus,
.bd-auth-passkey-row input:focus {
    outline: none;
    box-shadow: none;
}

.bd-auth-panel input::placeholder {
    color: #94a3b8;
    font-size: 13px;
}

.bd-auth-btn {
    border: none;
    border-radius: 14px;
    padding: 13px 18px;
    font-size: 14px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--bd-primary, #0f766e), var(--bd-secondary, #2563eb));
    color: #fff;
    cursor: pointer;
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease, filter 0.15s ease;
    min-height: 50px;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}

.bd-auth-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    transition: background 0.15s ease;
}

.bd-auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(15, 118, 110, 0.28), 0 4px 10px rgba(15, 118, 110, 0.16);
    filter: brightness(1.04);
}

.bd-auth-btn:active {
    transform: translateY(0);
    filter: brightness(0.97);
}

.bd-auth-secondary {
    background: #fff;
    border: 1px solid rgba(15, 118, 110, 0.35);
    color: var(--bd-primary, #0f766e);
    box-shadow: none;
}

.bd-auth-otp {
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    padding: 14px;
    background: #f8fafc;
}

.bd-auth-otp-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.bd-auth-otp-row input {
    flex: 1;
    min-width: 200px;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
}

.bd-auth-passkey {
    margin-top: 10px;
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(236, 253, 248, 0.96), rgba(235, 244, 255, 0.96));
    border: 1px solid rgba(153, 246, 228, 0.5);
    box-shadow: inset 0 1px 3px rgba(15, 118, 110, 0.06);
}

.bd-auth-passkey-head h4 {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bd-auth-passkey-head p {
    margin: 0 0 14px;
    font-size: 12.5px;
    color: #64748b;
    line-height: 1.8;
}

.bd-auth-passkey-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    padding: 0 12px;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    background: #fff;
}

.bd-auth-passkey-row input {
    flex: 1;
    min-width: 200px;
}

.bd-auth-passkey-btn {
    flex-shrink: 0;
}

.bd-auth-footer {
    margin-top: 18px;
    text-align: center;
}

.bd-auth-hint {
    color: #94a3b8;
    font-size: 12px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.bd-auth-hint-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.bd-auth-hint-icon svg {
    width: 14px;
    height: 14px;
    display: block;
}

.bd-auth-alert {
    min-height: 22px;
    font-size: 13px;
    color: #be123c;
    margin-bottom: 6px;
}

.bd-auth-alert[aria-live],
.bd-profile-alert[aria-live] {
    border-radius: 10px;
    padding: 8px 12px;
    transition: background 0.2s ease, color 0.2s ease;
}

.bd-auth-alert[aria-live]:not(:empty),
.bd-profile-alert[aria-live]:not(:empty) {
    background: var(--bd-ui-danger-soft, rgba(214, 69, 104, 0.12));
    border: 1px solid rgba(214, 69, 104, 0.18);
}

.bd-auth-alert[aria-live].is-success,
.bd-profile-alert[aria-live].is-success {
    color: var(--bd-ui-success, #1da97c);
    background: var(--bd-ui-success-soft, rgba(29, 169, 124, 0.13));
    border-color: rgba(29, 169, 124, 0.2);
}

.bd-auth-alert.is-success {
    color: #0f766e;
}

.bd-recaptcha {
    margin: 12px auto 10px;
    display: flex;
    justify-content: center;
}

.bd-auth-message {
    direction: rtl;
    text-align: center;
    padding: 18px;
    background: #fff7e8;
    border: 1px solid #ffd7a5;
    border-radius: 12px;
    font-family: inherit;
}

.bd-auth-gate-wrapper {
    direction: rtl;
    display: flex;
    justify-content: center;
    padding: 28px 16px 44px;
    min-height: 50vh;
    background:
        radial-gradient(ellipse at 15% 20%, rgba(42, 109, 246, 0.1), transparent 50%),
        radial-gradient(ellipse at 85% 10%, rgba(29, 169, 124, 0.08), transparent 48%),
        linear-gradient(160deg, var(--bd-bg-start, #eef4ff) 0%, var(--bd-bg-end, #f4f8ff) 55%, #ffffff 100%);
}

.bd-auth-gate {
    width: min(480px, 100%);
    text-align: center;
    padding: 32px 28px 28px;
    border-radius: var(--bd-ui-radius-lg, 22px);
    border: 1px solid var(--bd-ui-border, rgba(255, 255, 255, 0.78));
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(244, 248, 255, 0.88));
    box-shadow: var(--bd-ui-shadow, 0 24px 60px rgba(22, 40, 72, 0.14));
}

.bd-auth-gate-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 999px;
    color: var(--bd-ui-primary, #2a6df6);
    background: var(--bd-ui-primary-soft, rgba(42, 109, 246, 0.12));
    border: 1px solid rgba(42, 109, 246, 0.16);
}

.bd-auth-gate-icon svg {
    display: block;
    width: 32px;
    height: 32px;
}

.bd-auth-gate-title {
    margin: 0 0 10px;
    font-size: clamp(1.15rem, 2vw, 1.35rem);
    line-height: 1.55;
    color: var(--bd-ui-title, #102944);
}

.bd-auth-gate-message {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.9;
    color: var(--bd-ui-text-soft, #5f7593);
}

.bd-auth-gate-message a {
    color: var(--bd-ui-primary, #2a6df6);
    font-weight: 700;
    text-decoration: none;
}

.bd-auth-gate-message a:hover {
    text-decoration: underline;
}

.bd-auth-gate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 160px;
    padding: 0 22px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--bd-ui-primary, #2a6df6), var(--bd-ui-primary-strong, #1c57cb));
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 14px 28px rgba(42, 109, 246, 0.22);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.bd-auth-gate-btn:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(42, 109, 246, 0.28);
}

.bd-auth-gate-btn:focus-visible {
    outline: none;
    box-shadow: var(--bd-ui-shadow-focus, 0 0 0 4px rgba(42, 109, 246, 0.14));
}

.bd-profile-wrapper {
    --bd-glass-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.45));
    --bd-glass-border: rgba(255, 255, 255, 0.56);
    --bd-surface-border: rgba(122, 140, 186, 0.24);
    --bd-shadow-soft: 0 18px 44px rgba(22, 30, 58, 0.14);
    --bd-shadow-subtle: 0 10px 24px rgba(22, 30, 58, 0.1);
    --bd-text-primary: #19233f;
    --bd-text-secondary: #4e5c80;
    --bd-accent: #226b5d;
    --bd-sidebar-width: 292px;
    direction: rtl;
    padding: 28px 16px 40px;
    display: flex;
    justify-content: center;
    background:
        radial-gradient(circle at 12% 14%, rgba(130, 97, 255, 0.2), transparent 48%),
        radial-gradient(circle at 86% 8%, rgba(35, 184, 123, 0.2), transparent 42%),
        linear-gradient(160deg, var(--bd-bg-start, #f3f6ff) 0%, var(--bd-bg-end, #fdf2f8) 60%, #edf2ff 100%);
    font-size: clamp(13px, 1.3vw, 16px);
}

.bd-profile-layout {
    display: grid;
    grid-template-columns: var(--bd-sidebar-width) minmax(0, 1fr);
    grid-template-areas: "sidebar main";
    gap: 22px;
    width: min(1180px, 100%);
    align-items: start;
}

.bd-profile-sidebar {
    grid-area: sidebar;
    width: 100%;
    flex-shrink: 0;
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border-radius: 22px;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.82), rgba(248, 251, 255, 0.66));
    border: 1px solid var(--bd-glass-border);
    box-shadow: var(--bd-shadow-soft);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    max-height: calc(100dvh - 48px);
    overflow: auto;
}

.bd-profile-main {
    grid-area: main;
    min-width: 0;
}

.bd-profile-sidebar-user {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(223, 231, 246, 0.92);
}

.bd-profile-sidebar-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #17345f;
    background: linear-gradient(145deg, rgba(230, 242, 255, 0.95), rgba(235, 255, 248, 0.9));
    border: 2px solid rgba(255, 255, 255, 0.78);
    box-shadow: 0 8px 18px rgba(22, 30, 58, 0.12);
}

.bd-profile-sidebar-user-meta {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.bd-profile-sidebar-user-meta strong {
    color: var(--bd-text-primary);
    font-size: 0.92rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.bd-profile-sidebar-user-meta span {
    color: var(--bd-text-secondary);
    font-size: 0.74rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.bd-profile-sidebar-close {
    display: none;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 999px;
    background: rgba(241, 245, 249, 0.95);
    color: #475569;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.bd-profile-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bd-profile-sidebar-item {
    border: 1px solid rgba(190, 203, 229, 0.55);
    background: rgba(255, 255, 255, 0.62);
    color: var(--bd-text-primary);
    border-radius: 14px;
    padding: 11px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s ease;
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    text-align: right;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
}

.bd-profile-sidebar-item-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(241, 245, 249, 0.95);
    color: #2a5a87;
    flex-shrink: 0;
}

.bd-profile-sidebar-item-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.bd-profile-sidebar-item-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.bd-profile-sidebar-item-label {
    font-size: 0.84rem;
    line-height: 1.35;
}

.bd-profile-sidebar-item-hint {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--bd-text-secondary);
    line-height: 1.4;
}

.bd-profile-sidebar-item:hover {
    border-color: rgba(34, 107, 93, 0.35);
    background: rgba(255, 255, 255, 0.88);
    transform: translateX(-2px);
}

.bd-profile-sidebar-item.is-active {
    background: linear-gradient(135deg, rgba(34, 107, 93, 0.14), rgba(47, 125, 137, 0.08));
    color: var(--bd-text-primary);
    border-color: rgba(34, 107, 93, 0.42);
    box-shadow: inset 3px 0 0 #226b5d;
}

.bd-profile-sidebar-item.is-active .bd-profile-sidebar-item-icon {
    background: linear-gradient(135deg, #226b5d, #2f7d89);
    color: #fff;
}

.bd-profile-sidebar-item.is-active .bd-profile-sidebar-item-hint {
    color: #3f6f66;
}

.bd-profile-sidebar,
.bd-profile-sidebar * {
    box-sizing: border-box;
}

.bd-profile-sidebar button,
.bd-profile-sidebar a {
    font-family: inherit;
    line-height: inherit;
}

.bd-profile-sidebar-divider {
    height: 1px;
    background: linear-gradient(to left, transparent, rgba(190, 203, 229, 0.85), transparent);
}

.bd-profile-sidebar-links {
    display: grid;
    gap: 6px;
}

.bd-profile-sidebar-links-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    padding: 0 6px 2px;
}

.bd-profile-sidebar-link,
.bd-profile-sidebar-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    text-decoration: none;
    color: var(--bd-text-primary);
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.bd-profile-sidebar-link:hover,
.bd-profile-sidebar-logout:hover {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(190, 203, 229, 0.75);
    transform: translateY(-1px);
}

.bd-profile-sidebar-link.is-guide {
    color: #0f5e50;
}

.bd-profile-sidebar-link.is-leitner {
    color: #5b21b6;
}

.bd-profile-sidebar-link.is-chatbot {
    color: #0f4e85;
}

.bd-profile-sidebar-logout {
    margin-top: auto;
    color: #ffffff;
    background: linear-gradient(135deg, #cc3a2e, #a92218);
    border-color: rgba(180, 35, 24, 0.44);
    justify-content: center;
}

.bd-profile-sidebar-logout:hover {
    background: linear-gradient(135deg, #bc3228, #931c14);
    border-color: rgba(143, 27, 18, 0.7);
    color: #fff;
}

.bd-profile-sidebar-backdrop {
    display: none;
}

.bd-profile-mobile-bar,
.bd-profile-mobile-nav {
    display: none;
}

.bd-profile-tab-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #2a5a87;
    flex-shrink: 0;
}

.bd-profile-tab-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

@media (min-width: 961px) {
    .bd-profile-sidebar-close {
        display: none !important;
    }

    .bd-profile-mobile-bar,
    .bd-profile-mobile-nav {
        display: none !important;
    }

    .bd-profile-header {
        display: flex !important;
    }
}

.bd-profile-card {
    width: 100%;
    background: var(--bd-glass-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 24px;
    box-shadow: var(--bd-shadow-soft);
    padding: 26px;
    font-family: inherit;
    border: 1px solid var(--bd-glass-border);
    display: grid;
    gap: 22px;
    overflow: hidden;
}

.bd-profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.bd-profile-header-content {
    flex: 1;
    display: grid;
    gap: 8px;
}

.bd-nav-icon {
    width: 17px;
    height: 17px;
    display: inline-flex;
}

.bd-profile-nav-btn {
    text-decoration: none;
    background: rgba(255, 255, 255, 0.64);
    border: 1px solid rgba(255, 255, 255, 0.66);
    color: var(--bd-text-primary);
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 600;
    box-shadow: var(--bd-shadow-subtle);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: normal;
    word-break: break-word;
    font-size: clamp(0.72rem, 1vw, 0.84rem);
    line-height: 1.45;
    cursor: pointer;
}

.bd-profile-nav-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(30, 126, 108, 0.45);
    box-shadow: 0 14px 28px rgba(22, 30, 58, 0.18);
}

.bd-profile-header h2 {
    margin: 0 0 6px;
    color: var(--bd-text-primary);
    font-size: clamp(1.2rem, 2vw, 1.56rem);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.bd-profile-header p {
    margin: 0;
    color: var(--bd-text-secondary);
    font-size: clamp(0.8rem, 1.25vw, 0.9rem);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.bd-profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.7);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    color: #17345f;
    background: linear-gradient(145deg, rgba(230, 242, 255, 0.95), rgba(235, 255, 248, 0.9));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.52), 0 14px 30px rgba(22, 30, 58, 0.14);
}

.bd-profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.bd-profile-grid-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--bd-surface-border);
    background: rgba(255, 255, 255, 0.56);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.bd-profile-grid-icon,
.bd-section-title-icon,
.bd-plan-group-icon,
.bd-plan-meta-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #2a5a87;
}

.bd-section-title-icon,
.bd-plan-group-icon {
    width: 20px;
    height: 20px;
    color: #23695c;
}

.bd-nav-icon svg,
.bd-profile-grid-icon svg,
.bd-section-title-icon svg,
.bd-plan-group-icon svg,
.bd-plan-meta-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.bd-profile-grid span {
    display: block;
    color: var(--bd-text-secondary);
    font-size: 13px;
}

.bd-profile-grid strong {
    display: block;
    margin-top: 4px;
    font-size: clamp(0.84rem, 1.3vw, 0.96rem);
    color: var(--bd-text-primary);
    overflow-wrap: anywhere;
}

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

.bd-profile-smart-card {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.72);
    background: rgba(255,255,255,0.72);
    box-shadow: var(--bd-shadow-subtle);
    display: grid;
    gap: 6px;
}

.bd-profile-smart-card span,
.bd-profile-insight-label {
    font-size: 12px;
    color: var(--bd-text-secondary);
}

.bd-profile-smart-card strong,
.bd-profile-behavior-card strong {
    color: var(--bd-text-primary);
    font-size: clamp(0.95rem, 1.5vw, 1.08rem);
    line-height: 1.6;
}

.bd-profile-smart-card small,
.bd-profile-behavior-card small {
    color: #4b5f86;
    line-height: 1.8;
}

.bd-profile-smart-card.is-score {
    background: linear-gradient(135deg, rgba(230,245,255,0.92), rgba(255,255,255,0.72));
}

.bd-profile-smart-card.is-behavior {
    background: linear-gradient(135deg, rgba(235,255,245,0.92), rgba(255,255,255,0.72));
}

.bd-profile-smart-card.is-streak {
    background: linear-gradient(135deg, rgba(247,239,255,0.92), rgba(255,255,255,0.72));
}

.bd-profile-panels {
    display: grid;
    gap: 18px;
}

.bd-profile-panel[hidden] {
    display: none !important;
}

.bd-profile-panel.is-active {
    display: grid;
    gap: 18px;
}

.bd-profile-insight-grid,
.bd-profile-behavior-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.bd-profile-insight-card,
.bd-profile-behavior-card {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255,255,255,0.78);
    border: 1px solid rgba(223, 231, 246, 0.9);
    box-shadow: var(--bd-shadow-subtle);
    display: grid;
    gap: 8px;
}

.bd-profile-insight-card p {
    margin: 0;
    color: var(--bd-text-secondary);
    line-height: 1.9;
    font-size: 13px;
}

.bd-profile-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bd-profile-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 12px;
    font-weight: 700;
}

.bd-profile-chip.is-positive {
    background: rgba(222, 247, 231, 0.95);
    color: #156f46;
}

.bd-profile-chip.is-warning {
    background: rgba(255, 242, 223, 0.96);
    color: #a35f10;
}

.bd-profile-insight-notes,
.bd-profile-recommendations {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.bd-profile-insight-note,
.bd-profile-recommendation-item {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(245, 248, 255, 0.9);
    border: 1px solid rgba(220, 227, 244, 0.92);
    color: #42557d;
    line-height: 1.9;
    font-size: 13px;
}

.bd-profile-gamification {
    padding: 20px;
    border-radius: 18px;
    background: var(--bd-glass-bg);
    border: 1px solid var(--bd-surface-border);
    box-shadow: var(--bd-shadow-subtle);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.bd-profile-gamification-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.bd-profile-stat-card {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 14px;
    padding: 12px;
    display: grid;
    gap: 4px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.bd-profile-stat-card span {
    font-size: 12px;
    color: var(--bd-text-secondary);
}

.bd-profile-stat-card strong {
    font-size: clamp(1rem, 1.9vw, 1.1rem);
    color: var(--bd-text-primary);
    overflow-wrap: anywhere;
}

.bd-profile-stat-card small {
    font-size: 12px;
    color: var(--bd-text-secondary);
}

.bd-profile-streak-note {
    margin-top: 12px;
    font-size: 13px;
    color: #244f82;
    background: rgba(230, 242, 255, 0.82);
    border: 1px solid rgba(166, 201, 243, 0.62);
    border-radius: 12px;
    padding: 10px 12px;
}

.bd-profile-activity-log {
    margin-top: 14px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.68);
    border-radius: 14px;
    padding: 14px;
}

.bd-profile-activity-log h4 {
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--bd-text-primary);
}

.bd-profile-activity-log ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.bd-profile-activity-log li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(245, 249, 255, 0.7);
    border: 1px solid rgba(220, 229, 245, 0.7);
}

.bd-profile-activity-log li strong {
    display: block;
    color: var(--bd-text-primary);
    font-size: clamp(0.82rem, 1.2vw, 0.9rem);
    overflow-wrap: anywhere;
}

.bd-profile-activity-log li span {
    color: var(--bd-text-secondary);
    font-size: 12px;
}

.bd-profile-activity-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bd-profile-activity-meta span {
    background: rgba(223, 245, 236, 0.85);
    color: #16604f;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
}

.bd-profile-section {
    margin-top: 2px;
    padding: 20px;
    border-radius: 18px;
    background: var(--bd-glass-bg);
    border: 1px solid var(--bd-surface-border);
    box-shadow: var(--bd-shadow-subtle);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.bd-profile-section h3,
.bd-profile-form h3,
.bd-profile-verify h3,
.bd-profile-passkeys h3 {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: clamp(1rem, 1.6vw, 1.14rem);
    color: var(--bd-text-primary);
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.bd-profile-form {
    background: var(--bd-glass-bg);
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--bd-surface-border);
    box-shadow: var(--bd-shadow-subtle);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.bd-profile-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.bd-profile-form label {
    display: grid;
    gap: 6px;
    font-size: clamp(0.75rem, 1.1vw, 0.84rem);
    color: var(--bd-text-secondary);
}

.bd-profile-form input {
    border: 1px solid rgba(191, 205, 230, 0.7);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: clamp(0.78rem, 1.2vw, 0.9rem);
    background: rgba(255, 255, 255, 0.82);
}

.bd-profile-alert {
    margin-top: 10px;
    font-size: 13px;
    color: #bf1650;
}

.bd-profile-alert.is-success {
    color: #157d65;
}

.bd-profile-alert.is-error {
    color: #bf1650;
}

.bd-placement-summary {
    display: grid;
    gap: 14px;
}

.bd-placement-summary-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.bd-placement-summary-head p {
    margin: 6px 0 0;
    color: var(--bd-text-secondary);
    line-height: 1.9;
}

.bd-placement-summary-badge {
    min-width: 140px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(235, 242, 255, 0.94);
    border: 1px solid rgba(184, 207, 244, 0.9);
    display: grid;
    gap: 4px;
}

.bd-placement-summary-badge.is-zero {
    background: rgba(237, 247, 229, 0.96);
    border-color: rgba(176, 214, 149, 0.95);
}

.bd-placement-summary-badge span,
.bd-placement-summary-card span {
    font-size: 12px;
    color: var(--bd-text-secondary);
}

.bd-placement-summary-badge strong,
.bd-placement-summary-card strong {
    font-size: 1rem;
    color: var(--bd-text-primary);
}

.bd-placement-summary-card small {
    line-height: 1.9;
    color: #4d6082;
}

.bd-placement-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.bd-placement-modal-card {
    width: min(880px, 100%);
    display: grid;
    gap: 14px;
}

.bd-placement-modal-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.bd-placement-close {
    min-width: 90px;
}

.bd-placement-progress {
    display: grid;
    gap: 8px;
}

.bd-placement-progress-bar {
    height: 10px;
    border-radius: 999px;
    background: rgba(222, 230, 245, 0.9);
    overflow: hidden;
}

.bd-placement-progress-bar span {
    display: block;
    height: 100%;
    width: 10%;
    border-radius: inherit;
    background: linear-gradient(90deg, #4f46e5, #3b82f6);
    transition: width 0.25s ease;
}

.bd-placement-choice-grid,
.bd-placement-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.bd-placement-choice,
.bd-placement-result-card,
.bd-placement-assessment-card {
    border: 1px solid rgba(206, 219, 243, 0.95);
    border-radius: 16px;
    background: rgba(248, 251, 255, 0.96);
    padding: 16px;
}

.bd-placement-choice {
    display: grid;
    gap: 8px;
    text-align: right;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bd-placement-choice:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 32px rgba(102, 123, 173, 0.12);
}

.bd-placement-choice.is-secondary {
    background: rgba(246, 250, 239, 0.96);
    border-color: rgba(194, 217, 166, 0.95);
}

.bd-placement-choice strong,
.bd-placement-result-hero strong,
.bd-placement-question h4,
.bd-placement-assessment-card h4 {
    color: var(--bd-text-primary);
}

.bd-placement-choice span,
.bd-placement-result-summary,
.bd-placement-result-card,
.bd-placement-prompt,
.bd-placement-passage,
.bd-placement-option span {
    line-height: 1.9;
    color: #4d6082;
}

.bd-placement-result-hero {
    display: grid;
    gap: 6px;
    padding: 16px;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(235, 243, 255, 0.98), rgba(224, 236, 255, 0.94));
    border: 1px solid rgba(183, 205, 244, 0.95);
    margin-bottom: 12px;
}

.bd-placement-result-summary {
    margin-bottom: 12px;
}

.bd-placement-question {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.bd-placement-option {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(221, 229, 244, 0.95);
}

.bd-placement-textarea {
    width: 100%;
    margin-top: 14px;
    border: 1px solid rgba(191, 205, 230, 0.7);
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.92);
    min-height: 220px;
    resize: vertical;
}

.bd-placement-passage {
    margin-top: 10px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(242, 247, 255, 0.94);
    border: 1px solid rgba(210, 223, 246, 0.96);
}

.bd-placement-assessment-card .bd-auth-btn {
    margin-top: 14px;
}

.bd-profile-divider {
    margin: 18px 0;
    height: 1px;
    background: rgba(187, 199, 224, 0.65);
}

.bd-profile-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.bd-profile-secondary {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(188, 202, 227, 0.84);
    color: #2b3558;
}

.bd-profile-verify {
    background: var(--bd-glass-bg);
    border-radius: 18px;
    border: 1px solid var(--bd-surface-border);
    padding: 18px;
    box-shadow: var(--bd-shadow-subtle);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.bd-profile-passkeys {
    background: var(--bd-glass-bg);
    border-radius: 18px;
    border: 1px solid var(--bd-surface-border);
    padding: 18px;
    box-shadow: var(--bd-shadow-subtle);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.bd-profile-plans {
    margin-top: 4px;
    padding: 22px;
    border-radius: 20px;
    background: var(--bd-glass-bg);
    border: 1px solid var(--bd-surface-border);
    box-shadow: var(--bd-shadow-subtle);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.bd-profile-plans-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.bd-profile-plans-header h3 {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--bd-text-primary);
}

.bd-profile-plans-header p {
    margin: 0;
    color: var(--bd-text-secondary);
    font-size: clamp(0.76rem, 1.15vw, 0.84rem);
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.bd-profile-empty {
    margin-top: 14px;
    background: rgba(255, 247, 232, 0.82);
    border: 1px solid rgba(255, 205, 137, 0.85);
    color: #905100;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
}

.bd-profile-empty p {
    margin: 0 0 12px;
    line-height: 1.7;
}

.bd-profile-empty .bd-auth-btn {
    display: inline-block;
    width: auto;
    min-width: 160px;
}

.bd-plan-group {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed rgba(115, 134, 177, 0.35);
}

.bd-plan-group:first-of-type {
    margin-top: 16px;
    padding-top: 0;
    border-top: none;
}

.bd-plan-group h4 {
    margin: 0 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: clamp(0.82rem, 1.2vw, 0.92rem);
    color: var(--bd-text-primary);
    letter-spacing: 0.3px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.bd-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.bd-plan-grid:empty {
    display: none;
}

.bd-plan-card {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.78);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.76);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--bd-shadow-subtle);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.bd-plan-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, rgba(31, 143, 122, 0.9), rgba(70, 109, 196, 0.82));
    opacity: 0.6;
}

.bd-plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 44px rgba(18, 32, 64, 0.2);
}

.bd-plan-card.is-active {
    border-color: rgba(31, 143, 122, 0.45);
    box-shadow: 0 20px 38px rgba(31, 143, 122, 0.2);
}

.bd-plan-card.is-expiring {
    border-color: rgba(243, 156, 18, 0.45);
    box-shadow: 0 20px 38px rgba(243, 156, 18, 0.18);
}

.bd-plan-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.bd-plan-badge {
    padding: 5px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #1f8f7a, #146858);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}

.bd-plan-status {
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(223, 245, 236, 0.86);
    color: #1b6b58;
    font-size: 11px;
    font-weight: 600;
}

.bd-plan-status.is-expiring {
    background: rgba(255, 241, 219, 0.92);
    color: #a45b00;
}

.bd-plan-status.is-expired {
    background: rgba(255, 226, 226, 0.9);
    color: #a22b2b;
}

.bd-plan-card h5 {
    margin: 0;
    font-size: clamp(0.95rem, 1.55vw, 1.06rem);
    color: var(--bd-text-primary);
    line-height: 1.42;
    overflow-wrap: anywhere;
}

.bd-plan-card h5,
.bd-plan-card p {
    text-align: right;
}

.bd-plan-card p {
    margin: 0;
    color: var(--bd-text-secondary);
    font-size: clamp(0.76rem, 1.15vw, 0.84rem);
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.bd-plan-features {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 6px;
}

.bd-plan-features li {
    margin: 0;
    color: var(--bd-text-secondary);
    font-size: 13px;
    line-height: 1.6;
    position: relative;
    padding-right: 14px;
}

.bd-plan-features li::before {
    content: "•";
    position: absolute;
    right: 0;
    top: 0;
    color: var(--bd-primary-dark);
}

.bd-plan-body {
    display: grid;
    gap: 10px;
    flex: 1;
}

.bd-plan-footer {
    display: grid;
    gap: 10px;
    margin-top: auto;
}

.bd-plan-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    background: transparent;
    padding: 0;
    border: none;
}

.bd-plan-meta > div,
.bd-plan-meta-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 12px;
    border-radius: 14px;
    background: rgba(248, 251, 255, 0.75);
    border: 1px solid rgba(231, 238, 250, 0.84);
}

.bd-plan-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: clamp(0.71rem, 1.05vw, 0.78rem);
    color: var(--bd-text-secondary);
}

.bd-plan-meta strong {
    display: block;
    margin-top: 4px;
    font-size: clamp(0.74rem, 1.12vw, 0.82rem);
    color: var(--bd-text-primary);
    overflow-wrap: anywhere;
}

.bd-plan-cta {
    margin-top: 0;
    display: grid;
    gap: 10px;
}

.bd-plan-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    font-size: clamp(0.76rem, 1.1vw, 0.84rem);
    color: var(--bd-text-primary);
}

.bd-plan-price strong {
    white-space: nowrap;
}

.bd-plan-price span,
.bd-plan-price strong {
    font-feature-settings: "tnum";
}

.bd-plan-price span {
    color: var(--bd-text-secondary);
}

.bd-plan-coupon {
    display: grid;
    gap: 6px;
    margin-bottom: 10px;
}

.bd-plan-coupon-input::placeholder {
    color: #98a1b3;
}

.bd-plan-coupon-input {
    border: 1px solid rgba(191, 205, 230, 0.84);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: clamp(0.74rem, 1.08vw, 0.82rem);
    background: rgba(255, 255, 255, 0.9);
}

.bd-plan-coupon-input:focus {
    outline: none;
    border-color: rgba(31, 143, 122, 0.7);
    box-shadow: 0 0 0 3px rgba(31, 143, 122, 0.18);
}

.bd-plan-discount {
    font-size: clamp(0.7rem, 1.02vw, 0.76rem);
    color: var(--bd-text-secondary);
    min-height: 18px;
    overflow-wrap: anywhere;
}

.bd-plan-discount.is-error {
    color: #a22b2b;
}

.bd-plan-discount.is-success {
    color: #1b6b58;
}

.bd-plan-remaining {
    font-size: clamp(0.7rem, 1.02vw, 0.76rem);
    color: var(--bd-text-secondary);
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(244, 248, 255, 0.85);
    line-height: 1.6;
    border: 1px solid rgba(225, 234, 248, 0.8);
    overflow-wrap: anywhere;
}

.bd-plan-remaining.is-expiring {
    background: rgba(255, 247, 232, 0.86);
    color: #a45b00;
}

.bd-plan-remaining.is-expired {
    background: rgba(255, 226, 226, 0.86);
    color: #a22b2b;
}

.bd-plan-note {
    font-size: clamp(0.7rem, 1.02vw, 0.76rem);
    color: var(--bd-text-secondary);
    background: rgba(243, 244, 249, 0.75);
    border-radius: 12px;
    padding: 10px 12px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.bd-plan-actions {
    display: grid;
    gap: 10px;
    margin-top: auto;
}

.bd-plan-membership-note,
.bd-plan-compare-note,
.bd-plan-warning {
    min-height: 0;
}

.bd-plan-membership-note {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(244, 248, 255, 0.9);
    border: 1px solid rgba(220, 231, 248, 0.9);
    color: #466184;
    line-height: 1.9;
}

.bd-plan-card {
    align-items: stretch;
}

.bd-plan-body {
    gap: 12px;
}

@media (max-width: 720px) {
    .bd-plan-meta {
        grid-template-columns: 1fr;
    }
}

.bd-plan-warning {
    margin-top: 10px;
    font-size: clamp(0.7rem, 1.02vw, 0.76rem);
    color: #9f5b00;
    background: rgba(255, 243, 221, 0.9);
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 225, 181, 0.85);
    overflow-wrap: anywhere;
}

.bd-profile-passkey-form {
    display: grid;
    gap: 12px;
    margin: 12px 0;
}

.bd-profile-passkey-form label {
    display: grid;
    gap: 6px;
    font-size: 13px;
    color: var(--bd-text-secondary);
}

.bd-profile-passkey-form input {
    border: 1px solid rgba(191, 205, 230, 0.84);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.9);
}

.bd-profile-passkey-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.bd-profile-passkey-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: rgba(248, 250, 255, 0.78);
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(218, 228, 246, 0.82);
}

.bd-profile-passkey-list li span {
    display: block;
    color: var(--bd-text-secondary);
    font-size: clamp(0.7rem, 1.02vw, 0.76rem);
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.bd-profile-record-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.bd-profile-record-card {
    background: rgba(255, 255, 255, 0.76);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.76);
    box-shadow: var(--bd-shadow-subtle);
    padding: 14px;
    display: grid;
    gap: 8px;
}

.bd-profile-record-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.bd-profile-record-top h4 {
    margin: 0;
    font-size: clamp(0.84rem, 1.3vw, 0.94rem);
    color: var(--bd-text-primary);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.bd-profile-record-card p {
    margin: 0;
    color: var(--bd-text-secondary);
    font-size: clamp(0.74rem, 1.08vw, 0.82rem);
    overflow-wrap: anywhere;
}

.bd-profile-record-meta {
    display: grid;
    gap: 6px;
}

.bd-profile-record-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #3f527c;
    font-size: clamp(0.7rem, 1.02vw, 0.76rem);
    overflow-wrap: anywhere;
}

.bd-profile-book-license-note {
    margin: 14px 0 0;
    font-size: clamp(0.78rem, 1.05vw, 0.84rem);
    color: #3f527c;
    line-height: 1.7;
}

.bd-profile-book-license-note a {
    color: #1f8f7a;
    text-decoration: none;
    font-weight: 600;
}

.bd-profile-book-license-note a:hover,
.bd-profile-book-license-note a:focus-visible {
    text-decoration: underline;
}

.bd-gift-discount-section .bd-profile-verify-hint {
    margin: 0 0 16px;
}

.bd-gift-discount-card.is-shareable {
    border-color: #b8e6dc;
    background: linear-gradient(180deg, #f7fffc 0%, #ffffff 100%);
}

.bd-gift-discount-code-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 12px 0 10px;
}

.bd-gift-discount-code {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px dashed #7ec7b6;
    background: #ffffff;
    color: #145a4d;
    font-size: clamp(0.82rem, 1.1vw, 0.92rem);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.bd-gift-discount-copy {
    min-height: 40px;
    padding-inline: 14px;
}
.bd-profile-book-license-note a:focus {
    color: #187a68;
    text-decoration: underline;
}

.bd-profile-verify-grid {
    display: grid;
    gap: 16px;
    margin-top: 12px;
}

.bd-profile-verify-hint {
    margin: 8px 0 0;
    color: var(--bd-text-secondary);
    font-size: clamp(0.74rem, 1.08vw, 0.82rem);
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.bd-profile-verify-requirement {
    margin: 10px 0 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 243, 221, 0.9);
    color: #9f5b00;
    border: 1px solid rgba(255, 225, 181, 0.9);
    font-size: clamp(0.7rem, 1.02vw, 0.76rem);
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.bd-profile-verify-requirement.is-ready {
    background: rgba(223, 245, 236, 0.9);
    color: #157d65;
    border-color: rgba(184, 235, 218, 0.9);
}

.bd-profile-verify-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--bd-text-secondary);
}

.bd-profile-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: clamp(0.7rem, 1.02vw, 0.76rem);
    background: rgba(241, 243, 249, 0.8);
}

.bd-profile-status.is-success {
    background: rgba(223, 245, 236, 0.85);
    color: #157d65;
}

.bd-profile-status.is-pending {
    background: rgba(255, 240, 240, 0.9);
    color: #c0392b;
}

.bd-profile-verify-row {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) minmax(160px, 1fr) minmax(140px, 1fr);
    gap: 12px;
    align-items: center;
}

.bd-profile-verify-row .bd-auth-btn {
    justify-self: stretch;
}

.bd-profile-verify-row input {
    border: 1px solid rgba(191, 205, 230, 0.84);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: clamp(0.76rem, 1.12vw, 0.84rem);
    background: rgba(255, 255, 255, 0.9);
}

.bd-profile-verify-done {
    margin: 0;
    font-size: clamp(0.7rem, 1.02vw, 0.76rem);
    color: #157d65;
    background: rgba(223, 245, 236, 0.88);
    border: 1px solid rgba(184, 235, 218, 0.92);
    border-radius: 12px;
    padding: 10px 12px;
    overflow-wrap: anywhere;
}

body.bd-modal-open {
    overflow: hidden;
}

.bd-verify-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 18px 10px;
    overflow-y: auto;
}

.bd-verify-modal.is-open {
    display: flex;
}

.bd-verify-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    opacity: 0;
    transition: opacity 0.24s ease;
}

.bd-verify-modal-card {
    position: relative;
    width: min(100%, 520px);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 16px;
    border: 1px solid rgba(226, 234, 247, 0.85);
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.25);
    padding: 20px;
    z-index: 1;
    max-height: calc(100vh - 36px);
    overflow: auto;
    opacity: 0;
    transform: translateY(-8px) scale(0.985);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}

.bd-verify-modal.is-open .bd-verify-modal-backdrop {
    opacity: 1;
}

.bd-verify-modal.is-open .bd-verify-modal-card {
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: bdVerifyModalEnter 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.bd-verify-modal-card h3 {
    margin: 0 0 8px;
    font-size: clamp(0.95rem, 1.55vw, 1.08rem);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.bd-verify-modal-card p {
    margin: 0;
    color: var(--bd-text-secondary);
    font-size: clamp(0.74rem, 1.08vw, 0.82rem);
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.bd-verify-modal-list {
    margin: 14px 0 0;
    padding-right: 18px;
    color: var(--bd-text-primary);
    font-size: clamp(0.74rem, 1.08vw, 0.82rem);
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.bd-verify-modal-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 960px) {
    .bd-profile-wrapper {
        padding: 16px 10px 28px;
    }

    .bd-profile-layout {
        display: block;
    }

    .bd-profile-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        left: auto;
        width: min(320px, 88vw);
        height: 100dvh;
        max-height: none;
        z-index: 1300;
        border-radius: 0;
        transform: translateX(100%);
        transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
        box-shadow: -12px 0 40px rgba(15, 23, 42, 0.18);
    }

    .bd-profile-layout.is-sidebar-open .bd-profile-sidebar {
        transform: translateX(0);
    }

    .bd-profile-sidebar-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .bd-profile-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1290;
        background: rgba(15, 23, 42, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.24s ease;
    }

    .bd-profile-layout.is-sidebar-open .bd-profile-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    body.bd-profile-sidebar-open {
        overflow: hidden;
    }

    .bd-profile-mobile-bar {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 14px;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.78);
        border: 1px solid rgba(223, 231, 246, 0.92);
        box-shadow: var(--bd-shadow-subtle);
    }

    .bd-profile-menu-toggle {
        width: 42px;
        height: 42px;
        border: 1px solid rgba(190, 203, 229, 0.85);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.92);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 0;
        flex-shrink: 0;
    }

    .bd-profile-menu-toggle span {
        display: block;
        width: 16px;
        height: 1.7px;
        background: #334155;
        position: relative;
    }

    .bd-profile-menu-toggle span::before,
    .bd-profile-menu-toggle span::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        height: 1.7px;
        background: #334155;
    }

    .bd-profile-menu-toggle span::before {
        top: -5px;
    }

    .bd-profile-menu-toggle span::after {
        top: 5px;
    }

    .bd-profile-mobile-title {
        flex: 1;
        min-width: 0;
        display: grid;
        gap: 2px;
    }

    .bd-profile-mobile-title strong {
        color: var(--bd-text-primary);
        font-size: 0.95rem;
        line-height: 1.35;
    }

    .bd-profile-mobile-title span {
        color: var(--bd-text-secondary);
        font-size: 0.72rem;
        line-height: 1.35;
    }

    .bd-profile-mobile-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        font-weight: 700;
        color: #17345f;
        background: linear-gradient(145deg, rgba(230, 242, 255, 0.95), rgba(235, 255, 248, 0.9));
        border: 2px solid rgba(255, 255, 255, 0.78);
        flex-shrink: 0;
    }

    .bd-profile-mobile-nav {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 4px 2px 2px;
        scrollbar-width: none;
    }

    .bd-profile-mobile-nav::-webkit-scrollbar {
        display: none;
    }

    .bd-profile-mobile-tab {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        gap: 7px;
        padding: 9px 12px;
        border-radius: 999px;
        border: 1px solid rgba(190, 203, 229, 0.85);
        background: rgba(255, 255, 255, 0.82);
        color: var(--bd-text-primary);
        font-size: 0.76rem;
        font-weight: 700;
        white-space: nowrap;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .bd-profile-mobile-tab .bd-profile-tab-icon {
        width: 26px;
        height: 26px;
        border-radius: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: rgba(241, 245, 249, 0.95);
        color: #2a5a87;
        flex-shrink: 0;
    }

    .bd-profile-mobile-tab .bd-profile-tab-icon svg {
        width: 14px;
        height: 14px;
    }

    .bd-profile-mobile-tab.is-active {
        background: linear-gradient(135deg, #226b5d, #2f7d89);
        color: #fff;
        border-color: transparent;
        box-shadow: 0 10px 22px rgba(34, 107, 93, 0.22);
    }

    .bd-profile-mobile-tab.is-active .bd-profile-tab-icon {
        background: rgba(255, 255, 255, 0.18);
        color: #fff;
    }

    .bd-profile-header {
        display: none;
    }
}

@media (max-width: 720px) {
    .bd-profile-verify-row {
        grid-template-columns: 1fr;
    }

    .bd-plan-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bd-profile-record-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .bd-profile-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .bd-plan-meta {
        grid-template-columns: 1fr;
    }

    .bd-profile-activity-log li {
        flex-direction: column;
        align-items: flex-start;
    }

    .bd-profile-card {
        padding: 18px;
        border-radius: 20px;
        gap: 16px;
    }

    .bd-profile-section,
    .bd-profile-plans,
    .bd-profile-gamification,
    .bd-profile-form,
    .bd-profile-verify,
    .bd-profile-passkeys {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .bd-profile-wrapper {
        padding: 16px 10px;
        font-size: 13px;
    }

    .bd-profile-card {
        padding: 12px;
        border-radius: 16px;
        gap: 12px;
    }

    .bd-profile-header,
    .bd-profile-header-top {
        gap: 8px;
    }

    .bd-profile-mobile-bar {
        padding: 10px 12px;
        gap: 10px;
    }

    .bd-profile-mobile-tab {
        padding: 8px 10px;
        font-size: 0.72rem;
    }

    .bd-profile-avatar {
        width: 56px;
        height: 56px;
        font-size: 21px;
    }

    .bd-profile-grid,
    .bd-profile-smart-strip,
    .bd-profile-gamification-grid,
    .bd-plan-grid,
    .bd-profile-record-grid,
    .bd-profile-insight-grid,
    .bd-profile-behavior-grid {
        gap: 8px;
    }

    .bd-profile-grid-item,
    .bd-profile-stat-card,
    .bd-plan-card,
    .bd-profile-record-card,
    .bd-profile-activity-log,
    .bd-plan-meta {
        padding: 10px;
    }

    .bd-profile-section,
    .bd-profile-plans,
    .bd-profile-gamification,
    .bd-profile-form,
    .bd-profile-verify,
    .bd-profile-passkeys {
        padding: 12px;
        border-radius: 14px;
    }

    .bd-profile-nav {
        gap: 6px;
    }

    .bd-profile-nav-btn,
    .bd-auth-btn,
    .bd-profile-secondary,
    .bd-profile-verify-row .bd-auth-btn,
    .bd-verify-modal-actions .bd-auth-btn,
    .bd-profile-sidebar-link,
    .bd-profile-sidebar-logout {
        width: 100%;
        justify-content: center;
        min-height: 40px;
        padding: 9px 10px;
        font-size: 12px;
        line-height: 1.35;
    }

    .bd-profile-actions,
    .bd-verify-modal-actions,
    .bd-auth-otp-row,
    .bd-profile-verify-row {
        gap: 8px;
    }

    .bd-plan-price,
    .bd-plan-meta,
    .bd-profile-record-top {
        gap: 6px;
    }

    .bd-plan-meta {
        grid-template-columns: 1fr;
    }

    .bd-verify-modal-card {
        width: 100%;
        max-height: calc(100vh - 16px);
        padding: 12px;
        border-radius: 14px;
    }

    .bd-verify-modal.is-open .bd-verify-modal-card {
        animation-duration: 0.24s;
    }

    .bd-verify-modal {
        padding: 8px;
    }

    .bd-verify-modal-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .bd-verify-modal-actions .bd-auth-btn {
        width: 100%;
        min-height: 38px;
        padding: 8px 10px;
    }

    .bd-verify-modal-list {
        margin-top: 8px;
        padding-right: 12px;
    }
}

@media (max-width: 360px) {
    .bd-profile-wrapper {
        padding: 12px 8px;
        font-size: 12px;
    }

    .bd-profile-card {
        padding: 10px;
        gap: 10px;
        border-radius: 14px;
    }

    .bd-profile-header h2 {
        font-size: 1rem;
    }

    .bd-profile-header p,
    .bd-profile-nav-btn,
    .bd-plan-card p,
    .bd-profile-record-card p,
    .bd-verify-modal-card p,
    .bd-verify-modal-list {
        font-size: 11px;
    }

    .bd-profile-nav {
        gap: 4px;
    }

    .bd-profile-nav-btn,
    .bd-auth-btn,
    .bd-profile-secondary {
        min-height: 36px;
        padding: 7px 8px;
    }

    .bd-profile-grid-item,
    .bd-profile-stat-card,
    .bd-plan-card,
    .bd-profile-record-card,
    .bd-profile-activity-log,
    .bd-plan-meta,
    .bd-profile-section,
    .bd-profile-plans,
    .bd-profile-gamification,
    .bd-profile-form,
    .bd-profile-verify,
    .bd-profile-passkeys,
    .bd-profile-smart-card,
    .bd-profile-insight-card,
    .bd-profile-behavior-card {
        padding: 9px;
    }

    .bd-profile-record-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .bd-profile-record-top h4,
    .bd-plan-card h5 {
        font-size: 13px;
    }

    .bd-verify-modal {
        padding: 6px;
    }

    .bd-verify-modal-card {
        border-radius: 12px;
        padding: 10px;
        max-height: calc(100vh - 12px);
    }

    .bd-verify-modal-card h3 {
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bd-verify-modal-backdrop,
    .bd-verify-modal-card {
        transition: none;
    }

    .bd-verify-modal.is-open .bd-verify-modal-card {
        animation: none;
    }
}

@keyframes bdVerifyModalEnter {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes bdFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── OTP slide-down reveal ─── */
.bd-auth-otp {
    overflow: hidden;
    transition: max-height 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}
.bd-auth-otp.is-visible {
    animation: bdOtpReveal 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes bdOtpReveal {
    from { opacity: 0; transform: translateY(-8px) scale(0.99); }
    to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* ─── Button loading state ─── */
.bd-auth-btn.is-loading {
    pointer-events: none;
    opacity: 0.82;
    position: relative;
}
.bd-auth-btn.is-loading::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: inherit;
    z-index: 1;
}
.bd-auth-btn.is-loading::after {
    content: '';
    position: absolute;
    inset: 50% 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2.5px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bdSpin 0.72s linear infinite;
    z-index: 2;
}
@keyframes bdSpin {
    to { transform: rotate(360deg); }
}

/* ─── Shake animation on error ─── */
@keyframes bdShake {
    0%, 100% { transform: translateX(0); }
    15%  { transform: translateX(-7px); }
    30%  { transform: translateX(6px); }
    45%  { transform: translateX(-5px); }
    60%  { transform: translateX(4px); }
    75%  { transform: translateX(-3px); }
    90%  { transform: translateX(2px); }
}
.bd-auth-input-wrap.is-error-shake {
    animation: bdShake 0.42s ease;
    border-color: rgba(214, 69, 104, 0.7) !important;
}

/* ─── OTP timer + resend row ─── */
.bd-auth-otp-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.bd-auth-otp-timer {
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 5px;
}
.bd-auth-otp-timer-count {
    font-weight: 700;
    color: var(--bd-primary, #0f766e);
    font-variant-numeric: tabular-nums;
    min-width: 26px;
    display: inline-block;
}
.bd-auth-otp-resend {
    border: none;
    background: transparent;
    color: var(--bd-primary, #0f766e);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    font-family: inherit;
    transition: background 0.15s ease, color 0.15s ease;
    display: none;
}
.bd-auth-otp-resend:hover {
    background: rgba(15, 118, 110, 0.1);
}
.bd-auth-otp-resend.is-visible {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.bd-auth-otp-resend.is-loading {
    pointer-events: none;
    opacity: 0.6;
}

.bd-auth-otp-verify {
    width: 100%;
    margin-top: 14px;
}

.bd-auth-otp-verify:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.bd-auth-otp-verify.is-ready:not(:disabled) {
    opacity: 1;
}

/* ─── Password visibility toggle ─── */
.bd-auth-pw-toggle {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 4px;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
    transition: color 0.15s ease;
}
.bd-auth-pw-toggle:hover {
    color: #475569;
}
.bd-auth-pw-toggle svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* ─── Passkey section hidden until JS confirms support ─── */
.bd-auth-passkey {
    display: none;
}
.bd-auth-passkey.is-supported {
    display: block;
    animation: bdFadeIn 0.3s ease;
}

/* ─── Input success highlight ─── */
.bd-auth-input-wrap.is-success {
    border-color: rgba(29, 169, 124, 0.6);
    background: rgba(240, 253, 247, 0.85);
}

/* ─── OTP digit inputs (6-box layout) ─── */
.bd-auth-otp-digits {
    display: flex;
    gap: 8px;
    direction: ltr;
    margin-bottom: 2px;
}
.bd-auth-otp-digit {
    flex: 1;
    height: 48px;
    border: 1.5px solid #dbe3ef;
    border-radius: 12px;
    background: #f8fafc;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    caret-color: var(--bd-primary, #0f766e);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    width: 100%;
    min-width: 0;
    -webkit-appearance: none;
    appearance: none;
}
.bd-auth-otp-digit:focus {
    outline: none;
    border-color: rgba(15, 118, 110, 0.6);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
}
.bd-auth-otp-digit.is-filled {
    border-color: rgba(15, 118, 110, 0.45);
    background: rgba(240, 253, 247, 0.85);
}
.bd-auth-otp-digit.is-error {
    border-color: rgba(214, 69, 104, 0.7);
    background: rgba(255, 241, 244, 0.85);
    animation: bdShake 0.42s ease;
}
@media (max-width: 360px) {
    .bd-auth-otp-digit {
        height: 42px;
        font-size: 18px;
        border-radius: 10px;
    }
    .bd-auth-otp-digits {
        gap: 5px;
    }
}

@media (max-width: 780px) {
    .bd-auth-shell {
        grid-template-columns: 1fr;
    }

    .bd-auth-brand {
        display: none;
    }
}

@media (max-width: 640px) {
    .bd-auth-wrapper {
        padding: 18px 10px 32px;
        min-height: auto;
    }

    .bd-auth-card {
        padding: 26px 20px 22px;
        border-radius: 22px;
    }

    .bd-auth-card::before {
        border-radius: 22px 22px 0 0;
    }

    .bd-auth-tabs {
        margin-bottom: 16px;
    }

    .bd-auth-otp-row {
        flex-direction: column;
        align-items: stretch;
    }

    .bd-auth-passkey-row {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
    }

    .bd-auth-passkey-btn {
        width: 100%;
    }

    .bd-auth-input-wrap {
        min-height: 48px;
    }

    .bd-auth-btn {
        min-height: 48px;
    }
}

@media (max-width: 400px) {
    .bd-auth-card {
        padding: 22px 16px 18px;
    }

    .bd-auth-tab {
        padding: 9px 14px;
        font-size: 13px;
    }
}



/* ==========================
   Professional Leitner Panel
   ========================== */
.bd-leitner-panel {
    direction: rtl;
    width: min(1080px, 100%);
    margin: 28px auto;
    padding: 22px;
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfbff 100%);
    border: 1px solid #e8eaf5;
    box-shadow: 0 24px 60px rgba(25, 30, 60, 0.10);
    font-family: inherit;
}

.bd-leitner-panel-head {
    padding: 18px 18px 16px;
    border-radius: 18px;
    background: radial-gradient(circle at top right, #eef2ff 0%, #f5f8ff 45%, #ffffff 100%);
    border: 1px solid #e1e8ff;
    margin-bottom: 18px;
}

.bd-leitner-panel-head h2 {
    margin: 0 0 8px;
    font-size: 24px;
    color: #1e1b4b;
}

.bd-leitner-panel-head p {
    margin: 0;
    color: #475569;
    line-height: 1.85;
    font-size: 14px;
}

.bd-leitner-smart-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
    gap: 14px;
    padding: 16px;
    margin-bottom: 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(236,244,255,0.92), rgba(255,255,255,0.78));
    border: 1px solid #d8e6ff;
}

.bd-leitner-smart-badge {
    display: inline-flex;
    width: fit-content;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(255,255,255,0.88);
    color: #2554a5;
    font-size: 11px;
    font-weight: 800;
}

.bd-leitner-smart-hero-main h2 {
    margin: 10px 0 8px;
    color: #1c2f57;
    font-size: clamp(1.05rem, 1.7vw, 1.35rem);
}

.bd-leitner-smart-hero-main p {
    margin: 0;
    color: #4e6487;
    line-height: 1.9;
    font-size: 13px;
}

.bd-leitner-smart-hero-side {
    display: grid;
    gap: 10px;
}

.bd-leitner-smart-metric,
.bd-leitner-recommendation-item {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.86);
    border: 1px solid #dce6f6;
}

.bd-leitner-smart-metric span {
    display: block;
    color: #69809e;
    font-size: 12px;
}

.bd-leitner-smart-metric strong {
    display: block;
    margin-top: 5px;
    color: #163b6c;
    font-size: 18px;
}

.bd-leitner-recommendations {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.bd-leitner-recommendation-item {
    color: #44607f;
    line-height: 1.85;
    font-size: 13px;
}

.bd-leitner-add-card {
    background: #f8faff;
    border: 1px solid #dbe6ff;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
}

.bd-leitner-add-card h3 {
    margin: 0 0 12px;
    font-size: 16px;
    color: #1f2a44;
}

.bd-leitner-add-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.bd-leitner-add-grid input {
    border: 1px solid #d8dfef;
    border-radius: 12px;
    background: #fff;
    padding: 10px 12px;
    font-size: 14px;
    color: #1e293b;
}

.bd-leitner-add-grid input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16);
}

.bd-leitner-direction-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.bd-leitner-direction-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #4b5563;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 6px 10px;
}

.bd-leitner-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.bd-leitner-tab {
    border: 1px solid #d8e2f5;
    background: #fff;
    color: #1f2a44;
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.bd-leitner-tab:hover {
    border-color: #93c5fd;
    color: #1d4ed8;
    background: #f8fbff;
}

.bd-leitner-tab.is-active {
    background: #eef6ff;
    color: #0f4fb8;
    border-color: #9ec5ff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.16);
}

.bd-leitner-status {
    margin-bottom: 12px;
    border-radius: 12px;
    background: #f3f7ff;
    border: 1px solid #d4e3ff;
    color: #12438f;
    font-size: 13px;
    padding: 10px 12px;
}

.bd-leitner-status.is-error {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #be123c;
}

.bd-leitner-tab-content {
    display: none;
    animation: bdFadeIn .2s ease;
}

.bd-leitner-tab-content.is-active {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.bd-leitner-empty {
    grid-column: 1 / -1;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    color: #64748b;
    text-align: center;
    padding: 18px;
}

.bd-leitner-word-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.bd-leitner-word-head h4 {
    margin: 0;
    color: #111827;
    font-size: 18px;
}

.bd-leitner-word-head p {
    margin: 7px 0 0;
    color: #475569;
    font-size: 14px;
    line-height: 1.65;
}

.bd-leitner-word-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.bd-leitner-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    border: 1px solid transparent;
}

.bd-leitner-chip.is-box {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.bd-leitner-chip.is-source {
    background: #f8fafc;
    color: #475569;
    border-color: #e2e8f0;
}

.bd-leitner-chip.is-article {
    background: #f3e8ff;
    color: #6d28d9;
    border-color: #ddd6fe;
}

.bd-leitner-word-example {
    margin: 10px 0 0;
    font-size: 12px;
    color: #4b5563;
    border-top: 1px dashed #e2e8f0;
    padding-top: 8px;
    line-height: 1.7;
}

.bd-leitner-article-group {
    grid-column: 1 / -1;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
}

.bd-leitner-article-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.bd-leitner-article-head h4 {
    margin: 0;
    color: #1f2937;
    font-size: 15px;
}

.bd-leitner-article-head span {
    font-size: 12px;
    color: #64748b;
}

.bd-leitner-article-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

@media (max-width: 720px) {
    .bd-leitner-panel {
        padding: 14px;
        border-radius: 16px;
        margin: 18px auto;
    }

    .bd-leitner-panel-head h2 {
        font-size: 19px;
    }

    .bd-leitner-direction-row {
        flex-direction: column;
        align-items: stretch;
    }

    .bd-leitner-direction-row label {
        justify-content: center;
    }

    .bd-leitner-tab-content.is-active {
        grid-template-columns: 1fr;
    }
}


/* ==========================
   Leitner Practice-Only Panel
   ========================== */
.bd-leitner-practice-shell {
    background: #f8fbff;
    border: 1px solid #dbe6f9;
    border-radius: 18px;
    padding: 16px;
}

.bd-leitner-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.bd-leitner-dashboard-card {
    background: #fff;
    border: 1px solid #dbe5f3;
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.bd-leitner-dashboard-icon {
    width: 24px;
    height: 24px;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bd-leitner-dashboard-icon svg {
    width: 100%;
    height: 100%;
}

.bd-leitner-dashboard-label {
    font-size: 12px;
    color: #4a5b77;
}

.bd-leitner-dashboard-value {
    font-size: 22px;
    line-height: 1;
    font-weight: 700;
    color: #12284f;
}

.bd-leitner-practice-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(260px, 1fr);
    gap: 14px;
    align-items: start;
}

.bd-leitner-practice-card {
    background: #fff;
    border: 1px solid #dbe5f3;
    border-radius: 16px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
    padding: 18px;
}

.bd-leitner-practice-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.bd-leitner-stat {
    display: inline-flex;
    align-items: center;
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    background: #edf4ff;
    color: #1f4ea5;
    border: 1px solid #cfe0ff;
}

.bd-leitner-stat.is-correct {
    background: #ecfdf3;
    color: #14532d;
    border-color: #bbf7d0;
}

.bd-leitner-stat.is-attempted {
    background: #fff9eb;
    color: #9a3412;
    border-color: #fed7aa;
}

.bd-leitner-prompt-wrap {
    border: 1px dashed #c9daff;
    border-radius: 14px;
    background: #f8fbff;
    padding: 14px;
    margin-bottom: 12px;
}

.bd-leitner-prompt-label {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    color: #1d4ed8;
}

.bd-leitner-prompt-word {
    margin: 0;
    font-size: 28px;
    color: #0f1f3d;
    line-height: 1.4;
}

.bd-leitner-prompt-extra {
    margin: 8px 0 0;
    font-size: 13px;
    color: #3f4f69;
}

.bd-leitner-word-meta-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.bd-leitner-meta-pill {
    display: inline-flex;
    align-items: center;
    background: #f1f6ff;
    color: #204281;
    border: 1px solid #d6e5ff;
    border-radius: 10px;
    padding: 6px 9px;
    font-size: 12px;
    line-height: 1.5;
}

.bd-leitner-answer-row {
    margin-bottom: 12px;
}

.bd-leitner-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.bd-leitner-option-btn {
    border: 1px solid #c8d8f3;
    border-radius: 12px;
    background: #fff;
    color: #162744;
    padding: 10px;
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.6;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bd-leitner-option-btn:hover {
    border-color: #93c5fd;
    background: #f0f7ff;
}

.bd-leitner-option-btn.is-selected {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
}

.bd-leitner-option-btn.is-correct {
    background: #ecfdf3;
    border-color: #22c55e;
    color: #14532d;
}

.bd-leitner-option-btn.is-wrong {
    background: #fff1f2;
    border-color: #fb7185;
    color: #9f1239;
}

.bd-leitner-option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.9;
}

.bd-leitner-practice-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.bd-leitner-feedback {
    min-height: 24px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.bd-leitner-feedback.is-success {
    color: #15803d;
}

.bd-leitner-feedback.is-error {
    color: #b91c1c;
}

.bd-leitner-correct-answer {
    min-height: 24px;
    margin-top: 6px;
    font-size: 13px;
    color: #1f3f83;
    background: #edf4ff;
    border: 1px solid #d2e2ff;
    border-radius: 10px;
    padding: 8px 10px;
}

.bd-leitner-box-board {
    background: #fff;
    border: 1px solid #dbe5f3;
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
    padding: 14px;
}

.bd-leitner-box-board h3 {
    margin: 0;
    font-size: 16px;
    color: #102547;
}

.bd-leitner-box-board > p {
    margin: 6px 0 12px;
    font-size: 12px;
    color: #54637b;
}

.bd-leitner-box-list {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.bd-leitner-box-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
    border: 1px solid #dce7fb;
    background: #f9fbff;
    border-radius: 12px;
    padding: 8px 10px;
}

.bd-leitner-box-row span {
    color: #17366d;
    font-size: 12px;
    font-weight: 700;
}

.bd-leitner-box-row strong {
    justify-self: center;
    color: #0f172a;
    font-size: 16px;
}

.bd-leitner-box-row em {
    font-style: normal;
    justify-self: end;
    color: #60728f;
    font-size: 11px;
}

.bd-leitner-box-row.is-current {
    border-color: #93c5fd;
    background: #edf5ff;
}

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

.bd-leitner-session-item {
    border: 1px solid #dce7fb;
    border-radius: 10px;
    background: #f9fbff;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bd-leitner-session-item span {
    font-size: 11px;
    color: #4e5f79;
}

.bd-leitner-session-item strong {
    font-size: 16px;
    color: #12284f;
}


@media (max-width: 720px) {
    .bd-leitner-panel {
        padding: 14px;
        margin: 18px auto;
    }

    .bd-leitner-panel-head {
        padding: 14px;
        margin-bottom: 14px;
    }

    .bd-leitner-smart-hero {
        grid-template-columns: 1fr;
    }

    .bd-leitner-dashboard {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .bd-leitner-dashboard-card {
        padding: 10px;
    }

    .bd-leitner-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        padding: 6px;
        border-radius: 18px;
        background: rgba(237, 243, 253, 0.88);
        border: 1px solid rgba(209, 222, 243, 0.95);
    }

    .bd-leitner-tab {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 10px 12px;
        border-radius: 999px;
    }

    .bd-leitner-practice-shell {
        padding: 10px;
    }

    .bd-leitner-practice-grid {
        grid-template-columns: 1fr;
    }

    .bd-leitner-practice-card {
        padding: 12px;
    }

    .bd-leitner-box-board {
        padding: 12px;
    }

    .bd-leitner-prompt-word {
        font-size: 22px;
    }

    .bd-leitner-options {
        grid-template-columns: 1fr;
    }

    .bd-leitner-practice-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .bd-leitner-practice-actions .bd-auth-btn,
    .bd-leitner-practice-actions .bd-profile-secondary,
    .bd-leitner-practice-actions .bd-profile-nav-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

}

@media (max-width: 420px) {
    .bd-leitner-dashboard {
        grid-template-columns: 1fr;
    }
}

/* Leitner Pro — Section Nav, Session Controls, AI Context, Vocabulary */
.bd-leitner-section-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding: 6px;
    border-radius: 16px;
    background: #f0f4fc;
    border: 1px solid #dce6f6;
}

.bd-leitner-section-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: #4a5b77;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bd-leitner-section-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.bd-leitner-section-btn:hover {
    background: rgba(255,255,255,0.7);
    color: #1d4ed8;
}

.bd-leitner-section-btn.is-active {
    background: #fff;
    color: #0f4fb8;
    border-color: #9ec5ff;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
}

.bd-leitner-section[hidden] {
    display: none !important;
}

.bd-leitner-session-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.bd-leitner-session-modes {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.bd-leitner-session-mode {
    border: 1px solid #d4e3ff;
    background: #fff;
    color: #3b5278;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bd-leitner-session-mode.is-active {
    background: #1d4ed8;
    color: #fff;
    border-color: #1d4ed8;
}

.bd-leitner-daily-goal {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #dce7fb;
}

.bd-leitner-goal-ring {
    width: 40px;
    height: 40px;
}

.bd-leitner-goal-ring-bg {
    stroke: #e2e8f0;
}

.bd-leitner-goal-ring-fill {
    stroke: #2563eb;
    transition: stroke-dashoffset 0.4s ease;
}

.bd-leitner-goal-ring-fill.is-complete {
    stroke: #16a34a;
}

.bd-leitner-goal-text span {
    display: block;
    font-size: 10px;
    color: #64748b;
}

.bd-leitner-goal-text strong {
    font-size: 14px;
    color: #12284f;
}

.bd-leitner-prompt-wrap.is-flipping {
    animation: bdLeitnerFlip 0.35s ease;
}

@keyframes bdLeitnerFlip {
    0% { opacity: 0.4; transform: translateY(8px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.bd-leitner-word-example-line {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #c9daff;
    font-size: 13px;
    color: #475569;
    font-style: italic;
    line-height: 1.7;
}

.bd-leitner-ai-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    color: #fff !important;
    border: none !important;
}

.bd-leitner-ai-btn:hover {
    filter: brightness(1.05);
}

.bd-leitner-ai-context {
    margin-top: 12px;
    padding: 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f5f3ff 0%, #eff6ff 100%);
    border: 1px solid #c7d2fe;
    animation: bdFadeIn 0.25s ease;
}

.bd-leitner-ai-context-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #3730a3;
}

.bd-leitner-ai-context-badge {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 999px;
    background: #6366f1;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
}

.bd-leitner-ai-context-body {
    font-size: 14px;
    color: #1e293b;
    line-height: 1.85;
}

.bd-leitner-ai-context-static {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.bd-leitner-ai-static-chip {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.8);
    border: 1px solid #ddd6fe;
    font-size: 11px;
    color: #5b21b6;
}

.bd-leitner-keyboard-hint {
    margin-top: 10px;
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
}

.bd-leitner-vocab-shell {
    background: #f8fbff;
    border: 1px solid #dbe6f9;
    border-radius: 18px;
    padding: 16px;
}

.bd-leitner-vocab-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
    align-items: center;
}

.bd-leitner-vocab-search {
    flex: 1;
    min-width: 180px;
    border: 1px solid #d8dfef;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    background: #fff;
}

.bd-leitner-vocab-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bd-leitner-vocab-filter {
    border: 1px solid #d4e3ff;
    background: #fff;
    color: #3b5278;
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.bd-leitner-vocab-filter.is-active {
    background: #eef6ff;
    color: #0f4fb8;
    border-color: #9ec5ff;
}

.bd-leitner-vocab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.bd-leitner-vocab-actions {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #e2e8f0;
}

.bd-leitner-vocab-delete {
    border: 1px solid #fecdd3;
    background: #fff1f2;
    color: #be123c;
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
}

.bd-leitner-vocab-delete:hover {
    background: #ffe4e6;
}

.bd-leitner-chip.is-due {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}

.bd-leitner-vocab-empty {
    text-align: center;
    padding: 24px;
    color: #64748b;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
}

.bd-leitner-add-desc {
    margin: 0 0 12px;
    font-size: 13px;
    color: #475569;
    line-height: 1.7;
}

.bd-leitner-add-input-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.bd-leitner-add-query {
    flex: 1;
    min-width: 200px;
    border: 1px solid #d8dfef;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    background: #fff;
}

.bd-leitner-add-status {
    min-height: 20px;
    font-size: 13px;
    color: #334155;
    margin-bottom: 10px;
}

.bd-leitner-add-status.is-error {
    color: #b91c1c;
}

.bd-leitner-add-results {
    display: grid;
    gap: 10px;
}

.bd-leitner-analyze-card {
    text-align: right;
    border: 1px solid #dbe6ff;
    border-radius: 14px;
    background: #fff;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bd-leitner-analyze-card:hover {
    border-color: #93c5fd;
}

.bd-leitner-analyze-card.is-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
    background: #f5f3ff;
}

.bd-leitner-analyze-head {
    font-size: 18px;
    font-weight: 700;
    color: #1e1b4b;
    margin-bottom: 6px;
}

.bd-leitner-analyze-meaning {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
}

.bd-leitner-analyze-example {
    margin-top: 8px;
    font-size: 12px;
    color: #64748b;
    font-style: italic;
}

.bd-leitner-add-save-btn {
    margin-top: 6px;
    width: fit-content;
}

.bd-leitner-add-modes-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}

.bd-leitner-add-mode-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #1e4a8a;
    background: rgba(42, 109, 246, 0.1);
    border: 1px solid rgba(42, 109, 246, 0.22);
}

.bd-leitner-bundle-hero {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    margin-bottom: 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(42, 109, 246, 0.08), rgba(99, 102, 241, 0.06));
    border: 1px solid rgba(42, 109, 246, 0.18);
}

.bd-leitner-bundle-hero strong {
    font-size: 22px;
    color: #0f2d5c;
}

.bd-leitner-bundle-hero span {
    font-size: 15px;
    color: #334155;
    line-height: 1.7;
}

.bd-leitner-bundle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.bd-leitner-bundle-card {
    display: grid;
    gap: 8px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid #d7e3f7;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 45, 92, 0.06);
}

.bd-leitner-bundle-badge {
    display: inline-flex;
    width: fit-content;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    color: #1e4a8a;
    background: rgba(42, 109, 246, 0.12);
}

.bd-leitner-bundle-card.is-fa-de .bd-leitner-bundle-badge {
    color: #7c2d12;
    background: rgba(234, 88, 12, 0.12);
}

.bd-leitner-bundle-card.is-de-de .bd-leitner-bundle-badge {
    color: #14532d;
    background: rgba(22, 163, 74, 0.12);
}

.bd-leitner-bundle-prompt {
    font-size: 18px;
    font-weight: 800;
    color: #0f2d5c;
    line-height: 1.5;
}

.bd-leitner-bundle-answer {
    font-size: 14px;
    color: #334155;
    line-height: 1.7;
    padding-top: 6px;
    border-top: 1px dashed #dbe5f5;
}

.bd-leitner-bundle-hint {
    margin: 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.6;
}

.bd-leitner-bundle-example {
    margin: 0;
    font-size: 12px;
    color: #64748b;
    font-style: italic;
    line-height: 1.6;
}

.bd-leitner-options.is-grammar-mode {
    margin-top: 4px;
}

.bd-leitner-options[hidden] {
    display: none !important;
}

@media (max-width: 720px) {
    .bd-leitner-section-nav {
        flex-direction: column;
    }

    .bd-leitner-session-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .bd-leitner-daily-goal {
        justify-content: center;
    }

    .bd-leitner-vocab-grid {
        grid-template-columns: 1fr;
    }

    .bd-leitner-heatmap {
        grid-template-columns: repeat(14, minmax(22px, 1fr));
        gap: 4px;
        scroll-snap-type: x proximity;
    }

    .bd-leitner-heatmap-cell {
        min-width: 22px;
        min-height: 22px;
    }
}

/* Progress heatmap, sentence drill, CSV I/O */
.bd-leitner-progress-shell {
    background: #f8fbff;
    border: 1px solid #dbe6f9;
    border-radius: 18px;
    padding: 16px;
}

.bd-leitner-progress-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.bd-leitner-progress-stat {
    background: #fff;
    border: 1px solid #dce7fb;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bd-leitner-progress-stat span {
    font-size: 11px;
    color: #64748b;
}

.bd-leitner-progress-stat strong {
    font-size: 20px;
    color: #12284f;
}

.bd-leitner-heatmap-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.bd-leitner-heatmap-head h3 {
    margin: 0;
    font-size: 16px;
    color: #102547;
}

.bd-leitner-heatmap-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #64748b;
}

.bd-leitner-heatmap-scale {
    display: inline-flex;
    gap: 3px;
}

.bd-leitner-heatmap-scale::before {
    content: '';
    display: inline-flex;
    gap: 3px;
    width: 52px;
    height: 10px;
    border-radius: 3px;
    background: linear-gradient(90deg, #ebedf0, #9be9a8, #40c463, #30a14e, #216e39);
}

.bd-leitner-heatmap {
    display: grid;
    grid-template-columns: repeat(53, minmax(12px, 1fr));
    gap: 3px;
    overflow-x: auto;
    padding: 4px 0 8px;
    -webkit-overflow-scrolling: touch;
}

.bd-leitner-heatmap-cell {
    width: 100%;
    aspect-ratio: 1;
    min-width: 12px;
    min-height: 12px;
    border-radius: 3px;
    background: #ebedf0;
    transition: transform 0.15s ease;
    scroll-snap-align: start;
}

.bd-leitner-heatmap-cell:hover {
    transform: scale(1.15);
    outline: 1px solid #94a3b8;
}

.bd-leitner-heatmap-cell.is-level-1 { background: #9be9a8; }
.bd-leitner-heatmap-cell.is-level-2 { background: #40c463; }
.bd-leitner-heatmap-cell.is-level-3 { background: #30a14e; }
.bd-leitner-heatmap-cell.is-level-4 { background: #216e39; }

.bd-leitner-tab-breakdown {
    margin-top: 14px;
}

.bd-leitner-tab-breakdown h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #334155;
}

.bd-leitner-tab-breakdown-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bd-leitner-vocab-io {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.bd-leitner-import-label {
    cursor: pointer;
    margin: 0;
}

.bd-leitner-import-label input {
    display: none;
}

.bd-leitner-sentence-practice {
    display: grid;
    gap: 12px;
}

.bd-leitner-sentence-display {
    font-size: 20px;
    line-height: 1.7;
    color: #0f1f3d;
    padding: 14px;
    border-radius: 14px;
    background: #f8fbff;
    border: 1px dashed #c9daff;
    direction: ltr;
    text-align: left;
}

.bd-leitner-sentence-hint {
    margin: 0;
    font-size: 13px;
    color: #475569;
    line-height: 1.7;
}

.bd-leitner-sentence-actions {
    display: flex;
    gap: 8px;
}

.bd-leitner-sentence-input-wrap {
    display: grid;
    gap: 6px;
}

.bd-leitner-sentence-input-wrap span {
    font-size: 12px;
    color: #64748b;
}

.bd-leitner-sentence-input {
    border: 1px solid #d8dfef;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 16px;
    direction: ltr;
    text-align: left;
    background: #fff;
}

.bd-profile-scores {
    display: grid;
    gap: 14px;
}

.bd-profile-score-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.8fr);
    gap: 12px;
}

.bd-profile-score-main,
.bd-profile-score-confidence,
.bd-profile-score-card {
    border-radius: 16px;
    border: 1px solid rgba(174, 194, 229, 0.34);
    background: rgba(255,255,255,0.72);
    box-shadow: var(--bd-shadow-subtle);
}

.bd-profile-score-main,
.bd-profile-score-confidence {
    padding: 16px;
    display: grid;
    gap: 6px;
}

.bd-profile-score-main span,
.bd-profile-score-confidence span,
.bd-profile-score-card span {
    color: var(--bd-text-secondary);
    font-size: 12px;
}

.bd-profile-score-main strong,
.bd-profile-score-confidence strong,
.bd-profile-score-card strong {
    color: var(--bd-text-primary);
}

.bd-profile-score-main strong {
    font-size: 30px;
}

.bd-profile-score-main em {
    font-style: normal;
    color: var(--bd-accent);
    font-weight: 800;
}

.bd-profile-score-confidence strong {
    font-size: 22px;
}

.bd-profile-score-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.bd-profile-score-card {
    padding: 14px;
    display: grid;
    gap: 4px;
}

.bd-profile-score-card strong {
    font-size: 22px;
}

@media (max-width: 720px) {
    .bd-profile-score-hero {
        grid-template-columns: 1fr;
    }
}

.bd-leitner-audio-practice[hidden],
.bd-leitner-sentence-practice[hidden],
.bd-leitner-audio-practice:not(.is-visible),
.bd-leitner-sentence-practice:not(.is-visible) {
    display: none !important;
}

.bd-leitner-audio-practice.is-visible,
.bd-leitner-sentence-practice.is-visible {
    display: grid;
    gap: 10px;
    margin-top: 8px;
}

.bd-leitner-audio-practice {
    gap: 10px;
    margin-top: 8px;
}

.bd-leitner-audio-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bd-leitner-audio-input-wrap {
    display: grid;
    gap: 6px;
}

.bd-leitner-audio-input-wrap span {
    color: #44556f;
    font-size: 12px;
    font-weight: 700;
}

.bd-leitner-audio-input {
    border: 1px solid #d7e3f7;
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
    font-size: 14px;
    color: #123154;
}

.bd-leitner-audio-transcript {
    min-height: 24px;
    font-size: 12px;
    color: #42556f;
    line-height: 1.8;
}

/* Shared UI system alignment */
.bd-auth-wrapper {
    background: radial-gradient(circle at top, var(--bd-bg-start, #f3f6ff) 0%, var(--bd-bg-end, #fdf2f8) 40%, #f7faff 100%);
}

.bd-auth-card,
.bd-profile-card,
.bd-leitner-panel,
.bd-leitner-practice-card,
.bd-leitner-box-board,
.bd-profile-score-hero {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(244, 248, 255, 0.82));
    border-color: var(--bd-ui-border);
    box-shadow: var(--bd-ui-shadow);
}

.bd-profile-card {
    border-radius: var(--bd-ui-radius-xl);
}

.bd-profile-tabs,
.bd-profile-mobile-nav {
    background: rgba(237, 243, 253, 0.88);
    border: 1px solid rgba(209, 222, 243, 0.95);
}

.bd-profile-mobile-tab,
.bd-leitner-tab,
.bd-auth-tab {
    min-height: 44px;
}

.bd-profile-mobile-tab.is-active,
.bd-leitner-tab.is-active,
.bd-auth-tab.is-active {
    background: linear-gradient(135deg, var(--bd-ui-primary), var(--bd-ui-primary-strong));
    color: #fff;
    box-shadow: 0 16px 28px rgba(42, 109, 246, 0.22);
}

.bd-auth-btn,
.bd-profile-secondary,
.bd-leitner-practice-actions .bd-auth-btn,
.bd-leitner-practice-actions .bd-profile-secondary,
.bd-verify-modal-actions .bd-auth-btn {
    border-radius: 14px;
    min-height: 46px;
    box-shadow: 0 14px 28px rgba(31, 88, 185, 0.14);
}

.bd-profile-nav-btn,
.bd-profile-score-tag,
.bd-leitner-chip,
.bd-leitner-meta-pill,
.bd-leitner-smart-badge {
    border: 1px solid var(--bd-ui-chip-border);
    background: var(--bd-ui-chip);
}

.bd-profile-score-card,
.bd-profile-stat-card,
.bd-leitner-dashboard-card,
.bd-leitner-smart-metric,
.bd-leitner-recommendation-item,
.bd-leitner-session-item,
.bd-leitner-box-row {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(241, 247, 255, 0.76));
    border-color: var(--bd-ui-border-soft);
}

.bd-leitner-option-btn {
    border-radius: 16px;
    box-shadow: 0 10px 20px rgba(19, 45, 83, 0.08);
}

.bd-leitner-option-btn.is-selected,
.bd-leitner-option-btn.is-correct,
.bd-leitner-option-btn.is-wrong {
    box-shadow: 0 14px 26px rgba(19, 45, 83, 0.12);
}

.bd-profile-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 18px;
}

.bd-profile-ai-brief,
.bd-profile-ai-summary-card,
.bd-profile-focus-item,
.bd-profile-risk-flag {
    border-radius: 18px;
}

.bd-profile-ai-brief {
    display: grid;
    gap: 14px;
    padding: 18px;
    background: linear-gradient(145deg, rgba(255,255,255,0.92), rgba(238,245,255,0.82));
    border: 1px solid rgba(207, 222, 247, 0.96);
    box-shadow: var(--bd-ui-shadow-soft);
}

.bd-profile-ai-summary-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.bd-profile-ai-summary-card {
    padding: 14px;
    display: grid;
    gap: 4px;
    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(206, 220, 242, 0.88);
}

.bd-profile-ai-summary-card span,
.bd-profile-risk-flag,
.bd-profile-focus-item {
    color: var(--bd-text-secondary);
    font-size: 12px;
}

.bd-profile-ai-summary-card strong,
.bd-profile-coach-note {
    color: var(--bd-text-primary);
}

.bd-profile-coach-note {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(240, 246, 255, 0.92);
    border: 1px solid rgba(190, 210, 241, 0.9);
    line-height: 2;
    font-weight: 700;
}

.bd-profile-focus-plan,
.bd-profile-risk-flags {
    display: grid;
    gap: 8px;
}

.bd-profile-focus-item,
.bd-profile-risk-flag {
    padding: 12px 14px;
    background: rgba(255,255,255,0.76);
    border: 1px solid rgba(210, 222, 244, 0.88);
    line-height: 1.95;
}

.bd-profile-risk-flag {
    background: rgba(255, 245, 245, 0.9);
    border-color: rgba(245, 196, 205, 0.92);
    color: #a94462;
}

@media (max-width: 960px) {
    .bd-profile-dashboard-grid,
    .bd-profile-ai-summary-cards {
        grid-template-columns: 1fr;
    }
}

.bd-membership-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.bd-membership-summary-card,
.bd-membership-guidance-card,
.bd-plan-compare-note {
    border-radius: 18px;
    border: 1px solid rgba(208, 222, 244, 0.9);
    background: linear-gradient(145deg, rgba(255,255,255,0.92), rgba(241,247,255,0.82));
    box-shadow: var(--bd-ui-shadow-soft);
}

.bd-membership-summary-card {
    display: grid;
    gap: 6px;
    padding: 16px;
}

.bd-membership-summary-card span,
.bd-membership-guidance-card span,
.bd-plan-decision-hint,
.bd-plan-compare-note {
    color: var(--bd-text-secondary);
    font-size: 12px;
}

.bd-membership-summary-card strong,
.bd-membership-guidance-card strong {
    color: var(--bd-text-primary);
    font-size: clamp(0.92rem, 1.35vw, 1.02rem);
}

.bd-membership-summary-card small {
    color: #4d6082;
    line-height: 1.8;
}

.bd-membership-summary-card.is-primary {
    background: linear-gradient(145deg, rgba(233, 244, 255, 0.98), rgba(222, 238, 255, 0.9));
    border-color: rgba(174, 204, 244, 0.95);
}

.bd-membership-summary-card.is-warning {
    background: linear-gradient(145deg, rgba(255, 246, 230, 0.98), rgba(255, 238, 211, 0.92));
    border-color: rgba(245, 205, 139, 0.95);
}

.bd-membership-summary-card.is-ai {
    background: linear-gradient(145deg, rgba(243, 239, 255, 0.98), rgba(232, 238, 255, 0.92));
    border-color: rgba(197, 188, 248, 0.9);
}

.bd-membership-guidance-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.bd-membership-guidance-card {
    display: grid;
    gap: 8px;
    padding: 16px;
}

.bd-membership-guidance-card p {
    margin: 0;
    line-height: 1.9;
}

.bd-plan-card.is-recommended {
    border-color: rgba(106, 91, 236, 0.42);
    box-shadow: 0 22px 38px rgba(94, 81, 215, 0.16);
}

.bd-plan-card.is-best-value {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(241, 250, 244, 0.82));
}

.bd-plan-card.is-recommended::before {
    background: linear-gradient(90deg, rgba(104, 89, 232, 0.95), rgba(68, 141, 255, 0.88));
    opacity: 1;
}

.bd-plan-badge-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bd-plan-badge.is-recommended {
    background: linear-gradient(135deg, #6d28d9, #4f46e5);
}

.bd-plan-badge.is-neutral {
    background: linear-gradient(135deg, #0f766e, #0f9f8f);
}

.bd-plan-decision-hint {
    margin: 0;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(241, 246, 255, 0.88);
    border: 1px solid rgba(207, 221, 244, 0.9);
    line-height: 1.85;
}

.bd-plan-membership-note.is-urgent {
    background: rgba(255, 241, 219, 0.92);
    border-color: rgba(244, 199, 122, 0.92);
    color: #a45b00;
}

.bd-plan-compare-note {
    padding: 11px 12px;
    line-height: 1.75;
}

@media (max-width: 960px) {
    .bd-membership-summary-strip,
    .bd-membership-guidance-grid {
        grid-template-columns: 1fr;
    }

    .bd-placement-summary-head,
    .bd-placement-modal-top,
    .bd-placement-actions {
        grid-template-columns: 1fr;
        display: grid;
    }
}
