/* ============================================
   P5: Automating Digital Accessibility
   Team Website Styles — WCAG-fixed
   ============================================ */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  font-family: 'DM Sans', sans-serif;
  color: #1A1A1A;
  background-color: #F9F8F5;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* --- Skip Link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: #0D7377;
  color: #FFFFFF;
  padding: 8px 16px;
  border-radius: 0 0 4px 4px;
  z-index: 1000;
  font-weight: 500;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* --- Screen-reader-only utility (WCAG addition) --- */
.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;
}

/* --- Focus Styles --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #E8A838;
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Typography --- */
h1, h2, h3 {
  font-family: 'DM Serif Display', serif;
  color: #1A1A1A;
  line-height: 1.2;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: #0D7377;
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: #0a5c5f;
}

/* --- Container --- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Navbar --- */
.navbar {
  position: sticky;
  top: 0;
  background: #FFFFFF;
  border-bottom: 1px solid #e5e4e1;
  z-index: 100;
  padding: 0 24px;
}

.navbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navbar-brand {
  font-family: 'DM Serif Display', serif;
  font-size: 1.125rem;
  color: #1A1A1A;
  text-decoration: none;
  white-space: nowrap;
}

.navbar-brand:hover {
  color: #0D7377;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 32px;
}

.nav-links a {
  text-decoration: none;
  color: #1A1A1A;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: #0D7377;
  border-bottom-color: #0D7377;
}

