:root {
  color-scheme: light;
  --ink: #111827;
  --ink-soft: #354152;
  --muted: #6f7b8d;
  --paper: #fbf6ed;
  --paper-strong: #fffdf8;
  --panel: rgba(255, 253, 248, 0.86);
  --panel-solid: #fffdf8;
  --line: rgba(17, 24, 39, 0.12);
  --line-strong: rgba(17, 24, 39, 0.2);
  --night: #07111f;
  --navy: #0d2238;
  --teal: #047d83;
  --mint: #2fbf71;
  --amber: #f2a93b;
  --clay: #d65a31;
  --rose: #c24155;
  --sky: #e5f4f4;
  --shadow: 0 26px 70px rgba(10, 22, 40, 0.14);
  --shadow-soft: 0 14px 36px rgba(10, 22, 40, 0.1);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(4, 125, 131, 0.18), transparent 34rem),
    radial-gradient(circle at 85% 10%, rgba(242, 169, 59, 0.2), transparent 26rem),
    linear-gradient(145deg, #fbf6ed 0%, #eef7f6 46%, #f8eadb 100%);
}

body.modal-open {
  overflow: hidden;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.grain-layer {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.33;
  background-image:
    linear-gradient(rgba(17, 24, 39, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 24, 39, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.app-root {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.noscript-card {
  max-width: 560px;
  margin: 10vh auto;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
}

.toast-region {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 60;
  display: grid;
  gap: 12px;
  max-width: min(420px, calc(100vw - 36px));
}

.toast {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  color: #fffdf8;
  background: rgba(7, 17, 31, 0.92);
  box-shadow: var(--shadow-soft);
  animation: toast-in 0.24s ease-out;
}

.toast strong {
  display: block;
  margin-bottom: 3px;
  font-size: 0.86rem;
}

.toast span {
  color: rgba(255, 253, 248, 0.76);
  font-size: 0.82rem;
}

@keyframes toast-in {
  from {
    transform: translateY(-8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(430px, 0.72fr);
  gap: 28px;
  padding: 28px;
}

.auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: calc(100vh - 56px);
  padding: clamp(28px, 5vw, 64px);
  border-radius: var(--radius-xl);
  color: #fffdf8;
  background:
    linear-gradient(125deg, rgba(7, 17, 31, 0.96), rgba(13, 34, 56, 0.88)),
    radial-gradient(circle at 20% 20%, rgba(4, 125, 131, 0.52), transparent 22rem),
    radial-gradient(circle at 85% 35%, rgba(214, 90, 49, 0.35), transparent 20rem);
  box-shadow: var(--shadow);
}

.auth-brand::before,
.auth-brand::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.09);
}

.auth-brand::before {
  width: 460px;
  height: 460px;
  right: -190px;
  top: -150px;
}

.auth-brand::after {
  width: 260px;
  height: 260px;
  left: 12%;
  bottom: 14%;
  border: 1px solid rgba(255, 253, 248, 0.14);
  background: transparent;
}

.brand-mark,
.sidebar-logo-mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  color: #fffdf8;
  background: linear-gradient(135deg, var(--teal), var(--clay));
  font-weight: 800;
  letter-spacing: -0.06em;
}

.auth-brand-top,
.brand-stack,
.sidebar-logo {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-name {
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 18px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 253, 248, 0.16);
  border-radius: 999px;
  color: rgba(255, 253, 248, 0.78);
  background: rgba(255, 253, 248, 0.08);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-brand h1 {
  position: relative;
  z-index: 1;
  max-width: 850px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 7.4rem);
  line-height: 0.9;
  letter-spacing: -0.08em;
}

.auth-brand-copy {
  position: relative;
  z-index: 1;
  max-width: 650px;
  margin-top: 28px;
  color: rgba(255, 253, 248, 0.76);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.8;
}

.use-case-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 38px;
}

.use-case-pill {
  padding: 16px;
  border: 1px solid rgba(255, 253, 248, 0.14);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.08);
  backdrop-filter: blur(10px);
}

.use-case-pill b {
  display: block;
  margin-bottom: 4px;
}

.use-case-pill span {
  color: rgba(255, 253, 248, 0.62);
  font-size: 0.84rem;
}

.auth-panel {
  display: grid;
  align-content: center;
  padding: clamp(10px, 3vw, 34px);
}

.auth-card {
  width: 100%;
  max-width: 510px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 253, 248, 0.88);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.auth-card h2,
.page-title,
.section-heading h2,
.report-title,
.modal-card h2 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.055em;
}

