:root {
    --bg-color: #f8fafc;
    --panel-bg: rgba(255, 255, 255, 0.7);
    --panel-border: rgba(0, 0, 0, 0.08);
    --text-primary: #0f172a;
    --text-secondary: #475569;

    --accent-primary: #c3272e;
    --accent-secondary: #d64047;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    /* clip (not hidden) so position:sticky on result header still works */
    overflow-x: clip;
    position: relative;
    line-height: 1.5;
}

/* Background Animated Blobs */
.blob {
    position: absolute;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.5;
    animation: drift 20s infinite alternate linear;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(195, 39, 46, 0.15) 0%, rgba(13, 15, 23, 0) 70%);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(103, 103, 103, 0.1) 0%, rgba(13, 15, 23, 0) 70%);
    animation-delay: -10s;
}

@keyframes drift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(5%, 10%) scale(1.1);
    }
}

/* Typography & Layout */
.app-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    min-height: 100vh;
    box-sizing: border-box;
}

.site-footer {
    margin-top: auto;
    padding: 0.25rem 0 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.45;
}

.site-footer p {
    margin: 0;
}

.site-footer a {
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.hidden {
    display: none !important;
}

/* Glassmorphism System */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

/* Header */
header {
    text-align: left;
    padding: 2rem !important;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    margin-bottom: 0;
    min-width: 0;
}

.logo-link {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    line-height: 0;
    text-decoration: none;
    color: inherit;
}

.logo-link img {
    display: block;
}

.logo svg {
    color: var(--accent-primary);
    width: 2.5rem;
    height: 2.5rem;
}

h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
}

/* Search Box */
.search-box {
    padding: 1.5rem !important;
}

.input-wrapper {
    display: flex;
    gap: 1rem;
    position: relative;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--panel-border);
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(195, 39, 46, 0.2);
}

.input-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    width: 1.25rem;
}

input[type="url"] {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1.05rem;
    padding: 0.75rem 0.75rem 0.75rem 3rem;
    outline: none;
}

input::placeholder {
    color: #475569;
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(195, 39, 46, 0.4);
}

.primary-btn:active {
    transform: translateY(0);
}

.primary-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Analyze morphs to Stop while a run is active */
.primary-btn.is-stop {
    background: #ffffff;
    color: #b42318;
    border: 1.5px solid #fda29b;
    box-shadow: none;
}

.primary-btn.is-stop:hover {
    background: #fef3f2;
    color: #912018;
    border-color: #f97066;
    box-shadow: 0 6px 14px -4px rgba(180, 35, 24, 0.25);
    transform: translateY(-1px);
}

.primary-btn.is-stop:active {
    transform: translateY(0);
}

.primary-btn.is-stop svg {
    width: 1rem;
    height: 1rem;
}

.error-msg {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    margin-left: 1rem;
    display: none;
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
    border-left: 1px solid var(--panel-border);
}

.toggle-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
    background-color: var(--accent-primary);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* Results Container & Stepper */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: slideUp 0.5s ease forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stepper h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stepper h3 svg {
    color: var(--accent-primary);
}

.step-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

/* Step Status States */
.step.waiting {
    opacity: 0.5;
}

.step.running {
    opacity: 1;
    background: rgba(195, 39, 46, 0.05);
    border-color: rgba(195, 39, 46, 0.2);
}

.step.running .default-icon {
    display: none;
}

.step.running .spinner {
    display: block;
}

.step.running h4 {
    color: var(--text-primary);
}

.step.complete {
    opacity: 1;
    border-color: rgba(16, 185, 129, 0.2);
}

.step.complete .step-icon {
    color: var(--success);
}

.step.warning {
    opacity: 1;
    border-color: rgba(245, 158, 11, 0.2);
}

.step.warning .step-icon {
    color: var(--warning);
}


