/* =============================================================================
   UI Compare — public/styles.css
   All presentation styles. No inline styles or style="" attributes in HTML.
   ============================================================================= */

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

body {
  font-family: 'Inter', sans-serif;
  background: #f4f6f9;
  color: #1a1a2e;
  font-size: 14px;
}

/* =============================================================================
   Nav
   ============================================================================= */

nav {
  background: #fff;
  border-bottom: 1px solid #e8e8f0;
  padding: 0 40px;
  height: 56px;
  display: flex;
  align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #7034FF, #4a00e0);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-logo-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
}

.nav-logo-text {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a2e;
}

.nav-badge {
  font-size: 11px;
  background: #f0ebff;
  color: #7034FF;
  padding: 3px 8px;
  border-radius: 99px;
  font-weight: 600;
  margin-left: 4px;
}

.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
  color: #7034FF;
}

/* =============================================================================
   Hero
   ============================================================================= */

.hero {
  background: linear-gradient(135deg, #7034FF 0%, #4a00e0 100%);
  /* Bottom padding stays deeper than the top: .input-card-wrap pulls itself
     up 44px into the hero, so the two only look balanced once that's absorbed. */
  padding: 44px 40px 72px;
  text-align: center;
}

.hero-eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255, 255, 255, .7);
  margin-bottom: 14px;
}

.hero h1 {
  font-size: 38px;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
}

.hero h1 span {
  color: #c4a0ff;
}

.hero-sub {
  font-size: 16px;
  color: rgba(255, 255, 255, .8);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.6;
}

/* =============================================================================
   Input card
   ============================================================================= */

.input-card-wrap {
  max-width: 100%;
  margin: 40px 0 0;
  padding: 0 32px;
  position: relative;
  z-index: 10;
}

/* Page title, now inside the card rather than in a banner above it. */
.card-title {
  font-size: 26px;
  font-weight: 800;
  color: #1a1a2e;
  line-height: 1.2;
  margin-bottom: 16px;
}
.card-title span {
  color: #7034FF;
}

/* Visually hidden but still read by screen readers — the textarea's visible
   instructions live in its placeholder, which isn't a substitute for a label. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.input-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(112, 52, 255, .18), 0 2px 8px rgba(0, 0, 0, .06);
  overflow: hidden;
}

.panel-body {
  padding: 20px 24px;
}

/* =============================================================================
   Fields
   ============================================================================= */

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
}

.label-hint {
  font-weight: 400;
  color: #c0c8d8;
}

.spacer-sm {
  height: 10px;
}

input[type=url],
input[type=text],
input[type=number],
input[type=password],
textarea,
select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: #1a1a2e;
  outline: none;
  transition: border-color .15s;
  background: #fff;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

input[type=url]:focus,
input[type=text]:focus,
input[type=number]:focus,
input[type=password]:focus,
textarea:focus,
select:focus {
  border-color: #7034FF;
  box-shadow: 0 0 0 3px rgba(112, 52, 255, .1);
}

.field-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.field-row > div {
  flex: 1;
  min-width: 180px;
}

.field-col-narrow {
  flex: 0;
  min-width: auto;
}

.input-narrow {
  width: 80px;
  padding: 11px 10px;
}

/* =============================================================================
   Compare sub-mode tabs
   ============================================================================= */

.cmodes {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.cmode-btn {
  padding: 6px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  background: #fff;
  font-family: 'Inter', sans-serif;
  transition: all .15s;
}

.cmode-btn:hover {
  border-color: #b39dff;
  color: #7034FF;
}

.cmode-btn.active {
  border-color: #7034FF;
  background: #f5f0ff;
  color: #7034FF;
}

.cpanel {
  display: none;
}

.cpanel.active {
  display: block;
}

/* Mockup mode: Image vs Figma sub-toggle — visually mirrors .cmodes/.cmode-btn
   but uses its own classes so it doesn't get picked up by the top-level cmode click handler. */
.subtoggle {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.subtoggle-btn {
  padding: 6px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  background: #fff;
  font-family: 'Inter', sans-serif;
  transition: all .15s;
}

.subtoggle-btn:hover {
  border-color: #b39dff;
  color: #7034FF;
}

.subtoggle-btn.active {
  border-color: #7034FF;
  background: #f5f0ff;
  color: #7034FF;
}

.subpanel {
  display: none;
}

.subpanel.active {
  display: block;
}

.tc-panel-body {
  padding: 12px 14px;
}

/* Password / token fields with a show-hide eye toggle */
.pw-wrap {
  position: relative;
}

.pw-wrap input[type=password],
.pw-wrap input[type=text] {
  padding-right: 42px;
}

.pw-toggle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 0;
}

.pw-toggle:hover {
  color: #7034FF;
}

.pw-toggle .pw-eye-off {
  display: none;
}

.pw-toggle.showing .pw-eye {
  display: none;
}

.pw-toggle.showing .pw-eye-off {
  display: block;
}

#mockupImageInput {
  display: none;
}

