:root {
  --ink: #0f172a;
  --muted: #64748b;
  --panel: #ffffff;
  --line: #dbe3ea;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --warn: #b45309;
  --mask: rgba(20, 184, 166, 0.45);
}

html,
body {
  height: 100%;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f8fafc;
}

.language-switch {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 95;
  display: inline-flex;
  gap: 0.35rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  padding: 0.25rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(10px);
}

.language-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.38rem 0.62rem;
  color: #475569;
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.language-btn:hover,
.language-btn.active {
  background: #2563eb;
  color: #ffffff;
}

.language-btn .flag {
  font-size: 1rem;
}

.quebec-flag {
  display: inline-flex;
  width: 1.2rem;
  height: 1.2rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 0.85rem;
  line-height: 1;
}

.funding-strip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  align-self: center;
  border: 1px solid #dbeafe;
  border-radius: 0.9rem;
  background: #eff6ff;
  padding: 0.4rem 0.65rem 0.45rem;
}

.funding-strip-label {
  color: #475569;
  font-size: 0.57rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
}

.funding-strip-header {
  min-width: 7rem;
}

.funding-strip-footer {
  min-width: 6.5rem;
}

.footer-funding-label {
  font-size: 0.53rem;
}

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

.scroll-thin::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.scroll-thin::-webkit-scrollbar-track {
  background: #eef2f7;
}

.scroll-thin::-webkit-scrollbar-thumb {
  background: #b8c3cf;
  border-radius: 999px;
}

.asset-img {
  object-fit: contain;
}

.header-dev-prompt-wrap {
  display: flex;
  justify-content: flex-start;
  padding-top: 0.34rem;
}

.terms-dev-prompt-wrap {
  padding-top: 0.5rem;
}

.header-dev-prompt {
  position: relative;
  display: inline-flex;
  align-items: center;
  isolation: isolate;
  overflow: hidden;
  min-height: 2.85rem;
  padding: 0.46rem 1.15rem 0.46rem 1.3rem;
  border-left: 4px solid #ff1a1a;
  border-radius: 0.18rem;
  background:
    linear-gradient(180deg, rgba(2, 6, 10, 0.99), rgba(7, 11, 16, 0.98)),
    repeating-linear-gradient(90deg, rgba(26, 74, 88, 0.16) 0 1px, transparent 1px 18px);
  color: #ff2a2a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  box-shadow:
    inset 0 1px 0 rgba(79, 209, 255, 0.38),
    inset 0 0 0 1px rgba(24, 49, 62, 0.96),
    0 0 0 1px rgba(7, 16, 23, 0.95),
    0 0 0 2px rgba(255, 28, 28, 0.14),
    0 0 22px rgba(255, 0, 0, 0.36),
    0 0 42px rgba(255, 0, 0, 0.14);
}

.header-dev-prompt::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1.7rem;
  margin-right: 1rem;
  background: linear-gradient(180deg, #ff6666 0%, #ff1010 32%, #ff0000 100%);
  box-shadow:
    0 0 10px rgba(255, 0, 0, 1),
    0 0 18px rgba(255, 0, 0, 0.8),
    0 0 34px rgba(255, 0, 0, 0.38);
}

.header-dev-prompt::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.065) 0 1px,
      rgba(255, 255, 255, 0) 1px 4px
    ),
    linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(255, 0, 0, 0.015) 42%, rgba(255, 0, 0, 0.08));
  mix-blend-mode: screen;
  opacity: 0.96;
}

.header-dev-prompt-text {
  color: #ff2a2a;
  text-shadow:
    0 0 8px rgba(255, 0, 0, 0.98),
    0 0 16px rgba(255, 0, 0, 0.9),
    0 0 28px rgba(255, 38, 38, 0.46);
  animation: vintage-prompt-blink 1.06s steps(2, end) infinite;
}

@keyframes vintage-prompt-blink {
  0%, 16%, 20%, 58%, 62%, 100% {
    opacity: 1;
    filter: saturate(1.5) brightness(1.18);
  }
  17%, 19%, 59%, 61% {
    opacity: 0.22;
    filter: saturate(0.72) brightness(0.82);
  }
}

body[data-dev-prompt="off"] .header-dev-prompt-wrap {
  display: none;
}

.step-dot {
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 1.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 800;
}

