:root {
  color-scheme: dark;
  --bg: #070a0b;
  --bg-soft: #0d1113;
  --panel: #121719;
  --panel-2: #192023;
  --line: rgba(248, 250, 245, 0.11);
  --line-strong: rgba(248, 250, 245, 0.22);
  --text: #f8faf5;
  --muted: #9aa59d;
  --acid: #c7ff41;
  --mint: #6bffbd;
  --sky: #75d7ff;
  --gold: #ffbd4a;
  --pink: #ff5f7e;
  --violet: #9a83ff;
  --danger: #ff6b6b;
  --radius: 8px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(117, 215, 255, 0.08), transparent 360px),
    linear-gradient(135deg, rgba(199, 255, 65, 0.07), transparent 460px),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 82%);
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1500px, calc(100% - 28px));
  margin: 0 auto;
  padding: 14px 0 34px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 10, 11, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 13px);
  gap: 3px;
  flex: 0 0 auto;
  padding: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #050708;
}

.brand-mark i {
  width: 13px;
  height: 13px;
  border-radius: 2px;
}

.brand-mark i:nth-child(1) {
  background: var(--acid);
}

.brand-mark i:nth-child(2) {
  background: var(--sky);
}

.brand-mark i:nth-child(3) {
  background: var(--gold);
}

.brand-mark i:nth-child(4) {
  background: var(--pink);
}

.brand-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-copy strong {
  overflow: hidden;
  font-size: 1rem;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.8rem;
}

.nav-tabs {
  display: flex;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
}

.nav-tabs button,
.segmented button,
.wallet-button,
.primary-button,
.secondary-button,
.secondary-link,
.ghost-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  text-decoration: none;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 150ms ease;
}

.nav-tabs button {
  padding: 0 13px;
  white-space: nowrap;
}

.nav-tabs button.active,
.segmented button.active {
  border-color: rgba(199, 255, 65, 0.68);
  color: #071008;
  background: var(--acid);
}

.wallet-button {
  min-width: 112px;
  padding: 0 14px;
}

.wallet-button.connected {
  border-color: rgba(107, 255, 189, 0.54);
  color: var(--mint);
}

.wallet-picker {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: start end;
  padding: 82px max(14px, calc((100vw - 1500px) / 2 + 14px)) 14px 14px;
}

.wallet-picker-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.45);
  cursor: default;
}

.wallet-picker-panel {
  position: relative;
  z-index: 1;
  width: min(360px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 23, 25, 0.98);
  box-shadow: var(--shadow);
}

.wallet-picker-close {
  min-height: 30px;
}

.wallet-options {
  display: grid;
  gap: 8px;
}

.wallet-option {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 54px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
}

.wallet-option:hover {
  border-color: rgba(199, 255, 65, 0.5);
  background: rgba(199, 255, 65, 0.08);
}

.wallet-option img,
.wallet-option-icon {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  object-fit: cover;
}

.wallet-option-icon {
  display: grid;
  place-items: center;
  color: #071008;
  background: linear-gradient(135deg, var(--acid), var(--sky));
  font-weight: 900;
}

.wallet-option strong,
.wallet-option small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-option strong {
  font-size: 0.94rem;
}

.wallet-option small,
.wallet-empty {
  color: var(--muted);
  font-size: 0.76rem;
}

.wallet-option small {
  margin-top: 2px;
}

.wallet-empty {
  line-height: 1.4;
}

.nav-tabs button:hover,
.segmented button:hover,
.wallet-button:hover,
.primary-button:hover,
.secondary-button:hover,
.secondary-link:hover,
.ghost-button:hover,
.pixel-cell:hover {
  transform: translateY(-1px);
}

main {
  margin-top: 16px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.board-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 438px;
  gap: 16px;
  align-items: start;
}

.board-main,
.reserve-rail,
.studio-layout,
.testnet-layout,
.contracts-layout {
  min-width: 0;
}

.board-main {
  display: grid;
  grid-template-areas:
    "grid";
}

.board-heading {
  grid-area: heading;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 8px;
}

.kicker {
  color: var(--acid);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 940px;
  margin-top: 5px;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-top: 4px;
  font-size: 1.75rem;
  line-height: 1.02;
  letter-spacing: 0;
}

