:root {
  color-scheme: light;
  --ink: #082033;
  --muted: #607587;
  --line: #d8e9f3;
  --surface: #f4fbff;
  --paper: #ffffff;
  --accent: #0ea5e9;
  --accent-dark: #0369a1;
  --accent-soft: #e0f2fe;
  --alert: #bb3d2f;
  --blueprint: #082f49;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #f5fbff 0%, #ffffff 48%, #eef8ff 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body.is-analyzing {
  overflow: hidden;
}

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

.analysis-loading {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(180deg, #eff9ff 0%, #ffffff 100%);
}

.analysis-loading[hidden] {
  display: none;
}

.loading-panel {
  width: min(620px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 70px rgba(8, 47, 73, 0.14);
}

.loading-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 22px;
  border-radius: 12px;
  background: var(--blueprint);
  color: white;
  font-weight: 900;
}

.loading-bar {
  height: 8px;
  margin-top: 24px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbeef9;
}

.loading-bar span {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  animation: loading-slide 1.35s ease-in-out infinite;
}

@keyframes loading-slide {
  0% {
    transform: translateX(-105%);
  }
  100% {
    transform: translateX(270%);
  }
}

.app-shell {
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 22px 0 42px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto 22px;
  padding: 10px 12px;
  border: 1px solid rgba(186, 230, 253, 0.88);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 50px rgba(8, 47, 73, 0.08);
  backdrop-filter: blur(16px);
}

.brand,
.topbar nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  color: var(--ink);
  font-weight: 850;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7dd3fc, #0ea5e9);
  color: white;
}

.topbar nav a {
  padding: 9px 13px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.topbar nav a:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.auth-widget {
  min-width: 150px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.auth-status {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.auth-status.error {
  color: var(--alert);
}

.google-button-host {
  min-height: 36px;
}

.auth-user {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 300px;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
}

.auth-user img,
.auth-avatar-fallback {
  width: 28px;
  height: 28px;
  border-radius: 999px;
}

.auth-avatar-fallback {
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.auth-user span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.auth-user button {
  border: 0;
  border-radius: 999px;
  padding: 7px 9px;
  background: var(--surface);
  color: var(--accent-dark);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.auth-gate {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #bae6fd;
  border-radius: 14px;
  background: var(--accent-soft);
}

.auth-gate[hidden] {
  display: none;
}

.auth-gate strong {
  color: var(--accent-dark);
  font-size: 14px;
}

.auth-gate span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(420px, 1.08fr);
  gap: 22px;
  align-items: stretch;
}

.home-workspace {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(420px, 0.88fr);
  gap: 34px;
  align-items: start;
  min-height: auto;
  padding: 18px 0 26px;
}

.saas-hero {
  position: relative;
  overflow: hidden;
  padding: 44px 44px 54px;
  border: 1px solid rgba(125, 211, 252, 0.54);
  border-radius: 30px;
  background:
    linear-gradient(160deg, #effaff 0%, #dff4ff 48%, #f7fcff 100%);
  box-shadow: 0 34px 90px rgba(8, 47, 73, 0.12);
}

.saas-hero::before,
.saas-hero::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 42px;
  border: 1px solid rgba(14, 165, 233, 0.12);
  transform: rotate(-12deg);
  pointer-events: none;
}

.saas-hero::before {
  top: 38px;
  right: -58px;
  background: rgba(14, 165, 233, 0.12);
}

.saas-hero::after {
  bottom: 74px;
  left: -82px;
  background: rgba(59, 130, 246, 0.08);
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(340px, 0.95fr) minmax(410px, 0.86fr);
  gap: 36px;
  align-items: start;
}

.home-intro {
  padding: 20px 0 0;
}

.logo-hero {
  display: block;
  width: 78px;
  height: 78px;
  margin-bottom: 18px;
  filter: drop-shadow(0 18px 26px rgba(3, 7, 18, 0.18));
}

.saas-hero .eyebrow {
  color: var(--accent-dark);
}

.saas-hero h1 {
  max-width: 610px;
  color: var(--ink);
  text-wrap: balance;
}

.saas-hero .lead {
  color: #426174;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.hero-primary,
.hero-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
}

.hero-primary {
  background: linear-gradient(135deg, #22c3f3, #0ea5e9);
  color: white;
  box-shadow: 0 18px 40px rgba(2, 132, 199, 0.2);
}

.hero-secondary {
  border: 1px solid rgba(14, 165, 233, 0.28);
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.58);
}

.feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.feature-row span {
  padding: 10px 13px;
  border: 1px solid rgba(14, 165, 233, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
}

.workflow-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin: 0;
}

.workflow-strip span {
  min-height: 68px;
  padding: 14px;
  border: 1px solid #d8e9f3;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  color: #16435d;
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 14px 34px rgba(8, 47, 73, 0.07);
}

.upload-panel,
.result-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(8, 47, 73, 0.12);
}

.upload-panel {
  width: min(760px, 100%);
  padding: 28px;
}

.hero-upload {
  justify-self: end;
  max-width: 520px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 80px rgba(8, 47, 73, 0.13);
}

.privacy-note {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid rgba(125, 211, 252, 0.72);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(240, 249, 255, 0.96), rgba(224, 242, 254, 0.72));
  color: #16435d;
}

.privacy-note strong {
  color: #075985;
  font-size: 13px;
  font-weight: 900;
}

.privacy-note span {
  color: #526a7b;
  font-size: 12px;
  line-height: 1.45;
}

.hero-product-preview {
  position: relative;
  z-index: 1;
  margin: 38px auto -18px;
  max-width: 920px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 32px 80px rgba(7, 23, 75, 0.28);
}

.safe-preview {
  border-color: rgba(14, 165, 233, 0.2);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 32px 80px rgba(8, 47, 73, 0.13);
}

.preview-browser {
  display: flex;
  gap: 8px;
  padding: 15px 18px;
  background: linear-gradient(135deg, #0ea5e9, #38bdf8);
}

.preview-browser span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.hero-product-preview img {
  display: block;
  width: 100%;
  height: clamp(260px, 42vw, 520px);
  object-fit: cover;
  object-position: center;
  background: white;
}

.safe-preview-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 18px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(240, 249, 255, 0.96));
}

.safe-plan {
  position: relative;
  min-height: 350px;
  overflow: hidden;
  border: 1px solid #d7ecf8;
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(14, 165, 233, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(14, 165, 233, 0.06) 1px, transparent 1px),
    #ffffff;
  background-size: 42px 42px;
}

.safe-plan-grid {
  position: absolute;
  inset: 52px 66px 58px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(62px, 1fr));
  gap: 8px;
  opacity: 0.85;
}

.safe-plan-grid span {
  position: relative;
  min-height: 62px;
  border: 2px solid rgba(8, 47, 73, 0.18);
  border-radius: 4px;
  background:
    linear-gradient(90deg, transparent 46%, rgba(8, 47, 73, 0.14) 46% 49%, transparent 49%),
    linear-gradient(180deg, rgba(224, 242, 254, 0.44), rgba(255, 255, 255, 0.72));
}

.safe-plan-grid span::before,
.safe-plan-grid span::after {
  content: "";
  position: absolute;
  background: rgba(8, 47, 73, 0.18);
}

.safe-plan-grid span::before {
  left: 14%;
  right: 14%;
  top: 49%;
  height: 1px;
}

.safe-plan-grid span::after {
  width: 24px;
  height: 18px;
  right: 8px;
  bottom: 8px;
  border: 1px solid rgba(8, 47, 73, 0.16);
  border-radius: 2px;
  background: transparent;
}

.safe-plan-grid span.wide {
  grid-column: span 2;
}

.safe-plan-grid span.tall {
  grid-row: span 2;
}

.plan-corridor {
  position: absolute;
  border: 1px solid rgba(8, 47, 73, 0.16);
  background:
    repeating-linear-gradient(90deg, rgba(14, 165, 233, 0.08) 0 12px, transparent 12px 24px),
    rgba(255, 255, 255, 0.72);
}

.plan-corridor.horizontal {
  left: 58px;
  right: 58px;
  top: 50%;
  height: 34px;
  transform: translateY(-50%);
}

.plan-corridor.vertical {
  top: 46px;
  bottom: 52px;
  left: 50%;
  width: 34px;
  transform: translateX(-50%);
}

.plan-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72px;
  height: 58px;
  border: 2px solid rgba(8, 47, 73, 0.2);
  border-radius: 5px;
  background:
    linear-gradient(135deg, transparent 44%, rgba(8, 47, 73, 0.16) 45% 48%, transparent 49%),
    rgba(255, 255, 255, 0.86);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.64);
}

.dimension-line {
  position: absolute;
  border-color: rgba(8, 47, 73, 0.22);
}

.dimension-line.top {
  left: 70px;
  right: 70px;
  top: 26px;
  height: 1px;
  border-top: 1px dashed rgba(8, 47, 73, 0.22);
}

.dimension-line.right {
  top: 58px;
  bottom: 58px;
  right: 30px;
  width: 1px;
  border-right: 1px dashed rgba(8, 47, 73, 0.22);
}

.safe-label {
  position: absolute;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.12);
  color: #075985;
  font-size: 13px;
  font-weight: 900;
}

.safe-label.one {
  top: 82px;
  left: 25%;
}

