/* ============================================================
   AccesPub — Design System v2
   Palette  : Slate + Indigo  |  Font: Inter  |  Icons: Lucide
   ============================================================ */

/* ── Design tokens ─────────────────────────────────────────── */
:root {
  --font:      'Inter', -apple-system, system-ui, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', 'Fira Code', monospace;

  /* Page chrome */
  --bg:        #f8fafc;
  --surface:   #ffffff;
  --border:    #e2e8f0;
  --border-md: #cbd5e1;

  /* Text */
  --text:    #0f172a;
  --text-md: #475569;
  --text-sm: #94a3b8;

  /* Accent — Indigo */
  --accent:    #6366f1;
  --accent-d:  #4f46e5;
  --accent-dk: #4338ca;
  --accent-l:  #e0e7ff;
  --accent-ll: #eef2ff;

  /* Success — Green */
  --success:      #16a34a;
  --success-l:    #dcfce7;
  --success-ll:   #f0fdf4;
  --success-bd:   #bbf7d0;
  --success-text: #166534;

  /* Warning — Amber */
  --warn:      #d97706;
  --warn-l:    #fde68a;
  --warn-ll:   #fffbeb;
  --warn-bd:   #fde68a;
  --warn-text: #92400e;
  --warn-dark: #78350f;

  /* Error — Red */
  --error:      #ef4444;
  --error-l:    #fecaca;
  --error-ll:   #fff5f5;
  --error-text: #991b1b;
  --error-dark: #7f1d1d;

  /* Neutrals */
  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* Shadows */
  --sh-xs: 0 1px 2px rgba(15,23,42,.04);
  --sh-sm: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.03);
  --sh-md: 0 4px 6px -1px rgba(15,23,42,.07), 0 2px 4px -2px rgba(15,23,42,.04);
  --sh-lg: 0 10px 15px -3px rgba(15,23,42,.07), 0 4px 6px -4px rgba(15,23,42,.04);
  --sh-xl: 0 20px 25px -5px rgba(15,23,42,.08), 0 8px 10px -6px rgba(15,23,42,.04);

  /* Border radius */
  --r4:    4px;
  --r6:    6px;
  --r8:    8px;
  --r10:   10px;
  --r12:   12px;
  --r16:   16px;
  --r-full: 9999px;
}

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

