* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #0f1117;
    color: #e1e4e8;
    min-height: 100vh;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
}

.back-link {
    display: inline-block;
    color: #58a6ff;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.back-link:hover {
    text-decoration: underline;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.subtitle {
    color: #8b949e;
    font-size: 1.05rem;
}

form {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.form-group-small {
    max-width: 120px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #c9d1d9;
    font-size: 0.9rem;
}

select,
input[type="text"],
input[type="number"],
textarea {
    width: 100%;
    padding: 10px 14px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    color: #e1e4e8;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

select:focus,
input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus {
    outline: none;
    border-color: #58a6ff;
}

textarea {
    resize: vertical;
}

.hint {
    display: block;
    font-size: 0.78rem;
    color: #6e7681;
    margin-top: 4px;
}

.engine-toggles {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.engine-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    transition: border-color 0.2s;
    font-weight: 400;
    margin-bottom: 0;
}

.engine-toggle:hover {
    border-color: #58a6ff;
}

.engine-toggle input[type="checkbox"] {
    accent-color: #238636;
    width: 16px;
    height: 16px;
}

.toggle-label {
    color: #c9d1d9;
    font-size: 0.9rem;
    font-weight: 600;
}

.toggle-status {
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.toggle-status.available {
    background: #23863633;
    color: #3fb950;
}

.toggle-status.unavailable {
    background: #da363322;
    color: #f8514966;
}

button[type="submit"] {
    width: 100%;
    padding: 12px;
    background: #238636;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

button[type="submit"]:hover {
    background: #2ea043;
}

button[type="submit"]:disabled {
    background: #21262d;
    color: #484f58;
    cursor: not-allowed;
}

h2 {
    font-size: 1.3rem;
    margin-bottom: 16px;
    color: #fff;
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    margin-top: 24px;
    color: #c9d1d9;
}

h4 {
    font-size: 0.95rem;
    margin-bottom: 8px;
    margin-top: 16px;
    color: #8b949e;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #21262d;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #238636, #3fb950);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.85rem;
    color: #8b949e;
    margin-bottom: 16px;
    min-height: 1.2em;
}

@keyframes pulse-text {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#progressSection .progress-text {
    animation: pulse-text 2s ease-in-out infinite;
}

/* ── Bottom job progress bar ─────────────────────────────────────── */
#llmBottomBar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0d1117;
    border-top: 1px solid #30363d;
    z-index: 9000;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.55);
    padding: 10px 20px 14px;
}
.llm-bb-inner { max-width: 960px; margin: 0 auto; }
.llm-bb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 7px;
}
.llm-bb-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #e6edf3;
    display: flex;
    align-items: center;
    gap: 7px;
}
.llm-bb-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3fb950;
    display: inline-block;
    animation: pulse 1.2s infinite;
    flex-shrink: 0;
}
.llm-bb-count { font-size: 0.76rem; color: #8b949e; }
.llm-bb-collapse-btn {
    background: none;
    border: 1px solid #30363d;
    border-radius: 4px;
    color: #8b949e;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    padding: 2px 7px;
    transition: color 0.2s, border-color 0.2s;
}
.llm-bb-collapse-btn:hover { color: #e6edf3; border-color: #58a6ff; }
.llm-bb-track {
    height: 4px;
    background: #21262d;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 9px;
}
.llm-bb-fill {
    height: 100%;
    background: linear-gradient(90deg, #238636, #3fb950);
    border-radius: 2px;
    width: 0%;
    transition: width 0.4s ease;
}
.llm-bb-engines {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.llm-bb-job-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.llm-bb-job-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #58a6ff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0 2px;
}
.llm-bb-engines-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.llm-bb-engine {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 8px;
    padding: 5px 10px;
    flex: 1;
    min-width: 130px;
    max-width: 240px;
    overflow: hidden;
}
.llm-bb-job-dl {
    font-size: 0.78rem;
    padding: 2px 2px 0;
}
.llm-bb-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #30363d;
    transition: background 0.3s;
}
.llm-bb-dot.running { background: #58a6ff; animation: pulse 1.2s infinite; }
.llm-bb-dot.done    { background: #3fb950; animation: none; }
.llm-bb-dot.error   { background: #f85149; animation: none; }
.llm-bb-ename {
    font-size: 0.76rem;
    font-weight: 600;
    color: #c9d1d9;
    white-space: nowrap;
}
.llm-bb-estatus {
    font-size: 0.71rem;
    color: #8b949e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.engine-progress-block {
    margin-bottom: 16px;
}

.engine-progress-block h3 {
    margin-top: 12px;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.run-results {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.run-dot {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 600;
    transition: transform 0.2s;
}

.run-dot:hover {
    transform: scale(1.15);
}

.run-dot.cited {
    background: #238636;
    color: #fff;
}

.run-dot.not-cited {
    background: #21262d;
    color: #6e7681;
    border: 1px solid #30363d;
}

.run-dot.error {
    background: #da3633;
    color: #fff;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.stat-card.highlight {
    border-color: #238636;
    background: #0d1117;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.stat-card.highlight .stat-value {
    color: #3fb950;
}

.stat-label {
    font-size: 0.78rem;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.url-list {
    list-style: none;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 12px 16px;
}

.url-list li {
    padding: 6px 0;
    border-bottom: 1px solid #21262d;
    font-size: 0.9rem;
    word-break: break-all;
}

.url-list li:last-child {
    border-bottom: none;
}

.url-list li a {
    color: #58a6ff;
    text-decoration: none;
}

.url-list li a:hover {
    text-decoration: underline;
}

.details-table-wrap,
.top-domains-table {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.88rem;
}

tr.seed-row {
    background: rgba(56, 139, 253, 0.08);
    border-left: 3px solid #58a6ff;
}

.sortable-th {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.sortable-th:hover {
    color: #58a6ff;
}

.sort-arrow {
    font-size: 0.7rem;
}

th {
    background: #21262d;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: #c9d1d9;
    border-bottom: 1px solid #30363d;
}

td {
    padding: 10px 14px;
    border-bottom: 1px solid #21262d;
    color: #e1e4e8;
}

tr:last-child td {
    border-bottom: none;
}

tr.target-row td {
    color: #3fb950;
    font-weight: 600;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge.yes {
    background: #23863633;
    color: #3fb950;
}

.badge.no {
    background: #da363333;
    color: #f85149;
}

.engine-summary {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.engine-summary h3 {
    margin-top: 0;
    color: #fff;
    font-size: 1.15rem;
}

.target-url a {
    color: #3fb950;
    font-weight: 600;
}

.url-target {
    color: #3fb950;
    font-weight: 600;
    word-break: break-all;
}

.url-other {
    color: #8b949e;
    word-break: break-all;
}

.url-cell {
    font-size: 0.82rem;
    line-height: 1.6;
}

.all-urls-list {
    max-height: 300px;
    overflow-y: auto;
}

.engine-error {
    border-color: #da363366;
}

.error-banner {
    background: #da363322;
    color: #f85149;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.analyze-section {
    margin-top: 28px;
    text-align: center;
}

.analyze-btn {
    padding: 14px 32px;
    background: linear-gradient(135deg, #1f6feb, #58a6ff);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.analyze-btn:hover {
    opacity: 0.9;
}

.analyze-btn:disabled {
    background: #21262d;
    color: #484f58;
    cursor: not-allowed;
}

.analysis-loading {
    color: #8b949e;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.analysis-content {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 28px 32px;
    margin-top: 20px;
    text-align: left;
    line-height: 1.8;
    color: #d1d5db;
    font-size: 0.95rem;
}

.analysis-content h2,
.analysis-content h3,
.analysis-content h4 {
    color: #f0f3f6;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #21262d;
}

.analysis-content h2 {
    font-size: 1.3rem;
    margin-top: 28px;
    color: #58a6ff;
    border-bottom: 2px solid #1f6feb44;
    padding-bottom: 8px;
}

.analysis-content h3 {
    font-size: 1.15rem;
    margin-top: 22px;
    color: #e1e4e8;
}

.analysis-content h4 {
    font-size: 1.05rem;
    margin-top: 16px;
    color: #c9d1d9;
    border-bottom: none;
}

.analysis-content h2:first-child,
.analysis-content h3:first-child {
    margin-top: 0;
}

.analysis-content strong {
    color: #58a6ff;
    font-weight: 600;
}

.analysis-content em {
    color: #c9d1d9;
    font-style: italic;
}

.analysis-content code {
    background: #0d1117;
    color: #79c0ff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.88em;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.analysis-content ul,
.analysis-content ol {
    padding-left: 24px;
    margin: 10px 0 14px 0;
}

.analysis-content ul {
    list-style: disc;
}

.analysis-content ol {
    list-style: decimal;
}

.analysis-content li {
    margin-bottom: 8px;
    padding-left: 4px;
    line-height: 1.7;
}

.analysis-content li strong {
    color: #e1e4e8;
}

.analysis-content p {
    margin-bottom: 12px;
    line-height: 1.8;
}

.analysis-content hr {
    border: none;
    border-top: 1px solid #30363d;
    margin: 20px 0;
}

.analysis-content a {
    color: #58a6ff;
    text-decoration: underline;
}

.analysis-content a:hover {
    color: #79c0ff;
}

.analysis-streaming-text {
    opacity: 0.85;
    border-color: #58a6ff44;
}

.response-accordion {
    margin-top: 8px;
}

.response-item {
    margin-bottom: 4px;
}

.response-toggle {
    width: 100%;
    text-align: left;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 10px 14px;
    color: #c9d1d9;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s;
    font-family: inherit;
}

.response-toggle:hover {
    background: #161b22;
}

.toggle-icon {
    font-size: 0.7rem;
    color: #8b949e;
    flex-shrink: 0;
}

.response-preview {
    color: #6e7681;
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-left: 8px;
    flex: 1;
}

.response-body {
    border: 1px solid #30363d;
    border-top: none;
    border-radius: 0 0 8px 8px;
    margin-top: -4px;
    padding-top: 4px;
}

.response-text {
    background: #0d1117;
    color: #e1e4e8;
    padding: 16px;
    font-size: 0.85rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 400px;
    overflow-y: auto;
    font-family: inherit;
    margin: 0;
}

.visibility-score-section {
    text-align: center;
    margin: 24px 0 28px;
}

.visibility-score-section h3 {
    margin-top: 12px;
    color: #8b949e;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score-circle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid;
    background: #0d1117;
}

.score-number {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
}

.score-label {
    font-size: 0.75rem;
    color: #8b949e;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reco-heading {
    text-align: center;
    color: #fff;
    margin-bottom: 16px;
    font-size: 1.15rem;
}

.recommendation-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.reco-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 20px;
    transition: border-color 0.2s, transform 0.2s;
}

.reco-card:hover {
    border-color: #58a6ff;
    transform: translateY(-2px);
}

.reco-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.reco-icon {
    flex-shrink: 0;
}

.reco-icon svg {
    display: block;
}

.reco-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.reco-number {
    font-size: 0.8rem;
    color: #6e7681;
    font-weight: 600;
}

.reco-impact {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid;
}

.reco-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    margin-top: 0;
    line-height: 1.3;
}

.reco-desc {
    color: #8b949e;
    font-size: 0.88rem;
    line-height: 1.5;
    margin-bottom: 12px;
}

.reco-category {
    display: inline-block;
    background: #21262d;
    color: #6e7681;
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: capitalize;
}

.detailed-analysis {
    margin-top: 20px;
}

.detail-toggle {
    width: 100%;
    text-align: left;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 14px 18px;
    color: #58a6ff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s;
}

.detail-toggle:hover {
    background: #1c2128;
}

.brand-detection {
    background: #1c2333;
    border: 1px solid #2d3548;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.brand-detection p {
    font-size: 0.95rem;
    color: #c9d1d9;
}

.brand-tag {
    display: inline-block;
    background: #238636;
    color: #fff;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    margin: 2px 4px;
}

.search-volume-info {
    background: #1c2333;
    border: 1px solid #2d3548;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.search-volume-info p {
    font-size: 0.95rem;
    color: #c9d1d9;
}

.search-vol-number {
    color: #58a6ff;
    font-weight: bold;
    font-size: 1.1rem;
}

.llm-prompt-estimates {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
}

.prompt-est-tag {
    display: inline-block;
    background: #161b22;
    border: 1px solid #30363d;
    color: #c9d1d9;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.prompt-est-tag strong {
    color: #58a6ff;
}

.est-disclaimer {
    font-size: 0.75rem;
    color: #8b949e;
    margin-top: 6px;
    font-style: italic;
}

.combined-summary {
    margin-bottom: 24px;
}

@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
    }
    .form-group-small {
        max-width: none;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    header h1 {
        font-size: 1.5rem;
    }
    .engine-toggles {
        flex-direction: column;
    }
}

.competitor-table-wrap {
    overflow-x: auto;
    margin-bottom: 24px;
}

.competitor-table {
    width: 100%;
    border-collapse: collapse;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    overflow: hidden;
}

.competitor-table th {
    background: #1c2128;
    color: #8b949e;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #30363d;
}

.competitor-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #21262d;
    color: #e1e4e8;
    font-size: 0.9rem;
    vertical-align: top;
}

.competitor-table tr:last-child td {
    border-bottom: none;
}

.competitor-table tr:hover {
    background: #1c2128;
}

.comp-strengths {
    margin: 0;
    padding-left: 16px;
    list-style: disc;
}

.comp-strengths li {
    color: #8b949e;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.comp-strengths li:last-child {
    margin-bottom: 0;
}

.pdf-download-section {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #30363d;
}

.pdf-btn {
    display: inline-block;
    padding: 12px 28px;
    background: #1f6feb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.pdf-btn:hover {
    background: #388bfd;
}

/* Deep render toggle */
.audit-toggle-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #30363d;
    border-radius: 24px;
    transition: background 0.2s;
    border: 1px solid #484f58;
}

.toggle-slider:before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    top: 2px;
    background: #8b949e;
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #1a4a8a;
    border-color: #1f6feb;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(18px);
    background: #58a6ff;
}

.toggle-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.toggle-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #c9d1d9;
    display: flex;
    align-items: center;
    gap: 7px;
}

.toggle-desc {
    font-size: 0.8rem;
    color: #8b949e;
    line-height: 1.45;
}

.badge-new {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    background: #1f6feb33;
    color: #58a6ff;
    border: 1px solid #1f6feb55;
    border-radius: 4px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.logo-option-btn {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.logo-option-btn input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.logo-option-btn span {
    display: inline-block;
    padding: 5px 13px;
    background: #161b22;
    border: 1px solid #30363d;
    color: #8b949e;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.logo-option-btn input[type="radio"]:checked ~ span {
    background: #1a4a8a;
    border-color: #1f6feb;
    color: #58a6ff;
}

.logo-option-btn:hover span {
    border-color: #484f58;
    color: #c9d1d9;
}

.dashboard-wrapper {
    max-width: 700px;
    margin: 0 auto;
    padding: 80px 20px;
    text-align: center;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 48px;
}

.dashboard-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 16px;
    padding: 40px 28px;
    text-decoration: none;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.dashboard-card:hover {
    border-color: #58a6ff;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.dashboard-card-icon {
    margin-bottom: 20px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d1117;
    border-radius: 50%;
    border: 1px solid #30363d;
}

.dashboard-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.dashboard-card-desc {
    color: #8b949e;
    font-size: 0.9rem;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .dashboard-wrapper {
        padding: 40px 16px;
    }
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
}

.market-selector {
    position: relative;
}

.market-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    cursor: pointer;
    color: #e1e4e8;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.market-toggle:hover {
    border-color: #58a6ff;
}

.market-toggle-arrow {
    font-size: 0.75rem;
    color: #8b949e;
    transition: transform 0.2s;
}

.market-toggle.open .market-toggle-arrow {
    transform: rotate(180deg);
}

.market-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    z-index: 100;
    max-height: 360px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.market-region-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 1px solid #30363d;
}

.region-btn {
    padding: 4px 12px;
    font-size: 0.8rem;
    border-radius: 16px;
    border: 1px solid #30363d;
    background: #0d1117;
    color: #8b949e;
    cursor: pointer;
    transition: all 0.2s;
}

.region-btn:hover {
    border-color: #58a6ff;
    color: #58a6ff;
}

.region-btn.active {
    background: #1f6feb;
    border-color: #1f6feb;
    color: #fff;
}

.region-btn-clear {
    border-color: #da3633;
    color: #da3633;
}

.region-btn-clear:hover {
    background: #da3633;
    color: #fff;
}

.market-search-wrap {
    padding: 8px 12px;
    border-bottom: 1px solid #30363d;
}

.market-search {
    width: 100%;
    padding: 7px 10px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #e1e4e8;
    font-size: 0.85rem;
    outline: none;
}

.market-search:focus {
    border-color: #58a6ff;
}

.market-options {
    overflow-y: auto;
    max-height: 240px;
    padding: 6px 0;
}

.market-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #c9d1d9;
    transition: background 0.15s;
}

.market-option:hover {
    background: #1c2128;
}

.market-option input[type="checkbox"] {
    accent-color: #58a6ff;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.market-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.market-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: #1f6feb22;
    border: 1px solid #1f6feb;
    border-radius: 16px;
    font-size: 0.8rem;
    color: #58a6ff;
}

.market-tag-remove {
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.market-tag-remove:hover {
    opacity: 1;
}

.generate-prompts-btn {
    padding: 6px 16px;
    font-size: 0.85rem;
    border-radius: 6px;
    border: 1px solid #30363d;
    background: #21262d;
    color: #c9d1d9;
    cursor: pointer;
    transition: all 0.2s;
}

.generate-prompts-btn:hover {
    border-color: #58a6ff;
    color: #58a6ff;
}

.generate-prompts-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.generated-prompts-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
    max-height: 300px;
    overflow-y: auto;
}

.generated-prompt-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #c9d1d9;
    transition: border-color 0.2s;
}

.generated-prompt-item:hover {
    border-color: #58a6ff;
}

.generated-prompt-item input[type="checkbox"] {
    accent-color: #58a6ff;
    margin-top: 2px;
    flex-shrink: 0;
}

.use-prompts-btn {
    padding: 6px 16px;
    font-size: 0.85rem;
    border-radius: 6px;
    border: 1px solid #238636;
    background: #238636;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.use-prompts-btn:hover {
    background: #2ea043;
}

.brand-domain-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #161b22;
    border: 1px solid #238636;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #c9d1d9;
    margin-bottom: 8px;
}

.brand-tag-fixed {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #238636;
    background: rgba(35, 134, 54, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.detect-brands-btn {
    padding: 6px 16px;
    font-size: 0.85rem;
    border-radius: 6px;
    border: 1px solid #30363d;
    background: #21262d;
    color: #c9d1d9;
    cursor: pointer;
    transition: all 0.2s;
}

.detect-brands-btn:hover {
    border-color: #58a6ff;
    color: #58a6ff;
}

.detect-brands-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.detected-brands-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.detected-brand-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #c9d1d9;
    transition: border-color 0.2s;
}

.detected-brand-item:hover {
    border-color: #58a6ff;
}

.detected-brand-item input[type="checkbox"] {
    accent-color: #58a6ff;
    flex-shrink: 0;
}

.detected-brand-item.unchecked {
    opacity: 0.5;
}

.prompts-used-info {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.prompts-used-list {
    margin: 8px 0 0 20px;
    font-size: 0.85rem;
    color: #8b949e;
}

.prompts-used-list li {
    margin-bottom: 4px;
}

.prompt-cell {
    font-size: 0.8rem;
    color: #8b949e;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bing-section {
    margin-top: 32px;
    border-top: 2px solid #00a4ef;
    padding-top: 24px;
}

.bing-header {
    font-size: 1.3rem;
    font-weight: 700;
    color: #00a4ef;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}

.bing-section .stat-card {
    border-color: #00a4ef33;
}

.bing-section .stat-card .stat-label {
    color: #7ec8f0;
}

.live-badge {
    display: inline-block;
    background: #238636;
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.db-badge {
    display: inline-block;
    background: #00a4ef33;
    color: #7ec8f0;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.bing-serp-detail {
    background: #161b2233;
    border: 1px solid #30363d;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

.bing-serp-detail summary {
    padding: 10px 14px;
    cursor: pointer;
    color: #e6edf3;
    font-size: 0.9rem;
}

.bing-serp-detail summary:hover {
    background: #21262d;
}

.bing-serp-detail[open] summary {
    border-bottom: 1px solid #30363d;
}

.bing-serp-detail .details-table-wrap {
    margin: 0;
}

.bing-serp-detail table {
    font-size: 0.82rem;
}

.bing-serp-detail .target-row {
    background: #00a4ef15;
}

.bing-serp-detail .target-row td {
    color: #00a4ef;
    font-weight: 600;
}

/* ===== PAGE AUDIT ===== */

.audit-overview {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

.audit-url-bar {
    font-size: 0.95rem;
    color: #8b949e;
    margin-bottom: 12px;
    word-break: break-all;
}

.audit-url-bar a {
    color: #58a6ff;
}

.audit-score-row {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

.audit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

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

.audit-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 10px;
    overflow: hidden;
}

.audit-card-title {
    background: #21262d;
    padding: 10px 16px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #e6edf3;
    border-bottom: 1px solid #30363d;
    letter-spacing: 0.3px;
}

.audit-card-body {
    padding: 14px 16px;
}

.audit-stat-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.audit-mini-stat {
    flex: 1;
    min-width: 70px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 8px 10px;
    text-align: center;
}

.audit-mini-val {
    font-size: 1.4rem;
    font-weight: 700;
    color: #e6edf3;
    line-height: 1.2;
}

.audit-mini-label {
    font-size: 0.7rem;
    color: #8b949e;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.audit-checks-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.audit-check-item {
    font-size: 0.87rem;
    color: #c9d1d9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.audit-check-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.87rem;
}

.audit-check-table tr + tr td {
    border-top: 1px solid #21262d;
}

.audit-kw-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.audit-kw-table thead th {
    background: #1e2330;
    color: #8b949e;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #30363d;
}
.audit-kw-table thead th:nth-child(3),
.audit-kw-table thead th:nth-child(4),
.audit-kw-table thead th:nth-child(5),
.audit-kw-table thead th:nth-child(6),
.audit-kw-table thead th:nth-child(7) { text-align: right; }
.audit-kw-table thead th:nth-child(1),
.audit-kw-table thead th:nth-child(3) { text-align: center; }
.audit-kw-table tbody tr { border-bottom: 1px solid #21262d; }
.audit-kw-table tbody tr:hover { background: #161b22; }
.audit-kw-table tbody td {
    padding: 7px 10px;
    color: #adbac7;
    vertical-align: middle;
}

.audit-check-label {
    color: #8b949e;
    padding: 6px 8px 6px 0;
    width: 180px;
    vertical-align: top;
    white-space: nowrap;
}

.audit-check-value {
    color: #c9d1d9;
    padding: 6px 0;
    word-break: break-word;
}

.heading-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    margin-right: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.h1-badge { background: #f0883e33; color: #f0883e; }
.h2-badge { background: #58a6ff22; color: #58a6ff; }
.h3-badge { background: #3fb95022; color: #3fb950; }
.h4-badge { background: #8b949e22; color: #8b949e; }

.audit-section-header {
    font-size: 1.2rem;
    font-weight: 700;
    color: #e6edf3;
    margin: 24px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #30363d;
}

.audit-quality-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.audit-quality-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 14px 16px;
}

.audit-quality-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.audit-quality-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: #e6edf3;
}

.audit-quality-score-bar {
    height: 6px;
    background: #21262d;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.audit-quality-score-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.audit-quality-score-val {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.audit-quality-notes {
    font-size: 0.82rem;
    color: #8b949e;
    line-height: 1.4;
}

.audit-rec-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.audit-rec-list li {
    padding: 8px 0 8px 20px;
    position: relative;
    font-size: 0.9rem;
    color: #c9d1d9;
    border-bottom: 1px solid #21262d;
}

.audit-rec-list li:last-child {
    border-bottom: none;
}

.audit-rec-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #f0883e;
    font-weight: 700;
}

.details-table-wrap {
    overflow-x: auto;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid #30363d;
    border-radius: 6px;
}

.details-table-wrap table {
    width: 100%;
    min-width: 400px;
    border-collapse: collapse;
}

.details-table-wrap table thead th {
    background: #21262d;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 1;
}

.details-table-wrap table tbody tr:nth-child(even) td {
    background: #0d111766;
}

.details-table-wrap table tbody td {
    padding: 5px 10px;
    border-top: 1px solid #21262d;
    color: #c9d1d9;
    vertical-align: top;
}

.url-cell {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: monospace;
    font-size: 0.78rem !important;
    color: #8b949e !important;
}

.audit-ai-summary {
    background: #0d1117;
    border: 1px solid #30363d;
    border-left: 3px solid #58a6ff;
    border-radius: 8px;
    padding: 14px 18px;
    color: #c9d1d9;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.audit-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 700px) {
    .audit-detail-grid { grid-template-columns: 1fr; }
}

.audit-detail-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 16px;
}

.audit-detail-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.audit-detail-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.audit-detail-label {
    font-weight: 700;
    font-size: 0.95rem;
    color: #e6edf3;
    flex: 1;
}

.audit-detail-score-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.audit-detail-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #58a6ff;
    margin: 10px 0 6px;
}

.audit-detail-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.audit-findings-list li {
    font-size: 0.85rem;
    color: #c9d1d9;
    padding: 5px 0 5px 18px;
    position: relative;
    border-bottom: 1px solid #21262d;
    line-height: 1.45;
}

.audit-findings-list li:last-child {
    border-bottom: none;
}

.audit-findings-list li::before {
    content: '•';
    position: absolute;
    left: 4px;
    color: #8b949e;
}

.audit-rec-detail-list li {
    font-size: 0.85rem;
    color: #c9d1d9;
    padding: 5px 0 5px 18px;
    position: relative;
    border-bottom: 1px solid #21262d;
    line-height: 1.45;
}

.audit-rec-detail-list li:last-child {
    border-bottom: none;
}

.audit-rec-detail-list li::before {
    content: '→';
    position: absolute;
    left: 2px;
    color: #f0883e;
    font-weight: 700;
}

/* ── Page Construct ────────────────────────────────────────────── */
.construct-meta-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid #21262d;
    flex-wrap: wrap;
}
.construct-meta-row:last-child { border-bottom: none; }
.construct-meta-label {
    min-width: 165px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #8b949e;
    padding-top: 1px;
    flex-shrink: 0;
}
.construct-meta-value {
    flex: 1;
    font-size: 0.9rem;
    color: #cdd9e5;
    line-height: 1.4;
}
.construct-copy-btn {
    flex-shrink: 0;
    background: #1c2333;
    border: 1px solid #30363d;
    color: #8b949e;
    border-radius: 5px;
    padding: 2px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.construct-copy-btn:hover { background: #30363d; color: #cdd9e5; }

.construct-copy-all-btn {
    display: inline-block;
    margin-top: 10px;
    background: #1c2333;
    border: 1px solid #30363d;
    color: #8b949e;
    border-radius: 6px;
    padding: 5px 16px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.construct-copy-all-btn:hover { background: #30363d; color: #cdd9e5; }

.construct-section {
    padding: 12px 0;
    border-bottom: 1px solid #21262d;
}
.construct-section:last-of-type { border-bottom: none; }

.construct-h2-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.construct-h2-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: #58a6ff;
    flex: 1;
}
.construct-h3-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
    margin-left: 20px;
}
.construct-h3-text {
    font-size: 0.88rem;
    font-weight: 600;
    color: #bc8cff;
    flex: 1;
}
.construct-tag {
    display: inline-block;
    border-radius: 4px;
    padding: 1px 7px;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: 0.03em;
}
.construct-tag-h2 { background: #1a3050; color: #58a6ff; }
.construct-tag-h3 { background: #2a1a40; color: #bc8cff; }

.construct-brief {
    font-size: 0.82rem;
    color: #8b949e;
    margin-top: 5px;
    margin-left: 46px;
    font-style: italic;
    line-height: 1.5;
}
.construct-brief-h3 { margin-left: 66px; }

.construct-faq {
    padding: 10px 0;
    border-bottom: 1px solid #21262d;
}
.construct-faq:last-child { border-bottom: none; }
.construct-faq-q {
    font-size: 0.88rem;
    font-weight: 700;
    color: #cdd9e5;
    display: flex;
    align-items: center;
    gap: 10px;
}
.construct-faq-a {
    font-size: 0.83rem;
    color: #8b949e;
    margin-top: 5px;
    margin-left: 2px;
    line-height: 1.55;
}

.construct-code {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 12px;
    font-size: 0.72rem;
    color: #adbac7;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 280px;
    overflow-y: auto;
    line-height: 1.5;
}

.construct-link-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #21262d;
    flex-wrap: wrap;
}
.construct-link-row:last-child { border-bottom: none; }
.construct-anchor {
    background: #1a3050;
    color: #58a6ff;
    border-radius: 4px;
    padding: 2px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}
.construct-link-desc {
    font-size: 0.82rem;
    color: #8b949e;
    flex: 1;
    line-height: 1.45;
}

.construct-serp-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #21262d;
}
.construct-serp-row:last-child { border-bottom: none; }
.construct-serp-pos {
    min-width: 28px;
    height: 28px;
    background: #1c2333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: #8b949e;
    flex-shrink: 0;
    text-align: center;
    line-height: 28px;
}
.construct-serp-info { flex: 1; }
.construct-serp-title { font-size: 0.88rem; font-weight: 600; }
.construct-serp-title a { color: #58a6ff; text-decoration: none; }
.construct-serp-title a:hover { text-decoration: underline; }
.construct-serp-url { font-size: 0.75rem; color: #3fb950; margin-top: 2px; }
.construct-serp-desc { font-size: 0.78rem; color: #8b949e; margin-top: 3px; line-height: 1.4; }

/* ── Page Construct HTML modal ─────────────────────────────────────────────── */
.construct-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.construct-modal {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 12px;
    width: 100%;
    max-width: 1000px;
    height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}
.construct-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #21262d;
    flex-shrink: 0;
    gap: 10px;
    flex-wrap: wrap;
}
.construct-modal-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #cdd9e5;
}
.construct-modal-close {
    background: #21262d;
    border: 1px solid #30363d;
    color: #8b949e;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.construct-modal-close:hover { background: #f85149; color: #fff; border-color: #f85149; }

.construct-modal-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 14px;
    border-bottom: 1px solid #21262d;
    flex-shrink: 0;
    background: #0d1117;
}
.construct-tab {
    background: none;
    border: 1px solid transparent;
    color: #8b949e;
    border-radius: 6px;
    padding: 5px 16px;
    font-size: 0.83rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.construct-tab:hover { color: #cdd9e5; background: #161b22; }
.construct-tab.active {
    background: #1c2333;
    border-color: #30363d;
    color: #cdd9e5;
    font-weight: 600;
}
.construct-modal-body {
    flex: 1;
    overflow: auto;
    padding: 16px;
    min-height: 0;
}
.construct-html-code {
    background: transparent;
    border: none;
    margin: 0;
    padding: 0;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.78rem;
    color: #adbac7;
    white-space: pre;
    line-height: 1.6;
    tab-size: 4;
}

/* ── Content Analysis scores ───────────────────────────────────────────────── */
.construct-score-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}
.construct-score-card {
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: 8px;
    padding: 12px 14px;
}
.construct-score-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.construct-score-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #8b949e;
    flex: 1;
    line-height: 1.3;
    padding-right: 8px;
}
.construct-score-num {
    font-size: 1.3rem;
    font-weight: 800;
    flex-shrink: 0;
    line-height: 1;
}
.construct-score-bar-wrap {
    height: 4px;
    background: #21262d;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}
.construct-score-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease;
}
.construct-score-fb {
    margin: 0;
    padding-left: 14px;
    list-style: disc;
}
.construct-score-fb li {
    font-size: 0.74rem;
    color: #8b949e;
    line-height: 1.45;
    margin-bottom: 2px;
}

/* Score ring */
.construct-score-ring {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: conic-gradient(var(--ring-color, #3fb950) calc(var(--score-pct, 0) * 1%), #21262d 0);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}
.construct-score-ring::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: #0d1117;
}
.construct-score-ring span {
    position: relative;
    z-index: 1;
}

/* Optimization notice (in-progress spinner state) */
.construct-optimize-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #1c1a0e;
    border: 1px solid #4a3800;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 8px;
}

/* Optimization CTA (button state shown after scoring) */
.construct-optimize-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: #1c1a0e;
    border: 1px solid #4a3800;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.construct-optimize-btn {
    background: #d29922;
    color: #0d1117;
    border: none;
    border-radius: 6px;
    padding: 7px 18px;
    font-size: 0.83rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, transform 0.1s;
    flex-shrink: 0;
}
.construct-optimize-btn:hover { background: #e3ad30; }
.construct-optimize-btn:active { transform: scale(0.97); }
.construct-optimize-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.construct-optimized-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #0d2614;
    border: 1px solid #1a4a28;
    color: #3fb950;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 20px;
    padding: 4px 14px;
    margin-bottom: 14px;
}

/* Spinner */
@keyframes construct-spin {
    to { transform: rotate(360deg); }
}
.construct-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #30363d;
    border-top-color: #58a6ff;
    border-radius: 50%;
    animation: construct-spin 0.8s linear infinite;
    flex-shrink: 0;
}

/* ── Sales Funnel Analyser ───────────────────────────────────────────────── */
.funnel-action-item:last-child {
    border-bottom: none !important;
}
.funnel-action-item:hover {
    background: rgba(255,255,255,0.015) !important;
    transition: background 0.15s;
}

/* ── Page Audit — parallel jobs panel ───────────────────────────────────── */
#audit-jobs-panel {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 10px;
    overflow: hidden;
}
.audit-jobs-header {
    padding: 10px 16px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid #30363d;
    background: #1c2128;
}
.audit-job-card {
    padding: 12px 16px;
    border-bottom: 1px solid #21262d;
}
.audit-job-card:last-child { border-bottom: none; }
.audit-job-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.audit-job-url {
    font-size: 0.85rem;
    color: #cdd9e5;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 75%;
}
.audit-job-bar-wrap {
    height: 4px;
    background: #30363d;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 5px;
}
.audit-job-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s ease;
}
.audit-job-msg {
    font-size: 0.76rem;
    color: #8b949e;
}
.audit-job-view-btn {
    margin-top: 6px;
    background: #1f6feb22;
    color: #58a6ff;
    border: 1px solid #388bfd55;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.15s;
}
.audit-job-view-btn:hover { background: #1f6feb44; }
.audit-spinner {
    display: inline-block;
    width: 8px;
    height: 8px;
    border: 1.5px solid #30363d;
    border-top-color: #58a6ff;
    border-radius: 50%;
    animation: construct-spin 0.8s linear infinite;
    flex-shrink: 0;
}
