/* === generator-2.html === */
.objectives-container {
    margin-top: 10px;
}
.objective-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 10px;
}
.objective-item input {
    flex: 1;
}
.objective-item button {
    padding: 8px 12px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}
.objective-item button:hover {
    background: #dc2626;
}
.add-objective-btn {
    margin-top: 10px;
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.add-objective-btn:hover {
    background: var(--primary-dark);
}
.section-header {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    margin: 30px 0 20px 0;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}
.section-header i {
    color: var(--primary);
}
.task-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 15px;
}
.task-type-card {
    position: relative;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    min-height: 120px;
    justify-content: center;
}
.task-type-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
    border-color: var(--primary);
}
.task-type-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.task-type-card.checked {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}
.task-type-card.checked .task-icon {
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    color: white;
    transform: scale(1.1);
}
.task-type-card.checked label {
    color: var(--primary);
}
.task-icon {
    font-size: 2rem;
    color: var(--gray);
    transition: all 0.3s ease;
    background: #f3f4f6;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
}
.task-type-card label {
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--dark);
    user-select: none;
    margin: 0;
    line-height: 1.3;
    transition: color 0.3s ease;
}
.custom-task-wrapper {
    margin-top: 20px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
    border: 2px dashed #d1d5db;
    transition: all 0.3s ease;
}
.custom-task-wrapper.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}
.custom-task-wrapper label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    color: var(--dark);
}
.custom-task-wrapper input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}
.custom-task-input {
    margin-top: 15px;
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}
.custom-task-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.objective-item {
    background: #f9fafb;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e5e7eb;
}
.objective-item:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.add-objective-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}
.add-objective-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
@media (max-width: 768px) {
    .login-prompt {
        padding: 30px 20px;
        margin: 20px 16px;
    }
    .login-prompt h2 {
        font-size: 1.4rem;
        margin-bottom: 15px;
    }
    .login-prompt p {
        font-size: 0.95rem;
        margin-bottom: 25px;
    }
    .login-prompt .auth-buttons {
        flex-direction: column;
        gap: 12px;
    }
    .login-prompt .auth-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }
    .task-types-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .task-type-card {
        min-height: 100px;
        padding: 12px;
    }
    .task-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    .section-header {
        font-size: 1.1rem;
        margin: 25px 0 15px 0;
    }
}
@media (max-width: 480px) {
    .login-prompt {
        padding: 24px 16px;
        margin: 16px 12px;
    }
    .login-prompt h2 {
        font-size: 1.2rem;
    }
    .login-prompt p {
        font-size: 0.9rem;
    }
    .login-prompt .auth-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    .task-types-grid {
        grid-template-columns: 1fr;
    }
    .task-type-card {
        min-height: 90px;
        padding: 10px;
    }
    .task-icon {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
}

/* === generator-3.html === */
.assessment-type-info {
    margin-top: 12px;
    padding: 12px;
    background-color: #f0f9ff;
    border-radius: 6px;
    border-left: 3px solid var(--primary);
    font-size: 0.9rem;
    display: none;
    line-height: 1.5;
}

/* === generator-4.html === */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}
.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}
.checkbox-group label {
    margin: 0;
    cursor: pointer;
    flex: 1;
}
.tooltip {
    position: relative;
    display: inline-block;
}
.tooltip i {
    color: var(--primary);
    cursor: help;
}
.tooltip .tooltiptext {
    visibility: hidden;
    width: 250px;
    background-color: var(--dark);
    color: white;
    text-align: left;
    border-radius: 8px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -125px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85rem;
    line-height: 1.4;
}
.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* === generator-5.html === */
.sor-block {
    background: #f8f9fa;
    border: 2px solid var(--light-gray);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
}
.sor-block h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.remove-sor {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.remove-sor:hover {
    background: #db2777;
    transform: translateY(-1px);
}
.add-sor-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 20px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.add-sor-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 768px) {
    .login-prompt {
        padding: 30px 20px;
        margin: 20px 16px;
    }
    .login-prompt h2 {
        font-size: 1.4rem;
    }
    .login-prompt p {
        font-size: 0.95rem;
    }
    .form-row-2 {
        grid-template-columns: 1fr;
    }
}

/* === generator-6.html === */
.test-info {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}
.question-block {
    background: white;
    border: 2px solid var(--light-gray);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
}
.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.question-number {
    font-weight: 600;
    color: var(--primary);
    font-size: 1.1rem;
}
.question-type-badge {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}
.remove-question {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.85rem;
}
.remove-question:hover {
    background: #db2777;
}
.answer-option {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}
.answer-option input[type="radio"] {
    width: auto;
}
.remove-option {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.8rem;
}
.add-option-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 10px;
}
.add-option-btn:hover {
    background: var(--primary-dark);
}
.matching-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}
.image-preview {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 10px;
    border: 2px solid var(--light-gray);
}
.file-input-wrapper {
    position: relative;
    display: inline-block;
}
.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.file-input-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.file-input-label:hover {
    background: var(--primary-dark);
}
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}
.action-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.action-btn.primary {
    background: var(--gradient);
    color: white;
}
.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}
.action-btn.secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.action-btn.secondary:hover {
    background: var(--primary);
    color: white;
}
.test-settings {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}
.test-settings h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--primary);
}
@media (max-width: 768px) {
    .matching-pair {
        grid-template-columns: 1fr;
    }
    .action-buttons {
        flex-direction: column;
    }
    .action-btn {
        width: 100%;
        justify-content: center;
    }
}

/* === history.html === */
.page-header {
    margin-bottom: 30px;
}
.page-header h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.page-header p {
    color: var(--gray);
    font-size: 1rem;
}
.filters-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}
.filters-section select {
    padding: 10px 15px;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s;
}
.filters-section select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.filters-section input {
    flex: 1;
    min-width: 200px;
}
.filters-section select {
    min-width: 200px;
}
.subject-autocomplete-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
}
.subject-autocomplete-wrapper input {
    width: 100%;
}
.subject-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--light-gray);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: none;
}
.subject-autocomplete-dropdown.active {
    display: block;
}
.subject-autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid var(--light-gray);
}
.subject-autocomplete-item:last-child {
    border-bottom: none;
}
.subject-autocomplete-item:hover {
    background: #f8fafc;
}
.subject-autocomplete-item.selected {
    background: var(--primary);
    color: white;
}
.history-item:last-child {
    border-bottom: none;
}
.history-item-preview {
    margin-top: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}
