/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #2b3a4e;
  --primary-light: #3d5266;
  --accent: #c2410c;
  --accent-hover: #9a3412;
  --accent-light: #fff7ed;
  --accent-warm: #ea580c;
  --green: #15803d;
  --green-light: #dcfce7;
  --red: #b91c1c;
  --red-light: #fee2e2;
  --blue: #1d4ed8;
  --blue-light: #dbeafe;
  --yellow-light: #fef9c3;
  --bg: #ffffff;
  --bg-warm: #faf9f7;
  --bg-section: #f5f4f0;
  --bg-card: #ffffff;
  --text: #1a1a2e;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e5e2dc;
  --border-light: #f0ede8;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
}

html {
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
}

/* ===== TOP ACCENT BAR ===== */
body::before {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(90deg, #c2410c, #d97706, #ea580c);
}

/* ===== HEADER ===== */
.site-header {
  background: var(--bg);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 960px;
}

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

.logo:hover {
  color: var(--text);
}

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
}

.logo-icon img,
.logo-icon svg {
  width: 100%;
  height: 100%;
}

.logo-highlight {
  color: var(--accent);
}

.site-header nav {
  display: flex;
  gap: 20px;
}

.site-header nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  transition: color 0.15s;
}

.site-header nav a:hover {
  color: var(--accent);
}

/* ===== HERO ===== */
.hero {
  background: var(--bg-warm);
  padding: 56px 0 64px;
  border-bottom: 1px solid var(--border-light);
}

.hero .container {
  max-width: 640px;
  text-align: center;
}

.hero h1 {
  color: var(--text);
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -1.2px;
  margin-bottom: 16px;
}

.hero h1 .accent {
  color: var(--accent);
}

.hero-sub {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ===== UPLOAD SECTION ===== */
.upload-section {
  margin-top: -28px;
  padding-bottom: 48px;
}

.upload-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  border: 1px solid var(--border-light);
}

/* Tabs */
.upload-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border-light);
}

.tab-btn {
  background: none;
  border: none;
  padding: 12px 24px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-family: inherit;
  transition: color 0.15s;
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-btn:hover {
  color: var(--accent);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.drop-zone-inner svg {
  color: var(--text-light);
  margin-bottom: 12px;
}

.drop-text {
  font-size: 1rem;
  margin-bottom: 4px;
}

.browse-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.drop-hint {
  color: var(--text-light);
  font-size: 0.8rem;
}

/* File preview */
.file-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--green-light);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 12px;
}

.file-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.file-remove {
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
}

/* Textarea */
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 0.9rem;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  min-height: 180px;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.1);
}

textarea::placeholder {
  color: var(--text-light);
}

/* Extra fields */
.extra-fields {
  margin-top: 20px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 0;
}

.extra-fields summary {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  list-style: none;
}

.extra-fields summary::-webkit-details-marker {
  display: none;
}

.extra-fields summary::before {
  content: '+ ';
  font-weight: 700;
}

.extra-fields[open] summary::before {
  content: '- ';
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px 16px;
}

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.field input,
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.08);
}

