/* AI Search Ready: everything is scoped under .asr-app so it can live inside other pages (owner area tab). */
.asr-app {
    --asr-green: #42b983;
    --asr-green-dark: #2f8a61;
    --asr-text: #1f2937;
    --asr-muted: #5b6472;
    --asr-border: #e5e7eb;
    --asr-bg: #ffffff;
    --asr-soft: #f7f8fa;
    --asr-critical: #b42318;
    --asr-high: #c4320a;
    --asr-medium: #a15c07;
    --asr-low: #2563a8;
    --asr-info: #5b6472;
    color: var(--asr-text);
    font-size: 15px;
    line-height: 1.5;
    text-align: left;
    max-width: 1100px;
    margin: 0 auto;
}
.asr-app *, .asr-app *::before, .asr-app *::after { box-sizing: border-box; }
.asr-app h2 { font-size: 1.35rem; font-weight: 600; margin: 0 0 12px; text-align: left; }
.asr-app h3 { font-size: 1.1rem; font-weight: 600; margin: 0 0 8px; }
.asr-app h4 { font-size: 1rem; font-weight: 600; margin: 14px 0 6px; }
.asr-app p { margin: 0 0 10px; }
.asr-app a { color: var(--asr-green-dark); }
.asr-app code { background: #f1f3f5; padding: 1px 5px; border-radius: 4px; font-size: 0.9em; word-break: break-all; }
.asr-app pre { background: #16161a; color: #f3f3f5; padding: 14px; border-radius: 8px; overflow-x: auto; font-size: 13px; line-height: 1.5; white-space: pre; }
.asr-app pre code { background: none; padding: 0; color: inherit; word-break: normal; }

.asr-card { background: var(--asr-bg); border: 1px solid var(--asr-border); border-radius: 10px; padding: 20px; margin: 0 0 18px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.asr-muted { color: var(--asr-muted); }
.asr-small { font-size: 13px; }
.asr-hidden { display: none !important; }
.asr-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* tabs */
.asr-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--asr-border); margin: 0 0 18px; }
.asr-tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--asr-muted); cursor: pointer; border-radius: 0; }
.asr-tab:hover { color: var(--asr-text); background: none; }
.asr-tab[aria-selected="true"] { color: var(--asr-text); border-bottom-color: var(--asr-green); }

