:root {
  --bg: #eef3f9;
  --bg-deep: #0f172a;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --surface-muted: #f7fafc;
  --line: rgba(148, 163, 184, 0.28);
  --line-strong: rgba(148, 163, 184, 0.5);
  --text: #0f172a;
  --muted: #526277;
  --muted-soft: #6b7a90;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --brand-soft: rgba(37, 99, 235, 0.12);
  --success: #15803d;
  --success-soft: rgba(34, 197, 94, 0.15);
  --warning: #b45309;
  --warning-soft: rgba(245, 158, 11, 0.18);
  --danger: #dc2626;
  --danger-soft: rgba(239, 68, 68, 0.18);
  --shadow-sm: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.12);
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
}

@font-face {
  font-family: "CVIS Display";
  src: url("/static/fonts/cvis/Bricolage_Grotesque/BricolageGrotesque-VariableFont_opsz,wdth,wght.ttf") format("truetype");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 500 16px/1.5 "CVIS Display", "Segoe UI", Tahoma, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.08), transparent 22%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.app-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0)),
    radial-gradient(circle at 20% 0%, rgba(37, 99, 235, 0.09), transparent 34%),
    radial-gradient(circle at 100% 20%, rgba(59, 130, 246, 0.08), transparent 32%);
  z-index: -1;
}

.app-main,
.auth-main {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
}

.app-main {
  padding: 36px 0 56px;
}

