@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap");

:root {
  color-scheme: dark;
  --ui-bg-top: #01040b;
  --ui-bg-mid: #020813;
  --ui-bg-bottom: #01050d;
  --ui-shell-surface-top: #061424;
  --ui-shell-surface-bottom: #030b16;
  --ui-text-bright: #f7efd8;
  --ui-text: #efe5c9;
  --ui-text-muted: #d3bb7f;
  --ui-panel-surface-top: #0a2239;
  --ui-panel-surface-bottom: #061627;
  --ui-accent: #ffd84a;
  --ui-accent-strong: #ffae1a;
  --ui-accent-glow-soft: rgba(255, 216, 74, 0.18);
  --ui-accent-glow: rgba(255, 216, 74, 0.42);
  --ui-panel-border: #0a2740;
  --ui-panel-border-deep: #06192a;
  --ui-shadow: rgba(0, 0, 0, 0.55);
  --ui-corner-accent: #ffb72a;
  --ui-noise: rgba(255, 216, 74, 0.16);
  --ui-pixel-grid: rgba(0, 0, 0, 0.3);
  --ui-shell-border: rgba(158, 112, 22, 0.94);
  --ui-shell-inner-shadow: rgba(7, 24, 44, 0.9);
  --checker-a: rgba(247, 239, 216, 0.07);
  --checker-b: rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
  image-rendering: pixelated;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, var(--ui-bg-top) 0%, var(--ui-bg-mid) 46%, var(--ui-bg-bottom) 100%);
  color: var(--ui-text);
  font-family: "VT323", "Courier New", Courier, monospace;
  font-size: 18px;
  line-height: 1.28;
  letter-spacing: 0.012em;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 216, 74, 0.06), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(255, 174, 26, 0.08), transparent 28%),
    radial-gradient(circle at 22% 72%, rgba(255, 216, 74, 0.035), transparent 24%),
    radial-gradient(circle at 80% 78%, rgba(255, 174, 26, 0.03), transparent 22%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.01), transparent 24%);
  opacity: 0.18;
  mix-blend-mode: screen;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0 2px, rgba(0, 0, 0, 0.26) 2px 3px, rgba(255, 216, 74, 0.035) 3px 4px, rgba(0, 0, 0, 0) 4px 6px),
    repeating-linear-gradient(90deg, transparent 0 2px, rgba(255, 255, 255, 0.03) 2px 3px, rgba(255, 216, 74, 0.02) 3px 4px, transparent 4px 6px),
    repeating-linear-gradient(0deg, transparent 0 2px, var(--ui-noise) 2px 4px, transparent 4px 6px),
    linear-gradient(90deg, rgba(255, 216, 74, 0.035), transparent 28%, rgba(255, 174, 26, 0.025) 64%, transparent);
  background-size: 100% 6px, 100% 100%, 100% 6px, 100% 100%;
  opacity: 0.54;
  mix-blend-mode: soft-light;
}

button,
input,
select {
  font: inherit;
}

a,
button,
.button {
  cursor: pointer;
}

h1,
h2,
h3,
.button,
.eyebrow,
.viz-label,
.status-badge {
  font-family: "Press Start 2P", "VT323", monospace;
  letter-spacing: 0.06em;
}

h1,
h2 {
  margin: 0;
  color: var(--ui-text-bright);
}

h1 {
  font-size: clamp(1.3rem, 2.8vw, 1.9rem);
  line-height: 1.1;
}

h2 {
  font-size: 0.9rem;
  line-height: 1.18;
}

p {
  margin: 0;
}

.eyebrow {
  margin: 0;
  font-size: 0.72rem;
  color: var(--ui-accent);
  text-transform: uppercase;
}

.copy-tag {
  font-size: 1rem;
  line-height: 1.15;
}