.step-icon {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.step-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.spinner {
    display: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(195, 39, 46, 0.3);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.step-content {
    min-width: 0;
    flex: 1 1 auto;
}

.step-content h4 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.step-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.step-output {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    border: 1px dashed var(--panel-border);
    font-size: 0.85rem;
    color: var(--text-primary);
    word-break: break-word;
    max-height: 250px;
    overflow-y: auto;
}

/* Formatted Step Outputs */
.formatted-section {
    margin-bottom: 0.5rem;
}

.formatted-section:last-child {
    margin-bottom: 0;
}

.formatted-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-primary);
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.formatted-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.formatted-list {
    margin-left: 1.25rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.formatted-list li {
    margin-bottom: 0.25rem;
}

.clean-links li a {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.clean-links li a:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.formatted-empty {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

.tags-mini {
    margin-top: 0.25rem;
}

.inline-tag {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.raw-fallback {
    font-family: inherit;
    margin: 0;
    white-space: pre-wrap;
}


.manual-controls {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.edit-keywords-area {
    width: 100%;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-primary);
    resize: vertical;
    outline: none;
    transition: all 0.3s ease;
    min-height: 120px;
    margin-top: 0.5rem;
    line-height: 1.6;
}

.edit-keywords-area:focus {
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(195, 39, 46, 0.1);
}

.edit-title-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s ease;
    margin-top: 0.25rem;
}

.edit-title-input:focus {
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(195, 39, 46, 0.1);
}

.secondary-btn {
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    background: rgba(195, 39, 46, 0.1);
}

.secondary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Final Results Panel */
.final-results {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.05);
    overflow: visible;
}

.result-header.analysis-report-card {
    position: sticky;
    top: 0.75rem;
    z-index: 40;
    display: flex;
    align-items: flex-start;
    gap: 1.15rem;
    margin: 0.15rem 0 0.75rem;
    padding: 1.1rem 1.2rem;
    background: #ffffff;
    border: 1px solid #e3e8ef;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 28px rgba(16, 24, 40, 0.06);
}

.analysis-report-body {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.analysis-report-body h2 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: clamp(1.2rem, 2.6vw, 1.55rem);
    font-weight: 700;
    line-height: 1.3;
    color: #101828;
}

.product-image {
    width: 96px;
    height: 96px;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e3e8ef;
}

.analysis-report-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0;
    margin-top: 0.15rem;
    color: #667085;
    font-size: 0.92rem;
    line-height: 1.4;
}

.analysis-report-meta > :not(.hidden):not(:last-child)::after {
    content: "\00b7";
    margin: 0 0.65rem;
    color: #98a2b3;
    font-weight: 500;
}

.product-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: #12b76a;
    white-space: nowrap;
}

.meta-source,
.meta-report-date {
    color: #667085;
}

.meta-report-date time {
    font-variant-numeric: tabular-nums;
}

.result-section h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Keyword Tags */
.keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.keyword-tag {
    background: rgba(195, 39, 46, 0.05);
    color: var(--accent-primary);
    border: 1px solid rgba(195, 39, 46, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.keyword-tag:hover {
    background: rgba(195, 39, 46, 0.1);
    transform: translateY(-2px);
}

/* Extracted Search Intent ? wrapping pills */
.intent-keyword-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.6rem;
}

.intent-keyword-pill {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 0.45rem 0.9rem;
    color: #101828;
    background: #ffffff;
    border: 1px solid #d0d5dd;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.25;
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.intent-keyword-pill:hover {
    border-color: #98a2b3;
    background: #f8fafc;
}

.intent-keyword-pill.is-highlighted {
    color: #175cd3;
    background: #eff8ff;
    border-color: #84caff;
    font-weight: 600;
}

.intent-keyword-pill.is-highlighted:hover {
    color: #1849a9;
    background: #e0f2fe;
    border-color: #53b1fd;
}

.intent-keyword-note {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin: 0.85rem 0 0;
    color: #667085;
    font-size: 0.82rem;
    line-height: 1.4;
}

.intent-keyword-note-dot {
    flex-shrink: 0;
    width: 0.55rem;
    height: 0.55rem;
    margin-top: 0.28rem;
    border: 1.5px solid #2e90fa;
    border-radius: 50%;
}

/* Cost Display */
.cost-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(16, 185, 129, 0.05);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    width: fit-content;
}

/* URL Cards */
.url-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.url-card {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0.25rem 0;
    background: transparent;
    border: none;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    gap: 0.5rem;
}

.url-card:hover {
    color: var(--accent-primary);
}

.url-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow: hidden;
}

.url-title {
    font-weight: 500;
    font-size: 0.85rem;
    word-break: break-word;
}

.url-path {
    font-size: 0.75rem;
    color: var(--text-secondary);
    word-break: break-all;
}

.url-card svg {
    color: var(--accent-primary);
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.url-card:hover svg {
    opacity: 1;
    transform: translateX(0);
}

/* Category Page Table Columns */
.result-keyword-col {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 280px;
    flex-shrink: 0;
    padding-right: 1rem;
    border-right: 1px solid var(--border-color);
}

.keyword-badge {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    white-space: normal;
    word-break: break-word;
    max-width: 230px;
}

/* Recommended category pages use shared grid tracks so headers, links, and
   statuses remain level even when a shelf title wraps. */
.recommended-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.15fr) minmax(240px, 1fr) minmax(285px, 310px);
    column-gap: 0.75rem;
    min-width: 0;
}

.discovery-section-title {
    margin: 1.25rem 0 0.65rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.discovery-section-title:first-child {
    margin-top: 0;
}

.discovery-section-empty {
    margin: 0 0 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.recommended-grid-header {
    align-items: center;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.recommended-grid-header > div {
    min-width: 0;
    padding: 0 0.55rem;
}

.recommended-grid-header > div:first-child {
    padding-left: 0;
}

.recommended-ranking-header {
    text-align: left;
    white-space: normal;
}

.recommended-placement-header {
    text-align: center;
}

.recommended-grid-row {
    grid-template-areas: "base-link ranking placement";
    align-items: center;
    margin-bottom: 0.8rem;
}

.recommended-base-link { grid-area: base-link; }

.recommended-ranking-cell {
    grid-area: ranking;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0.35rem;
    min-width: 0;
    height: 100%;
    padding: 0.4rem 0.65rem;
    border-left: 1px solid var(--border-color);
    color: #344054;
    font-size: 0.9rem;
    line-height: 1.45;
}

.google-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.7rem;
    padding: 0.12rem 0.45rem;
    color: #175cd3;
    background: #eff8ff;
    border: 1px solid #b2ddff;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.google-rank-badge.google-rank-unknown {
    color: #667085;
    background: #f2f4f7;
    border-color: #d0d5dd;
}

.ranking-keyword {
    color: #101828;
    font-weight: 700;
}

.recommended-grid-row .url-card {
    min-width: 0;
    margin-bottom: 0;
    height: 100%;
    padding: 0.55rem 0.7rem 0.55rem 0;
    align-items: center;
    border-left: 0;
}

.recommended-grid-row .url-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: inherit;
}

.recommended-placement-cell {
    grid-area: placement;
    display: flex;
    justify-content: center;
    min-width: 0;
    height: 100%;
    min-height: 3rem;
    align-items: center;
    padding: 0.4rem 0 0.4rem 0.7rem;
    border-left: 1px solid var(--border-color);
}

/* Placement Mix keeps all three signals together in the table's rightmost
   column. Other status chips keep their existing treatment. */
.placement-mix-statuses {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: flex-start;
    width: 100%;
    gap: 0.5rem;
}

.placement-status-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-width: 0;
    gap: 0.25rem;
}

.placement-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    padding: 0.42rem 0.5rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 750;
    line-height: 1;
    letter-spacing: 0.015em;
    white-space: nowrap;
}

a.placement-status-link {
    text-decoration: none;
    cursor: pointer;
    transition: filter 0.15s ease, box-shadow 0.15s ease;
}

a.placement-status-link:hover {
    filter: brightness(0.97);
    box-shadow: 0 0 0 1px currentColor;
    text-decoration: underline;
}

.placement-pill-present {
    color: #067647;
    background: #d1fadf;
    border-color: #6ce9a6;
}

.placement-pill-absent {
    color: #b42318;
    background: #fee4e2;
    border-color: #fda29b;
}

.placement-pill-unavailable {
    color: var(--text-secondary);
    border-color: var(--border-color);
    background: rgba(148, 163, 184, 0.08);
}

.placement-status-detail {
    min-height: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.6rem;
    font-weight: 650;
    line-height: 1.2;
    white-space: nowrap;
}

.placement-detail-present {
    color: #067647;
}

.placement-detail-absent {
    color: #b42318;
}

.placement-detail-unavailable {
    color: var(--text-secondary);
}

/* ===================================================================
   "How it works" button + guided tour (driver.js) theming
   =================================================================== */
header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.header-actions {
    position: static;
    top: auto;
    right: auto;
    transform: none;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    flex-shrink: 0;
    gap: 0.5rem;
    z-index: 2;
    max-width: min(100%, 420px);
}