h3 {
  font-size: 1rem;
  line-height: 1.2;
}

.market-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(95px, 1fr));
  gap: 1px;
  min-width: 410px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.market-strip span {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.8rem;
}

.market-strip strong {
  color: var(--text);
  font-size: 1.02rem;
}

.board-toolbar {
  grid-area: toolbar;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  overflow-x: auto;
}

.segmented button {
  min-width: 82px;
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.88rem;
}

.formula-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(117, 215, 255, 0.24);
  border-radius: 7px;
  color: #d8f3ff;
  background: rgba(117, 215, 255, 0.075);
  font-size: 0.9rem;
  white-space: nowrap;
}

.grid-frame {
  grid-area: grid;
  width: min(100%, calc(100svh - 122px), 1100px);
  margin-inline: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    #080b0c;
  background-size: 20px 20px;
  box-shadow: var(--shadow);
}

.pixel-board {
  display: grid;
  grid-template-columns: repeat(20, minmax(0, 1fr));
  gap: 4px;
}

.pixel-cell {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  aspect-ratio: 1;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 4px;
  color: var(--cell-text, rgba(248, 250, 245, 0.88));
  background: #111719;
  overflow: hidden;
  text-align: center;
}

.pixel-cell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--cell-bg, rgba(255, 255, 255, 0.025));
  opacity: 0.95;
}

.pixel-cell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 44%);
  opacity: 0.45;
}