.safe-label.two {
  top: 152px;
  left: 61%;
}

.safe-label.three {
  bottom: 82px;
  left: 36%;
}

.safe-label.four {
  right: 18%;
  bottom: 96px;
}

.safe-shield {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 3px;
  width: min(230px, calc(100% - 36px));
  padding: 13px;
  border: 1px solid rgba(14, 165, 233, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 45px rgba(8, 47, 73, 0.09);
}

.safe-shield strong {
  color: var(--accent-dark);
  font-size: 14px;
}

.safe-shield span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.safe-table {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
  border: 1px solid #d7ecf8;
  border-radius: 18px;
  background: #ffffff;
}

.safe-table strong {
  color: #16435d;
  font-size: 15px;
}

.safe-table div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.safe-table div:last-child {
  border-bottom: 0;
}

.safe-table span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.safe-table b {
  color: var(--accent-dark);
  font-size: 18px;
}

.hero-preview-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(14, 165, 233, 0.14);
  background: #e0f2fe;
}

.hero-preview-stats div {
  display: grid;
  gap: 3px;
  padding: 16px 18px;
  border-right: 1px solid rgba(14, 165, 233, 0.16);
}

.hero-preview-stats div:last-child {
  border-right: 0;
}

.hero-preview-stats strong {
  color: var(--accent-dark);
  font-size: 25px;
  line-height: 1;
}

.hero-preview-stats span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.panel-head {
  margin-bottom: 22px;
}

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

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 620px;
  font-size: clamp(42px, 5vw, 64px);
  line-height: 1;
}

.lead {
  max-width: 560px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
}

h2 {
  font-size: 24px;
}

.drop-zone {
  position: relative;
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 14px;
  min-height: 96px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px dashed #93cfe9;
  border-radius: 16px;
  background: var(--surface);
  cursor: pointer;
}

.drop-zone.has-file {
  border-color: var(--accent);
  background: #eaf7ff;
}

.drop-zone.has-file .file-icon {
  background: var(--accent);
}

.drop-zone.has-file small {
  color: var(--accent-dark);
  font-weight: 800;
}

.drop-zone.compact {
  min-height: 76px;
}

.drop-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--blueprint);
  color: white;
  font-size: 12px;
  font-weight: 800;
}

.drop-zone strong,
.drop-zone small {
  display: block;
}

.drop-zone strong {
  font-size: 16px;
}

.drop-zone small {
  max-width: 100%;
  margin-top: 4px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 4px 0 16px;
}

.mode-switch label {
  cursor: pointer;
}

.mode-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-switch span {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 850;
}

.mode-switch input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.18);
}

.compact-mode {
  margin: 10px 0 12px;
}

.compact-mode span {
  min-height: 36px;
  font-size: 12px;
}

.compact-variant-option {
  margin: 0 0 12px;
}

.unit-name-entry {
  display: grid;
  gap: 10px;
  margin: 2px 0 18px;
}

.unit-name-entry[hidden] {
  display: none;
}

.unit-name-entry strong,
.unit-name-entry small {
  display: block;
}

.unit-name-entry strong {
  font-size: 15px;
}

.unit-name-entry small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.unit-name-entry textarea {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 13px;
  color: var(--ink);
  background: white;
  font: inherit;
  line-height: 1.4;
}

.unit-name-entry textarea:focus {
  outline: 2px solid rgba(14, 165, 233, 0.18);
  border-color: var(--accent);
}

.variant-option,
.case-option,
.inline-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: -4px 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(244, 251, 255, 0.72);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.variant-option {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  padding: 0;
  border: 0;
  background: transparent;
}

.variant-option label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(244, 251, 255, 0.72);
  cursor: pointer;
}

.variant-option input:checked + span strong {
  color: var(--accent-dark);
}

.variant-option label:has(input:checked) {
  border-color: rgba(14, 165, 233, 0.58);
  background: var(--accent-soft);
}

.compact-variant-option {
  grid-template-columns: 1fr;
  gap: 8px;
}

.compact-variant-option label {
  padding: 10px;
}

.variant-option strong,
.variant-option small,
.case-option strong,
.case-option small {
  display: block;
}

.variant-option strong,
.case-option strong {
  color: var(--ink);
  font-size: 13px;
}

.variant-option small,
.case-option small {
  margin-top: 3px;
  line-height: 1.35;
}

.variant-option input,
.case-option input,
.inline-check input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.compact-unit-entry {
  margin: 0 0 12px;
}

.compact-unit-entry textarea {
  min-height: 92px;
  font-size: 13px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0;
}

.settings-grid label {
  display: grid;
  gap: 7px;
}

.settings-grid .wide {
  grid-column: 1 / -1;
}

.settings-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

input[type="number"],
input[type="text"] {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  color: var(--ink);
  background: white;
  font: inherit;
}

.primary-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 15px;
  padding: 0 16px;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: white;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.primary-action:hover {
  background: linear-gradient(135deg, #0284c7, #0369a1);
}

.supporting-sections {
  display: grid;
  gap: 22px;
  padding: 28px 0 4px;
}

.sample-shell {
  width: min(1040px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 22px 0 42px;
}

.sample-brand {
  margin-bottom: 26px;
}

.sample-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 24px;
  align-items: start;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 70px rgba(8, 47, 73, 0.12);
}

.sample-copy h1 {
  max-width: 440px;
  font-size: clamp(34px, 4vw, 52px);
}

.sample-meta {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.sample-meta span {
  width: fit-content;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.sample-picker {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.sample-table-head,
.sample-candidate-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 80px minmax(120px, 0.8fr);
  gap: 12px;
  align-items: center;
}

.sample-table-head {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.sample-candidate-list {
  max-height: 520px;
  overflow: auto;
}

.sample-candidate-row {
  position: relative;
  min-height: 54px;
  padding: 12px 16px 12px 50px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
}

.sample-candidate-row:hover,
.sample-candidate-row:has(input:checked) {
  background: var(--accent-soft);
}

.sample-candidate-row input {
  position: absolute;
  left: 16px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.sample-candidate-row input:disabled:not(:checked) {
  opacity: 0.35;
}

.sample-unit-name {
  font-weight: 850;
}

.sample-empty {
  padding: 18px;
  color: var(--muted);
  font-weight: 750;
}

.sample-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.benefit-strip,
.time-savings-section,
.metric-strip,
.info-section,
.feedback-section,
.capability-section {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 50px rgba(8, 47, 73, 0.08);
}

.benefit-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
}

.benefit-strip span {
  min-height: 68px;
  display: flex;
  align-items: center;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(239, 248, 255, 0.88));
  color: #16435d;
  font-size: 14px;
  font-weight: 850;
}

.time-savings-section {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.18fr);
  gap: 22px;
  align-items: center;
  padding: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 18%, rgba(14, 165, 233, 0.3), transparent 34%),
    linear-gradient(135deg, rgba(232, 247, 255, 0.98), rgba(186, 230, 253, 0.88));
  border-color: rgba(125, 211, 252, 0.95);
  box-shadow: 0 24px 70px rgba(14, 165, 233, 0.16);
}

.time-savings-copy h2 {
  max-width: 480px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.03;
}

.time-savings-copy p:not(.eyebrow) {
  max-width: 470px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.48;
  font-weight: 700;
}

.time-chart-card {
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid rgba(186, 215, 235, 0.88);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 24px 60px rgba(8, 47, 73, 0.12);
}

.time-chart-head,
.time-chart-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.time-chart-head span,
.time-chart-footer span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.time-chart-head strong {
  padding: 8px 12px;
  border-radius: 999px;
  background: #0ea5e9;
  color: white;
  font-size: 13px;
  font-weight: 950;
  box-shadow: 0 12px 24px rgba(14, 165, 233, 0.2);
}

.time-bars {
  display: grid;
  gap: 14px;
}

.time-bar-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.72fr) 56px minmax(0, 1.28fr);
  gap: 14px;
  align-items: center;
  min-height: 82px;
  padding: 14px;
  border: 1px solid rgba(217, 232, 242, 0.96);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 251, 255, 0.9));
}

.time-bar-row strong {
  display: block;
  color: #16435d;
  font-size: 15px;
  font-weight: 950;
}

.time-bar-row div span {
  display: block;
  margin-top: 4px;
  color: #607587;
  font-size: 12px;
  font-weight: 750;
}

.time-bar-row b {
  color: var(--ink);
  font-size: 22px;
  text-align: right;
}

.time-bar-row i {
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8f5fc;
  box-shadow: inset 0 0 0 1px rgba(186, 215, 235, 0.7);
}

.time-bar-row i span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.time-bar-row.manual i span {
  width: 100%;
  background: linear-gradient(90deg, #94a3b8, #64748b);
}

.time-bar-row.drawlytix i span {
  width: 10%;
  min-width: 24px;
  background: linear-gradient(90deg, #38bdf8, #0284c7);
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.38);
}

.time-chart-footer {
  padding-top: 2px;
}

.time-chart-footer b {
  color: var(--accent-dark);
  font-size: 18px;
}

.info-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.22fr);
  gap: 22px;
  padding: 22px;
  align-items: start;
}

.workflow-section {
  background:
    linear-gradient(135deg, rgba(240, 249, 255, 0.92), rgba(255, 255, 255, 0.9));
}

