:root {
  color-scheme: dark;
  --bg: #080f1b;
  --panel: #101b2b;
  --panel-2: #142237;
  --line: #253650;
  --text: #edf5ff;
  --muted: #91a4bf;
  --blue: #168cff;
  --cyan: #39d7ff;
  --focus: rgba(57, 215, 255, 0.28);
  font-family:
    Inter,
    Segoe UI,
    system-ui,
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
  background: radial-gradient(ellipse at 80% -15%, #123b671f, transparent 48%), var(--bg);
  color: var(--text);
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
.shell {
  max-width: 1380px;
  margin: auto;
  padding: 26px clamp(16px, 3vw, 42px) 38px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  padding: 2px;
  border: 1px solid #2c5f8c;
  border-radius: 11px;
  display: block;
  object-fit: contain;
  background: linear-gradient(145deg, #123154, #0b1728);
}
.brand-name {
  font-weight: 720;
  letter-spacing: 0.01em;
}
.brand-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.local-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b9cce2;
  background: #101d2d;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
}
.local-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #46d99b;
  box-shadow: 0 0 12px #46d99b88;
}
.intro {
  margin-bottom: 22px;
}
.eyebrow {
  color: #75cfff;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}
.intro h1 {
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1.12;
  margin: 7px 0 8px;
  letter-spacing: -0.035em;
}
.intro p {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(270px, 0.9fr) minmax(340px, 1.2fr) minmax(270px, 0.9fr);
  gap: 20px;
  align-items: stretch;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #111d2d, #0e1928);
  box-shadow: 0 14px 38px #0002;
}
.controls {
  padding: 18px;
}
.design-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.design-settings-grid > .section {
  margin: 0;
  padding: 0;
  border: 0;
}
.design-settings-grid > .section + .section {
  padding-top: 18px;
  border-top: 1px solid #223149;
}
.section {
  padding: 0 0 17px;
  margin: 0 0 17px;
  border-bottom: 1px solid #223149;
}
.section:last-of-type {
  border: 0;
  padding-bottom: 4px;
  margin-bottom: 9px;
}
.section-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 13px;
}
.step {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: #143252;
  color: #75cfff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}
.section h2 {
  font-size: 13px;
  margin: 0;
  font-weight: 670;
  letter-spacing: 0.01em;
}
.section-note {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}
label {
  display: block;
  font-size: 12px;
  color: #d8e5f5;
  font-weight: 600;
  margin: 0 0 7px;
}
.field {
  margin-top: 12px;
}
.input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #2b3d56;
  border-radius: 8px;
  background: #0a1422;
  color: var(--text);
  padding: 10px 11px;
  outline: 0;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.input:focus,
.custom-select-trigger:focus-visible,
button:focus-visible,
.drop:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--focus);
}
.native-select {
  display: none;
}
.custom-select {
  position: relative;
}
.custom-select-trigger {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #2b3d56;
  border-radius: 8px;
  background: #0a1422;
  color: var(--text);
  padding: 9px 11px;
  text-align: left;
}
.select-chevron {
  width: 14px;
  height: 14px;
  flex: none;
  transition: transform 0.16s;
}
.custom-select.open .select-chevron {
  transform: rotate(180deg);
}
.custom-select-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow: auto;
  padding: 4px;
  border: 1px solid #355372;
  border-radius: 9px;
  background: #101d2d;
  box-shadow: 0 12px 28px #0008;
}
.custom-select-menu[hidden] {
  display: none;
}
.custom-select-option {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 13px;
}
.custom-select-option:hover,
.custom-select-option[aria-selected="true"],
.custom-select-option.active {
  background: #1b3857;
  color: #eff9ff;
}
.hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
  margin: 7px 0 0;
}
.drop {
  min-height: 112px;
  border: 1px dashed #355372;
  border-radius: 10px;
  background: #0b1726;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 12px;
  transition: 0.18s;
}
.drop.drag {
  border-color: var(--cyan);
  background: #112942;
}
.drop.has-file {
  border-style: solid;
  border-color: #28659a;
}
.drop-content {
  display: grid;
  justify-items: center;
  gap: 5px;
}
.upload-icon {
  width: 22px;
  height: 22px;
  color: #55caff;
}
.drop strong {
  font-size: 12px;
}
.drop span {
  font-size: 11px;
  color: var(--muted);
}
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.file-button {
  border: 1px solid #31516f;
  background: #142942;
  color: #dceeff;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 650;
  margin-top: 4px;
}
.logo-state {
  min-height: 17px;
  color: #76dbb6;
  font-size: 11px;
  margin-top: 7px;
}
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.split > div {
  min-width: 0;
}
.design-controls .split {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.color-control {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 42px;
  border: 1px solid #2b3d56;
  border-radius: 8px;
  background: #0a1422;
  padding: 5px 8px;
}
.color-control.inactive {
  opacity: 0.58;
}
.color-control:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--focus);
}
.color-control input[type="color"] {
  width: 30px;
  height: 28px;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 5px;
  cursor: pointer;
}
.color-pick {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #31516f;
  border-radius: 6px;
  background: #142942;
  color: #70dfff;
  font-size: 20px;
  line-height: 1;
  font-weight: 500;
}
.color-pick:hover,
.color-pick[aria-pressed="true"] {
  border-color: var(--cyan);
  background: #1a3552;
  color: #fff;
}
.color-control code {
  min-width: 0;
  overflow: hidden;
  color: #d5e6fb;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.select-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid #2b3d56;
  border-radius: 9px;
  background: #0a1422;
}
.segmented button {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 8px 5px;
  font-size: 11px;
}
.segmented button[aria-pressed="true"] {
  color: #eff9ff;
  background: #1a3552;
  box-shadow: inset 0 0 0 1px #2d557b;
}
.range-line {
  display: grid;
  grid-template-columns: 1fr 38px;
  align-items: center;
  gap: 12px;
}
.range-line input {
  width: 100%;
  accent-color: #20aaff;
}
.range-line output {
  text-align: right;
  color: #bdd3eb;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #d8e5f5;
  margin-top: 12px;
}
.inline-check input {
  accent-color: #18a8ff;
}
.actions {
  display: flex;
  gap: 9px;
  margin-top: 13px;
}
.primary,
.secondary {
  min-height: 42px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}
