/* ================================================================
   SmartPlans — Design System & Styles
   AI-Powered Construction Document Analysis
   ================================================================ */

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

:root {
  /* Color Tokens */
  --bg-deep: #050a18;
  --bg-surface: rgba(12, 20, 40, 0.65);
  --bg-surface-2: rgba(255, 255, 255, 0.03);
  --bg-surface-hover: rgba(255, 255, 255, 0.06);

  --accent-sky: #38bdf8;
  --accent-indigo: #818cf8;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --text-primary: #e8ecf4;
  --text-secondary: rgba(255, 255, 255, 0.55);
  --text-muted: rgba(255, 255, 255, 0.3);

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(56, 189, 248, 0.25);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  --shadow-glow: 0 0 30px rgba(56, 189, 248, 0.12);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.25);

  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;

  --transition-fast: 0.15s ease;
  --transition-med: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

::selection { background: rgba(56, 189, 248, 0.3); }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.14); }

/* ─── Animated Background ─── */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 100%);
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  will-change: transform;
}

.bg-orb-1 {
  width: 600px; height: 600px;
  top: 10%; left: 5%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.06) 0%, transparent 70%);
  animation: orbFloat1 22s ease-in-out infinite;
}

.bg-orb-2 {
  width: 500px; height: 500px;
  bottom: 5%; right: 5%;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.05) 0%, transparent 70%);
  animation: orbFloat2 28s ease-in-out infinite;
}

.bg-orb-3 {
  width: 350px; height: 350px;
  top: 50%; left: 60%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.04) 0%, transparent 70%);
  animation: orbFloat3 18s ease-in-out infinite;
}

@keyframes orbFloat1 { 0%,100%{transform:translate(0,0)} 33%{transform:translate(40px,-50px)} 66%{transform:translate(-20px,30px)} }
@keyframes orbFloat2 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-35px,40px)} }
@keyframes orbFloat3 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(30px,-25px)} }

/* ─── App Shell ─── */
#app-shell {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
}

/* ─── Header ─── */
#app-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(8, 14, 30, 0.8);
  backdrop-filter: blur(12px);
}

.header-logo svg {
  display: block;
  filter: drop-shadow(0 2px 8px rgba(56, 189, 248, 0.3));
}

.header-text h1 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--accent-sky), var(--accent-indigo));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-text p {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ─── Step Navigation ─── */
#step-nav {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  overflow-x: auto;
  background: rgba(8, 14, 30, 0.5);
  border-bottom: 1px solid var(--border-subtle);
  gap: 0;
  scrollbar-width: none;
}
#step-nav::-webkit-scrollbar { display: none; }

.step-item {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.step-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: default;
  padding: 4px 4px;
  min-width: 0;
  opacity: 0.3;
  transition: opacity var(--transition-med), transform var(--transition-fast);
}

.step-btn.clickable {
  cursor: pointer;
  opacity: 1;
}
.step-btn.clickable:hover { transform: translateY(-1px); }

.step-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  transition: all var(--transition-med);
  border: 2px solid var(--border-medium);
  background: var(--bg-surface-2);
  color: var(--text-muted);
  position: relative;
}

.step-btn.active .step-circle {
  background: linear-gradient(135deg, var(--accent-sky), var(--accent-indigo));
  border-color: var(--accent-sky);
  color: #fff;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}

.step-btn.completed .step-circle {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
  font-size: 14px;
}

.step-label {
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
  transition: color var(--transition-med);
}

.step-btn.active .step-label { color: var(--accent-sky); font-weight: 700; }
.step-btn.completed .step-label { color: var(--accent-emerald); }

.step-connector {
  flex: 1;
  height: 2px;
  min-width: 8px;
  background: var(--border-subtle);
  border-radius: 1px;
  margin: 0 3px 20px;
  transition: background var(--transition-slow);
}
.step-connector.done {
  background: linear-gradient(90deg, var(--accent-emerald), rgba(16, 185, 129, 0.4));
}

/* ─── Main Content ─── */
#step-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 36px;
  scroll-behavior: smooth;
}

.step-heading {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #fff, rgba(255,255,255,0.85));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.step-subheading {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
  line-height: 1.6;
}

/* ─── Form Elements ─── */
.form-group {
  margin-bottom: 22px;
}

.form-label {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.form-label .required {
  color: var(--accent-rose);
  margin-left: 2px;
}

.form-hint {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.55;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent-sky);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
  background: rgba(255, 255, 255, 0.06);
}

.form-select option {
  background: #1a2340;
  color: #e2e8f0;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* ─── Chip / Multi-Select Buttons ─── */
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-medium);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.chip:hover {
  border-color: rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.06);
  color: var(--text-primary);
}