/* Buttons */
.btn-primary {
  display: block;
  width: 100%;
  padding: 16px;
  margin-top: 24px;
  background: linear-gradient(135deg, #c2410c 0%, #ea580c 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s, transform 0.1s;
  box-shadow: 0 2px 8px rgba(194, 65, 12, 0.25);
}

.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(194, 65, 12, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  background: var(--text-light);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-secondary {
  display: inline-block;
  padding: 10px 20px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.btn-secondary:hover {
  background: var(--bg-warm);
  border-color: var(--text-light);
}

/* Processing state */
.processing {
  text-align: center;
  padding: 40px 0;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

.processing-text {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.processing-sub {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Error */
.error-msg {
  text-align: center;
  padding: 24px;
  background: var(--red-light);
  border-radius: var(--radius);
  margin-top: 16px;
}

.error-msg p {
  color: var(--red);
  font-weight: 600;
  margin-bottom: 12px;
}

/* ===== HOW IT WORKS ===== */
.how-it-works {
  padding: 64px 0;
  background: var(--bg);
}

.how-it-works h2 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 36px;
  color: var(--text);
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}

.step {
  text-align: center;
}

.step-img {
  width: 100%;
  height: 100px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  margin-bottom: 14px;
  opacity: 0.65;
  filter: saturate(0.8);
  transition: opacity 0.2s;
}

.step:hover .step-img {
  opacity: 0.85;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #c2410c 0%, #ea580c 100%);
  color: #fff;
  border-radius: 50%;
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 14px;
}

.step h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.step p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ===== TRUST SECTION ===== */
.trust-section {
  padding: 56px 0;
  background: var(--bg-section);
  border-top: 1px solid var(--border-light);
}

.trust-section h2 {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 28px;
}

.trust-points {
  display: grid;
  gap: 14px;
}

.trust-point {
  padding: 18px 22px;
  background: var(--bg-card);
  border-radius: var(--radius);
  font-size: 0.9rem;
  line-height: 1.55;
  border: 1px solid var(--border-light);
}

.trust-point strong {
  color: var(--accent);
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--primary);
  color: #8899aa;
  padding: 24px 0;
  text-align: center;
  font-size: 0.78rem;
}

.site-footer a {
  color: #aabbcc;
  font-size: 0.78rem;
}

.footer-note {
  margin-top: 8px;
  font-size: 0.72rem;
  color: #667788;
}

/* ===== RESULTS PAGE ===== */
.results-header {
  background: var(--bg-warm);
  padding: 32px 0 40px;
  border-bottom: 1px solid var(--border-light);
}

.results-header h1 {
  color: var(--text);
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.results-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.results-body {
  margin-top: 24px;
  padding-bottom: 48px;
}

/* ===== SCORE METER (Gauge) ===== */
.overall-score-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 28px 24px 24px;
  text-align: center;
  border: 1px solid var(--border-light);
  margin-bottom: 20px;
}

.overall-score-card h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.meter-container {
  position: relative;
  max-width: 220px;
  margin: 0 auto 8px;
}

.score-meter {
  width: 100%;
  height: auto;
  display: block;
}

.meter-bg {
  fill: none;
  stroke: var(--border-light);
  stroke-width: 14;
  stroke-linecap: round;
}

.meter-fill {
  fill: none;
  stroke-width: 14;
  stroke-linecap: round;
  stroke: var(--text-light);
  stroke-dasharray: 251.3;
  stroke-dashoffset: 251.3;
  transition: stroke-dashoffset 1.2s ease-out, stroke 0.5s ease;
}

.meter-value {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
  color: var(--text);
}

.meter-value small {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-light);
}

.meter-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 6px;
}

.meter-explain {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.4;
}

/* Small meters for individual scores */
.mini-meter {
  position: relative;
  max-width: 140px;
  margin: 8px auto;
}

.score-meter-sm {
  width: 100%;
  height: auto;
  display: block;
}

.meter-value-sm {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
}

.meter-value-sm small {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
}

/* Score cards */
.score-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.score-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  text-align: center;
  border: 1px solid var(--border-light);
}

.score-card h3 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.score-value {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 4px;
}

.score-value small {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-light);
}

.score-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.score-good { color: var(--green); }
.score-ok { color: var(--accent); }
.score-bad { color: var(--red); }
.score-na { color: var(--text-light); }

/* Meter colour classes */
.meter-good { stroke: var(--green); }
.meter-ok { stroke: var(--accent); }
.meter-bad { stroke: var(--red); }

/* Result sections */
.result-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
}

.result-section h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-section p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
}

.context-note {
  background: var(--yellow-light);
  border-color: #fde68a;
}

.context-note p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Item table */
.items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 8px;
}

.items-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-section);
  border-bottom: 2px solid var(--border);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
}

