* {
  box-sizing: border-box;
}

:root {
  --bg: #edf3f8;
  --surface: #ffffff;
  --surface-soft: #f7fbff;
  --surface-ink: #f4f8fc;
  --text: #0f172a;
  --text-soft: #334155;
  --muted: #64748b;
  --accent: #0f6cde;
  --accent-strong: #0b57b7;
  --accent-soft: rgba(15, 108, 222, 0.1);
  --cyan-soft: rgba(34, 211, 238, 0.12);
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.13);
  --shadow-sm: 0 10px 26px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 20px 50px rgba(15, 23, 42, 0.09);
  --shadow-lg: 0 30px 70px rgba(15, 23, 42, 0.12);
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(15, 108, 222, 0.08), transparent 32%),
    linear-gradient(180deg, #f2f6fb 0%, var(--bg) 100%);
  color: var(--text-soft);
  font-family: "Manrope", "Segoe UI", sans-serif;
  line-height: 1.55;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.app-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.backdrop-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(10px);
  opacity: 0.5;
}

.orb-one {
  top: 110px;
  left: -90px;
  width: 280px;
  height: 280px;
  background: rgba(34, 211, 238, 0.14);
}

.orb-two {
  top: 40px;
  right: -60px;
  width: 340px;
  height: 340px;
  background: rgba(15, 108, 222, 0.08);
}

.app-nav,
.page-shell {
  position: relative;
  z-index: 1;
}

.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 34px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #eef6ff 100%);
  border: 1px solid rgba(15, 108, 222, 0.12);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-meta {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.brand-name {
  margin: 0;
  color: var(--text);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.nav-utility {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(15, 108, 222, 0.24);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(15, 108, 222, 0.08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.nav-context {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.page-shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 26px 30px 56px;
}

.hero-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.9fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 28px;
}

.hero-panel,
.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
}

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(15, 108, 222, 0.09), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: var(--shadow-md);
  animation: rise-in 0.55s ease;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -50px -120px auto;
  width: 300px;
  height: 300px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.14), transparent 70%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 780px;
}

.hero-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-panel h1 {
  margin: 12px 0 0;
  color: var(--text);
  font-size: clamp(40px, 5vw, 66px);
  line-height: 0.98;
  letter-spacing: -0.06em;
  max-width: 880px;
}

.hero-subtitle {
  margin: 18px 0 0;
  color: var(--text);
  font-size: 21px;
  line-height: 1.35;
  font-weight: 700;
  max-width: 740px;
}

.hero-detail {
  margin: 12px 0 0;
  max-width: 700px;
  color: var(--muted);
  font-size: 15px;
}

.hero-stat-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 34px;
}

