/* ==========================================================================
   Document Extraction Demo — theme
   ========================================================================== */

:root {
  --bg: #0A0E17;
  --surface: rgba(12, 16, 36, 0.95);
  --surface-alt: #0E1228;
  --border: rgba(55, 25, 202, 0.20);
  --violet: #3719CA;
  --violet-2: #4A2BE2;
  --cyan: #1DD1E8;
  --text: #E8EAF0;
  --text-dim: #8B92A8;
  --warn: #F0925C;
  --danger: #F0615C;
  --good: #3FE0A5;

  --radius: 20px;
  --radius-sm: 12px;
  --font-ui: 'Poppins', system-ui, -apple-system, Segoe UI, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  min-height: 100vh;
}

#root {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

/* top-of-page radial glow */
#root::before {
  content: "";
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 1200px;
  height: 700px;
  max-width: 160vw;
  background: radial-gradient(closest-side, rgba(74, 43, 226, 0.35), rgba(29, 209, 232, 0.08) 55%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

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

button { font-family: inherit; }

/* ---------- layout shells ---------- */

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.center-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ---------- header ---------- */

.app-header {
  position: relative;
  z-index: 1;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 14, 23, 0.6);
  backdrop-filter: blur(10px);
}

.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: 1080px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-mark svg { width: 18px; height: 18px; stroke: #fff; }

.brand-name { font-size: 16px; }
.brand-sub { color: var(--text-dim); font-size: 12px; font-weight: 400; }

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.api-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  box-shadow: 0 0 0 rgba(0,0,0,0);
}

.status-dot.online { background: var(--good); box-shadow: 0 0 8px var(--good); }
.status-dot.offline { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.status-dot.checking { background: var(--warn); animation: pulse 1.2s infinite ease-in-out; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-primary {
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  color: #fff;
  padding: 13px 28px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(55, 25, 202, 0.35);
}

.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(29, 209, 232, 0.3); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 999px;
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }

.btn-sm { padding: 8px 16px; font-size: 13px; }

.btn-link {
  background: none;
  border: none;
  color: var(--cyan);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
}

/* ---------- login ---------- */

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  text-align: center;
}

.login-brand .brand-mark { width: 52px; height: 52px; border-radius: 14px; }
.login-brand .brand-mark svg { width: 26px; height: 26px; }
.login-brand h1 { font-size: 19px; margin: 0; }
.login-brand p { margin: 0; color: var(--text-dim); font-size: 13px; }

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 7px;
  font-weight: 500;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease;
}

.field textarea { font-family: var(--font-ui); resize: vertical; min-height: 70px; }

.field select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  font-family: var(--font-mono);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B92A8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
}

.field select option {
  background: var(--surface-alt);
  color: var(--text);
}

.field input:focus,
.field textarea:focus,
.field select:focus { border-color: var(--cyan); }

.field-hint { color: var(--text-dim); font-size: 12px; margin-top: 6px; }

.error-box {
  background: rgba(240, 97, 92, 0.1);
  border: 1px solid rgba(240, 97, 92, 0.35);
  color: #FCA5A1;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 18px;
  line-height: 1.5;
}

.error-box strong { color: #fff; }

.warn-box {
  background: rgba(240, 146, 92, 0.1);
  border: 1px solid rgba(240, 146, 92, 0.35);
  color: var(--warn);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 18px;
}

.login-card .btn-primary { width: 100%; margin-top: 4px; }

.login-footnote {
  margin-top: 22px;
  text-align: center;
  color: var(--text-dim);
  font-size: 11.5px;
  line-height: 1.5;
}

/* ---------- home ---------- */

.page-title { margin: 8px 0 4px; font-size: 26px; }
.page-subtitle { color: var(--text-dim); font-size: 14.5px; margin: 0 0 32px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding-bottom: 60px;
}

.doc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.doc-card:hover {
  transform: translateY(-3px);
  border-color: rgba(29, 209, 232, 0.4);
  box-shadow: 0 12px 30px rgba(55, 25, 202, 0.25);
}

.doc-card-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(55, 25, 202, 0.35), rgba(29, 209, 232, 0.2));
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.doc-card-icon svg { width: 24px; height: 24px; stroke: var(--cyan); }

.doc-card h3 { margin: 0; font-size: 16px; }
.doc-card p { margin: 0; color: var(--text-dim); font-size: 13px; line-height: 1.5; }

.doc-card .subtypes {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  opacity: 0.7;
  margin-top: auto;
}

.doc-card.auto {
  background: linear-gradient(135deg, rgba(55, 25, 202, 0.18), rgba(29, 209, 232, 0.08));
  border-color: rgba(29, 209, 232, 0.35);
}