.review-tools-section {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(246, 252, 255, 0.92));
}

.outputs-section {
  background:
    linear-gradient(135deg, rgba(239, 248, 255, 0.92), rgba(255, 255, 255, 0.9));
}

.privacy-section {
  align-items: stretch;
  padding-block: 18px;
  background:
    linear-gradient(135deg, rgba(248, 251, 253, 0.96), rgba(239, 246, 251, 0.92));
  border-color: rgba(203, 221, 232, 0.88);
}

.privacy-list {
  display: grid;
  gap: 8px;
  align-content: center;
}

.privacy-list div {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 9px 11px;
  border: 1px solid rgba(186, 215, 235, 0.78);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 30px rgba(8, 47, 73, 0.06);
}

.privacy-list span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 10px;
  font-weight: 950;
}

.privacy-list p {
  margin: 0;
  color: #526a7b;
  font-size: 13px;
  line-height: 1.45;
}

.section-copy h2 {
  max-width: 420px;
  font-size: 24px;
  line-height: 1.16;
}

.section-copy p:not(.eyebrow) {
  max-width: 430px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 650;
}

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

.preview-card {
  min-height: 180px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, #ffffff, #f5fbff);
  box-shadow: 0 18px 42px rgba(8, 47, 73, 0.06);
}

.review-tools-section .preview-card:nth-child(1) {
  background:
    linear-gradient(180deg, #effaff, #ffffff);
}

.review-tools-section .preview-card:nth-child(2) {
  background:
    linear-gradient(180deg, #ffffff, #f7fcff);
}

.review-tools-section .preview-card:nth-child(3) {
  background:
    linear-gradient(180deg, #f6fbff, #ffffff);
}

.outputs-section .preview-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 248, 255, 0.74));
}

.preview-card {
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.preview-card:hover {
  transform: translateY(-2px);
  border-color: rgba(125, 211, 252, 0.78);
  box-shadow: 0 24px 54px rgba(8, 47, 73, 0.1);
}

.preview-card strong {
  display: block;
  margin-bottom: 14px;
  color: #16435d;
  font-size: 14px;
}

.mini-table {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.mini-table span {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
}

.mini-table span:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.mini-table span:nth-child(even) {
  color: var(--accent-dark);
  font-weight: 850;
  text-align: right;
}

.mini-table.warning span:nth-child(even) {
  color: var(--alert);
}

.label-preview-card,
.location-preview {
  min-height: 118px;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(14, 165, 233, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(14, 165, 233, 0.05) 1px, transparent 1px),
    #ffffff;
  background-size: 28px 28px;
}

.label-preview-card span {
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.14);
  color: var(--accent-dark);
  font-size: 18px;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(8, 47, 73, 0.08);
}

.label-preview-card span:nth-child(2) {
  justify-self: end;
}

.label-preview-card span:nth-child(3) {
  justify-self: center;
}

.location-preview span,
.location-preview small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.location-preview b {
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 20px;
  line-height: 1;
  box-shadow: 0 14px 26px rgba(14, 165, 233, 0.2);
}

.export-preview {
  display: grid;
  gap: 8px;
}

.export-preview span {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(232, 247, 255, 0.72));
}

.metric-strip div {
  display: grid;
  gap: 4px;
  min-height: 82px;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.38);
}

.metric-strip div:last-child {
  border-right: 0;
}

.metric-strip strong {
  color: var(--accent-dark);
  font-size: 24px;
  line-height: 1;
}

.metric-strip span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.capability-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
  gap: 22px;
  align-items: center;
  overflow: hidden;
  padding: 26px;
  background:
    radial-gradient(circle at 82% 30%, rgba(125, 211, 252, 0.18), transparent 30%),
    linear-gradient(135deg, #f5fbff 0%, #ffffff 42%, #eaf7ff 100%);
}

.capability-copy h2 {
  max-width: 470px;
  margin: 0;
  font-size: 28px;
  line-height: 1.12;
  text-wrap: balance;
}

.capability-copy p:not(.eyebrow) {
  max-width: 520px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 650;
}

.capability-visual {
  position: relative;
  min-height: 240px;
  display: grid;
  place-items: center;
}

.capability-visual img {
  width: min(420px, 100%);
  height: auto;
  filter: drop-shadow(0 26px 46px rgba(37, 99, 235, 0.24));
}

.capability-mock {
  min-height: 260px;
}

.capability-dashboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: min(520px, 100%);
  padding: 18px;
  border: 1px solid #d7ecf8;
  border-radius: 20px;
  background:
    linear-gradient(180deg, #ffffff, #f3fbff);
  box-shadow: 0 24px 55px rgba(8, 47, 73, 0.11);
}

.capability-dashboard div {
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 16px;
  border: 1px solid rgba(14, 165, 233, 0.16);
  border-radius: 16px;
  background:
    linear-gradient(180deg, #f8fdff, #e8f7ff);
}

.capability-dashboard b {
  color: var(--ink);
  font-size: 14px;
}

.capability-dashboard span {
  align-self: end;
  color: var(--accent-dark);
  font-size: 22px;
  font-weight: 900;
}

.capability-list {
  position: absolute;
  right: 6px;
  bottom: 8px;
  display: grid;
  gap: 8px;
}

.capability-list span {
  width: fit-content;
  justify-self: end;
  padding: 9px 11px;
  border: 1px solid rgba(14, 165, 233, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 12px 30px rgba(8, 47, 73, 0.09);
}

.feedback-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(246, 252, 255, 0.9));
}

.feedback-section h2 {
  max-width: 620px;
  margin: 0;
  font-size: 24px;
  line-height: 1.16;
}

.feedback-section p:not(.eyebrow) {
  max-width: 680px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 650;
}

.feedback-action {
  display: grid;
  gap: 4px;
  min-width: 240px;
  padding: 14px 16px;
  border: 1px solid rgba(14, 165, 233, 0.32);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #eff9ff);
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.feedback-action:hover {
  border-color: rgba(14, 165, 233, 0.58);
  background: var(--accent-soft);
}

.feedback-action span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.feedback-action strong {
  overflow-wrap: anywhere;
  font-size: 15px;
}

.primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

.primary-action.small,
.secondary-action {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 7px;
  padding: 10px 12px;
  font-weight: 800;
}

.primary-action.small {
  width: auto;
  height: auto;
}

.secondary-action {
  border: 1px solid var(--line);
  background: white;
  color: var(--accent-dark);
}

.preview-panel {
  min-height: 620px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #c8d2cc;
  background: #102e3f;
  box-shadow: 0 20px 46px rgba(20, 43, 53, 0.18);
}

.preview-toolbar {
  display: flex;
  gap: 7px;
  align-items: center;
  height: 38px;
  padding: 0 14px;
  background: #0d2635;
}

.preview-toolbar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #89a9b5;
}

.preview-panel img {
  display: block;
  width: 100%;
  height: 505px;
  object-fit: cover;
  object-position: 8% 9%;
}

