/* 🔓 Feature unlocks: profile menu, locked page, progress page. */

/* ---- Account menu (profile dropdown) ---- */
.dropdown-menu-custom.account-menu {
    width: 288px;
    min-width: 0;
    padding: 6px;
    border-radius: 14px;
    /* Always fits the screen; scrolls inside if a member has everything. */
    max-height: calc(100vh - 96px);
    max-height: calc(100dvh - 96px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    box-shadow: 0 12px 40px rgba(17, 24, 39, 0.14), 0 2px 6px rgba(17, 24, 39, 0.06);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.am-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    color: var(--text-color, #111827);
    text-decoration: none;
}

.am-head:hover { background: var(--accent-gray, #f5f5f5); }

.am-head__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #f3f4f6;
}

.am-head__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }

.am-head__name {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.am-head__sub { font-size: 0.78rem; color: #6b7280; }

.am-badge {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.am-start {
    display: block;
    margin: 2px 4px 6px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    color: var(--text-color, #111827);
    text-decoration: none;
}

.am-start:hover { border-color: #e5e7eb; }
.am-start__row { display: flex; justify-content: space-between; align-items: baseline; }
.am-start__title { font-weight: 700; font-size: 0.82rem; }
.am-start__count { font-size: 0.75rem; color: #6b7280; }
.am-start__next { display: block; margin-top: 6px; font-size: 0.8rem; color: #4b5563; }
.am-start__next i { font-size: 0.7rem; margin-left: 2px; }

.am-bar {
    display: block;
    height: 4px;
    margin-top: 6px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.am-bar > span { display: block; height: 100%; border-radius: 999px; background: #10b981; }

.am-write {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 4px 4px 6px;
    min-height: 40px;
    border-radius: 10px;
    background: #111827;
    color: #fff;
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
}

.am-write:hover { background: #000; color: #fff; }

.am-list { display: flex; flex-direction: column; }

.am-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 38px;
    padding: 0 10px;
    border-radius: 8px;
    color: var(--text-color, #111827);
    font-size: 0.88rem;
    text-decoration: none;
}

.am-item > i {
    width: 18px;
    text-align: center;
    color: #6b7280;
    font-size: 0.92rem;
    flex-shrink: 0;
}

.am-item:hover { background: var(--accent-gray, #f5f5f5); }
.am-item:hover > i { color: var(--text-color, #111827); }

.am-new {
    margin-left: auto;
    padding: 1px 7px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 0.66rem;
    font-weight: 700;
}

.am-divider {
    display: block;
    height: 1px;
    margin: 5px 10px;
    background: var(--border-color, #e5e7eb);
}

.am-unlock {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 6px 4px 2px;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px dashed #d1d5db;
    color: var(--text-color, #111827);
    text-decoration: none;
}

.am-unlock:hover { border-color: #9ca3af; background: #fafafa; }
.am-unlock > .fa-lock { width: 18px; text-align: center; color: #9ca3af; font-size: 0.85rem; }
.am-unlock__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.am-unlock__title { font-size: 0.85rem; font-weight: 600; }

.am-unlock__hint {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.am-chev { font-size: 0.7rem; color: #9ca3af; }

.am-foot {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.am-foot__link {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    border-radius: 8px;
    color: #4b5563;
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.am-foot__link:hover { background: var(--accent-gray, #f5f5f5); color: var(--text-color, #111827); }
.am-foot__link--out:hover { background: #fef2f2; color: #b91c1c; }

.account-menu a:focus-visible,
.profile-trigger:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

/* Small phones: a little narrower, never wider than the screen. */
@media (max-width: 380px) {
    .dropdown-menu-custom.account-menu { width: calc(100vw - 24px); }
}

@media (prefers-reduced-motion: reduce) {
    .dropdown-menu-custom.account-menu { transition: none; }
}

/* ---- Locked page + progress page ---- */
.locked {
    max-width: 560px;
    margin: 8rem auto 4rem;
    padding: 0 16px;
}

.locked--wide { max-width: 680px; }

.locked__icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.locked__title { font-weight: 800; font-size: 1.6rem; margin: 0 0 0.4rem; }
.locked__pitch { color: #4b5563; margin: 0 0 1.5rem; }
.locked__h2 { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #6b7280; margin: 0 0 0.5rem; }

.locked__needs { list-style: none; margin: 0 0 1rem; padding: 0; }

.locked__need {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.locked__need:first-child { border-top: 0; }
.locked__check { color: #d1d5db; }
.locked__need.is-met .locked__check { color: #10b981; }
.locked__label { flex: 1; min-width: 0; }
.locked__label a { color: inherit; }
.locked__count { font-size: 0.85rem; color: #6b7280; white-space: nowrap; }
.locked__need.is-met .locked__count { color: #047857; font-weight: 600; }

.locked__note { color: #6b7280; font-size: 0.9rem; }

.locked__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1.25rem; }

.locked__btn {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 1.1rem;
    border-radius: 999px;
    border: 1px solid #111827;
    color: #111827;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    white-space: nowrap;
}

.locked__btn--primary { background: #111827; color: #fff; }

.locked__btn:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; }

.up-card {
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.up-card.is-unlocked { background: #f9fafb; }
.up-card__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.up-card__title { font-size: 1.05rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.up-card__title i { color: #9ca3af; font-size: 0.9rem; }
.up-card.is-unlocked .up-card__title i { color: #10b981; }
.up-card__pitch { color: #4b5563; font-size: 0.9rem; margin: 0.35rem 0 0.5rem; }

/* Editor AI buttons that aren't unlocked yet */
.is-locked { opacity: 0.6; cursor: help; }
.is-locked .fa-lock { font-size: 0.75em; }
.wa-locked { display: flex; gap: 0.4rem; align-items: baseline; }