.auth-card h2 {
  font-size: clamp(2.1rem, 4vw, 3rem);
}

.auth-card p,
.field-hint,
.empty-state p,
.metric-card p,
.summary-card p,
.report-copy,
.muted {
  color: var(--muted);
}

.auth-card p {
  margin: 10px 0 24px;
  line-height: 1.6;
}

.form-stack {
  display: grid;
  gap: 16px;
}

.form-row {
  display: grid;
  gap: 8px;
}

.form-row label {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--ink-soft);
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  color: var(--ink);
  background: #fffdf8;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.input,
.select {
  min-height: 48px;
  padding: 0 14px;
}

.textarea {
  min-height: 112px;
  padding: 14px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(4, 125, 131, 0.74);
  box-shadow: 0 0 0 4px rgba(4, 125, 131, 0.12);
}

.form-error {
  min-height: 18px;
  color: var(--rose);
  font-size: 0.82rem;
  font-weight: 700;
}

.auth-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-meta a,
.text-link {
  color: var(--teal);
  font-weight: 800;
}

.demo-strip {
  margin-top: 22px;
  padding: 14px;
  border: 1px dashed rgba(4, 125, 131, 0.38);
  border-radius: 18px;
  color: var(--ink-soft);
  background: rgba(229, 244, 244, 0.78);
  font-size: 0.86rem;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

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

.btn-primary {
  color: #fffdf8;
  background: linear-gradient(135deg, var(--navy), var(--teal));
  box-shadow: 0 14px 26px rgba(4, 125, 131, 0.18);
}

.btn-primary:hover {
  box-shadow: 0 18px 32px rgba(4, 125, 131, 0.26);
}

.btn-secondary {
  color: var(--ink);
  border-color: var(--line-strong);
  background: rgba(255, 253, 248, 0.78);
}

.btn-secondary:hover {
  border-color: rgba(4, 125, 131, 0.48);
  background: #fffdf8;
}

.btn-danger {
  color: #fffdf8;
  background: var(--rose);
}

.btn-ghost {
  color: var(--ink-soft);
  background: transparent;
}

.btn-block {
  width: 100%;
}

.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px;
  color: #fffdf8;
  background:
    linear-gradient(180deg, rgba(7, 17, 31, 0.98), rgba(13, 34, 56, 0.98)),
    radial-gradient(circle at 30% 15%, rgba(4, 125, 131, 0.42), transparent 18rem);
}

.sidebar-logo {
  margin-bottom: 28px;
}

.sidebar-logo span:last-child {
  font-weight: 800;
  letter-spacing: -0.03em;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: 18px;
  color: rgba(255, 253, 248, 0.68);
  font-weight: 800;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.nav-item:hover,
.nav-item.active {
  color: #fffdf8;
  border-color: rgba(255, 253, 248, 0.12);
  background: rgba(255, 253, 248, 0.09);
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.09);
}

.sidebar-card {
  margin-top: auto;
  padding: 18px;
  border: 1px solid rgba(255, 253, 248, 0.13);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.08);
}

.sidebar-card b {
  display: block;
  margin-bottom: 8px;
}

.sidebar-card p {
  margin: 0 0 14px;
  color: rgba(255, 253, 248, 0.64);
  font-size: 0.86rem;
  line-height: 1.6;
}

.main-shell {
  min-width: 0;
  padding: 24px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin: -24px -24px 24px;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  background: rgba(251, 246, 237, 0.78);
  backdrop-filter: blur(16px);
}

.mobile-menu-btn {
  display: none;
}

.search-shell {
  flex: 1;
  max-width: 520px;
  position: relative;
}

.search-shell input {
  width: 100%;
  min-height: 44px;
  padding: 0 16px 0 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.72);
  outline: none;
}

.search-shell::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 50%;
  width: 12px;
  height: 12px;
  border: 2px solid var(--muted);
  border-radius: 999px;
  transform: translateY(-50%);
}

.search-shell::after {
  content: "";
  position: absolute;
  left: 28px;
  top: 28px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: var(--muted);
  transform: rotate(45deg);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px 7px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.8);
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #fffdf8;
  background: linear-gradient(135deg, var(--clay), var(--teal));
  font-size: 0.78rem;
  font-weight: 900;
}

.user-chip span:last-child {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
  font-weight: 800;
}

.page {
  display: grid;
  gap: 24px;
  animation: page-in 0.28s ease-out;
}

@keyframes page-in {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.page-eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-title {
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  line-height: 0.95;
}

.page-description {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 20px;
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.94), rgba(229, 244, 244, 0.76)),
    radial-gradient(circle at 85% 15%, rgba(242, 169, 59, 0.24), transparent 20rem);
  box-shadow: var(--shadow-soft);
}