#mockupChosenFile {
  display: none;
}

#mockupChosenFile.visible {
  display: block;
}

/* =============================================================================
   Drop zone (CSV / Excel upload)
   ============================================================================= */

.drop-zone {
  border: 2px dashed #d1c4f5;
  border-radius: 10px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: #faf8ff;
}

.drop-zone:hover,
.drop-zone.over {
  border-color: #7034FF;
  background: #f5f0ff;
}

.drop-zone svg {
  margin-bottom: 8px;
  opacity: .5;
}

.drop-zone p {
  font-size: 13px;
  color: #94a3b8;
}

.drop-zone p u {
  color: #7034FF;
}

.drop-zone .chosen {
  font-size: 13px;
  font-weight: 600;
  color: #7034FF;
  margin-top: 6px;
}

.drop-hint {
  font-size: 11px;
  margin-top: 5px;
  color: #a78bfa;
}

#compareChosenFile {
  display: none;
}

#compareChosenFile.visible {
  display: block;
}

#compareCsvInput {
  display: none;
}

/* =============================================================================
   Test coverage toggle
   ============================================================================= */

.tc-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #7034FF;
  font-family: 'Inter', sans-serif;
  padding: 0;
  margin-top: 14px;
}

#tcArrow {
  transition: transform .2s;
}

#tcArrow.rotated {
  transform: rotate(90deg);
}

.tc-panel {
  display: none;
  margin-top: 10px;
  border: 1px solid #e8e8f0;
  border-radius: 10px;
  overflow: hidden;
  font-size: 12px;
}

.tc-panel.open {
  display: block;
}

.tc-table {
  width: 100%;
  border-collapse: collapse;
}

.tc-table thead tr {
  background: #f8f5ff;
}

.tc-table th {
  padding: 8px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6d28d9;
  border-bottom: 1px solid #e8e8f0;
}

.tc-table td {
  padding: 7px 12px;
  border-bottom: 1px solid #f4f5f8;
}

.tc-table td:first-child {
  font-weight: 600;
}

.tc-table td:last-child {
  color: #475569;
}

.tc-table tr.alt {
  background: #fafafa;
}

.tc-table tbody tr:last-child td {
  border-bottom: none;
}

.tc-footer {
  background: #f8f5ff;
  padding: 10px 12px;
  border-top: 1px solid #e8e8f0;
}

.tc-footer-heading {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6d28d9;
  margin-bottom: 6px;
}

.tc-footer-text {
  font-size: 11px;
  color: #64748b;
  line-height: 1.6;
}

/* =============================================================================
   Options section (browsers + devices)
   ============================================================================= */

.options-section {
  padding: 0 24px 20px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.opt-group {
  flex: 1;
  min-width: 200px;
}

.opt-group-fixed {
  flex: 0 0 auto;
}

.opt-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
}

.opt-label-inline {
  margin-bottom: 0;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 99px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  transition: all .15s;
  user-select: none;
  background: #fff;
}

.pill:hover {
  border-color: #b39dff;
  color: #7034FF;
}

.pill.on {
  border-color: #7034FF;
  background: #f5f0ff;
  color: #7034FF;
  font-weight: 600;
}

.pill svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* =============================================================================
   Device list
   ============================================================================= */

.dev-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.dev-limit-hint {
  font-size: 11px;
  color: #94a3b8;
  margin-left: auto;
}

.dev-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 4px 6px;
}

.dev-group-hd {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 6px 2px 2px;
  margin-top: 2px;
}

.dev-group-hd:first-child {
  padding-top: 0;
  margin-top: 0;
}

.dev-item {
  display: inline-flex;
  align-items: center;
  padding: 6px 13px;
  border: 1.5px solid #e2e8f0;
  border-radius: 99px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  background: #fff;
  transition: all .15s;
  user-select: none;
  white-space: nowrap;
}

.dev-item:hover:not(.dev-disabled) {
  border-color: #b39dff;
  color: #7034FF;
  background: #faf7ff;
}

.dev-item.dev-checked {
  border-color: #7034FF;
  background: #f5f0ff;
  color: #7034FF;
  font-weight: 600;
}