.history-item-preview-text {
    color: var(--dark);
    font-size: 0.9rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    padding: 20px;
}
.pagination button {
    padding: 10px 20px;
    border: 1px solid var(--light-gray);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.pagination button:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.pagination-info {
    padding: 10px 20px;
    color: var(--gray);
    font-size: 0.9rem;
}
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}
.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}
.empty-state h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--dark);
}
.loading-state {
    text-align: center;
    padding: 60px 20px;
}
.loading-state i {
    font-size: 3rem;
    color: var(--primary);
    animation: spin 1s linear infinite;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #ef4444;
}
#resultContent table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
#resultContent table td {
    border: 1px solid #e5e7eb;
    padding: 12px;
    text-align: left;
    vertical-align: top;
}
#resultContent table th {
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
}
#resultContent table td {
    background: white;
    color: var(--dark);
}
#resultContent table tr:nth-child(even) td {
    background: #f8fafc;
}
#resultContent table tr:hover td {
    background: #f1f5f9;
}
#resultContent h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin: 30px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary);
}
#resultContent h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    margin: 25px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
}
#resultContent h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
    margin: 20px 0 12px 0;
}
#resultContent h4 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    margin: 18px 0 10px 0;
}
#resultContent h5 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
    margin: 15px 0 8px 0;
}
#resultContent h6 {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark);
    margin: 12px 0 6px 0;
}
#resultContent ol {
    margin: 15px 0;
    padding-left: 30px;
}
#resultContent li {
    margin: 8px 0;
    line-height: 1.6;
}
#resultContent p {
    margin: 12px 0;
    line-height: 1.8;
}
#resultContent strong {
    font-weight: 600;
    color: var(--dark);
}
#resultContent em {
    font-style: italic;
}
#resultContent code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #e11d48;
}
#resultContent pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 15px 0;
}
#resultContent pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}
#resultContent blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 20px;
    margin: 15px 0;
    color: var(--gray);
    font-style: italic;
}
@media (max-width: 768px) {
    .main-container {
        padding: 20px 15px;
    }
    .filters-section {
        flex-direction: column;
    }
    .filters-section input,
    .filters-section select {
        width: 100%;
    }
    .history-item-header {
        flex-direction: column;
        gap: 10px;
    }
    .history-item-header > div {
        width: 100%;
        justify-content: flex-start;
    }
    .history-item-header button {
        width: 100%;
        justify-content: center;
    }
}




/* === Restored missing history.html base styles === */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}
.filters-section input,
.filters-section select {
    padding: 10px 15px;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s;
}
.filters-section input:focus,
.filters-section select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
#resultContent table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
#resultContent table th,
#resultContent table td {
    border: 1px solid #e5e7eb;
    padding: 12px;
    text-align: left;
    vertical-align: top;
}
#resultContent table th {
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
}
#resultContent table td { background: white; color: var(--dark); }
#resultContent table tr:nth-child(even) td { background: #f8fafc; }
#resultContent table tr:hover td { background: #f1f5f9; }
#resultContent h1 { font-family: 'Montserrat', sans-serif; font-size: 1.8rem; font-weight: 700; color: var(--primary); margin: 30px 0 20px 0; padding-bottom: 10px; border-bottom: 3px solid var(--primary); }
#resultContent h2 { font-family: 'Montserrat', sans-serif; font-size: 1.5rem; font-weight: 600; color: var(--primary); margin: 25px 0 15px 0; padding-bottom: 8px; border-bottom: 2px solid var(--primary); }
#resultContent h3 { font-family: 'Montserrat', sans-serif; font-size: 1.2rem; font-weight: 600; color: var(--primary); margin: 20px 0 12px 0; }
#resultContent h4 { font-family: 'Montserrat', sans-serif; font-size: 1.1rem; font-weight: 600; color: var(--primary); margin: 18px 0 10px 0; }
#resultContent h5 { font-family: 'Montserrat', sans-serif; font-size: 1rem; font-weight: 600; color: var(--dark); margin: 15px 0 8px 0; }
#resultContent h6 { font-family: 'Montserrat', sans-serif; font-size: 0.95rem; font-weight: 600; color: var(--dark); margin: 12px 0 6px 0; }
#resultContent ul, #resultContent ol { margin: 15px 0; padding-left: 30px; }
#resultContent li { margin: 8px 0; line-height: 1.6; }
#resultContent p { margin: 12px 0; line-height: 1.8; }
#resultContent strong { font-weight: 600; color: var(--dark); }
#resultContent em { font-style: italic; }
#resultContent code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-family: 'Courier New', monospace; font-size: 0.9em; color: #e11d48; }
#resultContent pre { background: #1e293b; color: #e2e8f0; padding: 15px; border-radius: 8px; overflow-x: auto; margin: 15px 0; }
#resultContent pre code { background: transparent; color: inherit; padding: 0; }
#resultContent blockquote { border-left: 4px solid var(--primary); padding-left: 20px; margin: 15px 0; color: var(--gray); font-style: italic; }


/* === Restored history.html own list-style history styles === */
.history-container {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.history-item {
    padding: 20px;
    border-bottom: 1px solid var(--light-gray);
    transition: all 0.2s;
    cursor: pointer;
}
.history-item:hover {
    background: #f8fafc;
}
.history-item-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    margin: 0;
    flex: 1;
}
.history-item-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.history-item-badge.ready {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
}
.history-item-badge.processing {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}
.history-item-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--gray);
}
.history-item-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.history-item-meta-item i {
    color: var(--primary);
}