/* buttons and forms */
.asr-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; background: var(--asr-green); color: #fff; border: 1px solid var(--asr-green); border-radius: 6px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; }
.asr-btn:hover { background: var(--asr-green-dark); border-color: var(--asr-green-dark); color: #fff; }
.asr-btn:disabled { background: #9ca3af; border-color: #9ca3af; cursor: not-allowed; }
.asr-btn-secondary { background: #fff; color: var(--asr-text); border-color: #cfd4da; }
.asr-btn-secondary:hover { background: var(--asr-soft); color: var(--asr-text); border-color: #b8bec6; }
.asr-btn-small { padding: 5px 10px; font-size: 13px; }
.asr-btn-danger { background: #fff; color: var(--asr-critical); border-color: #f1b5b0; }
.asr-btn-danger:hover { background: #fdecea; color: var(--asr-critical); border-color: var(--asr-critical); }
.asr-app button:focus-visible, .asr-app a:focus-visible, .asr-app input:focus-visible, .asr-app select:focus-visible, .asr-app textarea:focus-visible, .asr-app summary:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }

.asr-form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.asr-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.asr-field-grow { flex: 1 1 320px; }
.asr-field label, .asr-label { font-weight: 600; font-size: 14px; }
.asr-app input[type="url"], .asr-app input[type="text"], .asr-app input[type="number"], .asr-app input[type="date"], .asr-app input[type="search"], .asr-app select, .asr-app textarea {
    width: 100%; padding: 9px 11px; font: inherit; font-size: 15px; border: 1px solid #cfd4da; border-radius: 6px; background: #fff; color: var(--asr-text);
}
.asr-app textarea { min-height: 70px; resize: vertical; }
.asr-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 6px 0 14px; }
.asr-check input { margin-top: 3px; width: 18px; height: 18px; flex: 0 0 auto; }
.asr-modes { display: flex; gap: 10px; flex-wrap: wrap; }
.asr-mode { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--asr-border); border-radius: 8px; padding: 10px 12px; cursor: pointer; flex: 1 1 220px; }
.asr-mode input { margin-top: 3px; }
.asr-mode:has(input:checked) { border-color: var(--asr-green); background: #f0faf5; }

.asr-alert { padding: 12px 14px; border-radius: 8px; border: 1px solid; margin: 0 0 14px; font-size: 14px; }
.asr-alert-error { background: #fdecea; border-color: #f1b5b0; color: #8a1c12; }
.asr-alert-warn { background: #fff7e6; border-color: #f5d08a; color: #6b4300; }
.asr-alert-info { background: #eef5ff; border-color: #c4dafb; color: #1e3a6b; }
.asr-alert-ok { background: #ecf8f2; border-color: #b4e2cb; color: #1e5c3e; }
.asr-disclaimer { font-size: 13px; color: var(--asr-muted); border-left: 3px solid var(--asr-border); padding: 4px 0 4px 10px; margin: 12px 0 0; }

/* limits bar */
.asr-limits { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--asr-muted); margin: 0 0 14px; }
.asr-limits strong { color: var(--asr-text); }

/* progress */
.asr-progress { height: 10px; background: #edf0f3; border-radius: 6px; overflow: hidden; margin: 10px 0; }
.asr-progress > div { height: 100%; background: var(--asr-green); width: 0; transition: width .4s ease; }
.asr-phases { display: flex; gap: 6px; flex-wrap: wrap; list-style: none; padding: 0; margin: 10px 0; font-size: 13px; }
.asr-phases li { padding: 3px 10px; border-radius: 999px; background: #edf0f3; color: var(--asr-muted); }
.asr-phases li.is-done { background: #dff3e9; color: #1e5c3e; }
.asr-phases li.is-current { background: var(--asr-green); color: #fff; }

/* overview */
.asr-overview { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.asr-score { text-align: center; }
.asr-score-ring { width: 170px; height: 170px; margin: 0 auto 8px; display: block; }
.asr-score-number { font-size: 44px; font-weight: 700; fill: var(--asr-text); }
.asr-score-of { font-size: 14px; fill: var(--asr-muted); }
.asr-band { display: inline-block; padding: 3px 12px; border-radius: 999px; font-weight: 600; font-size: 14px; background: #edf0f3; }
.asr-band-critical { background: #fdecea; color: var(--asr-critical); }
.asr-band-early { background: #fff1e6; color: var(--asr-high); }
.asr-band-good { background: #fff7e6; color: var(--asr-medium); }
.asr-band-strong { background: #ecf8f2; color: #1e5c3e; }
.asr-band-advanced { background: #dff3e9; color: #145233; }
.asr-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 14px; }
.asr-meta div { background: var(--asr-soft); border-radius: 8px; padding: 10px 12px; }
.asr-meta dt { font-size: 12px; color: var(--asr-muted); text-transform: uppercase; letter-spacing: .03em; }
.asr-meta dd { margin: 2px 0 0; font-weight: 600; font-size: 16px; }

.asr-cats { list-style: none; padding: 0; margin: 0; }
.asr-cats li { display: grid; grid-template-columns: minmax(160px, 1.2fr) 2fr 90px; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--asr-border); font-size: 14px; }
.asr-cats .asr-bar { height: 8px; background: #edf0f3; border-radius: 4px; overflow: hidden; }
.asr-cats .asr-bar > span { display: block; height: 100%; background: var(--asr-green); }
.asr-cats .asr-cat-score { text-align: right; font-variant-numeric: tabular-nums; }

.asr-top-issues { list-style: none; padding: 0; margin: 0; }
.asr-top-issues li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px dashed var(--asr-border); }

/* badges */
.asr-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.asr-sev-critical { background: #fdecea; color: var(--asr-critical); border-color: #f1b5b0; }
.asr-sev-high { background: #fff1e6; color: var(--asr-high); border-color: #f7c9a8; }
.asr-sev-medium { background: #fff7e6; color: var(--asr-medium); border-color: #f5d08a; }
.asr-sev-low { background: #eef5ff; color: var(--asr-low); border-color: #c4dafb; }
.asr-sev-info { background: #f1f3f5; color: var(--asr-info); border-color: #dde1e5; }
.asr-st-pass { background: #ecf8f2; color: #1e5c3e; }
.asr-st-partial { background: #fff7e6; color: var(--asr-medium); }
.asr-st-fail { background: #fdecea; color: var(--asr-critical); }
.asr-st-not_tested, .asr-st-unknown, .asr-st-not_applicable { background: #f1f3f5; color: var(--asr-info); }

/* findings */
.asr-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 14px; }
.asr-filters .asr-field-search { grid-column: 1 / -1; }
.asr-finding { border: 1px solid var(--asr-border); border-radius: 8px; margin: 0 0 10px; background: #fff; }
.asr-finding-head { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; }
.asr-finding-head .asr-badges { display: flex; gap: 6px; flex-wrap: wrap; flex: 0 0 auto; }
.asr-finding-title { font-weight: 600; flex: 1 1 auto; min-width: 0; }
.asr-finding-title small { display: block; font-weight: 400; color: var(--asr-muted); font-size: 12px; }
.asr-finding-body { padding: 0 14px 14px; font-size: 14px; }
.asr-finding-body .asr-reco { background: #f0faf5; border-left: 3px solid var(--asr-green); padding: 8px 10px; margin: 8px 0; }
.asr-finding-detail { border-top: 1px solid var(--asr-border); padding: 12px 14px; background: var(--asr-soft); font-size: 14px; }
.asr-finding-detail dl { margin: 0; display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; }
.asr-finding-detail dt { font-weight: 600; color: var(--asr-muted); }
.asr-finding-detail dd { margin: 0; }
.asr-urls { margin: 6px 0 0; padding-left: 18px; font-size: 13px; max-height: 260px; overflow: auto; word-break: break-all; }

.asr-evidence { font-size: 13px; overflow-x: auto; }
.asr-evidence table { border-collapse: collapse; width: 100%; margin: 4px 0 8px; background: #fff; }
.asr-evidence th, .asr-evidence td { border: 1px solid var(--asr-border); padding: 4px 6px; text-align: left; vertical-align: top; word-break: break-word; }
.asr-evidence th { background: #f1f3f5; font-weight: 600; }
.asr-evidence dl { display: grid; grid-template-columns: minmax(120px, 220px) 1fr; gap: 3px 10px; margin: 0 0 6px; }
.asr-evidence dt { color: var(--asr-muted); }
.asr-evidence dd { margin: 0; word-break: break-word; }
.asr-evidence ul { margin: 0; padding-left: 18px; }

/* history */
.asr-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.asr-table th, .asr-table td { padding: 8px 10px; border-bottom: 1px solid var(--asr-border); text-align: left; vertical-align: middle; }
.asr-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--asr-muted); }
.asr-table-wrap { overflow-x: auto; }
.asr-trend { width: 100%; height: 140px; display: block; }
.asr-trend .asr-trend-line { fill: none; stroke: var(--asr-green); stroke-width: 2.5; }
.asr-trend .asr-trend-dot { fill: #fff; stroke: var(--asr-green); stroke-width: 2; }
.asr-trend .asr-trend-grid { stroke: #edf0f3; stroke-width: 1; }
.asr-trend text { font-size: 11px; fill: var(--asr-muted); }
.asr-delta-up { color: #1e7a4c; font-weight: 600; }
.asr-delta-down { color: var(--asr-critical); font-weight: 600; }

/* prompts */
.asr-prompt { display: grid; grid-template-columns: 26px 1fr 150px 36px; gap: 8px; align-items: center; margin-bottom: 6px; }
.asr-key-once { background: #fff7e6; border: 1px dashed #f5d08a; padding: 10px; border-radius: 8px; word-break: break-all; font-family: ui-monospace, Consolas, monospace; }

.asr-spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: asr-spin .8s linear infinite; display: inline-block; }
.asr-spinner-dark { border-color: #d1d5db; border-top-color: var(--asr-green); }
@keyframes asr-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .asr-spinner { animation-duration: 3s; } .asr-progress > div { transition: none; } }

@media (max-width: 760px) {
    .asr-overview { grid-template-columns: 1fr; }
    .asr-cats li { grid-template-columns: 1fr 70px; }
    .asr-cats .asr-bar { grid-column: 1 / -1; grid-row: 2; }
    .asr-finding-head { flex-direction: column; }
    .asr-finding-detail dl, .asr-evidence dl { grid-template-columns: 1fr; }
    .asr-prompt { grid-template-columns: 26px 1fr 36px; }
    .asr-prompt select { grid-column: 2; }
}
