:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --ink: #171713;
  --muted: #6d6b62;
  --line: #dedbd0;
  --gold: #b78221;
  --gold-dark: #6d4a11;
  --blue: #2563eb;
  --cyan: #0ea5e9;
  --green: #137a4b;
  --amber: #a56710;
  --red: #9f2f2f;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid rgba(23, 23, 19, 0.1);
  background: rgba(251, 250, 246, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 820;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: #171713;
  color: #f6c85f;
  font-weight: 860;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: #fbfaf6;
}

.detail-topbar {
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr) auto;
}

.detail-title {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 0.98;
  font-weight: 780;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.1;
}

main {
  width: min(1480px, 100%);
  margin: 0 auto;
}

.landing-hero {
  min-height: clamp(520px, 72vh, 760px);
  display: flex;
  align-items: center;
  padding: 64px clamp(20px, 4vw, 56px);
  background-color: #1d1c17;
  background-size: cover;
  background-position: center;
  color: #fff;
}

.landing-hero .eyebrow {
  color: #f6c85f;
}

.hero-copy {
  width: min(760px, 100%);
}

.hero-copy h1 {
  max-width: 740px;
  font-size: clamp(44px, 7vw, 96px);
  line-height: 0.92;
}

.hero-text {
  max-width: 620px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.42;
}

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

.landing-hero .link-button {
  border-color: rgba(255, 255, 255, 0.72);
  color: #fff;
}

.landing-hero .link-button.primary {
  border-color: #f6c85f;
  background: #f6c85f;
  color: #171713;
}

.site-stats,
.workflow-band,
.sample-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  padding: 1px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.site-stats div,
.workflow-band div,
.sample-steps a {
  min-height: 118px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 22px;
  background: #fbfaf6;
}

.site-stats span,
.workflow-band span,
.sample-steps span {
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.site-stats strong {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
}

.workflow-band strong {
  font-size: 24px;
}

.sample-steps {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sample-steps a {
  color: var(--ink);
  text-decoration: none;
}

.sample-steps strong {
  font-size: 22px;
}

.workflow-band p {
  margin: 0;
  color: var(--muted);
}

.upload-band,
.history,
.metrics,
.image-review,
.result-summary,
.particle-map-section,
.admin-hero,
.admin-grid,
.page-head,
.value-band,
.processing-page {
  padding: 26px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
}

.processing-page {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(23, 23, 19, 0.88), rgba(23, 23, 19, 0.64)),
    url("/storage/hero-paystreak.jpg") center / cover;
}

.processing-card {
  width: min(640px, 100%);
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(251, 250, 246, 0.96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.processing-card h1 {
  margin-bottom: 18px;
}

.processing-card p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.processing-ring {
  width: 54px;
  height: 54px;
  margin-bottom: 22px;
  border: 4px solid rgba(183, 130, 33, 0.18);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  margin: 26px 0 16px;
  border-radius: 999px;
  background: rgba(23, 23, 19, 0.1);
}

.progress-track span {
  display: block;
  width: 44%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-dark), #f6c85f);
  animation: progress-slide 1.8s ease-in-out infinite;
}

.processing-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
  text-transform: uppercase;
}

.processing-note {
  margin: 22px 0;
}

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

@keyframes progress-slide {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(70%);
  }
  100% {
    transform: translateX(230%);
  }
}

.archive-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 24px;
  padding: 48px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, rgba(183, 130, 33, 0.18), transparent 30%),
    linear-gradient(135deg, #161510 0%, #27231c 48%, #f7f3e8 48.5%, #fbfaf6 100%);
  color: var(--ink);
}

.archive-hero h1 {
  max-width: 820px;
}

.archive-hero-copy {
  max-width: 880px;
}

.archive-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.archive-chip,
.archive-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.archive-chip {
  border-color: rgba(23, 23, 19, 0.12);
  background: rgba(255, 255, 255, 0.9);
  font-size: 14px;
}

.archive-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  padding: 1px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.archive-metrics div,
.archive-panel,
.archive-board,
.archive-topic {
  background: var(--white);
}

.archive-metrics div {
  display: grid;
  gap: 8px;
  min-height: 120px;
  padding: 22px;
  align-content: center;
}

.archive-metrics strong {
  font-size: clamp(22px, 3vw, 34px);
}