/* --- Hamburger Button --- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
}

.hamburger-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: #1A1A1A;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.hamburger[aria-expanded="true"] .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger[aria-expanded="true"] .hamburger-bar:nth-child(2) {
  opacity: 0;
}
.hamburger[aria-expanded="true"] .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Hero --- */
.hero {
  padding: 96px 24px 80px;
  text-align: center;
  animation: fadeIn 0.8s ease-out;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1.25rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero-subtitle {
  font-size: 1.1875rem;
  max-width: 640px;
  margin: 0 auto 1.5rem;
  color: #444;
  line-height: 1.6;
}

.hero-partner {
  font-size: 0.9375rem;
  color: #595959;
}

.hero-partner a {
  color: #0D7377;
  font-weight: 500;
}

.survey-container {
  text-align: center;
  margin-top: 2rem;
}

.survey-btn {
  display: inline-block;
  padding: 12px 32px;
  background: #D4A017;
  color: #FFFFFF;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
}

.survey-btn:hover {
  background: #b8890f;
}

.survey-btn:focus-visible {
  outline: 2px solid #0D7377;
  outline-offset: 2px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Sections --- */
section {
  padding: 80px 24px;
}

section:nth-child(even) {
  background: #FFFFFF;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header p {
  max-width: 640px;
  margin: 0.75rem auto 0;
  color: #555;
}

.accent-bar {
  width: 48px;
  height: 4px;
  background: #E8A838;
  border-radius: 2px;
  margin: 0 auto 16px;
}

/* --- About Section --- */
.about-content {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: 1.8;
}

/* --- Team Grid --- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
  list-style: none;
  padding: 0;
}

.team-card {
  background: #FFFFFF;
  border-radius: 8px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
  border: 1px solid #f0efec;
}

.team-card-initial {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #0D7377;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Serif Display', serif;
  font-size: 1.25rem;
  margin: 0 auto 16px;
}

.team-card h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.team-card .team-role {
  font-size: 0.875rem;
  color: #0D7377;
  font-weight: 600;
  margin-bottom: 8px;
}

.team-card .team-desc {
  font-size: 0.8125rem;
  color: #595959;
  line-height: 1.5;
  text-align: left;
  margin-bottom: 0;
}

/* --- Deliverables --- */
.deliverables-list {
  max-width: 720px;
  margin: 0 auto;
  list-style: none;
  counter-reset: deliverable;
}

.deliverables-list li {
  counter-increment: deliverable;
  padding: 24px 24px 24px 28px;
  border-left: 3px solid #0D7377;
  margin-bottom: 20px;
  background: #FFFFFF;
  border-radius: 0 8px 8px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.deliverables-list li::before {
  content: counter(deliverable) ".";
  font-family: 'DM Serif Display', serif;
  font-size: 1.25rem;
  color: #0D7377;
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}

.deliverables-list strong {
  font-weight: 600;
}

.deliverables-list .stretch {
  display: inline-block;
  background: #E8A838;
  color: #1A1A1A;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* --- Lighthouse Scores --- */
.lighthouse-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 600px;
  margin: 0 auto 24px;
}

.lighthouse-card {
  background: #FFFFFF;
  border-radius: 8px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
  border: 1px solid #f0efec;
}

.lighthouse-card h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #555;
  margin-bottom: 8px;
}

.lighthouse-score {
  font-family: 'DM Serif Display', serif;
  font-size: 2.5rem;
  color: #0D7377;
  line-height: 1;
}

.lighthouse-note {
  text-align: center;
  font-size: 0.875rem;
  color: #636363;
  font-style: italic;
  max-width: 600px;
  margin: 0 auto;
}

/* --- Goal Section --- */
.goal-content {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.125rem;
  line-height: 1.8;
  text-align: center;
}

.goal-content blockquote {
  border-left: 4px solid #E8A838;
  padding-left: 24px;
  text-align: left;
  font-style: italic;
  color: #333;
}

/* --- Footer --- */
.site-footer {
  background: #1A1A1A;
  color: #ccc;
  padding: 48px 24px;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.8;
}

.site-footer a {
  color: #E8A838;
}

.site-footer a:hover {
  color: #f0bc5e;
}

.footer-inner p {
  margin-bottom: 0.25rem;
}

/* ============================================
   Responsive Breakpoints
   ============================================ */

@media (max-width: 768px) {
  .hero h1 { font-size: 2.25rem; }
  .hero { padding: 72px 24px 56px; }
  h2 { font-size: 1.75rem; }
  section { padding: 60px 24px; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .navbar-brand { font-size: 1rem; }
}

@media (max-width: 680px) {
  .hamburger { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #FFFFFF;
    border-bottom: 1px solid #e5e4e1;
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  }
  .nav-links.nav-open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a,
  .nav-links .nav-audit-btn {
    display: block;
    width: 100%;
    padding: 12px 24px;
    font-size: 1rem;
    border-bottom: none;
    border-radius: 0;
    text-align: left;
  }
  .nav-links .nav-audit-btn {
    border: none;
    color: #0D7377;
    font-weight: 600;
  }
  .navbar { position: sticky; }
  .navbar-inner { position: relative; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.75rem; }
  .hero-subtitle { font-size: 1rem; }
  .hero { padding: 56px 16px 48px; }
  h2 { font-size: 1.5rem; }
  section { padding: 48px 16px; }
  .team-grid { grid-template-columns: 1fr; }
  .lighthouse-grid { grid-template-columns: 1fr; }
  html { scroll-padding-top: 60px; }
  .deliverables-list li { padding: 20px 16px 20px 20px; }
}

/* ============================================
   Audit Tool Tab
   ============================================ */

.nav-audit-btn {
  background: none;
  border: 1.5px solid #0D7377;
  color: #0D7377;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
  line-height: 1;
}

.nav-audit-btn:hover,
.nav-audit-btn.active {
  background: #0D7377;
  color: #FFFFFF;
}

.nav-audit-btn:focus-visible {
  outline: 3px solid #E8A838;
  outline-offset: 2px;
}

.audit-section {
  padding: 72px 24px 96px;
  min-height: calc(100vh - 64px);
}

/* --- Form --- */
.audit-form {
  max-width: 760px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 6px;
  color: #1A1A1A;
}

.required-mark {
  color: #c0392b;
  margin-left: 2px;
}

.optional-mark {
  font-weight: 400;
  color: #636363;
  font-size: 0.875em;
}

.form-group textarea,
.form-group input[type="password"],
.form-group input[type="text"],
.form-group input[type="url"],
.form-group select {
  width: 100%;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  color: #1A1A1A;
  background: #FFFFFF;
  border: 1.5px solid #d6d4d0;
  border-radius: 6px;
  padding: 10px 14px;
  transition: border-color 0.18s ease;
  box-sizing: border-box;
}

.form-group textarea {
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
  font-size: 0.8125rem;
  resize: vertical;
  min-height: 200px;
  line-height: 1.5;
}

.form-group textarea:focus,
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #0D7377;
  box-shadow: 0 0 0 3px rgba(13, 115, 119, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 24px;
}

.field-hint {
  font-size: 0.8125rem;
  color: #636363;
  margin: 6px 0 0;
}

/* --- API key row: input + toggle + validate button side by side --- */
.api-key-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.api-key-row input {
  flex: 1;
  min-width: 0;
}

/* --- Toggle key visibility button --- */
.toggle-key-btn {
  flex-shrink: 0;
  background: none;
  border: 1.5px solid #d6d4d0;
  border-radius: 6px;
  padding: 0 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #636363;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.toggle-key-btn:hover {
  color: #1A1A1A;
  border-color: #999;
}

#eyeIcon {
  display: none;
}

.toggle-key-btn.showing #eyeOffIcon {
  display: none;
}

.toggle-key-btn.showing #eyeIcon {
  display: block;
}

