/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --navy:       #0d1b2a;
  --navy-mid:   #162032;
  --navy-light: #1e2f45;
  --red:        #d0282e;
  --red-hover:  #b01f24;
  --white:      #ffffff;
  --off-white:  #f4f5f7;
  --muted:      #8a99aa;
  --border:     rgba(255,255,255,0.08);
  --radius:     10px;
  --shadow:     0 4px 24px rgba(0,0,0,0.35);
  --font:       'Inter', system-ui, -apple-system, sans-serif;
}

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

/* Ensure [hidden] always wins over class-level display rules */
[hidden] { display: none !important; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden; /* prevent any child from causing horizontal page scroll */
}

body {
  font-family: var(--font);
  background: var(--navy);
  color: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* belt-and-suspenders: clips any overflow before scrollbar appears */
}

main { flex: 1; }

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box; /* redundant with *, kept for explicitness */
}

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--white);
  text-decoration: none;
}

.logo span, .logo-small span { color: var(--red); }

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

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

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

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  padding: 80px 0 100px;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 60px;
  align-items: center;
}

.hero-text h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 20px;
}

.accent { color: var(--red); }

.subheadline {
  font-size: 1.1rem;
  color: #aabbc8;
  line-height: 1.7;
  max-width: 480px;
  margin-bottom: 28px;
}

.trust-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trust-list li {
  font-size: 0.9rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.check {
  color: var(--red);
  font-weight: 700;
}

/* ── Upload card ────────────────────────────────────────── */
.upload-card {
  background: var(--navy-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.drop-zone {
  border: 2px dashed rgba(208, 40, 46, 0.4);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.15s;
  outline: none;
}

.drop-zone:hover,
.drop-zone:focus {
  border-color: var(--red);
  background: rgba(208, 40, 46, 0.05);
}

.drop-zone.drag-over {
  border-color: var(--red);
  border-style: solid;
  background: rgba(208, 40, 46, 0.08);
  box-shadow: 0 0 0 4px rgba(208, 40, 46, 0.15);
  transform: scale(1.01);
}

.drop-icon {
  color: var(--red);
  margin-bottom: 14px;
  display: flex;
  justify-content: center;
}

.drop-label {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.drop-sub {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.link-text {
  color: var(--red);
  font-weight: 600;
  cursor: pointer;
}

.drop-hint {
  font-size: 0.775rem;
  color: var(--muted);
}

/* file preview */
.file-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--navy-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 14px;
}

.file-name {
  flex: 1;
  font-size: 0.875rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}

.remove-btn:hover { color: var(--red); }

/* security notice */
/* upgraded privacy block */
.upload-privacy-block {
  background: rgba(74, 222, 128, 0.07);
  border: 1px solid rgba(74, 222, 128, 0.2);
  border-radius: 10px;
  padding: 12px 16px;
  margin-top: 18px;
}
.upload-privacy-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: #d4fce8;
  font-weight: 600;
}
.upload-privacy-row svg {
  flex-shrink: 0;
  stroke: #4ade80;
  color: #4ade80;
}
.upload-privacy-sub {
  font-size: 0.78rem;
  color: rgba(74,222,128,0.7);
  margin-top: 4px;
  padding-left: 24px;
}

/* keep old class for any legacy references */
.upload-security-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 14px;
}
.upload-security-notice svg {
  width: 13px; height: 13px; flex-shrink: 0;
  stroke: #4caf7d; color: #4caf7d;
}

/* error */
.upload-error {
  background: rgba(208, 40, 46, 0.12);
  border: 1px solid rgba(208, 40, 46, 0.4);
  border-radius: 8px;
  color: #f88;
  font-size: 0.85rem;
  padding: 10px 14px;
  margin-top: 14px;
}

/* buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: var(--red);
  color: var(--white);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  padding: 14px 24px;
  margin-top: 20px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover:not(:disabled) {
  background: var(--red-hover);
  text-decoration: none;
}

.btn-primary:active:not(:disabled) { transform: scale(0.98); }

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 24px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--muted);
  color: var(--white);
}

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

/* spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.upload-disclaimer {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin-top: 14px;
  line-height: 1.5;
}

/* ── How it works ───────────────────────────────────────── */
.how-it-works {
  background: var(--navy-mid);
  border-top: 1px solid var(--border);
  padding: 80px 0;
}

.how-it-works h2 {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 48px;
}

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

.step {
  text-align: center;
  padding: 0 16px;
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(208, 40, 46, 0.15);
  border: 1px solid rgba(208, 40, 46, 0.4);
  color: var(--red);
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

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

.step p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.65;
}

/* ── Results page ───────────────────────────────────────── */
.results-main { padding: 60px 0; }

.results-header { margin-bottom: 36px; }

.results-header h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

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

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 36px;
}

.result-card {
  background: var(--navy-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

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

.card-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
}

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 100px;
  padding: 3px 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-coming-soon {
  background: rgba(255,255,255,0.07);
  color: var(--muted);
  border: 1px solid var(--border);
}

.placeholder-text {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 18px;
}

.risk-bar-placeholder {
  height: 8px;
  background: var(--navy-light);
  border-radius: 100px;
  overflow: hidden;
}

.risk-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--red);
  border-radius: 100px;
}

.placeholder-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton {
  height: 18px;
  background: linear-gradient(90deg, var(--navy-light) 25%, var(--navy-mid) 50%, var(--navy-light) 75%);
  background-size: 200% 100%;
  border-radius: 6px;
  animation: shimmer 1.5s infinite;
}

.skeleton:nth-child(2) { width: 75%; }
.skeleton:nth-child(3) { width: 60%; }

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.legal-disclaimer {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

/* ── Why RedLine section ─────────────────────────────────── */
.why-redline {
  padding: 80px 0;
  background: var(--navy-mid);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.why-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.why-text h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 18px;
  color: var(--white);
}
.why-text h2::before {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  background: var(--red);
  border-radius: 2px;
  margin-bottom: 16px;
}
.why-text p {
  color: var(--muted);
  line-height: 1.75;
  font-size: 0.975rem;
  margin-bottom: 14px;
}
.why-stats {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.why-stat {
  border-left: 3px solid var(--red);
  padding-left: 20px;
}
.why-stat-num {
  display: block;
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--white);
  line-height: 1.1;
}
.why-stat-label {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}
@media (max-width: 700px) {
  .why-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .why-stats {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
  }
  .why-stat { flex: 1 1 140px; }
}

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  background: var(--navy);  /* matches header bg — consistent dark navy throughout */
}

.site-footer .container {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-small {
  font-size: 1rem;
  font-weight: 800;
  color: var(--white);
}

.site-footer p {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .steps {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }

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

@media (max-width: 560px) {
  .hero { padding: 48px 0 60px; }
  .results-actions { flex-direction: column; align-items: stretch; }
  .results-actions .btn-secondary { text-align: center; }
}

/* ── Results: loading + error states ────────────────────────── */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 80px 0;
}

.spinner-lg { width: 40px; height: 40px; border-width: 3px; }
.loading-text { color: var(--muted); font-size: 1rem; }

/* ── Analysis complete state ────────────────────────────────── */
.complete-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 80px 0;
  animation: completeIn 0.35s ease-out both;
}