.copy-tag,
.muted {
  color: var(--ui-text-muted);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1760px, calc(100vw - 20px));
  min-height: calc(100dvh - 20px);
  margin: 10px auto;
  padding: 14px;
  display: grid;
  gap: 12px;
  background:
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(255, 255, 255, 0.04) 2px 3px, transparent 3px 6px),
    repeating-linear-gradient(90deg, transparent 0 2px, rgba(0, 0, 0, 0.2) 2px 3px, transparent 3px 6px),
    linear-gradient(135deg, rgba(255, 216, 74, 0.03), transparent 28%, rgba(255, 174, 26, 0.025) 68%, transparent),
    linear-gradient(160deg, var(--ui-shell-surface-top), var(--ui-shell-surface-bottom));
  border: 3px solid var(--ui-shell-border);
  box-shadow:
    inset 0 0 0 2px var(--ui-shell-inner-shadow),
    inset 0 0 28px rgba(255, 216, 74, 0.05),
    0 0 34px rgba(8, 28, 52, 0.5),
    0 0 14px rgba(255, 216, 74, 0.08),
    0 10px 0 var(--ui-shadow);
}

.shell::before {
  content: "";
  position: absolute;
  inset: 7px;
  pointer-events: none;
  border: 2px dashed rgba(219, 176, 82, 0.24);
  box-shadow: 0 0 10px rgba(255, 216, 74, 0.08);
}

.shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(180deg, var(--ui-pixel-grid) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, var(--ui-pixel-grid) 0 1px, transparent 1px 4px),
    linear-gradient(135deg, rgba(255, 216, 74, 0.03), transparent 36%, rgba(255, 174, 26, 0.025) 72%, transparent);
  opacity: 0.3;
}

.app-shell,
.sidebar,
.workspace,
.sidebar-section,
.candidate-list,
.event-log,
.info-stack {
  display: grid;
  gap: 10px;
}

.panel-stack {
  display: grid;
  gap: 12px;
}

.sidebar,
.sidebar-section,
.candidate-list,
.event-log,
.info-stack,
.panel-stack {
  min-width: 0;
}

.ui-surface,
.field-control {
  overflow: hidden;
  border: 4px solid var(--ui-panel-border);
  border-bottom-width: 5px;
  background: linear-gradient(180deg, var(--ui-panel-surface-top), var(--ui-panel-surface-bottom));
  box-shadow:
    inset 0 0 0 2px rgba(255, 216, 74, 0.6),
    inset 0 0 20px rgba(255, 216, 74, 0.08),
    inset 0 0 0 5px rgba(7, 24, 44, 0.9),
    0 0 16px rgba(255, 216, 74, 0.1),
    0 8px 0 var(--ui-shadow);
}

.ui-frame {
  position: relative;
}

.ui-frame::before,
.button::before {
  content: "";
  position: absolute;
  inset: 2px;
  pointer-events: none;
  border: 1px dotted rgba(148, 109, 38, 0.22);
}

.ui-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background:
    linear-gradient(to right, var(--ui-corner-accent) 0 3px, transparent 3px 12px) left top / 12px 4px no-repeat,
    linear-gradient(to bottom, var(--ui-corner-accent) 0 3px, transparent 3px 12px) left top / 4px 12px no-repeat,
    linear-gradient(to left, var(--ui-corner-accent) 0 3px, transparent 3px 12px) right top / 12px 4px no-repeat,
    linear-gradient(to bottom, var(--ui-corner-accent) 0 3px, transparent 3px 12px) right top / 4px 12px no-repeat,
    linear-gradient(to right, var(--ui-corner-accent) 0 3px, transparent 3px 12px) left bottom / 12px 4px no-repeat,
    linear-gradient(to top, var(--ui-corner-accent) 0 3px, transparent 3px 12px) left bottom / 4px 12px no-repeat,
    linear-gradient(to left, var(--ui-corner-accent) 0 3px, transparent 3px 12px) right bottom / 12px 4px no-repeat,
    linear-gradient(to top, var(--ui-corner-accent) 0 3px, transparent 3px 12px) right bottom / 4px 12px no-repeat;
}

.ui-frame > * {
  position: relative;
  z-index: 1;
}

