:root,
[data-theme="light"] {
  --bg: #eef1f4;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --ink: #12151a;
  --muted: #5c6570;
  --line: #dde1e7;
  --line-strong: #c5cbd4;
  --accent: #0b6e4f;
  --accent-soft: #e6f5ee;
  --accent-ink: #08523b;
  --accent-glow: rgba(11, 110, 79, 0.35);
  --danger-bg: #fef2f2;
  --danger: #991b1b;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 8px 24px rgba(16, 24, 40, 0.06);
  --hero-veil: linear-gradient(180deg, rgba(8, 14, 16, 0.15) 0%, rgba(8, 14, 16, 0.55) 55%, rgba(238, 241, 244, 0.96) 100%);
  --top-bg: rgba(255, 255, 255, 0.86);
  --drop-bg: #fafbfc;
  --chip: #eef0f3;
  --font: "DM Sans", sans-serif;
  --font-display: "IBM Plex Sans", "DM Sans", sans-serif;
}

[data-theme="dark"] {
  --bg: #070a0c;
  --surface: #12171b;
  --surface-2: #1a2127;
  --ink: #eef2f5;
  --muted: #9aa5b1;
  --line: #243038;
  --line-strong: #35424c;
  --accent: #3ecf9a;
  --accent-soft: rgba(62, 207, 154, 0.12);
  --accent-ink: #7aefc4;
  --accent-glow: rgba(62, 207, 154, 0.25);
  --danger-bg: #2a1212;
  --danger: #fca5a5;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04), 0 12px 32px rgba(0, 0, 0, 0.35);
  --hero-veil: linear-gradient(180deg, rgba(7, 10, 12, 0.2) 0%, rgba(7, 10, 12, 0.55) 50%, rgba(7, 10, 12, 0.98) 100%);
  --top-bg: rgba(10, 14, 17, 0.82);
  --drop-bg: #0e1317;
  --chip: #1e272e;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.45;
}

body {
  transition: background 0.2s ease, color 0.2s ease;
}

/* —— Header —— */
.top {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(12px);
  background: var(--top-bg);
  border-bottom: 1px solid var(--line);
}

.top-inner {
  width: min(1280px, calc(100% - 2rem));
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 52px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

.brand-mark {
  border-radius: 7px;
  display: block;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.03em;
}

.top-nav {
  display: flex;
  gap: 1rem;
  margin-left: 0.5rem;
}

.top-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
}

.top-nav a:hover {
  color: var(--accent-ink);
}

.top-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tool-btn {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 650;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tool-btn:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.theme-icon::before {
  content: "☾";
  font-size: 0.95rem;
  line-height: 1;
}

[data-theme="dark"] .theme-icon::before {
  content: "☀";
}

.status {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--chip);
  white-space: nowrap;
}

