/* ====================================================
   AIA — Premium Competitive Intelligence
   Design System
   ==================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #f4f5f7;
  --surface:      #ffffff;
  --surface-2:    #f8f9fb;
  --border:       #e5e7eb;
  --border-soft:  #edeef0;

  --accent:       #5b5ef4;
  --accent-hover: #4a4dd8;
  --accent-light: #eef0ff;
  --accent-dim:   #c7c8fc;

  --text:         #111827;
  --text-body:    #374151;
  --text-muted:   #6b7280;
  --text-xmuted:  #9ca3af;

  --green:        #15803d;
  --green-bg:     #dcfce7;
  --amber:        #b45309;
  --amber-bg:     #fef3c7;
  --gray-score:   #4b5563;
  --gray-score-bg:#f1f3f5;
  --red:          #dc2626;
  --red-bg:       #fee2e2;

  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 2px 12px rgba(0,0,0,0.07);
  --shadow-hover: 0 6px 24px rgba(0,0,0,0.11);

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
}

html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   SKELETON SHIMMER
   ============================================================ */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

.skeleton {
  background: linear-gradient(90deg, #ebebeb 25%, #f5f5f5 50%, #ebebeb 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}

.skeleton-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 26px;
  margin-bottom: 14px;
  overflow: hidden;
}
.skeleton-card .sk-line { height: 12px; margin-bottom: 10px; }
.skeleton-card .sk-line.short  { width: 30%; }
.skeleton-card .sk-line.medium { width: 60%; }
.skeleton-card .sk-line.long   { width: 90%; }
.skeleton-card .sk-line.full   { width: 100%; }
.skeleton-card .sk-head        { height: 20px; width: 75%; margin-bottom: 14px; }
.skeleton-card .sk-score       { height: 56px; width: 72px; border-radius: 10px; float: right; margin-left: 16px; }

/* ============================================================
   PULSE DOT (logo)
   ============================================================ */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.35; transform: scale(0.7); }
}

/* ============================================================
   AUTH SCREEN
   ============================================================ */
.auth-container {
  max-width: 420px;
  margin: 0 auto;
  padding: 60px 28px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.logo {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.logo-dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2.2s ease-in-out infinite;
  flex-shrink: 0;
}

.tagline {
  color: var(--text-muted);
  margin: 14px 0 40px;
  font-size: 16px;
  line-height: 1.6;
}

/* Auth tabs */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  border-bottom: 2px solid var(--border);
}
.tab {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 10px 18px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Form elements */
.form-group { margin-bottom: 14px; }

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 11px 14px;
  font-size: 15px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
input::placeholder { color: var(--text-xmuted); }

.error-msg { color: var(--red); font-size: 13px; margin: 6px 0 4px; min-height: 16px; }

.btn-primary {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 15px;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover  { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.99); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

/* ============================================================
   DASHBOARD SHELL
   ============================================================ */
.screen { height: 100vh; overflow: hidden; }

/* ---- HEADER ---- */
.header {
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  align-items: center;
  height: 60px;
  padding: 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--border-soft);
}

.header-left  { display: flex; align-items: center; }
.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

/* Center nav */
.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  margin: 0 auto;
  width: fit-content;
}
.nav-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 5px 18px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}
.nav-tab:hover  { color: var(--text); }
.nav-tab.active { color: #fff; background: var(--accent); font-weight: 600; }

.user-email {
  color: var(--text-muted);
  font-size: 13px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-ghost {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 5px 14px;
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }

/* ============================================================
   LAYOUT
   ============================================================ */
.main { height: calc(100vh - 60px); overflow: hidden; }
.tab-content { height: 100%; overflow: hidden; }

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100%;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border-soft);
  padding: 24px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-header h2 {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.badge {
  background: var(--surface-2);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border);
}

/* Add URL row */
.url-input-full {
  width: 100%;
  font-size: 13px;
  padding: 10px 12px;
  margin-bottom: 8px;
  box-sizing: border-box;
}

.btn-watch {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  margin-bottom: 4px;
  letter-spacing: 0.01em;
}
.btn-watch:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99,102,241,.35);
}
.btn-watch:disabled { opacity: 0.45; cursor: not-allowed; }