/* ---------- configuration wizard ---------- */

.cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(55, 25, 202, 0.22), rgba(29, 209, 232, 0.10));
  border: 1px solid rgba(29, 209, 232, 0.35);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin: 8px 0 32px;
}

.cta-banner h2 { margin: 0 0 6px; font-size: 16px; }
.cta-banner p { margin: 0; color: var(--text-dim); font-size: 13px; max-width: 480px; }
.cta-banner .btn-primary { white-space: nowrap; }

.config-wizard {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 640px;
  margin: 0 auto 60px;
}

.config-step h3 {
  margin: 0 0 16px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--cyan);
}

.fields-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.option-pill-list { display: flex; flex-wrap: wrap; gap: 10px; }

.option-pill {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.option-pill:hover { border-color: var(--cyan); }
.option-pill.selected {
  background: linear-gradient(90deg, rgba(55, 25, 202, 0.35), rgba(29, 209, 232, 0.2));
  border-color: var(--cyan);
  color: var(--text);
  font-weight: 500;
}

.field-option-list { display: flex; flex-direction: column; }

.field-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 2px;
  border-top: 1px solid var(--border);
  cursor: pointer;
  font-size: 14px;
}
.field-option:first-child { border-top: none; }

.field-option input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--cyan);
  cursor: pointer;
  flex-shrink: 0;
}

.field-option-label { flex: 1; }
.field-option.checked .field-option-label { color: var(--cyan); font-weight: 500; }

.tag-recommended {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(63, 224, 165, 0.12);
  border: 1px solid rgba(63, 224, 165, 0.35);
  color: var(--good);
  flex-shrink: 0;
}

.custom-field-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.custom-field-input {
  flex: 1;
  min-width: 0;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease;
}
.custom-field-input:focus { border-color: var(--cyan); }

.custom-field-row .btn-ghost { flex-shrink: 0; }

.selected-fields-box {
  margin-top: 20px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.selected-fields-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 10px;
  font-weight: 600;
}

.selected-fields-empty { color: var(--text-dim); font-size: 13px; }

.selected-field-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.selected-field-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(90deg, rgba(55, 25, 202, 0.35), rgba(29, 209, 232, 0.2));
  border: 1px solid rgba(29, 209, 232, 0.35);
  border-radius: 999px;
  padding: 6px 8px 6px 14px;
  font-size: 12.5px;
  font-family: var(--font-mono);
}

.selected-field-chip button {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.selected-field-chip button:hover { background: var(--danger); }

.pending-panel {
  text-align: center;
  max-width: 480px;
  margin: 20px auto 60px;
  padding: 48px 32px;
}

.pending-panel .pending-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(55, 25, 202, 0.35), rgba(29, 209, 232, 0.2));
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pending-panel .pending-icon svg { width: 28px; height: 28px; stroke: var(--cyan); }

.pending-panel h2 { margin: 0 0 10px; font-size: 19px; }
.pending-panel p { margin: 0 0 26px; color: var(--text-dim); font-size: 13.5px; line-height: 1.5; }

/* ---------- upload ---------- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 18px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}
.back-link:hover { color: var(--cyan); }

.upload-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 640px;
  margin: 0 auto 60px;
}

.upload-panel-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.upload-panel-head h2 { margin: 0; font-size: 19px; }
.upload-panel-head p { margin: 2px 0 0; color: var(--text-dim); font-size: 13px; }

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  background: var(--surface-alt);
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--cyan);
  background: rgba(29, 209, 232, 0.05);
}

.dropzone svg { width: 32px; height: 32px; stroke: var(--cyan); margin-bottom: 10px; }
.dropzone-title { font-weight: 600; font-size: 14.5px; }
.dropzone-sub { color: var(--text-dim); font-size: 12.5px; margin-top: 4px; }

.picked-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.picked-file .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picked-file button {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.picked-file button:hover { color: var(--danger); }

/* ---------- processing ---------- */

.processing-box {
  text-align: center;
  padding: 60px 20px;
}

.spinner {
  width: 54px;
  height: 54px;
  margin: 0 auto 24px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--cyan);
  animation: spin 0.9s linear infinite;
}

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

.processing-box h2 { margin: 0 0 8px; font-size: 18px; }
.processing-box p { color: var(--text-dim); font-size: 13px; font-family: var(--font-mono); }

/* ---------- result ---------- */

.result-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.result-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
}

