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

/* ═══════════════════════════════════════════════════════════════════
   JoyA Design System — Layout
   ═══════════════════════════════════════════════════════════════════ */

[hidden] { display: none !important; }

/* ── Header ─────────────────────────────────────────────────────── */

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 2rem;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap; /* allow nav to wrap to next line on small screens */
}

.header__logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    order: 1;
    flex: 1 1 0%;
}

.header__icon {
    font-size: 1.8rem;
    color: var(--accent);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.header__logo .header__title {
    font-family: var(--font-heading);
    font-size: 2.6rem;
    font-weight: 700;
    font-style: normal;
    letter-spacing: 0.02em;
    background: linear-gradient(180deg, #fff2c8 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
    line-height: 1;
    margin: 0;
}

.header__pro-badge {
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--accent);
    background: rgba(245, 189, 65, 0.05);
    border: 1px solid rgba(245, 189, 65, 0.3);
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-left: 0.4rem;
    align-self: center;
    backdrop-filter: blur(4px);
    box-shadow: inset 0 0 8px rgba(245, 189, 65, 0.1);
    position: relative;
    overflow: hidden;
    margin-top: 0;
}

.header__calculated-person {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.8;
    margin-right: 0.5rem;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.header__tagline {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ── Page Navigation ─────────────────────────────────────────────── */

.page-nav {
    display: flex;
    justify-content: center;
    gap: 0;
    background: rgba(10, 10, 15, 0.6);
    border-bottom: 1px solid var(--border);
    transition: padding 0.3s ease, background 0.3s ease;
    flex-wrap: wrap; /* allow wrapping on small screens */
    width: 100%;
}

.page-nav__tab {
    background: none;
    border: none;
    padding: 0.6rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.nav-icon {
    font-size: 1.15em;
    line-height: 0;
    transform: translateY(0.15em);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.page-nav--stuck {
    background: transparent;
    border-bottom: none;
    box-shadow: none;
    flex: 0 1 auto;
    margin: 0;
    order: 2; /* sits between logo and right menu */
    padding: 0;
    width: auto;
}

.page-nav--stuck .page-nav__tab {
    padding: 0.4rem 0.85rem;
    font-size: 0.72rem;
}

.page-nav--stuck .page-nav__tab--locked {
    padding-right: 1.5rem;
}

@media (max-width: 1100px) {
    .page-nav--stuck {
        order: 4;
        flex: 1 1 100%;
        margin-top: 0.5rem;
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .page-nav--stuck::-webkit-scrollbar {
        display: none;
    }
}

.page-nav__tab:hover {
    color: var(--text-secondary);
}

.page-nav__tab--active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ── Main ───────────────────────────────────────────────────────── */

.main {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}


/* House Lords table row highlighting */
.house-lord--kendra td:first-child {
    border-left: 3px solid var(--success);
}

.house-lord--trikona td:first-child {
    border-left: 3px solid var(--color-vargottama);
}

.house-lord--dusthana td:first-child {
    border-left: 3px solid var(--danger);
}

.badge--debilitated {
    background: rgba(248, 113, 113, 0.15);
    color: var(--danger);
}

/* ── Section ────────────────────────────────────────────────────── */

.section {
    margin-bottom: 1.5rem;
}

.section__title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section__title::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.6;
    flex-shrink: 0;
}

/* ── Footer ─────────────────────────────────────────────────────── */

.footer {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: linear-gradient(180deg, transparent, rgba(245, 189, 65, 0.02));
}

/* ── Mode Toggle (Basic / Pro) ──────────────────────────────────── */

.mode-toggle {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
    margin-right: 0.75rem;
    height: 32px;
}

.mode-toggle__btn {
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 0 0.85rem;
    height: 100%;
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.03em;
}

.mode-toggle__btn:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
}

.mode-toggle__btn--active {
    background: rgba(245, 189, 65, 0.12);
    color: var(--accent);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* ── Language Switcher ──────────────────────────────────────────── */

.lang-switch {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
    margin-right: 0.75rem;
    height: 32px;
}

.lang-switch__btn {
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 0 0.65rem;
    height: 100%;
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.03em;
}

.lang-switch__btn:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
}

.lang-switch__btn--active {
    background: rgba(245, 189, 65, 0.12);
    color: var(--accent);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* ── Bento Box (Charts + Teaser Grid) ───────────────────────────── */

.bento-box {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-md);
}

@media (min-width: 960px) {
    .bento-box {
        grid-template-columns: 1fr 2.4fr;
        gap: var(--space-md);
    }
    .bento-box__charts {
        margin-left: -1rem;
    }
}

.bento-box__charts {
    min-width: 0; /* prevent SVG overflow */
}

/* ── Teaser (Экспресс-Досье) ────────────────────────────────────── */

.bento-box__teaser {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: var(--space-md) var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.bento-box__teaser::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #f97316, var(--accent));
    opacity: 0.7;
}

.teaser__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.teaser__title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent);
    margin: 0;
}

.teaser__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.teaser__item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    transition: border-color 0.2s;
}

.teaser__item:hover {
    border-color: rgba(245, 189, 65, 0.15);
}

.teaser__item--highlight {
    background: rgba(245, 189, 65, 0.05);
    border: 1px solid rgba(245, 189, 65, 0.25);
    padding: var(--space-md);
}
.teaser__item--highlight .teaser__item-label {
    font-size: 1.2rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}
.teaser__item--highlight .teaser__item-text {
    font-size: 1.05rem;
    line-height: 1.6;
}
.teaser__item--highlight .teaser__item-icon {
    width: 3.5rem;
    height: 3.5rem;
}

.teaser__item-icon {
    flex-shrink: 0;
    width: 2.2rem;
    height: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.teaser__item-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.teaser__item-text {
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.teaser__item-label {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--accent);
    display: block;
    margin-bottom: 0.2rem;
}

/* ── Teaser CTA ─────────────────────────────────────────────────── */

.teaser__cta {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.teaser__hook {
    font-size: 0.92rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 1.25rem 0;
    font-style: normal;
}

.teaser__hook b {
    color: var(--accent);
    font-weight: 600;
}

/* ── Bottom CTA Banner ────────────────────────────────────────────── */

.bottom-cta-banner {
    margin-top: 2rem;
    padding: 2.5rem 1.5rem;
    background: rgba(245, 189, 65, 0.03);
    border: 1px solid rgba(245, 189, 65, 0.15);
    border-radius: 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.bottom-cta-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), #f97316, transparent);
    opacity: 0.8;
}

.bottom-cta__inner {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.bottom-cta__title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--accent);
    margin: 0;
}

.bottom-cta__desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0 auto 0.8rem;
    max-width: 540px;
}


.page-nav__tab--locked {
    opacity: 0.6;
    cursor: pointer;
    position: relative;
    padding-right: 2rem;
}

.page-nav__tab--locked::after {
    content: "";
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0.75rem;
    height: 0.75rem;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='11' width='16' height='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='11' width='16' height='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") no-repeat center / contain;
    opacity: 0.7;
}

.page-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}
