.score-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.score {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: var(--panel-strong);
}

.score strong {
  display: block;
  font-size: 28px;
}

.score span {
  color: var(--muted);
  font-size: 12px;
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.audit-table th,
.audit-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.audit-value-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.badge {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}

.badge-pass {
  background: rgba(21,164,107,.12);
  color: var(--good);
}

.badge-warn {
  background: rgba(201,135,0,.12);
  color: var(--warn);
}

.badge-fail {
  background: rgba(217,45,32,.12);
  color: var(--bad);
}

.audit-fix-btn,
.pill-fix {
  background: #dc2626 !important;
  color: #fff !important;
  border: 0 !important;
  cursor: pointer;
  position: relative;
  z-index: 3;
}

.platform-fix-btn-chatgpt {
  background: #10b981 !important;
  color: #fff !important;
}

.platform-fix-btn-perplexity {
  background: #7c3aed !important;
  color: #fff !important;
}

.platform-fix-btn-claude {
  background: #f59e0b !important;
  color: #fff !important;
}

.platform-fix-btn-gemini {
  background: #2563eb !important;
  color: #fff !important;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.stat-card strong {
  font-size: 22px;
}

.passed-check-list {
  display: grid;
  gap: 10px;
}

.passed-check-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.passed-check-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(34,197,94,0.12);
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex: 0 0 auto;
}

.competitor-watchlist {
  display: grid;
  gap: 10px;
}

.competitor-watch-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
}

.competitor-watch-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 8px;
}

.competitor-watch-top strong {
  font-size: 14px;
}

.competitor-watch-domain {
  font-size: 11px;
  color: var(--muted);
  word-break: break-all;
}

.competitor-watch-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.competitor-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: #0f172a;
}

.competitor-badge-category {
  background: #eef2ff;
  color: #4338ca;
  border-color: #c7d2fe;
}

.competitor-badge-confidence {
  background: #f8fafc;
  color: #334155;
}