.chip.selected {
  border-color: var(--accent-sky);
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-sky);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.08);
}

/* ─── Toggle Buttons ─── */
.toggle-row {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.toggle-btn {
  flex: 1;
  padding: 16px 22px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-medium);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.toggle-btn:hover {
  border-color: rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.04);
}

.toggle-btn.selected {
  border-color: var(--accent-sky);
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-sky);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.1);
}

/* ─── File Upload Zone ─── */
.upload-zone {
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: rgba(255, 255, 255, 0.015);
  position: relative;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent-sky);
  background: rgba(56, 189, 248, 0.04);
}

.upload-zone.drag-over {
  box-shadow: inset 0 0 30px rgba(56, 189, 248, 0.06);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-icon {
  font-size: 36px;
  margin-bottom: 10px;
  opacity: 0.7;
}

.upload-text {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.upload-formats {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 6px;
  font-family: var(--font-mono);
}

/* File List */
.file-list {
  margin-top: 12px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 5px;
  animation: slideIn 0.2s ease;
}

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

.file-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.file-item-icon { font-size: 16px; flex-shrink: 0; }

.file-item-name {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item-size {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.file-remove-btn {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: var(--accent-rose);
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.file-remove-btn:hover {
  background: rgba(244, 63, 94, 0.2);
}

/* ─── Info Cards ─── */
.info-card {
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 18px;
  border: 1px solid;
  position: relative;
  overflow: hidden;
}

.info-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
}

.info-card--sky {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.06), rgba(56, 189, 248, 0.02));
  border-color: rgba(56, 189, 248, 0.15);
}
.info-card--sky::before { background: var(--accent-sky); }

.info-card--amber {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.06), rgba(245, 158, 11, 0.02));
  border-color: rgba(245, 158, 11, 0.15);
}
.info-card--amber::before { background: var(--accent-amber); }

.info-card--rose {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.06), rgba(244, 63, 94, 0.02));
  border-color: rgba(244, 63, 94, 0.15);
}
.info-card--rose::before { background: var(--accent-rose); }

.info-card--indigo {
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.06), rgba(129, 140, 248, 0.02));
  border-color: rgba(129, 140, 248, 0.15);
}
.info-card--indigo::before { background: var(--accent-indigo); }

.info-card--emerald {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), rgba(16, 185, 129, 0.02));
  border-color: rgba(16, 185, 129, 0.15);
}
.info-card--emerald::before { background: var(--accent-emerald); }

.info-card-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  padding-left: 8px;
}

.info-card--sky .info-card-title { color: var(--accent-sky); }
.info-card--amber .info-card-title { color: var(--accent-amber); }
.info-card--rose .info-card-title { color: var(--accent-rose); }
.info-card--indigo .info-card-title { color: var(--accent-indigo); }
.info-card--emerald .info-card-title { color: var(--accent-emerald); }

.info-card-body {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.7;
  padding-left: 8px;
}

.info-card-body div { margin-bottom: 3px; }
.info-card-body strong { color: var(--text-primary); }

/* ─── Format Quality Badge ─── */
.format-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}

.format-badge.best {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.format-badge.ok {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.format-badge.poor {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

/* ─── Review Summary Grid ─── */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 22px;
}

.summary-card {
  padding: 16px 18px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
}

.summary-card:hover {
  border-color: var(--border-medium);
}

.summary-card-label {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
  font-weight: 600;
}

.summary-card-value {
  font-size: 14px;
  font-weight: 650;
  color: var(--text-primary);
}

.summary-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── File Summary Panel ─── */
.files-summary {
  padding: 18px 22px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 22px;
}

.files-summary-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.files-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.files-summary-row:last-child { border-bottom: none; }

.files-summary-row-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.files-summary-count {
  font-size: 13px;
  font-weight: 650;
  font-family: var(--font-mono);
}

.files-summary-count.has-files { color: var(--accent-emerald); }
.files-summary-count.no-files { color: var(--text-muted); }

/* ─── Accuracy Gauge ─── */
.accuracy-panel {
  padding: 28px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.06), rgba(129, 140, 248, 0.06));
  border: 1px solid rgba(56, 189, 248, 0.12);
  border-radius: var(--radius-lg);
  text-align: center;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}

.accuracy-panel::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 80%, rgba(56, 189, 248, 0.04), transparent 60%);
  pointer-events: none;
}

.accuracy-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.accuracy-value {
  font-size: 52px;
  font-weight: 900;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--accent-sky), var(--accent-indigo));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.accuracy-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
  position: relative;
  z-index: 1;
}

/* ─── Analysis Progress ─── */
.analysis-overlay {
  text-align: center;
  padding: 60px 20px;
  animation: fadeInUp 0.4s ease;
}

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