.auth-main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(248, 251, 255, 0.82);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.topbar-inner {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-lockup strong {
  display: block;
  font-size: 1.6rem;
  line-height: 1;
}

.brand-lockup small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.brand-mark.large {
  width: 54px;
  height: 54px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topnav-link {
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 600;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.topnav-link:hover,
.topnav-link.active {
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

.user-badge em {
  color: var(--muted);
  font-style: normal;
  text-transform: capitalize;
}

.page-shell {
  display: grid;
  gap: 24px;
}

.page-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  padding: 10px 0 4px;
}

.page-hero h1,
.auth-copy h1,
.confirmation-card h1 {
  margin: 0;
  font-size: clamp(2.3rem, 4vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.page-hero p,
.auth-copy p,
.confirmation-card p {
  margin: 12px 0 0;
  max-width: 780px;
  color: var(--muted);
  font-size: 1.05rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  color: var(--brand-strong);
  font-size: 0.92rem;
  font-weight: 700;
}

.hero-actions,
.form-actions,
.action-cluster {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-stat-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
}

.hero-stat,
.stat-card,
.side-card,
.table-card,
.filter-panel,
.settings-panel,
.upload-form-card,
.document-panel,
.review-form-card,
.summary-panel,
.confirmation-card,
.chat-card,
.auth-card,
.list-card,
.event-card,
.empty-card,
.insight-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}

.hero-stat,
.stat-card,
.list-card,
.event-card,
.empty-card {
  border-radius: var(--radius-md);
}

.hero-stat {
  padding: 16px 18px;
}

.hero-stat span,
.stat-card span,
.ordered-label,
.panel-header p,
.inline-note,
.cell-meta {
  color: var(--muted);
}

.hero-stat strong,
.stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.5rem;
}

.workspace-grid {
  display: grid;
  gap: 24px;
}

.upload-layout {
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.65fr);
}

.records-layout {
  grid-template-columns: minmax(280px, 0.52fr) minmax(0, 1.48fr);
}

.records-layout-stitch {
  grid-template-columns: minmax(240px, 0.42fr) minmax(0, 1.58fr);
  align-items: start;
}

.dashboard-layout {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
}

.review-layout {
  grid-template-columns: minmax(280px, 0.6fr) minmax(0, 1.4fr);
}

.review-layout-stitch {
  grid-template-columns: minmax(340px, 0.95fr) minmax(240px, 0.58fr) minmax(360px, 0.9fr);
  align-items: start;
}

.filter-panel,
.settings-panel,
.side-card,
.document-panel,
.summary-panel {
  padding: 24px;
  border-radius: var(--radius-lg);
}

.table-card,
.upload-form-card,
.review-form-card,
.chat-card,
.auth-card,
.confirmation-card {
  border-radius: var(--radius-lg);
  padding: 26px;
}

.review-page {
  color: #e5edf8;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.11), transparent 22%),
    linear-gradient(180deg, #10192b 0%, #0b1220 100%);
}

.review-page .app-backdrop {
  background:
    radial-gradient(circle at 20% 10%, rgba(59, 130, 246, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(14, 23, 40, 0.92), rgba(8, 13, 24, 0.96));
}

.review-page .topbar {
  background: rgba(20, 29, 46, 0.82);
  border-bottom-color: rgba(100, 116, 139, 0.22);
}

.review-page .brand-lockup strong,
.review-page .topnav-link.active,
.review-page .topnav-link:hover {
  color: #f8fbff;
}

.review-page .brand-lockup small,
.review-page .topnav-link,
.review-page .button-link,
.review-page .user-badge em {
  color: #9fb2ce;
}

.review-page .user-badge {
  background: rgba(30, 41, 59, 0.72);
  border-color: rgba(100, 116, 139, 0.28);
  color: #f8fbff;
}

.review-shell-dark {
  gap: 18px;
}

.review-workspace-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.review-workspace-header h1 {
  margin: 0;
  color: #f8fbff;
  font-size: clamp(2rem, 3.3vw, 3rem);
}

.review-workspace-header p {
  margin: 10px 0 0;
  color: #94a8c6;
}

.review-eyebrow {
  background: rgba(30, 41, 59, 0.75);
  border-color: rgba(100, 116, 139, 0.25);
  color: #8cb8ff;
}

.review-header-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 10px;
}

.review-mini-stat {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(30, 41, 59, 0.78);
  border: 1px solid rgba(100, 116, 139, 0.22);
}

.review-mini-stat span {
  color: #90a2bd;
  font-size: 0.85rem;
}

.review-mini-stat strong {
  display: block;
  margin-top: 4px;
  color: #f8fbff;
  font-size: 1.1rem;
}

.review-alert {
  background: rgba(91, 52, 12, 0.35);
  border-color: rgba(245, 158, 11, 0.3);
}

.review-card {
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid rgba(71, 85, 105, 0.4);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.26);
  backdrop-filter: none;
}

.review-card .panel-header h2,
.review-card .insight-card h3,
.review-card .review-field-label,
.review-card .timeline-step strong,
.review-card .plain-list,
.review-card .button-ghost {
  color: #f8fbff;
}

.review-card .panel-header p,
.review-card .timeline-step p,
.review-card .review-confidence-indicator,
.review-card .plain-list li,
.review-card .empty-card,
.review-card .document-toolbar-label {
  color: #98aac5;
}

.review-document-card,
.review-timeline-card,
.review-data-card {
  height: 100%;
}

.review-document-viewer {
  background: rgba(30, 41, 59, 0.45);
  border-color: rgba(71, 85, 105, 0.38);
}

.document-toolbar,
.document-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.document-toolbar {
  margin-bottom: 12px;
}

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

.document-tool-button {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(100, 116, 139, 0.32);
  background: rgba(30, 41, 59, 0.74);
  color: #f8fbff;
  cursor: pointer;
}

.document-tool-button.large {
  width: 38px;
  height: 38px;
}

.document-viewport {
  min-height: 540px;
  display: grid;
  place-items: center;
  padding: 16px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.68);
  overflow: auto;
}

.document-viewport.zoomed .review-document-image {
  max-height: none;
  width: auto;
  max-width: 140%;
}

.review-document-image {
  max-height: 520px;
  width: auto;
  max-width: 100%;
  border-radius: 12px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.22);
}

.review-document-frame {
  min-height: 540px;
  background: #fff;
}

.document-footer-actions {
  justify-content: center;
  margin-top: 12px;
}

.review-timeline-card {
  position: sticky;
  top: 96px;
}

.review-timeline-list {
  gap: 20px;
}

.review-timeline-step {
  grid-template-columns: 28px minmax(0, 1fr);
}

.review-timeline-step span {
  width: 28px;
  height: 28px;
  background: rgba(51, 65, 85, 0.82);
  border-color: rgba(100, 116, 139, 0.5);
}