.dev-item.dev-disabled {
  opacity: .35;
  cursor: not-allowed;
  pointer-events: none;
}

/* Extra devices are hidden by default; shown when .show-extras is on .dev-list */
.dev-extra {
  display: none;
}

.dev-list.show-extras .dev-group-hd.dev-extra {
  display: flex;
}

.dev-list.show-extras .dev-item.dev-extra {
  display: inline-flex;
}

.dev-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #7034FF;
  background: #f0ebff;
  padding: 1px 7px;
  border-radius: 99px;
}

.dev-footer {
  padding: 6px 14px;
  font-size: 11px;
  color: #f59e0b;
  background: #fffbeb;
  border-top: 1px solid #fef3c7;
  display: none;
}

.dev-footer.show {
  display: block;
}

.dev-custom-row {
  display: none;
  padding: 10px 4px 4px;
}

.dev-custom-row.show {
  display: block;
}

.dev-more-btn {
  padding: 6px 13px;
  border: 1.5px dashed #c4b5fd;
  border-radius: 99px;
  background: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: #7034FF;
  font-family: 'Inter', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all .15s;
  white-space: nowrap;
}

.dev-more-btn:hover {
  background: #f5f0ff;
  border-color: #7034FF;
}

#devMoreArrow {
  transition: transform .2s;
}

#devMoreArrow.rotated {
  transform: rotate(180deg);
}

/* =============================================================================
   Run button
   ============================================================================= */

.run-wrap {
  padding: 0 24px 24px;
}

.run-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #7034FF, #4a00e0);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity .15s;
  letter-spacing: .2px;
}

.run-btn:hover {
  opacity: .92;
}

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

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

.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

.run-spinner {
  display: none;
}

/* =============================================================================
   Page body
   ============================================================================= */

.page-body {
  max-width: 100%;
  margin: 40px 0;
  padding: 0 32px 60px;
}

/* =============================================================================
   Progress card
   ============================================================================= */

#progressCard {
  display: none;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .08);
  padding: 28px 28px 24px;
  margin-bottom: 20px;
}

.prog-title {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
}

.prog-sub {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 20px;
}

.prog-bar-wrap {
  background: #f1f5f9;
  border-radius: 99px;
  height: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}

.prog-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #7034FF, #a855f7);
  transition: width .4s ease;
  width: 0%;
}

.prog-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #94a3b8;
}

.prog-step {
  max-width: 82%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prog-pct {
  font-weight: 700;
  color: #7034FF;
}

/* =============================================================================
   Live preview
   ============================================================================= */

#liveCard {
  margin-top: 18px;
  border: 1.5px solid #e8e8f0;
  border-radius: 12px;
  overflow: hidden;
  display: none;
}

.live-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e8e8f0;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
  animation: livePulse 1s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .4; transform: scale(.85); }
}

.live-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  color: #ef4444;
  text-transform: uppercase;
}

.live-action {
  flex: 1;
  font-size: 12px;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-img-wrap {
  background: #0f172a;
  line-height: 0;
  max-height: 520px;
  overflow-y: auto;
}

#liveImg {
  width: 100%;
  display: block;
  transition: opacity .2s;
}

/* =============================================================================
   Compare result card
   ============================================================================= */

#compareResultCard {
  display: none;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .08);
  overflow: hidden;
  margin-bottom: 20px;
}

.result-header {
  background: linear-gradient(135deg, #7034FF, #4a00e0);
  padding: 20px 24px;
  color: #fff;
}

.result-header h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
}

.result-header p {
  font-size: 12px;
  opacity: .75;
}

.result-stats {
  display: flex;
  gap: 1px;
  background: #e2e8f0;
}

.rstat {
  flex: 1;
  background: #fff;
  padding: 16px;
  text-align: center;
}

.rstat .rn {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}

.rstat .rl {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
  margin-top: 4px;
}