.analysis-ring {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 36px;
  position: relative;
}

.analysis-ring-inner {
  width: 106px;
  height: 106px;
  border-radius: 50%;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.analysis-pct {
  font-size: 30px;
  font-weight: 900;
  color: var(--accent-sky);
  letter-spacing: -0.03em;
  line-height: 1;
}

.analysis-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.analysis-stage {
  font-size: 14px;
  color: var(--accent-sky);
  min-height: 22px;
  transition: opacity 0.3s;
}

.analysis-bar-track {
  width: 100%;
  max-width: 420px;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  margin: 22px auto 0;
  overflow: hidden;
}

.analysis-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-sky), var(--accent-indigo));
  border-radius: 2px;
  transition: width 0.25s linear;
}

/* ─── Results Page ─── */
.results-hero {
  padding: 28px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.07), rgba(56, 189, 248, 0.07));
  border: 1px solid rgba(16, 185, 129, 0.12);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.results-top {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.results-ring {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.results-ring-inner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
}

.results-ring-pct {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-emerald);
}

.results-confidence-label {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.results-confidence-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.results-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.results-stat {
  text-align: center;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
}

.results-stat-icon { font-size: 22px; margin-bottom: 6px; }

.results-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.results-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* ─── RFI List ─── */
.rfi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 28px 0 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.rfi-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.rfi-actions {
  display: flex;
  gap: 8px;
}

.rfi-action-btn {
  padding: 7px 16px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.rfi-action-btn--select {
  border: 1px solid rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.08);
  color: var(--accent-sky);
}

.rfi-action-btn--clear {
  border: 1px solid var(--border-medium);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
}

.rfi-action-btn:hover { opacity: 0.85; }

.rfi-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
}

.rfi-item {
  margin-bottom: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface-2);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.rfi-item.selected {
  border-color: var(--border-accent);
  background: rgba(56, 189, 248, 0.04);
}

.rfi-item-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  user-select: none;
}

.rfi-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border-medium);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 12px;
  color: #fff;
  font-weight: 700;
  transition: all var(--transition-fast);
}

.rfi-checkbox.checked {
  border-color: var(--accent-sky);
  background: var(--accent-sky);
}

.rfi-item-content {
  flex: 1;
  min-width: 0;
}

.rfi-item-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.rfi-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.rfi-tag--id {
  color: var(--accent-sky);
  background: rgba(56, 189, 248, 0.1);
}

.rfi-tag--discipline {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
}

.rfi-item-question {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
}

.rfi-item-question.truncated {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rfi-expand-icon {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.rfi-expand-icon.open { transform: rotate(180deg); }

.rfi-item-reason {
  padding: 0 16px 14px 50px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  animation: slideIn 0.15s ease;
}

.rfi-item-reason strong {
  color: var(--accent-amber);
}

/* ─── Export Button ─── */
.export-btn {
  width: 100%;
  margin-top: 22px;
  padding: 15px 24px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.2);
  font-family: var(--font-sans);
}

.export-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.3);
}

/* ─── Footer Nav ─── */
#step-footer {
  padding: 16px 36px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(8, 14, 30, 0.8);
  backdrop-filter: blur(12px);
}

.footer-btn {
  padding: 11px 22px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
  border: none;
}

.footer-btn--back {
  border: 1px solid var(--border-medium);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
}

.footer-btn--back:hover:not(:disabled) {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.footer-btn--back:disabled {
  opacity: 0.3;
  cursor: default;
}

.footer-btn--next {
  background: linear-gradient(135deg, var(--accent-sky), var(--accent-indigo));
  color: #fff;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.2);
}

.footer-btn--next:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.3);
}

.footer-btn--next:disabled {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.2);
  box-shadow: none;
  cursor: default;
}

.footer-step-indicator {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.footer-btn--restart {
  padding: 11px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
  margin: 0 auto;
}

.footer-btn--restart:hover {
  border-color: var(--border-accent);
  background: rgba(56, 189, 248, 0.06);
  color: var(--accent-sky);
}

/* ─── Upload count badge ─── */
.upload-count {
  padding: 12px 18px;
  background: rgba(16, 185, 129, 0.07);
  border: 1px solid rgba(16, 185, 129, 0.18);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--accent-emerald);
  font-weight: 600;
  margin-top: 14px;
}

/* ─── Responsive ─── */
@media (max-width: 640px) {
  #step-content { padding: 22px 18px; }
  #step-footer { padding: 14px 18px; }
  #app-header { padding: 14px 18px; }
  .step-heading { font-size: 22px; }
  .summary-grid { grid-template-columns: 1fr; }
  .results-stats { grid-template-columns: 1fr; }
  .accuracy-value { font-size: 40px; }
}