.hero-stat-card {
  min-height: 150px;
  padding: 18px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.hero-stat-label {
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.hero-stat-title {
  margin: 12px 0 0;
  color: var(--text);
  font-size: 22px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.hero-stat-text {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.upload-panel {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 251, 255, 0.98) 100%);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
  animation: rise-in 0.65s ease;
}

.upload-top {
  display: grid;
  gap: 10px;
}

.upload-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.upload-panel h2 {
  margin: 0;
  color: var(--text);
  font-size: 30px;
  line-height: 1.06;
  letter-spacing: -0.04em;
}

.upload-copy {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.upload-copy code {
  border: 1px solid rgba(15, 108, 222, 0.22);
  border-radius: 8px;
  background: #eef5ff;
  color: var(--accent);
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}

.upload-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.upload-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 10px;
  background: #f2f7fd;
  border: 1px solid rgba(15, 23, 42, 0.06);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.upload-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.input-wrap {
  display: grid;
  gap: 8px;
}

.input-wrap label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input[type="file"] {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #cad5e4;
  border-radius: 14px;
  background: #ffffff;
  color: var(--text-soft);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input[type="file"]:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

button {
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #ffffff;
  min-width: 150px;
  padding: 14px 22px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(15, 108, 222, 0.28);
  transition: transform 0.14s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(15, 108, 222, 0.34);
  filter: saturate(1.04);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.75;
  box-shadow: none;
  transform: none;
}

.upload-feedback {
  display: grid;
  gap: 10px;
}

.loading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #dbeafe;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

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

.status {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.error-message {
  margin: 0;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fff1f2;
  color: #991b1b;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
}

.upload-footnote {
  padding-top: 4px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  color: var(--muted);
  font-size: 13px;
}

.hidden {
  display: none;
}

.dashboard {
  display: grid;
  gap: 24px;
}

.section-block {
  display: grid;
  gap: 14px;
  animation: rise-in 0.55s ease;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.section-kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.section-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  letter-spacing: -0.03em;
}

.section-copy {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

.kpi-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: 16px;
}

.gauge-card,
.chart-card,
.insight-card,
.cluster-panel,
.quotes-panel,
.ai-listing-panel,
.recommendations-panel,
.mini-kpi-card {
  padding: 26px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.gauge-card:hover,
.chart-card:hover,
.insight-card:hover,
.cluster-panel:hover,
.quotes-panel:hover,
.ai-listing-panel:hover,
.recommendations-panel:hover,
.mini-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.gauge-card {
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: var(--shadow-md);
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gauge-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.gauge-caption {
  margin: 10px 0 0;
  max-width: 640px;
  color: var(--muted);
  font-size: 14px;
}

.gauge-note {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  background: #eff6ff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.gauge-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(260px, 0.8fr);
  gap: 18px;
  align-items: center;
  margin-top: 18px;
}

.gauge-visual {
  position: relative;
  width: min(100%, 360px);
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}

.risk-gauge {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.risk-gauge-track {
  fill: none;
  stroke: #e2e8f0;
  stroke-width: 20;
}

.risk-gauge-progress {
  fill: none;
  stroke: url(#riskGaugeGradient);
  stroke-width: 20;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.45s ease;
}

.gauge-main {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.gauge-score {
  color: var(--text);
  font-size: clamp(76px, 8vw, 108px);
  line-height: 0.88;
  font-weight: 800;
  letter-spacing: -0.07em;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 800;
  text-transform: capitalize;
}

.risk-level.low {
  background: #dcfce7;
  color: #166534;
}

.risk-level.moderate {
  background: #fef3c7;
  color: #92400e;
}

.risk-level.high {
  background: #fee2e2;
  color: #991b1b;
}

.risk-level.critical {
  background: #7f1d1d;
  color: #ffffff;
}

.risk-level.no-data {
  background: #e2e8f0;
  color: #64748b;
}

.risk-level.loading {
  background: #dbeafe;
  color: #1d4ed8;
}

.gauge-side {
  display: grid;
  gap: 14px;
}

.gauge-side-card {
  padding: 18px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #f9fbff 0%, #ffffff 100%);
}

.gauge-side-label {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gauge-side-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--text-soft);
  font-size: 14px;
  display: grid;
  gap: 10px;
}

.gauge-empty-hint {
  margin: 0;
  padding: 14px 16px;
  border: 1px dashed rgba(15, 108, 222, 0.28);
  border-radius: var(--radius-md);
  background: rgba(15, 108, 222, 0.05);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.dashboard:not(.empty-state) .gauge-empty-hint {
  display: none;
}

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

.mini-kpi-card {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.metric-highlight {
  border-color: rgba(15, 108, 222, 0.18);
  box-shadow: 0 18px 42px rgba(15, 108, 222, 0.12);
}

.metric-label {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.metric-value {
  margin: 0;
  color: var(--text);
  font-size: clamp(42px, 4vw, 58px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.06em;
}

.metric-sub {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 700;
}

.metric-helper {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

.card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.card-head h3,
.insight-card h3,
.cluster-panel h3,
.quotes-panel h3,
.ai-listing-panel h3,
.recommendations-panel h3 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  letter-spacing: -0.03em;
}

.chart-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.chart-wrap {
  position: relative;
  height: 400px;
  margin-top: 18px;
  padding: 8px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #f9fbff 0%, #ffffff 100%);
}

.chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-skeleton {
  position: absolute;
  inset: 8px;
  border-radius: 16px;
  background:
    linear-gradient(100deg, #eef3f8 35%, #f9fbfd 50%, #eef3f8 65%);
  background-size: 240% 100%;
  animation: shimmer 1.5s infinite;
}

.insights-grid,
.analysis-grid,
.recommendations-grid {
  display: grid;
  gap: 16px;
}

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

.analysis-grid {
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.85fr);
}

.recommendations-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.95fr);
}

.cluster-panel {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.quotes-panel {
  background: linear-gradient(180deg, #fcfdff 0%, #f5f9fd 100%);
}

.clean-list,
.quotes-list {
  margin: 16px 0 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.clean-list li,
.quotes-list li {
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 14px;
  background: linear-gradient(180deg, #f9fbff 0%, #ffffff 100%);
  color: var(--text-soft);
  padding: 12px 14px;
  line-height: 1.5;
}

.clean-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

#recommendations.clean-list li {
  display: block;
}

.item-title {
  color: var(--text);
  font-weight: 700;
}

.item-meta {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.empty-item,
.empty-note {
  color: var(--muted);
}

.empty-item {
  justify-content: center;
  text-align: center;
  min-height: 62px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.empty-note {
  padding: 14px 16px;
  border: 1px dashed rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
}

.clusters-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.cluster-card {
  padding: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.cluster-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.cluster-heading h4 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.cluster-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cluster-share {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.severity.low {
  background: #dcfce7;
  color: #166534;
}

.severity.medium {
  background: #fef3c7;
  color: #92400e;
}

.severity.high {
  background: #fee2e2;
  color: #991b1b;
}

.cluster-summary {
  margin: 0 0 12px;
  color: var(--text-soft);
  font-size: 14px;
}

.quotes-wrap {
  display: grid;
  gap: 8px;
}

.quote-block {
  margin: 0;
  border-left: 3px solid #60a5fa;
  border-radius: 12px;
  background: linear-gradient(180deg, #f4f9ff 0%, #ffffff 100%);
  padding: 10px 12px;
  color: #475569;
  font-size: 13px;
}

.ai-listing-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 249, 255, 0.98) 100%);
  border-color: rgba(15, 108, 222, 0.16);
}

.listing-improvements-list {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.listing-improvement-card {
  padding: 16px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.listing-improvement-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
}

.listing-improvement-card p + p {
  margin-top: 8px;
}

.listing-improvement-card strong {
  color: var(--text);
}

.recommendations-panel {
  display: grid;
  gap: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.small-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.priority-text {
  margin: 0;
  padding: 16px 18px;
  border-left: 4px solid var(--accent);
  border-radius: 16px;
  background: linear-gradient(180deg, #eff6ff 0%, #f8fbff 100%);
  color: #1e3a8a;
  font-weight: 700;
}

.body-text {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
}

.listing-improvement-skeleton {
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  display: grid;
  gap: 8px;
}

.skeleton-line,
.skeleton-item {
  background:
    linear-gradient(100deg, #eef3f8 35%, #f9fbfd 50%, #eef3f8 65%);
  background-size: 240% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-line {
  height: 10px;
  border-radius: 999px;
}

.skeleton-line.short {
  width: 72%;
}

.skeleton-item {
  list-style: none;
  height: 14px;
  border-radius: 999px;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

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

.dashboard.empty-state .chart-card,
.dashboard.empty-state .quotes-panel,
.dashboard.empty-state .insight-card,
.dashboard.empty-state .cluster-panel,
.dashboard.empty-state .ai-listing-panel,
.dashboard.empty-state .recommendations-panel,
.dashboard.empty-state .mini-kpi-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 251, 255, 0.96) 100%);
}

@media (max-width: 1260px) {
  .hero-shell,
  .analysis-grid,
  .recommendations-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

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

  .gauge-side {
    max-width: 680px;
    margin: 0 auto;
  }
}

@media (max-width: 1040px) {
  .charts-grid,
  .insights-grid,
  .clusters-grid,
  .hero-stat-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .section-copy {
    text-align: left;
    max-width: none;
  }
}

@media (max-width: 760px) {
  .app-nav {
    padding: 14px 16px;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-utility {
    width: 100%;
    justify-content: space-between;
  }

  .nav-context {
    display: none;
  }

  .page-shell {
    padding: 18px 14px 36px;
  }

  .hero-panel,
  .panel {
    padding: 20px;
  }

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

  .brand-name {
    font-size: 22px;
  }

  .hero-panel h1 {
    font-size: 38px;
  }

  .hero-subtitle {
    font-size: 18px;
  }

  .chart-wrap {
    height: 320px;
  }

  .gauge-score {
    font-size: 74px;
  }

  .cluster-heading {
    flex-direction: column;
    align-items: flex-start;
  }
}

.page-shell {
  max-width: 1400px;
  padding: 18px 30px 56px;
}

.app-nav {
  gap: 18px;
  padding: 10px 28px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.nav-brand {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
}

.brand-lockup-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
  width: clamp(272px, 27vw, 348px);
  height: clamp(48px, 3.9vw, 56px);
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.brand-home-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
  flex: 0 0 auto;
}

.brand-lockup-image {
  position: absolute;
  top: 52%;
  left: -8px;
  display: block;
  width: clamp(274px, 27.2vw, 354px);
  height: auto;
  max-width: none;
  transform: translateY(-50%) scale(1.1);
  transform-origin: left center;
  margin: 0;
}

.nav-utility {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.nav-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 999px;
  padding: 0 16px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  transition: transform 0.14s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

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

.nav-link-primary {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(15, 108, 222, 0.2);
}

.nav-link-secondary {
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

.nav-context {
  display: none;
}

body[data-request-state="loading"] .upload-panel {
  border-color: rgba(15, 108, 222, 0.2);
  box-shadow: 0 32px 72px rgba(15, 108, 222, 0.12);
}

body[data-request-state="error"] .upload-panel {
  border-color: rgba(239, 68, 68, 0.18);
}

.hero-shell {
  grid-template-columns: minmax(0, 1.33fr) minmax(360px, 0.94fr);
  gap: 18px;
  margin-bottom: 18px;
}

.hero-panel {
  padding: 26px 28px;
  background:
    linear-gradient(135deg, rgba(15, 108, 222, 0.14), transparent 40%),
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.hero-copy {
  max-width: 700px;
}

.hero-panel h1 {
  margin: 10px 0 0;
  max-width: 740px;
  font-size: clamp(40px, 4.4vw, 54px);
  line-height: 1;
}

.hero-subtitle {
  margin: 12px 0 0;
  max-width: 660px;
  font-size: 18px;
  line-height: 1.3;
}

.hero-detail {
  margin: 8px 0 0;
  max-width: 520px;
  font-size: 13px;
  line-height: 1.5;
}

.hero-proof-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.hero-proof-card {
  min-height: 108px;
  padding: 14px 15px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.hero-proof-card:nth-child(1) {
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.95) 0%, #ffffff 100%);
}

.hero-proof-card:nth-child(2) {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, #ffffff 100%);
}

.hero-proof-card:nth-child(3) {
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.74) 0%, #ffffff 100%);
}

.hero-proof-label,
.preview-chip-label {
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hero-proof-title {
  margin: 7px 0 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.hero-proof-copy {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.42;
}

.hero-preview-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.preview-chip {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 15px;
  background: rgba(248, 251, 255, 0.92);
}

.preview-chip:nth-child(1) {
  border-color: rgba(15, 108, 222, 0.12);
}

.preview-chip:nth-child(2) {
  border-color: rgba(51, 65, 85, 0.1);
}

.preview-chip:nth-child(3) {
  border-color: rgba(34, 211, 238, 0.14);
}

.preview-chip strong {
  color: var(--text);
  font-size: 13px;
}

.upload-panel {
  padding: 28px;
  gap: 14px;
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(246, 250, 255, 0.98) 100%);
}

.upload-form {
  padding: 18px;
  gap: 12px;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  border: 1px solid rgba(15, 108, 222, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 24px rgba(15, 23, 42, 0.04);
}

.upload-secondary-shell {
  display: grid;
  gap: 10px;
  padding: 14px 2px 0;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: transparent;
}

.upload-secondary-label {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.workflow-support-grid {
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  align-items: stretch;
}

.quick-action-card {
  min-height: 76px;
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 4px;
  padding: 14px 15px;
  text-align: left;
}

.quick-action-card-static {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.quick-action-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.quick-action-copy {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}

.quick-action-options {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.quick-action-option {
  min-width: 0;
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.quick-guide-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(15, 108, 222, 0.1);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(250, 252, 255, 0.98) 0%, rgba(244, 248, 255, 0.94) 100%);
  align-content: start;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 8px 20px rgba(15, 23, 42, 0.03);
}

.quick-guide-head {
  display: grid;
  gap: 4px;
}

.quick-guide-title {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.quick-guide-intro {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
}

.quick-guide-grid {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.quick-guide-card {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid rgba(15, 108, 222, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  align-content: start;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.quick-guide-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.quick-guide-value {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.35;
}

.quick-guide-note {
  margin: 2px 0 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}

.quick-action-copy,
.quick-guide-intro,
.quick-guide-note,
.file-picker-hint,
.preview-snapshot-text,
.snapshot-detail {
  color: var(--text-soft);
}

.sr-only-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.file-picker-button {
  width: 100%;
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 16px 18px;
  cursor: pointer;
  position: relative;
  border: 1px solid rgba(15, 108, 222, 0.24);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(15, 108, 222, 0.04) 0%, rgba(15, 108, 222, 0) 42%),
    linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 10px 24px rgba(15, 23, 42, 0.05);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

.file-picker-button::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(15, 108, 222, 0.08);
  border-radius: 14px;
  pointer-events: none;
}

.file-picker-button:hover,
.file-picker-button:focus-visible {
  border-color: rgba(15, 108, 222, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 0 0 4px rgba(15, 108, 222, 0.08),
    0 14px 34px rgba(15, 108, 222, 0.12);
  transform: translateY(-1px);
}

.file-picker-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.file-picker-affordance {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  width: 100%;
  margin-top: 6px;
  padding: 0 12px 0 14px;
  border: 1px solid rgba(15, 108, 222, 0.22);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(15, 108, 222, 0.08) 0%, rgba(15, 108, 222, 0.04) 100%);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.file-picker-affordance-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(15, 108, 222, 0.12);
  font-size: 13px;
  line-height: 1;
}

.file-picker-subtitle {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
}

.file-picker-subtitle strong {
  color: var(--text);
  font-weight: 700;
}

.file-picker-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0 2px;
}

.selected-file-name {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.file-picker-hint {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}

button.secondary-button,
button.ghost-button {
  min-width: 0;
  box-shadow: none;
}

button.secondary-button {
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #ffffff;
  color: var(--text);
}

button.secondary-button:hover {
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

button.cta-strong {
  border-color: rgba(15, 108, 222, 0.22);
  background: linear-gradient(180deg, #f5f9ff 0%, #eaf3ff 100%);
  color: var(--accent-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

button.ghost-button {
  border: 1px dashed rgba(15, 108, 222, 0.28);
  background: rgba(15, 108, 222, 0.04);
  color: var(--accent-strong);
}

button.ghost-button:hover {
  box-shadow: 0 12px 24px rgba(15, 108, 222, 0.1);
}

.status {
  min-height: 22px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
}

.pre-analysis-panel {
  display: grid;
  margin-top: 2px;
}

.pre-analysis-panel.hidden {
  display: none;
}

.pre-analysis-panel[data-state="error"] .preview-snapshot {
  border-color: rgba(239, 68, 68, 0.16);
  background:
    linear-gradient(135deg, rgba(239, 68, 68, 0.08), transparent 45%),
    linear-gradient(180deg, #ffffff 0%, #fff8f8 100%);
}

.pre-analysis-panel[data-state="error"] .preview-score-card {
  border-color: rgba(239, 68, 68, 0.14);
  background: rgba(255, 255, 255, 0.96);
}

.pre-analysis-panel[data-state="error"] .preview-summary-label {
  color: #991b1b;
}

.pre-analysis-panel[data-state="error"] .pre-analysis-summary-card {
  border-color: rgba(239, 68, 68, 0.14);
  background: rgba(255, 255, 255, 0.9);
}

.pre-analysis-panel[data-state="error"] .pre-analysis-summary-indicator {
  background: rgba(239, 68, 68, 0.2);
  box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.06);
}

.pre-analysis-panel[data-state="loading"] .preview-snapshot {
  border-color: rgba(15, 108, 222, 0.2);
  background:
    linear-gradient(135deg, rgba(15, 108, 222, 0.12), transparent 45%),
    linear-gradient(180deg, #ffffff 0%, #f4f9ff 100%);
}

.pre-analysis-panel[data-state="loading"] .preview-score-card {
  border-color: rgba(15, 108, 222, 0.16);
  background: rgba(255, 255, 255, 0.96);
}

.pre-analysis-panel[data-state="loading"] .pre-analysis-summary-card {
  border-color: rgba(15, 108, 222, 0.14);
  background: rgba(255, 255, 255, 0.9);
}

.pre-analysis-panel[data-state="loading"] .pre-analysis-summary-indicator {
  background: rgba(15, 108, 222, 0.22);
}

.preview-snapshot {
  display: grid;
  gap: 14px;
  padding: 22px 24px;
  border-color: rgba(15, 108, 222, 0.16);
  background:
    linear-gradient(135deg, rgba(15, 108, 222, 0.14), transparent 45%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: var(--shadow-md);
}

.preview-snapshot-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.preview-snapshot-copy {
  display: grid;
  gap: 6px;
}

.preview-snapshot-copy h2 {
  margin: 0;
  color: var(--text);
  font-size: 26px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.preview-snapshot-text {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  max-width: 680px;
  line-height: 1.55;
}

.preview-score-card {
  min-width: 210px;
  display: grid;
  justify-items: start;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.preview-score-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.preview-score-value {
  color: var(--text);
  font-size: clamp(48px, 4.6vw, 66px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.06em;
}

.preview-score-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pre-analysis-overview {
  display: grid;
  gap: 14px;
}

.pre-analysis-summary-card {
  display: grid;
  gap: 14px;
  padding: 18px 18px 16px;
  border: 1px solid rgba(15, 108, 222, 0.1);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(246, 250, 255, 0.86) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.pre-analysis-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pre-analysis-summary-indicator {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(15, 108, 222, 0.18);
  box-shadow: 0 0 0 6px rgba(15, 108, 222, 0.05);
}

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

.pre-analysis-item {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.pre-analysis-item strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
}

.snapshot-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.snapshot-detail {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}

.preview-summary-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.preview-summary-copy {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 650;
}

.dashboard-shell {
  display: grid;
  gap: 20px;
  margin-top: 16px;
}

.dashboard-shell.hidden {
  display: none;
}

.report-state-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.report-state-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.report-state-demo {
  background: rgba(14, 165, 233, 0.12);
  color: #0f5f8c;
}

.report-state-uploaded {
  background: rgba(15, 108, 222, 0.1);
  color: var(--accent-strong);
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 28px;
  padding: 20px 6px 0;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.footer-meta-stack {
  display: grid;
  gap: 3px;
}

.footer-brand {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.footer-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
}

.footer-links a,
.footer-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent-strong);
}

.footer-meta {
  margin: 0;
}

.legal-page-shell {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 26px 24px 56px;
}

.legal-page-panel {
  display: grid;
  gap: 24px;
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-md);
}

.legal-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px 6px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.legal-back-link::before {
  content: "\2190";
  font-size: 14px;
  line-height: 1;
}

.legal-back-link:hover {
  color: var(--accent);
}

.legal-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.legal-page-panel h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(34px, 5vw, 48px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.legal-hero {
  display: grid;
  gap: 18px;
  padding: 6px 0 4px;
}

.legal-hero-copy {
  display: grid;
  gap: 10px;
  max-width: 760px;
}

.legal-intro,
.legal-copy {
  margin: 0;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.7;
}

.legal-meta-grid,
.legal-card-grid,
.legal-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.legal-meta-card,
.legal-card,
.legal-section-card {
  display: grid;
  gap: 8px;
  padding: 18px 18px 16px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 251, 255, 0.98) 100%);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.04);
}

.legal-meta-label,
.legal-card-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.legal-meta-value,
.legal-card-title {
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.legal-meta-note,
.legal-card-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.legal-outline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 4px 0 2px;
}

.legal-outline a {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(247, 251, 255, 0.92);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.legal-section {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.legal-section-card {
  align-content: start;
}

.legal-section h2 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  letter-spacing: -0.03em;
}

.legal-section-copy {
  display: grid;
  gap: 10px;
}

.legal-callout {
  display: grid;
  gap: 8px;
  padding: 18px 20px;
  border: 1px solid rgba(15, 108, 222, 0.12);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(15, 108, 222, 0.08), transparent 48%),
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.legal-callout-title {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.legal-callout-copy {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.placeholder-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  border: 1px solid rgba(15, 108, 222, 0.14);
  background: rgba(15, 108, 222, 0.07);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-card {
  min-height: 168px;
}

.contact-card .legal-card-title {
  font-size: 18px;
}

.contact-detail {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.contact-detail strong {
  font-weight: 800;
}

.legal-divider {
  height: 1px;
  border: 0;
  margin: 2px 0;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.02));
}

.pricing-page-panel {
  gap: 28px;
}

.pricing-hero {
  display: grid;
  gap: 18px;
}

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

.pricing-plan-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 22px 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(247, 251, 255, 0.98) 100%);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.05);
}

.pricing-plan-card-featured {
  border-color: rgba(15, 108, 222, 0.18);
  background:
    linear-gradient(135deg, rgba(15, 108, 222, 0.08), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(246, 250, 255, 0.99) 100%);
  box-shadow: 0 22px 42px rgba(15, 108, 222, 0.08);
}

.pricing-plan-card-annual {
  border-color: rgba(15, 108, 222, 0.16);
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(246, 251, 255, 0.98) 100%);
}

.pricing-plan-name {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.pricing-plan-price {
  margin: 0;
  color: var(--accent-strong);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.pricing-plan-price-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
 }

.pricing-plan-copy {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.pricing-feature-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pricing-feature-list li {
  position: relative;
  padding-left: 16px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.6;
}

.pricing-feature-list li::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 108, 222, 0.58);
}

.pricing-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

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

@media (max-width: 860px) {
  .legal-meta-grid,
  .legal-card-grid,
  .legal-section-grid,
  .pricing-plan-grid,
  .pricing-note-grid {
    grid-template-columns: 1fr;
  }

  .legal-page-panel {
    padding: 26px 22px;
  }
}

.report-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px;
  background:
    linear-gradient(135deg, rgba(15, 108, 222, 0.08), transparent 42%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: var(--shadow-md);
}

body[data-mode="demo"] .gauge-empty-hint,
body[data-mode="uploaded"] .gauge-empty-hint {
  display: none;
}

.report-heading {
  display: grid;
  gap: 6px;
}

.report-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 30px;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.report-context {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.export-menu {
  position: relative;
}

.export-menu-trigger {
  position: relative;
  padding-right: 34px;
}

.export-menu-trigger[aria-disabled="true"] {
  cursor: default;
  opacity: 0.62;
  border-color: rgba(15, 23, 42, 0.08);
  background: rgba(248, 250, 252, 0.9);
  color: #64748b;
}

.export-menu-trigger[aria-disabled="true"]::after {
  opacity: 0.35;
}

.export-menu-trigger[aria-disabled="true"],
.export-menu-trigger[aria-disabled="true"] *,
.export-menu-trigger[aria-disabled="true"]::before,
.export-menu-trigger[aria-disabled="true"]::after {
  cursor: default !important;
}

.export-menu-trigger::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-65%) rotate(45deg);
  opacity: 0.7;
}

.export-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  min-width: 220px;
  display: none;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(10px);
}

.export-menu-panel:not(.hidden) {
  display: grid;
}

.export-option {
  min-width: 0;
  min-height: 0;
  justify-content: flex-start;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.export-option:hover {
  background: #f5f9ff;
  border-color: rgba(15, 108, 222, 0.12);
  box-shadow: none;
}

.action-button {
  min-width: 0;
}

.gauge-empty-hint {
  background: rgba(15, 108, 222, 0.06);
}

.empty-note,
.empty-item {
  color: var(--muted);
}

.empty-note {
  border-color: rgba(15, 23, 42, 0.1);
  background: linear-gradient(180deg, #f9fbff 0%, #ffffff 100%);
}

body[data-mode="demo"] .hero-shell,
body[data-mode="uploaded"] .hero-shell {
  margin-bottom: 20px;
}

body[data-mode="demo"] .hero-panel,
body[data-mode="uploaded"] .hero-panel {
  box-shadow: var(--shadow-sm);
}

body[data-mode="demo"] .hero-preview-band,
body[data-mode="uploaded"] .hero-preview-band {
  margin-top: 14px;
}

body[data-mode="uploaded"] .page-shell {
  padding-bottom: 44px;
}

body[data-mode="uploaded"] .hero-shell {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.88fr);
  gap: 18px;
  margin-bottom: 14px;
  align-items: start;
}

body[data-mode="uploaded"] .hero-panel {
  padding: 26px 28px;
}

body[data-mode="uploaded"] .hero-stat-grid {
  margin-top: 24px;
}

body[data-mode="uploaded"] .upload-panel {
  gap: 12px;
  padding: 22px;
}

body[data-mode="uploaded"] .upload-top {
  gap: 8px;
}

body[data-mode="uploaded"] .upload-panel h2 {
  font-size: 24px;
}

body[data-mode="uploaded"] .upload-copy {
  font-size: 13px;
}

body[data-mode="uploaded"] .upload-form {
  padding: 14px;
}

body[data-mode="uploaded"] .upload-feedback {
  min-height: 0;
}

body[data-mode="uploaded"] .upload-footnote {
  display: none;
}

body[data-mode="uploaded"] .upload-secondary-shell {
  padding: 10px 2px 0;
  gap: 8px;
  background: transparent;
}

body[data-mode="uploaded"] .upload-secondary-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

body[data-mode="uploaded"] .upload-secondary {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

body[data-mode="uploaded"] .workflow-support-grid {
  grid-template-columns: 1fr;
}

body[data-mode="uploaded"] .quick-action-card {
  min-height: 0;
  padding: 11px 12px;
  gap: 2px;
}

body[data-mode="uploaded"] .quick-action-copy {
  display: none;
}

body[data-mode="uploaded"] .quick-guide-panel {
  gap: 7px;
  padding: 10px 11px;
}

body[data-mode="uploaded"] .quick-guide-intro {
  display: none;
}

body[data-mode="uploaded"] .quick-guide-card {
  padding: 11px;
}

body[data-mode="uploaded"] .quick-action-options {
  gap: 6px;
  margin-top: 6px;
}

body[data-mode="uploaded"] .quick-action-option {
  min-height: 36px;
  padding: 8px 10px;
  font-size: 11px;
}

body[data-mode="uploaded"] .dashboard-shell {
  margin-top: 10px;
}

@media (max-width: 1180px) {
  .upload-secondary,
  .hero-preview-band {
    grid-template-columns: 1fr;
  }

  .workflow-support-grid {
    grid-template-columns: 1fr;
  }

  .app-footer {
    align-items: start;
    flex-direction: column;
  }

  .report-toolbar {
    align-items: start;
    flex-direction: column;
  }

  .report-actions {
    justify-content: flex-start;
  }

  .export-menu-panel {
    left: 0;
    right: auto;
  }
}

@media (max-width: 1040px) {
  .hero-proof-grid {
    grid-template-columns: 1fr;
  }

  .nav-utility {
    align-items: flex-start;
    width: 100%;
  }

  .nav-actions,
  .preview-snapshot-head {
    align-items: start;
    flex-direction: column;
  }

  .nav-context {
    text-align: left;
  }

  .pre-analysis-overview {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .pre-analysis-checklist {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding: 18px 14px 40px;
  }

  .app-nav {
    padding: 12px 16px;
  }

  .nav-utility {
    width: 100%;
    justify-content: flex-start;
  }

  .nav-brand {
    gap: 6px;
    flex-wrap: nowrap;
  }

  .brand-lockup-wrap {
    width: min(258px, calc(100vw - 52px));
    height: 49px;
    padding: 0;
  }

  .brand-lockup-image {
    left: -6px;
    width: min(264px, calc(100vw - 40px));
    max-width: none;
    top: 52%;
    transform: translateY(-50%) scale(1.07);
    margin: 0;
  }

  .brand-edition {
    padding: 5px 9px;
  }

  .nav-context {
    text-align: left;
  }

  .hero-panel,
  .upload-panel,
  .preview-snapshot,
  .report-toolbar {
    padding: 20px;
  }

  .file-picker-status {
    align-items: flex-start;
    flex-direction: column;
  }

  .legal-page-shell {
    padding: 24px 14px 40px;
  }

  .legal-page-panel {
    padding: 24px 20px;
  }

  .report-heading h2 {
    font-size: 24px;
  }

  .report-state-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}

.page-shell,
.hero-shell > *,
.legal-page-shell,
.legal-page-panel,
.pricing-plan-card,
.legal-card,
.legal-section-card,
.footer-links,
.upload-secondary,
.pre-analysis-overview,
.report-toolbar,
.report-heading,
.report-actions {
  min-width: 0;
}

@media (max-width: 1040px) {
  .hero-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    align-items: start;
  }

  .hero-panel,
  .upload-panel {
    width: 100%;
    min-width: 0;
  }

  .hero-copy,
  .hero-panel h1,
  .hero-subtitle,
  .hero-detail {
    max-width: none;
  }

  .hero-preview-band,
  .pre-analysis-overview {
    grid-template-columns: 1fr;
  }

  .preview-score-card {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 760px) {
  .app-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .nav-brand,
  .nav-utility,
  .nav-actions {
    width: 100%;
  }

  .nav-utility {
    justify-content: flex-start;
  }

  .nav-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-link-button {
    width: 100%;
    min-height: 44px;
  }

  .hero-shell {
    gap: 12px;
  }

  .hero-panel h1 {
    font-size: clamp(30px, 10vw, 38px);
    line-height: 1.02;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .hero-detail {
    font-size: 13px;
  }

  .upload-meta {
    gap: 6px;
  }

  .upload-chip {
    max-width: 100%;
    padding: 6px 10px;
    font-size: 11px;
  }

  .file-picker-button,
  #analyze-btn {
    width: 100%;
  }

  .file-picker-affordance {
    width: 100%;
    justify-content: space-between;
  }

  .quick-action-card {
    min-height: 0;
    padding: 13px 14px;
  }

  .quick-action-options {
    grid-template-columns: 1fr;
  }

  .pre-analysis-overview {
    grid-template-columns: 1fr;
  }

  .pre-analysis-summary-card,
  .pre-analysis-item,
  .quick-guide-card {
    padding: 14px;
  }

  .app-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding-top: 14px;
  }

  .footer-links {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .page-shell {
    padding: 16px 12px 32px;
  }

  .brand-lockup-wrap {
    width: min(226px, calc(100vw - 42px));
    height: 45px;
  }

  .brand-lockup-image {
    left: -4px;
    width: min(232px, calc(100vw - 28px));
    top: 52%;
    transform: translateY(-50%) scale(1.04);
    margin: 0;
  }

  .legal-page-shell {
    padding: 18px 12px 32px;
  }

  .hero-panel,
  .upload-panel,
  .preview-snapshot,
  .report-toolbar,
  .legal-page-panel {
    padding: 18px 16px;
  }

  .hero-kicker,
  .upload-kicker,
  .upload-secondary-label,
  .preview-score-label,
  .snapshot-label,
  .legal-kicker,
  .legal-meta-label,
  .legal-card-label {
    letter-spacing: 0.1em;
  }

  .hero-panel h1 {
    font-size: clamp(28px, 9.5vw, 34px);
  }

  .preview-score-value {
    font-size: clamp(40px, 18vw, 56px);
  }

  .report-heading h2,
  .legal-page-panel h1 {
    font-size: clamp(28px, 8.5vw, 34px);
  }

  .pricing-plan-card,
  .legal-card,
  .legal-section-card,
  .legal-meta-card {
    padding: 16px;
  }

  .pricing-cta-row,
  .report-actions,
  .footer-links {
    gap: 8px;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .app-backdrop,
  .app-nav,
  .hero-shell,
  .pre-analysis-panel,
  .report-actions,
  .upload-feedback,
  .upload-footnote {
    display: none !important;
  }

  .page-shell {
    max-width: none;
    padding: 0;
  }

  .dashboard-shell {
    display: block !important;
    margin-top: 0;
  }

  .panel,
  .chart-wrap,
  .cluster-card,
  .listing-improvement-card {
    box-shadow: none !important;
  }
}
