/* Internal AI Visibility Audit (visibility/index.php). Builds on app.css tokens and helpers. */
.vis-page { background: var(--paper); }
.vis-header { gap: 18px; }
.vis-shell { padding: 28px 0 60px; }
.vis-shell h1 { margin: 0; font-size: 28px; letter-spacing: -.03em; }
.vis-shell h2 { margin: 0 0 10px; font-size: 18px; letter-spacing: -.02em; }
.vis-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.vis-hint { color: var(--muted); font-size: 12.5px; }
.vis-error { margin: 0 0 18px; }
.vis-crumbs { margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.vis-crumbs a { color: var(--mint-dark); font-weight: 650; text-decoration: none; }
.vis-title-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.vis-title-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.vis-card { margin-bottom: 18px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 10px 30px rgba(16, 27, 44, .05); }
.vis-card > p:first-of-type { margin-top: 0; }
.vis-button { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 16px; border: 0; border-radius: 8px; color: #06220c; background: #00e000; font-size: 13px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.vis-button:hover { background: #3cf03c; }
.vis-button:focus-visible, .button-secondary:focus-visible { outline: 2px solid var(--mint-dark); outline-offset: 3px; }
a.button-secondary { display: inline-flex; align-items: center; text-decoration: none; }

/* Forms */
.vis-form label, .vis-login label, .vis-capture label { display: block; margin-bottom: 14px; color: var(--ink); font-size: 13px; font-weight: 650; }
.vis-form label span, .vis-capture label span { color: var(--muted); font-weight: 450; }
.vis-shell input:not([type="hidden"]), .vis-shell textarea { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid #d4dce5; border-radius: 8px; color: var(--ink); background: #fff; font: inherit; font-size: 14px; }
.vis-shell textarea { resize: vertical; line-height: 1.5; }
.vis-shell input::placeholder, .vis-shell textarea::placeholder { color: #a3aebb; font-weight: 400; }
.vis-shell input:focus, .vis-shell textarea:focus { border-color: #65bd9c; outline: 0; box-shadow: 0 0 0 3px rgba(101, 189, 156, .2); }
.vis-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.vis-inline { display: flex; gap: 10px; }
.vis-inline input:not([type="hidden"]) { max-width: 260px; margin-top: 0; }
.vis-login { max-width: 420px; margin: 40px auto; }
.vis-login h1 { margin-bottom: 16px; font-size: 22px; }
.vis-login button { margin-top: 4px; }
.vis-shell code { padding: 1px 5px; border-radius: 4px; background: #eef1f4; font-size: 12px; }
.vis-questions { margin-top: 14px; font-size: 13px; }
.vis-questions summary { color: var(--mint-dark); font-weight: 650; cursor: pointer; }
.vis-questions em, .vis-tag { margin-left: 6px; padding: 1px 7px; border-radius: 10px; color: #476576; background: #edf3f5; font-size: 10px; font-style: normal; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.tag-client { color: #0d5c3f; background: #d7f5e6; }

/* Tables */
.vis-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.vis-table th { padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10.5px; font-weight: 750; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.vis-table td { padding: 11px 10px; border-bottom: 1px solid #eef1f4; vertical-align: top; }
.vis-table a { color: var(--mint-dark); }
.vis-score { color: var(--tone); font-size: 16px; }
.vis-actions { display: flex; gap: 12px; justify-content: flex-end; font-weight: 650; }

/* Capture */
.vis-progress { margin: -6px 0 18px; }
.vis-progress .bar-svg { height: 8px; --tone: #00c000; }
.vis-tabs { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.vis-tabs a { margin-bottom: -1px; padding: 10px 16px; border: 1px solid transparent; border-radius: 9px 9px 0 0; color: var(--muted); font-weight: 700; text-decoration: none; }
.vis-tabs a.is-active { border-color: var(--line); border-bottom-color: var(--paper); color: var(--ink); background: var(--paper); }
.vis-tabs small { margin-left: 4px; font-family: ui-monospace, "Courier New", monospace; font-size: 11px; }
.vis-tip { margin: 0 0 18px; padding: 12px 14px; border: 1px solid #f3d9a4; border-radius: 10px; color: #6b4a12; background: #fef9ec; font-size: 13px; }
.vis-tip a { margin-left: 6px; color: var(--mint-dark); font-weight: 750; }
.vis-question { scroll-margin-top: 16px; padding: 16px 20px; }
.vis-question.is-saved { border-color: #b7e4cc; }
.vis-question header { display: flex; align-items: flex-start; gap: 12px; }
.vis-qnum { display: grid; flex: 0 0 auto; width: 26px; height: 26px; place-items: center; border-radius: 50%; color: #fff; background: var(--navy); font-size: 12px; font-weight: 800; }
.vis-qtext { flex: 1; margin: 2px 0 0; font-size: 15px; font-weight: 650; }
.vis-question header .vis-tag { margin-top: 5px; }
.vis-copy { flex: 0 0 auto; height: 32px; }
.vis-result { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 10px 0 0 38px; font-size: 12px; }
.vis-competitors { color: var(--muted); }
.vis-capture { margin: 10px 0 0 38px; }
.vis-capture summary { color: var(--mint-dark); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.vis-capture form { margin-top: 10px; }
.vis-form-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Result chips */
.vis-chip { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.chip-cited { color: #0d5c3f; background: #d7f5e6; }
.chip-mentioned { color: #8a5a0b; background: #fdf1d8; }
.chip-absent { color: #9b2f2c; background: #fbe3e2; }
.chip-none { color: #8390a1; background: #eef1f4; }

/* Results */
.vis-summary { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.vis-summary .vis-card { margin: 0; }
.vis-score-card { display: flex; align-items: center; gap: 22px; }
.vis-score-card .ring-wrap b { font-size: 34px; }
.vis-score-card h2 { margin: 2px 0 6px; color: var(--tone); font-size: 24px; }
.vis-score-card p:last-child { margin: 0; color: #40516a; font-size: 13px; }
.vis-score-card .eyebrow { margin: 0; color: var(--muted); }
.vis-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vis-stat { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.vis-stat span { color: var(--muted); font-size: 10.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.vis-stat strong { display: block; margin-top: 2px; font-size: 26px; line-height: 1.15; letter-spacing: -.03em; }
.vis-stat p { margin: 2px 0 0; color: var(--muted); font-size: 11.5px; }
.vis-platforms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.vis-platform { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; }
.vis-platform-head { display: flex; justify-content: space-between; margin-bottom: 8px; }
.vis-platform-head b { color: var(--tone); font-size: 20px; }
.vis-platform p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.vis-voices { margin: 0; padding: 0; list-style: none; }
.vis-voices li { display: grid; grid-template-columns: minmax(120px, 220px) 1fr 90px; align-items: center; gap: 12px; padding: 7px 0; font-size: 13px; }
.vis-voices .bar-svg { --tone: #9fb0c2; height: 10px; }
.vis-voices .is-client { font-weight: 800; }
.vis-voices .is-client .bar-svg { --tone: #00b400; }
.vis-voices b { font-size: 12.5px; font-variant-numeric: tabular-nums; text-align: right; }
.vis-matrix td:first-child { width: 46%; }
.vis-domains { margin: 0; padding-left: 20px; font-size: 13px; columns: 2; column-gap: 32px; }
.vis-domains li { padding: 4px 0; break-inside: avoid; }
.vis-domains li b { float: right; font-variant-numeric: tabular-nums; }
.trend-chart { display: block; width: 100%; max-width: 640px; height: auto; margin: 4px 0 14px; }
.trend-grid { stroke: #e3e8ee; stroke-width: 1; }
.trend-axis, .trend-label { fill: #8390a1; font-size: 10px; font-family: Inter, system-ui, sans-serif; }
.trend-line { stroke: #00b400; stroke-width: 2.5; }
.trend-dot { fill: #00b400; }
.trend-value { fill: var(--ink); font-size: 11px; font-weight: 800; font-family: Inter, system-ui, sans-serif; }
.vis-method { color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.vis-danger { margin-top: 26px; text-align: right; }
.vis-danger .button-secondary { color: var(--fail); }
.vis-print-cover { display: none; }

@media (max-width: 800px) {
    .vis-summary, .vis-platforms, .vis-two { grid-template-columns: 1fr; }
    .vis-voices li { grid-template-columns: 1fr 80px; }
    .vis-voices .bar-svg { grid-column: 1 / -1; grid-row: 2; }
    .vis-domains { columns: 1; }
    .vis-result, .vis-capture { margin-left: 0; }
    .vis-question header { flex-wrap: wrap; }
    .vis-matrix { display: block; overflow-x: auto; }
}

@media print {
    html, .vis-page { background: #fff; }
    .vis-page .site-header, .no-print, .vis-tip { display: none !important; }
    .vis-shell { width: 100%; padding: 0; }
    .vis-print-cover { display: block; margin-bottom: 6px; }
    .vis-print-cover .eyebrow { color: var(--mint-dark); }
    .vis-card, .vis-stat, .vis-platform { box-shadow: none; break-inside: avoid; }
    .vis-summary { grid-template-columns: 1fr 1fr; }
    .vis-platforms { grid-template-columns: repeat(3, 1fr); }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Standard prompt set, capture extras, and the dashboard results page. */
.vis-shell select { display: block; width: 100%; margin-top: 6px; padding: 9px 10px; border: 1px solid #d4dce5; border-radius: 8px; color: var(--ink); background: #fff; font: inherit; font-size: 14px; }
.vis-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.vis-form h2 { margin: 6px 0 14px; }
.vis-form h2:not(:first-of-type) { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.vis-prompt { font-weight: 700; }
.vis-prompt .vis-tag { margin: 0 4px 0 0; }
.vis-check { display: flex !important; align-items: center; gap: 8px; font-weight: 500 !important; }
.vis-check input { display: inline-block !important; width: auto !important; margin: 0 !important; }
.tag-branded { color: #5b3fa0; background: #eee8fb; }
.vis-qbody { flex: 1; min-width: 0; }
.vis-qmeta { margin: 0 0 3px; }
.vis-qmeta .vis-tag { margin-left: 0; }
.vis-qactions { display: flex; flex: 0 0 auto; gap: 6px; }
.chip-positive { color: #0d5c3f; background: #d7f5e6; }
.chip-mixed { color: #8a5a0b; background: #fdf1d8; }
.chip-negative { color: #9b2f2c; background: #fbe3e2; }

/* Engine badges and colors (one hue per engine, reused in charts and dots). */
.pf-badge { display: inline-grid; min-width: 30px; height: 22px; padding: 0 5px; place-items: center; border-radius: 6px; color: #fff; font-size: 9.5px; font-weight: 800; letter-spacing: .04em; vertical-align: middle; }
.pf-chatgpt { --pf: #10a37f; } .pf-perplexity { --pf: #1f7a8c; } .pf-gemini { --pf: #4f6bed; } .pf-copilot { --pf: #c2410c; } .pf-google_aio { --pf: #d93025; }
.pf-badge { background: var(--pf, #63738a); }
.pf-fill { fill: var(--pf, #63738a); }
.vis-tabs a .pf-badge { margin-right: 4px; }

.dash-top { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.dash-top .vis-card, .dash-grid .vis-card { margin: 0; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.dash-brand-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.dash-brand h1 { font-size: 30px; }
.dash-aliases { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0 0; font-size: 12px; }
.dash-aliases span { color: var(--muted); font-weight: 650; }
.dash-aliases .vis-tag { margin: 0; text-transform: none; letter-spacing: 0; font-size: 11px; }
.dash-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 18px 0 16px; }
.dash-kpis div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.dash-kpis span { display: block; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.dash-kpis strong { display: block; margin-top: 4px; font-size: 24px; line-height: 1.1; letter-spacing: -.03em; }
.dash-kpis small { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0; }
.dash-card-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 14px; font-size: 15px; font-weight: 800; }
.dash-card-title small { color: var(--muted); font-size: 11.5px; font-weight: 500; }
.dash-ring-row { display: flex; justify-content: space-around; gap: 12px; }
.dash-ring { display: grid; justify-items: center; gap: 4px; text-align: center; }
.dash-ring .ring-wrap b { font-size: 24px; font-family: Inter, system-ui, sans-serif; }
.dash-ring > span { color: var(--muted); font-size: 12px; font-weight: 650; }
.dash-ring small { display: block; font-weight: 500; }
.bar-chart { display: block; width: 100%; height: auto; }
.dash-cats { margin: 0; padding: 0; list-style: none; }
.dash-cats li { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 44px; align-items: center; gap: 10px; padding: 7px 0; font-size: 12.5px; }
.dash-cats li > span { overflow: hidden; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.dash-cats .bar-svg { height: 14px; }
.dash-cats b { text-align: right; font-variant-numeric: tabular-nums; }
.cat-0 { --tone: #f97316; } .cat-1 { --tone: #a855f7; } .cat-2 { --tone: #10b981; } .cat-3 { --tone: #3b82f6; } .cat-4 { --tone: #ec4899; }
.dash-ranking { margin: 0; padding: 0; list-style: none; }
.dash-ranking li { display: grid; grid-template-columns: 26px 1fr auto 34px; align-items: center; gap: 10px; margin-bottom: 6px; padding: 8px 10px; border: 1px solid #eef1f4; border-radius: 9px; background: #fafbfc; font-size: 13px; }
.dash-ranking li.is-client { border-color: #b7a4ef; background: #f4f0fe; font-weight: 750; }
.dash-rank { color: var(--muted); font-variant-numeric: tabular-nums; }
.dash-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-name .vis-tag { text-transform: none; }
.dash-engines { display: flex; gap: 3px; }
.dash-engines i { width: 8px; height: 8px; border-radius: 50%; background: #dfe4ea; }
.dash-engines i.on { background: var(--pf); }
.pf-dot-chatgpt { --pf: #10a37f; } .pf-dot-perplexity { --pf: #1f7a8c; } .pf-dot-gemini { --pf: #4f6bed; } .pf-dot-copilot { --pf: #c2410c; } .pf-dot-google_aio { --pf: #d93025; }
.dash-ranking b { text-align: right; font-variant-numeric: tabular-nums; }
.dash-prompts td { vertical-align: middle; }
.dash-prompts td:nth-child(2) { width: 52%; }
.dash-prompt { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.dash-prompts small { color: var(--muted); font-size: 11px; }
.dash-pill { display: inline-block; min-width: 30px; padding: 2px 8px; border-radius: 7px; font-size: 12px; font-weight: 750; text-align: center; }
.pill-brands { color: #1e5aa8; background: #e3effd; }
.pill-cites { color: #9a5b00; background: #fff2d6; }
.dash-branded { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.dash-sentiment { display: flex; gap: 6px; }
.dash-sentiment em { padding: 0 9px; border-radius: 8px; font-size: 20px; font-style: normal; }
.dash-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 6px; }
.dash-two h3 { margin: 0 0 8px; font-size: 13px; }
.dash-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.dash-tags .vis-chip { font-style: normal; }
.vis-domains li b { font-weight: 600; color: var(--muted); font-size: 12px; }

@media (max-width: 900px) {
    .dash-top, .dash-grid, .dash-two, .vis-three { grid-template-columns: 1fr; }
    .dash-kpis, .dash-branded { grid-template-columns: 1fr 1fr; }
    .dash-prompts { display: block; overflow-x: auto; }
    .vis-question header { flex-wrap: wrap; }
}
@media print {
    .dash-top { grid-template-columns: 1.4fr 1fr; }
    .dash-grid, .dash-two { grid-template-columns: 1fr 1fr; }
    .dash-kpis, .dash-branded { grid-template-columns: repeat(4, 1fr); }
    .vis-print-cover { display: block; margin: 0 0 8px; }
    .vis-method { break-before: avoid; }
}
.vis-login .vis-sub { margin: 0 0 20px; line-height: 1.6; }