.items-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

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

.assessment-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-fair {
  background: var(--green-light);
  color: var(--green);
}

.badge-high {
  background: var(--red-light);
  color: var(--red);
}

.badge-low {
  background: var(--blue-light);
  color: var(--blue);
}

.badge-unknown {
  background: var(--bg-section);
  color: var(--text-light);
}

/* Flags list */
.flags-list {
  list-style: none;
  padding: 0;
}

.flags-list li {
  padding: 8px 0 8px 24px;
  position: relative;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-light);
}

.flags-list li:last-child {
  border-bottom: none;
}

.flags-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.flags-list.risk li::before {
  background: var(--red);
}

.flags-list.scope li::before {
  background: var(--accent);
}

.flags-list.missing li::before {
  background: var(--text-light);
}

/* Review links */
.review-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.review-links a {
  display: inline-block;
  padding: 6px 14px;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--primary);
  transition: background 0.15s, border-color 0.15s;
}

.review-links a:hover {
  background: var(--border-light);
  border-color: var(--text-light);
}

/* Back link */
.back-link {
  display: inline-block;
  margin-top: 24px;
  font-size: 0.9rem;
}

/* Loading results */
.results-loading {
  text-align: center;
  padding: 80px 0;
}

/* ===== EMAIL REPORT SECTION ===== */
.email-report-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
}

.email-report-section h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.email-report-section p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

.email-form {
  display: flex;
  gap: 10px;
}

.email-form input[type="email"] {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
}

.email-form input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.08);
}

.email-form button {
  padding: 10px 20px;
  background: linear-gradient(135deg, #c2410c 0%, #ea580c 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.email-form button:hover {
  opacity: 0.9;
}

.email-form button:disabled {
  background: var(--text-light);
  cursor: not-allowed;
}

.email-status {
  font-size: 0.82rem;
  margin-top: 8px;
}

.email-status.success {
  color: var(--green);
}

.email-status.error {
  color: var(--red);
}

.email-consent {
  font-size: 0.72rem;
  color: var(--text-light);
  margin-top: 6px;
  line-height: 1.4;
}

/* ===== DISCLAIMER BAR ===== */
.disclaimer-bar {
  background: var(--bg-section);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 16px;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.disclaimer-bar strong {
  color: var(--text);
  font-size: 0.78rem;
}

/* ===== ABOUT PAGE ===== */
.page-content {
  padding: 48px 0;
}

.page-content h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 24px;
}

.page-content h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 28px;
  margin-bottom: 8px;
}

.page-content p,
.page-content li {
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 12px;
}

.page-content ul {
  padding-left: 20px;
  margin-bottom: 16px;
}

/* ===== ADMIN PAGE ===== */
.admin-login {
  max-width: 360px;
  margin: 80px auto;
  background: var(--bg-card);
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
}

.admin-login h1 {
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.admin-login input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  margin-bottom: 12px;
}

.admin-body {
  padding: 32px 0;
}

.admin-body .container {
  max-width: 960px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--accent);
}

.stat-card .stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 4px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.admin-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.admin-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
}

.admin-table tr:hover {
  background: var(--bg-warm);
}

.admin-table tr[data-clickable] {
  cursor: pointer;
}

.admin-table tr[data-clickable]:hover {
  background: var(--accent-light);
}

.admin-section {
  margin-bottom: 32px;
}

.admin-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
}

/* Admin detail panel */
.detail-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 4px 12px;
  font-size: 0.82rem;
  margin-bottom: 16px;
}

.detail-grid dt {
  font-weight: 700;
  color: var(--text-muted);
  padding: 4px 0;
}

