/* ==================== V-MENTOR AI 2026 - RESPONSIVE & CROSS-DEVICE POLISH ==================== */
/* Tối ưu hiển thị cho PC, Tablet và Mobile */

:root {
    --header-height: 72px;
}

@media (max-width: 768px) {
    :root {
        --header-height: 64px;
    }
}

@media (max-width: 480px) {
    :root {
        --header-height: 58px;
    }
}

/* ==================== GLOBAL SAFETY & TYPOGRAPHY ==================== */
html,
body {
    max-width: 100%;
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

h1,
h2,
h3,
h4,
h5,
p,
li,
.question-main,
.question-situation,
.step-title,
.step-desc,
.career-card,
.modal-content,
.test-result-title {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

img,
svg,
video {
    max-width: 100%;
    height: auto;
}

/* Ẩn widget chatbot cũ bị trùng với ChatbotV3 */
.chatbot-widget {
    display: none !important;
}

/* ==================== CONTAINER & HEADER ==================== */
.container {
    width: 100%;
    max-width: var(--container-width, 1200px);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0;
    min-height: var(--header-height);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: clamp(1.05rem, 2vw, 1.45rem);
    font-weight: 700;
    flex-shrink: 0;
    white-space: nowrap;
}

.logo i {
    font-size: 1.5em;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    font-size: 0.95rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.header-actions .btn {
    white-space: nowrap;
}

/* Dark-mode outline buttons */
[data-theme="dark"] .btn-outline {
    background: rgba(255, 255, 255, 0.06);
    color: #f7f4ee;
    border-color: rgba(255, 255, 255, 0.22);
}

[data-theme="dark"] .btn-outline:hover {
    background: rgba(255, 218, 159, 0.14);
    border-color: #ffda9f;
    color: #ffda9f;
}

/* Mobile Hamburger & Drawer */
.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color, #e5e7eb);
    background: var(--bg-input, #f9fafb);
    color: var(--text-primary, #1f2937);
    font-size: 1.05rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
    border-color: var(--at-gold, #ffda9f);
    color: var(--at-gold, #ffda9f);
}

.mobile-nav-drawer {
    display: none;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.85rem 1.15rem 1.1rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
    background: var(--bg-card, #ffffff);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.24);
}

.mobile-nav-drawer.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 44px;
    padding: 0.65rem 1rem;
    border-radius: 9999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary, #1f2937);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.mobile-nav-link i {
    width: 20px;
    text-align: center;
    color: var(--at-gold, #c9923d);
}

.mobile-nav-link:hover,
.mobile-nav-link:active {
    background: var(--bg-hover, #f3f4f6);
    color: var(--at-gold, #c9923d);
}

[data-theme="dark"] .mobile-menu-btn {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.16);
    color: #f7f4ee;
}

[data-theme="dark"] .mobile-nav-drawer {
    background: #1e1b14;
    border-top-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .mobile-nav-link {
    color: #f7f4ee;
}

[data-theme="dark"] .mobile-nav-link:hover {
    background: rgba(255, 218, 159, 0.12);
    color: #ffda9f;
}

@media (min-width: 1025px) {
    .mobile-nav-drawer,
    .mobile-nav-drawer.active {
        display: none !important;
    }
}

@media (max-width: 1200px) and (min-width: 1025px) {
    .nav {
        gap: 1rem;
    }

    .nav-link {
        font-size: 0.88rem;
    }

    .header-actions {
        gap: 0.45rem;
    }

    .header-actions .btn {
        padding: 0.55rem 0.95rem;
        font-size: 0.84rem;
    }
}

@media (max-width: 1024px) {
    .container {
        padding: 0 1.25rem;
    }

    .header .nav {
        display: none;
    }

    .mobile-menu-btn {
        display: inline-flex;
    }
}

@media (max-width: 768px) {
    .header-actions .theme-toggle-btn {
        padding: 0.4rem 0.6rem;
        gap: 0.35rem;
    }

    #theme-label {
        display: none;
    }

    .header-actions .btn {
        padding: 0.5rem 0.85rem;
        font-size: 0.82rem;
    }

    .user-profile-btn {
        padding: 0.35rem 0.7rem;
        gap: 0.5rem;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .user-name {
        max-width: 110px;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 0.85rem;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 540px) {
    .container {
        padding: 0 0.85rem !important;
    }

    .header-content {
        gap: 0.45rem;
        padding: 0.55rem 0 !important;
    }

    .logo {
        font-size: 0.96rem !important;
        gap: 0.4rem !important;
    }

    .logo i {
        width: 30px;
        height: 30px;
        font-size: 0.84rem !important;
    }

    .logo .badge {
        display: none;
    }

    #loginBtn i,
    #registerBtn i {
        display: none;
    }

    .header-actions {
        gap: 0.35rem;
    }

    .header-actions .theme-toggle-btn {
        width: 34px;
        height: 34px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }

    .mobile-menu-btn {
        width: 34px;
        height: 34px;
        font-size: 0.92rem;
    }

    .theme-toggle-btn .toggle-track {
        display: none;
    }

    .user-profile-btn {
        padding: 0.25rem 0.5rem;
        gap: 0.35rem;
    }

    .user-name {
        display: none;
    }

    .header-actions .btn {
        padding: 0.42rem 0.68rem;
        font-size: 0.76rem;
        gap: 0.25rem;
    }

    .user-dropdown {
        position: fixed;
        top: calc(var(--header-height) + 8px);
        right: 0.75rem;
        left: auto;
        width: min(280px, calc(100vw - 1.5rem));
    }
}

@media (max-width: 420px) {
    .container {
        padding: 0 0.7rem !important;
    }

    .header-content {
        gap: 0.3rem;
        padding: 0.5rem 0 !important;
    }

    .logo {
        font-size: 0.88rem !important;
        gap: 0.32rem !important;
    }

    .logo i {
        width: 28px;
        height: 28px;
        font-size: 0.78rem !important;
    }

    .header-actions {
        gap: 0.26rem;
    }

    .header-actions .theme-toggle-btn,
    .mobile-menu-btn {
        width: 32px;
        height: 32px;
        font-size: 0.86rem;
    }

    .header-actions .btn {
        padding: 0.38rem 0.54rem;
        font-size: 0.72rem;
    }
}

/* ==================== HERO SECTION ==================== */
.hero {
    min-height: calc(100svh - var(--header-height));
    height: auto;
    padding: 3.5rem 0;
}

.hero-content {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.hero-title {
    font-size: clamp(1.85rem, 4.6vw, 3.5rem);
    line-height: 1.18;
    margin-bottom: 1.25rem;
}

.hero-subtitle {
    font-size: clamp(0.95rem, 1.8vw, 1.2rem);
    line-height: 1.65;
    max-width: 680px;
    margin: 0 auto 2.25rem;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.25rem;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    justify-content: center;
}

@media (max-width: 991px) {
    .hero {
        padding: 2.75rem 0;
    }

    .hero-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }

    .stat-card {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 540px) {
    .hero {
        padding: 2rem 0;
    }

    .hero-subtitle {
        margin-bottom: 1.5rem;
    }

    .hero-cta {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hero-stats {
        gap: 0.75rem;
        margin-bottom: 1.75rem;
    }

    .stat-card {
        padding: 1.15rem 0.85rem;
    }

    .stat-number {
        font-size: 1.75rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }
}

/* ==================== TEST FLOW (STEPS 1-6) ==================== */
.progress-bar-sticky {
    top: var(--header-height);
    padding: 0.75rem 0;
}

.steps-indicator {
    max-width: var(--container-width, 1200px);
    margin: 1.75rem auto;
    padding: 0 1.5rem;
}

.step-title {
    font-size: clamp(1.2rem, 3vw, 1.9rem);
    line-height: 1.3;
    align-items: flex-start;
    gap: 0.65rem;
}

.step-desc {
    font-size: clamp(0.88rem, 1.6vw, 1.05rem);
    line-height: 1.55;
}

.rating-scale {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.rating-option {
    min-width: 0;
}

.rating-option label {
    padding: 0.7rem 0.5rem;
    font-size: 0.88rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.subject-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
    gap: 0.75rem;
}

.edu-type-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    max-width: 600px;
    margin: 0 auto;
}

.voca-jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 155px), 1fr));
    gap: 0.5rem;
}

.career-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
    gap: 1.15rem;
}

.step-footer {
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Dark mode support for test cards & selectors */
[data-theme="dark"] .holland-group-header p {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .subject-checkbox-item label {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .subject-checkbox-item .subject-name {
    color: var(--text-primary);
}

[data-theme="dark"] .subject-checkbox-item input[type="checkbox"]:checked + label {
    background: rgba(102, 126, 234, 0.22);
    border-color: #818cf8;
}

[data-theme="dark"] .subject-checkbox-item input[type="checkbox"]:checked + label .subject-name {
    color: #c7d2fe;
}

[data-theme="dark"] .edu-type-card {
    background: var(--bg-secondary);
    border-color: var(--border-color) !important;
    color: var(--text-primary);
}

[data-theme="dark"] #vocaJobSelection {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] #vocaJobSelection p {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .voca-option {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

@media (max-width: 991px) {
    .test-container {
        padding: 2rem 1.5rem;
        margin: 1.25rem 0;
    }
}

@media (max-width: 768px) {
    .steps-indicator {
        padding: 0 0.75rem;
        margin: 1.25rem auto;
    }

    .steps-indicator::before {
        top: 16px;
        left: 1.5rem;
        right: 1.5rem;
    }

    .step-circle {
        width: 32px;
        height: 32px;
        font-size: 0.82rem;
    }

    .step-label {
        font-size: 0.72rem;
        line-height: 1.2;
    }

    .step-header {
        margin-bottom: 1.75rem;
    }

    .rating-scale {
        gap: 0.45rem;
    }

    .rating-option label {
        padding: 0.6rem 0.3rem;
        font-size: 0.78rem;
    }
}

@media (max-width: 640px) {
    .test-container {
        padding: 1.25rem 1rem;
        margin: 1rem 0;
        border-radius: 0.85rem;
    }

    .question-card {
        padding: 1.15rem 1rem;
    }

    .holland-group-header {
        padding: 1rem !important;
    }

    .holland-group-header span:first-child {
        font-size: 1.5rem !important;
    }
}

@media (max-width: 600px) {
    .career-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 540px) {
    .rating-scale {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .rating-option:last-child {
        grid-column: 1 / -1;
    }

    .rating-option label {
        padding: 0.68rem 0.5rem;
        font-size: 0.85rem;
        min-height: 44px;
    }

    .subject-checkbox-item label {
        padding: 0.8rem 0.9rem;
        gap: 0.55rem;
    }

    .subject-checkbox-item .subject-icon {
        font-size: 1.25rem;
    }

    .subject-checkbox-item .subject-name {
        font-size: 0.88rem;
    }
}

@media (max-width: 480px) {
    .steps-indicator {
        padding: 0 0.35rem;
        gap: 0.15rem;
    }

    .steps-indicator::before {
        top: 14px;
        left: 1rem;
        right: 1rem;
    }

    .step-circle {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .step-label {
        font-size: 0.65rem;
    }

    .edu-type-grid {
        grid-template-columns: 1fr;
    }

    .step-footer .btn-large {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
        flex: 1 1 auto;
    }
}

/* ==================== RESULTS PAGE ==================== */
.results-hero-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: clamp(2rem, 5vw, 3.75rem) clamp(1.25rem, 4vw, 2rem);
    border-radius: 1rem;
    text-align: center;
    margin-bottom: 2rem;
}

.results-hero-card h1 {
    font-size: clamp(2rem, 6vw, 3rem);
    margin-bottom: 0.75rem;
}

.results-hero-card h2 {
    font-size: clamp(1.3rem, 4vw, 2rem);
    opacity: 0.95;
}

.results-hero-card p {
    font-size: clamp(0.95rem, 2.2vw, 1.2rem);
    opacity: 0.85;
    margin-top: 0.75rem;
}

.results-detail-card {
    background: var(--bg-card, #ffffff);
    padding: clamp(1.25rem, 4vw, 3rem);
    border-radius: 1rem;
    box-shadow: var(--shadow-card, 0 10px 15px -3px rgb(0 0 0 / 0.1));
}

.results-uni-card {
    padding: 1.25rem;
    background: #f9fafb;
    border-radius: 0.65rem;
    border-left: 4px solid #6366f1;
}

.results-salary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.results-salary-card {
    text-align: center;
    padding: 1.35rem 1rem;
    border-radius: 0.75rem;
}

.results-salary-card.entry {
    background: #f0fdf4;
}

.results-salary-card.mid {
    background: #dbeafe;
}

.results-salary-card.senior {
    background: #fef3c7;
}

.results-roadmap-item {
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: #f9fafb;
    border-radius: 0.6rem;
    border-left: 4px solid #6366f1;
}

.results-challenges-box {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    padding: clamp(1.15rem, 3vw, 2rem);
    border-radius: 1rem;
    border: 2px solid #fecaca;
}

.results-stories-box {
    background: linear-gradient(135deg, #fef3c7, #fed6e3);
    padding: clamp(1.15rem, 3vw, 2rem);
    border-radius: 1rem;
    border: 2px solid #fde68a;
}

.results-actions-bar {
    margin-top: 2.25rem;
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
}

[data-theme="dark"] .results-detail-card {
    background: var(--bg-card);
    color: var(--text-primary);
}

[data-theme="dark"] .results-uni-card,
[data-theme="dark"] .results-roadmap-item {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

[data-theme="dark"] .results-uni-card p {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .results-salary-card.entry {
    background: rgba(16, 185, 129, 0.14);
}

[data-theme="dark"] .results-salary-card.mid {
    background: rgba(37, 99, 235, 0.16);
}

[data-theme="dark"] .results-salary-card.senior {
    background: rgba(245, 158, 11, 0.16);
}

[data-theme="dark"] .results-challenges-box {
    background: rgba(127, 29, 29, 0.25);
    border-color: rgba(248, 113, 113, 0.35);
}

[data-theme="dark"] .results-stories-box {
    background: rgba(120, 53, 15, 0.25);
    border-color: rgba(251, 191, 36, 0.35);
}

@media (max-width: 768px) {
    .results-salary-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }
}

@media (max-width: 540px) {
    .results-actions-bar {
        flex-direction: column;
    }

    .results-actions-bar .btn {
        width: 100%;
    }
}

/* ==================== COMPARISON MODAL ==================== */
.comparison-modal-container {
    max-width: 1200px;
    width: 100%;
}

.comparison-modal-body {
    padding: 1.5rem 2rem;
    max-height: 70vh;
    overflow-y: auto;
}

.comparison-grid-header,
.comparison-grid-row {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.comparison-grid-row {
    padding: 1rem;
    background: white;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
}

.comparison-label-cell {
    font-weight: 700;
    color: #374151;
    display: flex;
    align-items: center;
}

.comparison-value-cell {
    color: #6b7280;
    line-height: 1.6;
    min-width: 0;
}

.comparison-modal-footer {
    padding: 1.5rem 2rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 1.5rem 1.5rem;
}

[data-theme="dark"] .comparison-grid-row {
    background: var(--bg-card);
    border-color: var(--border-color);
}

[data-theme="dark"] .comparison-label-cell {
    color: var(--text-primary);
}

[data-theme="dark"] .comparison-value-cell,
[data-theme="dark"] .comparison-value-cell strong,
[data-theme="dark"] .comparison-value-cell span {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .comparison-modal-footer {
    background: var(--bg-secondary);
    border-top-color: var(--border-color);
}

[data-theme="dark"] .comparison-modal-footer label {
    color: var(--text-primary) !important;
}

@media (max-width: 899px) {
    .comparison-grid-header,
    .comparison-grid-row {
        grid-template-columns: 135px minmax(0, 1fr) minmax(0, 1fr);
        gap: 0.75rem;
    }

    .comparison-modal-body {
        padding: 1.25rem;
    }
}

@media (max-width: 640px) {
    .comparison-modal-header {
        padding: 1.15rem 3.25rem 1.15rem 1.15rem !important;
    }

    .comparison-modal-header h2 {
        font-size: 1.25rem !important;
        gap: 0.55rem !important;
    }

    .comparison-modal-header p {
        font-size: 0.85rem;
    }

    .comparison-modal-header .modal-close-btn {
        top: 1rem !important;
        right: 1rem !important;
        width: 34px !important;
        height: 34px !important;
        font-size: 1rem !important;
    }

    .comparison-modal-body {
        padding: 1rem;
        max-height: 66vh;
    }

    .comparison-grid-header {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }

    .comparison-header-spacer {
        display: none;
    }

    .comparison-grid-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
        padding: 0.85rem;
    }

    .comparison-label-cell {
        grid-column: 1 / -1;
        border-bottom: 1px solid var(--border-color, #e5e7eb);
        padding-bottom: 0.45rem;
        font-size: 0.9rem;
    }

    .comparison-value-cell {
        font-size: 0.85rem;
    }

    .comparison-modal-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
        padding: 1rem 1.25rem;
    }

    .comparison-modal-footer .btn {
        width: 100%;
    }
}

/* ==================== MODALS, AUTH, ACCOUNT, CHATBOT & FOOTER ==================== */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 0.75rem;
    }

    .modal-container {
        margin: 0;
        max-height: 94vh;
        border-radius: 1.15rem;
    }

    .modal-header-bg {
        height: auto;
        min-height: 180px;
    }

    .modal-header-overlay {
        position: relative;
        padding: 3.25rem 1.25rem 1.25rem;
    }

    .modal-title {
        font-size: 1.35rem;
    }

    .modal-icon {
        font-size: 2.2rem;
    }

    .modal-body {
        padding: 1.25rem;
    }

    .match-score-badge {
        padding: 1rem 1.25rem;
        gap: 1rem;
        flex-wrap: wrap;
    }

    .ai-explanation-section,
    .ai-impact-section,
    .ai-impact-meter {
        padding: 1.15rem;
    }

    .ai-reason-card {
        flex-wrap: wrap;
        padding: 1rem;
        gap: 0.85rem;
    }

    .salary-level-title {
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .modal-cta {
        padding: 1rem 1.25rem;
    }

    .footer {
        padding: 2.5rem 0 1.5rem;
        margin-top: 3rem;
    }

    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 1.75rem !important;
    }
}

@media (max-width: 640px) {
    .modal-content {
        padding: 1.5rem 1.15rem;
        width: 94%;
        border-radius: 1rem;
    }

    .team-info-header {
        flex-direction: column;
        text-align: center;
        gap: 0.85rem;
    }

    .auth-overlay {
        padding: 0.65rem;
    }

    .auth-header,
    .account-modal-header {
        padding: 1.35rem 1.15rem;
    }

    .auth-body,
    .account-modal-body {
        padding: 1.15rem;
    }

    .account-header-user {
        gap: 0.85rem;
    }

    .account-avatar-large {
        width: 52px;
        height: 52px;
        font-size: 1.25rem;
    }

    .account-header-meta {
        min-width: 0;
    }

    .account-header-meta .auth-subtitle {
        word-break: break-all;
    }

    .account-stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .account-stat-box {
        padding: 0.7rem 0.45rem;
    }

    .account-stat-value {
        font-size: 1.05rem;
    }

    .account-stat-label {
        font-size: 0.7rem;
    }

    .test-result-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .history-card {
        padding: 1rem;
    }

    .history-card-actions .btn {
        flex: 1 1 auto;
    }

    .result-save-banner {
        flex-direction: column;
        align-items: stretch;
        padding: 0.95rem 1rem;
    }

    .result-banner-actions .btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 540px) {
    .vm-toast-notify {
        top: calc(var(--header-height) + 10px);
        left: 0.75rem;
        right: 0.75rem;
        max-width: none;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .chatbot-fab {
        width: 52px;
        height: 52px;
        font-size: 1.25rem;
    }

    .chatbot-panel {
        top: 8vh;
        max-height: 92dvh;
        z-index: 3500;
    }

    .input-hint {
        flex-wrap: wrap;
        gap: 0.35rem;
    }
}

/* ==================== AI MEDIA STUDIO RESPONSIVE OVERRIDES ==================== */
@media (max-width: 768px) {
    .account-tabs {
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .account-tabs .auth-tab {
        flex: 1 1 auto;
        min-width: fit-content;
        padding: 0.58rem 0.65rem;
        font-size: 0.83rem;
        white-space: nowrap;
    }

    .ai-type-grid {
        grid-template-columns: 1fr;
    }

    .ai-queue-banner {
        flex-direction: column;
        align-items: stretch;
    }

    .ai-queue-card-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .ai-studio-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .ai-studio-actions .btn {
        width: 100%;
    }

    .ai-action-slot {
        flex: 1 1 auto;
    }

    .ai-action-slot .btn {
        width: 100%;
    }

    .ai-preview-actions .btn {
        flex: 1 1 auto;
    }

    .ai-preview-iframe {
        height: 60vh;
    }

    .ai-poster-preview-img {
        max-height: 58vh;
    }
}

@media (max-width: 480px) {
    .ai-studio-modal,
    .ai-preview-modal {
        width: 96vw;
        border-radius: 16px;
    }

    .ai-type-card {
        padding: 0.72rem 0.8rem;
    }

    .ai-style-chip {
        padding: 0.4rem 0.72rem;
        font-size: 0.78rem;
    }
}

/* ==================== ATELIER HERO & NAVIGATION RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
        max-width: 680px;
        margin: 0 auto;
        gap: 2.5rem;
    }

    .hero-content {
        text-align: center !important;
    }

    .hero-eyebrow {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-cta {
        justify-content: center !important;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 2.75rem 0 3.5rem !important;
        min-height: auto;
    }

    .hero-showcase-panel {
        border-radius: 24px;
        padding: 1.15rem;
        gap: 1rem;
    }

    .hero-scene-circle {
        width: 42px;
        height: 42px;
        font-size: 0.9rem;
    }

    .hero-scene-item span {
        font-size: 0.68rem;
    }

    .hero-stats {
        gap: 0.75rem !important;
    }

    .stat-card {
        padding: 1rem 0.9rem !important;
        border-radius: 18px !important;
    }
}

/* Duplicate <=540px header overrides folded above */

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem !important;
    }

    .hero-start-pill {
        width: 100%;
        justify-content: space-between;
        padding: 0.45rem 0.45rem 0.45rem 1.25rem !important;
    }

    .hero-cta .btn-outline {
        width: 100%;
    }

    .hero-scenes-row {
        gap: 0.45rem;
    }

    .hero-float-pill {
        font-size: 0.72rem;
    }
}
