/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #0b0f1a;
    background-image: url("/public/background.png");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
}

/* Safety: hidden overlays/loaders must never block clicks */
.mon-overlay[hidden],
.mon-overlay.hidden {
    display: none !important;
    pointer-events: none !important;
}

/* Monitoring / Login helpers */
.mon-card {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
    background: #fafafa;
}

.mon-status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 12px;
    line-height: 1.6;
    border: 1px solid rgba(0,0,0,0.08);
}

.mon-status-badge.status-good {
    background: rgba(40, 167, 69, 0.12);
    color: #1f7a33;
}

.mon-status-badge.status-wip {
    background: rgba(102, 126, 234, 0.12);
    color: #2f3fb5;
}

.mon-status-badge.status-bad {
    background: rgba(220, 53, 69, 0.12);
    color: #a61e2b;
}

.mon-source-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 12px;
    line-height: 1.6;
    border: 1px solid rgba(0,0,0,0.08);
    background: rgba(0,0,0,0.04);
    color: #333;
    white-space: nowrap;
}

/* Monitoring settings (single-screen, product-like) */
.mon-settings-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    box-shadow: 0 8px 22px rgba(0,0,0,0.06);
    margin-bottom: 12px;
}

.mon-settings-title {
    font-weight: 900;
    font-size: 16px;
    line-height: 1.2;
}

.mon-settings-header-center {
    flex: 1;
    min-width: 240px;
}

.mon-settings-header-right {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.mon-settings-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 12px;
    align-items: start;
}

.mon-settings-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mon-settings-card {
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    padding: 14px;
    background: #fff;
}

.mon-settings-card-title {
    font-weight: 900;
    margin-bottom: 6px;
}

.mon-settings-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    align-items: center;
}

.mon-settings-row input[type="url"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
}

.mon-settings-pages-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    background: #fafafa;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.mon-settings-pages-url {
    flex: 1;
    min-width: 220px;
    font-weight: 700;
}

.mon-settings-chip {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(102,126,234,0.12);
    color: #2f3fb5;
    font-weight: 800;
    font-size: 12px;
}

.mon-settings-checkbox {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.mon-settings-checkbox input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    accent-color: #0d6efd;
}

.mon-settings-radio {
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.mon-settings-radio input[type="radio"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    accent-color: #0d6efd;
}

.mon-settings-radio.disabled {
    opacity: 0.55;
}

/* Monitoring tiles (projects overview) */
.mon-tiles-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.mon-tile {
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 12px;
    padding: 14px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 160px;
}

.mon-tile-title {
    font-weight: 900;
    font-size: 14px;
    line-height: 1.25;
    word-break: break-word;
}

.mon-tile-meta {
    color: #666;
    font-size: 12px;
    line-height: 1.35;
}

.mon-tile-chip {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.08);
    background: rgba(0,0,0,0.04);
    font-weight: 800;
    font-size: 12px;
    white-space: nowrap;
}

.mon-tile-chip.paused {
    background: rgba(220, 53, 69, 0.10);
    color: #a61e2b;
}

.mon-tile-status {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: #555;
    font-weight: 800;
}

.mon-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #bbb;
    display: inline-block;
    position: relative;
}

.mon-dot.live {
    background: #2f9e44;
}

.mon-dot.stale {
    background: #f08c00;
}

.mon-dot.paused {
    background: #adb5bd;
}

.mon-dot.pulse::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 999px;
    border: 2px solid rgba(47, 158, 68, 0.45);
    animation: monPulse 1.6s ease-out infinite;
}

@keyframes monPulse {
    0% { transform: scale(0.6); opacity: 0.85; }
    70% { transform: scale(1.4); opacity: 0; }
    100% { transform: scale(1.4); opacity: 0; }
}

.mon-tile-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    flex-wrap: wrap;
}

.mon-tile-actions button {
    flex: 1;
    min-width: 160px;
}

.mon-tile-actions-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 160px;
}

.mon-tile-actions-stack button {
    width: 100%;
}

.mon-tile-btn {
    border: 2px solid rgba(0,0,0,0.12);
    border-radius: 10px;
    padding: 12px 14px;
    font-weight: 900;
    cursor: pointer;
    width: 100%;
    min-height: 46px;
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.mon-tile-btn:hover:enabled {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.10);
}