.detail-grid dd {
  padding: 4px 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  html { font-size: 16px; }

  .hero h1 { font-size: 1.6rem; }
  .hero-sub { font-size: 0.95rem; }

  .steps {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .score-row {
    grid-template-columns: 1fr 1fr;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-table {
    font-size: 0.72rem;
  }

  .admin-table th,
  .admin-table td {
    padding: 6px 8px;
  }

  .email-form {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .upload-card { padding: 20px; }

  .steps {
    grid-template-columns: 1fr;
  }

  .hero h1 { font-size: 1.4rem; }

  .site-header .container {
    flex-direction: column;
    gap: 8px;
  }

  .score-row {
    grid-template-columns: 1fr;
  }
}

/* ===== BLOG ===== */
.blog-intro {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.blog-list {
  display: grid;
  gap: 16px;
  margin-bottom: 32px;
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  transition: box-shadow 0.15s, border-color 0.15s;
}

.blog-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}

.blog-card a {
  display: block;
  padding: 20px 24px;
  text-decoration: none;
  color: inherit;
}

.blog-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.blog-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}

.blog-card time {
  font-size: 0.75rem;
  color: var(--text-light);
}

.blog-date {
  display: block;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 24px;
}

.blog-body {
  font-size: 0.95rem;
  line-height: 1.75;
}

.blog-body h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 32px;
  margin-bottom: 10px;
}

.blog-body h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 8px;
}

.blog-body p {
  margin-bottom: 14px;
}

.blog-body ul, .blog-body ol {
  padding-left: 20px;
  margin-bottom: 14px;
}

.blog-body li {
  margin-bottom: 6px;
}

.blog-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  margin: 16px 0;
  color: var(--text-muted);
  font-style: italic;
}

.blog-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.blog-nav a {
  font-size: 0.85rem;
  font-weight: 500;
}

/* ===== FEEDBACK BUTTONS ===== */
.feedback-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.feedback-btn {
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.feedback-btn:hover {
  background: var(--bg-warm);
  border-color: var(--text-light);
}

.feedback-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ===== LUMP SUM BADGE ===== */
.badge-lumpsum {
  background: #fef3c7;
  color: #92400e;
}

/* ===== PHOTO CAPTURE ===== */
.capture-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  margin-top: 12px;
  transition: background 0.15s;
}

.capture-btn:hover {
  background: var(--border-light);
}

.capture-btn svg {
  width: 18px;
  height: 18px;
}

/* ===== BLOG CARDS (enhanced) ===== */
.blog-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
  margin-bottom: 0;
}

.blog-card:has(.blog-card-img) {
  overflow: hidden;
}

.blog-card:has(.blog-card-img) a {
  padding-top: 0;
}

.blog-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.blog-tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg-section);
  border-radius: 4px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.blog-featured-img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 16px 0;
}

/* ===== COMPARE QUOTES ===== */
.compare-upload-area {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.compare-slot {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.compare-slot:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.compare-slot.has-file {
  border-style: solid;
  border-color: var(--green);
  background: var(--green-light);
}

.compare-slot .slot-label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.compare-slot .slot-file {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.compare-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.compare-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.compare-card.recommended {
  border-color: var(--green);
  border-width: 2px;
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.1);
}

.compare-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.compare-card .card-header h3 {
  font-size: 1rem;
  margin: 0;
}

.compare-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.compare-badge.best {
  background: var(--green-light);
  color: var(--green);
}

.compare-items-table {
  width: 100%;
  font-size: 0.78rem;
  border-collapse: collapse;
  margin-top: 12px;
}

.compare-items-table th, .compare-items-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.compare-items-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

/* ===== INTEGRITY BADGE ===== */
.integrity-badge-card {
  margin-bottom: 24px;
}

.integrity-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  position: relative;
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.integrity-badge:hover {
  box-shadow: var(--shadow-md);
}

.integrity-badge[data-state="inactive"] {
  border-color: var(--border);
  background: var(--bg-section);
}

.integrity-badge[data-state="amber"] {
  border-color: #d97706;
  background: #fffbeb;
}

.integrity-badge[data-state="green"] {
  border-color: #15803d;
  background: #f0fdf4;
}

.integrity-badge-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
}

.integrity-badge-icon svg {
  width: 100%;
  height: 100%;
}

.integrity-badge-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.integrity-badge-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.integrity-badge[data-state="inactive"] .integrity-badge-label {
  color: var(--text-muted);
}

.integrity-badge-confidence {
  font-size: 0.75rem;
  font-weight: 500;
}

.integrity-badge-tooltip {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  margin-top: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 16px;
}

.integrity-badge:hover .integrity-badge-tooltip {
  display: block;
}

.tooltip-content p {
  font-size: 0.82rem;
  margin-bottom: 8px;
  color: var(--text);
}

.tooltip-content ul {
  list-style: none;
  padding: 0;
  margin: 0 0 8px 0;
}

.tooltip-content li {
  font-size: 0.78rem;
  padding: 3px 0 3px 16px;
  position: relative;
  color: var(--text-muted);
}

.tooltip-content li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

#tooltip-criteria-met li::before {
  background: var(--green);
}