.preview-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.preview-strip div {
  padding: 14px 16px;
  color: white;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.preview-strip span,
.preview-strip small {
  display: block;
}

.preview-strip span {
  font-size: 24px;
  font-weight: 800;
}

.preview-strip small {
  margin-top: 2px;
  color: #b8c9cf;
}

.result-shell {
  width: min(1040px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.review-shell {
  width: min(1920px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 16px 0 24px;
}

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

.review-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.review-stats span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(620px, 720px);
  gap: 14px;
  align-items: start;
}

.drawing-stage,
.unit-sidebar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 20px 46px rgba(8, 47, 73, 0.10);
}

.drawing-stage {
  min-height: calc(100vh - 110px);
  overflow: hidden;
}

.stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.stage-title {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.stage-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.tool-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 10px;
  background: white;
  color: var(--accent-dark);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.tool-button:hover,
.tool-button.is-active {
  border-color: var(--accent);
  background: #e7f4ef;
}

.tool-button.compact-label {
  min-width: 38px;
  padding-inline: 8px;
}

.tool-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.secondary-action.compact {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.drawing-scroll-canvas {
  height: calc(100vh - 164px);
  min-height: 640px;
  overflow: auto;
  background: #f5fbff;
  padding: 14px;
}

.drawing-page {
  width: 100%;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: white;
  box-shadow: 0 10px 24px rgba(8, 47, 73, 0.08);
}

.drawing-page figcaption {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.drawing-page-body {
  position: relative;
}

.drawing-page-image {
  display: block;
  width: 100%;
  height: auto;
}

.unit-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.unit-box {
  position: absolute;
  min-width: 10px;
  min-height: 10px;
  border: 2px solid rgba(14, 165, 233, 0.18);
  background: rgba(14, 165, 233, 0.05);
  opacity: 0;
  pointer-events: auto;
  cursor: pointer;
}

.unit-box.highlight {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  opacity: 0;
  z-index: 4;
}

.unit-box.highlight::after {
  content: attr(data-label);
  position: absolute;
  left: 0;
  top: -28px;
  padding: 4px 7px;
  border-radius: 5px;
  background: #d7372f;
  color: white;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  display: none;
}

.unit-box.detail-highlight {
  border-color: rgba(124, 58, 237, 0.48);
  background: rgba(124, 58, 237, 0.08);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.18);
  opacity: 1;
  z-index: 6;
}

.unit-readable-label {
  position: absolute;
  transform: translate(-1px, -50%);
  border: 0;
  padding: 0 1px;
  background: transparent;
  color: #075985;
  font: inherit;
  font-size: calc(10px * var(--label-scale, 1));
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  opacity: 0;
  pointer-events: none;
  text-shadow:
    -1px -1px 0 rgba(255, 255, 255, 0.88),
    1px -1px 0 rgba(255, 255, 255, 0.88),
    -1px 1px 0 rgba(255, 255, 255, 0.88),
    1px 1px 0 rgba(255, 255, 255, 0.88),
    0 1px 3px rgba(255, 255, 255, 0.95);
  white-space: nowrap;
  z-index: 2;
}

.show-readable-labels .unit-readable-label,
.unit-readable-label.highlight {
  opacity: 0.82;
  pointer-events: auto;
}

.unit-readable-label.highlight {
  color: #d7372f;
  font-weight: 900;
  text-shadow:
    -1px -1px 0 rgba(255, 255, 255, 0.94),
    1px -1px 0 rgba(255, 255, 255, 0.94),
    -1px 1px 0 rgba(255, 255, 255, 0.94),
    1px 1px 0 rgba(255, 255, 255, 0.94),
    0 1px 4px rgba(255, 255, 255, 0.98);
  z-index: 5;
}

.unit-readable-label.detail-highlight {
  color: #6d28d9;
  font-weight: 950;
  opacity: 0.94;
  text-shadow:
    -1px -1px 0 rgba(255, 255, 255, 0.96),
    1px -1px 0 rgba(255, 255, 255, 0.96),
    -1px 1px 0 rgba(255, 255, 255, 0.96),
    1px 1px 0 rgba(255, 255, 255, 0.96),
    0 2px 5px rgba(237, 233, 254, 0.98);
  z-index: 7;
}

.show-readable-labels .candidate-readable-label {
  opacity: 0;
  pointer-events: none;
}

.candidate-readable-label.highlight {
  opacity: 0.82;
  pointer-events: auto;
}

.report-action.is-loading {
  cursor: wait;
  opacity: 0.78;
}

.review-react-shell {
  --panel-glow: rgba(14, 165, 233, 0.14);
}

.review-react-topbar {
  padding-inline: 18px;
}

.review-react-sidebar {
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 251, 255, 0.96));
  box-shadow: 0 24px 70px rgba(8, 47, 73, 0.12);
}

.review-search-block {
  background:
    linear-gradient(135deg, #ffffff, #eef9ff);
}

.review-table-wrap {
  background:
    linear-gradient(180deg, rgba(240, 249, 255, 0.72), rgba(255, 255, 255, 0.9));
}

.react-table-panels {
  gap: 14px;
  padding: 14px;
}

.react-unit-panel {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 18px 44px rgba(8, 47, 73, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.react-panel-head {
  padding: 16px 16px 12px;
  background:
    linear-gradient(135deg, rgba(240, 249, 255, 0.92), rgba(255, 255, 255, 0.96));
}

.react-panel-head strong {
  color: #16435d;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.react-panel-head span {
  color: #607587;
  font-size: 13px;
}

.react-switch {
  padding: 0 16px 14px;
}

.react-switch span {
  min-height: 38px;
  border-radius: 13px;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.react-switch input:checked + span {
  background: linear-gradient(180deg, #dff3ff, #eef9ff);
  box-shadow: 0 10px 24px rgba(14, 165, 233, 0.16);
}

.variant-grouping-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  align-self: start;
  gap: 8px;
  padding: 7px 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(240, 249, 255, 0.82), rgba(255, 255, 255, 0.92));
}

.variant-grouping-card > div:first-child {
  display: grid;
  gap: 2px;
}

.variant-grouping-card strong {
  color: #16435d;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.variant-grouping-card span {
  color: #607587;
  font-size: 10px;
}

.variant-grouping-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  width: min(245px, 100%);
}

.variant-grouping-actions form {
  min-width: 0;
}

.variant-group-button {
  width: 100%;
  min-height: 34px;
  display: grid;
  align-content: center;
  gap: 0;
  padding: 5px 7px;
  border: 1px solid rgba(186, 215, 235, 0.95);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.94);
  color: #0b5f91;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.variant-group-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(14, 165, 233, 0.6);
  box-shadow: 0 10px 24px rgba(14, 165, 233, 0.13);
}

.variant-group-button.active {
  border-color: rgba(14, 165, 233, 0.72);
  background: linear-gradient(180deg, #dff3ff, #f5fbff);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
  cursor: default;
}

.variant-group-button strong {
  color: inherit;
  font-size: 11px;
  text-transform: none;
}

.variant-group-button small {
  color: #607587;
  font-size: 8.5px;
  line-height: 1.25;
}

.variant-detail-toggle {
  margin-left: 6px;
  padding: 2px 6px;
  border: 1px solid rgba(125, 184, 221, 0.55);
  border-radius: 999px;
  background: rgba(240, 249, 255, 0.9);
  color: #0b6da4;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.4;
  cursor: pointer;
}

.variant-detail-toggle:hover {
  border-color: rgba(14, 165, 233, 0.7);
  background: #e5f6ff;
}

.react-data-table tbody tr.variant-detail-row {
  background: transparent;
  box-shadow: none;
}

.react-data-table tbody tr.variant-detail-row:hover {
  background: transparent;
  transform: none;
  box-shadow: none;
}

.variant-detail-row td {
  padding-top: 0;
  border: 0;
}

.variant-detail-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 0 8px;
}

.variant-detail-list button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border: 1px solid rgba(186, 215, 235, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #183d55;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.variant-detail-list button:hover {
  transform: translateY(-1px);
  border-color: rgba(14, 165, 233, 0.65);
  background: #f0f9ff;
}

.variant-detail-list b {
  min-width: 18px;
  min-height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #dff3ff;
  color: #0b6da4;
  font-size: 10px;
}

.react-data-table {
  border-collapse: separate;
  border-spacing: 0 8px;
  padding: 0 10px;
}

.react-data-table thead th {
  padding: 9px 10px;
  border: 0;
  color: #5d7181;
  font-size: 11px;
}

.react-data-table tbody tr {
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 7px 18px rgba(8, 47, 73, 0.055);
  transform: translateY(0);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.react-data-table tbody tr:hover {
  background: #f3fbff;
  box-shadow: 0 14px 28px rgba(8, 47, 73, 0.095);
  transform: translateY(-1px);
}

.react-data-table tbody tr.active {
  background: linear-gradient(90deg, #e8f7ff, #ffffff);
  box-shadow:
    0 16px 34px rgba(14, 165, 233, 0.16),
    inset 3px 0 0 #38bdf8;
}

.react-data-table td {
  border-top: 1px solid rgba(216, 233, 243, 0.72);
  border-bottom: 1px solid rgba(216, 233, 243, 0.72);
  padding: 11px 10px;
  vertical-align: middle;
}

.react-data-table td:first-child {
  border-left: 1px solid rgba(216, 233, 243, 0.72);
  border-radius: 14px 0 0 14px;
}

.react-data-table td:last-child {
  border-right: 1px solid rgba(216, 233, 243, 0.72);
  border-radius: 0 14px 14px 0;
}

.unit-name-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(224, 242, 254, 0.72);
  color: #0f3f5b;
  font-weight: 850;
}

.unit-name-pill.possible {
  background: rgba(238, 247, 255, 0.92);
  color: #446174;
}

.react-data-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: 6px;
}

.react-data-table .row-move-button {
  color: #7dbce0;
  transition:
    transform 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.react-data-table .row-move-button:hover {
  transform: translateX(2px);
  background: #dcf3ff;
  color: #0284c7;
}

.react-data-table .move-left:hover {
  transform: translateX(-2px);
}

.react-export-actions {
  background:
    linear-gradient(180deg, #f5fbff, #ffffff);
}

.react-dialog {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 28px 90px rgba(8, 47, 73, 0.28);
}


.unit-sidebar {
  position: sticky;
  top: 14px;
  display: grid;
  grid-template-rows: auto auto minmax(280px, 1fr) auto;
  max-height: calc(100vh - 36px);
  overflow: hidden;
}

.search-block {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.search-block label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

input[type="search"] {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  color: var(--ink);
  background: white;
  font: inherit;
}

.unit-table-wrap {
  min-height: 0;
  overflow: auto;
}

.table-panels {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 10px;
  min-width: 620px;
  padding: 10px;
}

.table-panel,
.candidate-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.result-panel-compact {
  display: flex;
  flex-direction: column;
}

.unit-table {
  margin: 0;
  width: 100%;
  border-collapse: collapse;
}

.unit-table th,
.unit-table td {
  padding: 8px 8px;
  font-size: 12px;
}

.unit-table th:first-child,
.unit-table td:first-child {
  width: 30px;
  text-align: center;
}

.unit-table input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

.unit-table .unit-action-col {
  width: 34px;
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
}

.row-move-button {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #7fb9d7;
  cursor: pointer;
  font-size: 17px;
  font-weight: 850;
  line-height: 1;
}

.row-move-button:hover {
  background: #eaf7ff;
  color: var(--accent-strong);
}

.unit-table tbody tr {
  cursor: pointer;
}

.unit-table tbody tr:hover,
.unit-table tbody tr.active {
  background: #eaf7ff;
}

.unit-table tr.is-mismatch .diff-cell {
  color: var(--alert);
  font-weight: 800;
}

.floor-table th:first-child,
.floor-table td:first-child {
  width: auto;
  min-width: 82px;
  text-align: left;
}

.candidate-panel {
  background: #f8fcff;
}

.candidate-head {
  display: grid;
  gap: 3px;
  padding: 12px 10px 8px;
}

.candidate-head strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.candidate-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.table-view-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 10px 10px;
}

.table-view-switch label {
  cursor: pointer;
}

.table-view-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.table-view-switch span {
  display: grid;
  place-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 850;
}

.table-view-switch input:checked + span {
  border-color: rgba(14, 165, 233, 0.58);
  background: var(--accent-soft);
}

.candidate-table {
  margin-top: 0;
}

.candidate-empty {
  padding: 14px 10px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
}

.candidate-table th:first-child,
.candidate-table td:first-child {
  width: 34px;
  text-align: center;
}

.candidate-table th:nth-child(2),
.candidate-table td:nth-child(2) {
  width: 30px;
  text-align: center;
}

.move-to-possible,
.include-candidates {
  width: calc(100% - 20px);
  min-height: 38px;
  height: 38px;
  margin: 8px 10px 12px;
  padding: 7px 10px;
  font-size: 13px;
}

.move-to-possible:disabled,
.include-candidates:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.export-actions {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.export-actions .primary-action {
  grid-column: 1 / -1;
  min-height: 44px;
  height: 44px;
  font-size: 14px;
}

.export-actions .regenerate-action {
  width: 100%;
}

.export-actions .secondary-action {
  min-height: 40px;
  height: 40px;
  padding: 8px 10px;
  font-size: 13px;
}

.regenerate-form {
  grid-column: 1 / -1;
}

.action-menu-button {
  width: 100%;
}

.action-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(23, 32, 27, 0.26);
}

.action-dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 31;
  width: min(360px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 24px 70px rgba(8, 47, 73, 0.24);
}

.action-dialog[hidden],
.action-dialog-backdrop[hidden] {
  display: none;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.dialog-head strong {
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 800;
}

.dialog-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.dialog-options {
  display: grid;
  padding: 8px;
}

.dialog-options a {
  padding: 12px;
  border-radius: 7px;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 800;
}

.dialog-options a:hover {
  background: #eaf7ff;
}

.redetect-panel {
  padding: 0 12px 12px;
}

.redetect-panel .primary-action {
  width: 100%;
  min-height: 42px;
  height: 42px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--accent);
  font-weight: 800;
}

.result-hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 22px;
  margin-bottom: 18px;
  padding: 24px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
}

.result-hero.error {
  background: var(--alert);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 8px;
}

.stats div {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
}

.stats span,
.stats label {
  display: block;
  overflow-wrap: anywhere;
}

.stats span {
  font-weight: 800;
  font-size: 20px;
}

.stats label {
  margin-top: 4px;
  color: #cbd8d1;
  font-size: 12px;
}

.result-panel {
  margin-bottom: 16px;
  padding: 20px;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.download {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--accent-dark);
  font-weight: 700;
  overflow-wrap: anywhere;
}

table {
  width: 100%;
  margin-top: 14px;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.quiet {
  color: var(--muted);
}

.error-detail {
  white-space: pre-wrap;
  padding: 16px;
  border-radius: 8px;
  background: #2b1110;
  color: #ffe8e5;
  overflow-x: auto;
}

@media (max-width: 860px) {
  .workspace,
  .home-workspace,
  .hero-grid,
  .time-savings-section,
  .info-section,
  .capability-section,
  .review-layout,
  .result-hero {
    grid-template-columns: 1fr;
    display: grid;
  }

  .saas-hero {
    padding: 34px 26px 40px;
  }

  .hero-upload {
    justify-self: stretch;
    max-width: none;
  }

  .preview-panel {
    min-height: 420px;
  }

  .preview-panel img {
    height: 330px;
  }

  h1 {
    font-size: 42px;
  }

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

  .benefit-strip,
  .preview-grid,
  .metric-strip,
  .hero-preview-stats {
    grid-template-columns: 1fr 1fr;
  }

  .time-bar-row {
    grid-template-columns: minmax(150px, 0.7fr) 52px minmax(160px, 1fr);
  }

  .hero-product-preview {
    margin-top: 28px;
  }

  .metric-strip div:nth-child(2) {
    border-right: 0;
  }

  .metric-strip div:last-child {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }

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

  .unit-sidebar {
    position: static;
    max-height: none;
  }

  .drawing-scroll-canvas {
    min-height: 420px;
    height: 62vh;
  }
}

@media (max-width: 520px) {
  .app-shell,
  .result-shell {
    width: min(100vw - 20px, 1180px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
  }

  .topbar nav {
    width: 100%;
    flex-wrap: wrap;
  }

  .topbar nav a {
    padding: 8px 10px;
  }

  .auth-widget,
  .auth-user {
    width: 100%;
    max-width: none;
    justify-content: flex-start;
  }

  .upload-panel {
    padding: 18px;
  }

  .saas-hero {
    padding: 28px 18px 32px;
    border-radius: 24px;
  }

  .hero-grid {
    gap: 20px;
  }

  .logo-hero {
    width: 58px;
    height: 58px;
    margin-bottom: 14px;
  }

  .saas-hero h1 {
    font-size: 38px;
    line-height: 1.04;
  }

  .saas-hero .lead {
    margin-top: 12px;
    font-size: 16px;
    line-height: 1.42;
  }

  .hero-actions {
    gap: 8px;
    margin-top: 18px;
  }

  .hero-primary,
  .hero-secondary {
    width: 100%;
  }

  .hero-product-preview {
    border-radius: 18px;
  }

  .safe-preview-body {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .safe-plan {
    min-height: 250px;
  }

  .safe-plan-grid {
    inset: 34px 28px 44px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .safe-table {
    grid-template-columns: 1fr;
  }

  .feature-row {
    display: none;
  }

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

  .benefit-strip,
  .time-savings-section,
  .preview-grid,
  .metric-strip,
  .hero-preview-stats,
  .feedback-section,
  .capability-section {
    grid-template-columns: 1fr;
  }

  .time-savings-section {
    padding: 20px;
  }

  .time-chart-head,
  .time-chart-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .time-bar-row {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .time-bar-row b {
    text-align: left;
  }

  .capability-section {
    padding: 20px;
  }

  .capability-list {
    position: static;
    width: 100%;
    margin-top: -12px;
  }

  .capability-dashboard {
    grid-template-columns: 1fr;
  }

  .capability-list span {
    justify-self: stretch;
    text-align: center;
  }

  .metric-strip div,
  .metric-strip div:nth-child(2),
  .metric-strip div:last-child {
    grid-column: auto;
    border-right: 0;
    border-top: 1px solid var(--line);
  }

  .metric-strip div:first-child {
    border-top: 0;
  }

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

/* ---- Drawing vs. schedule matrix ------------------------------------------------ */

.matrix-panels {
  grid-template-columns: minmax(0, 1fr);
}

.matrix-panel {
  display: flex;
  flex-direction: column;
}

.matrix-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px 8px;
}

.matrix-building-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.matrix-building-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.matrix-building-tabs button.is-active {
  border-color: rgba(14, 165, 233, 0.58);
  background: var(--accent-soft);
}

.matrix-building-tabs b {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 9px;
  background: var(--alert);
  color: #fff;
  font-size: 11px;
  text-align: center;
}

.matrix-only-diffs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.matrix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 10px 8px;
}

.matrix-chip {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.matrix-scroll {
  overflow: auto;
  border-top: 1px solid var(--line);
}

.matrix-table th,
.matrix-table td {
  padding: 6px 6px;
  text-align: center;
  white-space: nowrap;
  border-bottom: 1px solid #eef5fa;
}

.matrix-table th:first-child,
.matrix-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  width: auto;
  min-width: 86px;
  background: #fff;
  text-align: left;
}

.matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f4fbff;
  color: var(--muted);
  font-weight: 850;
}

.matrix-table thead th:first-child {
  z-index: 3;
}

.matrix-cell {
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.matrix-empty {
  color: #c9d8e2;
}

.matrix-total {
  color: var(--muted);
  font-weight: 800;
}

.matrix-total.is-off {
  color: var(--alert);
}

.status-over,
.matrix-chip.status-over {
  background: #fde0d6;
  color: #9a2a12;
  font-weight: 850;
}

.status-under,
.matrix-chip.status-under {
  background: #fff1c2;
  color: #7a5200;
  font-weight: 850;
}

.status-extra_type,
.matrix-chip.status-extra_type {
  background: #dbeafe;
  color: #1e40af;
  font-weight: 850;
}

.status-missing_type,
.matrix-chip.status-missing_type {
  background: #f1dcfb;
  color: #6b21a8;
  font-weight: 850;
}

.matrix-table tr.status-extra_type td:first-child,
.matrix-table tr.status-missing_type td:first-child {
  background: inherit;
}

.matrix-notes,
.analysis-warnings ul,
.matrix-checks ul {
  margin: 0;
  padding: 0 12px 8px 26px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.matrix-notes li,
.analysis-warnings li,
.matrix-checks li {
  margin-bottom: 4px;
}

.analysis-warnings {
  margin: 10px 10px 0;
  border: 1px solid #f3d9a4;
  border-radius: 8px;
  background: #fffaf0;
}

.matrix-checks {
  border-top: 1px solid var(--line);
}

.analysis-warnings-toggle {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: #7a5200;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.matrix-checks .analysis-warnings-toggle {
  color: var(--alert);
}

/* ==== Review workspace v2 (2026-11 redesign) ========================================
   Drawing-first: highlighter-yellow unit labels, blue selection, IBM Plex type.
   Scoped to the review shell so the upload page keeps its own styles. */

.review-react-shell {
  --v2-ink: #1C2733;
  --v2-muted: #5B6B7A;
  --v2-line: #D5DBE1;
  --v2-line-soft: #E6EAEE;
  --v2-ground: #F4F6F8;
  --v2-sheet-bg: #E9EDF1;
  --v2-blue: #1D5BD8;
  --v2-blue-dark: #123E99;
  --v2-blue-soft: #EAF1FF;
  --v2-marker: #FFD233;
  min-height: 100vh;
  padding: 0;
  background: var(--v2-ground);
  color: var(--v2-ink);
  font-family: "IBM Plex Sans", Inter, system-ui, sans-serif;
}

.review-react-shell .review-topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 10px 20px;
  background: #fff;
  border-bottom: 1px solid var(--v2-line);
}

.review-react-shell .v2-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--v2-ink);
}

.review-react-shell .v2-file {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.review-react-shell .v2-file strong {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-react-shell .v2-file small {
  color: var(--v2-muted);
  font-size: 12px;
}

.review-react-shell .v2-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-react-shell .v2-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #C3CBD3;
  border-radius: 8px;
  background: #fff;
  color: var(--v2-ink);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.review-react-shell .v2-button.v2-primary {
  border-color: var(--v2-blue);
  background: var(--v2-blue);
  color: #fff;
  font-weight: 600;
}

.review-react-shell .v2-button:focus-visible,
.review-react-shell .v2-tool-rail button:focus-visible,
.review-react-shell .v2-stage-toolbar button:focus-visible,
.review-react-shell .v2-location-list button:focus-visible {
  outline: 2px solid var(--v2-blue);
  outline-offset: 2px;
}

.review-react-shell .v2-layout {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) minmax(360px, 440px);
  gap: 0;
  align-items: stretch;
}

.review-react-shell .v2-tool-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 0;
  background: #fff;
  border-right: 1px solid var(--v2-line);
}

.review-react-shell .v2-tool-rail button {
  width: 64px;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--v2-ink);
  font: inherit;
  cursor: pointer;
}

.review-react-shell .v2-tool-rail button span {
  font-size: 11px;
  font-weight: 600;
}

.review-react-shell .v2-tool-rail button small {
  font-size: 10px;
  color: var(--v2-muted);
}

.review-react-shell .v2-tool-rail button.is-active {
  background: var(--v2-blue-soft);
  color: var(--v2-blue);
}

.review-react-shell .v2-tool-rail button:disabled {
  cursor: default;
  opacity: 0.55;
}

.review-react-shell .drawing-stage,
.review-react-shell .unit-sidebar {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
}

.review-react-shell .unit-sidebar {
  border-left: 1px solid var(--v2-line);
  max-height: calc(100vh - 62px);
}

.review-react-shell .v2-stage-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--v2-line);
  font-size: 13px;
}

.review-react-shell .v2-page-jump,
.review-react-shell .v2-label-size {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--v2-muted);
}

.review-react-shell .v2-page-jump select {
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid #C3CBD3;
  border-radius: 6px;
  background: #fff;
  color: var(--v2-ink);
  font: inherit;
  font-size: 13px;
}

.review-react-shell .v2-label-size button,
.review-react-shell .v2-zoom button {
  min-width: 36px;
  height: 36px;
  border: 1px solid #C3CBD3;
  border-radius: 6px;
  background: #fff;
  color: var(--v2-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.review-react-shell .v2-label-size button:disabled {
  opacity: 0.45;
  cursor: default;
}

.review-react-shell .v2-label-size output {
  min-width: 44px;
  text-align: center;
  color: var(--v2-ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.review-react-shell .v2-toggle {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #C3CBD3;
  border-radius: 6px;
  background: #fff;
  color: var(--v2-ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.review-react-shell .v2-toggle.is-on {
  border-color: var(--v2-blue);
  background: var(--v2-blue-soft);
  color: var(--v2-blue-dark);
}

.review-react-shell .v2-zoom {
  display: flex;
  gap: 4px;
}

.review-react-shell .v2-zoom button.is-active {
  border-color: var(--v2-blue);
  background: var(--v2-blue-soft);
}

.review-react-shell .v2-link {
  margin-left: auto;
  color: var(--v2-blue);
  font-weight: 600;
}

.review-react-shell .drawing-scroll-canvas {
  height: calc(100vh - 124px);
  background: var(--v2-sheet-bg);
  padding: 20px 24px 40px;
}

.review-react-shell .drawing-page {
  margin: 0 auto 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.review-react-shell .drawing-page figcaption {
  position: static;
  display: flex;
  justify-content: space-between;
  padding: 0 0 6px;
  border: 0;
  background: transparent;
  color: var(--v2-muted);
  font-size: 12px;
  font-weight: 400;
}

.review-react-shell .drawing-page figcaption strong {
  color: var(--v2-ink);
  font-weight: 600;
}

.review-react-shell .drawing-page-body {
  background: #fff;
  box-shadow: 0 1px 3px rgba(28, 39, 51, 0.18);
}

.review-react-shell .drawing-page-image {
  transition: opacity 160ms ease;
}

.review-react-shell .drawing-scroll-canvas.is-faded .drawing-page-image {
  opacity: 0.42;
}

.review-react-shell .unit-readable-label {
  transform: translate(-2px, -50%);
  padding: 0 2px;
  border-radius: 2px;
  background: transparent;
  color: #0B6FC2;
  font-family: "IBM Plex Sans", Inter, system-ui, sans-serif;
  font-size: calc(10px * var(--label-scale, 1));
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
  text-shadow:
    -1px -1px 0 #fff,
    1px -1px 0 #fff,
    -1px 1px 0 #fff,
    1px 1px 0 #fff,
    0 0 3px #fff;
}

.review-react-shell.show-readable-labels .unit-readable-label,
.show-readable-labels .review-react-shell .unit-readable-label,
.review-react-shell .unit-readable-label.highlight {
  opacity: 1;
}

.review-react-shell .unit-readable-label.highlight {
  background: var(--v2-blue);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(29, 91, 216, 0.22);
  text-shadow: none;
}

.review-react-shell .unit-readable-label.detail-highlight {
  background: #6D28D9;
  color: #fff;
  text-shadow: none;
}

.review-react-shell .candidate-readable-label.highlight {
  background: #FFF1C2;
  outline: 1px dashed #B54708;
}

.review-react-shell .search-block {
  padding: 14px 16px 10px;
  background: #fff;
}

.review-react-shell .search-block label {
  color: var(--v2-muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
}

.review-react-shell .review-table-wrap {
  background: #fff;
}

.review-react-shell .react-table-panels,
.review-react-shell .table-panels {
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 12px;
  padding: 12px;
}

.review-react-shell .react-unit-panel {
  border: 1px solid var(--v2-line-soft);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

.review-react-shell .react-panel-head {
  padding: 12px 14px 8px;
  background: #fff;
}

.review-react-shell .react-panel-head strong {
  color: var(--v2-ink);
  font-size: 16px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.review-react-shell .react-panel-head span {
  color: var(--v2-muted);
  font-size: 12px;
}

.review-react-shell .react-switch span,
.review-react-shell .table-view-switch span {
  min-height: 32px;
  border-radius: 6px;
  border-color: var(--v2-line);
  color: var(--v2-muted);
  font-weight: 600;
}

.review-react-shell .table-view-switch input:checked + span {
  border-color: var(--v2-blue);
  background: var(--v2-blue-soft);
  color: var(--v2-blue-dark);
}

.review-react-shell .unit-table th {
  color: var(--v2-muted);
  font-weight: 600;
}

.review-react-shell .unit-table tbody tr.active,
.review-react-shell .unit-table tbody tr:hover {
  background: var(--v2-blue-soft);
}

.review-react-shell .unit-name-pill {
  padding: 2px 6px;
  border-radius: 4px;
  background: #E6F1FC;
  color: #0B5A9E;
  font-family: "IBM Plex Sans", Inter, system-ui, sans-serif;
  font-weight: 600;
}

.review-react-shell .unit-table tr.active .unit-name-pill {
  background: var(--v2-blue);
  color: #fff;
}

.review-react-shell .unit-name-pill.possible {
  background: #F1F3F5;
  outline: 1px dashed #98A2B3;
}

.review-react-shell .v2-location-row td {
  padding-top: 0;
  background: #F7F9FB;
}

.review-react-shell .v2-location-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0 8px;
}

.review-react-shell .v2-location-list button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--v2-ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.review-react-shell .v2-location-list button span:last-child {
  color: var(--v2-muted);
}

.review-react-shell .v2-location-list button:hover {
  background: #DCE7FF;
}

.review-react-shell .primary-action,
.review-react-shell .regenerate-action {
  background: var(--v2-blue);
  border-color: var(--v2-blue);
  box-shadow: none;
}

@media (max-width: 1100px) {
  .review-react-shell .v2-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .review-react-shell .v2-tool-rail {
    flex-direction: row;
    justify-content: flex-start;
    padding: 6px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--v2-line);
    overflow-x: auto;
  }

  .review-react-shell .unit-sidebar {
    max-height: none;
    border-left: 0;
    border-top: 1px solid var(--v2-line);
  }
}

@media (prefers-reduced-motion: reduce) {
  .review-react-shell .drawing-page-image {
    transition: none;
  }
}

.review-react-shell .v2-disclosure {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-right: 2px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--v2-muted);
  cursor: pointer;
  vertical-align: middle;
}

.review-react-shell .v2-disclosure svg {
  transition: transform 150ms ease;
}

.review-react-shell .v2-disclosure.is-open svg {
  transform: rotate(180deg);
}

.review-react-shell .v2-disclosure:hover {
  background: #DCE7FF;
  color: var(--v2-blue-dark);
}

.review-react-shell .unit-table .unit-action-col {
  width: 72px;
  white-space: nowrap;
}

.review-react-shell .v2-location-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 10px 6px;
  color: var(--v2-muted);
  font-size: 12px;
}

.review-react-shell .v2-location-head .v2-hide {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 0 8px 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--v2-blue);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.review-react-shell .v2-location-head .v2-hide:hover {
  background: #DCE7FF;
  color: var(--v2-blue-dark);
}

.review-react-shell .v2-location-head .v2-hide:focus-visible {
  outline: 2px solid var(--v2-blue);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .review-react-shell .v2-disclosure svg {
    transition: none;
  }
}

/* ==== Home / upload v2 ============================================================ */

.home-v2 {
  --v2-ink: #1C2733;
  --v2-muted: #5B6B7A;
  --v2-line: #D5DBE1;
  --v2-blue: #1D5BD8;
  --v2-blue-dark: #123E99;
  --v2-blue-soft: #EAF1FF;
  min-height: 100vh;
  background: #F4F6F8;
  color: var(--v2-ink);
  font-family: "IBM Plex Sans", Inter, system-ui, sans-serif;
}

.hv2-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 32px;
  background: #fff;
  border-bottom: 1px solid var(--v2-line);
}

.hv2-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--v2-ink);
  font-size: 17px;
  font-weight: 700;
}

.hv2-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  font-size: 14px;
}

.hv2-nav > a {
  color: var(--v2-muted);
}

.hv2-nav > a:hover {
  color: var(--v2-ink);
}

.home-v2 .auth-status {
  color: var(--v2-muted);
  font-size: 13px;
}

.hv2-main {
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
  padding: 56px 24px 72px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.hv2-intro h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  font-weight: 700;
}

.hv2-intro p {
  margin: 0;
  max-width: 620px;
  color: var(--v2-muted);
  font-size: 17px;
  line-height: 1.55;
}

.hv2-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--v2-line);
  border-radius: 12px;
}

.home-v2 .auth-gate {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #FFF8E6;
  color: #7A4B00;
  font-size: 14px;
}

.home-v2 .auth-gate[hidden] {
  display: none;
}

.hv2-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 16px;
  border: 2px dashed #C3CBD3;
  border-radius: 10px;
  background: #FAFBFC;
  text-align: center;
  cursor: pointer;
}

.hv2-drop:hover,
.hv2-drop:focus-within {
  border-color: var(--v2-blue);
  background: #F5F8FF;
}

.hv2-drop.has-file {
  border-style: solid;
  border-color: var(--v2-blue);
  background: #F5F8FF;
}

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

.hv2-drop strong {
  font-size: 16px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.hv2-drop small {
  color: var(--v2-muted);
  font-size: 13px;
}

.hv2-more {
  border-top: 1px solid #E6EAEE;
  padding-top: 14px;
}

.hv2-more summary {
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
}

.hv2-more summary span {
  color: var(--v2-muted);
  font-weight: 400;
}

.hv2-more > p {
  margin: 8px 0 12px;
  color: var(--v2-muted);
  font-size: 14px;
}

.hv2-more .hv2-drop {
  padding: 24px 16px;
}

.hv2-choice {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  border: 0;
}

.hv2-choice legend {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}

.hv2-choice label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--v2-line);
  border-radius: 8px;
  cursor: pointer;
}