/* Watch items */
.watch-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 13px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
  background: var(--surface);
  border: 1.5px solid var(--border-soft);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.watch-item:hover  { border-color: var(--accent-dim); box-shadow: var(--shadow); }
.watch-item.active { border-color: var(--accent); background: var(--accent-light); }

.watch-item-left {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.watch-favicon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  margin-top: 2px;
}

.watch-item-info { min-width: 0; flex: 1; }
.watch-item-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.watch-item-url {
  font-size: 11px;
  color: var(--text-xmuted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.watch-item-status {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Status dots */
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.status-dot.gray   { background: #d1d5db; }
.status-dot.yellow { background: #f59e0b; }
.status-dot.green  { background: #22c55e; }

.watch-item-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding-top: 1px;
}

.btn-delete {
  background: none;
  border: none;
  color: var(--text-xmuted);
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 5px;
  font-size: 16px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.btn-delete:hover { color: var(--red); background: var(--red-bg); }

/* ============================================================
   FEED AREA
   ============================================================ */
.feed {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

.monitored-pages-bar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 32px 12px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-subtle);
  flex-wrap: wrap;
}
.monitored-pages-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
  padding-top: 2px;
  flex-shrink: 0;
}
.monitored-pages-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.monitored-page-pill {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 8px;
  border-radius: 20px;
  cursor: default;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px 16px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
  background: var(--surface);
}
.feed-header h2 { font-size: 15px; font-weight: 700; color: var(--text); }

.feed-tabs { display: flex; gap: 6px; }
.feed-tab {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
}
.feed-tab:hover  { border-color: var(--accent-dim); color: var(--accent); }
.feed-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

#insights-container {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
}

/* Feed inner width constraint */
.feed-inner {
  max-width: 780px;
  margin: 0 auto;
}

/* ---- ASSESS CTA BUTTON ---- */
.assess-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-top: 8px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.assess-cta.new {
  border-style: dashed;
  background: var(--surface-2);
}
.assess-cta-text {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}
.assess-cta-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.btn-assess-cta {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
}
.btn-assess-cta:hover { border-color: var(--accent); color: var(--accent); }
.btn-assess-cta.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-assess-cta.accent:hover { background: var(--accent-hover); }

/* ============================================================
   INSIGHT CARDS
   ============================================================ */
.insight-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0;
  margin-bottom: 16px;
  overflow: hidden;
  border-left: 4px solid var(--border);
  transition: box-shadow 0.18s, transform 0.18s;
  position: relative;
}
.insight-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}
.insight-card.score-high { border-left-color: #22c55e; }
.insight-card.score-mid  { border-left-color: #f59e0b; }
.insight-card.score-low  { border-left-color: #d1d5db; }

.insight-card-inner {
  padding: 22px 26px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.insight-card-body { flex: 1; min-width: 0; }

/* Score badge — large prominent number */
.score-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  width: 68px;
  min-height: 68px;
  flex-shrink: 0;
  padding: 8px 6px;
}
.score-pill.score-high { background: var(--green-bg); }
.score-pill.score-mid  { background: var(--amber-bg); }
.score-pill.score-low  { background: var(--gray-score-bg); }

.score-pill .score-num {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  display: block;
}
.score-pill.score-high .score-num { color: var(--green); }
.score-pill.score-mid  .score-num { color: var(--amber); }
.score-pill.score-low  .score-num { color: var(--gray-score); }

.score-pill .score-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}
.score-pill.score-high .score-label { color: var(--green); }
.score-pill.score-mid  .score-label { color: var(--amber); }
.score-pill.score-low  .score-label { color: var(--gray-score); }

/* Card meta row */
.insight-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.insight-source-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.insight-date {
  font-size: 12px;
  color: var(--text-xmuted);
}
.insight-sep { color: var(--border); font-size: 12px; }

/* Headline */
.insight-headline {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

/* Body text */
.insight-analysis {
  color: var(--text-body);
  font-size: 15px;
  line-height: 1.75;
  margin-bottom: 14px;
}

/* Footer row */
.insight-footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 11px 26px 13px;
  border-top: 1px solid var(--border-soft);
  background: var(--surface-2);
}
.btn-toggle-details {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
}
.btn-toggle-details:hover { color: var(--accent-hover); }

/* Changes block */
.insight-changes {
  background: var(--surface-2);
  border-top: 1px solid var(--border-soft);
  padding: 16px 26px;
  font-size: 13px;
  color: var(--text-muted);
  white-space: pre-wrap;
  max-height: 160px;
  overflow-y: auto;
  line-height: 1.65;
  display: none;
}

/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 72px 24px;
  color: var(--text-muted);
}
.empty-state .empty-emoji {
  font-size: 40px;
  display: block;
  margin-bottom: 14px;
  line-height: 1;
}
.empty-state .empty-heading {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.empty-state .empty-sub {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 340px;
  margin: 0 auto;
}
.empty-state.small {
  padding: 28px 8px 8px;
}
.empty-state.small .empty-emoji { font-size: 26px; margin-bottom: 8px; }
.empty-state.small .empty-heading { font-size: 14px; font-weight: 600; }
.empty-state.small .empty-sub { font-size: 12px; }

/* Legacy fallback */
.loading {
  color: var(--text-muted);
  text-align: center;
  padding: 60px 0;
  font-size: 15px;
}

/* ---- ANALYZE LOADING STATE ---- */
.analyze-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 56px 32px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.analyze-loading-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 24px;
}

.analyze-loading-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.analyze-loading-sub {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 360px;
  line-height: 1.6;
}

/* ============================================================
   ANALYZE TAB
   ============================================================ */
.analyze-layout {
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 36px 48px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.analyze-header,
#assess-panel,
#compare-panel {
  width: 100%;
  max-width: 780px;
}

.analyze-header { margin-bottom: 32px; }

.analyze-modes { display: flex; gap: 12px; }

.analyze-mode {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  cursor: pointer;
  min-width: 180px;
  gap: 2px;
  box-shadow: var(--shadow);
  transition: all 0.15s;
}
.analyze-mode:hover  { border-color: var(--accent-dim); box-shadow: var(--shadow-hover); }
.analyze-mode.active { border-color: var(--accent); background: var(--accent-light); }
.mode-icon { font-size: 20px; margin-bottom: 4px; }
.analyze-mode > :nth-child(2) { font-size: 15px; font-weight: 700; color: var(--text); }
.mode-desc { font-size: 12px; color: var(--text-muted); }

.analyze-form {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}
.analyze-form input, .compare-form input,
.analyze-form select, .compare-form select { flex: 1; }

select {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 11px 14px;
  font-size: 15px;
  font-family: var(--font);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.vs-label {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}
.btn-analyze { width: auto; padding: 11px 28px; margin-top: 0; white-space: nowrap; }

.history-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 36px 0 16px;
  font-weight: 700;
}

/* ============================================================
   ASSESSMENT CARD
   ============================================================ */
.assess-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  max-width: 860px;
}

.assess-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.assess-site {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.assess-headline {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.3px;
}

/* Large score in assess card */
.score-pill-lg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  width: 80px;
  min-height: 80px;
  flex-shrink: 0;
  padding: 10px 8px;
}
.score-pill-lg.score-high { background: var(--green-bg); }
.score-pill-lg.score-mid  { background: var(--amber-bg); }
.score-pill-lg.score-low  { background: var(--gray-score-bg); }

.score-pill-lg .score-num {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  display: block;
}
.score-pill-lg.score-high .score-num { color: var(--green); }
.score-pill-lg.score-mid  .score-num { color: var(--amber); }
.score-pill-lg.score-low  .score-num { color: var(--gray-score); }

.score-pill-lg .score-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 3px;
}
.score-pill-lg.score-high .score-label { color: var(--green); }
.score-pill-lg.score-mid  .score-label { color: var(--amber); }
.score-pill-lg.score-low  .score-label { color: var(--gray-score); }

