/* static/styles.css */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap');

:root {
  /* High-end Academic Palette */
  --bg-body: #ffffff;        /* Subtle cool gray background */
  --bg-card: #ffffff;
  --bg-card-neutral: #fbfbfa;
  --bg-card-cool: #f6f8fb;
  --bg-card-privacy: #bce8f2ac;
  --text-main: #0f172a;      /* Deep Slate/Navy for readability */
  --text-muted: #475569;
  --primary: #1e293b;        /* Midnight Blue-Grey */
  --primary-hover: #0f172a;
  --accent: #e2e8f0;
  --border: #e2e8f0;
  --radius: 8px; /* Slightly tighter corners feel more professional */

  /* Elevation */
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

  /* Refined Semantic Colors (Moving away from neon traffic lights) */
  --cit-matched-bg: #f0fdf4; --cit-matched-border: #bbf7d0; --cit-matched-text: #166534;
  --cit-missing-bg: #fef2f2; --cit-missing-border: #fecaca; --cit-missing-text: #991b1b;
  --cit-ambiguous-bg: #fffbeb; --cit-ambiguous-border: #fde68a; --cit-ambiguous-text: #92400e;
  --cit-suggested-bg: #f0f9ff; --cit-suggested-border: #bae6fd;
}

body {
  font-family: 'Inter', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  margin: 0;
  line-height: 1.5;
  letter-spacing: -0.011em; /* Tighten Inter's default spacing slightly */
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

h1, h2, h3 {
  color: #18181b;
  font-weight: 700;
  margin-top: 0;
  letter-spacing: -0.02em; /* Tight and designed */
}

h1 { font-size: 1.8rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.1rem; margin-bottom: 1rem; color: var(--primary); }

a { color: var(--primary); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }

/* Make verification links in reports obviously clickable. */
.verify-link {
  color: #1a73e8 !important;
  text-decoration: underline !important;
  font-weight: 750;
}
.verify-link:hover { color: #1558b0 !important; }

/* --- Buttons (links) --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--primary);
  color: white;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-weight: 600; /* Less heavy for academic tools */
  border: 1px solid var(--primary);
  text-decoration: none;
  box-shadow: var(--shadow);
  white-space: nowrap;
  transition: all 0.2s ease-in-out; /* Subtle hover transitions */
  position: relative;
}
.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius) var(--radius) 0 0;
}
.btn:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  text-decoration: none;
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}
.btn-secondary {
  background: white; /* White background */
  color: var(--primary);
  border: 1px solid #cbd5e1; /* Very thin slate border */
}
.btn-secondary::before {
  display: none;
}
.btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}
.btn-small { padding: 8px 12px; font-weight: 600; font-size: 0.9rem; }
.btn-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* --- Mode selection buttons --- */
.mode-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 760px) {
  .mode-grid { grid-template-columns: 1fr 1fr; }
}
.mode-btn {
  justify-content: flex-start;
  text-align: left;
  width: 100%;
  white-space: normal;
  line-height: 1.25;
  display: flex;
  flex-direction: row; /* Changed to row for horizontal layout */
  align-items: center;
  gap: 10px;
  padding: 12px 14px; /* Reduced vertical padding to make less tall */
  border: 2px solid var(--border); /* Thicker border for more obvious button look */
  background: var(--bg-card);
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  position: relative; /* For absolute positioning of badge */
}
.mode-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: #94a3b8; /* Darker border on hover */
}
.mode-btn.is-selected {
  background: #f1f5f9;
  border: 2px solid var(--primary);
}
.mode-title { font-weight: 600; color: #18181b; } /* Changed from 950 to 600 */
.mode-sub { color: var(--text-muted); font-weight: 400; font-size: 0.85rem; } /* Changed from 650 to 400, made smaller */
.mode-cost {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(30, 41, 59, 0.2);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.08), rgba(30, 41, 59, 0.04));
  color: var(--primary);
  font-weight: 600;
  font-size: 0.7rem;
}
.mode-btn-full {
  background: rgba(30, 41, 59, 0.04);
  border-color: var(--border);
}
.mode-text-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 60px; /* Space for the badge */
}
.credit-summary {
  margin-top: 10px;
  font-weight: 600;
  color: #18181b;
}

/* --- Icon button --- */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 34px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.7);
  color: var(--primary);
  cursor: pointer;
  box-shadow: var(--shadow);
}
.icon-btn:hover { background: rgba(255,255,255,0.95); }
.icon-btn:active { transform: translateY(1px); }