.hv2-choice label:has(input:checked) {
  border-color: var(--v2-blue);
  background: #F5F8FF;
}

.hv2-choice input {
  margin-top: 3px;
  accent-color: var(--v2-blue);
}

.hv2-choice span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hv2-choice strong {
  font-size: 14px;
}

.hv2-choice small {
  color: var(--v2-muted);
  font-size: 13px;
}

.hv2-names {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  font-size: 14px;
}

.hv2-names[hidden] {
  display: none;
}

.hv2-names textarea {
  padding: 10px;
  border: 1px solid #C3CBD3;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
}

.hv2-submit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.hv2-primary,
.hv2-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 8px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.hv2-primary {
  border: 0;
  background: var(--v2-blue);
  color: #fff;
}

.hv2-primary:hover {
  background: var(--v2-blue-dark);
}

.hv2-primary:disabled {
  cursor: wait;
  opacity: 0.7;
}

.hv2-secondary {
  border: 1px solid #C3CBD3;
  background: #fff;
  color: var(--v2-ink);
}

.hv2-submit small {
  color: var(--v2-muted);
  font-size: 13px;
}

.hv2-primary:focus-visible,
.hv2-secondary:focus-visible,
.hv2-drop:focus-within,
.hv2-more summary:focus-visible {
  outline: 2px solid var(--v2-blue);
  outline-offset: 2px;
}