.status.ok {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.status.warn {
  color: #d97706;
  background: rgba(217, 119, 6, 0.12);
}

.status.bad {
  color: var(--danger);
  background: var(--danger-bg);
}

/* —— Hero —— */
.hero {
  position: relative;
  width: min(1280px, calc(100% - 2rem));
  margin: 0.85rem auto 0;
  height: clamp(160px, 22vw, 220px);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  animation: fade-up 0.55s ease both;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

.hero-veil {
  position: absolute;
  inset: 0;
  background: var(--hero-veil);
}

.hero-copy {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
}

.hero-logo {
  border-radius: 11px;
  margin-bottom: 0.45rem;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 8px 24px rgba(0, 0, 0, 0.35);
  animation: pop 0.6s ease 0.08s both;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.04em;
  margin: 0;
  animation: fade-up 0.55s ease 0.12s both;
}

.hero-sub {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 64ch;
  hyphens: none;
  overflow-wrap: normal;
  animation: fade-up 0.55s ease 0.18s both;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes pop {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* —— Main —— */
main {
  width: min(1280px, calc(100% - 2rem));
  margin: 0.75rem auto 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.95rem 1.05rem 1rem;
  animation: fade-up 0.45s ease both;
}

.panel-head {
  margin-bottom: 0.75rem;
}

.panel-head h2 {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  margin: 0 0 0.2rem;
}

.lede,
.result-sub,
.about-body {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  max-width: 100ch;
}

.upload-row {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.upload-stage {
  border: 1.5px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--drop-bg);
  min-height: 148px;
  padding: 1.15rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.upload-stage:hover,
.upload-stage:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  outline: none;
}

.upload-stage.dragover {
  border-color: var(--accent);
  border-style: solid;
  background: var(--accent-soft);
}

.stage-core {
  pointer-events: none;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 0 auto 0.45rem;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-size: 1.15rem;
  font-weight: 700;
  background: var(--accent-soft);
}

.stage-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  margin: 0 0 0.12rem;
}

.stage-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.file-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  max-height: 4.2rem;
  overflow: auto;
}

.file-list li {
  font-size: 0.72rem;
  color: var(--ink);
  background: var(--chip);
  border-radius: 4px;
  padding: 0.12rem 0.4rem;
  max-width: 15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-col {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.upload-pickers {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.upload-pickers .btn {
  min-width: 145px;
  background: var(--surface);
}

.upload-command-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.upload-command-bar .primary {
  min-width: 150px;
}

.btn {
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 0.48rem 0.65rem;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, opacity 0.12s ease, transform 0.12s ease;
}

.btn:hover:not(:disabled) {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #04140e;
}

[data-theme="light"] .btn.primary {
  color: #fff;
}

.btn.primary:hover:not(:disabled) {
  filter: brightness(1.05);
}

.btn.subtle {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.btn.subtle:hover:not(:disabled) {
  color: var(--ink);
  background: var(--surface-2);
}

.settings {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.progress-panel {
  margin-top: 0.7rem;
  padding: 0.72rem 0.85rem;
  border: 1px solid rgba(62, 207, 154, 0.35);
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(62, 207, 154, 0.08), var(--surface-2));
}

.progress-panel[hidden] {
  display: none !important;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.8rem;
}

.progress-head span {
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-weight: 700;
}

.progress-track {
  position: relative;
  display: flex;
  justify-content: space-between;
  margin: 0.75rem 0 0.5rem;
}

.progress-line {
  position: absolute;
  z-index: 0;
  top: 6px;
  left: 8px;
  right: 8px;
  height: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.25);
}

.progress-line i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.progress-dot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.65rem;
}

.progress-dot b {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  background: var(--surface-2);
  box-shadow: 0 0 0 3px var(--surface-2);
}

.progress-dot.done,
.progress-dot.active {
  color: var(--ink);
}

.progress-dot.done b,
.progress-dot.active b {
  border-color: var(--accent);
  background: var(--accent);
}

.progress-dot.active b {
  box-shadow: 0 0 0 4px var(--accent-glow);
  animation: progress-pulse 1.15s ease-in-out infinite;
}

@keyframes progress-pulse {
  50% { transform: scale(0.72); opacity: 0.72; }
}

.progress-log {
  min-height: 1.15rem;
  max-height: 3.7rem;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.72rem;
}

.progress-log li::before {
  content: "·";
  color: var(--accent);
  margin-right: 0.4rem;
}

.settings-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.3rem;
  display: block;
}

.mode-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.mode {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.26rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--surface-2);
  user-select: none;
}

.mode:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.mode input {
  accent-color: var(--accent);
  margin: 0;
}

.mode-help,
.archive-options p,
.assignment-head p,
.mapping-note {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.channel-assignments,
.archive-options {
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.channel-assignments[hidden],
.archive-options[hidden],
.custom-map[hidden],
.merged-only[hidden] {
  display: none !important;
}

.assignment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.assignment-head strong {
  font-family: var(--font-display);
  font-size: 0.84rem;
}

.model-order {
  flex: 0 0 auto;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid rgba(62, 207, 154, 0.35);
  border-radius: 999px;
  padding: 0.22rem 0.48rem;
  font-size: 0.68rem;
  font-weight: 650;
}

.assignment-grid,
.custom-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.assignment-grid label,
.archive-options label,
.custom-map label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.assignment-grid small {
  color: var(--accent-ink);
  font-weight: 600;
}

.assignment-grid select,
.archive-options select,
.custom-map select {
  width: 100%;
  min-width: 0;
  height: 2rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0.35rem 0.45rem;
  background: var(--drop-bg);
  color: var(--ink);
  font: 500 0.78rem var(--font);
}

.params {
  display: grid;
  grid-template-columns: 6.5rem 6.5rem auto minmax(12rem, 1fr);
  gap: 0.45rem 0.65rem;
  align-items: end;
}

.params label {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.params input[type="number"],
.params select {
  width: 100%;
  padding: 0.38rem 0.45rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  background: var(--drop-bg);
  height: 1.95rem;
}

.params .check {
  flex-direction: row;
  align-items: center;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink);
  gap: 0.35rem;
  height: 1.95rem;
  align-self: end;
  padding-bottom: 0.3rem;
}

.params .check input {
  accent-color: var(--accent);
}

.params .wide {
  min-width: 0;
}

.custom-map,
.mapping-note {
  grid-column: 1 / -1;
}

.mapping-note {
  align-self: center;
}

/* —— Results —— */
.results .result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 0.7rem;
}

.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.metric {
  min-width: 4.3rem;
  padding: 0.35rem 0.55rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.metric-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.metric-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.hero-metric {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.hero-metric .metric-value {
  font-size: 1.35rem;
  color: var(--accent-ink);
}

.gallery-section {
  margin-top: 0.55rem;
}

.plate-section {
  margin-top: 0.75rem;
}

.plate-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.plate-title-row .gallery-title {
  margin: 0;
}

.plate-metric {
  flex: 0 0 auto;
}

.plate-metric .mode {
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
}

.plate-card {
  padding: 0.7rem;
  background: #0a0e10;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.plate-card canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 560px;
}

.heat-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.heat-legend i {
  width: 120px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, #149660, #f6efd3, #da4646);
}

.gallery-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 650;
  margin: 0 0 0.4rem;
}

.gallery-title .muted {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.72rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.gallery-grid-lg {
  gap: 0.85rem;
}

.gallery-grid-lg .gallery-card img {
  min-height: 280px;
}

.gallery-card-meta .card-avg {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  background: rgba(62, 207, 154, 0.14);
  border: 1px solid rgba(62, 207, 154, 0.45);
}

.gallery-card-meta .card-avg-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9ad9b8;
}

.gallery-card-meta .card-avg-value {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #7aefc4;
  line-height: 1;
}

.gallery-card {
  margin: 0;
  background: #0a0e10;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  cursor: zoom-in;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.gallery-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.gallery-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
  background: #0a0e10;
}

.settings-disclosure {
  margin-top: 0.8rem;
  border-top: 1px solid var(--line);
  padding-top: 0.65rem;
}

.settings-disclosure > summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 700;
  list-style-position: inside;
  padding: 0.3rem 0;
}

.settings-disclosure[open] > summary {
  margin-bottom: 0.75rem;
}

/* File names determine merged/split/ZIP mode automatically. Keep the legacy
   mode radios available to the script but out of the primary workflow. */
.input-type-bar { display: none; }

.stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.download-button {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--accent);
  border-radius: 7px;
  padding: 0.45rem 0.7rem;
  color: var(--ink);
  background: var(--accent-soft);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
}

.well-table-wrap { margin-top: 1rem; max-height: 340px; overflow: auto; }
.well-table-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.55rem; }
.well-table-head h4 { margin: 0; color: var(--ink); }
.well-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.well-table th, .well-table td { padding: 0.42rem 0.55rem; border-bottom: 1px solid var(--line); text-align: right; }
.well-table th:first-child, .well-table td:first-child { text-align: left; }
.well-table th { color: var(--muted); font-weight: 700; position: sticky; top: 0; background: var(--surface-1); z-index: 1; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  cursor: zoom-out;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox img {
  max-width: min(96vw, 1100px);
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}

.lightbox-cap {
  margin: 0.75rem 0 0;
  color: #e8eef2;
  font-size: 0.9rem;
}

.lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.gallery-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  padding: 0.4rem 0.5rem 0.5rem;
  font-size: 0.72rem;
  color: #b7c0c8;
  background: #12181c;
}

.gallery-card-meta strong {
  color: #fff;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-section {
  margin-top: 0.85rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.plot-card {
  margin: 0;
  padding: 0.65rem 0.75rem 0.55rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.plot-card figcaption {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 650;
  margin: 0 0 0.45rem;
  color: var(--ink);
}

.plot-card canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  background: var(--drop-bg);
}

@media (max-width: 720px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.error {
  margin: 0;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 0.84rem;
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.about-panel h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 0.4rem;
}

.steps {
  margin: 0.7rem 0 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.steps li {
  margin: 0.25rem 0;
}

footer {
  text-align: center;
  padding: 0.25rem 1rem 1.4rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.busy .upload-stage,
.busy .action-col {
  pointer-events: none;
  opacity: 0.6;
}

@media (max-width: 720px) {
  .top-nav {
    display: none;
  }

  .hero {
    height: 150px;
  }

  .upload-row {
    grid-template-columns: 1fr;
  }

  .action-col {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .action-col .btn {
    flex: 1 1 auto;
  }

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

  .params .wide,
  .params .check {
    grid-column: 1 / -1;
  }

  .assignment-head {
    flex-direction: column;
  }

  .plate-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .assignment-grid,
  .custom-map {
    grid-template-columns: 1fr;
  }

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