/* --- Forms & Inputs --- */
label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
}

input[type="text"], 
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

input[type="text"]:focus, 
input[type="number"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--accent);
}

input[type="file"] {
  display: block;
  width: 100%;
  padding: 10px;
  background: white;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

button {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 12px 24px;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  width: 100%;
  box-shadow: var(--shadow);
  position: relative;
}
button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius) var(--radius) 0 0;
}

/* --- Progress --- */
.progress-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}
.progress-stage {
  font-weight: 700;
  color: #18181b;
}
.progress-pct {
  color: var(--text-muted);
  font-weight: 700;
}
.progress-bar {
  height: 12px;
  border-radius: 999px;
  background: rgba(212, 212, 216, 0.45);
  border: 1px solid rgba(212, 212, 216, 0.9);
  overflow: hidden;
  margin-top: 10px;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), rgba(30, 41, 59, 0.7));
  transition: width 0.35s ease;
}
.log-list li {
  font-family: 'Inter', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
  color: #111827;
}
.log-list {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 6px;
}

.dual-progress-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 880px) {
  .dual-progress-grid {
    grid-template-columns: 1fr;
  }
}

.progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

/* --- Tabs --- */
.tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  justify-content: center;
}
.tab-btn {
  background: rgba(212, 212, 216, 0.35);
  border: 1px solid rgba(212, 212, 216, 0.9);
  color: #18181b;
  border-radius: 999px;
  padding: 10px 16px;
  min-width: 260px;
  max-width: 360px;
  text-align: center;
  font-weight: 700;
  cursor: pointer;
}
.tab-btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* --- Report downloads --- */
.section-rule {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0; /* Clear breathing room between sections */
}
.download-buttons {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: 16px;
  margin: 24px auto 32px;
  max-width: 1100px;
  flex-wrap: wrap;
}
.download-btn {
  flex: 1 1 0;
  min-width: 200px;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 20px;
  border-radius: 12px;
  border: 2px solid;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  white-space: normal;
  line-height: 1.3;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.download-btn::before {
  display: none; /* Remove the standard button shine */
}
.download-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  text-decoration: none;
}
.download-btn:active {
  transform: translateY(-1px);
}
.download-btn-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.download-btn-text {
  display: block;
  max-width: 100%;
}
.download-btn-internal {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  border-color: #9ca3af;
  color: #1f2937;
}
.download-btn-internal:hover {
  background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
  border-color: #6b7280;
  color: #111827;
}
.download-btn-online {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: #60a5fa;
  color: #1e40af;
}
.download-btn-online:hover {
  background: linear-gradient(135deg, #bfdbfe 0%, #93c5fd 100%);
  border-color: #3b82f6;
  color: #1e3a8a;
}
.download-btn-bib {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border-color: #34d399;
  color: #065f46;
}
.download-btn-bib:hover {
  background: linear-gradient(135deg, #a7f3d0 0%, #6ee7b7 100%);
  border-color: #10b981;
  color: #064e3b;
}

/* Responsive: Stack buttons on mobile */
@media (max-width: 720px) {
  .download-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  .download-btn {
    max-width: none;
    width: 100%;
  }
}

.report-title {
  text-align: center;
}
.report-source {
  text-align: center;
}

button:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}
button:disabled { opacity: 0.7; cursor: wait; }
button[disabled] { cursor: not-allowed; }

/* --- Layout Components --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px; /* Increased padding */
  box-shadow: var(--shadow-lg); /* Soft, large-spread shadow */
  margin-bottom: 20px;
}
.card-tint-neutral { background: var(--bg-card-neutral); }
.card-tint-cool { background: var(--bg-card-cool); }
.card-tint-privacy { background: var(--bg-card-privacy); }

.or-divider {
  text-align: center;
  margin: 20px 0;
  position: relative;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}
.or-divider::before, .or-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 45%;
  height: 1px;
  background: var(--border);
}
.or-divider::before { left: 0; }
.or-divider::after { right: 0; }