.how-btn {
    position: static;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    font-family: var(--font-body, inherit);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.how-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent-primary);
}

.how-btn:active {
    transform: scale(0.97);
}

.how-btn i,
.how-btn svg {
    width: 1rem;
    height: 1rem;
    color: var(--accent-primary);
}

.auth-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.85rem;
    font-family: var(--font-body, inherit);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 999px;
    border: 1px solid var(--panel-border, rgba(0, 0, 0, 0.08));
    background: #f8fafc;
    color: var(--text-primary);
    white-space: nowrap;
    max-width: 220px;
}

.auth-chip.auth-signin:hover {
    background: #fff5f5;
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.auth-chip.auth-user {
    color: var(--text-secondary);
}

.auth-chip.auth-user #authUserEmail {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}

.auth-chip.auth-user a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 700;
}

.auth-chip.auth-user a:hover {
    text-decoration: underline;
}

@media (max-width: 560px) {
    .how-btn span {
        display: none;
    }
    .how-btn {
        padding: 0.45rem;
    }
    .auth-chip.auth-user #authUserEmail {
        display: none;
    }
}

/* Tour popover ? match the app's look */
.driver-popover.sf-tour-popover {
    background: var(--bg-card, #16181f);
    color: var(--text-primary, #e8eaf0);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
    border-radius: 0.75rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    max-width: 340px;
}

.driver-popover.sf-tour-popover .driver-popover-title {
    font-family: var(--font-heading, inherit);
    font-size: 1.05rem;
}

.driver-popover.sf-tour-popover .driver-popover-description {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary, #aab1c2);
}

.driver-popover.sf-tour-popover .driver-popover-progress-text {
    color: var(--text-secondary, #aab1c2);
    font-size: 0.78rem;
}

.driver-popover.sf-tour-popover .driver-popover-navigation-btns button {
    background: var(--accent-primary, #c3272e);
    color: #fff;
    border: none;
    text-shadow: none;
    border-radius: 0.4rem;
    padding: 0.35rem 0.8rem;
    font-weight: 600;
}

.driver-popover.sf-tour-popover .driver-popover-navigation-btns button.driver-popover-prev-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #e8eaf0);
}

.driver-popover.sf-tour-popover .driver-popover-arrow {
    border-color: var(--bg-card, #16181f);
}

/* Dashboard Styling */
.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
    gap: 1rem;
    background: #111827; /* Dark elegant background */
    padding: 1.5rem;
    border-radius: 16px;
    color: #e5e7eb;
    margin-bottom: 2rem;
    font-family: var(--font-body);
}

.dash-box {
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: #1f2937;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dash-missing { border-color: rgba(239, 68, 68, 0.4); }
.dash-found { border-color: rgba(16, 185, 129, 0.4); }
.dash-total { border-color: rgba(245, 158, 11, 0.4); }
.dash-ratio { border-color: rgba(59, 130, 246, 0.4); }

.dash-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #9ca3af;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.dash-value {
    font-size: 2rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: #f9fafb;
    line-height: 1;
}

.dash-sub {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

/* Distribution Panel spans 3 cols */
.dash-distribution {
    grid-column: 1;
    background: #1f2937;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 1.5rem;
}

/* Right panel spans 1 col */
.dash-col-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.dash-panel {
    background: #1f2937;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 1.5rem;
    min-width: 0;
    overflow-wrap: anywhere;
}

.dash-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.dash-panel-header h3 {
    margin: 0;
    min-width: 0;
    font-size: 1.1rem;
    color: #f9fafb;
}

.dash-pill {
    flex-shrink: 0;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    border: 1px solid currentColor;
    white-space: nowrap;
}
.dash-pill.critical { color: #ef4444; background: rgba(239, 68, 68, 0.1); }
.dash-pill.healthy  { color: #10b981; background: rgba(16, 185, 129, 0.1); }
.dash-pill.moderate { color: #f59e0b; background: rgba(245, 158, 11, 0.1); }

/* Progress bars */
.dash-bar-container { margin-bottom: 1rem; }
.dash-bar-label { font-size: 0.85rem; margin-bottom: 0.4rem; color: #d1d5db; }
.dash-progress-track {
    background: rgba(255,255,255,0.1);
    height: 1.25rem;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}
.dash-progress-track.slim { height: 0.5rem; margin: 1rem 0; }
.dash-progress-fill {
    height: 100%;
    transition: width 0.5s ease-out;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.5rem;
}
.dash-progress-fill.miss { background: #ef4444; }
.dash-progress-fill.found { background: #10b981; }
.dash-progress-fill.vis-page2 { background: #f59e0b; }
.dash-progress-text {
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
}

.dash-progress-track:not(.slim) .dash-progress-text {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.4rem;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.65);
}

/* Stats Row */
.dash-stats-row {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}
.dash-stat {
    flex: 1;
    background: rgba(0,0,0,0.2);
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
}
.dash-stat .val { font-size: 1.25rem; font-weight: bold; }
.dash-stat .val.miss { color: #ef4444; }
.dash-stat .val.found { color: #10b981; }
.dash-stat .val.total { color: #f59e0b; }
.dash-stat .lbl { font-size: 0.65rem; line-height: 1.25; color: #9ca3af; text-transform: uppercase; margin-top: 0.25rem; overflow-wrap: anywhere; }

/* Right Col Panels */
.text-center { text-align: center; }
.dash-score-huge { max-width: 100%; font-size: clamp(2rem, 3.4vw, 2.5rem); font-weight: 900; line-height: 1; color: white; margin-top: 0.5rem; white-space: nowrap; }
.dash-risk-text { font-size: 0.75rem; line-height: 1.3; font-weight: bold; text-transform: uppercase; color: #ef4444; letter-spacing: 0.04em; overflow-wrap: anywhere; }

.dash-risk-huge { max-width: 100%; font-size: clamp(1.1rem, 2.5vw, 1.5rem); line-height: 1.15; font-weight: 800; margin: 0.5rem 0; overflow-wrap: anywhere; }
.dash-risk-huge.miss    { color: #ef4444; }
.dash-risk-huge.healthy { color: #10b981; }
.dash-risk-huge.moderate { color: #f59e0b; }
.dash-risk-desc { font-size: 0.75rem; color: #9ca3af; }

/* Keep Organic Reach aligned with the bottom of the placement panel. */
.organic-dashboard .dash-col-right > .dash-panel:last-child {
    flex: 1;
}

/* Banner */
.dash-banner {
    grid-column: 1 / -1;
    border: 1px solid rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.05);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: #e5e7eb;
    font-size: 0.9rem;
}

@media (max-width: 820px) {
    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
        padding: 1rem;
    }

    .dash-distribution,
    .dash-col-right,
    .dash-banner {
        grid-column: 1;
    }

    .dash-col-right {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Mobile card pattern: hide the shared column header and label each
       field inside the row so Keyword / Rank / shelves map clearly. */
    .recommended-grid-header {
        display: none;
    }

    .recommended-grid-row {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.7rem;
        padding: 0.9rem;
    }

    .recommended-ranking-cell,
    .recommended-grid-row .url-card,
    .recommended-placement-cell {
        width: 100%;
        height: auto;
        min-height: 0;
        margin: 0;
        padding: 0;
        border: 0;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
        text-align: left;
    }

    .recommended-ranking-cell {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .recommended-grid-row .recommended-base-link::before,
    .recommended-ranking-cell::before,
    .recommended-placement-cell::before {
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        color: var(--text-secondary);
        line-height: 1.2;
    }

    .recommended-grid-row .recommended-base-link::before { content: 'Walmart Digital Shelf'; }
    .recommended-ranking-cell::before { content: "Why it's important?"; flex: 1 0 100%; }
    .recommended-placement-cell::before { content: 'On-Shelf Visibility'; }

    .recommended-grid-row .url-card {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.35rem 0.5rem;
        padding: 0.55rem 0.65rem;
        border: 1px solid #e3e8ef;
        border-radius: 8px;
        background: #ffffff;
    }

    .recommended-grid-row .url-card::before {
        flex: 1 0 100%;
    }

    .recommended-placement-cell {
        border-top: 1px solid var(--border-color);
        padding-top: 0.7rem;
    }

    .placement-mix-statuses {
        max-width: none;
        width: 100%;
    }
}

@media (max-width: 560px) {
    .dash-col-right {
        grid-template-columns: minmax(0, 1fr);
    }

    .dash-distribution,
    .dash-panel {
        padding: 1rem;
    }

    .dash-stats-row {
        gap: 0.5rem;
    }

    .dash-stat {
        min-width: 0;
        padding: 0.6rem 0.35rem;
    }
}

/* Responsive */
@media (max-width: 640px) {
    h1 {
        font-size: 2rem;
    }

    .input-wrapper {
        flex-direction: column;
    }

    .input-icon {
        top: 1.3rem;
    }

}
/* ==========================================================================
   ShelvesFinder v2 ? Additional Styles
   ========================================================================== */

/* v2 badge next to title */
.v2-badge {
    font-size: 0.65rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 0.15rem 0.45rem;
    border-radius: 0.3rem;
    vertical-align: middle;
    letter-spacing: 0.05em;
    margin-left: 0.25rem;
}

/* v1 / v2 mode selector buttons */
.mode-selector {
    display: flex;
    gap: 2px;
    background: rgba(0,0,0,0.08);
    border-radius: 0.4rem;
    padding: 3px;
    flex-shrink: 0;
}

.mode-btn {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.3rem 0.7rem;
    border: none;
    border-radius: 0.3rem;
    cursor: pointer;
    background: transparent;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    letter-spacing: 0.03em;
}

.mode-btn.active {
    background: white;
    color: var(--accent-primary);
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* v2 settings toggle button */
.v2-settings-toggle {
    padding: 0.5rem 0 0;
}

.v2-settings-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: 1px solid var(--panel-border);
    border-radius: 0.4rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.v2-settings-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(195, 39, 46, 0.04);
}

.v2-settings-icon {
    width: 15px;
    height: 15px;
    transition: transform 0.3s ease;
}

.v2-settings-btn.active .v2-settings-icon {
    transform: rotate(90deg);
}

.v2-settings-chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

.v2-settings-btn.active .v2-settings-chevron {
    transform: rotate(180deg);
}

.v2-settings-btn.active {
    color: var(--primary);
    border-color: var(--primary);
}

/* v2 collapsible settings panel */
.v2-settings-panel {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.3s ease;
    padding: 0 0.25rem;
    border-left: 2px solid transparent;
}

.v2-settings-panel.hidden {
    display: block !important;
    max-height: 0;
    opacity: 0;
    padding: 0 0.25rem;
    pointer-events: none;
}

.v2-settings-panel.open {
    max-height: 500px;
    opacity: 1;
    padding: 0.5rem 0.25rem 0.25rem 0.75rem;
    border-left-color: var(--primary);
    pointer-events: auto;
}

/* v2 config row under the URL input */
.v2-config {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem 0.25rem 0;
    flex-wrap: wrap;
}

.v2-config-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.v2-config-item label {
    white-space: nowrap;
    font-weight: 600;
}

.v2-provider-select {
    background: rgba(0,0,0,0.06);
    border: 1px solid var(--panel-border);
    border-radius: 0.3rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.82rem;
    color: var(--text-primary);
    cursor: pointer;
    appearance: auto;
}

.v2-provider-select:focus {
    outline: none;
    border-color: rgba(195, 39, 46, 0.4);
}

.v2-config-item input[type="number"] {
    width: 5rem;
    background: rgba(0,0,0,0.06);
    border: 1px solid var(--panel-border);
    border-radius: 0.3rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.82rem;
    color: var(--text-primary);
    text-align: center;
}

/* Thin vertical divider between number inputs and checkbox */
.v2-config-divider {
    width: 1px;
    height: 1.25rem;
    background: var(--panel-border);
    padding: 0;
    margin: 0 0.25rem;
    align-self: center;
}

/* Custom checkbox ? styled to match the panel aesthetic */
.v2-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    user-select: none;
    font-weight: 600 !important;
    white-space: nowrap;
}

.v2-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.v2-checkbox-custom {
    width: 1rem;
    height: 1rem;
    border: 1.5px solid var(--panel-border);
    border-radius: 0.2rem;
    background: rgba(0,0,0,0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}

.v2-checkbox-custom::after {
    content: '';
    display: none;
    width: 0.3rem;
    height: 0.55rem;
    border: 2px solid white;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
}

.v2-checkbox:checked + .v2-checkbox-custom {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.v2-checkbox:checked + .v2-checkbox-custom::after {
    display: block;
}

.v2-checkbox-label:hover .v2-checkbox-custom {
    border-color: var(--accent-primary);
}

/* v2 agent instructions box */
.v2-instructions {
    padding: 0.75rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.v2-instructions-header {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.v2-inst-label-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.v2-inst-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.v2-inst-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.v2-preset-btns {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.v2-preset-btn {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--panel-border);
    background: rgba(0,0,0,0.05);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.v2-preset-btn:hover {
    background: rgba(195, 39, 46, 0.08);
    border-color: rgba(195, 39, 46, 0.35);
    color: var(--accent-primary);
}

.v2-preset-btn.active {
    background: rgba(195, 39, 46, 0.12);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.v2-instructions-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(0,0,0,0.04);
    border: 1px solid var(--panel-border);
    border-radius: 0.5rem;
    padding: 0.6rem 0.75rem;
    font-family: var(--font-body);
    font-size: 0.82rem;
    color: var(--text-primary);
    resize: vertical;
    min-height: 4rem;
    line-height: 1.5;
    transition: border-color 0.2s;
}

.v2-instructions-input:focus {
    outline: none;
    border-color: rgba(195, 39, 46, 0.4);
    background: rgba(0,0,0,0.02);
}

.v2-instructions-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* -----------------------------------------------------------------------
   v2 Agent Panel
   ----------------------------------------------------------------------- */
.v2-agent-panel {
    margin-bottom: 1.5rem;
}

.v2-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.v2-panel-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
}

.v2-status-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.v2-round-badge {
    font-size: 0.78rem;
    font-weight: 700;
    background: rgba(195, 39, 46, 0.12);
    color: var(--accent-primary);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(195, 39, 46, 0.25);
}

.v2-cost-badge {
    font-size: 0.78rem;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-family: monospace;
}

/* Setup steps row */
.v2-setup-steps {
    display: flex;
    gap: 0.65rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    width: 100%;
    min-width: 0;
}

.v2-setup-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: rgba(0,0,0,0.04);
    border-radius: 0.4rem;
    border: 1px solid var(--panel-border);
    font-size: 0.82rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    flex: 1 1 240px;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.v2-setup-step > svg,
.v2-setup-step > i {
    flex-shrink: 0;
}

.v2-setup-step.running {
    border-color: var(--warning);
    color: var(--warning);
    background: rgba(245, 158, 11, 0.08);
}

.v2-setup-step.done {
    border-color: var(--success);
    color: var(--success);
    background: rgba(16, 185, 129, 0.08);
}

.v2-setup-step.warn {
    border-color: var(--warning);
    color: var(--warning);
    background: rgba(245, 158, 11, 0.08);
}

.v2-setup-label {
    flex-shrink: 0;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.v2-setup-msg {
    font-size: 0.8rem;
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Agent reasoning log */
.v2-reasoning-log {
    background: rgba(0,0,0,0.04);
    border: 1px solid var(--panel-border);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    height: 14rem;
    overflow-y: auto;
    font-size: 0.82rem;
    font-family: var(--font-body);
    margin-bottom: 1rem;
    scroll-behavior: smooth;
}

.v2-log-placeholder {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    margin-top: 4rem;
}

.v2-log-entry {
    display: flex;
    gap: 0.6rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    line-height: 1.5;
    color: var(--text-primary);
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.v2-log-ts {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-family: monospace;
    white-space: nowrap;
    padding-top: 0.1rem;
    flex-shrink: 0;
}

.v2-log-reasoning { color: var(--text-secondary); font-style: italic; }
.v2-log-tool      { color: var(--accent-primary); }
.v2-log-result    { color: var(--text-primary); }
.v2-log-goal      { color: #7c3aed; font-weight: 600; }
.v2-log-loop      { color: var(--text-secondary); font-size: 0.75rem; }
.v2-log-done      { color: var(--success); font-weight: 700; }
.v2-log-error     { color: var(--error); font-weight: 600; }

/* Live stats bar */
/* ---------- Stats bar ---------- */
@keyframes stat-dot-blink {
    0%, 100% { opacity: 1;   transform: scale(1);    }
    50%       { opacity: 0.2; transform: scale(0.7);  }
}

@keyframes stat-tile-breathe {
    0%, 100% {
        background: rgba(195, 39, 46, 0.06);
        box-shadow: 0 0 0 0 rgba(195, 39, 46, 0);
    }
    50% {
        background: rgba(195, 39, 46, 0.14);
        box-shadow: 0 0 0 3px rgba(195, 39, 46, 0.18);
    }
}

@keyframes stat-val-pop {
    0%, 100% { color: var(--text-primary); }
    50%       { color: var(--accent-primary); }
}

.v2-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.v2-stat-item {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--panel-border);
    border-radius: 0.4rem;
    padding: 0.6rem 0.75rem;
    text-align: center;
    position: relative;
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

/* ?? Processing state ?? */
.v2-stats-bar.processing .v2-stat-item {
    border-color: var(--accent-primary);
    border-top-width: 3px;
    animation: stat-tile-breathe 1.6s ease-in-out infinite;
}
.v2-stats-bar.processing .v2-stat-item:nth-child(2) { animation-delay: 0.3s;  }
.v2-stats-bar.processing .v2-stat-item:nth-child(3) { animation-delay: 0.6s;  }
.v2-stats-bar.processing .v2-stat-item:nth-child(4) { animation-delay: 0.9s;  }

/* Blinking number while processing */
.v2-stats-bar.processing .v2-stat-val {
    animation: stat-val-pop 1.6s ease-in-out infinite;
}
.v2-stats-bar.processing .v2-stat-item:nth-child(2) .v2-stat-val { animation-delay: 0.3s; }
.v2-stats-bar.processing .v2-stat-item:nth-child(3) .v2-stat-val { animation-delay: 0.6s; }
.v2-stats-bar.processing .v2-stat-item:nth-child(4) .v2-stat-val { animation-delay: 0.9s; }

/* "PROCESSING" label strip above each tile */
.v2-stat-item::before {
    content: '';          /* hidden by default */
    display: none;
}
.v2-stats-bar.processing .v2-stat-item::before {
    content: '? PROCESSING';
    display: block;
    position: absolute;
    top: 5px;
    right: 7px;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--accent-primary);
    animation: stat-dot-blink 1.2s ease-in-out infinite;
}
.v2-stats-bar.processing .v2-stat-item:nth-child(2)::before { animation-delay: 0.3s; }
.v2-stats-bar.processing .v2-stat-item:nth-child(3)::before { animation-delay: 0.6s; }
.v2-stats-bar.processing .v2-stat-item:nth-child(4)::before { animation-delay: 0.9s; }

.v2-stat-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.v2-stat-val {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--text-primary);
    line-height: 1;
    transition: color 0.3s;
}

.v2-stat-val.miss {
    color: var(--error);
}

@media (max-width: 600px) {
    .v2-stats-bar { grid-template-columns: repeat(2, 1fr); }
    .v2-setup-steps { flex-direction: column; }
    .mode-selector { order: -1; }
}


/* ==========================================================================
   Readability refresh
   ========================================================================== */
:root {
    --bg-color: #f4f6f8;
    --panel-bg: #ffffff;
    --panel-border: #dde3ea;
    --border-color: #dde3ea;
    --text-primary: #17212b;
    --text-secondary: #5f6b7a;
    --accent-primary: #b4232a;
    --accent-secondary: #d13b42;
    --success: #07865c;
    --warning: #c87908;
    --error: #d92d20;
}

body {
    background: var(--bg-color);
    line-height: 1.6;
}

.blob {
    display: none;
}

.app-container {
    max-width: 1120px;
    padding: 1.5rem clamp(1rem, 3vw, 2rem) 2rem;
    gap: 1.25rem;
    min-height: 100vh;
}

.glass-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    padding: clamp(1.25rem, 3vw, 2rem);
    box-shadow: 0 8px 24px rgba(23, 33, 43, 0.06);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

header.glass-panel {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem clamp(1rem, 3vw, 2rem) !important;
    text-align: left;
}

.logo {
    justify-content: flex-start;
    margin-bottom: 0;
    min-width: 0;
    flex: 1 1 auto;
}

.logo h1 {
    min-width: 0;
    overflow-wrap: anywhere;
}

h1 {
    font-size: clamp(1.8rem, 4vw, 2.3rem);
}

.subtitle {
    max-width: 620px;
    margin: 0 auto;
    font-size: 0.95rem;
    font-weight: 400;
}

.header-actions {
    margin-left: auto;
    max-width: min(100%, 520px);
}

.how-btn,
.auth-chip {
    min-height: 40px;
    padding: 0.45rem 0.85rem;
    line-height: 1.2;
}

.how-btn {
    color: var(--text-primary);
    background: #f8fafc;
    border-color: var(--panel-border);
}

.how-btn:hover {
    background: #fff5f5;
}

.search-box {
    padding: 1rem !important;
}

.input-wrapper {
    gap: 0.65rem;
    padding: 0.45rem;
    background: #f8fafc;
    border-color: #cfd7e1;
}

.input-wrapper:focus-within {
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(180, 35, 42, 0.1);
}

input[type="url"] {
    min-width: 0;
    width: 100%;
    font-size: 1rem;
}

input::placeholder {
    color: #8a96a5;
}

.primary-btn,
.secondary-btn,
.mode-btn,
.how-btn,
.v2-settings-btn {
    min-height: 40px;
}

.primary-btn {
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(23, 33, 43, 0.12);
}

.primary-btn:hover {
    box-shadow: 0 6px 14px rgba(180, 35, 42, 0.2);
}

.primary-btn.is-stop {
    background: #ffffff;
    color: #b42318;
    border: 1.5px solid #fda29b;
    box-shadow: 0 1px 2px rgba(23, 33, 43, 0.08);
}

.primary-btn.is-stop:hover {
    background: #fef3f2;
    color: #912018;
    border-color: #f97066;
    box-shadow: 0 6px 14px rgba(180, 35, 24, 0.18);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(180, 35, 42, 0.24);
    outline-offset: 2px;
}

.mode-selector {
    background: #e9edf2;
    border-radius: 8px;
}

.mode-btn {
    padding: 0.45rem 0.8rem;
    border-radius: 6px;
}

.toggle-container {
    padding: 0 0.65rem;
}

.stepper,
.v2-agent-panel {
    margin-top: 1rem;
}

.final-results {
    gap: 0;
    padding-bottom: 2rem;
    border-color: var(--panel-border);
    box-shadow: 0 12px 36px rgba(23, 33, 43, 0.08);
    overflow: visible;
}

.result-eyebrow {
    margin: 0;
    color: var(--accent-primary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

@media (max-width: 700px) {
    .result-header.analysis-report-card {
        gap: 0.9rem;
        padding: 0.95rem 1rem;
    }

    .analysis-report-body h2 {
        font-size: 1.05rem;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .result-header .product-image {
        width: 72px;
        height: 72px;
    }

    .analysis-report-meta {
        font-size: 0.85rem;
    }
}

.result-section {
    padding: 1.75rem 0;
    border-bottom: 1px solid #e7ebf0;
}

.result-section:last-child {
    border-bottom: 0;
}

.result-section h3 {
    margin-bottom: 1rem;
    color: #344054;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
}

.keyword-tag,
.keyword-badge {
    border-radius: 7px;
}

.recommended-grid {
    grid-template-columns: minmax(220px, 1.15fr) minmax(240px, 1fr) minmax(285px, 310px);
}

.recommended-grid-header {
    padding: 0.7rem 1rem;
    background: #f2f4f7;
    border: 1px solid #e3e8ef;
    border-radius: 10px;
}

.recommended-grid-row {
    margin-bottom: 0.85rem;
    min-height: 5.75rem;
    padding: 1rem 1.1rem;
    background: #f8fafc;
    border: 1px solid #e3e8ef;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.recommended-grid-row:hover {
    border-color: #cdd5df;
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(16, 24, 40, 0.07);
}

.recommended-grid-row .url-card {
    color: #243242;
}

.recommended-grid-row .url-card:hover {
    color: var(--accent-primary);
}

.dashboard-grid {
    order: 100;
    margin: 1.25rem 0;
    /* Keep every dashboard card separated from the dark outer shell. This
       restores the inset that the generic .result-section rule removes. */
    padding: 1.5rem;
}

/* Discoverability (#visibilityDashboard) stays early in Advance (order 0).
   Advance Visibility / Organic use .dashboard-grid { order: 100 } so they
   remain after Recommended Category Pages.

   Basic: force Visibility under title/image and above keywords. Same-order
   siblings keep DOM order, so we must use distinct order values. */
#visibilityDashboard {
    order: 0;
}

#finalResultsPanel.mode-v1 > .result-header {
    order: 1;
}
#finalResultsPanel.mode-v1 > #visibilityDashboardPanel {
    order: 2;
}
#finalResultsPanel.mode-v1 > #visibilityDashboard {
    order: 3;
}
#finalResultsPanel.mode-v1 > #extractedSearchIntentSection {
    order: 4;
}
#finalResultsPanel.mode-v1 > #recommendedCategoryPagesSection {
    order: 5;
}
#finalResultsPanel.mode-v1 > #organicVisibilityDashboardPanel {
    order: 6;
}
#finalResultsPanel.mode-v1 > .email-report-section {
    order: 7;
}

.dashboard-grid .dash-panel-header h3 {
    color: #f9fafb;
    font-size: 1.1rem;
}

.email-report-section {
    order: 200;
    margin-top: 1rem;
    padding: 1.5rem;
    background: #f8fafc;
    border: 1px solid #e1e6ed;
    border-radius: 10px;
}

.email-report-section p {
    margin: -0.4rem 0 1rem;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.email-report-form {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    align-items: stretch;
}

#emailContactName,
#emailContactPhone,
#emailRecipients {
    padding: 0.7rem 0.85rem;
    color: var(--text-primary);
    background: #ffffff;
    border: 1px solid #cfd7e1;
    border-radius: 8px;
    font: inherit;
}

#emailContactName,
#emailContactPhone {
    flex: 1 1 160px;
    min-width: 140px;
}

#emailRecipients {
    flex: 2 1 250px;
    min-width: 220px;
}

/* The URL field relies on the wrapper's focus treatment, so suppress the
   second outline that would otherwise appear around the input itself. */
#urlInput:focus-visible {
    outline: none;
}

@media (max-width: 820px) {
    .dashboard-grid {
        padding: 1rem;
    }
}

@media (max-width: 700px) {
    header.glass-panel {
        padding: 0.85rem 1rem !important;
    }

    .subtitle {
        padding: 0 0.5rem;
    }

    .input-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .input-icon {
        top: 1.25rem;
    }

    .mode-selector {
        order: 0;
        width: 100%;
    }

    .mode-btn {
        flex: 1;
    }

    .toggle-container {
        min-height: 40px;
        padding: 0.25rem 0;
        border-left: 0;
    }
}

@media (max-width: 560px) {
    .app-container {
        padding-inline: 0.75rem;
    }

    .glass-panel {
        border-radius: 10px;
    }

    .dash-stats-row {
        flex-direction: column;
    }

    .email-report-form .primary-btn {
        width: 100%;
        justify-content: center;
    }

}

/* ---------------------------------------------------------------------------
   Locked (login-gated) rows in Recommended Category Pages.
   Anonymous visitors see a blurred, non-interactive row with a lock icon;
   hovering reveals a "Log in to see all details" call to action.
--------------------------------------------------------------------------- */
.copy-urls-wrap {
    position: relative;
    display: inline-flex;
    border-radius: 8px;
}

.locked-row {
    position: relative;
    border-radius: 8px;
}

.locked-row > *:not(.locked-overlay) {
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
}

.locked-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    z-index: 2;
    border-radius: 8px;
}

.locked-overlay .locked-lock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

.locked-overlay .locked-lock i {
    width: 18px;
    height: 18px;
}

.locked-overlay .locked-msg {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(17, 24, 39, 0.88);
    color: #fff;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    position: absolute;
}

.locked-overlay .locked-msg i {
    width: 14px;
    height: 14px;
}

.locked-row:hover .locked-lock {
    opacity: 0;
}

.locked-row:hover .locked-msg {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Mobile / touch browser compatibility
   ========================================================================== */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    overflow-x: clip;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.result-section-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.url-cards {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Touch devices: no hover ? keep affordances visible */
@media (hover: none), (pointer: coarse) {
    .url-card svg {
        opacity: 1;
        transform: none;
    }

    .locked-overlay .locked-msg {
        opacity: 1;
        transform: none;
        white-space: normal;
        text-align: center;
        max-width: calc(100% - 1rem);
        font-size: 0.75rem;
        padding: 0.35rem 0.7rem;
    }

    .locked-overlay .locked-lock {
        display: none;
    }

    .primary-btn:hover,
    .secondary-btn:hover,
    .how-btn:hover,
    .url-card:hover,
    .recommended-grid-row:hover {
        transform: none;
    }
}

@media (max-width: 900px) {
    .app-container {
        padding-top: 1rem;
        padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
        gap: 1rem;
        overflow-x: clip;
        max-width: 100%;
    }

    header.glass-panel {
        min-height: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
        padding: 0.85rem 1rem !important;
    }

    .header-actions {
        align-self: flex-end;
        order: -1;
        max-width: 100%;
        margin-left: 0;
    }

    .logo {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        max-width: 100%;
        min-width: 0;
    }

    .logo img {
        height: 2rem !important;
    }

    .v2-setup-steps {
        flex-direction: column;
    }

    .v2-setup-step {
        flex: 1 1 auto;
        width: 100%;
    }

    .v2-agent-panel,
    .stepper,
    .glass-panel {
        max-width: 100%;
        min-width: 0;
        overflow-x: clip;
    }

    .subtitle {
        padding: 0 0.5rem;
        font-size: 0.9rem;
    }

    .search-box {
        padding: 0.85rem !important;
    }

    .input-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 0.55rem;
    }

    .input-icon {
        top: 1.15rem;
        transform: none;
    }

    input[type="url"],
    #emailContactName,
    #emailContactPhone,
    #emailRecipients,
    .v2-config-item input[type="number"],
    .v2-provider-select {
        font-size: 16px; /* prevent iOS focus zoom */
    }

    input[type="url"] {
        width: 100%;
        min-width: 0;
        padding-right: 0.75rem;
    }

    .mode-selector,
    .toggle-container,
    .primary-btn {
        width: 100%;
        justify-content: center;
    }

    .mode-btn {
        flex: 1;
        min-height: 44px;
    }

    .toggle-container {
        justify-content: center;
        border-left: 0;
        padding: 0.35rem 0;
        min-height: 44px;
    }

    .primary-btn {
        min-height: 44px;
    }

    .v2-config {
        flex-direction: column;
        align-items: stretch;
    }

    .v2-config-item {
        width: 100%;
    }

    .v2-config-item input[type="number"],
    .v2-provider-select {
        width: 100%;
        min-height: 44px;
    }

    .v2-panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .v2-status-row {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .v2-setup-steps {
        flex-direction: column;
    }

    .result-section-toolbar {
        align-items: flex-start;
    }

    .result-section-toolbar h3 {
        font-size: 1.05rem;
        line-height: 1.3;
        flex: 1 1 auto;
        min-width: 0;
    }

    .copy-urls-wrap,
    #copyUrlsBtn {
        width: 100%;
    }

    #copyUrlsBtn {
        justify-content: center;
        min-height: 40px;
    }

    .placement-mix-statuses {
        grid-template-columns: 1fr;
        gap: 0.4rem;
        max-width: none;
    }

    .placement-status-pill {
        white-space: normal;
        text-align: center;
        line-height: 1.2;
        min-height: 36px;
    }

    .result-header.analysis-report-card {
        flex-direction: column;
        align-items: stretch;
    }

    .result-header .product-image {
        width: 88px;
        height: 88px;
    }

    #emailContactName,
    #emailContactPhone,
    #emailRecipients {
        min-width: 0;
        width: 100%;
        flex: 1 1 auto;
    }

    .email-report-form {
        flex-direction: column;
    }

    .driver-popover.sf-tour-popover {
        max-width: min(340px, calc(100vw - 1.5rem));
    }
}

@media (max-width: 560px) {
    header.glass-panel {
        padding: 0.75rem 0.85rem !important;
    }

    .how-btn {
        width: 40px;
        min-width: 40px;
        min-height: 40px;
        padding: 0;
        gap: 0;
        justify-content: center;
    }

    .auth-chip {
        max-width: 100%;
    }

    h1 {
        font-size: 1.45rem;
        line-height: 1.15;
        text-align: center;
        max-width: 100%;
    }

    .recommended-grid-row {
        padding: 0.8rem;
    }

    .keyword-badge {
        max-width: 100%;
    }

    .locked-overlay .locked-msg {
        font-size: 0.7rem;
    }

    .v2-stats-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ==========================================================================
   Print - distraction-free analysis report
   ========================================================================== */
@media print {
    @page {
        margin: 0.55in;
    }

    html,
    body {
        background: #ffffff !important;
        color: #101828 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    /* Hide app chrome / workflow UI - print the report only */
    .blob,
    header.glass-panel,
    .search-box,
    #agentStepper,
    #v2AgentPanel,
    .email-report-section,
    #copyUrlsWrap,
    .copy-urls-wrap,
    .manual-controls,
    .driver-overlay,
    .driver-popover,
    .driver-active .driver-overlay,
    #howItWorksBtn,
    .header-actions {
        display: none !important;
    }

    .app-container,
    main,
    .results-container {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
    }

    .results-container.hidden {
        display: none !important;
    }

    /* Only the finished report should print */
    #finalResultsPanel.hidden {
        display: none !important;
    }

    #finalResultsPanel:not(.hidden) {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        border: none !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    /* Undo screen flex reordering so print follows reading order */
    #finalResultsPanel > * {
        order: 0 !important;
    }

    .result-header.analysis-report-card {
        position: static !important;
        top: auto !important;
        margin: 0 0 0.9rem !important;
        padding: 0.85rem 1rem !important;
        background: #ffffff !important;
        border: 1px solid #d0d5dd !important;
        border-radius: 10px !important;
        box-shadow: none !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .analysis-report-body h2 {
        color: #101828 !important;
        font-size: 1.25rem !important;
    }

    .result-eyebrow {
        color: #c3272e !important;
    }

    .product-image {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .result-section {
        padding: 0.85rem 0 !important;
        border-bottom: 1px solid #e7ebf0 !important;
    }

    .result-section h3,
    .result-section-toolbar h3 {
        color: #344054 !important;
    }

    .result-section-toolbar {
        break-after: avoid;
    }

    /* Dark dashboards -> light printable cards */
    .dashboard-grid {
        background: #f8fafc !important;
        color: #101828 !important;
        border: 1px solid #d0d5dd !important;
        border-radius: 10px !important;
        box-shadow: none !important;
        margin: 0.75rem 0 !important;
        padding: 1rem !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .dashboard-grid.hidden {
        display: none !important;
    }

    .dash-panel,
    .dash-distribution,
    .dash-box {
        background: #ffffff !important;
        border: 1px solid #e3e8ef !important;
        color: #101828 !important;
        box-shadow: none !important;
    }

    .dashboard-grid .dash-panel-header h3,
    .dash-label,
    .dash-bar-label,
    .dash-risk-text,
    .dash-risk-desc,
    .dash-sub,
    .dash-stat .lbl,
    .dash-progress-text {
        color: #344054 !important;
    }

    .dash-value,
    .dash-score-huge,
    .dash-risk-huge,
    .dash-stat .val,
    .dash-stat .val.total {
        color: #101828 !important;
    }

    .dash-stat .val.found,
    .dash-progress-fill.found,
    .placement-detail-present,
    .product-price {
        color: #067647 !important;
    }

    .dash-stat .val.miss,
    .dash-progress-fill.miss,
    .placement-detail-absent {
        color: #b42318 !important;
    }

    .dash-progress-track {
        background: #e4e7ec !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .dash-progress-fill.found {
        background: #12b76a !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .dash-progress-fill.miss {
        background: #f04438 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .dash-banner,
    .dash-pill {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .dash-banner {
        color: #101828 !important;
        border: 1px solid #d0d5dd !important;
        background: #ffffff !important;
    }

    /* Search intent pills */
    .intent-keyword-pills {
        gap: 0.4rem !important;
    }

    .intent-keyword-pill {
        color: #101828 !important;
        background: #ffffff !important;
        border: 1px solid #d0d5dd !important;
        break-inside: avoid;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .intent-keyword-pill.is-highlighted {
        color: #175cd3 !important;
        background: #eff8ff !important;
        border-color: #84caff !important;
    }

    .intent-keyword-note {
        color: #667085 !important;
    }

    /* Category pages table */
    .recommended-grid-header {
        background: #f2f4f7 !important;
        border: 1px solid #e3e8ef !important;
        color: #344054 !important;
        break-after: avoid;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .recommended-grid-row {
        background: #ffffff !important;
        border: 1px solid #e3e8ef !important;
        box-shadow: none !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .recommended-ranking-cell,
    .ranking-keyword,
    .recommended-grid-row .url-card,
    .recommended-grid-row .url-title {
        color: #101828 !important;
    }

    .google-rank-badge {
        color: #175cd3 !important;
        background: #eff8ff !important;
        border: 1px solid #b2ddff !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .placement-status-pill,
    .placement-pill-present,
    .placement-pill-absent,
    .placement-pill-unavailable {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    a.placement-status-link,
    a.recommended-base-link,
    a.intent-keyword-pill {
        text-decoration: none !important;
    }

    /* Don't print login-gated teaser rows */
    .locked-row {
        display: none !important;
    }

}