.pixel-cell span,
.pixel-cell small {
  position: relative;
  z-index: 1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pixel-cell span {
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1;
}

.pixel-cell small {
  margin-top: 2px;
  color: currentColor;
  font-size: 0.55rem;
  line-height: 1;
  opacity: 0.74;
}

.pixel-cell.free {
  color: rgba(248, 250, 245, 0.24);
  background: #0e1315;
}

.pixel-cell.free span,
.pixel-cell small {
  display: none;
}

.pixel-cell.pending {
  color: #c0c6c8;
  background: #161b1d;
}

.pixel-cell.pending::before {
  background: linear-gradient(135deg, #343a3d, #1b2022);
  opacity: 1;
}

.pixel-cell.selected {
  border-color: var(--acid);
  box-shadow: inset 0 0 0 1px var(--acid), 0 0 0 2px rgba(199, 255, 65, 0.18);
}

.pixel-cell.mine {
  border-color: rgba(107, 255, 189, 0.78);
}

.pixel-cell.queued {
  border-color: rgba(199, 255, 65, 0.54);
  border-style: dashed;
}

.pixel-cell.dimmed {
  opacity: 0.28;
}

.legend {
  grid-area: legend;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.board-control-panel {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 12px;
}

.board-control-panel .board-heading {
  grid-area: auto;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 0;
}

.board-control-panel h1 {
  max-width: 100%;
  font-size: clamp(1.28rem, 1.45vw, 1.68rem);
  line-height: 1.05;
}

.board-control-panel .market-strip {
  min-width: 0;
}

.board-control-panel .board-toolbar {
  position: relative;
  z-index: 1;
  grid-area: auto;
  align-items: stretch;
  flex-direction: column;
  margin-bottom: 0;
}

.board-control-panel .formula-pill,
.board-control-panel .segmented {
  width: 100%;
}

.board-control-panel .formula-pill {
  justify-content: center;
}

.board-control-panel .segmented {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: visible;
}

.board-control-panel .segmented button {
  flex: 1 1 0;
  min-width: 0;
}

.board-control-panel .legend {
  grid-area: auto;
  margin-top: 0;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-live {
  background: var(--sky);
}

.legend-free {
  background: #263033;
}

.legend-pending {
  background: #596164;
}

.legend-selected {
  background: var(--acid);
}

.tx-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin: -2px 0 12px;
  color: var(--sky);
  font-size: 0.9rem;
  font-weight: 760;
  text-decoration: none;
}

.form-tx-link {
  min-height: 28px;
  margin: -6px 0 0;
}

.hidden {
  display: none !important;
}

.reserve-rail,
.studio-side {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 12px;
}

.panel,
.economy-band,
.policy-note,
.risk-band {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 23, 25, 0.9);
  box-shadow: var(--shadow);
}

.panel {
  min-width: 0;
  width: 100%;
  padding: 15px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 13px;
}

.panel-heading span,
.slot-meta dt,
.metadata-list dt {
  color: var(--muted);
  font-size: 0.84rem;
}

.panel-heading strong {
  color: var(--acid);
  font-size: 0.88rem;
  text-align: right;
}

.creative-preview {
  display: grid;
  gap: 7px;
  min-height: 142px;
  margin-bottom: 12px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  color: #071008;
  background: linear-gradient(135deg, var(--acid), var(--sky));
  overflow: hidden;
}

.creative-preview.has-image {
  background-position: center;
  background-size: cover;
}

.creative-preview.has-image span,
.creative-preview.has-image strong,
.creative-preview.has-image small {
  width: fit-content;
  max-width: 100%;
  padding: 3px 6px;
  border-radius: 5px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.72);
}

.creative-preview span {
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.creative-preview strong {
  overflow-wrap: anywhere;
  font-size: 1.45rem;
  line-height: 1.04;
}

.creative-preview small {
  color: inherit;
  font-size: 0.9rem;
  line-height: 1.35;
}

.slot-meta,
.metadata-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.slot-meta div,
.metadata-list div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
}

.slot-meta dd,
.metadata-list dd {
  margin-top: 5px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.slot-meta .slot-meta-wide {
  grid-column: 1 / -1;
}

.tx-hash-link {
  color: var(--sky);
  text-decoration: none;
}

.tx-hash-link.is-empty {
  color: var(--muted);
  pointer-events: none;
}

.reserve-form,
.studio-layout,
.contracts-layout,
.testnet-layout {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #dce5df;
  font-size: 0.9rem;
  font-weight: 760;
}

.palette-builder {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 76px;
  gap: 8px;
  align-items: end;
}

.color-field {
  gap: 6px;
}

.color-field input {
  min-height: 42px;
  padding: 3px;
}

.symbol-preview {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--symbol-text, #071008);
  background: linear-gradient(135deg, var(--symbol-bg, #c7ff41), var(--symbol-accent, #75d7ff));
  overflow: hidden;
}

.symbol-preview span {
  position: relative;
  z-index: 1;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}

.batch-panel {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
}

.batch-heading,
.batch-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.batch-heading span,
.batch-panel p {
  color: var(--muted);
  font-size: 0.84rem;
}

.batch-heading strong {
  color: var(--acid);
  font-size: 0.88rem;
  text-align: right;
}

.batch-panel p {
  line-height: 1.42;
}

input,
textarea {
  min-width: 0;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: #0a0e0f;
  outline: none;
}

input {
  padding: 0 11px;
}

textarea {
  min-height: 76px;
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.45;
}

input:focus,
textarea:focus {
  border-color: rgba(199, 255, 65, 0.72);
  box-shadow: 0 0 0 3px rgba(199, 255, 65, 0.12);
}

.wallet-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.wallet-metrics span {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.83rem;
}

.wallet-metrics strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.primary-button {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  color: #071008;
  background: var(--acid);
  font-weight: 900;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.secondary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.secondary-button,
.secondary-link,
.ghost-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: fit-content;
  padding: 0 13px;
  font-weight: 760;
}

.secondary-link {
  border-color: rgba(117, 215, 255, 0.3);
  color: var(--sky);
}

.ghost-button {
  min-height: 34px;
  color: var(--muted);
}

.form-status {
  min-height: 20px;
  color: var(--mint);
  font-size: 0.88rem;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.form-status.error {
  color: var(--danger);
}

.economy-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  gap: 16px;
  align-items: center;
  margin-top: 16px;
  padding: 18px;
}

.curve-table {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.curve-table span {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.curve-table b {
  color: var(--muted);
  font-size: 0.76rem;
}

.studio-layout {
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
}

.section-heading {
  margin-bottom: 2px;
}

.studio-grid,
.architecture-grid,
.steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.upload-zone {
  min-height: 112px;
  padding: 16px;
  border: 1px dashed rgba(199, 255, 65, 0.36);
  border-radius: var(--radius);
  background: rgba(199, 255, 65, 0.045);
  cursor: pointer;
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-zone span {
  font-size: 1rem;
}

.upload-zone small {
  color: var(--muted);
  font-weight: 500;
  line-height: 1.42;
}

.upload-preview {
  display: grid;
  place-items: center;
  min-height: 220px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: #0a0e0f;
  overflow: hidden;
}

.upload-preview img {
  width: 100%;
  height: 100%;
  max-height: 320px;
  object-fit: cover;
}

#paintCanvas {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #050708;
  image-rendering: pixelated;
  touch-action: none;
}

.paint-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.paint-swatch {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paint-color);
}

.paint-swatch.active {
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.13);
}

.metadata-box,
.code-panel pre {
  overflow: auto;
  min-height: 154px;
  margin: 12px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #dfffe8;
  background: #070a0b;
  font: 0.83rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.policy-note {
  padding: 15px;
  color: #dbe6de;
}

.policy-note strong {
  display: block;
  margin-bottom: 8px;
  color: var(--acid);
}

.policy-note p {
  color: #c5d0c8;
  line-height: 1.55;
}

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

.step,
.contract-strip article,
.architecture-item {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 23, 25, 0.9);
  box-shadow: var(--shadow);
}

.step span,
.architecture-item span,
.contract-strip span {
  color: var(--acid);
  font-size: 0.78rem;
  font-weight: 900;
}

.step p,
.architecture-item p,
.risk-band p {
  color: #c5d0c8;
  line-height: 1.5;
}

.contract-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.contract-strip strong,
.contract-strip a {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 860;
}

.contract-strip a {
  color: var(--sky);
  text-decoration: none;
}

.contract-strip small {
  color: var(--muted);
}

.architecture-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.risk-band {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
}

.risk-band div {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.035);
}

@media (max-width: 1180px) {
  .board-layout,
  .studio-layout {
    grid-template-columns: 1fr;
  }

  .reserve-rail,
  .studio-side {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .steps,
  .architecture-grid,
  .contract-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 880px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px;
  }

  .nav-tabs {
    justify-content: center;
  }

  .wallet-button {
    width: auto;
  }

  .board-heading,
  .economy-band {
    grid-template-columns: 1fr;
  }

  .board-main {
    grid-template-areas:
      "grid"
      "heading"
      "toolbar"
      "legend";
  }

  .board-heading {
    gap: 8px;
    margin: 8px 0 0;
  }

  .board-heading .kicker {
    display: none;
  }

  .board-heading h1 {
    margin-top: 0;
    font-size: 1.22rem;
    line-height: 1.08;
  }

  .market-strip {
    min-width: 0;
  }

  .board-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .formula-pill,
  .segmented {
    width: 100%;
  }

  .segmented button {
    min-width: 74px;
  }

  .pixel-board {
    grid-template-columns: repeat(20, minmax(0, 1fr));
  }

  .curve-table,
  .studio-grid,
  .reserve-rail,
  .studio-side,
  .risk-band {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 12px, 1500px);
    padding-top: 6px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    padding: 6px;
  }

  .brand {
    gap: 7px;
    grid-column: 1;
    grid-row: 1;
  }

  .brand-mark {
    grid-template-columns: repeat(2, 9px);
    gap: 2px;
    padding: 5px;
  }

  .brand-mark i {
    width: 9px;
    height: 9px;
  }

  .brand-copy strong {
    font-size: 0.9rem;
  }

  .brand-copy small {
    display: none;
  }

  .nav-tabs {
    grid-column: 1 / -1;
    grid-row: 2;
    gap: 4px;
  }

  .nav-tabs button {
    flex: 1 1 0;
    min-height: 30px;
    padding: 0 6px;
    font-size: 0.78rem;
  }

  .wallet-button {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    width: auto;
    min-width: 84px;
    min-height: 30px;
    padding: 0 9px;
    font-size: 0.78rem;
  }

  .wallet-picker {
    place-items: end stretch;
    padding: 10px;
  }

  .wallet-picker-panel {
    width: 100%;
  }

  main {
    margin-top: 6px;
  }

  .board-layout {
    gap: 9px;
  }

  .board-main {
    grid-template-areas:
      "grid"
      "heading"
      "toolbar"
      "legend";
  }

  .board-heading {
    grid-template-columns: 1fr;
    gap: 7px;
    margin: 8px 0 0;
  }

  .board-heading .kicker {
    display: none;
  }

  h1 {
    margin-top: 0;
    font-size: 1.08rem;
    line-height: 1.1;
  }

  h2 {
    font-size: 1.55rem;
  }

  .panel,
  .economy-band,
  .step,
  .architecture-item,
  .risk-band div {
    padding: 12px;
  }

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

  .market-strip span {
    min-width: 0;
    padding: 6px;
    font-size: 0.64rem;
  }

  .market-strip strong {
    font-size: 0.76rem;
  }

  .slot-meta,
  .metadata-list,
  .wallet-metrics,
  .steps,
  .architecture-grid,
  .contract-strip {
    grid-template-columns: 1fr;
  }

  .pixel-board {
    gap: 2px;
    grid-template-columns: repeat(20, minmax(0, 1fr));
  }

  .pixel-cell {
    min-height: 0;
    padding: 1px;
    border-radius: 2px;
  }

  .pixel-cell span,
  .pixel-cell small {
    font-size: 0.46rem;
  }

  .pixel-cell small,
  .legend {
    display: none;
  }

  .grid-frame {
    padding: 4px;
  }

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

  .symbol-preview {
    grid-column: 1 / -1;
  }

  .batch-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .batch-actions .secondary-button,
  .batch-actions .ghost-button {
    width: 100%;
  }
}

@media (max-height: 780px) and (min-width: 561px) {
  .pixel-cell {
    padding: 2px;
  }

  .pixel-cell span {
    font-size: 0.5rem;
  }

  .pixel-cell small {
    display: none;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.wallet-control { position: relative; justify-self: end; }
.wallet-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 8px; background: #131a1c; box-shadow: var(--shadow); }
.wallet-menu button, .wallet-menu a { display: flex; gap: 9px; align-items: center; width: 100%; padding: 10px; border: 0; border-radius: 4px; background: transparent; color: var(--text); font-size: 0.8rem; text-decoration: none; text-align: left; }
.wallet-menu button:hover, .wallet-menu a:hover { background: rgba(255, 255, 255, 0.07); }

@media (max-width: 560px) {
  .wallet-control { grid-column: 2; grid-row: 1; }
}

.lucide { width: 18px; height: 18px; flex-shrink: 0; }
.primary-button, .secondary-button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; }
.board-control-panel { background: #101516; box-shadow: none; }
.board-control-panel .board-heading { display: block; margin-bottom: 12px; }
.board-control-panel h1 { font-size: 1.55rem; line-height: 1.1; }
.board-control-panel .market-strip { margin-top: 14px; min-width: 0; width: 100%; }
.board-control-panel .board-toolbar { margin-bottom: 0; }
.board-control-panel .segmented { width: 100%; }
.board-control-panel .segmented button { flex: 1; min-width: 0; padding: 0 6px; }
.placement-offer { display: flex; justify-content: space-between; gap: 10px; margin: 14px 0; }
.placement-offer span, .draft-price { display: grid; gap: 4px; color: var(--muted); font-size: 0.76rem; }
.placement-offer strong, .draft-price strong { color: var(--text); font-size: 0.9rem; }
.board-control-panel .legend { margin-top: 12px; gap: 10px; font-size: 0.72rem; }
.board-control-panel #openBuilderButton { min-height: 42px; width: 100%; }
.account-panel { border-block: 1px solid var(--line); padding: 12px 0; }
.activity-status { font-size: 0.78rem; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.activity-status p:empty { display: none; }
.activity-status .error { color: var(--danger); }
.activity-status .tx-link { margin-top: 6px; font-size: 0.78rem; }
.account-panel .wallet-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.add-token-button { margin-top: 10px; min-height: 34px; font-size: 0.76rem; }
.transaction-intent { min-width: 0; padding: 12px 0; border-block: 1px solid var(--line); }
.transaction-intent .panel-heading { flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.transaction-intent .panel-heading strong { font-size: 0.9rem; }
.transaction-intent .panel-heading span { font-size: 0.72rem; color: var(--sky); }
.transaction-intent dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.transaction-intent dl > div:first-child, .transaction-intent dl > div:nth-child(2) { grid-column: 1 / -1; }
.transaction-intent dt { color: var(--muted); font-size: 0.7rem; }
.transaction-intent dd { margin: 4px 0 0; color: var(--text); font-size: 0.8rem; overflow-wrap: anywhere; }
.transaction-intent a { color: var(--sky); }
.transaction-intent .tx-link { font-size: 0.76rem; }
#tokenImportStatus { overflow-wrap: anywhere; }
.refund-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 12px; }
.refund-row > span { display: grid; gap: 5px; color: var(--muted); font-size: 0.78rem; }
.refund-row strong { color: var(--mint); font-size: 0.95rem; }
.refund-row button { min-height: 38px; font-size: 0.8rem; }
.unlock-row { flex-wrap: wrap; }
.unlock-row button { max-width: 100%; }
.refund-detail { margin: 8px 0 0; color: var(--muted); font-size: 0.72rem; line-height: 1.5; overflow-wrap: anywhere; }
.refund-detail:empty { display: none; }
.order-summary .withdrawal-rule { grid-column: 1 / -1; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.reserve-form { gap: 12px; padding: 14px 0; border-block: 1px solid var(--line); }
.reserve-form > .panel-heading { margin: 0; }
.builder-toolbar, .builder-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.builder-toolbar > span { color: var(--muted); font-size: 0.85rem; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; padding: 0; width: 34px; height: 34px; min-width: 34px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: #151b1d; }
.icon-button:hover { color: var(--text); border-color: var(--line-strong); }
.icon-button:focus-visible, .draft-select:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.add-draft-button { color: #101706; background: var(--acid); border-color: var(--acid); }
.draft-list { display: grid; gap: 0; min-width: 0; }
.draft-item { min-width: 0; border-block-start: 1px solid var(--line); border-inline-start: 3px solid transparent; }
.draft-item.active { border-inline-start-color: var(--sky); background: rgba(117, 215, 255, 0.035); }
.draft-item.has-conflict { border-inline-start-color: var(--danger); }
.draft-item-header { display: flex; align-items: center; min-width: 0; padding: 8px 6px; gap: 6px; }
.draft-select { display: flex; flex: 1; min-width: 0; align-items: center; gap: 9px; border: 0; background: transparent; padding: 0; color: var(--text); text-align: left; }
.draft-select > .lucide { width: 14px; color: var(--muted); }
.draft-item.active .draft-select > .lucide { transform: rotate(180deg); }
.draft-mini { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; font-size: 0.65rem; font-weight: 800; border-radius: 4px; }
.draft-row-copy { display: grid; gap: 4px; flex: 1; min-width: 0; }
.draft-row-copy strong { display: flex; gap: 7px; font-size: 0.8rem; }
.draft-row-copy strong span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-row-copy small { color: var(--muted); font-size: 0.72rem; }
.has-conflict .draft-row-copy small { color: var(--danger); }
.draft-fields-mount { min-width: 0; }
.draft-item:not(.active) .draft-fields-mount { display: none; }
.tile-fields { display: grid; gap: 12px; min-width: 0; }
.draft-fields-mount .tile-fields { padding: 4px 10px 14px; }
.slot-number-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; gap: 14px; }
.draft-price { padding-bottom: 10px; }
.tile-fields label { font-size: 0.8rem; gap: 6px; }
.tile-fields input:not([type="color"]), .tile-fields textarea { padding: 10px 12px; min-height: 40px; font-size: 0.88rem; }
.tile-fields textarea { min-height: 66px; resize: vertical; }
.tile-fields .palette-builder { grid-template-columns: repeat(3, minmax(0, 1fr)) 52px; gap: 8px; }
.tile-fields .symbol-preview { grid-column: auto; min-height: 38px; align-self: end; font-size: 0.72rem; }
.tile-fields input[type="color"] { height: 38px; min-height: 38px; padding: 5px; }
.field-error, .batch-summary.error { color: var(--danger); font-size: 0.78rem; line-height: 1.45; }
.order-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.order-summary span { display: grid; gap: 5px; color: var(--muted); font-size: 0.74rem; }
.order-summary strong { color: var(--text); font-size: 1rem; }
.order-summary .order-approval { grid-column: 1 / -1; }
.order-summary > span:first-child { grid-column: 1 / -1; }
.order-summary strong { overflow-wrap: anywhere; }
.batch-summary { color: var(--muted); font-size: 0.76rem; line-height: 1.4; }
.batch-summary:empty, .form-status:empty { display: none; }
.reserve-form .primary-button { min-height: 46px; width: 100%; font-size: 0.9rem; }
.transaction-progress { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; }
.transaction-progress li { flex: 1; padding-top: 8px; border-top: 2px solid var(--line); color: var(--muted); font-size: 0.7rem; }
.transaction-progress .current { border-color: var(--sky); color: var(--sky); }
.transaction-progress .done { border-color: var(--mint); color: var(--mint); }
.selected-panel { box-shadow: none; }
.selected-panel .creative-preview { min-height: 105px; }
.selected-panel .slot-meta div { border: 0; background: transparent; border-radius: 0; padding: 8px 0; border-bottom: 1px solid var(--line); }
.my-tiles-section { padding-block: 12px; border-top: 1px solid var(--line); }
.owned-tile-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.owned-tile-select { display: grid; gap: 5px; min-width: 0; flex: 1; text-align: left; padding: 0; border: 0; background: transparent; color: var(--text); }
.owned-tile-select strong { font-size: 0.82rem; overflow-wrap: anywhere; }
.owned-tile-select small { font-size: 0.72rem; color: var(--muted); }
.pixel-cell.queued { border-style: dashed; border-color: var(--sky); }
.pixel-cell.selected { outline: 2px solid var(--acid); outline-offset: -1px; z-index: 2; }
.pixel-cell { container-type: inline-size; }
.pixel-cell span { font-size: min(0.8rem, 29cqw); text-overflow: clip; }
.grid-frame { width: min(100%, calc(100svh - 142px), 1100px); }
.grid-caption { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: min(100%, calc(100svh - 142px), 1100px); margin: 8px auto 0; color: var(--muted); font-size: 0.68rem; }
.grid-caption #gridDraftLabel { color: var(--sky); }
.tile-focus-bar { display: flex; flex: 1; min-width: 0; align-items: center; justify-content: end; gap: 6px; }
.tile-focus-bar > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--acid); }
.tile-focus-bar .icon-button { width: 30px; height: 30px; min-width: 30px; }
.selected-slot-tools { display: flex; align-items: center; gap: 8px; }
.tile-share-result { min-width: 0; color: var(--sky); font-size: 0.78rem; }
.tile-share-result p { margin: 0; }
.tile-share-result input { margin-top: 8px; width: 100%; min-width: 0; font-size: 0.78rem; }
@media (max-width: 560px) {
  .grid-caption.has-tile-link > .grid-network-label { display: none; }
  .tile-focus-bar { justify-content: start; }
  .tile-focus-bar > span { flex: 1; }
}
.is-builder .board-control-panel { padding: 0; border: 0; background: transparent; }
.is-builder .board-control-panel .board-heading,
.is-builder .board-control-panel .board-toolbar,
.is-builder .board-control-panel .placement-offer,
.is-builder .board-control-panel .legend { display: none; }
.is-builder .reserve-form { padding-top: 0; border-top: 0; }
.is-builder .account-panel { padding-top: 0; border-top: 0; }

@media (min-width: 981px) {
  .reserve-rail { max-height: calc(100svh - 110px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #303c3f transparent; padding-right: 6px; padding-bottom: 16px; }
  .builder-toolbar { position: sticky; top: 0; z-index: 4; background: #0b1112; padding-block: 5px; }
}

@media (max-width: 980px) {
  .reserve-rail { position: static; max-height: none; }
  .board-control-panel .board-heading { display: block; }
  .board-control-panel h1 { font-size: 1.35rem; }
}