.assess-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.assess-wide { grid-column: span 2; }

.assess-field {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  border: 1px solid var(--border-soft);
}
.field-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  margin-bottom: 5px;
  font-weight: 700;
}
.field-label.green { color: var(--green); }
.field-label.red   { color: var(--red); }
.field-label.amber { color: var(--amber); }
.field-label.yellow { color: var(--amber); }
.field-value { font-size: 14px; color: var(--text-body); line-height: 1.65; }

.assess-lists {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.assess-list {
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  border: 1px solid var(--border-soft);
}
.assess-list.list-green { background: var(--green-bg); border-color: #bbf7d0; }
.assess-list.list-red   { background: #fff1f2; border-color: #fecdd3; }
.assess-list.list-amber { background: var(--amber-bg); border-color: #fde68a; }

.assess-list ul { list-style: none; margin-top: 6px; }
.assess-list li {
  font-size: 14px;
  color: var(--text-body);
  padding: 4px 0;
  line-height: 1.5;
  padding-left: 16px;
  position: relative;
}
.assess-list.list-green li::before { content: '✓'; position: absolute; left: 0; color: var(--green); font-size: 12px; top: 5px; }
.assess-list.list-red   li::before { content: '✕'; position: absolute; left: 0; color: var(--red); font-size: 11px; top: 5px; }
.assess-list.list-amber li::before { content: '→'; position: absolute; left: 0; color: var(--amber); font-size: 12px; top: 5px; }

.assess-time {
  font-size: 12px;
  color: var(--text-xmuted);
  text-align: right;
  margin-top: 8px;
}

/* ============================================================
   COMPARISON CARD
   ============================================================ */
.compare-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  max-width: 860px;
}

.compare-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.compare-headline {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.3px;
  flex: 1;
}

.winner-badge {
  background: var(--accent-light);
  color: var(--accent);
  border: 1.5px solid var(--accent-dim);
  border-radius: 999px;
  padding: 5px 16px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.winner-badge.tie {
  background: var(--surface-2);
  color: var(--text-muted);
  border-color: var(--border);
}

.compare-sites {
  display: grid;
  grid-template-columns: 1fr 52px 1fr;
  gap: 0;
  margin-bottom: 22px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
}

.compare-site {
  background: var(--surface-2);
  padding: 18px 20px;
}
.compare-site.is-winner {
  background: var(--accent-light);
}

.compare-site-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.compare-site-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.compare-winner-tag {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 999px;
}
.compare-site-url {
  font-size: 11px;
  color: var(--text-xmuted);
  margin-bottom: 10px;
}
.compare-summary { font-size: 14px; color: var(--text-body); line-height: 1.65; }

.compare-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-left: 1px solid var(--border-soft);
  border-right: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.5px;
}

/* Dimensions table */
.dims {
  margin-bottom: 20px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.dims-header {
  padding: 10px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.dim-row {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
  transition: background 0.1s;
}
.dim-row:last-child { border-bottom: none; }
.dim-row:hover { background: var(--surface-2); }

.dim-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
}

.dim-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.dim-winner-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  background: var(--green-bg);
  color: var(--green);
}
.dim-winner-badge.tie {
  background: var(--surface-2);
  color: var(--text-muted);
}

.dim-exp {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Strategic insight box */
.strategic-insight {
  background: linear-gradient(135deg, var(--accent-light) 0%, #f0f0ff 100%);
  border: 1.5px solid var(--accent-dim);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-bottom: 12px;
}
.strategic-insight .field-label {
  color: var(--accent);
  margin-bottom: 6px;
}
.strategic-insight p {
  font-size: 15px;
  color: var(--text-body);
  line-height: 1.75;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .analyze-layout { padding: 28px 32px; }
}

@media (max-width: 768px) {
  .header { grid-template-columns: auto 1fr auto; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--border-soft); max-height: 240px; }
  .assess-grid  { grid-template-columns: 1fr; }
  .assess-wide  { grid-column: span 1; }
  .assess-lists { grid-template-columns: 1fr; }
  .compare-sites { grid-template-columns: 1fr; }
  .compare-vs { display: none; }
  .analyze-modes  { flex-direction: column; }
  .analyze-layout { padding: 20px 16px; }
  #insights-container { padding: 18px 16px; }
  .insight-headline { font-size: 18px; }
  .score-pill { width: 58px; min-height: 58px; }
  .score-pill .score-num { font-size: 26px; }
}