.mon-tile-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.mon-tile-btn-active {
    background: rgba(40, 167, 69, 0.14);
    border-color: rgba(40, 167, 69, 0.35);
    color: #1f7a33;
}

.mon-tile-btn-paused {
    background: rgba(220, 53, 69, 0.12);
    border-color: rgba(220, 53, 69, 0.35);
    color: #a61e2b;
}

.mon-tile-btn-delete {
    background: rgba(220, 53, 69, 0.06);
    border-color: rgba(220, 53, 69, 0.25);
    color: #a61e2b;
    min-height: 23px;
    padding: 6px 12px;
    font-weight: 800;
}

.mon-tile-add {
    border: 2px dashed rgba(0,0,0,0.18);
    background: rgba(102, 126, 234, 0.06);
}

.mon-tile-add button {
    width: 100%;
}

@media (max-width: 1100px) {
    .mon-tiles-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Monitoring run status card (Проверка → Готово) */
.mon-run-card {
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(0,0,0,0.06);
    padding: 14px;
    margin: 0 0 12px 0;
    min-height: 168px; /* fixed-ish height to avoid layout jumps */
    transition: transform 180ms ease, opacity 180ms ease, border-color 180ms ease, background 180ms ease;
}

.mon-run-card.phase-done {
    border-color: rgba(40,167,69,0.35);
    background: rgba(40,167,69,0.08);
    animation: monPop 220ms ease-out 1;
}

.mon-run-card.phase-failed {
    border-color: rgba(220,53,69,0.35);
    background: rgba(220,53,69,0.08);
}

.mon-run-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.mon-run-title {
    font-weight: 900;
    font-size: 14px;
    line-height: 1.25;
}

.mon-run-status-line {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 6px;
}

.mon-run-icon {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    display: inline-block;
    background: #adb5bd;
}

.mon-run-card.phase-queued .mon-run-icon,
.mon-run-card.phase-running .mon-run-icon {
    background: #2f9e44;
    box-shadow: 0 0 0 0 rgba(47,158,68,0.45);
    animation: monPulseDot 1.2s ease-out infinite;
}

.mon-run-card.phase-failed .mon-run-icon {
    background: #f08c00;
}

.mon-run-card.phase-done .mon-run-icon {
    background: #2f9e44;
}

.mon-run-status-text {
    font-weight: 900;
}

.mon-run-meta {
    margin-top: 6px;
    color: #666;
    font-size: 12px;
    line-height: 1.3;
}

.mon-run-cta {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.mon-run-progress {
    margin-top: 12px;
    height: 10px;
    border-radius: 999px;
    background: rgba(0,0,0,0.08);
    overflow: hidden;
}

.mon-run-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: rgba(102,126,234,0.85);
    transition: width 220ms ease, background 220ms ease, filter 220ms ease;
}

.mon-run-card.phase-queued .mon-run-progress-fill {
    width: 22%;
    background: linear-gradient(90deg, rgba(102,126,234,0.35), rgba(102,126,234,0.85), rgba(102,126,234,0.35));
    background-size: 220% 100%;
    animation: monShimmer 1.2s linear infinite;
}

.mon-run-card.phase-running .mon-run-progress-fill {
    width: 90%;
    animation: monProgressFill 60s linear 1 forwards;
    background: rgba(102,126,234,0.85);
}

.mon-run-card.phase-done .mon-run-progress-fill {
    width: 100%;
    background: rgba(40,167,69,0.85);
}

.mon-run-card.phase-failed .mon-run-progress-fill {
    width: 100%;
    background: rgba(240,140,0,0.85);
}

.mon-run-steps {
    margin-top: 12px;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.mon-run-card.phase-running .mon-run-steps {
    opacity: 1;
    transform: translateY(0);
}

.mon-run-steps-title {
    font-weight: 900;
    font-size: 12px;
    color: #333;
}

.mon-run-steps-list {
    margin: 8px 0 0 18px;
    color: #555;
    font-size: 12px;
}

@keyframes monShimmer {
    0% { background-position: 0% 0; }
    100% { background-position: 220% 0; }
}

@keyframes monProgressFill {
    0% { width: 28%; }
    100% { width: 90%; }
}

@keyframes monPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes monPulseDot {
    0% { box-shadow: 0 0 0 0 rgba(47,158,68,0.45); }
    70% { box-shadow: 0 0 0 9px rgba(47,158,68,0); }
    100% { box-shadow: 0 0 0 9px rgba(47,158,68,0); }
}

/* Reports highlight */
.mon-report-highlight {
    outline: 2px solid rgba(102,126,234,0.55);
    box-shadow: 0 10px 24px rgba(102,126,234,0.18);
    transition: outline-color 180ms ease, box-shadow 180ms ease;
}

@media (max-width: 720px) {
    .mon-tiles-grid { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
    .mon-settings-grid {
        grid-template-columns: 1fr;
    }
    .mon-settings-row {
        grid-template-columns: 1fr;
    }
}

.mon-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 900px) {
    .mon-grid-2 {
        grid-template-columns: 1fr;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Заголовок */
header {
    text-align: center;
    color: white;
    padding: 40px 20px;
    margin-bottom: 30px;
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
}

/* Основной контент */
main {
    background: #f4efe3;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

/* Секция ввода */
.input-section {
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group label {
    font-weight: 600;
    font-size: 1.1em;
}

.input-group input,
.input-group select {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #667eea;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.advanced-settings summary {
    cursor: pointer;
    font-weight: 700;
    user-select: none;
}

/* ===== Keyword Generator ===== */
.hint {
    color: #666;
    font-size: 13px;
    line-height: 1.4;
}

.keyword-generator-settings {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fafafa;
}

.kg-block .kg-title {
    font-weight: 800;
    font-size: 16px;
    margin-bottom: 4px;
}

.kg-block .kg-subtitle {
    color: #555;
    font-size: 13px;
    line-height: 1.4;
}

.kg-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.kg-field label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 6px;
}

.kg-field input[type="text"],
.kg-field select,
.kg-field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    background: #fff;
}

.kg-field textarea {
    resize: vertical;
    min-height: 68px;
}

.kg-span-2 {
    grid-column: span 2;
}

.kg-radio {
    display: grid;
    gap: 10px;
}

.kg-radio-item {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 10px;
    align-items: start;
    padding: 10px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
}

.kg-radio-item small {
    display: block;
    color: #666;
    font-weight: 500;
    margin-top: 4px;
    line-height: 1.35;
}

@media (max-width: 820px) {
    .kg-grid {
        grid-template-columns: 1fr;
    }
    .kg-span-2 {
        grid-column: auto;
    }
}

/* Верхний уровень: Анализ / SEO-Scanner / Action Plan */
.tool-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.tool-tabs-row {
    display: grid;
    grid-template-columns: 1fr 0.25fr 1fr;
    gap: 10px;
    align-items: stretch;
}

/* Главная: верхние табы только в 2 колонки */
.main-tool-tabs {
    grid-template-columns: 1fr 1fr;
}

/* Auth tabs (Login/Register) */
.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-tab {
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    font-weight: 800;
    cursor: pointer;
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.btn-tab:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    border-color: #667eea;
}

.btn-tab.active {
    border-color: #667eea;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.18);
}

#tool-seo-scanner-tab {
    background: #1e6ff2;
    color: #fff;
    border-color: #1e6ff2;
}
#tool-seo-scanner-tab:hover {
    background: #1a5fd1;
    border-color: #1a5fd1;
}

#tool-analysis-tab {
    font-size: 22px;
    color: #000;
    background: #FC6600;
    border-color: #FC6600;
    padding: 6px 10px;
    min-height: 32px;
}

.btn-tab-secondary {
    border-color: #dc3545;
}

/* Monitoring wizard: mode selector + checks list (product-grade) */
.mon-mode-wrap {
    display: grid;
    gap: 10px;
    margin-top: 6px;
}

.mon-mode-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}