/* --- Validate key button --- */
.validate-key-btn {
  flex-shrink: 0;
  padding: 0 16px;
  background: #0D7377;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.validate-key-btn:hover {
  background: #0a5c60;
}

.validate-key-btn:focus-visible {
  outline: 3px solid rgba(13, 115, 119, 0.5);
  outline-offset: 2px;
}

.validate-key-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.key-validate-status {
  font-size: 0.8125rem;
  font-weight: 600;
  margin: 6px 0 0;
}

.key-validate-status.valid   { color: #1a7a1a; }
.key-validate-status.invalid { color: #b91c1c; }
.key-validate-status.validating { color: #636363; }

/* --- Impact badges on issue cards --- */
.impact-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.impact-critical  { background: #fde8e8; color: #991b1b; }
.impact-serious   { background: #fef3c7; color: #92400e; }
.impact-moderate  { background: #e0f2fe; color: #075985; }
.impact-minor     { background: #f0fdf4; color: #166534; }

/* --- Inline form error --- */
.form-error {
  color: #b91c1c;
  font-size: 0.875rem;
  font-weight: 500;
  margin: 8px 0 0;
  padding: 8px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 4px;
}

/* --- Input mode selector --- */
.audit-mode-group {
  margin-bottom: 28px;
}

.audit-mode-label {
  font-weight: 600;
  font-size: 0.9375rem;
  color: #1A1A1A;
  margin-bottom: 8px;
}

.audit-mode-tabs {
  display: flex;
  width: fit-content;
  border: 1.5px solid #d6d4d0;
  border-radius: 6px;
  overflow: hidden;
}

.audit-mode-tab {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.audit-mode-tab input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.audit-mode-tab span {
  display: block;
  padding: 8px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #555;
  background: #FFFFFF;
  border-right: 1.5px solid #d6d4d0;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  user-select: none;
}

.audit-mode-tab:last-child span { border-right: none; }
.audit-mode-tab:hover span { background: #f5f4f1; color: #1A1A1A; }
.audit-mode-tab input[type="radio"]:checked + span { background: #0D7377; color: #FFFFFF; }
.audit-mode-tab input[type="radio"]:focus-visible + span {
  outline: 3px solid #E8A838;
  outline-offset: -3px;
  border-radius: 0;
}

/* --- Drop zone --- */
.drop-zone {
  border: 2px dashed #c8c6c1;
  border-radius: 8px;
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
  background: #FFFFFF;
  position: relative;
}

.drop-zone:hover,
.drop-zone:focus-within { border-color: #0D7377; background: #f4fafa; }
.drop-zone.drag-over { border-color: #0D7377; background: #edf6f6; box-shadow: 0 0 0 4px rgba(13, 115, 119, 0.12); }
.drop-zone.has-file { border-style: solid; border-color: #0D7377; background: #f4fafa; cursor: default; }

.file-input-hidden {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  pointer-events: none;
}

.drop-icon {
  width: 36px;
  height: 36px;
  color: #636363;
  margin: 0 auto 12px;
  display: block;
  transition: color 0.18s ease;
}

.drop-zone:hover .drop-icon,
.drop-zone.drag-over .drop-icon { color: #0D7377; }
.drop-icon--ok { color: #0D7377; }

.drop-label {
  font-size: 0.9375rem;
  color: #444;
  margin: 0 0 6px;
}

.drop-label code {
  background: #f0efec;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.9em;
}

.drop-hint {
  font-size: 0.875rem;
  color: #636363;
  margin: 0;
}

.browse-link {
  background: none;
  border: none;
  color: #0D7377;
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.browse-link:hover { color: #0a5c5f; }

.drop-filename {
  font-weight: 600;
  font-size: 0.9375rem;
  color: #1A1A1A;
  margin: 0 0 4px;
  word-break: break-all;
}

.drop-filesize {
  font-size: 0.8125rem;
  color: #636363;
  margin: 0 0 14px;
}

.file-clear-btn {
  background: none;
  border: 1px solid #d0ceca;
  color: #555;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.file-clear-btn:hover { border-color: #c0392b; color: #c0392b; }

/* --- Paste fallback --- */
.paste-fallback { margin-top: 10px; }

.paste-fallback summary {
  font-size: 0.8125rem;
  color: #636363;
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.paste-fallback summary::before {
  content: '\25B6';
  font-size: 0.6rem;
  transition: transform 0.2s ease;
}

.paste-fallback[open] summary::before { transform: rotate(90deg); }
.paste-fallback summary:hover { color: #444; }

.paste-fallback textarea {
  width: 100%;
  margin-top: 10px;
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
  font-size: 0.8125rem;
  color: #1A1A1A;
  background: #FFFFFF;
  border: 1.5px solid #d6d4d0;
  border-radius: 6px;
  padding: 10px 14px;
  resize: vertical;
  min-height: 160px;
  line-height: 1.5;
  box-sizing: border-box;
  transition: border-color 0.18s ease;
}

.paste-fallback textarea:focus {
  outline: none;
  border-color: #0D7377;
  box-shadow: 0 0 0 3px rgba(13, 115, 119, 0.15);
}

/* --- Submit button --- */
.audit-btn {
  background: #0D7377;
  color: #FFFFFF;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  padding: 12px 32px;
  cursor: pointer;
  transition: background 0.18s ease, opacity 0.18s ease;
}

.audit-btn:hover { background: #0a5c5f; }
.audit-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.audit-btn:focus-visible { outline: 3px solid #E8A838; outline-offset: 2px; }

/* --- Results --- */
.audit-results {
  max-width: 760px;
  margin: 48px auto 0;
}

.audit-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}

.summary-stat {
  background: #FFFFFF;
  border: 1px solid #e8e6e2;
  border-radius: 8px;
  padding: 16px 20px;
  min-width: 120px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.stat-num {
  display: block;
  font-family: 'DM Serif Display', serif;
  font-size: 1.75rem;
  color: #0D7377;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  display: block;
  font-size: 0.8125rem;
  color: #636363;
}

.audit-notice {
  background: #f0f8ff;
  border: 1px solid #b8d9f0;
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 0.9rem;
  color: #1a4d6e;
  margin-bottom: 24px;
}

/* --- Findings sections --- */
.findings-section { margin-bottom: 40px; }

.findings-section h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #1A1A1A;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.findings-count {
  background: #f0efec;
  color: #555;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.findings-empty {
  color: #636363;
  font-style: italic;
  font-size: 0.9rem;
  margin: 0;
}

/* --- Programmatic findings table --- */
.findings-table-wrapper {
  overflow-x: auto;
  border-radius: 6px;
  border: 1px solid #e8e6e2;
}

.findings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.findings-table thead th {
  background: #f5f4f1;
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  color: #333;
  white-space: nowrap;
}

.findings-table tbody tr { border-top: 1px solid #f0efec; }
.findings-table tbody tr:hover { background: #faf9f7; }

.findings-table td {
  padding: 10px 14px;
  vertical-align: top;
  color: #333;
  line-height: 1.5;
}

.rule-id {
  font-size: 0.8125rem;
  background: #f0efec;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

/* --- Download report section --- */
.download-section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid #e8e6e2;
  text-align: center;
}

.download-desc {
  font-size: 0.9375rem;
  color: #555;
  margin-bottom: 20px;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #0D7377;
  color: #FFFFFF;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  padding: 14px 32px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.1s ease;
}

.download-btn:hover { background: #0a5c5f; transform: translateY(-1px); }
.download-btn:active { transform: translateY(0); }
.download-btn:focus-visible { outline: 3px solid #E8A838; outline-offset: 2px; }
.download-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* --- LLM findings --- */
.llm-findings {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.llm-prompt {
  background: #FFFFFF;
  border: 1px solid #e8e6e2;
  border-radius: 8px;
  overflow: hidden;
}

.llm-prompt-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 18px;
  background: #f5f4f1;
  border-bottom: 1px solid #e8e6e2;
  cursor: pointer;
  user-select: none;
}

.llm-prompt-header:hover { background: #eceae6; }
.llm-prompt:not(.open) .llm-prompt-header { border-bottom-color: transparent; }

.llm-chevron {
  width: 16px;
  height: 16px;
  color: #636363;
  flex-shrink: 0;
  margin-left: 4px;
  transition: transform 0.2s ease;
}

.llm-prompt.open .llm-chevron { transform: rotate(180deg); }

.llm-prompt-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: #1A1A1A;
  text-transform: capitalize;
}

.llm-prompt-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.llm-checklist-tag {
  background: #e8f4f4;
  color: #0D7377;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.wcag-tag {
  background: #f0efec;
  color: #555;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
  font-family: 'SFMono-Regular', 'Consolas', monospace;
}

.llm-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.llm-badge.dry-run { background: #fff3cd; color: #7a5200; }
.llm-badge.has-issues { background: #fde8d4; color: #8a3a00; }
.llm-badge.pass { background: #d4f0ee; color: #0a5c5f; }
.llm-badge.error { background: #fbdada; color: #9b1c1c; }

.llm-prompt-body { padding: 18px; }
.llm-error-message {
  margin: 0;
  color: #9b1c1c;
  font-family: 'SFMono-Regular', 'Consolas', monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* --- Issue cards --- */
.issue-card {
  background: #fdfcfa;
  border: 1px solid #ede9e2;
  border-left: 3px solid #E8A838;
  border-radius: 0 6px 6px 0;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.issue-card:last-child { margin-bottom: 0; }

.issue-desc {
  font-size: 0.9375rem;
  color: #1A1A1A;
  margin: 0 0 8px;
  line-height: 1.5;
}

.issue-desc:last-child { margin-bottom: 0; }

.issue-element {
  display: inline-block;
  font-family: 'SFMono-Regular', 'Consolas', monospace;
  font-size: 0.8125rem;
  background: #f0efec;
  padding: 3px 8px;
  border-radius: 3px;
  color: #333;
  margin-bottom: 8px;
  word-break: break-all;
}

.issue-fix {
  font-size: 0.875rem;
  color: #444;
  margin: 8px 0 0;
  line-height: 1.5;
}

.issue-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 10px 0 0;
  font-size: 0.8125rem;
}

.issue-meta dt { color: #636363; font-weight: 500; white-space: nowrap; }
.issue-meta dd { color: #444; margin: 0; word-break: break-word; }

/* --- Object-type LLM responses --- */
.llm-object {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.llm-obj-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9375rem;
  color: #333;
  padding: 8px 12px;
  background: #fafaf8;
  border-radius: 6px;
  border: 1px solid #f0efec;
}

.llm-obj-row.llm-obj-string { flex-wrap: wrap; align-items: flex-start; }

.check-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
}

.check-ok { background: #d4f0ee; color: #0D7377; }
.check-fail { background: #fde8e8; color: #c0392b; }

.llm-obj-key { font-weight: 500; text-transform: capitalize; }
.llm-obj-val { color: #555; font-size: 0.875rem; margin-left: auto; }

.llm-obj-empty {
  font-size: 0.75rem;
  color: #636363;
  background: #f0efec;
  padding: 1px 8px;
  border-radius: 8px;
  margin-left: auto;
}

.llm-obj-section { margin-top: 4px; }

.llm-obj-section-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #555;
  margin: 0 0 8px;
  text-transform: capitalize;
}

.llm-empty {
  color: #636363;
  font-style: italic;
  font-size: 0.9rem;
  margin: 0;
  padding: 4px 0;
}

.llm-json {
  font-family: 'SFMono-Regular', 'Consolas', monospace;
  font-size: 0.8125rem;
  background: #f5f4f1;
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #333;
  line-height: 1.5;
  margin: 0;
}

/* --- Skipped prompts --- */
.skipped-section h3 { color: #636363; }

.skipped-list {
  list-style: none;
  font-size: 0.875rem;
  color: #636363;
  line-height: 1.8;
  padding: 0;
  margin: 0;
}

.skipped-list code {
  font-size: 0.85em;
  background: #f0efec;
  padding: 1px 5px;
  border-radius: 3px;
  color: #555;
}

/* --- Error state --- */
.audit-error {
  background: #fff5f5;
  border: 1px solid #f5b8b8;
  border-left: 4px solid #c0392b;
  border-radius: 0 6px 6px 0;
  padding: 16px 20px;
  font-size: 0.9375rem;
  color: #7a1a1a;
  line-height: 1.7;
}

.audit-error code {
  background: rgba(0,0,0,0.06);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.9em;
}

/* --- Progress indicator --- */
.audit-progress { padding: 24px 20px; text-align: center; }

.progress-message {
  font-size: 1rem;
  font-weight: 600;
  color: #0D7377;
  margin-bottom: 12px;
}

.progress-bar-track {
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

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

.progress-detail {
  font-size: 0.85rem;
  color: #666;
  word-break: break-all;
}

/* ============================================
   Audit Tool — Responsive
   ============================================ */

@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .audit-section { padding: 56px 16px 72px; }
  .nav-audit-btn { font-size: 0.875rem; padding: 4px 10px; }
}

@media (max-width: 480px) {
  .audit-summary { gap: 10px; }
  .summary-stat { min-width: 100px; padding: 12px 14px; }
  .stat-num { font-size: 1.5rem; }
}

/* --- Multi-page crawl tree --- */
.page-tree { margin-bottom: 40px; }

.page-node {
  border: 1px solid #e8e6e2;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fff;
  overflow: hidden;
}

.page-node-children { padding: 0 0 10px 24px; }
.page-node-children .page-node { border-color: #ede9e3; background: #faf9f7; }

.page-node-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  border-radius: 8px;
  transition: background 0.15s;
}

.page-node-header:hover,
.page-node-header:focus-visible { background: #f5f4f1; outline: none; }
.page-node-header:focus-visible { outline: 2px solid #0D7377; outline-offset: -2px; }

.page-node-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #888;
  transition: transform 0.2s;
}

.page-node.open > .page-node-header .page-node-chevron { transform: rotate(180deg); }

.page-node-url {
  flex: 1;
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.8125rem;
  color: #0D7377;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.page-node-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}

.page-node-badge.has-issues { background: #fff0ed; color: #c0392b; }
.page-node-badge.pass { background: #edfaf3; color: #1a7a4a; }

.page-node-body {
  padding: 0 16px 16px;
  border-top: 1px solid #f0efec;
}

.page-node-body h4 {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1A1A1A;
  margin: 18px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}