.review-timeline-step.complete span {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.review-timeline-step.active span {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 0 0 7px rgba(59, 130, 246, 0.16);
}

.review-insight-card {
  margin-top: 22px;
  background: rgba(20, 29, 46, 0.92);
  border: 1px solid rgba(71, 85, 105, 0.34);
}

.review-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.review-field {
  gap: 6px;
}

.review-field .input {
  min-height: 44px;
  color: #f8fbff;
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(71, 85, 105, 0.5);
}

.review-field .input:focus {
  border-color: rgba(59, 130, 246, 0.7);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

.review-field .input-warning {
  border-color: rgba(245, 158, 11, 0.8);
  background: rgba(120, 68, 7, 0.38);
  color: #fff4db;
}

.review-confidence-indicator {
  display: inline-flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
}

.confidence-high {
  color: #4ade80;
}

.confidence-medium {
  color: #facc15;
}

.confidence-low {
  color: #fb7185;
}

.review-actions {
  margin-top: 18px;
}

.review-action-button {
  min-width: 156px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  padding: 22px;
}

.panel-header h2,
.summary-panel h2,
.auth-card h2,
.insight-card h3 {
  margin: 0;
  font-size: 1.35rem;
}

.panel-header p {
  margin: 8px 0 0;
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 260px;
  padding: 28px;
  margin-bottom: 22px;
  border: 2px dashed rgba(148, 163, 184, 0.42);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.62));
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: rgba(37, 99, 235, 0.5);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.dropzone input[type="file"] {
  display: none;
}

.dropzone-icon {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.12), rgba(59, 130, 246, 0.18));
  color: var(--brand-strong);
  font-size: 2rem;
  font-weight: 800;
}

.dropzone h2 {
  margin: 0;
  font-size: 2rem;
}

.dropzone p {
  margin: 0;
  max-width: 620px;
  color: var(--muted);
}

.button {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.28);
}

.button-secondary {
  color: #fff;
  background: linear-gradient(135deg, #1e293b, #334155);
}

.button-danger {
  color: #fff;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.button-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line);
}

.button-link {
  min-height: auto;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--muted-soft);
}

.button-block {
  width: 100%;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-weight: 700;
}

.field-span {
  grid-column: 1 / -1;
}

.input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.6);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.input-warning {
  border-color: rgba(245, 158, 11, 0.8);
  background: rgba(255, 251, 235, 0.95);
}

.low-confidence-tag {
  color: var(--warning);
  font-style: normal;
  font-weight: 700;
}

.ordered-fields,
.stack-sm,
.stack-md,
.stack-lg,
.timeline-list {
  display: grid;
}

.stack-sm {
  gap: 10px;
}

.stack-md {
  gap: 16px;
}

.stack-lg {
  gap: 20px;
}

.ordered-fields,
.timeline-list {
  gap: 12px;
}

.ordered-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.ordered-value {
  text-align: end;
  font-weight: 800;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: capitalize;
}

.status-approved {
  color: var(--success);
  background: var(--success-soft);
}

.status-pending,
.status-corrected {
  color: var(--warning);
  background: var(--warning-soft);
}

.status-rejected {
  color: var(--danger);
  background: var(--danger-soft);
}

.table-wrap {
  overflow-x: auto;
}

.records-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.records-table th,
.records-table td {
  padding: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  text-align: left;
  vertical-align: top;
}

.records-table th {
  color: var(--muted-soft);
  font-size: 0.9rem;
  font-weight: 700;
}

.records-table.compact th,
.records-table.compact td {
  min-width: 0;
}

.empty-state-cell {
  text-align: center;
  color: var(--muted);
}

.pending-table-card {
  display: grid;
  gap: 16px;
}

.search-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-bottom: 18px;
}

.records-shell {
  gap: 18px;
}

.records-hero h1 {
  font-size: clamp(2rem, 3vw, 2.7rem);
}

.records-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bulk-actions > span {
  font-weight: 800;
}

.records-search-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  flex: 1;
}

.records-filter-panel {
  padding: 0;
  overflow: hidden;
}

.filter-block {
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.filter-block:last-of-type {
  border-bottom: 0;
}

.filter-block-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.filter-checks {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.filter-check {
  display: flex;
  align-items: center;
  gap: 10px;
}

.confidence-range {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.confidence-range-bar {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #60a5fa, #2563eb);
}

.confidence-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.records-table-card {
  padding: 0;
  overflow: hidden;
}

.records-table-rich {
  min-width: 980px;
}

.records-table-rich th,
.records-table-rich td {
  padding: 14px 16px;
}

.checkbox-col {
  width: 48px;
}

.record-thumb {
  width: 72px;
  height: 44px;
  display: block;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #fff;
}

.record-thumb.placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
  color: #1d4ed8;
  font-weight: 800;
}

.records-footer {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  color: var(--muted);
  background: rgba(248, 250, 252, 0.8);
}

.timeline-step {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.document-viewer {
  margin-bottom: 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.04);
  padding: 14px;
}

.document-image,
.document-frame {
  width: 100%;
  border: 0;
  border-radius: 16px;
  background: #fff;
}

.document-image {
  display: block;
  max-height: 720px;
  object-fit: contain;
}

.document-frame {
  min-height: 720px;
}

.timeline-step span {
  width: 24px;
  height: 24px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.7);
  background: rgba(255, 255, 255, 0.7);
}

.timeline-step.complete span {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border-color: transparent;
}

.timeline-step.active span {
  background: linear-gradient(135deg, var(--brand), #60a5fa);
  border-color: transparent;
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.12);
}

.timeline-step p {
  margin: 4px 0 0;
  color: var(--muted);
}

.plain-list {
  margin: 14px 0 0;
  padding-left: 18px;
}

.plain-list li + li {
  margin-top: 8px;
}

.split {
  justify-content: space-between;
  align-items: center;
}

.chat-workspace {
  max-width: 920px;
}

.chat-card {
  display: grid;
  gap: 18px;
}

.chat-history {
  min-height: 460px;
  max-height: 62vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(241, 245, 249, 0.92));
  border: 1px solid var(--line);
}