.hv2-outcomes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.hv2-outcomes > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hv2-outcomes strong {
  font-size: 15px;
}

.hv2-outcomes span:last-child {
  color: var(--v2-muted);
  font-size: 14px;
  line-height: 1.5;
}

.hv2-sample-label {
  align-self: flex-start;
  color: #0B6FC2;
  font-size: 18px;
  font-weight: 600;
}

.hv2-sample-chip {
  align-self: flex-start;
  padding: 3px 8px;
  border: 1px solid #C3CBD3;
  border-radius: 4px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
}

.hv2-feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--v2-line);
}

.hv2-feedback h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.hv2-feedback p {
  margin: 0;
  color: var(--v2-muted);
  font-size: 14px;
}

/* Loading overlay in the new palette */
.analysis-loading {
  background: #F4F6F8;
  font-family: "IBM Plex Sans", Inter, system-ui, sans-serif;
}

.analysis-loading .loading-mark {
  background: #1C2733;
}

/* Loading overlay v2 */
.analysis-loading .lv2-panel {
  width: min(520px, 100%);
  padding: 32px;
  border: 1px solid #D5DBE1;
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
  color: #1C2733;
}

.lv2-panel h1 {
  margin: 20px 0 8px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.lv2-panel p {
  margin: 0;
  color: #5B6B7A;
  font-size: 15px;
  line-height: 1.55;
}

.lv2-panel .loading-bar {
  height: 4px;
  background: #E3E8ED;
}

.lv2-panel .loading-bar span {
  background: #1D5BD8;
}

@media (prefers-reduced-motion: reduce) {
  .lv2-panel .loading-bar span {
    width: 100%;
    animation: none;
    opacity: 0.6;
  }
}

/* Sample picker v2 */
.sv2-meta {
  margin-top: 10px !important;
  font-size: 14px !important;
}

.sv2-form {
  padding: 0;
  overflow: hidden;
}

.sv2-table-wrap {
  max-height: min(56vh, 560px);
  overflow: auto;
}

.sv2-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.sv2-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 20px;
  background: #F7F9FA;
  border-bottom: 1px solid var(--v2-line);
  color: var(--v2-muted);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.sv2-table td {
  padding: 0 20px;
  border-bottom: 1px solid #EBEEF1;
  color: var(--v2-muted);
}

.sv2-table tbody tr:hover {
  background: #F7F9FA;
}

.sv2-table tbody tr:has(input:checked) {
  background: var(--v2-blue-soft);
}

.sv2-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  cursor: pointer;
}