/* === instructions.html === */
        .instructions-container {
            max-width: 1000px;
            margin: 40px auto;
            padding: 0 20px;
        }
        .instructions-header {
            text-align: center;
            margin-bottom: 50px;
        }
        .instructions-title {
            font-family: 'Montserrat', sans-serif;
            font-size: 2.5rem;
            font-weight: 700;
            margin-bottom: 15px;
            background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        .instructions-subtitle {
            color: var(--gray);
            font-size: 1.1rem;
        }
        .instructions-nav {
            background: white;
            border-radius: var(--radius);
            padding: 20px;
            margin-bottom: 30px;
            box-shadow: var(--shadow);
            position: sticky;
            top: 90px;
            z-index: 50;
        }
        .instructions-nav-list {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            list-style: none;
            margin: 0;
            padding: 0;
        }
        .instructions-nav-item {
            flex: 1;
            min-width: 150px;
        }
        .instructions-nav-link {
            display: block;
            padding: 10px 15px;
            background: var(--light);
            border-radius: 8px;
            text-decoration: none;
            color: var(--dark);
            font-size: 0.9rem;
            transition: all 0.2s;
            text-align: center;
            font-weight: 500;
        }
        .instructions-nav-link:hover {
            background: var(--gradient);
            color: white;
            transform: translateY(-2px);
        }
        .instructions-nav-link.active {
            background: var(--gradient);
            color: white;
        }
        .instruction-section {
            background: white;
            border-radius: var(--radius);
            padding: 40px;
            margin-bottom: 30px;
            box-shadow: var(--shadow);
            scroll-margin-top: 100px;
        }
        .instruction-section h2 {
            font-family: 'Montserrat', sans-serif;
            font-size: 1.8rem;
            margin-bottom: 25px;
            color: var(--dark);
            display: flex;
            align-items: center;
            gap: 15px;
        }
        .instruction-section h2 i {
            color: var(--primary);
            font-size: 1.8rem;
        }
        .instruction-section h3 {
            font-family: 'Montserrat', sans-serif;
            font-size: 1.3rem;
            margin-top: 30px;
            margin-bottom: 15px;
            color: var(--dark);
        }
        .instruction-step {
            background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
            border-left: 4px solid var(--primary);
            padding: 20px;
            margin-bottom: 20px;
            border-radius: 8px;
        }
        .instruction-step-number {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 30px;
            height: 30px;
            background: var(--gradient);
            color: white;
            border-radius: 50%;
            font-weight: 700;
            margin-right: 15px;
            font-size: 0.9rem;
        }
        .instruction-step-content {
            display: inline-block;
            vertical-align: top;
            width: calc(100% - 50px);
        }
        .instruction-step-content strong {
            display: block;
            margin-bottom: 8px;
            color: var(--dark);
            font-size: 1rem;
        }
        .instruction-step-content p {
            margin: 0;
            color: var(--gray);
            line-height: 1.7;
        }
        .instruction-note {
            background: #fef3c7;
            border-left: 4px solid #f59e0b;
            padding: 15px;
            margin: 20px 0;
            border-radius: 8px;
        }
        .instruction-note i {
            color: #f59e0b;
            margin-right: 8px;
        }
        .instruction-warning {
            background: #fee2e2;
            border-left: 4px solid #ef4444;
            padding: 15px;
            margin: 20px 0;
            border-radius: 8px;
        }
        .instruction-warning i {
            color: #ef4444;
            margin-right: 8px;
        }
        .instruction-success {
            background: #d1fae5;
            border-left: 4px solid #10b981;
            padding: 15px;
            margin: 20px 0;
            border-radius: 8px;
        }
        .instruction-success i {
            color: #10b981;
            margin-right: 8px;
        }
        .instruction-link {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            color: var(--primary);
            text-decoration: none;
            font-weight: 600;
            transition: color 0.2s;
        }
        .instruction-link:hover {
            color: var(--primary-dark);
            text-decoration: underline;
        }
        .instruction-image-placeholder {
            background: var(--light);
            border: 2px dashed var(--light-gray);
            border-radius: 8px;
            padding: 40px;
            text-align: center;
            color: var(--gray);
            margin: 20px 0;
        }
        .btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 12px 24px;
            background: var(--gradient);
            color: white;
            border: none;
            border-radius: 8px;
            font-weight: 600;
            cursor: pointer;
            text-decoration: none;
            transition: all 0.2s;
            font-family: 'Montserrat', sans-serif;
        }
        .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
        }
        .tariff-limits-table {
            width: 100%;
            border-collapse: collapse;
            margin: 20px 0;
        }
        .tariff-limits-table th,
        .tariff-limits-table td {
            padding: 12px;
            text-align: left;
            border-bottom: 1px solid var(--light-gray);
        }
        .tariff-limits-table th {
            background: var(--light);
            font-weight: 600;
            color: var(--dark);
            font-family: 'Montserrat', sans-serif;
        }
        .tariff-limits-table tr:hover {
            background: var(--light);
        }
        @media (max-width: 768px) {
            .instructions-nav {
                position: relative;
                top: 0;
            }
            .instructions-nav-list {
                flex-direction: column;
            }
            .instructions-nav-item {
                min-width: 100%;
            }
            .instruction-section {
                padding: 25px 20px;
            }
            .instruction-section h2 {
                font-size: 1.5rem;
            }
            .instruction-step-content {
                width: 100%;
                display: block;
            }
            .instruction-step-number {
                display: block;
                margin-bottom: 10px;
                margin-right: 0;
            }
        }