.result-title h2 { margin: 0 0 4px; font-size: 21px; }
.result-title .meta {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--text-dim);
  font-size: 12.5px;
  font-family: var(--font-mono);
  flex-wrap: wrap;
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 11.5px;
}

.badges { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.badge {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  min-width: 92px;
}

.badge .value { font-family: var(--font-mono); font-size: 20px; font-weight: 700; }
.badge .label { font-size: 10.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }

.badge.confidence-high .value { color: var(--good); }
.badge.confidence-mid .value { color: var(--warn); }
.badge.confidence-low .value { color: var(--danger); }

.trust-badge { cursor: pointer; }

.trust-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  z-index: 20;
  text-align: left;
}

.trust-popover h4 { margin: 0 0 10px; font-size: 12.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }

.trust-factor {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
}
.trust-factor:first-of-type { border-top: none; }
.trust-factor .fname { color: var(--text); }
.trust-factor .fdetail { color: var(--text-dim); font-size: 11px; }
.trust-factor .pass { color: var(--good); }
.trust-factor .fail { color: var(--danger); }

.view-toggle {
  display: inline-flex;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  margin-bottom: 20px;
}

.view-toggle button {
  border: none;
  background: none;
  color: var(--text-dim);
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-ui);
}

.view-toggle button.active {
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  color: #fff;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.panel h3 {
  margin: 0 0 16px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel.key-fields h3 { color: var(--cyan); }
.panel.key-fields { border-color: rgba(29, 209, 232, 0.3); }

.field-rows { display: flex; flex-direction: column; }

.field-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
}
.field-row:first-child { border-top: none; }

.field-row .flabel { color: var(--text-dim); font-size: 13.5px; flex-shrink: 0; }
.field-row .fvalue { font-family: var(--font-mono); font-size: 13.5px; text-align: right; word-break: break-word; }

.field-row.block {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.field-row.block .fvalue { text-align: left; }

.sub-table-wrap { overflow-x: auto; margin-top: 6px; width: 100%; }
.sub-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 12.5px; }
.sub-table th, .sub-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.sub-table th { color: var(--text-dim); font-weight: 600; text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.4px; }

details.array-collapse { width: 100%; }
details.array-collapse summary {
  cursor: pointer;
  color: var(--cyan);
  font-size: 12.5px;
  font-family: var(--font-mono);
  list-style: none;
}
details.array-collapse summary::-webkit-details-marker { display: none; }
details.array-collapse summary:before { content: "▸ "; }
details.array-collapse[open] summary:before { content: "▾ "; }

.json-block {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  word-break: break-word;
  max-height: 640px;
  overflow-y: auto;
}

/* ---------- raw JSON tree (collapsible) ---------- */

.json-tree { white-space: normal; }

.jt-row { padding: 1px 0; }

.jt-children {
  margin-left: 8px;
  padding-left: 10px;
  border-left: 1px dashed var(--border);
}

.jt-details summary {
  cursor: pointer;
  list-style: none;
  display: inline;
}
.jt-details summary::-webkit-details-marker { display: none; }
.jt-details > summary .jt-close-inline { display: none; }
.jt-details[open] > summary .jt-close-inline { display: none; }
.jt-details:not([open]) > summary .jt-close-inline { display: inline; }

.jt-details summary:before {
  content: "▸ ";
  color: var(--text-dim);
}
.jt-details[open] > summary:before { content: "▾ "; }

.jt-close-line { color: var(--text-dim); }

.jt-count {
  color: var(--text-dim);
  font-style: italic;
}

.jt-key { color: var(--cyan); }
.jt-punc { color: var(--text-dim); }
.jt-str { color: var(--good); }
.jt-num { color: var(--warn); }
.jt-bool, .jt-null { color: var(--violet-2); font-weight: 600; }

.json-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.quality-issues { margin-top: 6px; font-size: 12.5px; color: var(--warn); }

.result-footer {
  display: flex;
  justify-content: center;
  padding: 20px 0 60px;
}

.retry-box {
  text-align: center;
  padding: 20px 0;
}

.retry-box .btn-primary { margin-top: 6px; }

/* ---------- misc ---------- */

.spacer { flex: 1; }

@media (max-width: 900px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr; }
  .result-header { flex-direction: column; align-items: flex-start; }
  .badges { width: 100%; }
  .badge { flex: 1; }
  .field-row { flex-direction: column; gap: 4px; }
  .field-row .fvalue { text-align: left; }
  .upload-panel { padding: 22px; }
  .login-card { padding: 30px 24px; }
  .cta-banner { flex-direction: column; align-items: stretch; text-align: center; }
  .cta-banner .btn-primary { width: 100%; }
}
