@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseRing {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 199, 168, 0.36);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 16px rgba(34, 199, 168, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 199, 168, 0);
    }
}

.card-surface,
.feature-card,
.blog-card,
.hot-column,
.rec-card,
.history-card,
.action-card {
    background: var(--gradient-surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.loading-pulse {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary);
    animation: pulseRing 1.8s infinite;
    margin: 48px auto;
}

.tabs {
    display: inline-flex;
    gap: 12px;
    padding: 8px;
    background: rgba(7, 17, 26, 0.65);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-soft);
}

.tab-btn {
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-dim);
    padding: 12px 20px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-weight: 700;
}

.tab-btn.active {
    background: rgba(34, 199, 168, 0.14);
    border-color: rgba(34, 199, 168, 0.28);
    color: var(--text);
    box-shadow: inset 0 0 0 1px rgba(77, 163, 255, 0.1);
}

.section-content {
    display: none;
    animation: fadeInUp 0.45s ease;
}

.section-content.active {
    display: block;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px 18px;
    background: rgba(4, 10, 16, 0.78);
    backdrop-filter: blur(14px);
    z-index: 4000;
}

.modal-overlay.active {
    display: flex;
}

.modal-content,
.console-modal-content {
    position: relative;
    width: min(1100px, 100%);
    max-height: 90vh;
    overflow: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-strong);
    background: linear-gradient(180deg, rgba(16, 33, 49, 0.98), rgba(7, 17, 26, 0.98));
    box-shadow: var(--shadow-strong);
}

.modal-content {
    width: min(880px, 100%);
    padding: 30px 28px;
}

.console-modal-content {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: rgba(7, 17, 26, 0.82);
    color: var(--text);
    cursor: pointer;
}

.console-sidebar {
    padding: 28px 18px;
    border-right: 1px solid var(--border);
    background: rgba(7, 17, 26, 0.72);
    transition: width 0.2s ease, padding 0.2s ease;
}

.console-sidebar.collapsed {
    width: 92px;
    padding-inline: 12px;
}

.sidebar-header,
.console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.console-sidebar-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
}

.sidebar-toggle {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: rgba(19, 38, 54, 0.9);
    cursor: pointer;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    cursor: pointer;
}

.sidebar-item:hover,
.sidebar-item.active {
    color: var(--text);
    border-color: rgba(34, 199, 168, 0.24);
    background: rgba(34, 199, 168, 0.1);
}

.console-sidebar.collapsed .console-sidebar-title,
.console-sidebar.collapsed .sidebar-item span:not(.icon) {
    display: none;
}

.console-main {
    min-width: 0;
    padding: 28px;
}

.dropdown-divider {
    border-top: 1px solid var(--border);
    margin: 18px 0;
}

.loading-shell {
    min-height: 220px;
    display: grid;
    place-items: center;
}

.loading-message-block {
    display: grid;
    gap: 8px;
    text-align: center;
    max-width: 520px;
}

.loading-message-block h3 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.15rem, 2vw, 1.45rem);
}

.loading-message-block p {
    margin: 0;
    color: var(--text-dim);
    font-size: 0.96rem;
    line-height: 1.6;
}

.loading-disclaimer,
.result-top-notice,
.hero-disclaimer {
    border: 1px solid rgba(110, 154, 186, 0.18);
    background: rgba(7, 17, 26, 0.44);
    color: var(--text-dim);
    border-radius: var(--radius-md);
    font-size: 0.84rem;
    line-height: 1.6;
}

.loading-disclaimer,
.result-top-notice {
    margin-top: 14px;
    padding: 12px 14px;
}

.hero-disclaimer {
    margin-top: 16px;
    padding: 14px 16px;
}

.disclaimer-consent-modal {
    width: min(640px, 100%);
}

.consent-header h2 {
    margin: 0 0 10px;
    color: var(--text);
}

.consent-header p {
    margin: 0 0 18px;
    color: var(--text-dim);
    line-height: 1.65;
}

.consent-check {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(19, 38, 54, 0.54);
    color: var(--text);
}

.consent-check input {
    margin-top: 3px;
}

.consent-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 22px;
}

.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: rgba(19, 38, 54, 0.8);
    color: var(--text);
    cursor: pointer;
}

.consent-confirm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 900px) {
    .console-modal-content {
        grid-template-columns: 1fr;
    }

    .console-sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .sidebar-toggle {
        display: none;
    }
}

@media (max-width: 640px) {
    .modal-overlay {
        padding: 12px;
    }

    .modal-content,
    .console-main {
        padding: 22px 18px;
    }

    .modal-close {
        top: 12px;
        right: 12px;
    }
}

.legal-notice {
    margin-top: 24px;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(110, 154, 186, 0.16);
    background: rgba(7, 17, 26, 0.56);
    color: var(--text-dim);
    font-size: 0.84rem;
    line-height: 1.65;
}

.legal-notice strong {
    display: inline-block;
    margin-bottom: 6px;
    color: var(--text);
    font-size: 0.92rem;
}

.legal-notice-modal {
    margin-top: 22px;
}

.legal-notice-console {
    margin-top: 28px;
}

.page-legal-wrap {
    padding: 28px 0 42px;
}

@media (max-width: 640px) {
    .legal-notice {
        padding: 14px 15px;
        font-size: 0.8rem;
    }

    .consent-actions {
        flex-direction: column-reverse;
    }

    .secondary-button,
    .consent-confirm-btn {
        width: 100%;
    }
}