.mon-mode-item input[type="radio"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    accent-color: #0d6efd;
}

.mon-mode-item small {
    display: block;
    color: #666;
    margin-top: 4px;
    line-height: 1.35;
}

.mon-check-item {
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
    margin-bottom: 10px;
}

.mon-check-head {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
}

.mon-check-label {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex: 1;
    min-width: 220px;
}

.mon-check-label input[type="checkbox"] {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    accent-color: #0d6efd;
}

.mon-check-caption {
    color: #666;
    font-size: 12px;
    margin-top: 6px;
    line-height: 1.35;
}

.mon-check-params {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.mon-check-params label {
    font-size: 12px;
    color: #555;
}

.mon-check-params input[type="number"] {
    width: 140px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.12);
}

@media (max-width: 720px) {
    .tool-tabs {
        grid-template-columns: 1fr 1fr;
    }
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.btn-primary,
.btn-secondary {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: #dc3545;
    color: white;
}

.btn-secondary:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* Главные кнопки на главной странице */
#action-plan-btn {
    background: #2f9e44;
    color: #fff;
}
#action-plan-btn:hover:not(:disabled) {
    background: #2b8a3e;
}

#strategy-start-btn {
    background: #2f9e44;
    color: #fff;
}
#strategy-start-btn:hover:not(:disabled) {
    background: #2b8a3e;
}