.primary-btn,
.secondary-btn,
.danger-btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 0.5rem;
  font-weight: 800;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, opacity 140ms ease;
}

.primary-btn {
  min-height: 2.5rem;
  border: 1px solid #2563eb;
  background: #2563eb;
  padding: 0.65rem 1rem;
  color: #ffffff;
  font-size: 0.85rem;
}

.primary-btn:hover:not(:disabled) {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.secondary-btn {
  min-height: 2.5rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  padding: 0.65rem 1rem;
  color: #334155;
  font-size: 0.85rem;
}

.secondary-btn:hover:not(:disabled) {
  border-color: #2563eb;
  color: #2563eb;
  background: #eff6ff;
}

.danger-btn {
  min-height: 2.5rem;
  border: 1px solid #dc2626;
  background: #dc2626;
  padding: 0.65rem 1rem;
  color: #ffffff;
  font-size: 0.85rem;
}

.danger-btn:hover:not(:disabled) {
  border-color: #b91c1c;
  background: #b91c1c;
}

.icon-btn {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
}

.icon-btn:hover:not(:disabled) {
  border-color: #2563eb;
  color: #2563eb;
  background: #eff6ff;
}

.export-btn {
  min-height: 2.5rem;
  border: 1px solid transparent;
  padding: 0.65rem 0.95rem;
  color: #ffffff;
  font-size: 0.84rem;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.export-btn-csv {
  border-color: #15803d;
  background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
}

.export-btn-csv:hover:not(:disabled) {
  border-color: #166534;
  background: linear-gradient(135deg, #16a34a 0%, #166534 100%);
}

.export-btn-json {
  border-color: #1d4ed8;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.export-btn-json:hover:not(:disabled) {
  border-color: #1e40af;
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

.export-btn-png {
  border-color: #c2410c;
  background: linear-gradient(135deg, #fb923c 0%, #c2410c 100%);
}

.export-btn-png:hover:not(:disabled) {
  border-color: #9a3412;
  background: linear-gradient(135deg, #f97316 0%, #9a3412 100%);
}

.viewer-action-row {
  align-items: stretch;
}

.visual-workspace-run {
  min-width: clamp(14rem, 26vw, 18rem);
}

.viewer-action-btn {
  min-width: clamp(13.25rem, 24vw, 16.5rem);
  min-height: 3.35rem;
  justify-content: flex-start;
  gap: 0.72rem;
  border-radius: 1rem;
  padding: 0.9rem 1.15rem;
  font-size: 0.98rem;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow:
    0 12px 24px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.viewer-action-btn i {
  flex-shrink: 0;
}

.viewer-action-btn-run {
  border-color: #4f7dff;
  background: linear-gradient(135deg, #5f8dff 0%, #3a66ea 100%);
}

.viewer-action-btn-run:hover:not(:disabled) {
  border-color: #3657c8;
  background: linear-gradient(135deg, #4f7dff 0%, #2e58d3 100%);
}

.viewer-action-btn-csv {
  border-color: #2ba95f;
  background: linear-gradient(135deg, #5fd98f 0%, #2ba95f 100%);
}

.viewer-action-btn-csv:hover:not(:disabled) {
  border-color: #20814a;
  background: linear-gradient(135deg, #4fce82 0%, #20814a 100%);
}

.viewer-action-btn-png {
  border-color: #e28450;
  background: linear-gradient(135deg, #ffbd90 0%, #e28450 100%);
}

.viewer-action-btn-png:hover:not(:disabled) {
  border-color: #c56b3c;
  background: linear-gradient(135deg, #ffae78 0%, #c56b3c 100%);
}

.image-input-dropzone {
  border-color: #93c5fd;
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.14), transparent 16rem),
    linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 10px 24px rgba(37, 99, 235, 0.08);
}

.image-input-panel {
  border-color: #93c5fd;
  box-shadow:
    0 14px 30px rgba(37, 99, 235, 0.08),
    inset 0 0 0 1px rgba(191, 219, 254, 0.55);
}

.primary-btn:disabled,
.secondary-btn:disabled,
.danger-btn:disabled,
.icon-btn:disabled,
.export-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.canvas-frame {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 34rem),
    linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  max-width: 100%;
  min-width: 0;
}

.viewer-compare-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
}

.viewer-compare-slider-wrap {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.viewer-compare-label {
  color: #475569;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#overlayRevealSlider {
  width: 100%;
  accent-color: #2563eb;
}

.viewer-zoom-controls {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.compare-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: 75vh;
  transform-origin: top left;
  transition: transform 140ms ease;
}

.compare-canvas {
  display: block;
  height: auto;
  max-width: 100%;
  max-height: 75vh;
}

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

.compare-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.18), 0 0 18px rgba(37, 99, 235, 0.25);
  pointer-events: none;
  transform: translateX(-1px);
}

.compare-divider-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.9rem;
  height: 1.9rem;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.92);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
  transform: translate(-50%, -50%);
}

.canvas-frame.is-zoomed {
  overflow: auto;
  justify-content: flex-start;
  align-items: flex-start;
  cursor: grab;
}

.canvas-frame.is-zoomed.is-panning {
  cursor: grabbing;
}

.canvas-frame.is-zoomed .compare-stage,
.canvas-frame.is-zoomed .compare-canvas {
  max-height: none;
}

.canvas-frame.is-zoomed .pointer-events-none {
  opacity: 0.25;
}

.glossary-card {
  border: 1px solid #dbeafe;
  border-radius: 0.9rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.glossary-card h3 {
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 800;
}

.glossary-card p {
  margin-top: 0.45rem;
  color: #475569;
  font-size: 0.86rem;
  line-height: 1.55;
}

body.modal-open {
  overflow: hidden;
}

main,
main > aside,
main > section,
#thresholdDiagnostics,
#logBox {
  min-width: 0;
}

#logBox {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}

.neural-console-section {
  max-width: 100%;
}

.neural-console {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(227, 27, 35, 0.48);
  border-radius: 1rem;
  background:
    linear-gradient(180deg, rgba(20, 18, 44, 0.96), rgba(4, 8, 20, 0.99)),
    linear-gradient(90deg, rgba(34, 211, 238, 0.08) 0%, rgba(0, 0, 0, 0) 32%, rgba(217, 70, 239, 0.07) 100%);
  box-shadow:
    0 18px 45px rgba(15, 23, 42, 0.34),
    0 0 28px rgba(34, 211, 238, 0.08),
    inset 0 0 0 1px rgba(227, 27, 35, 0.08),
    inset 0 0 48px rgba(34, 211, 238, 0.08),
    inset 0 -18px 30px rgba(217, 70, 239, 0.08);
  color: #d7fff4;
}

.neural-console::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(180deg, rgba(125, 211, 252, 0.08), transparent 18%, transparent 82%, rgba(217, 70, 239, 0.1)),
    repeating-linear-gradient(90deg, rgba(56, 189, 248, 0.09) 0 1px, transparent 1px 26px),
    radial-gradient(circle at top right, rgba(227, 27, 35, 0.13), transparent 28%);
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-size: auto, auto, auto;
  background-position: center, center, top right;
  mix-blend-mode: screen;
  opacity: 0.82;
}

.neural-console::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    repeating-linear-gradient(180deg, rgba(255,255,255,0.06) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, rgba(255,255,255,0.06), transparent 22%, transparent 78%, rgba(255,255,255,0.04)),
    linear-gradient(90deg, transparent 0%, rgba(34, 211, 238, 0.04) 48%, rgba(217, 70, 239, 0.05) 100%);
  mix-blend-mode: overlay;
}

.neural-console-header {
  border-bottom: 1px solid rgba(227, 27, 35, 0.36);
  background:
    linear-gradient(90deg, rgba(110, 10, 18, 0.52), rgba(217, 70, 239, 0.08));
  box-shadow:
    inset 0 -1px 0 rgba(217, 70, 239, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

@media (max-width: 900px) {
  .viewer-compare-toolbar {
    grid-template-columns: 1fr;
  }

  .viewer-zoom-controls {
    justify-content: flex-start;
  }
}

.neural-console-eyebrow {
  color: #67e8f9;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-shadow:
    0 0 10px rgba(34, 211, 238, 0.35),
    0 0 18px rgba(217, 70, 239, 0.18);
}

.terminal-title {
  color: #ecfeff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 1.04rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-shadow:
    0 0 14px rgba(56, 189, 248, 0.42),
    0 0 26px rgba(217, 70, 239, 0.14);
}

.terminal-led {
  border: 1px solid rgba(217, 70, 239, 0.42);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(49, 10, 72, 0.88), rgba(10, 20, 42, 0.92));
  padding: 0.4rem 0.7rem;
  color: #f5d0fe;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-shadow:
    0 0 12px rgba(217, 70, 239, 0.75),
    0 0 20px rgba(34, 211, 238, 0.24);
  box-shadow:
    inset 0 0 16px rgba(217, 70, 239, 0.14),
    0 0 18px rgba(217, 70, 239, 0.12);
}

.neural-console #logBox {
  background: transparent;
  color: #a7f3d0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  text-shadow:
    0 0 8px rgba(74, 222, 128, 0.34),
    0 0 18px rgba(34, 211, 238, 0.16);
  background-image:
    linear-gradient(180deg, rgba(56, 189, 248, 0.03), rgba(0, 0, 0, 0)),
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.08), transparent 32%),
    linear-gradient(90deg, rgba(217, 70, 239, 0.02), transparent 25%, transparent 70%, rgba(34, 211, 238, 0.03));
}

.neural-console #logBox .text-slate-400 {
  color: #7dd3fc;
  text-shadow:
    0 0 10px rgba(34, 211, 238, 0.35),
    0 0 16px rgba(217, 70, 239, 0.12);
}

.neural-console-watermark {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0.34;
}

.neural-console-watermark span {
  position: absolute;
  width: 8rem;
  height: 8rem;
  border: none;
  background-image: url("../img/canadian_maple_leaf_faithful.svg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  filter:
    grayscale(1)
    brightness(1.1)
    contrast(1.08)
    sepia(1)
    hue-rotate(-18deg)
    saturate(4.2)
    drop-shadow(0 0 10px rgba(227, 27, 35, 0.12));
  opacity: 0.18;
  mix-blend-mode: lighten;
  transform-origin: center;
  animation: maple-fall 18s linear infinite;
}

.neural-console-watermark span:nth-child(1) {
  left: 6%;
  top: -8%;
  width: 4.5rem;
  height: 4.5rem;
  animation-duration: 16s;
  animation-delay: -3s;
}

.neural-console-watermark span:nth-child(2) {
  left: 31%;
  top: 8%;
  width: 6rem;
  height: 6rem;
  animation-duration: 21s;
  animation-delay: -11s;
}

.neural-console-watermark span:nth-child(3) {
  right: 12%;
  top: -4%;
  width: 5.25rem;
  height: 5.25rem;
  animation-duration: 19s;
  animation-delay: -7s;
}

.neural-console-watermark span:nth-child(4) {
  right: 34%;
  top: 28%;
  width: 8.5rem;
  height: 8.5rem;
  opacity: 0.12;
  animation-duration: 24s;
  animation-delay: -15s;
}

@keyframes maple-fall {
  0% {
    transform: translate3d(0, -8%, 0) rotate(-12deg);
  }
  25% {
    transform: translate3d(12px, 18%, 0) rotate(3deg);
  }
  50% {
    transform: translate3d(-10px, 40%, 0) rotate(12deg);
  }
  75% {
    transform: translate3d(8px, 62%, 0) rotate(-2deg);
  }
  100% {
    transform: translate3d(-6px, 88%, 0) rotate(16deg);
  }
}

.terms-card {
  isolation: isolate;
}

.terms-watermark {
  position: absolute;
  z-index: 0;
  opacity: 0.055;
  pointer-events: none;
}

.terms-watermark-left {
  bottom: -1rem;
  left: -1rem;
  width: 9rem;
}

.terms-watermark-right {
  right: 1rem;
  top: 4.25rem;
  width: 11rem;
}

.terms-paused-bar {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 90;
  display: flex;
  max-width: min(92vw, 34rem);
  align-items: center;
  gap: 0.75rem;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: rgba(254, 242, 242, 0.96);
  padding: 0.6rem 0.8rem 0.6rem 1rem;
  color: #991b1b;
  font-size: 0.75rem;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}

.terms-paused-bar button {
  border-radius: 999px;
  background: #991b1b;
  padding: 0.35rem 0.65rem;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 900;
}

#postNmsCountBadge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.count-badge-label {
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  line-height: 1;
  opacity: 0.88;
  text-transform: uppercase;
}

.mask-status-area {
  border-bottom: 1px solid #e2e8f0;
  background: #fffbeb;
  padding: 0.85rem 1rem;
}

.mask-warning {
  margin-top: 0.45rem;
  color: #92400e;
  font-size: 0.75rem;
  font-weight: 800;
}

.threshold-diagnostics {
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 1rem;
}

.diagnostic-table {
  width: 100%;
  min-width: 19rem;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-collapse: separate;
  border-radius: 0.5rem;
  border-spacing: 0;
  color: #334155;
  font-size: 0.75rem;
}

.diagnostic-table th,
.diagnostic-table td {
  background: #ffffff;
  padding: 0.48rem 0.65rem;
  vertical-align: middle;
}

.diagnostic-table tr + tr th,
.diagnostic-table tr + tr td {
  border-top: 1px solid #e2e8f0;
}

.diagnostic-table th {
  color: #475569;
  font-weight: 800;
  text-align: left;
}

.diagnostic-table td {
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  text-align: right;
  white-space: nowrap;
}

.mask-status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.mask-status-chip.ok {
  background: #dcfce7;
  color: #166534;
}

.mask-status-chip.warn,
.mask-status-chip.missing {
  background: #fef3c7;
  color: #92400e;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  padding: 0.2rem;
  transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.logo-link:hover {
  background: #f8fafc;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
  transform: translateY(-1px);
}

.header-partners {
  min-width: 0;
}

.header-logo-row {
  gap: 0.65rem;
}

.header-logo-row .funding-strip-header {
  margin-left: clamp(1rem, 2.8vw, 2.75rem);
}

.birds-logo {
  height: 4.4rem;
  width: auto;
  max-width: none;
  flex-shrink: 0;
  transform: scale(1.09);
  transform-origin: left center;
}

.footer-logo-row {
  gap: 0.85rem;
}

.footer-creators {
  line-height: 1.7;
}

.analysis-nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
}

.analysis-nav-status {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid #dbe3ea;
  border-radius: 0.75rem;
  background: #f8fafc;
  padding: 0.72rem 0.9rem;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}

.canvas-shell {
  background:
    linear-gradient(45deg, #eef2f7 25%, transparent 25%),
    linear-gradient(-45deg, #eef2f7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef2f7 75%),
    linear-gradient(-45deg, transparent 75%, #eef2f7 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 0.5rem;
  font-weight: 800;
  transition: 150ms ease;
}

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

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.tool-btn {
  display: inline-flex;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 0.375rem;
  color: #17594a;
  background: #ffffff;
  font-size: 1.15rem;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.tool-btn:hover:not(:disabled) {
  background: #17594a;
  border-color: #17594a;
  color: #ffffff;
}

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

.asset-name {
  display: block;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 0.375rem;
  background: #f8fafc;
  padding: 0.7rem 0.8rem;
  color: #334155;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.sample-card {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  background: #ffffff;
  text-align: left;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.sample-card:hover {
  border-color: #2563eb;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.sample-card.selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.sample-card .sample-check {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 2;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #ffffff;
  padding: 0.25rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.sample-card.selected .sample-check {
  background: #2563eb;
}

.sample-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e2e8f0;
}

.sample-card .sample-title {
  display: block;
  padding: 0.45rem 0.55rem;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.language-switch {
  position: static;
}

.language-switch-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(203, 213, 225, 0.9);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 0.2rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.language-switch-inline .language-btn {
  min-height: 1.7rem;
  padding: 0.25rem 0.45rem;
  font-size: 0.68rem;
}

header .funding-strip {
  margin-top: 0;
}

header .funding-strip img {
  max-height: 1.55rem;
}

@media (max-width: 900px) {
  .viewer-compare-toolbar {
    grid-template-columns: 1fr;
  }

  .viewer-action-btn {
    width: 100%;
    min-width: 0;
  }

  .visual-workspace-run {
    width: 100%;
  }

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

  .analysis-nav .secondary-btn {
    width: 100%;
  }

  .analysis-nav-status {
    white-space: normal;
  }

  .header-logo-row {
    gap: 0.5rem;
  }

  .header-logo-row .funding-strip-header {
    margin-left: 0;
  }

  .birds-logo {
    height: 3.4rem;
    transform: scale(1.1);
  }
}

@media (min-width: 1100px) {
  .header-logo-row .funding-strip-header {
    margin-left: auto;
    padding-left: 1rem;
  }
}