.archive-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 20px;
  padding: 24px clamp(20px, 4vw, 56px) 44px;
}

.archive-panel {
  border: 1px solid var(--line);
  padding: 24px;
}

.archive-panel h2 {
  margin-bottom: 14px;
}

.archive-board-list {
  display: grid;
  gap: 14px;
}

.archive-board {
  border: 1px solid var(--line);
  padding: 18px;
}

.archive-board h3,
.archive-topic h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

.archive-board ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 0;
  padding-left: 18px;
}

.archive-board li,
.archive-highlights li {
  color: var(--muted);
}

.archive-topic {
  border: 1px solid var(--line);
  padding: 18px;
}

.archive-topic p {
  margin-bottom: 12px;
  color: var(--muted);
}

.archive-highlights {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

.archive-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .archive-grid,
  .archive-metrics,
  .site-stats,
  .workflow-band,
  .sample-steps {
    grid-template-columns: 1fr;
  }

  .archive-board ul {
    grid-template-columns: 1fr;
  }
}

.lab-band {
  background: #fffdf8;
}

.analysis-workflow {
  position: relative;
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(360px, 1.2fr);
  gap: 24px;
}

.setup-panel,
.drop-panel,
.process-panel {
  border: 1px solid var(--line);
  background: var(--white);
  padding: 24px;
}

.setup-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.setup-grid {
  display: grid;
  gap: 14px;
}

.drop-panel {
  display: grid;
  grid-template-rows: auto minmax(280px, 1fr);
  gap: 10px;
}

.dropzone {
  min-height: clamp(300px, 40vw, 520px);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  border: 2px dashed #c7bd9c;
  border-radius: 8px;
  background: #fffaf0;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--gold);
  background: #fff4cf;
  transform: translateY(-1px);
}

.dropzone.has-file {
  border-style: solid;
  border-color: var(--green);
  background: #f0fdf4;
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-icon {
  display: inline-grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 50%;
  background: #171713;
  color: #f6c85f;
  font-size: 42px;
  line-height: 1;
}

.dropzone strong {
  font-size: clamp(24px, 4vw, 44px);
  line-height: 1;
}

.dropzone small {
  color: var(--muted);
  font-size: 15px;
  font-weight: 740;
}

.process-panel {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.process-panel p {
  margin: 8px 0 0;
  color: var(--muted);
}

.processing-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 30px;
  background: rgba(251, 250, 246, 0.88);
  backdrop-filter: blur(10px);
  text-align: center;
}

.processing-overlay.is-active {
  display: grid;
}

.processing-overlay strong {
  font-size: 30px;
}

.processing-overlay p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
}

.spinner {
  width: 58px;
  height: 58px;
  border: 5px solid rgba(183, 130, 33, 0.18);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}

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

.page-head {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(320px, 1fr);
  gap: 28px;
  align-items: end;
  background: #fbfaf6;
}

.page-head .hero-text {
  margin: 0;
  color: var(--muted);
}

.value-band {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(320px, 1fr);
  gap: 30px;
  align-items: center;
  background: #171713;
  color: #fff;
}

.value-band .eyebrow {
  color: #f6c85f;
}

.value-band h2 {
  max-width: 620px;
  font-size: clamp(32px, 4vw, 56px);
  line-height: 0.98;
}

.value-band p:last-child {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 18px;
  line-height: 1.55;
}

.upload-form {
  display: grid;
  grid-template-columns: minmax(200px, 1.2fr) 120px 150px 140px minmax(220px, 1.5fr) auto;
  gap: 14px;
  align-items: end;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 680;
}

input {
  width: 100%;
  height: 46px;
  border: 1px solid #c9c5b8;
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  padding: 0 13px;
}

select {
  width: 100%;
  height: 46px;
  border: 1px solid #c9c5b8;
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  padding: 0 13px;
}

input[type="file"] {
  padding: 10px;
}

button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid #171713;
  border-radius: 6px;
  background: #171713;
  color: #fff;
  padding: 0 18px;
  font: inherit;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.link-button {
  background: transparent;
  color: var(--ink);
}

.link-button.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}

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

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

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

.section-head p,
.empty {
  margin-bottom: 0;
  color: var(--muted);
}