.meta { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 30px; }
.hint { font-size: 0.85rem; color: var(--text-muted); margin-top: 10px; text-align: center; }
.error { background: #fee2e2; border: 1px solid #fecaca; color: #b91c1c; padding: 12px; border-radius: var(--radius); margin-bottom: 20px; }
.warning { background: rgba(245, 158, 11, 0.14); border: 1px solid rgba(245, 158, 11, 0.28); color: #854d0e; padding: 12px; border-radius: var(--radius); margin-bottom: 20px; }

/* --- Header / Landing --- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 240px;
}
.brand-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.06);
  background: white;
  object-fit: cover;
}
.brand-logo-sm { width: 42px; height: 42px; border-radius: 12px; }
.brand-name {
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.2rem;
  color: #18181b;
}
.brand-link { text-decoration: none; color: inherit; }
.brand-link:hover { text-decoration: none; }
.topnav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.topnav .btn {
  padding: 6px 10px;
  min-height: 30px;
  font-size: 0.92rem;
  line-height: 1.2;
  box-shadow: none;
}
.topnav .btn-secondary {
  border-color: #cbd5e1;
}

.landing-banner { display: flex; justify-content: center; margin: 14px 0 26px; }
.landing-banner-img {
  width: 70%;
  height: auto;
  border: 2px solid #111;
  border-radius: 10px;
  display: block;
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: -0.01em;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.7);
  color: #18181b;
  white-space: nowrap;
}

/* Allow long result badges to wrap inside fixed-width result table cells. */
.results-table .badge {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.2;
}
.badge-inline {
  margin-left: 8px;
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 800;
  vertical-align: middle;
}
.badge-active { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.25); color: #166534; }
.badge-free { background: rgba(82, 82, 91, 0.08); border-color: rgba(82, 82, 91, 0.18); color: #3f3f46; }
.badge-warn { background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.25); color: #854d0e; }
.badge-danger { background: rgba(239, 68, 68, 0.10); border-color: rgba(239, 68, 68, 0.25); color: #b91c1c; }

/* --- Tables --- */
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.stacked-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 10px;
}
.legend-item { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; }
.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.25);
  display: inline-block;
}
.stacked-bar {
  position: relative;
  width: 100%;
  height: 24px; /* Thinner bar */
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); /* Subtle inner shadow */
}
.stacked-bar-fill {
  position: absolute;
  inset: 0;
  display: flex;
  border-radius: var(--radius);
  overflow: hidden;
}
.seg-fill {
  height: 100%;
  flex: 0 0 auto;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08); /* Recessed look */
}
.seg-verified { background: rgba(34, 197, 94, 0.18); }
.seg-review { background: rgba(245, 158, 11, 0.18); }
.seg-notfound { background: rgba(239, 68, 68, 0.16); }
.stacked-bar-labels {
  position: absolute;
  inset: 0;
  display: flex;
  pointer-events: none;
}
.seg-label-block {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  flex: 0 0 auto;
  overflow: hidden;
}
.seg-label {
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0 8px;
  text-align: center;
  white-space: nowrap;
  color: #111;
  text-shadow: 0 1px 0 rgba(255,255,255,0.85);
}
.results-table {
  width: 100%;
  max-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  table-layout: fixed;
}
.results-table th,
.results-table td {
  padding: 16px 12px; /* Increased padding */
  border-bottom: 1px solid var(--border); /* Only horizontal lines */
  border-left: none; /* Remove vertical borders */
  border-right: none; /* Remove vertical borders */
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.results-table th {
  background: var(--bg-card-cool);
  color: #18181b;
  font-weight: 800;
  font-size: 0.9rem;
}
.results-table tr:last-child td { border-bottom: none; }
.results-table td { font-size: 0.9rem; }
.results-table .ai-cell {
  white-space: pre-wrap;
  color: var(--text-muted);
  background: #f8fafc; /* Slightly different background */
  font-style: italic; /* Italicized font to distinguish System Output from User Data */
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: stretch;
  margin-top: 10px;
  margin-bottom: 64px;
  padding-bottom: 4px;
}
@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
}
.hero-copy { display: flex; flex-direction: column; min-height: 100%; }
.note { margin-top: auto; }
.card-header-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.hero-media { display: flex; flex-direction: column; gap: 18px; }
.hero-media .card { width: 100%; display: flex; flex-direction: column; }