.rstat.pass .rn { color: #00b894; }
.rstat.fail .rn { color: #d63031; }
.rstat.warn .rn { color: #e17055; }
.rstat.critical .rn { color: #dc2626; }
.rstat.high .rn { color: #d97706; }
.rstat.medium .rn { color: #ca8a04; }
.rstat.low .rn { color: #16a34a; }

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

.btn-secondary {
  flex: 1;
  min-width: 100px;
  text-align: center;
  padding: 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: #4a00e0;
  background: #f5f3ff;
  border: 1.5px solid #ede9fe;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
}

.btn-secondary:hover { background: #ede9fe; }

.result-footer {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-report {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #7034FF, #4a00e0);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  transition: opacity .15s;
}

.btn-report:hover {
  opacity: .9;
}

.btn-again {
  width: 100%;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}

.btn-again:hover {
  background: #f1f5f9;
}

/* =============================================================================
   Error card
   ============================================================================= */

#errorCard {
  display: none;
  background: #fff;
  border-left: 4px solid #d63031;
  border-radius: 0 12px 12px 0;
  padding: 16px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
  margin-bottom: 20px;
}

#errorCard p {
  font-size: 13px;
  color: #d63031;
}

#errorCard button {
  margin-top: 8px;
  font-size: 12px;
  color: #7034FF;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  padding: 0;
}

/* =============================================================================
   API Docs (docs.html)
   ============================================================================= */

.docs-body {
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.docs-intro {
  background: #fff;
  border: 1px solid #e8e8f0;
  border-radius: 14px;
  padding: 24px 28px;
  margin-bottom: 28px;
}

.docs-intro h2 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
}

.docs-intro p {
  font-size: 13px;
  color: #475569;
  line-height: 1.7;
}

.docs-intro code,
.docs-body code {
  background: #f0ebff;
  color: #6d28d9;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 12px;
  font-family: 'SF Mono', 'Menlo', monospace;
}

.docs-kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  row-gap: 6px;
  font-size: 13px;
  margin-top: 14px;
}

.docs-kv dt {
  color: #94a3b8;
  font-weight: 600;
}

.docs-kv dd {
  color: #1a1a2e;
}

.api-endpoint {
  background: #fff;
  border: 1px solid #e8e8f0;
  border-radius: 14px;
  margin-bottom: 24px;
  overflow: hidden;
}

.api-endpoint-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid #f4f5f8;
}

.api-method {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  padding: 4px 9px;
  border-radius: 6px;
  color: #fff;
}

.api-method.get  { background: #00b894; }
.api-method.post { background: #7034FF; }

.api-path {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a2e;
}

.api-summary {
  margin-left: auto;
  font-size: 12px;
  color: #94a3b8;
}

.api-endpoint-body {
  padding: 18px 20px 20px;
}

.api-endpoint-body p.api-desc {
  font-size: 13px;
  color: #475569;
  line-height: 1.7;
  margin-bottom: 14px;
}

.api-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6d28d9;
  margin: 16px 0 8px;
}

.api-section-title:first-child {
  margin-top: 0;
}

.docs-body pre {
  background: #1a1a2e;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 12px;
  font-family: 'SF Mono', 'Menlo', monospace;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}

.docs-body pre .cm { color: #64748b; }

.api-badge-req {
  font-size: 10px;
  font-weight: 700;
  color: #d63031;
  margin-left: 6px;
}

/* === Cloudflare clearance popup (live CDP screencast + click-through) === */
.cf-popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, .55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.cf-popup-overlay.active {
  display: flex;
}

.cf-popup {
  width: min(800px, 92vw);
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .25);
}

.cf-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #1a1a2e;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
}

.cf-popup-header span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}

.cf-popup-close {
  flex: none;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 4px;
}

.cf-popup-close:hover {
  color: #b39dff;
}

.cf-popup-body {
  position: relative;
  background: #0f172a;
  max-height: 80vh;
}

.cf-popup-frame {
  display: block;
  width: 100%;
  aspect-ratio: 1366 / 900;
  max-height: 80vh;
  object-fit: contain;
  cursor: pointer;
}

.cf-popup-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  pointer-events: none;
}

.cf-popup-loading.hidden {
  display: none;
}

.cf-popup-hint {
  margin: 0;
  padding: 8px 14px;
  font-size: 12px;
  color: #64748b;
  font-family: 'Inter', sans-serif;
  background: #f4f6f9;
}

/* === Inline field validation (replaces alert() popups) === */
input.field-error,
input.field-error:focus,
textarea.field-error,
textarea.field-error:focus,
select.field-error,
select.field-error:focus,
.drop-zone.field-error {
  border-color: #d63031;
  box-shadow: 0 0 0 3px rgba(214, 48, 49, .1);
}

.field-error-group {
  border: 1.5px solid #d63031;
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 0 0 3px rgba(214, 48, 49, .1);
}

.field-error-msg {
  margin-top: 6px;
  font-size: 12px;
  color: #d63031;
  font-family: 'Inter', sans-serif;
}

/* Cloudflare-clearance status line — success/error read distinctly instead of
   blending into the plain gray .label-hint instructional text. */
.cf-status-success {
  color: #16a34a;
  font-weight: 600;
}

.cf-status-error {
  color: #d63031;
  font-weight: 600;
}

/* =============================================================================
   Dashboard — the on-page summary shown as soon as an audit finishes.
   Just the headline numbers; the category breakdown, action plan and findings
   table all live in the gated report instead.
   ============================================================================= */
#dashboard { display: none; margin-bottom: 20px; }

.summary-card {
  background: #fff;
  border: 1px solid #eceef2;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .06);
  padding: 22px 26px;
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
}
.sum-left { display: flex; align-items: center; gap: 22px; flex: 1; min-width: 330px; }
.donut { flex-shrink: 0; }
.dn-n { font-size: 31px; font-weight: 800; fill: #6d3bf5; font-family: 'Inter', sans-serif; }
.dn-p { font-size: 16px; }
.dn-l { font-size: 8.5px; font-weight: 700; fill: #9b93b8; letter-spacing: .08em; font-family: 'Inter', sans-serif; }
.sum-txt { flex: 1; min-width: 180px; }
.sum-txt p { font-size: 14px; color: #334155; line-height: 1.55; }
.sum-txt strong { color: #1a1a2e; font-weight: 700; }
.sum-sub { color: #64748b; font-size: 13px; margin: 4px 0 12px; }
.mtr { width: 100%; background: #edf0f5; border-radius: 99px; overflow: hidden; }
.mtr-fl { height: 100%; border-radius: 99px; background: #6d3bf5; min-width: 2px; transition: width .5s ease; }

/* Severity tiles: number, label, icon and a plain-language line, so each tile
   still reads correctly without its colour. */
.sev-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; flex-shrink: 0; }
.sv {
  background: #fff;
  border: 1px solid #eceef2;
  border-radius: 11px;
  padding: 12px 10px;
  text-align: center;
  min-width: 104px;
}
.sv-n { font-size: 27px; font-weight: 800; line-height: 1.1; }
.sv-l { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #94a3b8; margin-top: 1px; }
.sv-i { font-size: 14px; margin: 7px 0 3px; line-height: 1; }
.sv-note { font-size: 10.5px; color: #94a3b8; line-height: 1.35; }
.sv-critical .sv-n, .sv-critical .sv-i { color: #dc2626; }
.sv-high     .sv-n, .sv-high     .sv-i { color: #ea7317; }
.sv-medium   .sv-n, .sv-medium   .sv-i { color: #d9a300; }
.sv-low      .sv-n, .sv-low      .sv-i { color: #16a34a; }

.dash-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.dash-actions .btn-report { width: auto; padding: 13px 24px; border: 0; cursor: pointer; font-family: inherit; }
.dash-actions .btn-secondary { width: auto; }
.dash-actions .btn-again { width: auto; padding: 10px 18px; margin-left: auto; }

@media (max-width: 860px) {
  .sev-row { grid-template-columns: repeat(2, 1fr); }
  .sum-left { min-width: 0; }
  .dash-actions .btn-again { margin-left: 0; }
}

/* =============================================================================
   Lead-capture modal
   ============================================================================= */
.lead-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 12, 40, .55);
  z-index: 1000;
  padding: 24px;
  overflow-y: auto;
}
.lead-overlay.open { display: flex; align-items: center; justify-content: center; }

.lead-modal {
  position: relative;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  padding: 28px;
  width: 100%;
  max-width: 420px;
}
.lead-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: 0;
  font-size: 26px;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
}
.lead-close:hover { color: #1a1a2e; }
.lead-modal h3 { font-size: 18px; font-weight: 800; color: #1a1a2e; }
.lead-intro {
  margin: 6px 0 18px;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
}
.lead-label {
  display: block;
  margin: 12px 0 5px;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}
.lead-label .req { color: #dc2626; }
.lead-modal input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #e3e6ee;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  color: #1a1a2e;
}
.lead-modal input:focus {
  outline: none;
  border-color: #7034FF;
  box-shadow: 0 0 0 3px rgba(112, 52, 255, .12);
}
.lead-modal input.err { border-color: #dc2626; }
.lead-error {
  display: none;
  margin-top: 12px;
  font-size: 12px;
  color: #dc2626;
}
.lead-error.show { display: block; }
.lead-submit { width: 100%; margin-top: 18px; }

@media (max-width: 720px) {
  .sev-row { grid-template-columns: repeat(3, 1fr); }
  .dash-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .dash-actions .btn-again { margin-left: 0; }
}