.result-summary {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(420px, 1.35fr);
  gap: 28px;
  align-items: stretch;
  background: linear-gradient(135deg, #fffdf8 0%, #f6f7fb 54%, #eff6ff 100%);
}

.summary-lead {
  display: grid;
  align-content: center;
  gap: 8px;
}

.summary-lead span,
.summary-grid span {
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.summary-lead strong {
  font-size: clamp(42px, 7vw, 88px);
  line-height: 0.9;
}

.summary-lead p,
.summary-grid small {
  margin: 0;
  color: var(--muted);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: rgba(23, 23, 19, 0.12);
  border: 1px solid rgba(23, 23, 19, 0.12);
}

.summary-grid div {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 132px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.74);
}

.summary-grid strong {
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  font-size: 14px;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

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

td a {
  color: var(--gold-dark);
  font-weight: 760;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 1px;
  background: var(--line);
  padding-top: 1px;
  padding-bottom: 1px;
}

.metrics div {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 4px;
  background: var(--bg);
  padding: 18px;
}

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

.metrics strong {
  font-size: 32px;
  line-height: 1;
}

.metrics .mode-label {
  font-size: 20px;
}

.admin-hero {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(260px, 420px);
  gap: 28px;
  align-items: end;
  background: #fbfaf6;
}

.admin-hero h1 {
  max-width: 780px;
}

.admin-status {
  display: grid;
  gap: 8px;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--white);
}

.admin-status span {
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.admin-status strong {
  font-size: 28px;
  line-height: 1.05;
}

.admin-status p {
  margin: 0;
  color: var(--muted);
}

.admin-metrics small {
  color: var(--muted);
  font-weight: 680;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  background: #f3f4f6;
}

.admin-panel {
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--white);
}

.readiness-list {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.readiness-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  background: var(--white);
}

.readiness-list span {
  color: var(--muted);
}

.readiness-list strong {
  font-size: 15px;
}

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

.mesh-table tbody tr:hover,
.mesh-table tbody tr.is-selected {
  background: #fffaf0;
}

.mesh-table tbody tr.is-selected td {
  border-bottom-color: rgba(183, 130, 33, 0.42);
}

.mesh-filter {
  display: inline-grid;
  justify-items: start;
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
  transform: none;
}

.mesh-filter span {
  font-weight: 780;
}

.mesh-filter small {
  color: var(--blue);
  font-weight: 760;
}

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

.particle-toolbar span {
  color: var(--muted);
  font-weight: 740;
}

.particle-map {
  position: relative;
  width: 100%;
  aspect-ratio: var(--image-aspect);
  overflow: hidden;
  background: #080806;
  border: 1px solid #24231d;
}

.particle-map img,
.particle-map svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.particle-map img {
  object-fit: contain;
}

.particle-map svg {
  pointer-events: auto;
}

.particle-marker {
  cursor: pointer;
  pointer-events: all;
}

.particle-marker rect,
.particle-marker circle {
  fill: transparent;
  vector-effect: non-scaling-stroke;
  transition: opacity 160ms ease, stroke-width 160ms ease, filter 160ms ease;
}

.particle-marker rect {
  opacity: 0.32;
  stroke: rgba(255, 255, 255, 0.72);
  stroke-width: 1.5;
}

.particle-marker circle {
  opacity: 0.24;
  stroke: rgba(14, 165, 233, 0.82);
  stroke-width: 2;
}

.particle-marker.accept circle {
  stroke: rgba(36, 211, 127, 0.86);
}

.particle-marker.review circle {
  stroke: rgba(255, 186, 73, 0.9);
}

.particle-marker.reject circle {
  stroke: rgba(255, 99, 99, 0.86);
}

.particle-map.is-filtered .particle-marker.is-muted rect,
.particle-map.is-filtered .particle-marker.is-muted circle {
  opacity: 0.05;
}

.particle-marker.is-active rect {
  opacity: 0.95;
  stroke: #fff7bf;
  stroke-width: 3;
  filter: drop-shadow(0 0 7px rgba(255, 214, 92, 0.95));
}

.particle-marker.is-active circle {
  opacity: 1;
  stroke: var(--cyan);
  stroke-width: 5;
  filter: drop-shadow(0 0 10px rgba(14, 165, 233, 0.95));
}

.particle-marker.is-selected-particle rect {
  opacity: 1;
  stroke: #ffffff;
  stroke-width: 4;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.95));
}