/* --- Landing carousel --- */
.carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  background: #f8fafc;
}
.carousel-container {
  position: relative;
  width: 100%;
  min-height: 300px;
}
.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}
.carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
  position: relative;
}
.carousel-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  background: white;
}
.carousel-zoom {
  position: absolute;
  top: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(24, 24, 27, 0.88);
  color: white;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  transition: background 0.2s;
  z-index: 10;
}
.carousel-zoom:hover { background: rgba(24, 24, 27, 0.96); }
.carousel-zoom:active { transform: translateY(1px); }
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.95);
  color: #18181b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: all 0.2s;
  z-index: 10;
}
.carousel-btn:hover {
  background: white;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  transform: translateY(-50%) scale(1.05);
}
.carousel-btn:active { transform: translateY(-50%) scale(0.98); }
.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }
.carousel-indicators {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}
.carousel-indicator {
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.2);
  background: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: all 0.3s;
}
.carousel-indicator:hover {
  background: rgba(255,255,255,0.9);
  transform: scale(1.2);
}
.carousel-indicator.active {
  background: white;
  width: 24px;
  border-radius: 4px;
}
@media (max-width: 720px) {
  .carousel-container { min-height: 250px; }
  .carousel-img { max-height: 320px; }
  .carousel-btn { width: 36px; height: 36px; }
  .carousel-zoom { width: 38px; height: 38px; top: 20px; right: 20px; }
}
.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding-top: 12px;
}
@media (min-width: 900px) {
  .features { grid-template-columns: 1fr 1fr; }
}
.features-full { grid-template-columns: 1fr; }
.footer { margin-top: 28px; text-align: center; }

/* --- ROI CTA / Calculator --- */
.hero-copy { gap: 18px; }
.hero-copy .card { margin-bottom: 0; }
@media (min-width: 900px) {
  .hero-copy { justify-content: space-between; }
}
.hero-roi-actions { margin-top: 14px; display: flex; }
.hero-roi-actions .btn { width: 100%; }
.hero-roi-card { display: flex; flex-direction: column; }
.hero-actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 720px) {
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
}

.roi-hero { border-color: var(--border); }
.roi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}
.roi-grid-single { grid-template-columns: 1fr; }
.roi-form { display: grid; gap: 16px; }
.roi-form-center { justify-items: center; }
.roi-field { margin-bottom: 2px; }
.roi-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.roi-row-center { justify-content: center; }
.roi-field label { text-align: center; }
.roi-prefix, .roi-suffix {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.6);
  font-weight: 800;
  color: #18181b;
}
.roi-prefix { min-width: 42px; text-align: center; }
input.roi-num {
  width: 56px;
  max-width: 56px;
  text-align: center;
  padding: 7px 8px;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.2;
  height: 38px;
  box-sizing: border-box;
}
input.roi-num::-webkit-outer-spin-button,
input.roi-num::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input.roi-num {
  -moz-appearance: textfield;
  appearance: textfield;
}
.roi-tip { text-align: center; margin-top: 8px; }
.roi-auto { text-align: center; }

.segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.65);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.seg-btn {
  width: auto;
  padding: 10px 14px;
  background: transparent;
  color: var(--primary);
  border: 0;
  border-radius: 0;
  border-right: 1px solid var(--border);
  font-weight: 700;
  cursor: pointer;
}
.seg-btn:last-child { border-right: 0; }
.seg-btn:hover { background: rgba(30, 41, 59, 0.06); }
.seg-btn.is-on {
  background: var(--primary);
  color: white;
}

.roi-details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(246, 248, 251, 0.8);
  padding: 12px 14px;
}
.roi-details summary {
  cursor: pointer;
  font-weight: 700;
  color: #18181b;
}
.roi-details-body { margin-top: 12px; }

.roi-actions button { width: 100%; font-size: 1rem; font-weight: 700; }