.competitor-badge-threat-high {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.competitor-badge-threat-medium {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.competitor-badge-threat-low {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.premium-intelligence-manual-list {
  display: grid;
  gap: 12px;
}

.premium-intelligence-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
}

.premium-intelligence-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.premium-intelligence-card-top strong {
  font-size: 14px;
  line-height: 1.4;
}

.premium-intelligence-credit {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: #0f172a;
  white-space: nowrap;
}

.premium-intelligence-why {
  margin: 10px 0 12px 0;
  font-size: 13px;
  line-height: 1.6;
}

.premium-intelligence-btn {
  width: 100%;
}

.premium-intelligence-context {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.premium-context-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.premium-context-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

/* scorecard polish */
.score {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 132px;
}

.score-delta {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.score-range {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}

.score-delta.is-up {
  color: var(--good);
}

.score-delta.is-down {
  color: var(--bad);
}

.score-delta.is-flat {
  color: var(--muted);
}

.platform-trend-label {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.impact-title-stamp {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
}

.impact-summary {
  background: var(--panel) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
}

.impact-summary .panel-title,
.impact-summary .muted,
.impact-summary .strategic-impact-summary {
  color: inherit;
}

/* health scorecard polish */
.score-row {
  gap: 14px;
}

.score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  min-height: 158px;
  padding: 18px 14px 16px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.score strong {
  width: 74px;
  height: 74px;
  margin: 0 0 10px 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  background: #fff;
  border: 4px solid #e5e7eb;
}

.score span {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.score-range {
  display: none;
}

.score.is-up strong {
  border-color: rgba(21,164,107,0.65);
  color: var(--good);
}

.score.is-down strong {
  border-color: rgba(217,45,32,0.55);
  color: var(--bad);
}

.score.is-flat strong {
  border-color: rgba(201,135,0,0.65);
  color: #9a6700;
}

.score-delta {
  margin-top: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.score-delta.is-up {
  color: var(--good);
  background: rgba(21,164,107,0.10);
  border-color: rgba(21,164,107,0.18);
}

.score-delta.is-down {
  color: var(--bad);
  background: rgba(217,45,32,0.10);
  border-color: rgba(217,45,32,0.18);
}

.score-delta.is-flat {
  color: var(--muted);
  background: #f8fafc;
}

/* unified code container copy buttons */
.code-copy-wrap {
  position: relative;
  margin: 12px 0 16px 0;
}

.code-copy-wrap .ai-code-block,
.code-copy-wrap .drawer-code-block,
.code-copy-wrap pre {
  margin: 0 !important;
}

.code-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(15,23,42,0.78);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
}

.code-copy-btn:hover {
  background: rgba(15,23,42,0.92);
}

.code-copy-btn.is-copied {
  background: rgba(21,164,107,0.92);
}

body.theme-dark .score {
  background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
}

body.theme-dark .score span {
  color: #e5e7eb;
}

body.theme-dark .score strong {
  background: #0b1220;
}

/* smaller polished health cards */
.score-row {
  gap: 12px;
}

.score {
  min-height: 126px;
  padding: 14px 10px 12px 10px;
  border-radius: 16px;
}

.score strong {
  width: 58px;
  height: 58px;
  margin: 0 0 8px 0;
  font-size: 18px;
  border-width: 4px;
}

.score span {
  font-size: 11px;
  line-height: 1.25;
}

.score-delta {
  margin-top: 8px;
  padding: 4px 8px;
  font-size: 10px;
}

/* ai readiness */
.ai-readiness-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0 4px 0;
}

.ai-readiness-score {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  border: 4px solid #e5e7eb;
  background: #fff;
}

.ai-readiness-score.is-good {
  border-color: rgba(21,164,107,0.7);
  color: var(--good);
}

.ai-readiness-score.is-warn {
  border-color: rgba(201,135,0,0.7);
  color: var(--warn);
}

.ai-readiness-score.is-bad {
  border-color: rgba(217,45,32,0.7);
  color: var(--bad);
}

.ai-readiness-title {
  font-weight: 700;
  margin-bottom: 2px;
}

.checklist-list,
.site-file-list,
.seo-health-list,
.issue-list {
  display: grid;
  gap: 8px;
}

.checklist-item,
.site-file-row,
.seo-health-row,
.issue-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

.checklist-item {
  justify-content: flex-start;
}

.check-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex: 0 0 auto;
}

.check-icon-pass {
  color: #0f766e;
  border: 1px solid rgba(15,118,110,0.35);
  background: rgba(13,148,136,0.08);
}

.check-icon-fail {
  color: #b45309;
  border: 1px solid rgba(180,83,9,0.35);
  background: rgba(245,158,11,0.08);
}

.site-file-missing,
.seo-health-row-fail,
.issue-row-critical {
  background: #fff7f7;
  border-color: #fecaca;
}

.site-file-found,
.seo-health-row-pass {
  background: #f4fcf7;
  border-color: #bbf7d0;
}

.seo-health-row-warn,
.issue-row-warning {
  background: #fffbf2;
  border-color: #fde68a;
}

.issues-summary {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
}

.issues-critical {
  color: var(--bad);
}

.issues-warning {
  color: var(--warn);
}

.issues-pass {
  color: var(--good);
}

/* code copy wrapper */
.code-copy-wrap {
  position: relative;
  margin: 12px 0 16px 0;
}

.code-copy-wrap pre {
  margin: 0 !important;
}

.code-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(15,23,42,0.82);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  z-index: 3;
}

.code-copy-btn.is-copied {
  background: rgba(21,164,107,0.95);
}

body.theme-dark .score,
body.theme-dark .checklist-item,
body.theme-dark .site-file-row,
body.theme-dark .seo-health-row,
body.theme-dark .issue-row {
  background: #111827;
  border-color: rgba(255,255,255,0.08);
  color: #e5e7eb;
}

body.theme-dark .ai-readiness-score {
  background: #0b1220;
}

/* restored interactive health sections */
.seo-health-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.site-file-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}

.site-file-download:hover {
  background: #f8fafc;
}

.audit-table td:last-child {
  text-align: right;
}

.checklist-item {
  justify-content: space-between;
}

.checklist-item span:nth-child(2) {
  flex: 1 1 auto;
}

body.theme-dark .site-file-download {
  background: #111827;
  color: #e5e7eb;
  border-color: rgba(255,255,255,0.08);
}

/* === widgets cleanup overrides for floating score cards === */
.center-col .score-row {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* competitor watchlist: keep name + domain left aligned */
.competitor-watch-top {
  justify-content: flex-start !important;
  align-items: flex-start !important;
  flex-direction: column !important;
}

.competitor-watch-top strong,
.competitor-watch-domain {
  display: block;
  width: 100%;
  text-align: left !important;
  font-size: 12px;
}

.competitor-watch-domain {
  margin-top: 2px;
}

/* =========================================================
   migrated from compat.css - first split pass
   ========================================================= */
.simple-list {
  margin: 0;
  padding-left: 18px;
}

.simple-list li {
  margin: 6px 0;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags a,
.tags span,
.pill,
.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--pill-bg);
  color: var(--pill-text);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  text-decoration: none;
}

.pill-credit {
  background: #eef2ff;
  color: #4338ca;
  border-color: #c7d2fe;
}

.pill-complete {
  background: rgba(100,220,140,0.14);
  color: #166534;
  border-color: rgba(100,220,140,0.35);
}

.priority {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.priority-critical,
.priority-high {
  color: var(--bad);
}

.priority-medium {
  color: var(--warn);
}

.priority-low {
  color: var(--good);
}

.pill-tone-low {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.pill-tone-medium {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.pill-tone-high {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

.pill-tone-critical {
  background: #7f1d1d;
  color: #fff;
  border-color: #ef4444;
}

.priority-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.priority-card {
  text-align: left;
  border-radius: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}

.priority-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.priority-card span {
  font-size: 12px;
  color: var(--muted);
}

.priority-card.priority-high,
.rec-card-high {
  border-left: 4px solid #ef4444;
}

.priority-card.priority-medium,
.rec-card-medium {
  border-left: 4px solid #f59e0b;
}

.priority-card.priority-low,
.rec-card-low {
  border-left: 4px solid #64748b;
}

.priority-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.priority-accordion {
  border: 1px solid var(--line);
  border-left: 4px solid transparent;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.priority-accordion.priority-critical { border-left-color: #ef4444; }

.priority-accordion.priority-high { border-left-color: #f59e0b; }

.priority-accordion.priority-medium { border-left-color: #eab308; }

.priority-accordion.priority-low { border-left-color: #22c55e; }

.priority-accordion summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.priority-accordion summary::-webkit-details-marker {
  display: none;
}

.priority-summary-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.priority-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.priority-dot-critical { background: #ef4444; }

.priority-dot-high { background: #f59e0b; }

.priority-dot-medium { background: #eab308; }

.priority-dot-low { background: #22c55e; }

.priority-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.priority-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.priority-pill-critical {
  background: #fee2e2;
  color: #991b1b;
}

.priority-pill-high {
  background: #fef3c7;
  color: #92400e;
}

.priority-pill-medium {
  background: #fef9c3;
  color: #854d0e;
}

.priority-pill-low {
  background: #dcfce7;
  color: #166534;
}

.priority-body {
  padding: 0 16px 16px 16px;
}

.priority-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.priority-limit-label {
  font-size: 12px;
  color: var(--muted);
}

.priority-limit-select {
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 10px;
}

.core-web-vitals-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.core-web-vital-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px;
}

.core-web-vital-card span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.core-web-vital-card strong {
  font-size: 18px;
}

.geo-issue-card {
  border: 1px solid var(--line);
  border-left: 4px solid #f59e0b;
  border-radius: 12px;
  padding: 14px;
  background: #fff;
  margin-bottom: 10px;
}

.geo-issue-high { border-left-color: #ef4444; }

.geo-issue-medium { border-left-color: #f59e0b; }

.geo-issue-low { border-left-color: #22c55e; }

.geo-issue-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.badge-priority-critical {
  background: #ef4444;
  color: #fff;
}

.badge-priority-high {
  background: #f97316;
  color: #fff;
}

.badge-priority-medium {
  background: #eab308;
  color: #111;
}

.badge-priority-low {
  background: #64748b;
  color: #fff;
}