.sv2-pick input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--v2-blue);
}

.sv2-name {
  color: #0B5A9E;
  font-weight: 600;
}

.sv2-num {
  width: 90px;
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}

.sv2-pages {
  width: 34%;
  font-size: 14px;
}

.sv2-empty {
  padding: 24px 20px !important;
}

.sv2-form .hv2-submit {
  padding: 18px 20px;
  border-top: 1px solid var(--v2-line);
  background: #fff;
}

.sv2-form .hv2-primary:disabled {
  cursor: not-allowed;
  background: #A9B8CC;
  opacity: 1;
}

/* Error page v2 */
.ev2-card h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
}

.ev2-card > p {
  margin: 0;
  color: var(--v2-muted);
  line-height: 1.55;
}

.ev2-card a.hv2-primary,
.ev2-card a.hv2-secondary {
  text-decoration: none;
}

.ev2-detail {
  max-height: 320px;
  overflow: auto;
  margin: 10px 0 0;
  padding: 14px;
  border-radius: 8px;
  background: #F4F6F8;
  font-size: 12px;
  white-space: pre-wrap;
}

.sv2-table { margin: 0; }
.sv2-table th { text-transform: none; letter-spacing: 0; }
.sv2-form { gap: 0; }

/* Unit matrix editor (drawing + matrix) */
.review-react-shell .v2-layout.is-matrix-mode {
  grid-template-columns: 76px minmax(0, 1fr) minmax(0, 1fr);
}

