/* ── Reset & base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: #f0f2f5;
  color: #222;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Site header ──────────────────────────────────────────────────────── */
.site-header {
  background: #1a2744;
  color: #fff;
  padding: 0 40px;
  display: flex;
  align-items: center;
  height: 60px;
  gap: 16px;
}

.site-header .logo-img {
  height: 32px;
  width: auto;
}

.site-header .divider {
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,.25);
}

.site-header .tool-name {
  font-size: 14px;
  opacity: .8;
}

.header-accent {
  height: 4px;
  background: #d9342e;
}

/* ── Warning banner ──────────────────────────────────────────────────── */
.warning-banner {
  background: #fff3cd;
  border-bottom: 2px solid #f0c040;
  padding: 14px 40px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.warning-banner .warn-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.warning-banner strong {
  display: block;
  font-size: 14px;
  color: #7d5a00;
  margin-bottom: 2px;
}

.warning-banner p {
  font-size: 13px;
  color: #6d4c00;
}

/* ── CS team callout ─────────────────────────────────────────────────── */
.cs-callout {
  background: #eef2ff;
  border-bottom: 1px solid #c7d2fe;
  padding: 10px 40px;
  font-size: 13px;
  color: #3730a3;
}

/* ── Main layout ─────────────────────────────────────────────────────── */
.main {
  max-width: 960px;
  margin: 36px auto;
  padding: 0 24px 80px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: #1a2744;
  margin-bottom: 6px;
}

.page-subtitle {
  color: #666;
  font-size: 14px;
  margin-bottom: 28px;
}

/* ── Tabs ─────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #dde0e6;
  margin-bottom: 28px;
}

.tab-btn {
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  color: #666;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  transition: color .15s, border-color .15s;
}

.tab-btn:hover { color: #1a2744; }

.tab-btn.active {
  color: #1a2744;
  border-bottom-color: #d9342e;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid #dde0e6;
  border-radius: 8px;
  padding: 28px 32px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #1a2744;
}

.card-desc {
  color: #666;
  font-size: 13px;
  margin-bottom: 20px;
}

/* ── URL input ───────────────────────────────────────────────────────── */
.url-row {
  display: flex;
  gap: 10px;
}

.url-input {
  flex: 1;
  height: 42px;
  padding: 0 14px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  outline: none;
  transition: border-color .15s;
}

.url-input:focus { border-color: #1a2744; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  height: 42px;
  padding: 0 22px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity .15s, background .15s;
  white-space: nowrap;
}

.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: #1a2744; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #243558; }

.btn-red { background: #d9342e; color: #fff; }
.btn-red:hover:not(:disabled) { background: #b82b26; }

.btn-outline {
  background: #fff;
  color: #1a2744;
  border: 1px solid #1a2744;
}
.btn-outline:hover:not(:disabled) { background: #f0f2f5; }

.btn-sm { height: 34px; padding: 0 16px; font-size: 13px; }

/* ── File drop zone ──────────────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed #bbc2d0;
  border-radius: 8px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: #fafbfc;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: #1a2744;
  background: #eef0f6;
}

.drop-zone .drop-icon { font-size: 36px; margin-bottom: 10px; }
.drop-zone .drop-label { font-size: 15px; font-weight: 600; color: #444; }
.drop-zone .drop-sub   { font-size: 12px; color: #888; margin-top: 4px; }

#file-input { display: none; }

/* ── URL list (from parsed report) ──────────────────────────────────── */
.url-list-wrapper {
  margin-top: 24px;
}

.url-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.url-list-header h3 { font-size: 14px; font-weight: 700; color: #1a2744; }
.url-count { font-size: 13px; color: #666; }

.url-list {
  border: 1px solid #dde0e6;
  border-radius: 6px;
  max-height: 260px;
  overflow-y: auto;
  background: #fafbfc;
}

.url-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid #eee;
  font-size: 12px;
}

.url-list-item:last-child { border-bottom: none; }

.url-list-item input[type="checkbox"] { flex-shrink: 0; }

.url-list-item .url-text {
  color: #1a5276;
  word-break: break-all;
  flex: 1;
}

.url-list-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ── Progress overlay ────────────────────────────────────────────────── */
.progress-card {
  background: #fff;
  border: 1px solid #dde0e6;
  border-radius: 8px;
  padding: 36px 32px;
  text-align: center;
}

.progress-card .spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #eee;
  border-top-color: #1a2744;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 20px;
}

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

.progress-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: #1a2744;
  margin-bottom: 6px;
}

.progress-label {
  font-size: 13px;
  color: #666;
  margin-bottom: 16px;
  min-height: 20px;
}

.progress-bar-track {
  height: 8px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
  max-width: 400px;
  margin: 0 auto;
}

.progress-bar-fill {
  height: 100%;
  background: #1a2744;
  border-radius: 4px;
  transition: width .4s ease;
  width: 0%;
}

.progress-count {
  font-size: 12px;
  color: #888;
  margin-top: 8px;
}

/* ── Results section ─────────────────────────────────────────────────── */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.results-header h2 { font-size: 18px; font-weight: 700; color: #1a2744; }

.results-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.download-beta-note {
  font-size: 12px;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 4px;
  padding: 3px 8px;
}

.summary-pills {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.pill {
  background: #fff;
  border: 1px solid #dde0e6;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pill-value { font-weight: 700; font-size: 18px; color: #1a2744; }
.pill-value.red { color: #c7221f; }

/* ── Inline violation preview ─────────────────────────────────────────── */
.violation-group {
  background: #fff;
  border: 1px solid #dde0e6;
  border-radius: 6px;
  margin-bottom: 10px;
  overflow: hidden;
}

.vg-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #f7f8fa;
  cursor: pointer;
  user-select: none;
}

.vg-header:hover { background: #eef0f4; }
.vg-header.closed .vg-chevron { transform: rotate(-90deg); }
.vg-body.hidden { display: none; }

.vg-name { flex: 1; font-weight: 700; font-size: 13px; }
.vg-chevron { font-size: 11px; color: #888; transition: transform .15s; }

.badge {
  display: inline-block;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 2px 8px;
  border-radius: 3px;
}

.vg-instance {
  border-top: 1px solid #eee;
  padding: 14px 16px;
  font-size: 12px;
}

.vg-url { color: #1a5276; word-break: break-all; margin-bottom: 6px; }
.vg-element { background: #f4f5f7; padding: 4px 8px; border-radius: 4px;
              font-family: monospace; font-size: 11px; word-break: break-all;
              white-space: pre-wrap; max-height: 60px; overflow: auto; }

/* ── Utility ─────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.mt-16 { margin-top: 16px; }

.error-msg {
  background: #fff8f8;
  border: 1px solid #f5c0c0;
  border-radius: 6px;
  padding: 14px 18px;
  color: #c7221f;
  font-size: 13px;
  margin-top: 14px;
}