/* === library.html === */
        body.page-library { background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%); min-height: 100vh; margin: 0; padding: 0; }
        .lib-container { max-width: 1200px; margin: 40px auto; padding: 0 20px; }
        .lib-hero { text-align: center; margin-bottom: 30px; }
        .lib-hero h1 { font-family: 'Montserrat', sans-serif; font-size: 2.4rem; margin: 0 0 10px; background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
        .lib-hero p { color: #6b7280; font-size: 1.05rem; max-width: 640px; margin: 0 auto; }
        .lib-filters { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 4px 12px rgba(0,0,0,0.06); margin-bottom: 24px; display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; align-items: center; }
        .lib-filters input, .lib-filters select { padding: 10px 14px; border: 1px solid #e5e7eb; border-radius: 8px; font: inherit; font-size: 0.95rem; min-width: 0; }
        .lib-filters input:focus, .lib-filters select:focus { outline: 2px solid #6366f1; outline-offset: -1px; border-color: transparent; }
        .lib-meta { color: #6b7280; font-size: 0.9rem; margin-bottom: 12px; }
        .lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
        .lib-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 4px 12px rgba(0,0,0,0.06); cursor: pointer; transition: all .25s ease; border: 1px solid transparent; display: flex; flex-direction: column; position: relative; }
        .lib-admin-unpublish { position: absolute; top: 10px; right: 10px; background: #fff; border: 1px solid #ef4444; color: #ef4444; padding: 4px 10px; border-radius: 999px; cursor: pointer; font-size: 0.72rem; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; transition: all .15s; z-index: 2; }
        .lib-admin-unpublish:hover { background: #ef4444; color: #fff; }
        .lib-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(99,102,241,0.18); border-color: #c7d2fe; }
        .lib-card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
        .lib-tag { font-size: 0.72rem; padding: 3px 10px; border-radius: 999px; font-weight: 600; }
        .lib-tag-subj { background: #eef2ff; color: #4f46e5; }
        .lib-tag-grade { background: #f0fdfa; color: #0d9488; }
        .lib-tag-lang { background: #fef3c7; color: #b45309; }
        .lib-card h3 { font-family: 'Montserrat', sans-serif; font-size: 1.1rem; margin: 0 0 10px; color: #1f2937; line-height: 1.35; }
        .lib-card p { color: #6b7280; font-size: 0.85rem; line-height: 1.5; margin: 0 0 14px; flex-grow: 1; }
        .lib-card-foot { color: #9ca3af; font-size: 0.75rem; display: flex; justify-content: space-between; }
        .lib-card-open { color: #6366f1; font-weight: 600; }
        .lib-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 30px; }
        .lib-page-btn { padding: 8px 14px; border-radius: 8px; border: 1px solid #e5e7eb; background: #fff; cursor: pointer; font: inherit; }
        .lib-page-btn:hover:not(:disabled) { background: #eef2ff; }
        .lib-page-btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .lib-page-btn.active { background: #6366f1; color: #fff; border-color: #6366f1; }
        .lib-empty { text-align: center; padding: 60px 20px; color: #9ca3af; }
        .lib-cta { margin-top: 40px; padding: 30px; background: linear-gradient(135deg, #6366f1, #8b5cf6); border-radius: 16px; color: #fff; text-align: center; }
        .lib-cta h3 { font-family: 'Montserrat', sans-serif; margin: 0 0 8px; font-size: 1.4rem; }
        .lib-cta a { display: inline-block; margin-top: 14px; background: #fff; color: #6366f1; padding: 12px 28px; border-radius: 999px; text-decoration: none; font-weight: 600; }
        @media (max-width: 640px) {
            .lib-filters { grid-template-columns: 1fr; }
            .lib-hero h1 { font-size: 1.8rem; }
        }

/* === library-item.html === */
        body.page-library-item { background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%); min-height: 100vh; margin: 0; padding: 0; }
        .item-container { max-width: 900px; margin: 30px auto; padding: 0 20px; }
        .back-link { display: inline-flex; align-items: center; gap: 8px; color: #6366f1; text-decoration: none; font-weight: 600; margin-bottom: 20px; }
        .back-link:hover { color: #8b5cf6; }
        .item-card { background: #fff; border-radius: 14px; padding: 30px; box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
        .item-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
        .item-tag { font-size: 0.78rem; padding: 4px 12px; border-radius: 999px; font-weight: 600; }
        .item-tag-subj { background: #eef2ff; color: #4f46e5; }
        .item-tag-grade { background: #f0fdfa; color: #0d9488; }
        .item-tag-lang { background: #fef3c7; color: #b45309; }
        .item-tag-gen { background: #f3e8ff; color: #7c3aed; }
        .item-title { font-family: 'Montserrat', sans-serif; font-size: 1.7rem; color: #1f2937; margin: 0 0 24px; line-height: 1.3; }
        .item-content { font-size: 0.95rem; line-height: 1.7; color: #374151; }
        .item-content h1, .item-content h2, .item-content h3 { font-family: 'Montserrat', sans-serif; color: #1f2937; margin-top: 24px; }
        .item-content h1 { font-size: 1.4rem; }
        .item-content h2 { font-size: 1.2rem; }
        .item-content h3 { font-size: 1.05rem; }
        .item-content .table-wrap { overflow-x: auto; margin: 16px 0; -webkit-overflow-scrolling: touch; border-radius: 8px; border: 1px solid #e5e7eb; }
        .item-content table { border-collapse: collapse; width: 100%; font-size: 0.88rem; min-width: 100%; }
        .item-content th, .item-content td { border: 1px solid #e5e7eb; padding: 8px 12px; text-align: left; vertical-align: top; word-break: break-word; }
        .item-content th { background: #f3f4f6; font-weight: 600; position: sticky; top: 0; }
        @media (max-width: 640px) {
            .item-content table { font-size: 0.78rem; min-width: 600px; }
            .item-content th, .item-content td { padding: 6px 8px; }
            .item-content .table-wrap::after { content: '⇄ листайте'; position: absolute; right: 24px; color: #9ca3af; font-size: 0.7rem; margin-top: -22px; pointer-events: none; }
        }
        .item-content code { background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: 0.88em; }
        .item-content pre { background: #f3f4f6; padding: 14px; border-radius: 8px; overflow-x: auto; }
        .item-content ul, .item-content ol { padding-left: 28px; }

        .paywall { margin-top: 24px; padding: 30px; background: linear-gradient(135deg, #6366f1, #8b5cf6); border-radius: 14px; color: #fff; text-align: center; position: relative; overflow: hidden; }
        .paywall::before { content: ''; position: absolute; top: -60px; left: 0; right: 0; height: 100px; background: linear-gradient(to bottom, transparent, #fff); opacity: 0.55; pointer-events: none; }
        .paywall h3 { font-family: 'Montserrat', sans-serif; margin: 0 0 8px; font-size: 1.5rem; }
        .paywall p { margin: 6px 0 18px; opacity: 0.95; max-width: 480px; margin-left: auto; margin-right: auto; }
        .paywall .pw-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
        .paywall .pw-btn { display: inline-block; padding: 12px 26px; border-radius: 999px; text-decoration: none; font-weight: 600; transition: all .2s; }
        .paywall .pw-btn-primary { background: #fff; color: #6366f1; }
        .paywall .pw-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,0,0.15); }
        .paywall .pw-btn-ghost { background: rgba(255,255,255,0.18); color: #fff; border: 1px solid rgba(255,255,255,0.35); }
        .paywall .pw-btn-ghost:hover { background: rgba(255,255,255,0.28); }

        .related { margin-top: 40px; }
        .related h3 { font-family: 'Montserrat', sans-serif; color: #1f2937; font-size: 1.15rem; margin-bottom: 14px; }
        .related-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
        .related-item { background: #fff; padding: 14px; border-radius: 10px; box-shadow: 0 3px 10px rgba(0,0,0,0.05); text-decoration: none; color: #374151; transition: all .2s; }
        .related-item:hover { transform: translateY(-2px); box-shadow: 0 8px 16px rgba(99,102,241,0.15); }
        .related-item-title { font-weight: 600; font-size: 0.92rem; line-height: 1.4; margin-bottom: 6px; }
        .related-item-meta { color: #9ca3af; font-size: 0.78rem; }
        .item-loading { text-align: center; padding: 60px; color: #9ca3af; }

        .item-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0 24px; padding: 14px; background: #f9fafb; border-radius: 10px; border: 1px solid #e5e7eb; align-items: center; }
        .item-action-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 8px; border: none; cursor: pointer; font: inherit; font-weight: 600; font-size: 0.9rem; transition: all .2s; }
        .item-action-btn.primary { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
        .item-action-btn.primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(16,185,129,0.3); }
        .item-action-btn.ghost { background: #eef2ff; color: #4f46e5; }
        .item-action-btn.ghost:hover { background: #e0e7ff; }
        .item-action-btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .item-limit-info { margin-left: auto; color: #6b7280; font-size: 0.85rem; }
        .item-limit-info strong { color: #1f2937; }

/* === page.html === */
        /* Обеспечиваем правильное применение стилей хедера */
        body.page-static {
            margin: 0;
            padding: 0;
            font-family: 'Source Sans Pro', sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #e0e7ff 50%, #fce7f3 100%);
            min-height: 100vh;
            position: relative;
            overflow-x: hidden;
        }
        body.page-static::before {
            content: '';
            position: fixed;
            top: -50%;
            right: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
            animation: float 20s ease-in-out infinite;
            pointer-events: none;
            z-index: 0;
        }
        body.page-static::after {
            content: '';
            position: fixed;
            bottom: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(236, 72, 153, 0.05) 0%, transparent 70%);
            animation: float 25s ease-in-out infinite reverse;
            pointer-events: none;
            z-index: 0;
        }
        @keyframes float {
            0%, 100% {
                transform: translate(0, 0) rotate(0deg);
            }
            50% {
                transform: translate(-5%, -5%) rotate(5deg);
            }
        }
        .page-container {
            position: relative;
            z-index: 1;
        }
        .page-container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 40px 20px;
        }
        .page-header {
            margin-bottom: 30px;
        }
        .page-header h1 {
            font-family: 'Montserrat', sans-serif;
            font-size: 2.5rem;
            color: var(--dark);
            margin-bottom: 10px;
        }
        .page-content {
            background: white;
            padding: 30px;
            border-radius: 12px;
            box-shadow: var(--shadow);
            line-height: 1.8;
            color: var(--dark);
        }
        .page-content h1, .page-content h2, .page-content h3 {
            font-family: 'Montserrat', sans-serif;
            color: var(--primary);
            margin-top: 30px;
            margin-bottom: 15px;
        }
        .page-content h1 { font-size: 2rem; }
        .page-content h2 { font-size: 1.5rem; }
        .page-content h3 { font-size: 1.2rem; }
        .page-content p {
            margin-bottom: 15px;
        }
        .page-content ul, .page-content ol {
            margin: 15px 0;
            padding-left: 30px;
        }
        .page-content li {
            margin: 8px 0;
        }
        .loading {
            text-align: center;
            padding: 40px;
            color: var(--gray);
        }
        .error {
            text-align: center;
            padding: 80px 40px;
            max-width: 650px;
            margin: 40px auto;
            background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
            border-radius: 24px;
            box-shadow: 0 20px 60px rgba(99, 102, 241, 0.15), 
                        0 0 0 1px rgba(99, 102, 241, 0.1);
            position: relative;
            overflow: hidden;
            animation: fadeInUp 0.6s ease-out;
        }
        .error::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
        }
        .error i {
            font-size: 5rem;
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 30px;
            display: block;
            animation: pulse 2s ease-in-out infinite;
            filter: drop-shadow(0 4px 8px rgba(99, 102, 241, 0.3));
        }
        .error h2 {
            color: var(--dark);
            margin-bottom: 20px;
            font-family: 'Montserrat', sans-serif;
            font-size: 2rem;
            font-weight: 700;
            letter-spacing: -0.5px;
            background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        .error p {
            color: var(--gray);
            margin-bottom: 40px;
            font-size: 1.125rem;
            line-height: 1.8;
            max-width: 500px;
            margin-left: auto;
            margin-right: auto;
        }
        .error .buttons {
            display: flex;
            gap: 20px;
            justify-content: center;
            flex-wrap: wrap;
        }
        .error .buttons a {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            padding: 16px 36px;
            color: white;
            text-decoration: none;
            border-radius: 12px;
            font-weight: 600;
            font-size: 1.05rem;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            letter-spacing: 0.3px;
        }
        .error .buttons a::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
            transition: left 0.5s;
        }
        .error .buttons a:hover::before {
            left: 100%;
        }
        .error .buttons a.login {
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
        }
        .error .buttons a.login:hover {
            transform: translateY(-3px) scale(1.02);
            box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
        }
        .error .buttons a.login:active {
            transform: translateY(-1px) scale(0.98);
        }
        .error .buttons a.register {
            background: linear-gradient(135deg, #ec4899 0%, #f472b6 100%);
        }
        .error .buttons a.register:hover {
            transform: translateY(-3px) scale(1.02);
            box-shadow: 0 8px 24px rgba(236, 72, 153, 0.4);
        }
        .error .buttons a.register:active {
            transform: translateY(-1px) scale(0.98);
        }
        .error .buttons a i {
            font-size: 1.1rem;
            background: none;
            -webkit-text-fill-color: white;
            filter: none;
            animation: none;
            margin: 0;
        }
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
        }
        @keyframes pulse {
            0%, 100% {
                transform: scale(1);
            }
            50% {
                transform: scale(1.05);
            }
        }
        @media (max-width: 768px) {
            .error {
                padding: 60px 30px;
                margin: 20px;
                border-radius: 20px;
            }
            .error i {
                font-size: 4rem;
            }
            .error h2 {
                font-size: 1.75rem;
            }
            .error p {
                font-size: 1rem;
            }
            .error .buttons {
                flex-direction: column;
                gap: 15px;
            }
            .error .buttons a {
                width: 100%;
                justify-content: center;
                padding: 14px 32px;
            }
        }
        /* Очистка Word-стилей */
        .page-content .MsoNormal {
            margin: 0 !important;
            padding: 0 !important;
            font-family: inherit !important;
            font-size: inherit !important;
            line-height: 1.8 !important;
        }
        .page-content [class*="Mso"] {
            font-family: 'Source Sans Pro', sans-serif !important;
            line-height: 1.8 !important;
        }
        .page-content o\:p,
        .page-content o:p {
            display: none !important;
        }
        /* Нормализация контента */
        .page-content * {
            max-width: 100%;
            box-sizing: border-box;
        }
        .page-content img {
            height: auto;
            max-width: 100%;
            display: block;
            margin: 15px auto;
        }
        .page-content table {
            width: 100%;
            border-collapse: collapse;
            margin: 15px 0;
        }
        .page-content p {
            margin-bottom: 15px;
            line-height: 1.8;
        }
        .page-content div {
            margin-bottom: 15px;
        }
        .page-content [align="center"] {
            text-align: center;
        }
        .page-content b,
        .page-content strong {
            font-weight: 600;
        }
        /* Убираем лишние отступы */
        .page-content br {
            line-height: 1.8;
        }
        /* Стили для контейнеров */
        .page-content #container {
            width: 100%;
            margin: 0;
            padding: 0;
        }
        .page-content .attent {
            margin: 20px 0;
            padding: 15px;
            background: #f9fafb;
            border-left: 4px solid var(--primary);
            border-radius: 4px;
        }
        .page-content .attent span[style*="color: rgb(224, 62, 45)"] {
            color: #e03e2d !important;
            font-weight: 600;
        }

/* === login.html === */
        .auth-container {
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            padding: 20px;
        }
        .auth-box {
            background: white;
            border-radius: 16px;
            padding: 40px;
            max-width: 450px;
            width: 100%;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        }
        .auth-title {
            font-family: 'Montserrat', sans-serif;
            font-size: 1.8rem;
            font-weight: 700;
            color: var(--dark);
            margin-bottom: 10px;
            text-align: center;
        }
        .auth-subtitle {
            text-align: center;
            color: var(--gray);
            margin-bottom: 30px;
            font-size: 0.95rem;
        }
        .auth-link {
            text-align: center;
            margin-top: 20px;
            color: var(--gray);
            font-size: 0.9rem;
        }
        .auth-link a {
            color: var(--primary);
            text-decoration: none;
            font-weight: 600;
        }
        .auth-link a:hover {
            text-decoration: underline;
        }
        .error-message {
            background: #fee;
            color: #c33;
            padding: 12px;
            border-radius: 8px;
            margin-bottom: 20px;
            display: none;
            font-size: 0.9rem;
        }
        @media (max-width: 768px) {
            .auth-container {
                padding: 15px;
            }
            .auth-box {
                padding: 30px 20px;
            }
            .auth-title {
                font-size: 1.5rem;
            }
            .auth-subtitle {
                font-size: 0.9rem;
            }
            input {
                font-size: 16px; /* Предотвращает зум на iOS */
            }
        }
        @media (max-width: 480px) {
            .auth-container {
                padding: 10px;
            }
            .auth-box {
                padding: 24px 16px;
            }
            .auth-title {
                font-size: 1.3rem;
            }
            .auth-subtitle {
                font-size: 0.85rem;
            }
            .btn {
                padding: 12px 20px;
                font-size: 0.95rem;
            }
        }

/* === profile.html === */
        .logout-btn {
            background: rgba(255, 255, 255, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.3);
            cursor: pointer;
        }
        .profile-container {
            max-width: 800px;
            margin: 40px auto;
            padding: 0 20px;
        }
        .profile-card {
            background: white;
            border-radius: var(--radius);
            padding: 40px;
            box-shadow: var(--shadow);
            margin-bottom: 30px;
        }
        .profile-header {
            display: flex;
            align-items: center;
            margin-bottom: 30px;
            padding-bottom: 20px;
            border-bottom: 2px solid var(--light-gray);
        }
        .profile-avatar {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            background: var(--gradient);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 2rem;
            font-weight: 600;
            margin-right: 20px;
        }
        .profile-info h2 {
            font-family: 'Montserrat', sans-serif;
            font-size: 1.5rem;
            margin-bottom: 5px;
        }
        .profile-info p {
            color: var(--gray);
            font-size: 0.95rem;
        }
        .form-section {
            margin-top: 30px;
        }
        .form-section h3 {
            font-family: 'Montserrat', sans-serif;
            font-size: 1.2rem;
            margin-bottom: 20px;
            color: var(--dark);
        }
        .success-message {
            background: #efe;
            color: #3c3;
            padding: 12px;
            border-radius: 8px;
            margin-bottom: 20px;
            display: none;
            font-size: 0.9rem;
        }
        .error-message {
            background: #fee;
            color: #c33;
            padding: 12px;
            border-radius: 8px;
            margin-bottom: 20px;
            display: none;
            font-size: 0.9rem;
        }
        .loading {
            text-align: center;
            padding: 40px;
            color: var(--gray);
        }
        @media (max-width: 768px) {
            .profile-container {
                margin: 20px auto;
                padding: 0 15px;
            }
            .profile-card {
                padding: 30px 20px;
            }
            .profile-header {
                flex-direction: column;
                text-align: center;
            }
            .profile-avatar {
                margin-right: 0;
                margin-bottom: 15px;
            }
            .profile-info h2 {
                font-size: 1.3rem;
            }
            input {
                font-size: 16px; /* Предотвращает зум на iOS */
            }
        }
        @media (max-width: 480px) {
            .profile-container {
                margin: 15px auto;
                padding: 0 12px;
            }
            .profile-card {
                padding: 24px 16px;
            }
            .profile-avatar {
                width: 60px;
                height: 60px;
                font-size: 1.5rem;
            }
            .profile-info h2 {
                font-size: 1.1rem;
            }
            .form-section h3 {
                font-size: 1.1rem;
            }
            .btn {
                padding: 12px 16px;
                font-size: 0.9rem;
            }
        }

/* === referrals.html === */
        .referrals-container {
            max-width: 1200px;
            margin: 40px auto;
            padding: 0 20px;
        }
        .referrals-title {
            font-family: 'Montserrat', sans-serif;
            font-size: 2.5rem;
            margin-bottom: 10px;
            color: var(--dark);
        }
        .referrals-subtitle {
            color: var(--gray);
            font-size: 1.1rem;
            margin-bottom: 40px;
        }
        .referral-section {
            background: white;
            border-radius: var(--radius);
            padding: 30px;
            margin-bottom: 30px;
            box-shadow: var(--shadow);
        }
        .referral-section h3 {
            font-family: 'Montserrat', sans-serif;
            font-size: 1.5rem;
            margin-bottom: 20px;
            color: var(--dark);
        }
        .referral-link-container {
            display: flex;
            flex-direction: column;
            gap: 15px;
        }
        .referral-link-input-group {
            display: flex;
            gap: 10px;
            align-items: center;
        }
        .referral-link-input {
            flex: 1;
            padding: 12px 16px;
            border: 2px solid var(--light-gray);
            border-radius: 8px;
            font-size: 0.95rem;
            font-family: 'Source Sans Pro', sans-serif;
            background: #f8fafc;
        }
        .referral-link-input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
        }
        .referral-link-clickable a:hover {
            color: var(--primary-dark);
            text-decoration: underline;
        }
        .btn {
            padding: 12px 24px;
            border: none;
            border-radius: 8px;
            font-size: 0.95rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            font-family: 'Montserrat', sans-serif;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }
        .btn-white {
            background: white;
            color: var(--dark);
            border: 2px solid var(--light-gray);
        }
        .btn-white:hover {
            background: #f8fafc;
            border-color: var(--primary);
        }
        .btn-primary {
            background: var(--gradient);
            color: white;
        }
        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
        }
        .btn-success {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            color: white;
        }
        .btn-success:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
        }
        .referral-link-hint {
            color: var(--gray);
            font-size: 0.9rem;
            margin-top: -5px;
        }
        .how-it-works {
            background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
            border-left: 4px solid var(--primary);
            padding: 25px;
            border-radius: 8px;
            margin-top: 20px;
        }
        .how-it-works ol {
            margin-left: 20px;
            color: var(--dark);
            line-height: 1.8;
        }
        .how-it-works li {
            margin-bottom: 12px;
        }
        .how-it-works p {
            margin-top: 15px;
            color: var(--gray);
            font-style: italic;
        }
        .table-container {
            overflow-x: auto;
            margin-top: 20px;
        }
        table {
            width: 100%;
            border-collapse: collapse;
        }
        thead {
            background: #f8fafc;
        }
        th {
            padding: 12px 16px;
            text-align: left;
            font-family: 'Montserrat', sans-serif;
            font-weight: 600;
            color: var(--dark);
            font-size: 0.9rem;
            border-bottom: 2px solid var(--light-gray);
        }
        td {
            padding: 12px 16px;
            border-bottom: 1px solid var(--light-gray);
            color: var(--dark);
        }
        tbody tr:hover {
            background: #f8fafc;
        }
        .empty-state {
            text-align: center;
            padding: 40px 20px;
            color: var(--gray);
        }
        .empty-state i {
            font-size: 3rem;
            margin-bottom: 15px;
            opacity: 0.5;
        }
        .bonus-balance {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 20px;
        }
        .bonus-balance-label {
            font-weight: 600;
            color: var(--dark);
            font-family: 'Montserrat', sans-serif;
        }
        .bonus-balance-value {
            font-size: 1.3rem;
            font-weight: 700;
            color: var(--primary);
            font-family: 'Montserrat', sans-serif;
        }
        .pagination {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 10px;
            margin-top: 20px;
            flex-wrap: wrap;
        }
        .pagination button {
            padding: 8px 16px;
            border: 2px solid var(--light-gray);
            background: white;
            color: var(--dark);
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.9rem;
            font-weight: 600;
            transition: all 0.2s;
            font-family: 'Montserrat', sans-serif;
        }
        .pagination button:hover:not(:disabled) {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        .pagination button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        .pagination button.active {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        .pagination-info {
            color: var(--gray);
            font-size: 0.9rem;
            margin: 0 10px;
        }
        @media (max-width: 768px) {
            .referral-link-input-group {
                flex-direction: column;
            }
            .referral-link-input-group .btn {
                width: 100%;
                justify-content: center;
            }
            table {
                font-size: 0.85rem;
            }
            th, td {
                padding: 8px 12px;
            }
        }

/* === receipt-view.html === */
        body.page-receipt {
            margin: 0;
            padding: 0;
            background: var(--light, #f5f5f5);
            font-family: 'Source Sans Pro', sans-serif;
        }
        .container {
            max-width: 1200px;
            margin: 30px auto;
            padding: 0 20px;
        }
        .receipt-info {
            background: white;
            border-radius: 12px;
            padding: 30px;
            margin-bottom: 30px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        .receipt-info h2 {
            font-family: 'Montserrat', sans-serif;
            font-size: 1.8rem;
            margin-bottom: 20px;
            color: var(--dark, #333);
        }
        .info-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-bottom: 20px;
        }
        .info-item {
            padding: 15px;
            background: var(--light, #f5f5f5);
            border-radius: 8px;
        }
        .info-item label {
            display: block;
            font-size: 0.85rem;
            color: var(--gray, #666);
            margin-bottom: 5px;
            font-weight: 600;
        }
        .info-item .value {
            font-size: 1rem;
            color: var(--dark, #333);
        }
        .status-badge {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 0.85rem;
            font-weight: 600;
        }
        .status-pending {
            background: #fef3c7;
            color: #92400e;
        }
        .status-confirmed {
            background: #d1fae5;
            color: #065f46;
        }
        .status-rejected {
            background: #fee2e2;
            color: #991b1b;
        }
        .receipt-viewer {
            background: white;
            border-radius: 12px;
            padding: 30px;
            margin-bottom: 30px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        .receipt-viewer h3 {
            font-family: 'Montserrat', sans-serif;
            font-size: 1.5rem;
            margin-bottom: 20px;
            color: var(--dark, #333);
        }
        .receipt-image {
            max-width: 100%;
            border: 2px solid var(--light-gray, #e0e0e0);
            border-radius: 8px;
            margin-bottom: 20px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }
        .receipt-pdf {
            width: 100%;
            height: 800px;
            border: 2px solid var(--light-gray, #e0e0e0);
            border-radius: 8px;
        }
        .action-buttons {
            background: white;
            border-radius: 12px;
            padding: 30px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            display: flex;
            gap: 20px;
            justify-content: center;
            flex-wrap: wrap;
        }
        .btn-confirm {
            background: #10b981;
            color: white;
            border: none;
            padding: 15px 40px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 1rem;
            font-weight: 600;
            transition: background 0.2s;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .btn-confirm:hover {
            background: #059669;
        }
        .btn-confirm:disabled {
            background: #9ca3af;
            cursor: not-allowed;
        }
        .btn-reject {
            background: #ef4444;
            color: white;
            border: none;
            padding: 15px 40px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 1rem;
            font-weight: 600;
            transition: background 0.2s;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .btn-reject:hover {
            background: #dc2626;
        }
        .btn-reject:disabled {
            background: #9ca3af;
            cursor: not-allowed;
        }
        .error-message {
            background: #fee;
            color: #c33;
            padding: 15px;
            border-radius: 8px;
            margin-bottom: 20px;
            display: none;
        }
        .success-message {
            background: #efe;
            color: #3c3;
            padding: 15px;
            border-radius: 8px;
            margin-bottom: 20px;
            display: none;
        }
        .loading {
            text-align: center;
            padding: 40px;
            color: var(--gray, #666);
        }
        .loading i {
            font-size: 3rem;
            margin-bottom: 20px;
            color: var(--primary, #667eea);
        }
        @media (max-width: 768px) {
            .container {
                margin: 20px auto;
                padding: 0 15px;
            }
            .receipt-info, .receipt-viewer, .action-buttons {
                padding: 20px;
            }
            .action-buttons {
                flex-direction: column;
            }
            .btn-confirm, .btn-reject {
                width: 100%;
            }
        }

/* === register.html === */
        .auth-container {
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            padding: 20px;
        }
        .auth-box {
            background: white;
            border-radius: 16px;
            padding: 40px;
            max-width: 450px;
            width: 100%;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        }
        .auth-title {
            font-family: 'Montserrat', sans-serif;
            font-size: 1.8rem;
            font-weight: 700;
            color: var(--dark);
            margin-bottom: 10px;
            text-align: center;
        }
        .auth-subtitle {
            text-align: center;
            color: var(--gray);
            margin-bottom: 30px;
            font-size: 0.95rem;
        }
        .auth-link {
            text-align: center;
            margin-top: 20px;
            color: var(--gray);
            font-size: 0.9rem;
        }
        .auth-link a {
            color: var(--primary);
            text-decoration: none;
            font-weight: 600;
        }
        .auth-link a:hover {
            text-decoration: underline;
        }
        .error-message {
            background: #fee;
            color: #c33;
            padding: 12px;
            border-radius: 8px;
            margin-bottom: 20px;
            display: none;
            font-size: 0.9rem;
        }
        .success-message {
            background: #efe;
            color: #3c3;
            padding: 12px;
            border-radius: 8px;
            margin-bottom: 20px;
            display: none;
            font-size: 0.9rem;
        }
        @media (max-width: 768px) {
            .auth-container {
                padding: 15px;
            }
            .auth-box {
                padding: 30px 20px;
            }
            .auth-title {
                font-size: 1.5rem;
            }
            .auth-subtitle {
                font-size: 0.9rem;
            }
            input {
                font-size: 16px; /* Предотвращает зум на iOS */
            }
        }
        @media (max-width: 480px) {
            .auth-container {
                padding: 10px;
            }
            .auth-box {
                padding: 24px 16px;
            }
            .auth-title {
                font-size: 1.3rem;
            }
            .auth-subtitle {
                font-size: 0.85rem;
            }
            .btn {
                padding: 12px 20px;
                font-size: 0.95rem;
            }
        }

/* === generate-og-image.html === */
        body.page-og {
            margin: 0;
            padding: 0;
            width: 1200px;
            height: 630px;
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            font-family: 'Arial', sans-serif;
            color: white;
            overflow: hidden;
        }
        .icon {
            font-size: 120px;
            margin-bottom: 30px;
        }
        .title {
            font-size: 72px;
            font-weight: bold;
            margin-bottom: 20px;
            text-align: center;
        }
        .domain {
            font-size: 36px;
            opacity: 0.9;
            text-align: center;
        }
        #downloadBtn {
            position: fixed;
            top: 10px;
            right: 10px;
            padding: 10px 20px;
            background: white;
            color: #6366f1;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
            font-weight: bold;
            z-index: 1000;
        }
        #downloadBtn:hover {
            background: #f0f0f0;
        }