.app-shell-header,
.hero,
.card {
  padding: 12px;
}

.app-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  align-items: start;
}

.sidebar {
  align-content: start;
}

.workspace {
  min-width: 0;
}

.brand,
.brand-lockup,
.copy-stack,
.header-instructions {
  display: grid;
  gap: 10px;
}

.copy-stack {
  min-width: 0;
}

.brand {
  min-height: 100%;
  align-items: center;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-emblem {
  width: 132px;
  height: 132px;
  flex: 0 0 auto;
  display: block;
  filter:
    drop-shadow(0 0 18px rgba(255, 216, 74, 0.22))
    drop-shadow(0 0 8px rgba(8, 36, 62, 0.35));
}

.brand-emblem-art {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
}

.brand-tag {
  font-size: 1.12rem;
  max-width: 40ch;
}

.app-shell-header {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) auto minmax(280px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.header-github-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 5.2rem;
  height: 5.2rem;
  padding: 0;
  color: rgba(247, 239, 216, 0.96);
  text-decoration: none;
  line-height: 0;
  flex: 0 0 auto;
  justify-self: center;
  align-self: start;
}

.header-github-link svg {
  display: block;
  width: 4rem;
  height: 4rem;
  fill: currentColor;
  filter:
    drop-shadow(0 0 0.9rem rgba(89, 183, 255, 0.34))
    drop-shadow(0 0 1.6rem rgba(89, 183, 255, 0.14));
}

.header-github-link:hover,
.header-github-link:focus-visible {
  color: #fff3e8;
}

.header-github-link:hover svg,
.header-github-link:focus-visible svg {
  filter:
    drop-shadow(0 0 0.45rem rgba(255, 216, 74, 0.44))
    drop-shadow(0 0 1.2rem rgba(255, 174, 26, 0.22));
}

.header-instructions {
  align-content: start;
  min-width: 0;
  padding: 12px 14px;
  border: 3px solid rgba(8, 36, 62, 0.88);
  background:
    radial-gradient(circle at top left, rgba(255, 216, 74, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(11, 33, 53, 0.96), rgba(6, 19, 35, 0.94));
  box-shadow:
    inset 0 0 0 1px rgba(255, 216, 74, 0.22),
    0 0 14px rgba(255, 216, 74, 0.08);
}

.instruction-line {
  font-size: 1.04rem;
  line-height: 1.18;
  color: var(--ui-text);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 32px;
  padding: 8px 12px;
  color: var(--ui-accent);
  background: rgba(255, 216, 74, 0.12);
  border: 2px solid rgba(255, 216, 74, 0.28);
  text-transform: uppercase;
  font-size: 0.68rem;
}

.status-text {
  color: var(--ui-text);
  font-size: 1.08rem;
  line-height: 1.2;
}

.card-head {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 12px;
}

.card-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--ui-accent), transparent);
  box-shadow:
    0 0 10px var(--ui-accent-glow),
    0 0 18px var(--ui-accent-glow-soft);
}

.dropzone {
  width: 100%;
  padding: 24px 14px;
  display: grid;
  gap: 8px;
  text-align: left;
  color: var(--ui-text-bright);
  background:
    radial-gradient(circle at top left, rgba(255, 216, 74, 0.14), transparent 36%),
    linear-gradient(180deg, #0d2d49, #061626);
}

.dropzone strong {
  font-size: 1.56rem;
  line-height: 1.08;
  text-transform: uppercase;
}

.dropzone span {
  font-size: 1.08rem;
  line-height: 1.18;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field {
  display: grid;
  gap: 7px;
}

.field-label {
  font-size: 0.84rem;
  line-height: 1;
  text-transform: uppercase;
  color: var(--ui-text-muted);
}

.field-heading,
.toggle-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.help-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 216, 74, 0.28);
  background: rgba(255, 216, 74, 0.12);
  color: var(--ui-accent);
  font-family: "Press Start 2P", "VT323", monospace;
  font-size: 0.5rem;
  line-height: 1;
  cursor: help;
}