.complete-exit {
  opacity: 0;
  transition: opacity 0.35s ease-out;
}

.complete-check {
  display: flex;
  justify-content: center;
  filter: drop-shadow(0 0 18px rgba(76, 175, 125, 0.35));
}

.checkmark-svg {
  width: 96px;
  height: 96px;
}

/* Circle traces itself in */
.checkmark-circle {
  stroke-dasharray: 276;
  stroke-dashoffset: 276;
  transform-origin: center;
  animation: drawCircle 0.55s cubic-bezier(0.4, 0, 0.2, 1) 0.1s forwards;
}

/* Check stroke draws after the circle finishes */
.checkmark-path {
  stroke-dasharray: 90;
  stroke-dashoffset: 90;
  animation: drawCheck 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.55s forwards;
}

@keyframes drawCircle {
  to { stroke-dashoffset: 0; }
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

.complete-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #4caf7d;
  letter-spacing: -0.3px;
  animation: completeLabelIn 0.4s ease-out 0.8s both;
}

.complete-sub {
  font-size: 0.85rem;
  color: var(--muted);
  animation: completeLabelIn 0.4s ease-out 1s both;
}

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

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

/* Results section fades in when revealed */
.results-reveal {
  animation: resultsIn 0.5s ease-out both;
}

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