.v2-matrix-pane {
  position: sticky;
  top: 62px;
  height: calc(100vh - 62px);
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
  border-left: 1px solid var(--v2-line);
  color: var(--v2-ink);
  font-family: "IBM Plex Sans", Inter, system-ui, sans-serif;
  font-size: 13px;
}

.mx-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--v2-line);
}

.mx-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.mx-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 8px;
  background: #EEF1F4;
}

.mx-tabs button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--v2-muted);
  font: inherit;
  cursor: pointer;
}

.mx-tabs button.is-active {
  background: #fff;
  color: var(--v2-ink);
  font-weight: 600;
}

.mx-head-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.mx-ghost {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #C3CBD3;
  border-radius: 6px;
  background: #fff;
  color: var(--v2-ink);
  font: inherit;
  cursor: pointer;
}

.mx-cellbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 16px;
  box-sizing: border-box;
  background: #F7F9FB;
  border-bottom: 1px solid #E3E8ED;
}

.mx-cellbar strong {
  font-size: 14px;
}

.mx-muted {
  color: var(--v2-muted);
}

.mx-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.mx-stepper > button:not(.mx-link) {
  width: 34px;
  height: 34px;
  border: 1px solid #C3CBD3;
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}

.mx-stepper input {
  width: 56px;
  height: 34px;
  box-sizing: border-box;
  border: 1px solid var(--v2-blue);
  border-radius: 6px;
  text-align: center;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.mx-link {
  border: 0;
  background: transparent;
  color: var(--v2-blue);
  font: inherit;
  cursor: pointer;
  padding: 0 4px;
}

.mx-link:hover {
  color: var(--v2-blue-dark);
  text-decoration: underline;
}

.mx-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.mx-empty {
  margin: 0;
  padding: 24px 16px;
  color: var(--v2-muted);
}

.mx-table {
  min-width: max-content;
  font-variant-numeric: tabular-nums;
}

.mx-row {
  display: grid;
  position: relative;
}

.mx-header {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #fff;
  border-bottom: 1px solid var(--v2-line);
  font-weight: 600;
}

.mx-rowhead {
  position: sticky;
  left: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 36px;
  padding: 0 4px 0 12px;
  background: inherit;
}

.mx-header .mx-rowhead {
  color: var(--v2-muted);
}

.mx-rowhead.is-menu-open {
  z-index: 6;
}

.mx-floorhead {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 2px;
}

.mx-floorhead.is-in-view {
  background: #E4EDFF;
  color: var(--v2-blue);
}

.mx-remove-floor {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #A3260F;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
}

.mx-floorhead:hover .mx-remove-floor,
.mx-remove-floor:focus-visible {
  opacity: 1;
}

.mx-total {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 12px;
  font-weight: 600;
}

.mx-num {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mx-category {
  position: sticky;
  left: 0;
  width: max-content;
  padding: 14px 12px 6px;
  font-weight: 600;
}

.mx-unit {
  background: #fff;
  border-bottom: 1px solid #EEF1F4;
}

.mx-name {
  color: #0B5A9E;
  font-weight: 600;
}

.mx-menu-button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--v2-muted);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}

.mx-menu-button:hover,
.mx-menu-button[aria-expanded="true"] {
  background: var(--v2-blue-soft);
}

.mx-menu {
  position: absolute;
  left: 40px;
  top: 34px;
  z-index: 8;
  width: 220px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #fff;
  border: 1px solid #C3CBD3;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(28, 39, 51, 0.16);
  font-weight: 400;
}

.mx-menu label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--v2-muted);
}

.mx-menu input,
.mx-menu select {
  height: 32px;
  box-sizing: border-box;
  border: 1px solid #C3CBD3;
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
  color: var(--v2-ink);
  font: inherit;
  font-size: 13px;
}

.mx-menu > button {
  min-height: 34px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--v2-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.mx-menu > button:hover {
  background: #F1F4F7;
}

.mx-menu > button.is-danger {
  color: #A3260F;
}

.mx-cell {
  display: flex;
}

.mx-cell.is-in-view {
  background: #F1F6FF;
}

.mx-cell button {
  flex: 1;
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--v2-ink);
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.mx-cell button:hover {
  background: var(--v2-blue-soft);
}

.mx-cell button.is-zero {
  color: #AEB8C2;
}

.mx-cell button.is-edited {
  background: #FFE8D6;
  box-shadow: inset 0 -2px 0 #E8590C;
  font-weight: 700;
}

.mx-cell button.is-selected {
  background: var(--v2-blue);
  box-shadow: none;
  color: #fff;
  font-weight: 700;
}

.mx-line-subtotal {
  min-height: 34px;
  background: #F7F9FB;
  color: var(--v2-muted);
}

.mx-line-subtotal .mx-total {
  color: var(--v2-ink);
}

.mx-row.mx-line-total {
  min-height: 42px;
  margin-top: 8px;
  border-top: 2px solid var(--v2-ink);
  background: #fff;
  font-weight: 700;
}

.mx-line-total .mx-num,
.mx-line-total .mx-rowhead {
  font-weight: 700;
}

.mx-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-top: 1px solid var(--v2-line);
  color: var(--v2-muted);
}

.mx-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mx-legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: #FFE8D6;
  border: 1px solid #E8590C;
}

.mx-foot .mx-link:first-of-type {
  margin-left: auto;
}

.v2-matrix-pane button:focus-visible,
.v2-matrix-pane input:focus-visible,
.v2-matrix-pane select:focus-visible {
  outline: 2px solid var(--v2-blue);
  outline-offset: 1px;
}

@media (max-width: 1100px) {
  .review-react-shell .v2-layout.is-matrix-mode {
    grid-template-columns: minmax(0, 1fr);
  }

  .v2-matrix-pane {
    position: static;
    height: 70vh;
    border-left: 0;
    border-top: 1px solid var(--v2-line);
  }
}

/* Sample picker: drawing preview beside the list */
.hv2-main.sv2-main {
  max-width: 1320px;
}

.sv2-split {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr);
  align-items: start;
}

.sv2-split .sv2-table-wrap {
  max-height: min(64vh, 640px);
  border-right: 1px solid var(--v2-line);
}

.sv2-table tbody tr.is-previewing {
  box-shadow: inset 3px 0 0 var(--v2-blue);
}

.sv2-preview {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 16px;
}

.sv2-preview-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.sv2-preview-head strong {
  color: #0B5A9E;
  font-size: 16px;
}

.sv2-preview-head span {
  color: var(--v2-muted);
  font-size: 13px;
}

.sv2-preview-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--v2-line);
  border-radius: 8px;
  background: #fff;
}

.sv2-preview-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.sv2-preview-frame.is-loading::after {
  content: "Loading the drawing";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.82);
  color: var(--v2-muted);
  font-size: 14px;
}

.sv2-preview-boxes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sv2-box {
  position: absolute;
  box-sizing: content-box;
  margin: -3px 0 0 -3px;
  padding: 2px;
  border-radius: 3px;
}

.sv2-box.is-target {
  border: 2px solid var(--v2-blue);
  background: rgba(29, 91, 216, 0.14);
  box-shadow: 0 0 0 4px rgba(29, 91, 216, 0.18);
}

.sv2-box.is-same {
  border: 2px solid rgba(29, 91, 216, 0.7);
}

.sv2-box.is-picked {
  border: 1.5px solid #2E8B57;
  background: rgba(46, 139, 87, 0.1);
}

.sv2-box.is-other {
  border: 1px dashed rgba(91, 107, 122, 0.55);
}

.sv2-preview-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 24px;
  color: var(--v2-muted);
  text-align: center;
  font-size: 14px;
}

.sv2-preview-empty[hidden] {
  display: none;
}

.sv2-preview-foot {
  display: flex;
  gap: 8px;
}

.sv2-preview-foot .hv2-secondary {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.sv2-preview-foot .hv2-secondary:disabled {
  cursor: default;
  opacity: 0.5;
}

@media (max-width: 900px) {
  .sv2-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .sv2-split .sv2-table-wrap {
    border-right: 0;
    border-bottom: 1px solid var(--v2-line);
  }
}

/* Progress page */
.pv2-card h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
}

.pv2-card > p {
  margin: 0;
  color: var(--v2-muted);
  line-height: 1.55;
}

.pv2-card [data-progress-message] {
  color: var(--v2-ink);
  font-size: 16px;
}

.pv2-bar {
  height: 4px;
  background: #E3E8ED;
}

.pv2-bar span {
  background: #1D5BD8;
}

.pv2-card [hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .pv2-bar span {
    width: 100%;
    animation: none;
    opacity: 0.6;
  }
}