.chat-bubble {
  max-width: 78%;
  padding: 14px 16px;
  border-radius: 18px;
  white-space: pre-wrap;
}

.chat-bubble.user {
  align-self: flex-end;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
}

.chat-bubble.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.auth-layout {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 32px;
  align-items: center;
}

.auth-copy {
  padding: 34px 0;
}

.auth-feature-list {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.feature-chip {
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

.auth-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.auth-card-header p {
  margin: 4px 0 0;
}

.confirmation-shell {
  max-width: 1180px;
  margin: 0 auto;
}

.confirmation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 26px 0;
}

.list-card {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
}

.list-card span,
.list-card em,
.event-card p,
.event-card small,
.empty-card {
  color: var(--muted);
}

.event-card {
  padding: 16px 18px;
}

.event-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.empty-card {
  padding: 18px;
}

.alert {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid transparent;
  font-weight: 600;
}

.alert.success {
  color: var(--success);
  background: rgba(220, 252, 231, 0.9);
  border-color: rgba(34, 197, 94, 0.28);
}

.alert.warning {
  color: var(--warning);
  background: rgba(255, 251, 235, 0.96);
  border-color: rgba(245, 158, 11, 0.28);
}

.alert.error {
  color: var(--danger);
  background: rgba(254, 242, 242, 0.96);
  border-color: rgba(239, 68, 68, 0.24);
}

.inline-note {
  margin: 0;
  display: inline-flex;
  align-items: center;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .upload-layout,
  .records-layout,
  .records-layout-stitch,
  .dashboard-layout,
  .review-layout,
  .review-layout-stitch,
  .auth-layout,
  .confirmation-grid {
    grid-template-columns: 1fr;
  }

  .page-hero {
    align-items: start;
  }

  .hero-stat-group {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .review-workspace-header,
  .review-header-meta {
    grid-template-columns: 1fr;
    display: grid;
  }

  .review-timeline-card {
    position: static;
  }
}

@media (max-width: 820px) {
  .app-main,
  .auth-main,
  .topbar-inner {
    width: min(100%, calc(100% - 24px));
  }

  .topbar-inner,
  .page-hero,
  .review-workspace-header,
  .records-toolbar,
  .split,
  .chat-form,
  .search-toolbar,
  .records-search-inline {
    grid-template-columns: 1fr;
    display: grid;
  }

  .topbar-inner {
    padding: 14px 0;
  }

  .topnav,
  .topbar-actions,
  .hero-actions,
  .form-actions,
  .action-cluster,
  .records-search-inline {
    width: 100%;
  }

  .stats-grid,
  .hero-stat-group,
  .review-header-meta {
    grid-template-columns: 1fr 1fr;
  }

  .bulk-actions,
  .records-footer {
    justify-content: flex-start;
  }

  .chat-bubble {
    max-width: 92%;
  }
}

@media (max-width: 560px) {
  .app-main {
    padding-top: 24px;
  }

  .table-card,
  .upload-form-card,
  .review-form-card,
  .chat-card,
  .auth-card,
  .confirmation-card,
  .filter-panel,
  .settings-panel,
  .side-card,
  .document-panel,
  .summary-panel {
    padding: 18px;
  }

  .stats-grid,
  .hero-stat-group,
  .review-header-meta,
  .review-form-grid {
    grid-template-columns: 1fr;
  }

  .confidence-inputs {
    grid-template-columns: 1fr;
  }

  .page-hero h1,
  .auth-copy h1,
  .confirmation-card h1 {
    font-size: 2.1rem;
  }
}