.error-card {
  background: rgba(208,40,46,0.08);
  border: 1px solid rgba(208,40,46,0.3);
  border-radius: var(--radius);
  padding: 28px;
  color: #f88;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ── Score hero ───────────────────────────────────────────────── */
.score-hero {
  display: flex;
  align-items: center;
  background: var(--navy-mid);
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-left: 5px solid var(--border);   /* overridden by variant classes */
  border-radius: var(--radius);
  padding: 36px 44px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  transition: border-left-color 0.4s ease;
}

/* Left accent stripe — color-coded by verdict */
.score-hero-verdict-low    { border-left-color: #22c55e; }
.score-hero-verdict-review { border-left-color: #f59e0b; }
.score-hero-verdict-high   { border-left-color: #d0282e; }

.score-hero-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.score-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.hero-number-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.hero-score-value {
  font-size: 6.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -4px;
  /* Color transitions with the verdict */
  transition: color 0.4s ease;
}

/* Score number inherits verdict color */
.score-hero-verdict-low    .hero-score-value { color: #4ade80; }
.score-hero-verdict-review .hero-score-value { color: #fbbf24; }
.score-hero-verdict-high   .hero-score-value { color: #f87171; }

.hero-score-denom {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: -1px;
}

.score-hero-divider {
  width: 1px;
  align-self: stretch;
  background: var(--border);
  margin: 0 44px;
  flex-shrink: 0;
}

.score-hero-verdict {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

/* Verdict badge — larger in the hero */
.verdict-badge {
  font-size: 1.25rem;
  font-weight: 800;
  padding: 10px 22px;
  border-radius: 100px;
  display: inline-block;
  letter-spacing: -0.3px;
}

.verdict-low    { background: rgba(34,197,94,0.15);  color: #4ade80; border: 1px solid rgba(34,197,94,0.35); }
.verdict-review { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.35); }
.verdict-high   { background: rgba(208,40,46,0.15);  color: #f87171; border: 1px solid rgba(208,40,46,0.35); }

/* ── Risk pip track ───────────────────────────────────────────── */
.risk-track {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

@keyframes pipIn {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}

.risk-pip {
  flex: 1;
  height: 7px;
  border-radius: 4px;
  transform-origin: left center;
  animation: pipIn 0.28s ease-out both;
}

.risk-pip-empty { background: var(--navy-light); animation: none; opacity: 0.45; }
.pip-low        { background: #22c55e; }
.pip-medium     { background: #f59e0b; }
.pip-high       { background: #d0282e; }

.risk-track-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 32px;
  padding: 0 1px;
}

/* ── Result cards ─────────────────────────────────────────────── */
.result-card {
  background: var(--navy-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 16px;
}

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

.card-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1rem;
  font-weight: 700;
}

.card-icon {
  width: 17px;
  height: 17px;
  stroke: var(--red);
  flex-shrink: 0;
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 100px;
  padding: 3px 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-count {
  background: rgba(255,255,255,0.07);
  color: var(--white);
  border: 1px solid var(--border);
}

.badge-coming-soon {
  background: rgba(255,255,255,0.07);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* ── Summary ──────────────────────────────────────────────────── */
.summary-text {
  font-size: 1rem;
  line-height: 1.85;
  color: #c5d2de;
}

/* ── Flagged clause cards ─────────────────────────────────────── */
.clause-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.clause-item {
  background: var(--navy-light);
  border-top:    1px solid var(--border);
  border-right:  1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-left:   4px solid transparent;
  border-radius: 8px;
  padding: 18px 20px 18px 22px;
  transition: border-left-color 0.2s;
}

/* Left-border color encodes risk level at a glance */
.clause-item-high    { border-left-color: rgba(208, 40, 46, 0.80); }
.clause-item-medium  { border-left-color: rgba(245,158, 11, 0.80); }
.clause-item-low     { border-left-color: rgba( 34,197, 94, 0.80); }
.clause-item-unknown { border-left-color: var(--border); }

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

.clause-risk {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 11px;
  border-radius: 100px;
}

.clause-risk-high    { background: rgba(208,40,46,0.18);  color: #f87171; border: 1px solid rgba(208,40,46,0.35); }
.clause-risk-medium  { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.30); }
.clause-risk-low     { background: rgba(34,197,94,0.12);  color: #4ade80; border: 1px solid rgba(34,197,94,0.25); }
.clause-risk-unknown { background: rgba(255,255,255,0.06); color: var(--muted); border: 1px solid var(--border); }

.clause-number {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

.clause-text {
  font-size: 0.9rem;
  color: #8a99aa;
  border-left: 2px solid rgba(255,255,255,0.1);
  padding-left: 14px;
  margin: 0 0 14px;
  line-height: 1.7;
  font-style: italic;
}

.clause-suggestion {
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.suggestion-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.clause-suggestion p {
  font-size: 0.9rem;
  color: #c5d2de;
  line-height: 1.7;
  margin: 0;
}

/* ── Missing protections ──────────────────────────────────────── */
.missing-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.missing-item {
  font-size: 0.9rem;
  color: #c5d2de;
  padding: 11px 16px 11px 40px;
  background: var(--navy-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  position: relative;
  line-height: 1.55;
}

.missing-item::before {
  content: '⚠';
  color: #fbbf24;
  position: absolute;
  left: 15px;
  top: 11px;
  font-size: 0.85rem;
}

/* ── Empty state + actions ────────────────────────────────────── */
.empty-notice {
  font-size: 0.875rem;
  color: var(--muted);
  font-style: italic;
}

.results-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.results-actions .btn-primary {
  width: auto;
  margin-top: 0;
}

.btn-print {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  white-space: nowrap;
}

.btn-print:hover {
  border-color: rgba(255,255,255,0.25);
  color: var(--white);
  background: rgba(255,255,255,0.04);
}

.btn-print svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  flex-shrink: 0;
}

/* ── Risk color helpers (used by dashboard too) ───────────────── */
.risk-low    { background: #22c55e; }
.risk-medium { background: #f59e0b; }
.risk-high   { background: #d0282e; }

/* ── Print / Save as PDF ──────────────────────────────────────── */
@media print {
  /* Force color output */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

  body { background: #fff !important; color: #111 !important; }

  /* Hide chrome */
  .site-header,
  .site-footer,
  .results-actions,
  #loadingState,
  #errorState { display: none !important; }

  /* Legal disclaimer stays, but smaller */
  .legal-disclaimer {
    font-size: 0.72rem;
    color: #888 !important;
    border-top-color: #ddd !important;
  }

  /* Report header with auto-stamped date */
  #resultsHeader::after {
    content: 'Generated by RedLine · ' attr(data-date);
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-top: 4px;
  }

  .results-main { padding: 0 !important; }

  /* Hero */
  .score-hero {
    background: #fff !important;
    box-shadow: none !important;
    border-right-color: #ddd !important;
    border-top-color: #ddd !important;
    border-bottom-color: #ddd !important;
    padding: 24px 32px !important;
    break-inside: avoid;
  }

  .score-hero-verdict-low    { border-left-color: #16a34a !important; }
  .score-hero-verdict-review { border-left-color: #d97706 !important; }
  .score-hero-verdict-high   { border-left-color: #dc2626 !important; }

  .score-hero-verdict-low    .hero-score-value { color: #16a34a !important; }
  .score-hero-verdict-review .hero-score-value { color: #d97706 !important; }
  .score-hero-verdict-high   .hero-score-value { color: #dc2626 !important; }

  .hero-score-value   { font-size: 4rem !important; letter-spacing: -2px !important; }
  .hero-score-denom   { color: #666 !important; }
  .score-eyebrow      { color: #666 !important; }
  .score-hero-divider { background: #ddd !important; }

  .verdict-low    { background: #dcfce7 !important; color: #15803d !important; border-color: #86efac !important; }
  .verdict-review { background: #fef3c7 !important; color: #b45309 !important; border-color: #fcd34d !important; }
  .verdict-high   { background: #fee2e2 !important; color: #b91c1c !important; border-color: #fca5a5 !important; }

  /* Pip track */
  .risk-track { margin-bottom: 6px !important; }
  .risk-pip          { animation: none !important; }
  .risk-pip-empty    { background: #e5e7eb !important; opacity: 1 !important; }
  .pip-low           { background: #16a34a !important; }
  .pip-medium        { background: #d97706 !important; }
  .pip-high          { background: #dc2626 !important; }
  .risk-track-labels { color: #888 !important; margin-bottom: 20px !important; }

  /* Cards */
  .result-card {
    background: #fff !important;
    border-color: #e5e7eb !important;
    box-shadow: none !important;
    break-inside: avoid;
    margin-bottom: 12px !important;
    padding: 20px 24px !important;
  }

  .card-title { color: #111 !important; }
  .card-icon  { stroke: #dc2626 !important; }
  .summary-text { color: #374151 !important; }

  /* Clauses */
  .clause-item {
    background: #f9fafb !important;
    border-top-color:    #e5e7eb !important;
    border-right-color:  #e5e7eb !important;
    border-bottom-color: #e5e7eb !important;
    break-inside: avoid;
  }

  .clause-item-high   { border-left-color: #dc2626 !important; }
  .clause-item-medium { border-left-color: #d97706 !important; }
  .clause-item-low    { border-left-color: #16a34a !important; }

  .clause-risk-high   { background: #fee2e2 !important; color: #b91c1c !important; border-color: #fca5a5 !important; }
  .clause-risk-medium { background: #fef3c7 !important; color: #b45309 !important; border-color: #fcd34d !important; }
  .clause-risk-low    { background: #dcfce7 !important; color: #15803d !important; border-color: #86efac !important; }

  .clause-number { color: #9ca3af !important; }

  .clause-text {
    color: #6b7280 !important;
    border-left-color: #d1d5db !important;
  }

  .clause-suggestion {
    background: #f3f4f6 !important;
    border-color: #e5e7eb !important;
  }

  .suggestion-label { color: #6b7280 !important; }
  .clause-suggestion p { color: #374151 !important; }

  /* Missing protections */
  .missing-item {
    background: #fffbeb !important;
    border-color: #fde68a !important;
    color: #374151 !important;
  }

  .missing-item::before { color: #d97706 !important; }

  .empty-notice { color: #9ca3af !important; }
  .badge-count  { background: #f3f4f6 !important; color: #374151 !important; border-color: #e5e7eb !important; }
}

/* ── Nav v2 (auth-aware) ─────────────────────────────────────── */
.nav-link {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--white); text-decoration: none; }

.nav-email {
  font-size: 0.85rem;
  color: var(--muted);
}

.nav-plan-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(208,40,46,0.18);
  color: var(--red);
  border: 1px solid rgba(208,40,46,0.35);
  border-radius: 100px;
  padding: 2px 8px;
}

.btn-nav-cta {
  background: var(--red);
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-nav-cta:hover { background: var(--red-hover); text-decoration: none; }

.nav-logout {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}
.nav-logout:hover { color: var(--white); }

/* Admin-only nav link — red tint so owner can spot it quickly */
.nav-admin       { color: var(--red) !important; }
.nav-admin:hover { color: var(--red-hover) !important; text-decoration: none; }

/* ── Nav language selector ───────────────────────────────────── */
.nav-lang-wrap {
  display: flex;
  align-items: center;
}

.nav-lang-select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  line-height: inherit;
  transition: color 0.2s;
  /* Show a subtle dropdown caret via background image */
  padding-right: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
}
.nav-lang-select:hover  { color: var(--white); }
.nav-lang-select:focus  { outline: none; color: var(--white); }
.nav-lang-select option { background: #1a1a1f; color: var(--white); }

/* ── Auth pages ──────────────────────────────────────────────── */
.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--navy-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  box-shadow: var(--shadow);
}

.auth-header { margin-bottom: 28px; }
.auth-header h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 6px; }
.auth-sub { font-size: 0.9rem; color: var(--muted); }

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

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.label-hint { font-weight: 400; color: var(--muted); }

.form-group input {
  width: 100%;
  background: var(--navy-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--white);
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input::placeholder { color: var(--muted); }
.form-group input:focus { border-color: var(--red); }

/* ── Password show/hide toggle ─────────────────────── */
.pw-wrap {
  position: relative;
}
.pw-wrap input {
  padding-right: 2.75rem;
}
.pw-eye {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 0.25rem;
  display: flex;
  align-items: center;
  line-height: 1;
  transition: color 0.2s;
  /* 44×44 tap target */
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
}
.pw-eye:hover { color: var(--text); }

.auth-error {
  background: rgba(208,40,46,0.12);
  border: 1px solid rgba(208,40,46,0.4);
  border-radius: 8px;
  color: #f88;
  font-size: 0.85rem;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.auth-footer-text {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 20px;
}

/* ── Owner emergency access section ──────────────────────── */
.owner-emergency-section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
}
.owner-emergency-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.owner-emergency-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 10px 16px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.owner-emergency-btn:hover {
  border-color: rgba(255,255,255,0.35);
  color: var(--text);
}
.owner-emergency-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.owner-emergency-sent {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #4ade80;
}
.owner-emergency-error {
  margin-top: 10px;
  font-size: 0.82rem;
  color: #f88;
}
/* Banner: verified via email */
.owner-emergency-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(74,222,128,0.12);
  border: 1px solid rgba(74,222,128,0.3);
  border-radius: 8px;
  color: #4ade80;
  font-size: 0.85rem;
  padding: 10px 14px;
  margin-bottom: 20px;
}
.owner-emergency-expired {
  background: rgba(251,191,36,0.12);
  border: 1px solid rgba(251,191,36,0.3);
  border-radius: 8px;
  color: #fbbf24;
  font-size: 0.85rem;
  padding: 10px 14px;
  margin-bottom: 20px;
}

.forgot-link {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.forgot-link:hover { color: var(--red); }

.auth-forgot-row {
  text-align: center;
  margin-top: 14px;
  margin-bottom: 0;
}
.auth-forgot-row a {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
  min-height: 44px;           /* iOS tap target */
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
}
.auth-forgot-row a:hover { color: var(--red); }

/* ── Pricing page ────────────────────────────────────────────── */
.pricing-main {
  flex: 1;
  padding: 60px 0 80px;
}

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

.pricing-header h1 { font-size: 2rem; font-weight: 800; margin-bottom: 10px; }
.pricing-sub { font-size: 1rem; color: var(--muted); }

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 760px;
  margin: 0 auto 32px;
}

.pricing-card {
  background: var(--navy-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  position: relative;
}

.pricing-card-featured {
  border-color: rgba(208,40,46,0.45);
  box-shadow: 0 0 0 1px rgba(208,40,46,0.25);
}

.pricing-popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--red);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 14px;
  border-radius: 100px;
  white-space: nowrap;
}

.pricing-card-header { margin-bottom: 24px; }
.pricing-card-header h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; }

.price-display { display: flex; align-items: baseline; gap: 4px; }
.price-amount  { font-size: 2.5rem; font-weight: 800; line-height: 1; }
.price-period  { font-size: 0.9rem; color: var(--muted); }

.pricing-features {
  list-style: none;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pricing-features li {
  font-size: 0.9rem;
  color: #c5d2de;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pricing-card .btn-primary { margin-top: 0; }

.pricing-card-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 10px;
}

.pricing-disclaimer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── Dashboard ───────────────────────────────────────────────── */
.dash-main { padding: 48px 0 80px; }

.dash-error {
  color: #f88;
  font-size: 0.95rem;
  padding: 20px 0;
}

.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.dash-title { font-size: 1.8rem; font-weight: 800; margin-bottom: 4px; }
.dash-email { font-size: 0.9rem; color: var(--muted); }

.dash-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.dash-cta { width: auto; margin-top: 0; }

.plan-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 100px;
  white-space: nowrap;
}
.plan-free { background: rgba(255,255,255,0.08); color: var(--muted); border: 1px solid var(--border); }
.plan-pro  { background: rgba(208,40,46,0.15); color: #f87171; border: 1px solid rgba(208,40,46,0.35); }

.stats-row {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--navy-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

.stat-value { font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--muted); }

.upgrade-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(208,40,46,0.08);
  border: 1px solid rgba(208,40,46,0.25);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.upgrade-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.upgrade-text strong { font-size: 0.95rem; }
.upgrade-text span   { font-size: 0.85rem; color: var(--muted); }

.upgrade-btn { width: auto; margin-top: 0; white-space: nowrap; }

.portal-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--navy-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 24px;
  margin-bottom: 32px;
  font-size: 0.9rem;
  color: var(--muted);
  flex-wrap: wrap;
}

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

.reviews-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

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

.reviews-table th {
  background: var(--navy-mid);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 16px;
  text-align: left;
}

.reviews-table td {
  padding: 13px 16px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}

.reviews-table tr:hover td { background: rgba(255,255,255,0.02); }

.review-link { color: var(--white); font-weight: 500; }
.review-link:hover { color: var(--red); text-decoration: none; }

.td-filename { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.score-chip, .verdict-chip {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  white-space: nowrap;   /* prevent "Review Carefully" from wrapping inside the badge */
}

.score-chip.score-low    { background: rgba(34,197,94,0.15);  color: #4ade80; }
.score-chip.score-medium { background: rgba(245,158,11,0.15); color: #fbbf24; }
.score-chip.score-high   { background: rgba(208,40,46,0.15);  color: #f87171; }
.score-chip.score-unknown { background: rgba(255,255,255,0.07); color: var(--muted); }

.verdict-chip.verdict-low    { background: rgba(34,197,94,0.12);  color: #4ade80; }
.verdict-chip.verdict-review { background: rgba(245,158,11,0.12); color: #fbbf24; }
.verdict-chip.verdict-high   { background: rgba(208,40,46,0.12);  color: #f87171; }
.verdict-chip.verdict-unknown { background: rgba(255,255,255,0.07); color: var(--muted); }

.td-date { color: var(--muted); white-space: nowrap; }

/* ── Review table: card layout on mobile ─────────────────────── */
@media (max-width: 640px) {
  /* Unwrap the table structure into stacked blocks */
  .reviews-table,
  .reviews-table tbody   { display: block; }
  .reviews-table thead   { display: none; }   /* hide column headers — labels implied by layout */

  .reviews-table tr {
    display: block;
    padding: 12px 14px;
    border-top: 1px solid var(--border);
  }
  .reviews-table tr:first-child { border-top: none; }

  /* All cells become inline by default — then we override selectively */
  .reviews-table td {
    display: inline;
    padding: 0;
    border: none;
    vertical-align: middle;
  }

  /* Filename: own line, full width, normal truncation */
  .td-filename {
    display: block;
    max-width: 100%;
    margin-bottom: 7px;
    font-size: 0.875rem;
  }

  /* Score + verdict sit inline on the same line — handled by inline td default above */

  /* Date: own line beneath chips, smaller muted text */
  .td-date {
    display: block;
    margin-top: 5px;
    font-size: 0.75rem;
    white-space: nowrap;
  }
}

/* ── Stripe trust row (pricing page) ─────────────────────────── */
.stripe-trust-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
  font-size: 0.8rem;
  color: var(--muted);
}

.stripe-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}

.stripe-badge svg:first-child {
  width: 13px;
  height: 13px;
  stroke: #4caf7d;
  flex-shrink: 0;
}

.stripe-wordmark {
  width: 36px;
  height: auto;
  vertical-align: middle;
  color: #8a9bb5;
}

.stripe-trust-sep { color: var(--border); }

.stripe-trust-item { color: var(--muted); }

/* ── Legal pages (privacy / terms) ──────────────────────────── */
.legal-main { padding: 56px 0 100px; }

.legal-container { max-width: 720px; }

.legal-header {
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.legal-header h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 6px;
}

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

.legal-notice {
  background: rgba(208,40,46,0.07);
  border: 1px solid rgba(208,40,46,0.22);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 36px;
  line-height: 1.5;
}
.legal-notice strong { color: var(--text); }

.legal-section {
  margin-bottom: 36px;
}

.legal-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--white);
}

.legal-section h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 14px 0 6px;
  color: var(--white);
}

.legal-body p, .legal-body li {
  font-size: 0.93rem;
  line-height: 1.75;
  color: rgba(255,255,255,0.75);
}

.legal-body ul {
  padding-left: 20px;
  margin: 8px 0;
}

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

.legal-body a {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-body a:hover { opacity: 0.8; }

.legal-notice {
  background: rgba(208, 40, 46, 0.12);
  border: 1px solid rgba(208, 40, 46, 0.35);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 36px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--light);
}

.legal-body address {
  font-style: normal;
  line-height: 1.9;
  color: var(--light);
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.site-footer a:hover { color: var(--white); }

/* ── Rewrite Fairly card ─────────────────────────────────────── */
.rewrite-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, rgba(30,47,69,0.9), rgba(22,32,50,0.9));
  border: 1px solid rgba(255,255,255,0.1);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 24px;
}

.rewrite-card-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: rgba(208,40,46,0.12);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
}

.rewrite-card-icon svg { width: 22px; height: 22px; }

.rewrite-card-body { flex: 1; min-width: 0; }

.rewrite-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.rewrite-card-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.btn-rewrite {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 11px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}

.btn-rewrite:hover  { background: var(--red-hover); transform: translateY(-1px); }
.btn-rewrite:active { transform: translateY(0); }
.btn-rewrite svg    { width: 16px; height: 16px; }

/* ── Rewrite modal ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 18, 0.82);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  animation: overlayIn 0.2s ease-out;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--navy-mid);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  width: 100%;
  max-width: 760px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color 0.2s, background 0.2s;
}

.modal-close:hover { color: var(--white); background: rgba(255,255,255,0.07); }
.modal-close svg   { width: 18px; height: 18px; }

/* Loading state inside modal */
.modal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 60px 24px;
}

.modal-loading-text {
  text-align: center;
  color: var(--white);
  font-size: 1rem;
  line-height: 1.6;
}

.modal-loading-sub {
  font-size: 0.82rem;
  color: var(--muted);
}

/* Error state inside modal */
.modal-error-state {
  padding: 40px 24px;
  text-align: center;
  color: #f88;
  font-size: 0.9rem;
}

/* Scrollable contract body */
.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  min-height: 0;
}

.rewritten-contract {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 0.9rem;
  line-height: 1.8;
  color: rgba(255,255,255,0.88);
}

/* Footer */
.modal-footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-footer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Score comparison block ──────────────────────────────── */
.score-compare {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.score-compare-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

.score-compare-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.score-compare-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.score-compare-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.score-val-low  { color: #4ade80; }
.score-val-mid  { color: #fbbf24; }
.score-val-high { color: #f87171; }

.score-compare-denom {
  font-size: 0.85rem;
  color: var(--muted);
}

.score-compare-arrow {
  font-size: 1.5rem;
  color: var(--muted);
  padding-bottom: 4px;
}

.score-compare-msg {
  font-size: 0.9rem;
  color: var(--white);
  text-align: center;
  margin: 0;
  font-weight: 600;
}

.btn-keep-refining {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(208,40,46,0.15);
  color: #f87171;
  border: 1px solid rgba(208,40,46,0.3);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-keep-refining:hover {
  background: rgba(208,40,46,0.25);
  border-color: rgba(208,40,46,0.5);
}

.btn-keep-refining svg { width: 14px; height: 14px; }

.btn-download-pdf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-download-pdf:hover { background: var(--red-hover); }
.btn-download-pdf svg   { width: 15px; height: 15px; }

.btn-modal-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.btn-modal-close:hover { color: var(--white); border-color: rgba(255,255,255,0.25); }

/* Prevent body scroll while modal is open */
body.modal-open { overflow: hidden; }

/* ── Document type chip selector ────────────────────────────── */
.doc-type-selector {
  margin-bottom: 22px;
}

.doc-type-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.doc-type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.doc-type-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 13px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  white-space: nowrap;
  /* reset button defaults */
  line-height: 1.4;
  appearance: none;
  -webkit-appearance: none;
}

.doc-type-chip:hover {
  border-color: rgba(255,255,255,0.2);
  color: var(--white);
  background: rgba(255,255,255,0.07);
}

.doc-type-chip.selected {
  background: rgba(208,40,46,0.14);
  border-color: rgba(208,40,46,0.55);
  color: var(--white);
  font-weight: 600;
}

/* ── Mobile: 2-column grid so chips align evenly ──────────────── */
@media (max-width: 640px) {
  .doc-type-chips {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .doc-type-chip {
    width: 100%;
    justify-content: center;
    text-align: center;
    white-space: normal;   /* allow long labels to wrap inside the pill */
    padding: 7px 10px;
    line-height: 1.35;
  }
}

/* Print: hide the chip selector */
@media print {
  .doc-type-selector { display: none !important; }
}

/* ── Camera scan option (touch / mobile only) ───────────────── */
.camera-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 6px;
}

.camera-divider {
  position: relative;
  width: 100%;
  text-align: center;
  padding: 2px 0;
}

.camera-divider::before,
.camera-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 16px);
  height: 1px;
  background: var(--border);
}
.camera-divider::before { left: 0; }
.camera-divider::after  { right: 0; }

.camera-divider span {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* Primary scan button — big, obvious, works on all devices */
.btn-scan-primary {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  color: var(--white);
  font-family: var(--font);
  padding: 18px 20px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.btn-scan-primary:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.32);
}
.btn-scan-primary:active { transform: scale(0.98); }

.btn-scan-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: rgba(208, 40, 46, 0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f87171;
}
.btn-scan-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.btn-scan-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
}
.btn-scan-sub {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 400;
}

/* Loading text inside submit button */
#btnLoading {
  font-size: 0.95rem;
  font-weight: 700;
}

/* ── Scan confirmation panel ─────────────────────────────────── */
.scan-panel {
  position: relative;
  text-align: center;
  padding: 28px 20px 20px;
  overflow: hidden;
  border-radius: 12px;
}

/* Full-card green flash on capture */
.scan-flash {
  position: absolute;
  inset: 0;
  background: rgba(34, 197, 94, 0.22);
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}
.scan-flash.scan-flash-active {
  animation: scanFlashAnim 0.55s ease-out forwards;
}
@keyframes scanFlashAnim {
  0%   { opacity: 0.7; }
  100% { opacity: 0; }
}

/* Checkmark SVG */
.scan-check-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
.scan-check-svg {
  width: 64px;
  height: 64px;
}
.scan-check-circle {
  stroke-dasharray: 160;
  stroke-dashoffset: 160;
}
.scan-check-tick {
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
}
.scan-check-svg.scan-animate .scan-check-circle {
  animation: drawCircle 0.4s ease-out 0s forwards;
}
.scan-check-svg.scan-animate .scan-check-tick {
  animation: drawTick 0.3s ease-out 0.3s forwards;
}
@keyframes drawCircle {
  to { stroke-dashoffset: 0; }
}
@keyframes drawTick {
  to { stroke-dashoffset: 0; }
}

.scan-message {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  margin: 0 0 4px;
}
.scan-sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 16px;
}
.scan-page-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: #22c55e;
  margin: 0 0 20px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Thumbnail strip */
.scan-thumbs {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
  min-height: 10px;
}
.scan-thumb-wrap {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid rgba(34, 197, 94, 0.5);
  width: 60px;
  height: 80px;
  flex-shrink: 0;
}
.scan-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.scan-thumb-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
  padding: 2px 0;
}

/* Scan action buttons */
.scan-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btn-scan-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 10px;
  border: 2px solid rgba(34, 197, 94, 0.6);
  background: rgba(34, 197, 94, 0.08);
  color: #22c55e;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  width: 100%;
}
.btn-scan-more:hover {
  background: rgba(34, 197, 94, 0.15);
  border-color: #22c55e;
}
.btn-scan-retake {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15);
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  width: 100%;
}
.btn-scan-retake:hover { color: var(--white); border-color: rgba(255,255,255,0.35); }

.scan-analyze-btn { margin-top: 4px; }

.scan-upload-error {
  margin-top: 12px;
  background: rgba(208, 40, 46, 0.15);
  border: 1px solid rgba(208, 40, 46, 0.4);
  color: #f87171;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.88rem;
  text-align: left;
}

/* ── Analysis loading panel ──────────────────────────────────── */
.loading-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}
.loading-spinner-lg {
  width: 56px;
  height: 56px;
  margin-bottom: 24px;
  animation: spinLg 1s linear infinite;
}
.loading-spinner-lg svg {
  width: 100%;
  height: 100%;
}
@keyframes spinLg {
  to { transform: rotate(360deg); }
}
.loading-msg {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  margin: 0 0 6px;
  transition: opacity 0.3s;
}
.loading-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}

/* ── Responsive additions ────────────────────────────────────── */
@media (max-width: 640px) {
  /* Nav: shrink gap and hide space-hungry decorative items */
  .site-header nav          { gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
  .nav-email                { display: none; } /* email shown on dashboard, redundant in nav on mobile */
  .nav-plan-badge           { display: none; } /* Pro chip — not actionable on mobile */
  .nav-lang-wrap            { display: none; } /* language picker — space-hungry, use on desktop */

  .pricing-grid  { grid-template-columns: 1fr; }
  .auth-card     { padding: 28px 20px; }
  .dash-header        { flex-direction: column; }
  .dash-header-right  { flex-direction: column; align-items: flex-start; gap: 10px; width: 100%; }
  .dash-cta           { width: 100%; text-align: center; justify-content: center; }
  .upgrade-banner { flex-direction: column; align-items: flex-start; }
  .rewrite-card  { flex-direction: column; align-items: flex-start; }
  .btn-rewrite   { width: 100%; justify-content: center; }
  .modal-footer-actions { flex-direction: column; }
  .btn-download-pdf, .btn-modal-close { width: 100%; justify-content: center; }
}

/* ── Negotiate & Rewrite — Question cards ────────────────────── */
.card-subtitle {
  font-size: 0.875rem;
  color: var(--muted);
  margin: -4px 0 16px;
  line-height: 1.5;
}

.clause-questions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
}

.clause-q {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-left-color 0.2s;
}

.clause-q-high   { border-left-color: rgba(208,40,46,0.75); }
.clause-q-medium { border-left-color: rgba(245,158,11,0.75); }
.clause-q-low    { border-left-color: rgba(34,197,94,0.75); }

/* Reuse existing clause-risk pill styles */
.clause-q-risk {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.clause-q-question {
  font-size: 0.975rem;
  line-height: 1.6;
  color: var(--white);
  margin-bottom: 14px;
}

.clause-q-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-clause-yes,
.btn-clause-no {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  border: 1px solid;
}

.btn-clause-yes {
  background: rgba(34,197,94,0.08);
  border-color: rgba(34,197,94,0.28);
  color: #4ade80;
}
.btn-clause-yes:hover {
  background: rgba(34,197,94,0.16);
  border-color: rgba(34,197,94,0.5);
}
.btn-clause-yes.selected {
  background: rgba(34,197,94,0.2);
  border-color: rgba(34,197,94,0.65);
  box-shadow: 0 0 0 1px rgba(34,197,94,0.45);
}

.btn-clause-no {
  background: rgba(208,40,46,0.07);
  border-color: rgba(208,40,46,0.25);
  color: #f87171;
}
.btn-clause-no:hover {
  background: rgba(208,40,46,0.15);
  border-color: rgba(208,40,46,0.45);
}
.btn-clause-no.selected {
  background: rgba(208,40,46,0.18);
  border-color: rgba(208,40,46,0.6);
  box-shadow: 0 0 0 1px rgba(208,40,46,0.4);
}

/* Follow-up textarea (shown when "No" is selected) */
.clause-q-followup {
  margin-top: 14px;
  animation: slideDown 0.18s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.clause-q-followup label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.clause-q-followup textarea {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--white);
  font-family: var(--font);
  font-size: 0.875rem;
  line-height: 1.5;
  padding: 9px 12px;
  resize: vertical;
  min-height: 68px;
  transition: border-color 0.2s;
}
.clause-q-followup textarea:focus {
  outline: none;
  border-color: rgba(255,255,255,0.22);
}
.clause-q-followup textarea::placeholder { color: var(--muted); opacity: 0.7; }

/* ── Clause progress counter ────────────────────────────────── */
.clause-progress {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin: 4px 0 20px;
  letter-spacing: 0.01em;
  transition: color 0.25s;
}

.clause-progress-done {
  color: #4ade80;
}

/* ── Negotiate section ──────────────────────────────────────── */
.negotiate-section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.negotiate-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.negotiate-hint {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.btn-negotiate-open {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 11px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}
.btn-negotiate-open:hover  { background: var(--red-hover); transform: translateY(-1px); }
.btn-negotiate-open:active { transform: translateY(0); }
.btn-negotiate-open svg    { width: 15px; height: 15px; }

/* Disabled state — shown until ≥1 question answered */
.btn-negotiate-open:disabled,
.btn-negotiate-open:disabled:hover {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  background: var(--red);
}

.negotiate-form { animation: slideDown 0.2s ease-out; }

.negotiate-form-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.negotiate-form-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

.negotiate-goals {
  display: block;
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--white);
  font-family: var(--font);
  font-size: 0.875rem;
  line-height: 1.6;
  padding: 11px 14px;
  resize: vertical;
  min-height: 80px;
  margin-bottom: 14px;
  transition: border-color 0.2s;
}
.negotiate-goals:focus { outline: none; border-color: rgba(255,255,255,0.22); }
.negotiate-goals::placeholder { color: var(--muted); opacity: 0.7; }

.btn-negotiate-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn-negotiate-submit:hover  { background: var(--red-hover); transform: translateY(-1px); }
.btn-negotiate-submit:active { transform: translateY(0); }
.btn-negotiate-submit svg    { width: 15px; height: 15px; }

/* Gentle reminder when some questions unanswered */
.negotiate-partial-msg {
  font-size: 0.82rem;
  color: #fbbf24;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  line-height: 1.5;
}

/* ── Print: hide interactive negotiate elements ─────────────── */
@media print {
  .negotiate-section,
  .clause-q-actions,
  .clause-q-followup,
  .card-subtitle { display: none !important; }
}

/* ── Responsive: negotiate section ──────────────────────────── */
@media (max-width: 640px) {
  .negotiate-prompt   { flex-direction: column; align-items: flex-start; }
  .btn-negotiate-open { width: 100%; justify-content: center; }
  .btn-negotiate-submit { width: 100%; justify-content: center; }
}

/* ══════════════════════════════════════════════════════════════
   LANGUAGE SELECTOR
   ══════════════════════════════════════════════════════════════ */

.lang-selector-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.lang-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.lang-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.lang-select-wrap::after {
  content: '▾';
  position: absolute;
  right: 10px;
  pointer-events: none;
  font-size: 0.7rem;
  color: var(--muted);
}

.lang-select {
  appearance: none;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--white);
  font-family: var(--font);
  font-size: 0.84rem;
  padding: 5px 28px 5px 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.lang-select:focus {
  outline: none;
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.09);
}
.lang-select option { background: #1a1a1f; color: var(--white); }
.lang-select:disabled { opacity: 0.5; cursor: default; }

.lang-translating {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
  animation: pulse 1s ease-in-out infinite alternate;
}
@keyframes pulse { from { opacity: 0.5; } to { opacity: 1; } }

/* ══════════════════════════════════════════════════════════════
   BOTTOM CTA (Negotiate + Rewrite side by side)
   ══════════════════════════════════════════════════════════════ */

.bottom-cta {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 36px;
  margin-bottom: 28px;
}

.bottom-cta-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  align-items: start;
}

.bottom-cta-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 24px;
}
.bottom-cta-col:first-child { padding-left: 0; }
.bottom-cta-col:last-child  { padding-right: 0; }

.bottom-cta-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
  min-height: 100px;
  margin: 0 4px;
}

.bottom-cta-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin: 0;
}

.bottom-cta-desc {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 6px;
}

/* Make both CTA buttons fill their column */
.bottom-cta .btn-negotiate-open,
.bottom-cta .btn-rewrite {
  width: 100%;
  justify-content: center;
}

/* Negotiate form sits below the button row, inside the card */
.bottom-cta .negotiate-form {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

/* ── Responsive: bottom CTA ──────────────────────────────────── */
@media (max-width: 700px) {
  .bottom-cta { padding: 24px 20px; }
  .bottom-cta-row {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .bottom-cta-col { padding: 0; }
  .bottom-cta-divider { display: none; }
}

/* ══════════════════════════════════════════════════════════════
   HELP PAGE
   ══════════════════════════════════════════════════════════════ */

.help-main { padding: 48px 0 80px; }

.help-header {
  text-align: center;
  margin-bottom: 48px;
}
.help-header h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 10px; }
.help-sub { color: var(--muted); font-size: 1.05rem; }

/* ── FAQ ──────────────────────────────────────────────────── */
.faq-section { margin-bottom: 60px; }
.faq-title {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 20px;
}

.faq-list { display: flex; flex-direction: column; gap: 4px; }

.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.faq-item[open] { border-color: rgba(255,255,255,0.18); }

.faq-question {
  padding: 16px 20px;
  font-size: 0.97rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  transition: background 0.15s;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after {
  content: '+';
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--muted);
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: 12px;
}
details[open] .faq-question::after {
  content: '−';
}
.faq-question:hover { background: rgba(255,255,255,0.04); }

.faq-answer {
  padding: 0 20px 18px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}
.faq-answer p + p { margin-top: 10px; }
.faq-answer ul,
.faq-answer ol {
  padding-left: 20px;
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.faq-answer a { color: var(--red); text-decoration: underline; }
.faq-answer a:hover { color: var(--red-hover); }

/* ── Contact section ──────────────────────────────────────── */
.help-contact-section { margin-bottom: 48px; }

.help-contact-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.help-contact-left h2 {
  font-size: 1.35rem;
  margin-bottom: 10px;
}
.help-contact-left p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.help-email-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--red);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.2s;
}
.help-email-link:hover { color: var(--red-hover); }
.help-email-link svg   { width: 16px; height: 16px; flex-shrink: 0; }

/* Contact form */
.contact-form { display: flex; flex-direction: column; gap: 16px; }

.contact-form textarea {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--white);
  font-family: var(--font);
  font-size: 0.875rem;
  line-height: 1.6;
  padding: 11px 14px;
  resize: vertical;
  transition: border-color 0.2s;
}
.contact-form textarea:focus { outline: none; border-color: rgba(255,255,255,0.22); }
.contact-form textarea::placeholder { color: var(--muted); opacity: 0.7; }

.contact-error {
  font-size: 0.85rem;
  color: #f87171;
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: 8px;
  padding: 10px 14px;
}

.contact-success {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #4ade80;
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.25);
  border-radius: 8px;
  padding: 12px 16px;
}
.contact-success svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Pricing page help link ──────────────────────────────── */
.pricing-help-link {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 28px;
}
.pricing-help-link a {
  color: var(--red);
  text-decoration: none;
  font-weight: 600;
}
.pricing-help-link a:hover { text-decoration: underline; }

/* ── Responsive: help page ──────────────────────────────── */
@media (max-width: 800px) {
  .help-contact-card {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 28px 24px;
  }
}
@media (max-width: 640px) {
  .help-main { padding: 32px 0 60px; }
  .faq-question { padding: 14px 16px; font-size: 0.92rem; }
  .faq-answer   { padding: 0 16px 14px; }
}

/* ── Paywall modal ───────────────────────────────────────── */
.paywall-modal { max-width: 480px; }

.paywall-body {
  padding: 28px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.paywall-desc {
  font-size: 0.97rem;
  color: var(--muted);
  line-height: 1.6;
}

.paywall-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.paywall-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.93rem;
  color: var(--white);
}

.paywall-features .check {
  color: #4ade80;
  font-weight: 700;
  flex-shrink: 0;
}

.paywall-cta {
  width: 100%;
  justify-content: center;
  font-size: 1rem;
  padding: 14px 24px;
}

.paywall-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

/* ══════════════════════════════════════════════════════════════
   Why Not ChatGPT section
   ══════════════════════════════════════════════════════════════ */
.why-not-chatgpt {
  padding: 72px 0 80px;
  background: linear-gradient(180deg, var(--navy) 0%, rgba(22,32,50,0.6) 100%);
  border-top: 1px solid var(--border);
}

.wncg-inner {
  display: flex;
  align-items: flex-start;
  gap: 48px;
}

.wncg-left {
  flex: 1 1 0;
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.wncg-logo-placeholder {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 14px;
  visibility: hidden; /* space reserved — nothing visible until real logo is placed */
}

.wncg-hook {
  flex: 1;
}

.wncg-hook-line {
  margin: 0 0 4px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--white);
}
.wncg-hook-lg { font-size: 2rem; }
.wncg-hook-md { font-size: 1.35rem; color: var(--muted); }

.wncg-hook-body {
  margin: 16px 0 0;
  font-size: 0.97rem;
  color: var(--muted);
  line-height: 1.65;
}
.wncg-hook-cta-line {
  font-weight: 600;
  color: rgba(255,255,255,0.75);
}

.wncg-right {
  flex-shrink: 0;
  padding-top: 8px;
}

.wncg-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(208,40,46,0.1);
  border: 1px solid rgba(208,40,46,0.35);
  color: #f87171;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.wncg-toggle-btn:hover {
  background: rgba(208,40,46,0.18);
  border-color: rgba(208,40,46,0.6);
  color: #fca5a5;
}
.wncg-toggle-arrow {
  width: 16px;
  height: 16px;
  transition: transform 0.25s;
  flex-shrink: 0;
}
.wncg-toggle-btn[aria-expanded="true"] .wncg-toggle-arrow {
  transform: rotate(180deg);
}

/* Dropdown */
.wncg-dropdown {
  margin-top: 36px;
  animation: slideDown 0.22s ease-out;
}

.wncg-dropdown-inner {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
}

.wncg-dropdown-headline {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--white);
}

.wncg-dropdown-body {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.65;
  margin: 0 0 28px;
}

.wncg-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.wncg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.wncg-table th,
.wncg-table td {
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.wncg-table th {
  font-weight: 700;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.wncg-table th:nth-child(2),
.wncg-table th:nth-child(3),
.wncg-table td:nth-child(2),
.wncg-table td:nth-child(3) {
  text-align: center;
  width: 110px;
}
.wncg-table td:first-child { color: rgba(255,255,255,0.8); }
.wncg-no { color: #f87171; font-weight: 700; font-size: 1.05rem; }
.wncg-yes { color: #4ade80; font-weight: 700; font-size: 1.05rem; }

.wncg-closing {
  margin: 24px 0 0;
  font-size: 0.93rem;
  color: var(--muted);
  line-height: 1.6;
  font-style: italic;
}

@media (max-width: 768px) {
  .wncg-inner { flex-direction: column; gap: 28px; }
  .wncg-right { padding-top: 0; }
  .wncg-toggle-btn { width: 100%; justify-content: center; }
  .wncg-hook-lg { font-size: 1.6rem; }
  .wncg-hook-md { font-size: 1.1rem; }
  .wncg-dropdown-inner { padding: 20px 16px; }
  .wncg-logo-placeholder { display: none; }
}

/* ══════════════════════════════════════════════════════════════
   Legal disclaimer modal
   ══════════════════════════════════════════════════════════════ */
.disclaimer-modal {
  max-width: 480px;
}

.disclaimer-body {
  padding: 28px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.disclaimer-text {
  font-size: 0.97rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.7;
  margin: 0;
}

.disclaimer-accept-btn {
  width: 100%;
  justify-content: center;
  font-size: 1rem;
  padding: 14px 24px;
}

/* ══════════════════════════════════════════════════════════════
   Structured sections card (results page)
   ══════════════════════════════════════════════════════════════ */
.sections-card { padding-bottom: 8px; }

.section-item {
  border-bottom: 1px solid var(--border);
}
.section-item:last-child { border-bottom: none; }

.section-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  padding: 18px 0;
  text-align: left;
  transition: color 0.18s;
}
.section-header:hover { color: rgba(255,255,255,0.75); }

.section-title {
  font-size: 0.97rem;
  font-weight: 700;
  flex: 1;
}

.section-chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.22s;
}
.section-header[aria-expanded="true"] .section-chevron {
  transform: rotate(180deg);
}

.section-body {
  padding: 0 0 18px;
}

.section-content {
  font-size: 0.93rem;
  color: rgba(255,255,255,0.72);
  line-height: 1.7;
  margin: 0;
  white-space: pre-wrap;
}

/* ══════════════════════════════════════════════════════════════
   Chip selection UX — locked state + drop-zone badge
   ══════════════════════════════════════════════════════════════ */

/* Chip grid collapses smoothly when a type is chosen */
.doc-type-selector {
  overflow: hidden;
  max-height: 220px;
  transition: max-height 0.3s ease, opacity 0.25s ease, margin-bottom 0.3s ease;
}
.doc-type-selector.chips-locked {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  margin-bottom: 0;
}

/* Badge shown inside the drop zone after selection */
.dz-chip-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  animation: dzBadgeIn 0.25s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes dzBadgeIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.dz-chip-label {
  display: inline-flex;
  align-items: center;
  padding: 9px 22px;
  border-radius: 28px;
  background: rgba(208,40,46,0.16);
  border: 1.5px solid rgba(208,40,46,0.6);
  color: var(--white);
  font-size: 1.15rem;   /* ~1.5x the normal chip size */
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 0 0 4px rgba(208,40,46,0.08);
}

.dz-change-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.78rem;
  font-family: var(--font);
  cursor: pointer;
  padding: 3px 10px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  line-height: 1.4;
}
.dz-change-btn:hover {
  color: var(--white);
  background: rgba(255,255,255,0.07);
}

@media (max-width: 640px) {
  .dz-chip-label { font-size: 1rem; padding: 8px 18px; }
}

/* ══════════════════════════════════════════════════════════════
   Tachometer gauge — risk score display
   ══════════════════════════════════════════════════════════════ */
.gauge-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}

.gauge-svg {
  width: 160px;
  height: 160px;
  /* Rotate so arc runs from lower-left → top → lower-right, gap at bottom */
  transform: rotate(135deg);
  transform-origin: center;
  overflow: visible;
}

.gauge-track {
  fill: none;
  stroke: rgba(255,255,255,0.07);
  stroke-width: 10;
  stroke-dasharray: 283 377;
  stroke-linecap: round;
}

.gauge-fill {
  fill: none;
  stroke: #22c55e;
  stroke-width: 10;
  stroke-dasharray: 283 377;
  stroke-dashoffset: 283; /* starts empty; driven by JS */
  stroke-linecap: round;
  /* filter (glow) set by JS */
}

.gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 20px; /* visual nudge up — gap is at bottom of arc */
}

/* Number inside gauge — smaller than the old standalone number */
.gauge-center .hero-score-value {
  font-size: 4rem;
  letter-spacing: -3px;
  line-height: 1;
  /* color driven by JS during animation; CSS verdict class still used for print */
}

.gauge-center .hero-score-denom {
  font-size: 0.95rem;
  margin-top: 2px;
}

@media (max-width: 640px) {
  .gauge-wrap  { width: 120px; height: 120px; }
  .gauge-svg   { width: 120px; height: 120px; }
  .gauge-center .hero-score-value { font-size: 3rem; letter-spacing: -2px; }
}

/* Print: hide gauge, show plain number instead */
@media print {
  .gauge-svg { display: none !important; }
  .gauge-center { position: static; padding: 0; }
}