.hero-panel::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -110px;
  width: 320px;
  height: 320px;
  border: 52px solid rgba(4, 125, 131, 0.08);
  border-radius: 999px;
}

.hero-copy,
.hero-widget {
  position: relative;
  z-index: 1;
}

.hero-copy h2 {
  max-width: 880px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.hero-copy p {
  max-width: 700px;
  color: var(--muted);
  line-height: 1.8;
}

.hero-widget {
  align-self: stretch;
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 26px;
  background: rgba(255, 253, 248, 0.74);
}

.pipeline-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(7, 17, 31, 0.04);
}

.step-dot {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 0 6px rgba(4, 125, 131, 0.11);
}

.step-dot.amber {
  background: var(--amber);
  box-shadow: 0 0 0 6px rgba(242, 169, 59, 0.14);
}

.step-dot.clay {
  background: var(--clay);
  box-shadow: 0 0 0 6px rgba(214, 90, 49, 0.12);
}

.pipeline-step b {
  display: block;
  margin-bottom: 2px;
  font-size: 0.88rem;
}

.pipeline-step span {
  color: var(--muted);
  font-size: 0.8rem;
}

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

.metric-card,
.card,
.table-card,
.summary-card,
.upload-card,
.settings-card,
.report-section,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.82);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.metric-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -42px;
  top: -42px;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: rgba(4, 125, 131, 0.11);
}

.metric-card p {
  margin: 0 0 10px;
  font-size: 0.84rem;
  font-weight: 800;
}

.metric-card strong {
  font-family: var(--font-display);
  font-size: 2.45rem;
  line-height: 1;
  letter-spacing: -0.06em;
}

.metric-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.55fr);
  gap: 18px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.section-heading h2 {
  font-size: 1.7rem;
}

.table-card,
.card,
.upload-card,
.settings-card,
.report-section {
  padding: 20px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 740px;
}

th,
td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

tr:last-child td {
  border-bottom: 0;
}

.file-cell b {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.file-cell span {
  color: var(--muted);
  font-size: 0.78rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: capitalize;
}

.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.badge-completed,
.badge-positive {
  color: #096b42;
  background: rgba(47, 191, 113, 0.14);
}

.badge-processing,
.badge-neutral,
.badge-uploaded {
  color: #8a5b05;
  background: rgba(242, 169, 59, 0.18);
}

.badge-failed,
.badge-negative {
  color: #9b2538;
  background: rgba(194, 65, 85, 0.14);
}

.badge-draft {
  color: #225c66;
  background: rgba(4, 125, 131, 0.13);
}

.action-link {
  color: var(--teal);
  border: 0;
  background: transparent;
  font-weight: 900;
}

.insight-list,
.action-list,
.next-step-list,
.email-log-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.insight-item,
.next-step-card,
.email-log-item {
  padding: 14px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.7);
}

.insight-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.insight-number {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: #fffdf8;
  background: var(--navy);
  font-size: 0.76rem;
  font-weight: 900;
}

.action-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 13px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.7);
}

.checkbox-visual {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(4, 125, 131, 0.55);
  border-radius: 8px;
  color: var(--teal);
  font-size: 0.85rem;
  font-weight: 900;
}

.use-case-cards {
  display: grid;
  gap: 12px;
}

.use-case-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.68);
}

.use-case-card b {
  display: block;
  margin-bottom: 5px;
}

.use-case-card span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.upload-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.42fr);
  gap: 18px;
}

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 330px;
  padding: 28px;
  border: 2px dashed rgba(4, 125, 131, 0.38);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(229, 244, 244, 0.7), rgba(255, 253, 248, 0.8)),
    radial-gradient(circle at 50% 20%, rgba(242, 169, 59, 0.18), transparent 14rem);
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.dropzone.dragging {
  border-color: var(--clay);
  transform: scale(1.01);
  background: rgba(255, 246, 232, 0.88);
}

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

.dropzone-inner {
  max-width: 620px;
  text-align: center;
}

.upload-symbol {
  display: inline-grid;
  place-items: center;
  width: 82px;
  height: 82px;
  margin-bottom: 18px;
  border-radius: 28px;
  color: #fffdf8;
  background: linear-gradient(135deg, var(--teal), var(--clay));
  box-shadow: 0 18px 36px rgba(4, 125, 131, 0.18);
  font-size: 2.2rem;
  font-weight: 900;
}

.dropzone h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: -0.06em;
}