#monitoring-btn {
    background: #FC6600;
    color: #0b1b3a;
}
#monitoring-btn:hover:not(:disabled) {
    background: #e05b00;
}

#reports-btn {
    background: #1e6ff2;
    color: #fff;
}
#reports-btn:hover:not(:disabled) {
    background: #1a5fd1;
}

#analyze-btn {
    background: #1e6ff2;
    color: #fff;
}
#analyze-btn:hover:not(:disabled) {
    background: #1a5fd1;
}

/* Кнопки действий (главная) */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-buttons-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.action-plan-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
}

.action-plan-row .strategy-hint {
    grid-column: 2;
    margin-top: -2px;
}

.action-button-slot {
    position: relative;
    width: 100%;
}

.action-button-slot > button,
.action-buttons-row > button,
.action-buttons > button {
    width: 100%;
}

/* Анализ / Обновить данные (SEO-Scanner) */
.analysis-buttons-row {
    display: flex;
    gap: 10px;
    width: 100%;
}
.analysis-buttons-row > button {
    width: 100%;
}

/* Секция лога */
.log-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.log-section h2 {
    color: #667eea;
    margin-bottom: 20px;
}

.log-content {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.log-entry {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    color: #6c757d;
    font-weight: 600;
    min-width: 80px;
}

.log-message {
    flex: 1;
}

.log-success {
    color: #28a745;
}

.log-error {
    color: #dc3545;
}

.log-warning {
    color: #ffc107;
}

.log-info {
    color: #17a2b8;
}

/* Секции результатов */
.results-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.results-section h2 {
    color: #667eea;
    margin-bottom: 20px;
}

.results-title-sub {
    display: block;
    font-size: 0.75em;
    font-weight: 400;
    opacity: 0.8;
    margin-top: 6px;
}

.strategy-waiting {
    background: #f4efe3;
    border-radius: 12px;
    padding: 24px;
}

.strategy-waiting-card {
    text-align: center;
}

.strategy-waiting-title {
    font-weight: 800;
    font-size: 20px;
    margin-bottom: 8px;
}

.strategy-waiting-text {
    font-size: 15px;
    color: #333;
}

.strategy-waiting-sub {
    margin-top: 6px;
    font-size: 12px;
    color: #666;
}

.strategy-summary {
    background: #f4efe3;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.strategy-summary-row {
    margin-bottom: 8px;
}

.strategy-bullets {
    margin: 8px 0 0 18px;
}

.strategy-section {
    margin-top: 16px;
}

.strategy-section-title {
    font-weight: 800;
    font-size: 16px;
}

.strategy-section-sub {
    color: #666;
    font-size: 13px;
    margin: 4px 0 8px;
}

.strategy-task-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.strategy-task-list li {
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    border: 1px solid rgba(0,0,0,0.06);
}

.strategy-task-title {
    font-weight: 700;
    margin-bottom: 4px;
}

.strategy-task-why {
    color: #555;
    font-size: 13px;
}

.strategy-error {
    background: #f4efe3;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(0,0,0,0.06);
}

.strategy-error-title {
    font-weight: 800;
    font-size: 18px;
    margin-bottom: 6px;
}

.strategy-error-text {
    color: #333;
    margin-bottom: 12px;
}

.results-content {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
}

.cache-notice {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 20px;
    color: #0c5460;
}

.result-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #dee2e6;
}

.result-header h3 {
    color: #764ba2;
    margin-bottom: 10px;
}

.result-section {
    margin-bottom: 30px;
}

