
:root {
  --page: #f4f6f8;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --line: #dfe4ea;
  --line-strong: #c7d0da;
  --text: #18212b;
  --muted: #637083;
  --subtle: #8994a4;
  --blue: #1769e0;
  --blue-soft: #eaf2ff;
  --nav: #17212d;
  --nav-muted: #aab6c5;
  --green: #157347;
  --green-soft: #e7f5ed;
  --amber: #9a5b00;
  --amber-soft: #fff3d6;
  --red: #b42318;
  --red-soft: #fdecea;
}

* { box-sizing: border-box; }
html { background: var(--page); }
body { margin: 0; background: var(--page); color: var(--text); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: 0; }
button, input, select { font: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); background: var(--page); }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--nav); color: white; padding: 22px 14px 18px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 24px; border-bottom: 1px solid #2a3746; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: #e32f2f; border-radius: 7px; }
.brand div { display: flex; flex-direction: column; gap: 1px; }
.brand strong { font-size: 15px; }
.brand span:not(.brand-mark) { color: var(--nav-muted); font-size: 12px; }
.nav-list { display: grid; gap: 5px; padding-top: 20px; }
.nav-list button { width: 100%; min-height: 42px; border: 0; background: transparent; color: var(--nav-muted); display: grid; grid-template-columns: 22px 1fr auto; align-items: center; text-align: left; gap: 9px; padding: 0 11px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; }
.nav-list button > span { font-size: 11px; padding: 2px 7px; background: #263443; border-radius: 999px; }
.nav-list button:hover { background: #202d3b; color: white; }
.nav-list button.active { background: #294e80; color: white; }
.sidebar-status { margin-top: auto; border-top: 1px solid #2a3746; padding: 17px 8px 0; display: flex; align-items: flex-start; gap: 9px; }
.status-dot { width: 8px; height: 8px; background: #3fc681; border-radius: 50%; margin-top: 4px; box-shadow: 0 0 0 3px rgba(63, 198, 129, .12); }
.status-dot.offline { background: #d89a2b; box-shadow: 0 0 0 3px rgba(216, 154, 43, .12); }
.status-dot.error { background: #d6483d; box-shadow: 0 0 0 3px rgba(214, 72, 61, .12); }
.sidebar-status div { display: flex; flex-direction: column; gap: 3px; }
.sidebar-status strong { font-size: 12px; }
.sidebar-status span:last-child { color: var(--nav-muted); font-size: 10px; }

.workspace { min-width: 0; }
.topbar { height: 84px; padding: 0 30px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.eyebrow { margin: 0 0 3px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.topbar h1 { margin: 0; font-size: 23px; line-height: 1.25; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-meta { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }
.cloud-button { height: 35px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); background: white; color: var(--text); border-radius: 6px; padding: 0 11px; font-size: 11px; font-weight: 700; cursor: pointer; }
.cloud-button:hover { border-color: var(--blue); }
.cloud-button.connected { color: var(--green); border-color: #9bcbb1; background: var(--green-soft); }
.cloud-button.connecting { color: var(--amber); border-color: #e1bd72; background: var(--amber-soft); }
.cloud-button.error { color: var(--red); border-color: #e6a39d; background: var(--red-soft); }
.cloud-button:disabled { opacity: .68; cursor: wait; }
.view-content { padding: 24px 30px 42px; max-width: 1560px; margin: 0 auto; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric-grid article { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 16px 18px; min-height: 110px; display: flex; flex-direction: column; }
.metric-grid span { color: var(--muted); font-size: 12px; font-weight: 600; }
.metric-grid strong { font-size: 30px; line-height: 1; margin: 13px 0 7px; }
.metric-grid small { color: var(--subtle); font-size: 11px; }
.section-block { margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.section-heading { padding: 17px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-heading h2 { margin: 0; font-size: 16px; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.heading-actions { display: flex; align-items: center; gap: 8px; }
.scope-switch { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-muted); }
.scope-switch button { min-height: 28px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); padding: 0 9px; font-size: 10px; font-weight: 700; cursor: pointer; }
.scope-switch button.active { background: white; color: var(--blue); box-shadow: 0 1px 3px rgba(25, 38, 54, .1); }
.scope-note { min-height: 38px; display: flex; align-items: center; gap: 7px; padding: 8px 18px; color: var(--green); background: var(--green-soft); border-bottom: 1px solid #cce4d7; font-size: 10px; font-weight: 600; }
.review-progress { color: var(--muted); border: 1px solid var(--line); padding: 6px 9px; border-radius: 5px; font-size: 11px; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.action-table { overflow-x: auto; }
.action-row { min-width: 1020px; display: grid; grid-template-columns: 116px 120px minmax(280px, 1.3fr) minmax(320px, 1fr) 42px; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); transition: background .15s ease, opacity .15s ease; }
.action-row:last-child { border-bottom: 0; }
.action-row:not(.action-header):hover { background: #f9fbfd; }
.action-row.reviewed { opacity: .58; }
.action-header { padding-top: 10px; padding-bottom: 10px; color: var(--subtle); background: var(--surface-muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.action-main, .evidence-cell { border: 0; background: transparent; padding: 0; text-align: left; cursor: pointer; }
.action-main { display: flex; flex-direction: column; gap: 5px; }
.action-main strong { font-size: 13px; line-height: 1.35; }
.action-main span { color: var(--muted); font-size: 11px; }
.evidence-cell { min-width: 0; border-left: 3px solid var(--line-strong); padding-left: 10px; display: flex; flex-direction: column; gap: 4px; }
.evidence-cell.action { border-left-color: var(--red); }
.evidence-cell.watch { border-left-color: var(--amber); }
.evidence-cell.healthy { border-left-color: var(--green); }
.evidence-cell strong { font-size: 11px; line-height: 1.35; }
.evidence-cell span { color: var(--muted); font-size: 9px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-button { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line-strong); background: white; color: var(--subtle); border-radius: 5px; cursor: pointer; }
.review-button:hover, .review-button.is-reviewed { border-color: var(--green); color: white; background: var(--green); }

.pill, .product, .decision-tag, .status-badge, .intent-tag { width: fit-content; display: inline-flex; align-items: center; border-radius: 999px; white-space: nowrap; font-size: 10px; font-weight: 700; }
.pill { padding: 4px 7px; }
.pill.danger { color: var(--red); background: var(--red-soft); }
.pill.warning { color: var(--amber); background: var(--amber-soft); }
.pill.info { color: #145bb8; background: var(--blue-soft); }
.pill.success { color: var(--green); background: var(--green-soft); }
.pill.neutral { color: #576474; background: #edf1f5; }
.product { padding: 4px 7px; color: #344153; background: #edf1f5; }
.product-malcare { color: #9d251e; background: #fdecea; }
.product-blogvault { color: #1754a4; background: #eaf2ff; }
.product-wpremote { color: #285f3e; background: #e7f5ed; }
.product-airlift { color: #7a5000; background: #fff3d6; }
.product-migrateguru { color: #5b3d94; background: #f0ebfb; }
.product-unclassified { color: #687484; background: #eef1f4; }
.intent-tag { padding: 4px 7px; }
.intent-tag.search { color: var(--green); background: var(--green-soft); }
.intent-tag.support { color: #5d6470; background: #eceff3; }

.explorer-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.explorer-summary > div:first-child { display: flex; align-items: baseline; gap: 8px; }
.explorer-summary > div:first-child strong { font-size: 25px; }
.explorer-summary > div:first-child span { color: var(--muted); font-size: 12px; }
.product-counts { display: flex; flex-wrap: wrap; gap: 7px; }
.product-counts span { color: var(--muted); background: white; border: 1px solid var(--line); border-radius: 5px; padding: 6px 8px; font-size: 10px; }
.product-counts strong { color: var(--text); margin-left: 3px; }
.filterbar { background: var(--surface); border: 1px solid var(--line); border-radius: 7px 7px 0 0; padding: 12px; display: grid; grid-template-columns: minmax(220px, 1fr) 142px 120px 158px auto auto auto; align-items: end; gap: 8px; }
.filterbar label { display: flex; flex-direction: column; gap: 5px; }
.filterbar label > span { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.filterbar input, .filterbar select { height: 36px; min-width: 0; border: 1px solid var(--line-strong); border-radius: 5px; background: white; color: var(--text); padding: 0 10px; font-size: 11px; outline: none; }
.filterbar input:focus, .filterbar select:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(23,105,224,.11); }
.filterbar .search-field { position: relative; display: block; }
.search-field svg { position: absolute; left: 10px; top: 9px; color: var(--subtle); }
.search-field input { width: 100%; padding-left: 36px; }
.toggle, .secondary-button { height: 36px; border: 1px solid var(--line-strong); border-radius: 5px; background: white; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 10px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.toggle.on { color: #145bb8; border-color: #8ab6ee; background: var(--blue-soft); }
.toggle:hover, .secondary-button:hover { border-color: var(--blue); }
.video-table { border: 1px solid var(--line); border-top: 0; background: var(--surface); overflow-x: auto; }
.video-row { width: 100%; min-width: 1080px; display: grid; grid-template-columns: minmax(320px, 1.6fr) 105px 100px 88px 82px 82px 145px; gap: 12px; align-items: center; text-align: left; padding: 11px 14px; border: 0; border-bottom: 1px solid var(--line); background: white; font-size: 11px; }
button.video-row { cursor: pointer; }
button.video-row:hover { background: #f8fbff; }
.video-row:last-child { border-bottom: 0; }
.video-header { background: var(--surface-muted); color: var(--subtle); font-size: 9px; font-weight: 700; text-transform: uppercase; padding-top: 9px; padding-bottom: 9px; }
.video-title-cell { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 10px; align-items: center; }
.video-thumb { width: 42px; height: 28px; border-radius: 4px; background: #e9edf2; color: #566477; display: grid; place-items: center; }
.video-title-cell > span:last-child { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.video-title-cell strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.video-row small { display: block; color: var(--subtle); font-size: 9px; margin-top: 3px; }
.decision-tag { max-width: 145px; overflow: hidden; text-overflow: ellipsis; padding: 4px 7px; }
.decision-tag.change { color: var(--red); background: var(--red-soft); }
.decision-tag.keep { color: var(--green); background: var(--green-soft); }
.decision-tag.review { color: #526071; background: #edf1f5; }
.empty-state { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--subtle); }
.empty-state strong { color: var(--text); font-size: 13px; }
.empty-state span { font-size: 11px; }
.pagination { display: flex; justify-content: space-between; align-items: center; padding: 12px 2px; color: var(--muted); font-size: 11px; }
.pagination div { display: flex; gap: 5px; }
.pagination button { width: 31px; height: 31px; border: 1px solid var(--line-strong); background: white; display: grid; place-items: center; border-radius: 5px; cursor: pointer; }
.pagination button:disabled { opacity: .35; cursor: default; }

.connection-banner { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px; background: white; border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 7px; padding: 16px; }
.connection-banner.connected { border-left-color: var(--green); }
.connection-banner.error { border-left-color: var(--red); }
.connection-icon { width: 38px; height: 38px; border-radius: 6px; display: grid; place-items: center; color: var(--amber); background: var(--amber-soft); }
.connection-banner.connected .connection-icon { color: var(--green); background: var(--green-soft); }
.connection-banner.error .connection-icon { color: var(--red); background: var(--red-soft); }
.connection-banner h2 { margin: 0; font-size: 15px; }
.connection-banner p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.connection-actions { display: flex; align-items: center; gap: 7px; }
.connection-actions .secondary-button, .connection-actions .primary-button { min-width: 104px; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 5px; background: white; cursor: pointer; }
.icon-button:hover { color: var(--blue); border-color: var(--blue); }
.spin { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.data-card { background: white; border: 1px solid var(--line); border-radius: 7px; padding: 16px; }
.data-card-head { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; color: var(--muted); font-size: 11px; }
.data-card > strong { display: block; margin-top: 18px; font-size: 24px; }
.data-card p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.status-badge { padding: 3px 7px; }
.status-badge.good { color: var(--green); background: var(--green-soft); }
.status-badge.partial { color: var(--amber); background: var(--amber-soft); }
.next-step-card { padding: 0 18px; }
.next-step-card > div { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.next-step-card > div:last-child { border-bottom: 0; }
.step-number { width: 25px; height: 25px; border: 1px solid var(--line-strong); border-radius: 50%; display: grid; place-items: center; color: var(--muted); font-size: 10px; font-weight: 700; }
.next-step-card h3 { margin: 0; font-size: 12px; }
.next-step-card p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.step-done { color: var(--green); }
.step-open { color: var(--amber); }
.later-label { color: var(--subtle); font-size: 10px; font-weight: 700; }
.error-log { margin-bottom: 20px; }
.error-row { display: grid; grid-template-columns: 210px minmax(0, 1fr) 130px; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); align-items: start; }
.error-row:last-child { border-bottom: 0; }
.error-row span { color: var(--amber); font-size: 10px; font-weight: 700; overflow-wrap: anywhere; }
.error-row p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.error-row time { color: var(--subtle); font-size: 9px; text-align: right; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(17, 25, 35, .36); display: flex; justify-content: flex-end; }
.detail-drawer { width: min(780px, 96vw); height: 100%; background: white; box-shadow: -12px 0 30px rgba(22, 31, 42, .13); padding: 26px 28px; overflow-y: auto; position: relative; }
.drawer-close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 5px; background: white; display: grid; place-items: center; cursor: pointer; }
.detail-content { padding-top: 24px; }
.detail-kicker { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 13px; }
.detail-content h2 { margin: 0; padding-right: 32px; font-size: 22px; line-height: 1.35; }
.detail-decision { color: var(--muted); font-size: 11px; margin: 9px 0 24px; }
.detail-content section { border-top: 1px solid var(--line); padding: 17px 0; }
.detail-content section h3 { margin: 0 0 7px; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.detail-content section p { margin: 0; font-size: 12px; line-height: 1.65; }
.drawer-verdict { margin: 18px 0 4px; padding: 16px; border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: 7px; background: var(--surface-muted); }
.drawer-verdict.action { border-left-color: var(--red); background: var(--red-soft); }
.drawer-verdict.healthy { border-left-color: var(--green); background: var(--green-soft); }
.drawer-verdict > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.drawer-verdict > strong { display: block; font-size: 16px; line-height: 1.35; }
.drawer-verdict > p { margin: 7px 0 0; color: #465466; font-size: 11px; line-height: 1.55; }
.drawer-verdict > div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.drawer-verdict em { padding: 5px 7px; border: 1px solid rgba(96, 112, 130, .18); border-radius: 4px; background: rgba(255,255,255,.7); color: #4d5a6a; font-size: 9px; font-style: normal; font-weight: 700; }
.analytics-evidence { margin-top: 18px; padding-top: 18px !important; }
.evidence-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.evidence-section-head h3 { margin-bottom: 4px !important; color: var(--text) !important; font-size: 13px !important; text-transform: none !important; }
.evidence-section-head p { color: var(--muted); font-size: 10px !important; line-height: 1.45 !important; }
.analysis-mode { flex: 0 0 auto; padding: 4px 7px; border-radius: 999px; color: var(--blue); background: var(--blue-soft); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.video-comparison-head { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.video-comparison-head > div { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-muted); display: flex; flex-direction: column; gap: 5px; }
.video-comparison-head strong { font-size: 11px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-comparison-head small { color: var(--muted); font-size: 9px; }
.video-role { width: fit-content; padding: 3px 6px; border-radius: 4px; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.video-role.current { color: #155bb3; background: var(--blue-soft); }
.video-role.older { color: #5c6470; background: #edf1f5; }
.comparison-rows { margin-top: 10px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.comparison-row { display: grid; grid-template-columns: 105px repeat(2, minmax(0, 1fr)); gap: 10px; align-items: center; min-height: 48px; padding: 8px 11px; border-bottom: 1px solid var(--line); }
.comparison-row:last-child { border-bottom: 0; }
.comparison-label { color: var(--muted); font-size: 9px; font-weight: 700; }
.comparison-value { min-width: 0; display: grid; grid-template-columns: 54px 1fr; align-items: center; gap: 7px; }
.comparison-value strong { font-size: 11px; }
.comparison-value i { height: 6px; min-width: 2px; border-radius: 999px; background: #70a7ed; }
.comparison-value.older i { background: #9aa6b5; }
.comparison-footnotes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.comparison-footnotes span { padding: 5px 7px; border-radius: 4px; color: var(--muted); background: var(--surface-muted); font-size: 9px; }
.comparison-footnotes strong { color: var(--text); }
.single-summary { display: grid; grid-template-columns: minmax(190px, .8fr) minmax(0, 1.4fr); gap: 10px; }
.single-trend-card { padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-muted); display: flex; flex-direction: column; }
.single-trend-card > span { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.single-trend-card > strong { margin-top: 12px; font-size: 20px; }
.single-trend-card small { margin-top: 9px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.trend-track { height: 8px; margin-top: 12px; border-radius: 999px; background: #e1e6ec; overflow: hidden; }
.trend-track i { display: block; height: 100%; border-radius: inherit; background: var(--amber); }
.analytics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.analytics-grid > div { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 6px; display: flex; flex-direction: column; gap: 4px; }
.analytics-grid span { color: var(--muted); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.analytics-grid strong { font-size: 13px; overflow-wrap: anywhere; }
.analytics-grid small { color: var(--subtle); font-size: 8px; line-height: 1.35; }
.decision-rationale h3:not(:first-child) { margin-top: 14px; }
.detail-content section.topic-health { margin: 4px -12px 18px; padding: 16px 12px; border: 1px solid #cfe0f5; border-radius: 8px; background: #f7fbff; }
.topic-health-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; color: var(--blue); }
.topic-health-heading h3 { color: var(--text) !important; font-size: 13px !important; text-transform: none !important; margin-bottom: 4px !important; }
.topic-health-heading p { color: var(--muted); font-size: 10px !important; line-height: 1.5 !important; }
.rank-controls { display: grid; grid-template-columns: minmax(0, 1fr) 82px auto; align-items: end; gap: 7px; margin-top: 14px; }
.rank-controls label { display: flex; flex-direction: column; gap: 5px; }
.rank-controls label > span { color: var(--muted); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.rank-controls input, .rank-controls select { width: 100%; height: 36px; min-width: 0; border: 1px solid var(--line-strong); border-radius: 5px; background: white; padding: 0 9px; font-size: 10px; outline: none; }
.rank-controls input:focus, .rank-controls select:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(23,105,224,.1); }
.rank-controls .primary-button { height: 36px; min-height: 36px; white-space: nowrap; }
.rank-controls .primary-button:disabled { opacity: .6; cursor: wait; }
.rank-caveat, .partial-warning { display: flex; align-items: flex-start; gap: 6px; margin-top: 9px !important; color: var(--subtle); font-size: 9px !important; line-height: 1.45 !important; }
.rank-caveat svg, .partial-warning svg { flex: 0 0 auto; margin-top: 1px; }
.health-error { display: flex; align-items: flex-start; gap: 7px; margin-top: 12px; padding: 10px; color: var(--red); background: var(--red-soft); border-radius: 5px; font-size: 10px; line-height: 1.45; }
.topic-verdict { margin-top: 14px; padding: 12px; border-left: 3px solid var(--blue); border-radius: 5px; background: white; }
.topic-verdict.healthy { border-color: var(--green); background: var(--green-soft); }
.topic-verdict.watch { border-color: var(--amber); background: var(--amber-soft); }
.topic-verdict.action { border-color: var(--red); background: var(--red-soft); }
.topic-verdict strong { display: block; font-size: 12px; }
.topic-verdict p { margin-top: 5px !important; color: #49576a; font-size: 10px !important; line-height: 1.55 !important; }
.health-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 10px; }
.health-metrics > div { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: white; display: flex; flex-direction: column; gap: 4px; }
.health-metrics span { color: var(--muted); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.health-metrics strong { font-size: 14px; overflow-wrap: anywhere; }
.health-metrics strong.negative { color: var(--red); }
.health-metrics strong.positive { color: var(--green); }
.health-metrics small { min-height: 13px; display: flex; align-items: center; gap: 4px; color: var(--subtle); font-size: 8px; overflow-wrap: anywhere; }
.term-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.term-columns > div { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.term-columns h4 { margin: 0 0 7px; color: var(--muted); font-size: 9px; }
.term-columns p { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 5px 0; border-top: 1px solid #edf0f4; font-size: 9px !important; line-height: 1.3 !important; }
.term-columns p span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.term-columns p strong { color: var(--muted); }
.term-columns em { color: var(--subtle); font-size: 9px; }
.intent-controls { display: inline-flex; gap: 6px; margin-top: 12px; }
.intent-controls button { min-height: 32px; border: 1px solid var(--line-strong); border-radius: 5px; background: white; color: var(--muted); padding: 0 10px; font-size: 10px; font-weight: 700; cursor: pointer; }
.intent-controls button.active { color: var(--blue); border-color: #8ab6ee; background: var(--blue-soft); }
.detail-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 20px; }
.detail-metrics div { background: var(--surface-muted); border: 1px solid var(--line); border-radius: 6px; padding: 11px; display: flex; flex-direction: column; gap: 5px; }
.detail-metrics span { color: var(--muted); font-size: 9px; }
.detail-metrics strong { font-size: 14px; }
.reference-videos a { color: inherit; text-decoration: none; border: 1px solid var(--line); border-radius: 6px; padding: 10px; margin-top: 7px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reference-videos a:hover { border-color: var(--blue); }
.reference-videos a span { display: flex; flex-direction: column; gap: 3px; font-size: 11px; }
.reference-videos a strong { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.primary-button { min-height: 38px; border: 1px solid var(--blue); background: var(--blue); color: white; border-radius: 5px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; font-size: 11px; font-weight: 700; cursor: pointer; }
.primary-button.complete { border-color: var(--green); background: var(--green); }

.setup-backdrop { justify-content: center; align-items: center; padding: 20px; }
.setup-dialog { position: relative; width: min(610px, 96vw); max-height: 94vh; overflow-y: auto; background: white; border-radius: 8px; box-shadow: 0 22px 60px rgba(18, 29, 41, .22); padding: 28px; }
.setup-icon { width: 44px; height: 44px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 7px; margin-bottom: 16px; }
.setup-dialog h2 { margin: 0; font-size: 22px; }
.setup-intro { margin: 8px 42px 22px 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.setup-step { display: grid; grid-template-columns: 28px 1fr; gap: 11px; padding: 14px 0; border-top: 1px solid var(--line); }
.setup-step > span { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--muted); font-size: 10px; font-weight: 700; }
.setup-step > div, .setup-step label { display: flex; flex-direction: column; gap: 8px; }
.setup-step strong { font-size: 11px; }
.setup-step code { overflow-wrap: anywhere; padding: 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-muted); color: #2f3f52; font-size: 10px; line-height: 1.5; }
.setup-step a { width: fit-content; display: inline-flex; align-items: center; gap: 5px; color: var(--blue); text-decoration: none; font-size: 10px; font-weight: 700; }
.setup-step input { width: 100%; height: 39px; border: 1px solid var(--line-strong); border-radius: 5px; padding: 0 10px; outline: none; font-size: 11px; }
.setup-step input:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(23,105,224,.11); }
.setup-connect { width: 100%; margin-top: 6px; }
.setup-connect:disabled { opacity: .55; cursor: wait; }
.setup-footnote { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--subtle); font-size: 9px; margin: 12px 0 0; }

@media (max-width: 1120px) {
  .filterbar { grid-template-columns: minmax(220px, 1fr) 140px 130px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: sticky; z-index: 10; width: 100%; height: auto; padding: 10px 12px; }
  .brand { padding: 0 0 9px; border: 0; }
  .brand-mark { width: 30px; height: 30px; }
  .nav-list { display: flex; overflow-x: auto; padding: 0; gap: 5px; }
  .nav-list button { min-width: max-content; width: auto; min-height: 36px; grid-template-columns: 18px auto auto; }
  .sidebar-status { display: none; }
  .topbar { height: 72px; padding: 0 16px; }
  .topbar h1 { font-size: 19px; }
  .topbar-meta { display: none; }
  .cloud-button { max-width: 145px; }
  .view-content { padding: 16px 14px 34px; }
  .section-heading { align-items: flex-start; }
  .heading-actions { align-items: flex-end; flex-direction: column-reverse; }
  .scope-switch button { padding: 0 7px; }
  .rank-controls { grid-template-columns: 1fr 84px; }
  .rank-controls .primary-button { grid-column: 1 / -1; }
  .term-columns { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric-grid article { min-height: 96px; padding: 13px; }
  .metric-grid strong { font-size: 24px; }
  .section-heading { align-items: flex-start; }
  .review-progress { display: none; }
  .explorer-summary { align-items: flex-start; flex-direction: column; }
  .filterbar { grid-template-columns: 1fr 1fr; }
  .filterbar .search-field { grid-column: 1 / -1; }
  .toggle, .secondary-button { width: 100%; }
  .data-grid { grid-template-columns: 1fr; }
  .connection-banner { grid-template-columns: 38px 1fr; }
  .connection-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr auto; }
  .error-row { grid-template-columns: 1fr; }
  .error-row time { text-align: left; }
  .detail-drawer { padding: 18px; }
  .video-comparison-head { grid-template-columns: 1fr; }
  .comparison-row { grid-template-columns: 82px 1fr 1fr; gap: 7px; }
  .comparison-value { grid-template-columns: 1fr; gap: 4px; }
  .single-summary { grid-template-columns: 1fr; }
  .analytics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .setup-dialog { padding: 22px 18px; }
}

/* Standalone runtime additions */
svg.icon { width: 1em; height: 1em; flex: 0 0 auto; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark svg.icon { fill: currentColor; stroke: currentColor; }
.standalone-banner { display:flex; align-items:flex-start; gap:9px; padding:10px 18px; border-bottom:1px solid #d7e4f5; background:#f0f6ff; color:#315b8a; font-size:10px; line-height:1.45; }
.standalone-banner strong { color:#1d4f88; }
.static-connect-note { margin-top:12px; padding:11px; border:1px solid #d7e4f5; border-radius:6px; background:#f7fbff; color:#52647a; font-size:10px; line-height:1.55; }
.action-row, .video-row { text-decoration:none; }
.video-row { width:100%; }
.detail-content .primary-button { margin-top:4px; }
.topic-placeholder { margin:4px -12px 18px; padding:14px 12px; border:1px solid #cfe0f5; border-radius:8px; background:#f7fbff; }
.topic-placeholder h3 { margin:0 0 5px; font-size:13px; }
.topic-placeholder p { margin:0; color:var(--muted); font-size:10px; line-height:1.55; }
.drawer-backdrop[hidden], .setup-backdrop[hidden] { display:none; }
.setup-dialog .primary-button { width:100%; }
.empty-state { min-height:210px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; color:var(--subtle); }
.empty-state strong { color:var(--text); }
.connection-banner.offline .connection-icon { color:var(--amber); background:var(--amber-soft); }
.offline-tag { display:inline-flex; padding:3px 7px; border-radius:999px; color:var(--amber); background:var(--amber-soft); font-size:9px; font-weight:700; }
.local-open-note { display:flex; align-items:center; gap:6px; color:var(--subtle); font-size:9px; margin-top:9px; }
@media (max-width: 760px) {
  .standalone-banner { padding:9px 14px; }
}
