/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a6bff;
    --primary-hover: #3a5bef;
    --secondary-color: #f8f9fa;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #e9ecef;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Utility class for hiding elements */
.hidden {
    display: none !important;
}

body, html {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--secondary-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    scrollbar-color: #ffb300 #f8fafd;
    scrollbar-width: thin;
}

.container {
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 5vw, 2rem);
}

.container-wide {
    width: 100%;
    max-width: calc(1200px + 320px + 1rem);
    margin: 0 auto;
    padding: 0;
}

.container-wide:has(.header-content) {
    background: linear-gradient(135deg, #f0f4ff 0%, #e3eaff 100%);
    box-shadow: 
        0 4px 16px rgba(58,123,213,0.08),
        0 2px 8px rgba(58,123,213,0.05);
    border-radius: 12px;
    border: 1px solid rgba(58,123,213,0.1);
    padding: 0.8rem 0;
}

/* Header styles */
.top-section {
    display: none;
}

.site-header {
    background: linear-gradient(90deg, #ffd180 0%, #ffe0b2 50%, #ffd180 100%);
    padding: 0.3rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    margin-bottom: 0.7rem;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.08);
}

.site-header .container-wide {
    border-radius: 0 0 16px 16px;
    overflow: hidden;
}

.content > .header-content {
    display: none;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    width: 100%;
    background: linear-gradient(135deg, #f0f4ff 0%, #e3eaff 100%);
    box-shadow: 
        0 4px 16px rgba(58,123,213,0.08),
        0 2px 8px rgba(58,123,213,0.05);
    border-radius: 12px;
    border: 1px solid rgba(58,123,213,0.1);
    padding: 1.5rem;
}

.logo img {
    height: clamp(80px, 12vw, 120px);
    width: auto;
    transition: var(--transition);
    margin: 0;
}

.logo img:hover {
    transform: scale(1.05);
}

.site-title {
    flex: 1;
    margin: 0;
}

.site-title h1, .site-title p {
    font-family: 'Fira Mono', 'JetBrains Mono', 'Consolas', 'Menlo', 'monospace';
}

.site-title h1 {
    font-size: clamp(1.7rem, 4vw, 2.3rem);
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
    white-space: nowrap;
}

.title-keyword { color: #3a7bd5; }
.title-accent {
    position: relative;
    color: #ffb300;
}
.title-accent::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 2px;
    height: 100%;
    border-right: 2px solid #ffb300;
    animation: blink-cursor 1s steps(1) infinite;
    display: inline-block;
    vertical-align: -0.1em;
}
@keyframes blink-cursor {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

h2, h3 {
    font-family: 'Fira Mono', 'JetBrains Mono', 'Consolas', 'Menlo', 'monospace';
    font-weight: 700;
    letter-spacing: 0.2px;
}
h2 {
    font-size: 2rem;
}
h3 {
    font-size: 1.2rem;
}

.site-title p {
    font-size: clamp(0.875rem, 2vw, 1rem);
    color: var(--text-light);
    margin-bottom: 0;
}

/* Navigation styles */
nav, #professions-nav {
    display: flex;
    gap: 0.8rem 0.1rem;
    margin-bottom: 0.1rem;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
}

.nav-btn, .level-btn {
    font-family: 'Fira Mono', 'JetBrains Mono', 'Consolas', 'Menlo', 'monospace';
    font-size: 1rem;
    padding: 0.1rem 0.4rem;
    border: 2px solid var(--border-color);
    background-color: #fff;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    min-height: 36px;
    line-height: 1.15;
    white-space: nowrap;
}

.nav-btn:hover, .level-btn:hover {
    background-color: var(--secondary-color);
    border-color: var(--primary-color);
}

.nav-btn.selected, .level-btn.selected {
    background: linear-gradient(90deg, #3a7bd5 0%, #4a6bff 100%);
    color: #fff;
    border-color: #3a7bd5;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(58,123,213,0.13);
    transition: background 0.2s, box-shadow 0.2s, color 0.2s;
}

.nav-btn {
    color: #444 !important;
    font-weight: 400;
}
.nav-btn .keyword { font-weight: 700; }
.nav-btn:nth-child(1) .keyword { color: #3a7bd5; }
.nav-btn:nth-child(2) .keyword { color: #e67e22; }
.nav-btn:nth-child(3) .keyword { color: #27ae60; }
.nav-btn:nth-child(4) .keyword { color: #b84592; }
.nav-btn:nth-child(5) .keyword { color: #2980b9; }
.nav-btn:nth-child(6) .keyword { color: #8e44ad; }
.nav-btn:nth-child(7) .keyword { color: #c0392b; }
.nav-btn:nth-child(8) .keyword { color: #16a085; }
.nav-btn:nth-child(9) .keyword { color: #f39c12; }
.nav-btn:nth-child(10) .keyword { color: #0097a7; }
.nav-btn:nth-child(11) .keyword { color: #d35400; }
.nav-btn:nth-child(12) .keyword { color: #7b1fa2; }
.nav-btn:nth-child(13) .keyword { color: #00bcd4; }
.nav-btn:nth-child(14) .keyword { color: #e91e63; }
.nav-btn:nth-child(15) .keyword { color: #43a047; }
.nav-btn:nth-child(16) .keyword { color: #f44336; }
.nav-btn:nth-child(17) .keyword { color: #6d4c41; }
.nav-btn:nth-child(18) .keyword { color: #00bfae; }
.nav-btn:nth-child(19) .keyword { color: #1e88e5; }
.nav-btn:nth-child(20) .keyword { color: #9c27b0; }
.nav-btn:nth-child(21) .keyword { color: #2196f3; }
.nav-btn:nth-child(22) .keyword { color: #ff9800; }
.nav-btn:nth-child(23) .keyword { color: #4caf50; }
.nav-btn:nth-child(24) .keyword { color: #9c27b0; }
.nav-btn:nth-child(25) .keyword { color: #795548; }
.nav-btn:nth-child(26) .keyword { color: #607d8b; }
.nav-btn:nth-child(27) .keyword { color: #ff5722; }
.nav-btn:nth-child(28) .keyword { color: #009688; }
.nav-btn:nth-child(29) .keyword { color: #673ab7; }
.nav-btn:nth-child(30) .keyword { color: #3f51b5; }
.nav-btn:nth-child(31) .keyword { color: #ff4081; }
.nav-btn:nth-child(32) .keyword { color: #26a69a; }
.nav-btn:nth-child(33) .keyword { color: #5c6bc0; }
.nav-btn:nth-child(34) .keyword { color: #8bc34a; }
.nav-btn:nth-child(35) .keyword { color: #00bcd4; }
.nav-btn:nth-child(36) .keyword { color: #ec407a; }
.nav-btn:nth-child(37) .keyword { color: #ff9800; }
.nav-btn:nth-child(38) .keyword { color: #f44336; }
.nav-btn:nth-child(39) .keyword { color: #e91e63; }
.nav-btn:nth-child(40) .keyword { color: #9c27b0; }
.nav-btn:nth-child(41) .keyword { color: #673ab7; }
.nav-btn:nth-child(42) .keyword { color: #3f51b5; }
.nav-btn:nth-child(43) .keyword { color: #2196f3; }
.nav-btn:nth-child(44) .keyword { color: #03a9f4; }
.nav-btn:nth-child(45) .keyword { color: #00bcd4; }
.nav-btn:nth-child(46) .keyword { color: #009688; }
.nav-btn:nth-child(47) .keyword { color: #4caf50; }
.nav-btn:nth-child(48) .keyword { color: #8bc34a; }
.nav-btn:nth-child(49) .keyword { color: #26a69a; }
.nav-btn:nth-child(50) .keyword { color: #5c6bc0; }

/* Сброс цвета для выбранной */
.nav-btn.selected {
    color: #fff !important;
}

/* Search input */
input[type="search"] {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 200px;
}

/* Main content */
.main-content {
    width: 100%;
    margin: 0.25rem 0;
}

.main-content .container {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.content {
    flex: 1 1 auto;
    min-width: 0;
    padding: 2rem;
    background-color: #fff;
    border-radius: 14px;
    box-shadow: 
        0 4px 16px rgba(255,179,0,0.12),
        0 2px 8px rgba(58,123,213,0.08);
    border: 2px solid #e0e6ed;
    width: 100%;
    max-width: 1200px;
}

/* Скрываем боковые колонки, если они закомментированы */
.main-content > aside:not([class]) {
    display: none;
}

.sidebar {
    flex: 0 0 160px;
    background-color: #fff;
    padding: clamp(1rem, 3vw, 2rem);
    border-radius: 14px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 120px;
}

.content,
.content.no-variants {
    background-color: #fff;
    min-height: unset !important;
    height: auto !important;
    flex: none !important;
}

.content.no-variants {
    gap: 0;
    padding: 2rem 2rem 0 2rem !important;
    background: #fff !important;
    min-height: 0 !important;
}

.content .constructor {
    padding-top: 2rem;
    padding-bottom: 2rem;
    margin-top: auto;
    margin-bottom: 0;
}

.content.no-variants .constructor {
    margin-top: 0 !important;
    padding-top: 2rem;
    padding-bottom: 2rem !important;
    margin-bottom: 0 !important;
}

.test-variants {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1rem;
    padding: 0.5rem;
    width: 100%;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.test-variants:has(button) {
    visibility: visible;
}

.test-variants h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: var(--text-color);
}

.test-variants p {
    color: var(--text-light);
    margin-bottom: 20px;
}

.test-variant {
    background: #fff;
    color: #2c3e50;
    border: 2px solid #e0e6ed;
    font-family: 'Fira Mono', 'JetBrains Mono', 'Consolas', 'Menlo', 'monospace';
    font-size: 1.12rem;
    font-weight: 600;
    border-radius: 20px;
    box-shadow: 
        0 4px 16px rgba(255,179,0,0.12),
        0 2px 8px rgba(58,123,213,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    min-height: 52px;
    padding: 0.8em 1.2em;
    position: relative;
    overflow: hidden;
}

.test-variant::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,179,0,0.1) 0%, rgba(255,152,0,0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.test-variant .variant-number {
    color: #ffb300;
    font-weight: 700;
    margin-right: 0.3em;
    position: relative;
    z-index: 1;
}

.test-variant:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 24px rgba(255,179,0,0.25),
        0 4px 12px rgba(58,123,213,0.15);
    border-color: #ffb300;
}

.test-variant:hover::before {
    opacity: 1;
}

.test-variant:active {
    transform: translateY(1px);
    box-shadow: 
        0 2px 8px rgba(255,179,0,0.15),
        0 1px 4px rgba(58,123,213,0.1);
}

.test-variant.selected {
    background: linear-gradient(135deg, #ffb300 0%, #ff9800 100%);
    color: #fff;
    border-color: #ffb300;
    box-shadow: 
        0 8px 24px rgba(255,179,0,0.3),
        0 4px 12px rgba(58,123,213,0.2);
}

.test-variant.selected .variant-number {
    color: #fff;
}

/* Constructor section */
.constructor {
    width: 100%;
    margin: 2.5rem auto 0;
    padding: 2rem;
    background-color: #f8fafd;
    border-radius: 12px;
    border: 2px solid #e0e6ed;
    box-shadow: 0 2px 8px rgba(58,123,213,0.05);
}

.constructor h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #3a7bd5;
    margin-bottom: 1.5rem;
    text-align: left;
    padding-left: 0.5rem;
    position: relative;
}

.constructor h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -0.5rem;
    width: 3rem;
    height: 3px;
    background: linear-gradient(90deg, #3a7bd5 0%, #4a6bff 100%);
    border-radius: 2px;
}

.topic {
    display: flex;
    align-items: center;
    gap: clamp(0.5rem, 2vw, 1rem);
    margin-bottom: clamp(0.5rem, 2vw, 1rem);
    padding: clamp(0.5rem, 2vw, 1rem);
    background-color: var(--secondary-color);
    border-radius: 8px;
}

.topic label {
    flex: 1;
    font-weight: 500;
    font-size: clamp(0.875rem, 2vw, 1rem);
}

.btn-minus, .btn-plus {
    width: clamp(30px, 4vw, 36px);
    height: clamp(30px, 4vw, 36px);
    border: none;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: #fff;
    font-size: clamp(1rem, 2vw, 1.25rem);
    cursor: pointer;
    transition: var(--transition);
}

.btn-minus:hover, .btn-plus:hover {
    background-color: var(--primary-hover);
}

.topic-input {
    width: clamp(40px, 6vw, 60px);
    text-align: center;
    padding: clamp(0.25rem, 1vw, 0.5rem);
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: clamp(0.875rem, 2vw, 1rem);
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

#reset-btn, #constructor-form button[type='submit'] {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

#reset-btn {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

#reset-btn:hover {
    background-color: var(--border-color);
}

#constructor-form button[type='submit'] {
    background: linear-gradient(90deg, #ffb300 0%, #ff9800 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255,179,0,0.10);
    border: none;
    font-weight: 600;
    transition: background 0.2s, box-shadow 0.2s;
}

#constructor-form button[type='submit']:hover {
    background: linear-gradient(90deg, #ff9800 0%, #ffb300 100%);
    box-shadow: 0 4px 16px rgba(255,179,0,0.18);
}

/* Dialog styles */
.dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 32px rgba(58,123,213,0.13);
    padding: 2.2rem 2.5rem 1.5rem 2.5rem;
    z-index: 1000;
    min-width: 320px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    font-family: 'Fira Mono', 'JetBrains Mono', 'Consolas', 'Menlo', monospace;
    text-align: center;
    animation: dialog-pop 0.18s cubic-bezier(.4,2,.6,1) both;
}
@keyframes dialog-pop {
    0% { transform: translate(-50%, -60%) scale(0.95); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
.dialog p {
    font-size: 1.13rem;
    color: #2c3e50;
    margin-bottom: 0.7rem;
    font-family: inherit;
    letter-spacing: 0.1px;
}
.dialog .btn-dialog {
    padding: 0.7em 2.2em;
    margin: 0 0.5em;
    border: none;
    border-radius: 10px;
    font-size: 1.08rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, box-shadow 0.18s, color 0.18s, transform 0.1s;
    box-shadow: 0 1px 4px rgba(58,123,213,0.07);
    letter-spacing: 0.1px;
    outline: none;
}
.dialog .btn-dialog#confirm-submit,
.dialog .btn-dialog#not-answered-confirm {
    background: linear-gradient(90deg, #ffb300 0%, #ff9800 100%);
    color: #fff;
}
.dialog .btn-dialog#confirm-submit:hover,
.dialog .btn-dialog#not-answered-confirm:hover {
    background: linear-gradient(90deg, #ff9800 0%, #ffb300 100%);
    color: #fff;
    transform: translateY(-2px);
}
.dialog .btn-dialog#back-to-questions,
.dialog .btn-dialog#not-answered-back,
.dialog .btn-dialog#cancel-exit {
    background: #f8fafd;
    color: #3a7bd5;
    border: 1.5px solid #e0e6ed;
}
.dialog .btn-dialog#back-to-questions:hover,
.dialog .btn-dialog#not-answered-back:hover,
.dialog .btn-dialog#cancel-exit:hover {
    background: #e3eaff;
    color: #3a7bd5;
    transform: translateY(-2px);
}
.dialog .btn-dialog#confirm-exit {
    background: linear-gradient(90deg, #ffb300 0%, #ff9800 100%);
    color: #fff;
}
.dialog .btn-dialog#confirm-exit:hover {
    background: linear-gradient(90deg, #ff9800 0%, #ffb300 100%);
    color: #fff;
    transform: translateY(-2px);
}

/* Error messages */
.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #ff4444;
    color: #fff;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
    z-index: 1000;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Footer */
footer {
    background-color: #fff;
    padding: clamp(1rem, 3vw, 2rem) 0;
    text-align: center;
    margin-top: auto;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

/* Loading indicator */
.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Улучшенные медиа-запросы для адаптивности */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .sidebar {
        display: none; /* Скрываем сайдбар на мобильных устройствах */
    }
    
    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 768px) {
    .main-content .container {
        flex-direction: column;
        padding: 0 0.5rem;
    }
    
    .content {
        padding: 1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .content .brand-section {
        gap: 1rem;
        margin: 0.3rem 0 1.5rem;
        padding: 1rem;
    }
    
    .content .brand-section .logo img {
        width: 50px;
        height: 50px;
    }
    
    .content .brand-section .site-title h1 {
        font-size: 1.4rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .content .brand-section .site-title p {
        font-size: 0.9rem;
        margin: 0.5rem 0 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .sidebar {
        display: none;
    }
    
    .level-btn {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .nav-btn {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .level-title {
        font-size: 1.1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .level-description {
        font-size: 0.9rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .level-stats {
        font-size: 0.85rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .btn-start {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    #professions-nav {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: var(--primary-color) transparent;
    }
    
    #professions-nav .nav-btn {
        width: 100%;
        text-align: left;
        padding: 0.5rem 1rem;
        display: none;
    }
    
    #professions-nav .nav-btn:first-child {
        display: block;
        position: relative;
        padding-right: 2.5rem;
    }
    
    #professions-nav .nav-btn:first-child::after {
        content: '';
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        height: 0;
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-top: 5px solid #444;
        transition: transform 0.3s ease;
    }
    
    #professions-nav.expanded .nav-btn {
        display: block;
    }
    
    #professions-nav.expanded .nav-btn:first-child::after {
        transform: translateY(-50%) rotate(180deg);
    }
    
    #professions-nav .nav-btn.selected {
        background: linear-gradient(90deg, #ffb300 0%, #ff9800 100%);
        color: #fff;
    }
    
    #professions-nav .nav-btn.selected .keyword {
        color: #fff !important;
    }

    .header-content {
        padding: 0.5rem 0;
    }

    .logo img {
        height: 40px;
    }

    .site-title h1 {
        font-size: 1.2rem;
    }

    .site-title p {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }

    .test-variants {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        padding: 0.5rem;
    }

    .test-variant {
        max-width: 400px;
        margin: 0 auto;
        width: 100%;
    }

    /* Добавляем специальные правила для текста в скобках */
    .content .brand-section .site-title h1 span,
    .content .brand-section .site-title p span,
    .nav-btn span,
    .level-btn span {
        display: inline-block;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        max-width: 100%;
    }
    
    /* Специальные правила для текста с косой чертой */
    .content .brand-section .site-title h1 span:has(span:contains("/")),
    .content .brand-section .site-title p span:has(span:contains("/")),
    .nav-btn span:has(span:contains("/")),
    .level-btn span:has(span:contains("/")) {
        white-space: normal;
        word-break: break-word;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0.3rem 0;
    }

    .logo img {
        height: 35px;
    }

    .site-title h1 {
        font-size: 1.1rem;
    }

    .site-title p {
        font-size: 0.75rem;
        margin-bottom: 0.3rem;
    }

    #professions-nav .nav-btn {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }

    .test-variants {
        gap: 0.6rem;
        padding: 0.4rem;
    }

    .test-variant {
        max-width: 320px;
        font-size: 1rem;
        padding: 0.7em 1em;
    }
}

@media (max-width: 360px) {
    .site-title h1 {
        font-size: 1.3rem;
    }
    
    .site-title p {
        font-size: 0.8rem;
    }
    
    .nav-btn, .level-btn {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    
    .question-text {
        font-size: 0.9rem;
    }
    
    .option-label {
        font-size: 0.85rem;
    }
    
    .content {
        padding: 0.6rem 0.2rem;
    }
    
    .test-variants {
        gap: 0.5rem;
        padding: 0.3rem;
    }

    .test-variant {
        max-width: 280px;
        font-size: 0.95rem;
        padding: 0.6em 0.9em;
    }
}

/* Улучшения для планшетов */
@media (min-width: 769px) and (max-width: 1024px) {
    .content.no-variants {
        max-width: none;
        margin: 0 auto;
    }
    
    .test-variants {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Улучшения для ландшафтной ориентации на мобильных */
@media (max-height: 500px) and (orientation: landscape) {
    .header-content {
        flex-direction: row;
        align-items: center;
        gap: 0.6rem;
    }
    
    .logo img {
        height: 45px;
    }
    
    .site-title {
        text-align: left;
    }
    
    .site-title h1 {
        font-size: 1.2rem;
        margin-bottom: 0.1rem;
    }
    
    .site-title p {
        font-size: 0.8rem;
        margin-bottom: 0;
    }
    
    .top-section {
        padding: 0.15rem 0;
    }
}

.category-item {
    background: #fff;
    border-radius: 14px;
    box-shadow: 
        0 4px 16px rgba(255,179,0,0.12),
        0 2px 8px rgba(58,123,213,0.08);
    padding: 0.75rem 1rem 0.5rem 1rem;
    margin-bottom: 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid #e0e6ed;
}

.category-item:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 24px rgba(255,179,0,0.25),
        0 4px 12px rgba(58,123,213,0.15);
    border-color: #ffb300;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}
.question-count {
    color: #7f8c8d;
    font-size: 0.92rem;
    margin-bottom: 0.2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.category-header:hover .question-count {
    opacity: 1;
    pointer-events: auto;
}
.question-counter {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.question-counter input[type='number'] {
    width: 45px;
    border-radius: 6px;
    border: 1px solid #e0e6ed;
    padding: 0.25rem;
    font-size: 0.95rem;
    text-align: center;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
}
.question-counter input[type='number']:focus {
    border: 1.2px solid #4a6bff;
    box-shadow: 0 0 0 1.5px #e3eaff;
}
.question-counter button {
    background: linear-gradient(90deg, #ffb300 0%, #ff9800 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    width: 26px;
    height: 26px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(255,179,0,0.10);
}
.question-counter button:hover {
    background: linear-gradient(90deg, #ff9800 0%, #ffb300 100%);
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(255,179,0,0.18);
}

.nav-btn .keyword { font-weight: 600; }
.nav-btn:nth-child(1) .keyword { color: #3a7bd5; }
.nav-btn:nth-child(2) .keyword { color: #e67e22; }
.nav-btn:nth-child(3) .keyword { color: #27ae60; }
.nav-btn:nth-child(4) .keyword { color: #b84592; }
.nav-btn:nth-child(5) .keyword { color: #2980b9; }
.nav-btn:nth-child(6) .keyword { color: #8e44ad; }
.nav-btn:nth-child(7) .keyword { color: #c0392b; }
.nav-btn:nth-child(8) .keyword { color: #16a085; }
.nav-btn.selected .keyword { color: #fff !important; }

.category-item, .test-variant, .content, .sidebar {
    border-radius: 14px;
}
.nav-btn, .level-btn, #constructor-form button[type='submit'], .question-counter button {
    border-radius: 12px;
}

.question-text {
    letter-spacing: 0.2px;
    font-size: 1.08rem;
}

.test-variant, .option-label {
    letter-spacing: 0.2px;
}

.nav-btn:active,
.level-btn:active,
#constructor-form button[type='submit']:active,
.question-counter button:active {
    filter: brightness(0.92);
    transform: translateY(2px);
}

a {
    color: #3a7bd5;
    text-decoration: none;
    border-bottom: 1.5px dotted #3a7bd5;
    transition: border-color 0.2s, color 0.2s;
}
a:hover {
    border-bottom: 1.5px solid #ffb300;
    color: #ffb300;
}

.logo a, .site-title a {
    color: inherit !important;
    border-bottom: none !important;
    text-decoration: none !important;
}

.site-title h1::after {
    content: none;
}

/* Цветные скроллбары */
::-webkit-scrollbar {
    width: 10px;
    background: #f8fafd;
}
::-webkit-scrollbar-thumb {
    background: #ffb300;
    border-radius: 8px;
}
::-webkit-scrollbar-track {
    background: #f8fafd;
}

/* Акцент для выбранного варианта */
.test-variant.selected {
    border-left: 4px solid #ffb300 !important;
    background: #fffbe6 !important;
    box-shadow: 0 2px 8px rgba(255,179,0,0.10);
}

.site-title h1, .site-title p,
h1, h2, h3,
.nav-btn, .level-btn, .keyword {
    font-family: 'Fira Mono', 'JetBrains Mono', 'Consolas', 'Menlo', 'monospace';
}

.level-block {
    background: #f8fafd;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(58,123,213,0.07);
    margin-bottom: 2rem;
    padding: 1.7rem 1.5rem 0.7rem 1.5rem;
    border-left: 6px solid #3a7bd5;
}
.level-block:last-child {
    margin-bottom: 0;
}
.level-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1rem;
}
.level-title {
    font-family: 'Fira Mono', 'JetBrains Mono', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: #3a7bd5;
    letter-spacing: 0.5px;
}
.level-block.level-junior { border-left-color: #ffb300; }
.level-block.level-middle { border-left-color: #3a7bd5; }
.level-block.level-senior { border-left-color: #b84592; }
.level-block.level-junior .level-title { color: #ffb300; }
.level-block.level-middle .level-title { color: #3a7bd5; }
.level-block.level-senior .level-title { color: #b84592; }

#test-variant-name {
    margin-top: 0rem;
}

.question-block {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(58,123,213,0.07);
    padding: 1.2rem 1.5rem;
    margin-bottom: 0.6rem;
    transition: box-shadow 0.2s;
}
.question-block:hover {
    box-shadow: 0 4px 16px rgba(58,123,213,0.13);
}
.question-text {
    font-family: 'Fira Mono', 'JetBrains Mono', monospace;
    font-size: 1.08rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1rem;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    gap: 0.7em;
}
.question-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8fafd;
    color: #3a7bd5;
    font-weight: 700;
    border-radius: 50%;
    width: 2.1em;
    height: 2.1em;
    font-size: 1.1em;
    margin-right: 0.5em;
    box-shadow: 0 1px 4px rgba(58,123,213,0.08);
    border: 2px solid #3a7bd5 !important;
}
.options-container {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.option-label {
    background: #f8fafd;
    border-radius: 8px;
    border: 1.5px solid #e0e6ed;
    padding: 0.7em 1em;
    transition: border 0.2s, background 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.7em;
}
.option-label:hover, .option-label input:focus + .option-text {
    border-color: #3a7bd5;
    background: #e3eaff;
}
.option-label input[type="radio"], .option-label input[type="checkbox"] {
    accent-color: #3a7bd5;
}

.btn-submit {
    display: block;
    width: 100%;
    max-width: 220px;
    margin: 1.2rem auto 0 auto;
    padding: 14px 0;
    background: linear-gradient(90deg, #ffb300 0%, #ff9800 100%);
    color: #fff;
    font-family: 'Fira Mono', 'JetBrains Mono', 'Consolas', 'Menlo', 'monospace';
    font-size: 1.13rem;
    font-weight: 700;
    border: none;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(255,179,0,0.13);
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
}
.btn-submit:hover {
    background: linear-gradient(90deg, #ff9800 0%, #ffb300 100%);
    box-shadow: 0 4px 16px rgba(255,179,0,0.18);
    transform: translateY(-2px);
}
.btn-submit:active {
    filter: brightness(0.92);
    transform: translateY(2px);
}

.constructor-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    text-align: center;
}