/* ── Base ──────────────────────────────────────────────────── */
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Header ────────────────────────────────────────────────── */
header {
  background: var(--slate-800);
  padding: 0 2rem;
  box-shadow: 0 1px 0 rgba(255,255,255,.06), var(--sh-md);
  position: sticky;
  top: 0;
  z-index: 100;
}
nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}
.logo {
  color: #fff;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
}
.logo-sub {
  font-size: 0.6em;
  font-weight: 400;
  opacity: 0.45;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.nav-links a {
  color: var(--slate-400);
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color .15s;
}
.nav-links a:hover { color: #fff; }
.nav-links a.active { color: #fff; }

/* ── Language selector ─────────────────────────────────────── */
.lang-selector {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: 1.5rem;
  font-size: 0.78rem;
}
.lang-link {
  color: var(--slate-400);
  text-decoration: none;
  padding: .2rem .45rem;
  border-radius: var(--r4);
  transition: color .15s, background .15s;
  font-weight: 500;
}
.lang-link:hover { color: #fff; background: rgba(255,255,255,.1); }
.lang-active {
  color: #fff;
  font-weight: 700;
  padding: .2rem .45rem;
  background: rgba(99,102,241,.4);
  border-radius: var(--r4);
}
.lang-sep { color: var(--slate-700); }

/* ── Main / Footer ─────────────────────────────────────────── */
main { flex: 1; padding: 2rem; }
footer {
  text-align: center;
  padding: .875rem 1rem;
  color: var(--slate-400);
  font-size: 0.78rem;
  background: var(--slate-100);
  border-top: 1px solid var(--border);
}

/* ── Page layouts ──────────────────────────────────────────── */
.page-center {
  max-width: 700px;
  margin: 2.5rem auto;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}
.page-wide {
  max-width: 1100px;
  margin: 0 auto;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--r16);
  padding: 2.5rem;
  box-shadow: var(--sh-md);
  border: 1px solid var(--border);
}
.upload-card h1 {
  font-size: 1.75rem;
  color: var(--text);
  margin-bottom: 0.4rem;
  letter-spacing: -0.025em;
  font-weight: 800;
}
.subtitle {
  color: var(--text-md);
  margin-bottom: 2rem;
  line-height: 1.65;
  font-size: 0.95rem;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .575rem 1.35rem;
  border-radius: var(--r8);
  border: none;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  font-family: var(--font);
  text-decoration: none;
  transition: background .15s, transform .12s, box-shadow .12s;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn svg, .btn i { width: .95rem; height: .95rem; flex-shrink: 0; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-d); transform: translateY(-1px); box-shadow: var(--sh-md); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: var(--success-text); transform: translateY(-1px); box-shadow: var(--sh-md); }

.btn-secondary { background: var(--slate-100); color: var(--slate-700); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--slate-200); }

/* "Edit →" button — accent outline so it reads as an action, not disabled */
.btn-edit-action {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-edit-action:hover { background: var(--accent); color: #fff; }

/* "Back to Report" button — subtle outline link style */
.btn-outline-report {
  background: transparent;
  color: var(--slate-500);
  border: 1px solid var(--slate-300);
  margin-left: auto;          /* push to the far right of the actions row */
}
.btn-outline-report:hover { background: var(--slate-100); color: var(--slate-700); }

.btn-large { padding: .85rem 2rem; font-size: 1rem; }

/* ── Lucide icon defaults ──────────────────────────────────── */
svg.lucide, i[data-lucide] { flex-shrink: 0; }

/* ── Drop zone ─────────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border-md);
  border-radius: var(--r12);
  padding: 2.75rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--slate-50);
}
.drop-zone:hover { border-color: var(--accent); background: var(--accent-ll); }
.drop-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--accent);
}
.drop-icon svg, .drop-icon i { width: 2.5rem; height: 2.5rem; stroke-width: 1.5; }
.drop-zone p { color: var(--text-md); margin-bottom: 0.4rem; font-size: 0.95rem; }
.hint { font-size: 0.8rem; color: var(--text-sm); }
.drop-zone input[type="file"] { display: none; }
.file-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--success-ll);
  border: 1px solid var(--success-bd);
  border-radius: var(--r8);
  padding: .9rem 1.25rem;
  margin-top: 1rem;
}
#file-name { font-weight: 600; color: var(--success-text); font-size: 0.9rem; }

/* ── Process steps ─────────────────────────────────────────── */
.process-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.step { text-align: center; }
.step-num {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dk));
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .875rem;
  margin: 0 auto .35rem;
  box-shadow: 0 2px 8px rgba(99,102,241,.3);
}
.step-label { font-size: 0.72rem; color: var(--text-sm); font-weight: 500; }
.step-arrow { color: var(--slate-300); font-size: 1.1rem; }

/* ── "What we do" feature grid ─────────────────────────────── */
.what-we-do h2 {
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: .5rem;
  letter-spacing: -.02em;
  font-weight: 700;
}
.what-intro {
  color: var(--text-md);
  line-height: 1.7;
  margin-bottom: 1.75rem;
  font-size: 0.925rem;
}
.what-outro {
  color: var(--text-md);
  line-height: 1.7;
  margin-top: 1.75rem;
  font-size: 0.925rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.feature-grid { display: flex; flex-direction: column; gap: 0.5rem; }

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--r8);
  transition: background .15s;
}
.feature-item:hover { background: var(--slate-50); }

.feature-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  background: var(--accent-ll);
  border-radius: var(--r8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-top: .1rem;
}
.feature-icon svg, .feature-icon i { width: 1.05rem; height: 1.05rem; }

.feature-body {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  font-size: .875rem;
  line-height: 1.55;
}
.feature-body strong { color: var(--slate-800); font-size: .9rem; font-weight: 600; }
.feature-body span   { color: var(--text-md); }

.feature-item--highlight {
  background: var(--warn-ll);
  border: 1.5px solid var(--warn-l);
  padding: 0.65rem 0.75rem;
}
.feature-item--highlight:hover { background: var(--warn-ll); }
.feature-item--highlight .feature-icon { background: #fef3c7; color: var(--warn); }
.feature-item--highlight .feature-body strong { color: var(--warn-text); }
.feature-item--highlight .feature-body span   { color: var(--warn-dark); }

/* ── Loading overlay ───────────────────────────────────────── */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
}
.loading-box {
  background: var(--surface);
  border-radius: var(--r16);
  padding: 2.5rem;
  text-align: center;
  box-shadow: var(--sh-xl);
  border: 1px solid var(--border);
  min-width: 220px;
}
.spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .75s linear infinite;
  margin: 0 auto 1.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Stats grid ────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .875rem;
  margin: 1.5rem 0;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--r12);
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: var(--sh-sm);
  border: 1px solid var(--border);
  border-top: 3px solid transparent;
  transition: box-shadow .15s, transform .15s;
}
.stat-card:hover { box-shadow: var(--sh-md); transform: translateY(-1px); }
.stat-card.stat-green  { border-top-color: #22c55e; }
.stat-card.stat-orange { border-top-color: var(--warn); }
.stat-card.stat-red    { border-top-color: var(--error); }
.stat-card.stat-blue   { border-top-color: var(--accent); }
.stat-num {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.stat-label { font-size: .75rem; color: var(--text-sm); margin-top: .3rem; font-weight: 500; }

/* ── Info bar ──────────────────────────────────────────────── */
.info-bar {
  background: var(--accent-ll);
  border-left: 3px solid var(--accent);
  padding: .7rem 1.1rem;
  border-radius: 0 var(--r8) var(--r8) 0;
  margin-bottom: 1.5rem;
  font-size: .875rem;
  color: var(--slate-700);
}

/* ── Language inline editor ────────────────────────────────── */
.lang-info-group        { display: inline-flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.btn-lang-edit          { background: none; border: none; cursor: pointer;
                          color: var(--accent); padding: 0 .25rem; line-height: 1;
                          display: inline-flex; align-items: center; }
.btn-lang-edit:hover    { color: var(--accent-d); }
.btn-lang-edit svg, .btn-lang-edit i { width: .85rem; height: .85rem; }
.lang-edit-form         { display: inline-flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.lang-edit-form.hidden  { display: none; }
.lang-edit-input        { border: 1px solid var(--border-md); border-radius: var(--r6);
                          padding: .2rem .4rem; font-size: .85rem;
                          width: 7rem; font-family: var(--font-mono); }
.lang-override-badge    { display: inline-block; background: #fef3c7; color: var(--warn-text);
                          border: 1px solid var(--warn-l); border-radius: var(--r4);
                          font-size: .7rem; padding: .05rem .35rem;
                          vertical-align: middle; font-weight: 600; }

/* ── Action banner ─────────────────────────────────────────── */
.action-banner {
  background: var(--warn-ll);
  border: 1px solid var(--warn-l);
  border-radius: var(--r10);
  padding: .9rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

/* ── Export section ────────────────────────────────────────── */
.export-section {
  background: linear-gradient(135deg, var(--success-ll), #fff);
  border: 1px solid var(--success-bd);
  border-radius: var(--r12);
  padding: 2rem;
  text-align: center;
  margin: 1.5rem 0;
}
.export-section h2 { color: var(--success-text); margin-bottom: .75rem; }

/* ── Report sections (collapsible) ────────────────────────── */
.report-section {
  margin: 1.25rem 0;
  border-radius: var(--r12);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  border: 1px solid var(--border);
}
.report-section-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: .875rem 1.1rem;
  font-size: .975rem; font-weight: 700;
  cursor: pointer; user-select: none;
  list-style: none;
  letter-spacing: -.01em;
}
.report-section-header::-webkit-details-marker { display: none; }
.report-section-header::after {
  content: '▾'; font-size: .875rem; transition: transform .2s; opacity: 0.55;
}
details[open] .report-section-header::after { transform: rotate(-180deg); }

.report-section-manual { background: #fff5f0; color: #7b341e; }
.report-section-fixed  { background: var(--success-ll); color: var(--success-text); }
.section-count {
  background: rgba(0,0,0,0.08); border-radius: var(--r-full);
  padding: .1rem .5rem; font-size: .8rem; margin-right: .5rem;
}
.report-section-ok {
  margin: 1.25rem 0; padding: .9rem 1.1rem;
  background: var(--success-ll); border: 1px solid var(--success-bd);
  border-radius: var(--r10); color: var(--success-text);
  font-weight: 600; display: flex; align-items: center; gap: .5rem;
}
.report-section-empty {
  margin: 1.25rem 0; padding: .9rem 1.1rem;
  background: var(--slate-100); border: 1px solid var(--border);
  border-radius: var(--r10); color: var(--text-sm);
}

/* ── Review subsections ────────────────────────────────────── */
.review-subsection {
  border-radius: var(--r8); border: 1px solid var(--border);
  overflow: hidden; background: var(--surface);
}
.review-subsection-header {
  display: flex; align-items: center; gap: .5rem;
  padding: .6rem .9rem;
  cursor: pointer; user-select: none; list-style: none;
  font-size: .9rem; font-weight: 700;
}
.review-subsection-header::-webkit-details-marker { display: none; }
.review-subsection-header::before {
  content: '\25B8'; font-size: .8rem; flex-shrink: 0;
  transition: transform .2s; opacity: 0.5;
}
details[open] > .review-subsection-header::before { transform: rotate(90deg); }
.rsub-title { flex: 1; }
.rsub-right { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.rsub-count {
  background: rgba(0,0,0,0.1); border-radius: var(--r-full);
  padding: .1rem .45rem; font-size: .75rem; font-weight: 700;
}
.review-subsection-images { background: #fffbeb; color: #92400e; border-color: var(--warn-l); }
.review-subsection-tables { background: var(--accent-ll); color: #1e40af; border-color: var(--accent-l); }

/* ── Review item rows ──────────────────────────────────────── */
.review-items-list {
  display: flex; flex-direction: column;
  background: var(--surface); border-top: 1px solid var(--border);
}
.review-item-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .4rem .9rem;
  font-size: .82rem;
  border-bottom: 1px solid var(--slate-100);
}
.review-item-row:last-child { border-bottom: none; }
.review-item-icon { flex-shrink: 0; opacity: 0.55; }
.review-item-icon svg, .review-item-icon i { width: .9rem; height: .9rem; }
.review-item-label {
  flex: 1; color: var(--text-md); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Issues list ───────────────────────────────────────────── */
.other-issues-label {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-sm);
  padding: .75rem .9rem .15rem;
}
.issues-list { display: flex; flex-direction: column; gap: .4rem; padding: .65rem; }
.issue-row {
  display: flex; align-items: flex-start; gap: .875rem;
  background: var(--surface); border-radius: var(--r8);
  padding: .8rem .9rem;
  box-shadow: var(--sh-xs);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  transition: box-shadow .15s;
}
.issue-row:hover { box-shadow: var(--sh-sm); }
.issue-row.issue-critical { border-left-color: var(--error); }
.issue-row.issue-serious  { border-left-color: var(--warn); }
.issue-row.issue-moderate { border-left-color: #ecc94b; }
.issue-row.issue-minor    { border-left-color: #22c55e; }
.issue-row.issue-fixed    { border-left-color: #22c55e; opacity: 0.85; }
.issue-status {
  flex-shrink: 0; display: flex; align-items: flex-start; padding-top: .05rem;
}
.issue-status svg, .issue-status i { width: 1.1rem; height: 1.1rem; }
.issue-body { flex: 1; min-width: 0; }
.issue-meta { display: flex; align-items: center; gap: .35rem; margin-bottom: .25rem; flex-wrap: wrap; }
.issue-type-tag {
  font-size: .68rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--slate-600); background: var(--slate-100);
  padding: .12rem .4rem; border-radius: var(--r4);
}
.issue-sev-badge {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  padding: .12rem .4rem; border-radius: var(--r4);
}
.issue-location { font-size: .72rem; color: var(--text-sm); margin-bottom: .15rem; }
.issue-desc { font-size: .875rem; color: var(--text); }
.issue-fix  { font-size: .8rem; color: var(--success-text); margin-top: .2rem; font-style: italic; }
.issue-badge {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  padding: .15rem .45rem; border-radius: var(--r4); flex-shrink: 0;
}
.badge-critical { background: var(--error-l); color: #c53030; }
.badge-serious  { background: #feebc8; color: #c05621; }
.badge-moderate { background: #fefcbf; color: #744210; }
.badge-minor    { background: var(--success-l); color: var(--success-text); }
.btn-sm { font-size: .78rem; padding: .28rem .7rem; }

/* ── Review layout ─────────────────────────────────────────── */
.review-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  align-items: start;
}
@media (max-width: 768px) { .review-layout { grid-template-columns: 1fr; } }

.review-sidebar {
  background: var(--surface);
  border-radius: var(--r12);
  padding: 1.5rem;
  box-shadow: var(--sh-md);
  border: 1px solid var(--border);
  position: sticky; top: 1rem;
}
.progress-section { margin-bottom: 1.5rem; }
.progress-section h3 { font-size: .95rem; margin-bottom: .65rem; font-weight: 700; }
.progress-bar {
  background: var(--slate-200); border-radius: var(--r-full); height: 6px;
  overflow: hidden; margin-bottom: .4rem;
}
.progress-fill {
  background: linear-gradient(90deg, var(--accent), var(--accent-dk));
  height: 100%; transition: width .4s ease;
}
.progress-section p { font-size: .82rem; color: var(--text-sm); }

.context-section h4 {
  font-size: .75rem; color: var(--text-sm); margin-bottom: .4rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.context-box {
  background: var(--slate-50); border: 1px solid var(--border);
  border-radius: var(--r8); padding: .65rem;
  font-size: .8rem; line-height: 1.5;
}
.context-before, .context-after { color: var(--text-sm); }
.context-image-marker {
  text-align: center; font-weight: 700; color: var(--accent);
  padding: .25rem; background: var(--accent-l);
  border-radius: var(--r4); margin: .35rem 0; font-size: .8rem;
}

.review-main {
  background: var(--surface); border-radius: var(--r12); padding: 2rem;
  box-shadow: var(--sh-md); border: 1px solid var(--border);
}
.review-header { margin-bottom: 1.5rem; }
.review-header h2 { font-size: 1.2rem; margin-bottom: .25rem; letter-spacing: -.01em; }
.img-src { font-size: .75rem; color: var(--text-sm); }

.image-display {
  background: var(--slate-50); border: 1px solid var(--border);
  border-radius: var(--r10); padding: 1.5rem; text-align: center;
  margin-bottom: 1.5rem; min-height: 200px;
  display: flex; align-items: center; justify-content: center;
}
.preview-img { max-width: 100%; max-height: 400px; object-fit: contain; border-radius: var(--r4); }
.image-unavailable { color: var(--text-sm); font-style: italic; }

/* ── Table preview ─────────────────────────────────────────── */
.table-preview-wrap {
  background: var(--slate-50); border-radius: var(--r8);
  padding: .4rem; margin-bottom: 1.5rem;
  border: 1px solid var(--border); overflow: hidden;
}
.table-preview-frame {
  width: 100%; min-height: 60px; max-height: 320px;
  border: none; display: block; border-radius: var(--r4); overflow: auto;
}
.caption-textarea {
  width: 100%; padding: .55rem .7rem;
  border: 1px solid var(--border-md); border-radius: var(--r6);
  font-size: .875rem; font-family: var(--font);
  resize: vertical; min-height: 3rem;
  margin-top: .5rem; margin-bottom: .25rem;
  box-sizing: border-box; transition: border-color .15s;
}
.caption-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.field-label { font-weight: 600; font-size: .875rem; color: var(--slate-700); display: block; margin-top: 1rem; }

.current-alt {
  display: flex; align-items: center; gap: .65rem;
  background: var(--slate-50); padding: .55rem .9rem;
  border-radius: var(--r6); margin-bottom: 1.1rem;
  font-size: .83rem; border: 1px solid var(--border);
}
.current-alt label { color: var(--text-sm); flex-shrink: 0; }

.alt-options { margin-bottom: 1.5rem; }
.option-group {
  display: flex; align-items: flex-start; gap: .5rem;
  padding: .7rem .85rem; border-radius: var(--r8);
  margin-bottom: .4rem;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: background .12s, border-color .12s;
}
.option-group:hover { background: var(--slate-50); border-color: var(--accent); }
.option-group input { margin-top: 2px; accent-color: var(--accent); }
.option-group label { cursor: pointer; font-size: .9rem; }

#alt-text-section { padding: .65rem 0; }
textarea {
  width: 100%; border: 1px solid var(--border);
  border-radius: var(--r8); padding: .65rem .75rem;
  font-size: .875rem; font-family: var(--font);
  resize: vertical; transition: border-color .15s; color: var(--text);
}
textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.char-counter { font-size: .72rem; color: var(--text-sm); margin-top: .25rem; }

.review-actions {
  display: flex; gap: .65rem; align-items: center;
  padding-top: 1.1rem; border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
  padding: .7rem .95rem; border-radius: var(--r8);
  margin-bottom: 1rem; font-size: .875rem;
}
.alert-error   { background: var(--error-ll); border: 1px solid var(--error-l); color: #c53030; }
.alert-info    { background: var(--accent-ll); border: 1px solid var(--accent-l); color: #1e40af; }
.alert-warning { background: var(--warn-ll); border: 1px solid var(--warn-l); color: var(--warn-text); }

/* ── AI badge ──────────────────────────────────────────────── */
.review-header { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; margin-bottom: .9rem; }
.review-header h2 { margin: 0; }
.ai-badge {
  font-size: .72rem; padding: .18rem .55rem; border-radius: var(--r-full);
  font-weight: 600; white-space: nowrap;
}
.ai-badge-claude  { background: var(--accent-l); color: var(--accent-dk); border: 1px solid #c7d2fe; }
.ai-badge-openai  { background: var(--success-l); color: #065f46; border: 1px solid var(--success-bd); }
.ai-badge-google  { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
.ai-badge-none    { background: var(--slate-100); color: var(--slate-500); border: 1px solid var(--border); }

/* ── Alt-input row / AI button ─────────────────────────────── */
.alt-input-row {
  display: flex; align-items: center;
  justify-content: space-between; gap: .5rem; margin-bottom: .4rem;
}
.alt-input-row label { font-size: .83rem; color: var(--text-md); margin: 0; }

.btn-ai {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff; border: none; border-radius: var(--r6);
  padding: .28rem .7rem; font-size: .78rem; font-weight: 600;
  font-family: var(--font); cursor: pointer;
  white-space: nowrap; transition: opacity .15s, transform .12s;
  display: inline-flex; align-items: center; gap: .3rem;
}
.btn-ai:hover   { opacity: .88; transform: translateY(-1px); }
.btn-ai:disabled { opacity: .5; cursor: default; transform: none; }

/* ── AI status ─────────────────────────────────────────────── */
.ai-status {
  font-size: .8rem; padding: .35rem .65rem; border-radius: var(--r6);
  margin-bottom: .45rem; display: flex; align-items: center; gap: .4rem;
}
.ai-status-ok   { background: var(--success-ll); color: var(--success-text); border: 1px solid var(--success-bd); }
.ai-status-err  { background: var(--error-ll); color: #c53030; border: 1px solid var(--error-l); }
.ai-status-warn { background: var(--warn-ll); color: var(--warn-text); border: 1px solid var(--warn-l); }

/* ── Code ──────────────────────────────────────────────────── */
code {
  background: var(--slate-100); padding: .1em .35em;
  border-radius: var(--r4); font-size: .83em;
  font-family: var(--font-mono); color: var(--slate-700);
}
.review-sidebar .hint code,
.review-sidebar .img-src {
  word-break: break-all; overflow-wrap: anywhere; white-space: normal;
}
h1 { margin-bottom: 1rem; letter-spacing: -.02em; }
h2 { margin: 1.5rem 0 .65rem; font-size: 1.2rem; letter-spacing: -.015em; }

/* ── Validation page ───────────────────────────────────────── */
.val-page { max-width: 860px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.val-page h2 { font-size: 1.35rem; margin-bottom: .9rem; color: var(--text); letter-spacing: -.02em; }

.val-banner {
  display: flex; align-items: flex-start; gap: .7rem;
  padding: .8rem 1rem; border-radius: var(--r8); margin-bottom: 1.1rem;
  font-size: .9rem; line-height: 1.5;
}
.val-icon { flex-shrink: 0; margin-top: .05rem; display: flex; align-items: center; }
.val-icon svg, .val-icon i { width: 1.1rem; height: 1.1rem; }
.val-banner-ok      { background: var(--success-ll); color: var(--success-text); border: 1px solid var(--success-bd); }
.val-banner-error   { background: var(--error-ll); color: var(--error-text); border: 1px solid var(--error-l); }
.val-banner-unknown { background: #fefce8; color: #854d0e; border: 1px solid #fde047; }

.val-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r10); padding: 1rem 1.15rem; margin-bottom: .9rem;
  box-shadow: var(--sh-xs);
}
.val-section h3 { font-size: .95rem; margin-bottom: .65rem; color: var(--text); font-weight: 700; letter-spacing: -.01em; }
.val-section details > summary { cursor: pointer; list-style: none; }
.val-section details > summary::-webkit-details-marker { display: none; }

.val-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .35rem; }
.val-list li { padding: .4rem .7rem; border-radius: var(--r6); font-size: .85rem; line-height: 1.45; }
.val-error   { background: var(--error-ll); color: var(--error-dark); border-left: 3px solid var(--error); }
.val-warning { background: var(--warn-ll); color: var(--warn-dark); border-left: 3px solid var(--warn); }
.val-info    { background: #f0f9ff; color: #075985; border-left: 3px solid #38bdf8; }

.val-code { font-size: .73em; background: rgba(0,0,0,0.06); padding: .1em .4em; border-radius: var(--r4); margin-right: .35em; }
.val-loc  { font-size: .75em; opacity: .6; margin-left: .5em; font-family: var(--font-mono); }
.val-hint { font-size: .85rem; color: var(--slate-500); margin-bottom: .85rem; }

.val-field-row { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .85rem; }
.val-field-row label { font-size: .85rem; font-weight: 600; color: var(--slate-700); }
.val-field-row input {
  padding: .42rem .65rem; border: 1px solid var(--border-md); border-radius: var(--r6);
  font-size: .875rem; width: 100%; max-width: 480px; font-family: var(--font);
  transition: border-color .15s;
}
.val-field-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }

.val-field-summary { border-top: 1px solid var(--border); padding-top: 1rem; margin-top: .5rem; }
.val-field-caption {
  font-size: .78rem; color: var(--slate-500); background: var(--slate-50);
  border-left: 3px solid #c7d2fe; padding: .45rem .7rem;
  border-radius: 0 var(--r6) var(--r6) 0; margin: .15rem 0 .45rem; max-width: 640px;
}
.val-field-caption code { font-size: .76rem; background: var(--accent-l); color: var(--accent-dk); }
.val-field-row textarea {
  padding: .45rem .65rem; border: 1px solid var(--border-md); border-radius: var(--r6);
  font-size: .875rem; width: 100%; max-width: 640px;
  resize: vertical; font-family: var(--font); line-height: 1.5;
  transition: border-color .15s;
}
.val-field-row textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }

.val-required { font-size: .7rem; background: var(--error-l); color: var(--error-text); padding: .1em .4em; border-radius: var(--r4); margin-left: .35em; font-weight: 700; }
.val-optional { font-size: .7rem; background: var(--slate-100); color: var(--slate-500); padding: .1em .4em; border-radius: var(--r4); margin-left: .35em; }
.val-actions  { margin-top: .5rem; }
.val-continue { margin-top: 1.5rem; text-align: center; }
.val-continue .btn-secondary {
  display: inline-block; padding: .65rem 1.4rem; font-size: .95rem;
  background: var(--accent); color: #fff; border-radius: var(--r8);
  text-decoration: none; font-weight: 600;
  transition: background .15s, transform .12s;
}
.val-continue .btn-secondary:hover { background: var(--accent-d); transform: translateY(-1px); }

/* ── Nav settings link ─────────────────────────────────────── */
.nav-settings {
  margin-left: auto; font-size: .78rem; opacity: 0.65;
  padding: .2rem .55rem; border-radius: var(--r6);
  transition: opacity .15s, background .15s;
  display: inline-flex; align-items: center; gap: .3rem;
}
.nav-settings:hover, .nav-settings-active { opacity: 1; background: rgba(255,255,255,.12); }
.nav-settings svg, .nav-settings i { width: .85rem; height: .85rem; }

/* ── Hamburger / Mobile nav ────────────────────────────────── */
.nav-burger {
  display: none;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: .35rem .4rem;
  border-radius: 6px;
  transition: background .15s;
  margin-left: auto;
  align-items: center;
  justify-content: center;
}
.nav-burger:hover { background: rgba(255,255,255,.12); }
.nav-burger i, .nav-burger svg { width: 22px; height: 22px; display: block; }

@media (max-width: 768px) {
  header { position: relative; }
  nav { flex-wrap: wrap; height: auto; min-height: 58px; padding: 0; }
  .logo { padding: 0 1rem; height: 58px; justify-content: center; }
  .nav-burger { display: flex; height: 58px; padding: 0 1rem; border-radius: 0; }

  .nav-links {
    display: none;
    order: 3;
    width: 100%;
    flex-direction: column;
    background: var(--slate-800);
    border-top: 1px solid rgba(255,255,255,.08);
    padding: .4rem 0 .75rem;
  }
  .nav-links a {
    margin-left: 0;
    padding: .7rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.05);
    display: block;
    font-size: .9rem;
  }
  .nav-links a:last-child { border-bottom: none; }

  .lang-selector {
    display: none;
    order: 4;
    width: 100%;
    margin-left: 0;
    padding: .6rem 1.25rem .85rem;
    border-top: 1px solid rgba(255,255,255,.08);
    background: var(--slate-800);
    justify-content: flex-start;
    gap: .3rem;
  }

  nav.nav-open .nav-links { display: flex; }
  nav.nav-open .lang-selector { display: flex; }
  nav.nav-open .nav-burger { background: rgba(255,255,255,.1); }
}

/* ── Export download — success finale ─────────────────────── */
.export-download-section {
  margin-top: 2.5rem;
  padding: 2rem 2.25rem 2.25rem;
  border-radius: var(--r16);
  border: 1.5px solid var(--success-bd);
  background: linear-gradient(135deg, var(--success-ll) 0%, #f0fdf8 60%, #e6faf2 100%);
  box-shadow: 0 4px 24px rgba(22,163,74,.10), 0 1px 4px rgba(22,163,74,.07);
  text-align: center;
}
.export-download-section h3 {
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  color: var(--success-text) !important;
  margin-bottom: .5rem !important;
  letter-spacing: -.02em;
}
.export-download-section p {
  font-size: .925rem;
  color: #166534cc;
  margin: 0 auto .1rem;
  max-width: 38rem;
  line-height: 1.6;
}
.export-download-section .btn-success {
  margin-top: 1.4rem;
  padding: .95rem 2.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.01em;
  box-shadow: 0 4px 16px rgba(22,163,74,.30);
  transition: transform .15s, box-shadow .15s;
}
.export-download-section .btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(22,163,74,.38);
}

/* ── Review status badges ──────────────────────────────────── */
.review-status-badge {
  font-size: .7rem; font-weight: 700; padding: .13em .55em;
  border-radius: var(--r-full); white-space: nowrap; flex-shrink: 0;
}
.status-reviewed    { background: var(--success-l); color: var(--success-text); }
.status-pending     { background: #fff7ed; color: #9a3412; }
.status-decorative  { background: #f1f5f9; color: #475569; }   /* slate-100/600 — neutral */
.status-layout      { background: #f1f5f9; color: #475569; }
.rsub-pending    { background: #fef3c7; color: #856404; }
.rsub-done       { background: var(--success-l); color: #065f46; margin-left: .3rem; }

/* ── Skip section ──────────────────────────────────────────── */
.skip-section {
  margin: 2rem auto 0; max-width: 860px;
  padding: 1rem 1.5rem;
  border: 1px dashed var(--border-md);
  border-radius: var(--r10);
  background: var(--slate-50);
  text-align: center;
}
.btn-skip-all {
  border: 1.5px solid var(--border-md); background: transparent; color: var(--slate-600);
  padding: .45rem 1.3rem; border-radius: var(--r8); font-size: .875rem;
  font-weight: 600; cursor: pointer; transition: all .15s; font-family: var(--font);
}
.btn-skip-all:hover { background: var(--slate-100); border-color: var(--slate-500); color: var(--slate-800); }
.skip-desc {
  margin: .55rem auto 0; max-width: 560px;
  font-size: .78rem; color: var(--slate-500); line-height: 1.5;
}

/* ── Incompatibility alert ─────────────────────────────────── */
.incompat-alert {
  background: var(--warn-ll); border: 1.5px solid var(--warn-l);
  border-radius: var(--r10); padding: 1rem 1.2rem; margin: .9rem 0;
}
.incompat-header { display: flex; align-items: center; gap: .55rem; margin-bottom: .45rem; }
.incompat-icon { display: flex; color: var(--warn); }
.incompat-icon svg, .incompat-icon i { width: 1.2rem; height: 1.2rem; }
.incompat-header strong { font-size: .95rem; color: var(--warn-text); }
.incompat-body { font-size: .875rem; color: var(--warn-dark); margin: 0 0 .45rem; line-height: 1.6; }
.incompat-details summary { cursor: pointer; font-size: .875rem; color: var(--warn-text); }
.incompat-to { font-size: .83rem; margin: .45rem 0; }
.incompat-textarea {
  width: 100%; max-width: 680px; height: 12rem;
  font-family: var(--font-mono); font-size: .76rem;
  border: 1px solid var(--border-md); border-radius: var(--r6);
  padding: .5rem; resize: vertical; background: var(--surface); margin-top: .55rem;
}
.incompat-actions { display: flex; gap: .65rem; align-items: center; margin-top: .65rem; flex-wrap: wrap; }

/* ── Settings/val-section spacing ─────────────────────────── */
.val-section + .val-section { margin-top: 1.25rem; }

/* ── Login / first-run ─────────────────────────────────────── */
.login-page {
  max-width: 420px; margin: 3rem auto;
  padding: 2.25rem 2.5rem;
  background: var(--surface); border-radius: var(--r16);
  box-shadow: var(--sh-xl); border: 1px solid var(--border);
}
.login-page h2 { margin: 0 0 1.25rem; font-size: 1.2rem; color: var(--text); letter-spacing: -.015em; font-weight: 700; }
.login-form .form-group { margin-bottom: .9rem; }
.login-form label { display: block; font-size: .83rem; font-weight: 600; color: var(--slate-700); margin-bottom: .3rem; }
.login-form .form-control {
  width: 100%; padding: .5rem .7rem;
  border: 1px solid var(--border-md); border-radius: var(--r8);
  font-size: .925rem; box-sizing: border-box; font-family: var(--font);
  transition: border-color .15s;
}
.login-form .form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.login-form .btn { margin-top: .5rem; width: 100%; justify-content: center; }
.login-error {
  background: var(--error-ll); border: 1px solid var(--error-l);
  border-radius: var(--r8); padding: .55rem .85rem;
  color: var(--error-text); font-size: .85rem; margin-bottom: .9rem;
}

/* ── Fixed Layout note ─────────────────────────────────────── */
.upload-fixed-note {
  color: var(--warn-text); font-size: .77rem; margin-top: .2rem;
}

/* ── Suspicious URL alert ──────────────────────────────────── */
.sus-url-alert {
  background: var(--warn-ll); border: 1.5px solid var(--warn-l);
  border-radius: var(--r10); padding: 1rem 1.2rem; margin: .9rem 0;
}
.sus-url-header { display: flex; align-items: center; gap: .55rem; margin-bottom: .45rem; }
.sus-url-icon { display: flex; color: var(--warn); }
.sus-url-icon svg, .sus-url-icon i { width: 1.15rem; height: 1.15rem; }
.sus-url-header strong { font-size: .95rem; color: var(--warn-text); }
.sus-url-body { font-size: .85rem; color: var(--warn-dark); margin: 0 0 .55rem; line-height: 1.6; }
.sus-url-list { margin: 0 0 .55rem 1.1rem; padding: 0; list-style: disc; font-size: .8rem; }
.sus-url-item { margin-bottom: .3rem; word-break: break-all; }
.sus-url-chars { margin-right: .35rem; }
.sus-url-chars code { background: var(--warn-l); border-radius: var(--r4); padding: .08em .3em; font-weight: 700; color: var(--warn-text); }
.sus-url-orig  { color: var(--slate-700); }
.sus-url-hint  { font-size: .8rem; color: var(--warn-text); margin: 0; font-style: italic; }

/* ── Export — computed a11y metadata panel ─────────────────── */
.a11y-computed-section { margin-top: 1.5rem; }

.a11y-checklist {
  display: flex; flex-direction: column; gap: .45rem;
  margin: .75rem 0 1rem;
}

.a11y-check-item {
  display: flex; align-items: flex-start; gap: .65rem;
  padding: .55rem .8rem; border-radius: var(--r8);
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: .875rem;
}

.a11y-check-ok   { border-color: var(--success-bd); background: var(--success-ll); }
.a11y-check-warn { border-color: var(--warn-l);     background: var(--warn-ll); }

.a11y-check-icon {
  flex-shrink: 0; width: 1.2rem; height: 1.2rem;
  font-size: 1rem; line-height: 1.2;
  color: var(--success-text);
}
.a11y-check-warn .a11y-check-icon { color: var(--warn-text); }

.a11y-check-body {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: .25rem .5rem; flex: 1;
}

.a11y-check-prop {
  font-weight: 600; font-size: .8rem; font-family: var(--font-mono);
  color: var(--text); letter-spacing: -.01em;
}

.a11y-check-val {
  font-size: .83rem; color: var(--text-md);
  flex: 1; min-width: 0;
}

.a11y-check-note {
  font-size: .78rem; color: var(--text-sm);
  width: 100%; margin-top: .15rem; font-style: italic;
}

.a11y-note-ok   { font-size: .78rem; color: var(--success-text); font-style: italic; margin-left: .25rem; }
.a11y-note-warn { font-size: .78rem; color: var(--warn-text);    font-style: italic; margin-left: .25rem; }

/* Summary textarea block */
.a11y-summary-block {
  margin-top: 1rem;
  padding: .8rem 1rem;
  border: 1px solid var(--border-md);
  border-radius: var(--r10);
  background: var(--surface);
}
.a11y-summary-block label {
  display: flex; align-items: baseline; gap: .4rem;
  font-size: .875rem; margin-bottom: .2rem;
}
.a11y-summary-block textarea {
  width: 100%; box-sizing: border-box;
  font-size: .875rem; font-family: var(--font);
  border: 1px solid var(--border-md); border-radius: var(--r8);
  padding: .5rem .7rem; resize: vertical;
  transition: border-color .15s;
}
.a11y-summary-block textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

/* Pending review warning banner */
.export-pending-warn {
  border-left: 4px solid var(--warn);
  padding: .75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: .875rem;
}