.result-section h4 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.metadata-grid > div {
    padding: 10px;
    background: white;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

.metadata-grid strong {
    color: #764ba2;
    display: block;
    margin-bottom: 5px;
}

.seo-core-content {
    background: white;
    padding: 20px;
    border-radius: 5px;
    border: 1px solid #dee2e6;
    line-height: 1.8;
}

.seo-core-content p {
    margin-bottom: 15px;
}

.steps-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.step-item {
    background: white;
    padding: 20px;
    border-radius: 5px;
    border: 1px solid #dee2e6;
    border-left: 4px solid #667eea;
}

.step-item h5 {
    color: #764ba2;
    margin-bottom: 10px;
}

.step-result {
    color: #495057;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Стили для финального отчета */
.report-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.report-content {
    line-height: 1.8;
    color: #495057;
    font-family: Arial, sans-serif;
    font-size: 12px;
}

.report-content h1,
.report-content h2,
.report-content h3 {
    color: #667eea;
    margin-top: 20px;
    margin-bottom: 15px;
    font-family: Arial, sans-serif;
}

.report-content h1 {
    font-size: 1.8em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.report-content h2 {
    font-size: 1.5em;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 8px;
}

.report-content h3 {
    font-size: 1.3em;
}

.report-content p {
    margin-bottom: 15px;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

.report-content ul,
.report-content ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.report-content li {
    margin-bottom: 8px;
}

.report-content strong {
    color: #764ba2;
    font-weight: 600;
}

.report-content code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.report-content pre {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    border: 1px solid #dee2e6;
}

.report-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.report-content table th,
.report-content table td {
    padding: 10px;
    border: 1px solid #dee2e6;
    text-align: left;
}

.report-content table th {
    background: #667eea;
    color: white;
    font-weight: 600;
}

.report-content hr {
    border: none;
    border-top: 2px solid #dee2e6;
    margin: 20px 0;
}

/* TODO-лист */
.todo-section {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 25px;
}

.todo-content {
    line-height: 1.8;
}

.todo-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    margin-bottom: 10px;
    background: white;
    border-radius: 5px;
    border-left: 4px solid #ffc107;
}

.todo-item input[type="checkbox"] {
    margin-top: 4px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.todo-item span {
    flex: 1;
    color: #495057;
}

/* Структура сайта */
.sitemap-content {
    background: white;
    padding: 20px;
    border-radius: 5px;
    border: 1px solid #dee2e6;
    overflow-x: auto;
}

.sitemap-content pre {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.6;
}

/* Футер */
footer {
    text-align: center;
    color: white;
    padding: 20px;
    opacity: 0.8;
}

/* Скроллбар */
.log-content::-webkit-scrollbar,
.results-content::-webkit-scrollbar {
    width: 8px;
}

.log-content::-webkit-scrollbar-track,
.results-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.log-content::-webkit-scrollbar-thumb,
.results-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.log-content::-webkit-scrollbar-thumb:hover,
.results-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Адаптивность */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }
    
    .input-group {
        gap: 10px;
    }
    
    main {
        padding: 20px;
    }
    
    .metadata-grid {
        grid-template-columns: 1fr;
    }
    
    .log-content {
        max-height: 300px;
    }

    /* На очень узких экранах делаем кнопки в одну колонку */
    .action-buttons-row {
        grid-template-columns: 1fr;
    }
}

/* ===== SEO-Scanner dashboard ===== */
.seo-scanner-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.seo-scanner-score {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
}

.seo-scanner-score .score-value {
    font-size: 28px;
    font-weight: 800;
}

.seo-scanner-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
    border: 1px solid transparent;
}

.seo-scanner-badge.ok { background: #e7f7ee; color: #0f5132; border-color: #badbcc; }
.seo-scanner-badge.warning { background: #fff3cd; color: #664d03; border-color: #ffecb5; }
.seo-scanner-badge.error { background: #f8d7da; color: #842029; border-color: #f5c2c7; }

.seo-scanner-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.seo-scanner-filters button {
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.seo-scanner-filters button.active {
    border-color: #0d6efd;
    color: #0d6efd;
}

.seo-scanner-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.seo-scanner-table th,
.seo-scanner-table td {
    padding: 10px;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    vertical-align: top;
}

.seo-scanner-table thead th {
    background: #f8fafc;
    font-size: 13px;
}

.seo-status {
    font-weight: 800;
    white-space: nowrap;
}
.seo-status.ok { color: #0f5132; }
.seo-status.warning { color: #664d03; }
.seo-status.error { color: #842029; }
.seo-status.na { color: #6c757d; } /* нейтрально: n/a (не измеримо без краулинга) */