#tooltip-criteria-missing li::before {
  background: var(--text-light);
}

/* ===== SOURCE TAGS ===== */
.source-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  vertical-align: middle;
  margin-left: 4px;
}

.source-tier-1 {
  background: var(--blue-light);
  color: var(--blue);
}

.source-tier-2 {
  background: var(--green-light);
  color: var(--green);
}

.source-tier-3 {
  background: #ede9fe;
  color: #7c3aed;
}

.source-tier-4 {
  background: #ecfeff;
  color: #0891b2;
}

.source-tier-5 {
  background: var(--bg-section);
  color: var(--text-light);
}

.source-quote-internal { background: var(--blue-light); color: var(--blue); }
.source-first-party-data { background: var(--green-light); color: var(--green); }
.source-public-index { background: #ede9fe; color: #7c3aed; }
.source-licensed-reference { background: #ecfeff; color: #0891b2; }
.source-llm-inference, .source-ai-assessment { background: var(--bg-section); color: var(--text-light); }

/* ===== CONFIDENCE INDICATORS ===== */
.confidence-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: 4px;
  vertical-align: middle;
}

.conf-high { background: var(--green); }
.conf-medium { background: #d97706; }
.conf-low { background: var(--text-light); }

/* ===== PC/PS TAG ===== */
.pc-ps-tag {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--yellow-light);
  color: #92400e;
  text-transform: uppercase;
  margin-left: 4px;
  vertical-align: middle;
}

/* ===== PROVENANCE BAR ===== */
.provenance-bar {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--bg-section);
  border-radius: 6px;
  font-size: 0.8rem;
}

.provenance-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.provenance-sources::before {
  content: 'Data sources: ';
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.provenance-limitations {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-light);
}

.provenance-limitations small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.provenance-triggers {
  margin-top: 8px;
}

.provenance-triggers details {
  font-size: 0.82rem;
}

.provenance-triggers summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 500;
  font-size: 0.82rem;
}

.provenance-triggers ul {
  list-style: none;
  padding: 8px 0 0 0;
  margin: 0;
}

.provenance-triggers li {
  padding: 4px 0;
  font-size: 0.78rem;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
}

.provenance-triggers li:last-child {
  border-bottom: none;
}

/* ===== ITEM TOOLTIP ===== */
.assessment-cell {
  position: relative;
}

.item-tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  z-index: 30;
  min-width: 260px;
  max-width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 12px;
  margin-bottom: 4px;
}

.assessment-cell:hover .item-tooltip {
  display: block;
}

.item-tooltip p {
  font-size: 0.78rem;
  margin-bottom: 6px;
  color: var(--text);
}

.item-tooltip ul {
  list-style: disc;
  padding-left: 16px;
  margin: 4px 0;
}

.item-tooltip li {
  font-size: 0.75rem;
  color: var(--text);
  padding: 2px 0;
}

.tooltip-limitation {
  font-style: italic;
  color: var(--text-muted) !important;
}

.market-source {
  color: var(--text-light);
}