.particle-marker.is-selected-particle circle {
  opacity: 1;
  stroke: #f6c85f;
  stroke-width: 6;
  filter: drop-shadow(0 0 14px rgba(246, 200, 95, 1));
}

.particle-marker.is-reviewed rect {
  stroke-dasharray: 5 4;
}

.particle-marker.is-excluded rect,
.particle-marker.is-excluded circle {
  opacity: 0.1;
  stroke: rgba(255, 255, 255, 0.34);
}

.particle-map.is-filtered .particle-marker.is-excluded rect,
.particle-map.is-filtered .particle-marker.is-excluded circle {
  opacity: 0.03;
  filter: none;
}

.image-review {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 28px;
}

.image-review img {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  background: #080806;
  border: 1px solid #24231d;
}

.decision {
  display: inline-flex;
  min-width: 68px;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 760;
}

.decision.accept {
  background: var(--green);
}

.decision.review {
  background: var(--amber);
}

.decision.reject {
  background: var(--red);
}

.particle-row {
  cursor: pointer;
}

.particle-row:hover,
.particle-row.is-selected-particle {
  background: #fffaf0;
}

.particle-row.is-labeled {
  box-shadow: inset 3px 0 0 rgba(19, 122, 75, 0.5);
}

.particle-row.is-excluded {
  color: rgba(23, 23, 19, 0.58);
  background: #f1f1ec;
}

.particle-row.is-excluded .decision,
.particle-row.is-excluded .human-label {
  opacity: 0.78;
}

.human-label {
  display: inline-flex;
  min-width: 86px;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  text-transform: capitalize;
}

.human-label.gold {
  border-color: rgba(183, 130, 33, 0.5);
  background: #fff4cf;
  color: var(--gold-dark);
}

.human-label.not_gold,
.human-label.rock {
  border-color: rgba(109, 107, 98, 0.35);
  background: #ecece7;
  color: #3b3a34;
}

.human-label.unsure {
  border-color: rgba(37, 99, 235, 0.3);
  background: #eff6ff;
  color: var(--blue);
}

.human-label.pyrite {
  border-color: rgba(165, 103, 16, 0.45);
  background: #fff7ed;
  color: var(--amber);
}

.human-label.glare {
  border-color: rgba(14, 165, 233, 0.35);
  background: #ecfeff;
  color: #087990;
}

.label-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: max(360px, 100%);
}

.review-button,
.label-button {
  min-height: 30px;
  border-color: #d8d4c7;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 780;
  text-transform: capitalize;
}

.label-button.is-selected {
  border-color: var(--gold);
  background: var(--gold);
  color: #fff;
}

.review-button {
  border-color: #171713;
  background: #171713;
  color: #fff;
}

.review-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.review-modal.is-open {
  display: flex;
}

.review-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 6, 0.72);
  backdrop-filter: blur(10px);
}

.review-dialog {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  max-height: min(860px, 92vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #fbfaf6;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.38);
}

.review-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.modal-close {
  min-height: 38px;
  border-color: #d8d4c7;
  background: #fff;
  color: var(--ink);
}

.review-dialog-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
}

.review-crop-wrap {
  min-height: 420px;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #080806;
}

.review-crop-wrap img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  image-rendering: auto;
}

.review-details {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 24px;
  overflow-y: auto;
}

.review-stat {
  display: grid;
  gap: 4px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.review-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.review-stat strong {
  font-size: 24px;
  line-height: 1;
}

.review-reason {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.modal-label-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.modal-label-actions .label-button {
  min-height: 42px;
  justify-content: center;
  border-radius: 6px;
}

@media (max-width: 920px) {
  .topbar,
  .site-nav,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .upload-form,
  .image-review,
  .review-dialog-body,
  .metrics,
  .site-stats,
  .workflow-band,
  .sample-steps,
  .analysis-workflow,
  .result-summary,
  .summary-grid,
  .admin-hero,
  .admin-grid,
  .page-head,
  .value-band,
  .detail-topbar {
    grid-template-columns: 1fr;
  }

  .process-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .landing-hero {
    min-height: 620px;
    align-items: end;
  }

  .summary-grid div {
    min-height: 104px;
  }

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

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