.help-tip:focus-visible {
  outline: 2px dotted var(--ui-text-muted);
  outline-offset: 2px;
}

.field-control {
  width: 100%;
  box-sizing: border-box;
  min-height: 42px;
  padding: 8px 10px;
  font-size: 1.02rem;
  line-height: 1.1;
  color: var(--ui-text);
  border: 3px solid var(--ui-panel-border);
  border-bottom-width: 4px;
  background: linear-gradient(180deg, #0d2944, #07182b);
}

select.field-control {
  color: var(--ui-text-bright);
  color-scheme: dark;
}

select.field-control option,
select.field-control optgroup {
  color: var(--ui-text-bright);
  background: #07182b;
}

.field-control::placeholder {
  color: rgba(211, 187, 127, 0.76);
}

.toggle-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  color: var(--ui-text);
  background: linear-gradient(180deg, #0c2842, #061726);
}

.toggle-row input {
  width: 20px;
  height: 20px;
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 10px 14px;
  font-size: 0.64rem;
  line-height: 1.15;
  border: 4px solid rgba(255, 216, 74, 0.34);
  border-bottom-width: 5px;
  color: var(--ui-text-bright);
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(255, 248, 210, 0.12);
  background:
    radial-gradient(circle at top center, rgba(255, 243, 181, 0.16), transparent 52%),
    linear-gradient(180deg, #225d88, #14395d 62%, #0b2643);
  box-shadow:
    inset 0 0 0 1px rgba(255, 243, 181, 0.16),
    inset 0 0 14px rgba(255, 216, 74, 0.14),
    0 0 0 1px rgba(255, 216, 74, 0.18),
    0 0 16px rgba(255, 216, 74, 0.12),
    0 4px 0 rgba(0, 0, 0, 0.28);
}

.button::after {
  content: ">";
  margin-left: 6px;
  opacity: 0.7;
  color: var(--ui-accent);
}

.button-secondary {
  background:
    radial-gradient(circle at top center, rgba(255, 243, 181, 0.11), transparent 52%),
    linear-gradient(180deg, #1d5278, #113250 62%, #091f36);
}

.button-small {
  min-height: 32px;
  padding: 8px 12px;
  font-size: 0.56rem;
}

.button:hover,
.button:focus-visible {
  color: #fff7cf;
  border-color: rgba(255, 216, 74, 0.92);
  background:
    radial-gradient(circle at top center, rgba(255, 243, 181, 0.3), transparent 48%),
    linear-gradient(180deg, #286793, #103453);
  box-shadow:
    inset 0 0 20px rgba(255, 243, 181, 0.2),
    0 0 22px rgba(255, 216, 74, 0.34),
    0 0 34px rgba(255, 216, 74, 0.16),
    0 0 0 1px rgba(255, 243, 181, 0.28),
    0 4px 0 rgba(0, 0, 0, 0.28);
}

.viewer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.status-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
}

.status-stage {
  margin: 0;
  font-size: 1.22rem;
  line-height: 1.1;
  color: var(--ui-text-bright);
}

.loss-canvas {
  width: 100%;
  height: 148px;
  display: block;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    linear-gradient(180deg, #0b2138, #050f1c);
}

.loss-canvas[hidden] {
  display: none;
}

.viewer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.viewer-inspect-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 12px;
}

.viewer-inspect-field {
  width: min(100%, 208px);
  min-width: 168px;
  flex: 0 0 auto;
  margin-left: auto;
}

.viewer-inspect-label {
  flex: 0 0 auto;
  white-space: nowrap;
}

.viewer-inspect-field select {
  width: 100%;
}

.viewer-inspect-copy {
  flex: 1 1 320px;
  margin: 0;
  min-width: 220px;
  font-size: 1rem;
  line-height: 1.2;
  color: var(--ui-text-muted);
}

.queue-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.viz-card {
  margin: 0;
  padding: 10px;
  display: grid;
  gap: 10px;
  background:
    radial-gradient(circle at top left, rgba(255, 216, 74, 0.08), transparent 34%),
    linear-gradient(180deg, #0b233b, #061321);
}

.viz-label {
  font-size: 0.74rem;
  color: var(--ui-accent);
  text-transform: uppercase;
}

.viz-card canvas {
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
  touch-action: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, rgba(5, 11, 13, 0.8), rgba(6, 14, 16, 0.92));
  border: 3px solid rgba(8, 36, 62, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(255, 216, 74, 0.15),
    0 0 14px rgba(255, 216, 74, 0.06);
}

.viz-card canvas.is-inspecting {
  cursor: grabbing;
}

.metrics-panel {
  display: grid;
  gap: 10px;
}

.status-panel {
  display: grid;
  gap: 14px;
  align-content: start;
  align-self: stretch;
  justify-self: stretch;
  padding: 16px 18px;
  width: 100%;
  max-width: none;
}

.status-activity {
  position: relative;
  height: 10px;
  overflow: hidden;
  border: 2px solid rgba(255, 216, 74, 0.18);
  background:
    linear-gradient(180deg, rgba(5, 14, 24, 0.9), rgba(6, 18, 31, 0.94));
}

.status-activity-bar {
  display: block;
  width: 36%;
  height: 100%;
  background:
    linear-gradient(90deg, transparent, rgba(255, 216, 74, 0.92), rgba(143, 226, 200, 0.9), transparent);
  transform: translateX(-120%);
  animation: status-sweep 1.35s linear infinite;
  animation-play-state: paused;
}

.status-panel[data-job-state="queued"] .status-activity-bar,
.status-panel[data-job-state="running"] .status-activity-bar,
.status-panel[data-job-state="waiting"] .status-activity-bar {
  animation-play-state: running;
}

.status-panel[data-job-state="failed"] .status-activity-bar {
  animation-play-state: paused;
  transform: translateX(0);
  width: 100%;
  background: linear-gradient(90deg, rgba(210, 78, 62, 0.75), rgba(255, 137, 95, 0.88));
}

.status-panel[data-job-state="completed"] .status-activity-bar {
  animation-play-state: paused;
  transform: translateX(0);
  width: 100%;
  background: linear-gradient(90deg, rgba(143, 226, 200, 0.82), rgba(255, 216, 74, 0.72));
}

.status-metrics {
  --status-metric-count: 1;
  display: grid;
  grid-template-columns: repeat(var(--status-metric-count), minmax(96px, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 10px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.info-card {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  border: 3px solid rgba(8, 36, 62, 0.88);
  background: linear-gradient(180deg, rgba(11, 32, 52, 0.96), rgba(6, 19, 35, 0.94));
  box-shadow:
    inset 0 0 0 1px rgba(255, 216, 74, 0.22),
    0 0 14px rgba(255, 216, 74, 0.08);
}

.info-card strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ui-accent);
  font-family: "Press Start 2P", "VT323", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.info-card span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.status-metric {
  min-height: 72px;
  padding: 8px 10px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
}

.status-metric strong {
  margin-bottom: 4px;
  font-size: 0.58rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-metric span {
  font-size: 1rem;
  line-height: 1.12;
  color: var(--ui-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

@keyframes status-sweep {
  from {
    transform: translateX(-120%);
  }

  to {
    transform: translateX(320%);
  }
}

.editor-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}

.editor-button-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.editor-toolbar-spacer {
  flex: 1 1 0;
  min-width: 0;
}

.editor-canvas-card {
  width: clamp(148px, 16vw, 196px);
  min-width: 148px;
  max-width: 196px;
  padding: 10px 12px;
  margin-left: auto;
}

.editor-canvas-card span {
  color: var(--ui-text-bright);
  font-variant-numeric: tabular-nums;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px;
  background: linear-gradient(180deg, #0b233b, #061321);
}

.editor-paint-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.paint-swatch {
  width: 60px;
  height: 60px;
  border: 3px solid rgba(8, 36, 62, 0.9);
  box-shadow:
    inset 0 0 0 2px rgba(255, 216, 74, 0.22),
    0 0 16px rgba(255, 216, 74, 0.08);
}

.editor-rgba-fields {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.editor-rgba-fields .field {
  min-width: 82px;
}

.editor-rgba-fields .field-control {
  min-height: 38px;
  padding: 6px 8px;
}

.editor-zoom-control {
  min-width: 0;
  width: min(100%, 180px);
  overflow: hidden;
}

.editor-zoom-control input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  height: 28px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.editor-zoom-control input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border: 2px solid rgba(255, 216, 74, 0.48);
  background: linear-gradient(180deg, rgba(9, 27, 44, 0.98), rgba(5, 16, 28, 0.96));
  box-shadow: inset 0 0 0 1px rgba(8, 36, 62, 0.9);
}

.editor-zoom-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 2px solid rgba(255, 216, 74, 0.86);
  background: #ffd84a;
  box-shadow: 0 0 10px rgba(255, 216, 74, 0.32);
}

.editor-zoom-control input[type="range"]::-moz-range-track {
  height: 8px;
  border: 2px solid rgba(255, 216, 74, 0.48);
  background: linear-gradient(180deg, rgba(9, 27, 44, 0.98), rgba(5, 16, 28, 0.96));
  box-shadow: inset 0 0 0 1px rgba(8, 36, 62, 0.9);
}

.editor-zoom-control input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 216, 74, 0.86);
  background: #ffd84a;
  box-shadow: 0 0 10px rgba(255, 216, 74, 0.32);
}

.editor-zoom-control input[type="range"]::-moz-focus-outer {
  border: 0;
}

.editor-stage {
  display: block;
}

.checkerboard {
  background:
    linear-gradient(45deg, var(--checker-a) 25%, transparent 25%) 0 0 / 20px 20px,
    linear-gradient(-45deg, var(--checker-a) 25%, transparent 25%) 0 10px / 20px 20px,
    linear-gradient(45deg, transparent 75%, var(--checker-b) 75%) 10px -10px / 20px 20px,
    linear-gradient(-45deg, transparent 75%, var(--checker-b) 75%) -10px 0 / 20px 20px,
    linear-gradient(180deg, #07172c, #0a2039);
}

.editor-surface {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 420px;
  overflow: auto;
  padding: 16px;
  overscroll-behavior: contain;
}

.editor-surface canvas {
  position: absolute;
  top: 16px;
  left: 16px;
  cursor: crosshair;
}

.editor-surface.is-eyedropper canvas {
  cursor: copy;
}

.editor-surface.is-panning,
.editor-surface.is-panning canvas {
  cursor: grabbing;
}

#editorGridCanvas {
  pointer-events: none;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--ui-accent);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px dotted var(--ui-text-muted);
  outline-offset: 2px;
}

@media (max-width: 1200px) {
  .app-grid,
  .editor-stage {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 940px) {
  .app-shell-header,
  .viewer-grid,
  .controls-grid {
    grid-template-columns: 1fr;
  }

  .card-head {
    flex-wrap: wrap;
  }

  .viewer-head {
    align-items: flex-start;
  }

  .header-github-link {
    justify-self: start;
  }

  .brand-lockup {
    flex-direction: column;
    align-items: flex-start;
  }

  .editor-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 700px) {
  body {
    font-size: 17px;
  }

  .shell {
    width: min(100vw - 8px, 100%);
    padding: 8px;
    margin: 4px auto;
  }

  .app-shell-header,
  .hero,
  .card {
    padding: 8px;
  }

  .brand-emblem {
    width: 108px;
    height: 108px;
  }

  .brand-tag,
  .copy-tag {
    font-size: 0.92rem;
  }

  .button {
    width: 100%;
  }

  .editor-button-group {
    width: 100%;
  }

  .editor-toolbar-spacer {
    display: none;
  }

  .status-metrics {
    grid-template-columns: repeat(var(--status-metric-count), minmax(88px, 1fr));
  }
}