.roi-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0 2px;
}
.roi-results { display: grid; gap: 16px; }
.roi-results-center { justify-items: center; text-align: center; }
.roi-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.roi-kpis-single { grid-template-columns: 1fr; max-width: 720px; width: 100%; }
.roi-kpi {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(246, 248, 251, 0.7));
  padding: 14px;
}
.roi-kpi-label { font-weight: 700; color: var(--primary); font-size: 0.95rem; }
.roi-kpi-strong { padding: 18px; }
.roi-kpi-main { font-weight: 800; font-size: 2.1rem; letter-spacing: -0.03em; color: #18181b; margin-top: 10px; text-align: center; }
.roi-kpi-main-green { color: #166534; }
.roi-kpi-sub { color: var(--text-muted); font-weight: 800; margin-top: 2px; }

.roi-next { display: flex; gap: 10px; flex-wrap: wrap; }
.roi-next .btn { width: auto; }
@media (max-width: 720px) {
  .roi-next { flex-direction: column; }
  .roi-next .btn { width: 100%; }
}
.roi-next-center { justify-content: center; }

/* --- Pricing --- */
.price { font-size: 2.1rem; font-weight: 700; color: #18181b; letter-spacing: -0.03em; }
.price-unit { font-size: 1rem; font-weight: 700; color: var(--text-muted); margin-left: 6px; }

.pricing-pack-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 14px;
}
@media (min-width: 900px) {
  .pricing-pack-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
  }
}
.pricing-pack {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(246, 248, 251, 0.75));
  display: flex;
  flex-direction: column;
}
.pricing-pack-top {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(246, 248, 251, 0.75);
  text-align: center;
}
.pricing-pack-credits { font-weight: 700; color: #18181b; font-size: 0.95rem; }
.pricing-pack-price { font-weight: 800; font-size: 1.5rem; letter-spacing: -0.03em; color: #18181b; margin-top: 4px; }
.pricing-pack-sub { color: var(--text-muted); font-weight: 800; margin-top: 2px; font-size: 0.85rem; }
.pricing-pack-body { padding: 12px; display: grid; gap: 8px; }
.pricing-pack-what { font-weight: 700; color: var(--primary); font-size: 0.85rem; }
.pricing-pack-list { margin: 0; font-size: 0.85rem; }
.pricing-pack .btn { width: 100%; box-shadow: none; }

/* --- FAQ --- */
.faq-hero { border-color: var(--border); }
.faq-section { border-color: var(--border); }
.faq-list { display: grid; gap: 10px; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.9);
  padding: 10px 12px;
}
.faq-item[open] { background: rgba(246, 248, 251, 0.85); }
.faq-q {
  cursor: pointer;
  font-weight: 700;
  color: #18181b;
  list-style: none;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-a { margin-top: 10px; }
.faq-a .meta { margin-top: 0; }

/* --- Modal (screenshot zoom) --- */
body.modal-open { overflow: hidden; }
.modal { display: none; position: fixed; inset: 0; z-index: 50; }
.modal.is-open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(24, 24, 27, 0.6); }
.modal-content {
  position: relative;
  max-width: min(1100px, 92vw);
  max-height: 90vh;
  margin: 5vh auto 0 auto;
  background: white;
  border-radius: var(--radius);
  border: 1px solid rgba(0,0,0,0.12);
  box-shadow: 0 18px 60px rgba(0,0,0,0.25);
  overflow: hidden;
}
.modal-content-text { max-width: min(640px, 92vw); }
.modal-image { display: block; width: 100%; height: auto; max-height: 90vh; object-fit: contain; background: #fff; }
.modal-body { padding: 22px; }
.modal-title { margin: 0 0 10px; font-size: 1.2rem; color: #18181b; }
.modal-text { margin: 0; color: var(--text-muted); font-weight: 650; }
.modal-actions { margin-top: 22px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.modal-actions .btn { width: auto; box-shadow: none; }
.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(255,255,255,0.96);
  color: #b91c1c;
  font-size: 24px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: white; }

/* --- Dropzone --- */
.dropzone {
  border: 2px dashed #cbd5e1; /* Larger gap dashed border */
  border-radius: var(--radius);
  background: linear-gradient(to bottom, #ffffff, #f8fafc); /* Atmospheric gradient */
  padding: 18px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.dropzone:hover {
  background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
  border-color: #94a3b8;
}
.dropzone.dragover {
  background: linear-gradient(to bottom, #f1f5f9, #e2e8f0);
  border-color: var(--primary);
  transform: translateY(-1px);
}
.dropzone-title { font-weight: 800; color: #18181b; margin-bottom: 4px; }
.dropzone-meta { color: var(--text-muted); font-size: 0.9rem; margin: 0; }
.file-hidden { display: none !important; }
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 12px;
  flex-wrap: wrap;
}
.file-choose-btn {
  width: auto;
  padding: 8px 12px;
}
.file-picked { color: var(--text-muted); font-size: 0.9rem; flex: 1 1 auto; }
.dropzone.is-disabled { opacity: 0.65; pointer-events: none; }

/* --- Dashboard Grid Layout --- */
.dashboard-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr; /* Mobile default */
  margin-bottom: 24px;
}

@media (min-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr 1fr; /* 50/50 split */
    align-items: start;
  }
}

.col-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* --- Lists & Highlights --- */
.simple-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.simple-list li {
  padding: 8px 0;
  border-bottom: 1px solid #f4f4f5;
  font-size: 0.95rem;
}
.simple-list li:last-child { border-bottom: none; }
.muted { color: var(--text-muted); font-style: italic; }

.doc-panel {
  background: white;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: "Charter", "Bitstream Charter", "Sitka Text", Cambria, serif; /* Modern Serif for editorial feel */
  line-height: 1.8;
  color: #333;
  margin-bottom: 24px;
  max-height: 600px;
  overflow-y: auto;
}

/* --- Citation Highlights --- */
.cit { padding: 2px 4px; border-radius: 4px; border-bottom: 2px solid transparent; cursor: help; transition: all 0.2s;}
.cit:hover { filter: brightness(0.95); }

.cit-matched { background: var(--cit-matched-bg); border-color: var(--cit-matched-border); color: #166534; }
.cit-missing { background: var(--cit-missing-bg); border-color: var(--cit-missing-border); color: #991b1b; }
.cit-ambiguous { background: var(--cit-ambiguous-bg); border-color: var(--cit-ambiguous-border); color: #854d0e; }
.cit-suggested { background: var(--cit-suggested-bg); border-color: var(--cit-suggested-border); color: #075985; }

.bib-entry { padding: 10px; border-radius: 6px; margin-bottom: 8px; font-size: 0.95rem; }
.bib-unused { background: #fff1f2; border-left: 4px solid #fda4af; }
.bib-used { background: #f8fafc; border-left: 4px solid #e2e8f0; }

/* --- Validation KPI Dashboard --- */
.validation-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
  justify-items: center; /* Center circles in their grid cells */
}

.validation-kpi {
  position: relative;
  background: white;
  border-radius: 50%; /* Circular shape */
  padding: 20px 12px;
  text-align: center;
  aspect-ratio: 1; /* Force perfect circle */
  width: 100%;
  max-width: 160px; /* Prevent circles from getting too large on desktop */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.validation-kpi:hover {
  transform: scale(1.05);
}

.validation-kpi-verified {
  border: 5px solid #22c55e; /* Thick green border */
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.1);
}

.validation-kpi-review {
  border: 5px solid #f59e0b; /* Thick orange border */
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.1);
}

.validation-kpi-notfound {
  border: 5px solid #ef4444; /* Thick red border */
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.1);
}

.validation-kpi-icon {
  font-size: 1.5rem;
  margin-bottom: 4px;
  font-weight: 700;
}

.validation-kpi-verified .validation-kpi-icon { color: #16a34a; }
.validation-kpi-review .validation-kpi-icon { color: #f59e0b; }
.validation-kpi-notfound .validation-kpi-icon { color: #ef4444; }

.validation-kpi-value {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 2px;
}

.validation-kpi-verified .validation-kpi-value { color: #166534; }
.validation-kpi-review .validation-kpi-value { color: #854d0e; }
.validation-kpi-notfound .validation-kpi-value { color: #b91c1c; }

.validation-kpi-pct {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.validation-kpi-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #18181b;
}

.validation-total {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted);
  padding: 12px;
  background: rgba(246, 248, 251, 0.5);
  border-radius: 8px;
  margin-bottom: 8px;
}

.validation-total strong {
  color: #18181b;
  font-weight: 700;
}

.validation-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 212, 216, 0.6), transparent);
  margin: 24px 0;
}

.validation-sources {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
}

.validation-source {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.04), rgba(246, 248, 251, 0.8));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s;
}

.validation-source:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.validation-source-count {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 6px;
}

.validation-source-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

@media (max-width: 600px) {
  .validation-kpis {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .validation-kpi {
    padding: 18px 12px;
  }

  .validation-kpi-value {
    font-size: 2rem;
  }

  .validation-kpi-icon {
    font-size: 1.3rem;
  }

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

/* --- Online validation visualiser (prototype) --- */
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.online-viz-modal-content { max-width: min(1180px, 98vw); max-height: 92vh; overflow: auto; }
.online-viz-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.online-viz-sub { font-weight: 750; }
.online-viz-board {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.9), rgba(241, 245, 249, 0.6));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.online-viz-svg { width: 100%; height: min(68vh, 640px); display: block; }