.primary {
  flex: 1;
  border: 1px solid #3cbfff;
  color: #061426;
  background: linear-gradient(110deg, #32caff, #168cff);
  box-shadow: 0 5px 18px #139dff30;
}
.secondary {
  border: 1px solid #31445f;
  color: #d9e7f6;
  background: #132034;
  padding: 0 14px;
}
.primary:hover {
  filter: brightness(1.06);
}
.secondary:hover,
.file-button:hover {
  background: #1a2d47;
}
.status {
  min-height: 18px;
  color: var(--muted);
  font-size: 11px;
  margin-top: 9px;
}
.status.error {
  color: #ff9a9a;
}
.status.good {
  color: #8de2bf;
}
.preview-panel {
  overflow: hidden;
}
.preview-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 17px 19px;
  border-bottom: 1px solid var(--line);
}
.preview-title {
  font-size: 13px;
  font-weight: 680;
}
.preview-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.preview-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}
.preview-dim {
  font-size: 11px;
  color: #b5c8df;
  font-variant-numeric: tabular-nums;
}
.zoom-controls {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid #2b3d56;
  border-radius: 8px;
  background: #0a1422;
}
.zoom-controls button {
  min-width: 28px;
  height: 26px;
  padding: 0 5px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #d8e5f5;
  font-size: 12px;
}
.zoom-controls button:hover {
  background: #1a3552;
}
.zoom-controls output {
  min-width: 38px;
  color: #b5c8df;
  font-size: 10px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.preview-body {
  padding: clamp(16px, 2vw, 24px);
  display: grid;
  place-items: center;
  min-height: 0;
}
.checker {
  position: relative;
  width: min(100%, 590px);
  aspect-ratio: 1;
  border: 1px solid #2b3b52;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background-color: #e9edf3;
  background-image:
    linear-gradient(45deg, #d5dce7 25%, transparent 25%),
    linear-gradient(-45deg, #d5dce7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d5dce7 75%),
    linear-gradient(-45deg, transparent 75%, #d5dce7 75%);
  background-size: 20px 20px;
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0;
}
.checker.white-preview {
  background: #fff;
}
.checker canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.checker > #qrCanvas {
  transform: translate3d(var(--preview-pan-x, 0px), var(--preview-pan-y, 0px), 0) scale(var(--preview-zoom, 1));
  transform-origin: center;
  transition: transform 0.16s ease;
}
.checker.can-pan > #qrCanvas {
  cursor: grab;
  transition: none;
  touch-action: none;
}
.checker.dragging,
.checker.dragging > #qrCanvas {
  cursor: grabbing;
}
.checker.picking-color,
.checker.picking-color > #qrCanvas {
  cursor: crosshair;
}
.checker.picking-color.dragging,
.checker.picking-color.dragging > #qrCanvas {
  cursor: crosshair;
}
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  min-width: 30px;
  padding: 0;
}
.icon-button svg {
  width: 15px;
  height: 15px;
}
.color-lens {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 144px;
  height: 144px;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #0a1422;
  box-shadow: 0 5px 20px #0008;
  pointer-events: none;
}
.color-lens[hidden] {
  display: none;
}
.color-lens canvas {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  image-rendering: pixelated;
}
.color-lens::before {
  position: absolute;
  z-index: 1;
  width: 16px;
  height: 16px;
  border: 1px solid #fff;
  border-radius: 2px;
  box-shadow: 0 0 0 1px #07101d;
  content: "";
}
.color-lens span {
  position: absolute;
  bottom: 12px;
  z-index: 2;
  max-width: 112px;
  overflow: hidden;
  padding: 3px 6px;
  border-radius: 4px;
  background: #08111fee;
  color: #fff;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.color-lens[data-position="top-left"] {
  top: 12px;
  left: 12px;
}
.color-lens[data-position="top-right"] {
  top: 12px;
  right: 12px;
}
.color-lens[data-position="bottom-left"] {
  bottom: 12px;
  left: 12px;
}
.color-lens[data-position="bottom-right"] {
  right: 12px;
  bottom: 12px;
}
.preview-foot {
  padding: 13px 19px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.preview-foot strong {
  color: #cfdeef;
  font-weight: 600;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 980px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .preview-header {
    padding: 15px;
  }
  .preview-foot {
    padding: 12px 15px;
  }
}
@media (max-width: 720px) {
  .shell {
    padding-top: 17px;
  }
  .topbar {
    margin-bottom: 23px;
  }
  .preview-body {
    padding: 14px;
    min-height: 0;
  }
  .checker {
    max-width: 520px;
  }
  .intro {
    margin-bottom: 17px;
  }
}
@media (max-width: 420px) {
  .split,
  .select-row {
    grid-template-columns: 1fr;
  }
  .preview-dim {
    display: none;
  }
  .preview-header {
    align-items: flex-start;
  }
  .preview-tools {
    gap: 6px;
  }
  .local-badge {
    font-size: 0;
    padding: 9px;
  }
  .local-badge i {
    font-size: initial;
  }
}

/* ==========================================================================
   ENGINE NAV SWITCHER (Hydra Standard vs. Organic Artwork Engine)
   ========================================================================== */
.engine-nav {
  display: flex;
  gap: 8px;
  margin: 0 auto 16px auto;
  max-width: 100%;
  background: #09152b;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid #1a2c4e;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.engine-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  user-select: none;
}
.engine-tab:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}
.engine-tab.active {
  background: #0e244d;
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.engine-tab svg {
  flex-shrink: 0;
}
.engine-chip {
  padding: 2px 7px;
  background: #0284c7;
  color: #ffffff;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1;
}
@media (max-width: 640px) {
  .engine-tab {
    padding: 8px 10px;
    font-size: 12px;
    gap: 6px;
  }
  .engine-tab svg {
    width: 15px;
    height: 15px;
  }
  .engine-chip {
    padding: 2px 5px;
    font-size: 9px;
  }
}