.dropzone p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.file-preview {
  display: none;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.78);
  text-align: left;
}

.file-preview.visible {
  display: block;
}

.progress-shell {
  display: none;
  margin-top: 18px;
}

.progress-shell.visible {
  display: block;
}

.progress-bar {
  overflow: hidden;
  height: 11px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.08);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--amber), var(--clay));
  transition: width 0.34s ease;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  color: var(--muted);
}

.timeline-marker {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  background: #fffdf8;
  font-size: 0.74rem;
  font-weight: 900;
}

.timeline-item.active .timeline-marker,
.timeline-item.done .timeline-marker {
  color: #fffdf8;
  border-color: transparent;
  background: var(--teal);
}

.timeline-item.failed .timeline-marker {
  color: #fffdf8;
  border-color: transparent;
  background: var(--rose);
}

.timeline-item b {
  display: block;
  color: var(--ink);
  margin-bottom: 3px;
}

.report-header-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  color: #fffdf8;
  background:
    linear-gradient(135deg, rgba(7, 17, 31, 0.97), rgba(13, 34, 56, 0.9)),
    radial-gradient(circle at 78% 10%, rgba(214, 90, 49, 0.38), transparent 18rem);
  box-shadow: var(--shadow);
}

.report-header-card::after {
  content: "";
  position: absolute;
  right: -100px;
  bottom: -160px;
  width: 360px;
  height: 360px;
  border: 54px solid rgba(255, 253, 248, 0.08);
  border-radius: 999px;
}

.report-title {
  position: relative;
  z-index: 1;
  max-width: 900px;
  font-size: clamp(2.1rem, 5vw, 4.8rem);
  line-height: 0.98;
}

.report-meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  color: rgba(255, 253, 248, 0.72);
}

.report-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(330px, 0.42fr);
  gap: 18px;
}

.summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.6fr) minmax(0, 1fr);
  gap: 18px;
}

.summary-card {
  padding: 22px;
}

.summary-card h3,
.report-section h3,
.settings-card h3,
.card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.summary-card p,
.report-copy {
  margin: 0;
  line-height: 1.8;
}

.confidence-ring {
  display: grid;
  place-items: center;
  width: 124px;
  height: 124px;
  margin: 8px auto 18px;
  border-radius: 999px;
  color: var(--ink);
  background:
    radial-gradient(circle at center, #fffdf8 58%, transparent 60%),
    conic-gradient(var(--teal) calc(var(--score) * 1%), rgba(17, 24, 39, 0.08) 0);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 170px 170px 170px;
  gap: 12px;
  margin-bottom: 16px;
}

.empty-state {
  padding: 46px 28px;
  text-align: center;
}

.empty-state h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2.2rem;
  letter-spacing: -0.055em;
}

.empty-state p {
  max-width: 560px;
  margin: 12px auto 22px;
  line-height: 1.7;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(300px, 0.42fr);
  gap: 18px;
}

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

.stat-chip {
  padding: 14px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.68);
}

.stat-chip b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.9rem;
  letter-spacing: -0.05em;
}

.stat-chip span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 17, 31, 0.52);
  backdrop-filter: blur(10px);
}

.modal-card {
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 30px;
  background: var(--panel-solid);
  box-shadow: var(--shadow);
}

.modal-card h2 {
  font-size: 2.2rem;
}

.modal-card p {
  color: var(--muted);
  line-height: 1.7;
}

.mobile-sidebar-backdrop {
  display: none;
}

@media (max-width: 1120px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    min-height: auto;
  }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(310px, calc(100vw - 52px));
    transform: translateX(-105%);
    transition: transform 0.22s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-sidebar-backdrop.open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(7, 17, 31, 0.38);
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .hero-panel,
  .content-grid,
  .upload-grid,
  .report-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .auth-page,
  .main-shell {
    padding: 14px;
  }

  .topbar {
    margin: -14px -14px 18px;
    padding: 14px;
  }

  .search-shell {
    display: none;
  }

  .user-chip span:last-child {
    display: none;
  }

  .page-header,
  .report-header-card,
  .section-heading {
    flex-direction: column;
    display: flex;
  }

  .use-case-grid,
  .metrics-grid,
  .summary-grid,
  .stat-strip,
  .filter-bar {
    grid-template-columns: 1fr;
  }

  .report-actions {
    width: 100%;
  }

  .report-actions .btn,
  .page-header .btn,
  .btn-row .btn {
    width: 100%;
  }

  .dropzone {
    min-height: 280px;
  }

  .toast-region {
    left: 14px;
    right: 14px;
    max-width: none;
  }
}
