:root {
  --ink: #121212;
  --paper: #eeeade;
  --acid: #d9ff43;
  --orange: #bb3214;
  --blue: #214fdc;
  --line: rgba(18, 18, 18, .22);
  --muted: #68665f;
  --shadow: 7px 7px 0 #121212;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { overflow-x: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.noise { position: fixed; inset: 0; z-index: 20; pointer-events: none; opacity: .07; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.34'/%3E%3C/svg%3E"); }

.topbar { height: 74px; display: grid; grid-template-columns: 280px minmax(0, 1fr) max-content; align-items: center; border-bottom: 2px solid var(--ink); position: sticky; top: 0; z-index: 15; background: rgba(238,234,222,.96); backdrop-filter: blur(12px); }
.brand { height: 100%; padding: 13px 24px; border-right: 2px solid var(--ink); display: flex; align-items: center; width: 100%; }
.brand img { display: block; width: min(224px, 100%); height: auto; }
.rule-line { min-width: 0; padding: 0 12px; text-align: center; text-transform: uppercase; font-size: 12px; letter-spacing: .09em; white-space: nowrap; }
.rule-line span { margin: 0 13px; color: var(--orange); }
.account-bar { justify-self: end; min-width: 0; height: 100%; display: flex; align-items: stretch; }
.identity-button { min-width: 150px; border: 0; border-left: 1px solid var(--line); background: transparent; padding: 11px 18px; text-align: right; cursor: pointer; }
.identity-button span, .identity-button small { display: block; }
.identity-button span { font-weight: 800; }
.identity-button small { color: var(--muted); margin-top: 2px; }
.primary { border: 2px solid var(--ink); background: var(--acid); font-weight: 900; text-transform: uppercase; letter-spacing: .04em; cursor: pointer; padding: 13px 18px; box-shadow: 4px 4px 0 var(--ink); transition: transform .12s, box-shadow .12s; }
.primary:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.primary:active { transform: translate(4px, 4px); box-shadow: none; }
.primary:disabled { cursor: not-allowed; opacity: .45; background: transparent; box-shadow: none; transform: none; }
.primary.compact { border-width: 0 0 0 2px; box-shadow: none; min-width: 124px; }
.paint-open { min-width: 138px; font-size: 13px; }
.wide { width: 100%; }
.secondary { border: 1px solid var(--ink); background: transparent; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; cursor: pointer; padding: 10px 14px; margin-top: 9px; }
.secondary:hover { background: white; }

.layout { display: grid; grid-template-columns: minmax(220px, 270px) minmax(520px, 1fr) minmax(270px, 320px); min-height: calc(100vh - 112px); }
.left-rail, .right-rail { padding: 28px 22px; }
.left-rail { border-right: 1px solid var(--line); }
.right-rail { border-left: 1px solid var(--line); padding: 20px; }
.eyebrow { font-size: 10px; font-weight: 900; letter-spacing: .18em; color: var(--orange); margin: 0 0 12px; }
.manifesto h1 { font-size: clamp(31px, 3vw, 49px); line-height: .94; letter-spacing: -.07em; margin: 0 0 22px; text-transform: uppercase; }
.manifesto h1 em { font-style: normal; color: var(--blue); }
.manifesto > p:last-child { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; line-height: 1.65; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--ink); margin: 28px 0; background: rgba(255,255,255,.23); }
.stat-grid div { padding: 13px 10px; min-width: 0; }
.stat-grid div:nth-child(odd) { border-right: 1px solid var(--line); }
.stat-grid div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
.stat-grid strong, .stat-grid span { display: block; overflow: hidden; text-overflow: ellipsis; }
.stat-grid strong { font-size: 18px; letter-spacing: -.04em; }
.stat-grid span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; margin-top: 3px; }
.instructions { border-top: 2px solid var(--ink); padding-top: 8px; }
.instructions p { font-size: 11px; font-weight: 750; text-transform: uppercase; }
.instructions span { color: var(--orange); margin-right: 9px; font-family: ui-monospace, monospace; }
.stats-entry { display: inline-block; margin-top: 8px; color: var(--blue); font-size: 9px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; text-underline-offset: 3px; }
.rail-entry { margin-top: 22px; }

.board-column { min-width: 0; padding: 18px 24px 28px; background: rgba(255,255,255,.16); }
.board-toolbar { display: flex; justify-content: space-between; align-items: center; min-height: 35px; font-size: 10px; font-weight: 850; letter-spacing: .09em; }
.live { color: var(--orange); }
.live i { display: inline-block; width: 7px; height: 7px; background: var(--orange); border-radius: 50%; margin-right: 6px; animation: pulse 1.6s infinite; }
.live span { color: var(--muted); margin-left: 11px; font-weight: 500; }
@keyframes pulse { 50% { opacity: .35; } }
.board-controls { display: flex; align-items: center; gap: 5px; }
.zoom-presets { display: flex; gap: 4px; }
.zoom-stepper { display: none; align-items: center; gap: 4px; }
.board-controls button { border: 1px solid var(--ink); background: transparent; min-width: 27px; min-height: 25px; cursor: pointer; font-weight: 900; }
.board-controls button.active { background: var(--blue); color: white; }
.zoom-label { color: var(--muted); font: 8px ui-monospace, monospace; letter-spacing: .1em; }
.board-controls strong { min-width: 27px; text-align: center; font-family: ui-monospace, monospace; font-size: 9px; }
.board-controls .studio-toggle { background: var(--blue); color: white; padding: 5px 9px; text-transform: uppercase; font-size: 8px; letter-spacing: .08em; }
.board-controls .studio-toggle.active { background: var(--orange); }
.board-frame { position: relative; width: min(100%, calc(100vh - 190px)); min-width: 360px; margin: 0 auto; border: 2px solid var(--ink); box-shadow: var(--shadow); background: #d7d4ca; }
.canvas-scroll { width: 100%; aspect-ratio: 1; overflow: auto; scrollbar-color: var(--orange) var(--paper); }
.canvas-stage { position: relative; width: 100%; height: auto; aspect-ratio: 1; }
.canvas-stage.pixel-grid::after { content: ''; position: absolute; inset: 0; z-index: 4; pointer-events: none; background-image: linear-gradient(to right, rgba(18,18,18,.24) 1px, transparent 1px), linear-gradient(to bottom, rgba(18,18,18,.24) 1px, transparent 1px); background-size: var(--pixel-size) var(--pixel-size); }
#board { display: block; width: 100%; height: 100%; image-rendering: pixelated; cursor: crosshair; background: #f7f3e8; outline: none; }
.canvas-scroll.is-pannable #board { cursor: grab; }
.canvas-scroll.is-panning #board { cursor: grabbing; }
.canvas-stage.draft-only-view #board { opacity: 0; }
#draft-layer, #guide-layer { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; }
#draft-layer { z-index: 2; }
#guide-layer { z-index: 3; }
.board-edit-active #board { cursor: crosshair; touch-action: none; }
.board-edit-active:has([data-tool="crop"].active) #board { cursor: crosshair; }
.position-active #board { cursor: grab; touch-action: none; }
.position-dragging #board { cursor: grabbing; }
#board:focus-visible { box-shadow: 0 0 0 4px var(--blue) inset; }
.pixel-cursor { position: absolute; z-index: 5; pointer-events: none; border: 1px solid var(--ink); box-shadow: 0 0 0 1px #fff inset, 0 0 0 1px #fff; min-width: 3px; min-height: 3px; }
.board-stamp { position: absolute; right: -2px; bottom: -27px; font-family: ui-monospace, monospace; font-size: 8px; font-weight: bold; letter-spacing: .1em; background: var(--ink); color: var(--paper); padding: 6px 9px; }
.palette { display: grid; grid-template-columns: repeat(12, 1fr); border: 2px solid var(--ink); margin-top: 35px; box-shadow: 4px 4px 0 var(--ink); }
.swatch { appearance: none; border: 0; border-right: 1px solid rgba(0,0,0,.28); aspect-ratio: 1.75; cursor: pointer; position: relative; }
.swatch:nth-child(12n) { border-right: 0; }
.swatch.active::after { content: ''; position: absolute; inset: 22%; border: 2px solid white; box-shadow: 0 0 0 1px #000; }

.studio-panel { border: 2px solid var(--ink); margin-top: 18px; background: rgba(255,255,255,.38); box-shadow: 5px 5px 0 var(--ink); }
.studio-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding: 17px; border-bottom: 1px solid var(--ink); }
.studio-heading .eyebrow { margin-bottom: 4px; }
.studio-heading h2 { margin: 0; text-transform: uppercase; font-size: 18px; letter-spacing: -.04em; }
.draft-total { text-align: right; white-space: nowrap; }
.draft-total span, .draft-total strong { display: block; }
.draft-total span { color: var(--muted); font: 9px ui-monospace, monospace; text-transform: uppercase; }
.draft-total strong { font-size: 27px; letter-spacing: -.06em; color: var(--blue); }
.studio-steps { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--ink); }
.studio-steps button { border: 0; border-right: 1px solid var(--ink); background: transparent; padding: 12px; text-align: left; text-transform: uppercase; font-size: 9px; font-weight: 900; letter-spacing: .08em; cursor: pointer; }
.studio-steps button:last-child { border-right: 0; }
.studio-steps button b { display: inline-grid; place-items: center; width: 19px; height: 19px; margin-right: 7px; border: 1px solid var(--ink); }
.studio-steps button.active { background: var(--blue); color: white; }
.studio-steps button:disabled { opacity: .4; cursor: default; }
.studio-phase { border-bottom: 1px solid var(--ink); }
.edit-surface { display: grid; grid-template-columns: 1fr auto auto; gap: 7px; align-items: center; padding: 9px 17px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.26); }
.edit-surface div strong, .edit-surface div span { display: block; }
.edit-surface div strong { font-size: 8px; letter-spacing: .12em; }
.edit-surface div span { margin-top: 3px; color: var(--muted); font: 8px/1.4 ui-monospace, monospace; }
.edit-surface button { border: 1px solid var(--ink); background: transparent; padding: 8px 10px; text-transform: uppercase; font-size: 8px; font-weight: 900; cursor: pointer; }
.edit-surface button.active { background: var(--blue); color: white; }
.edit-surface button:disabled { cursor: not-allowed; opacity: .4; }
.design-workspace { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(180px, .65fr); gap: 18px; padding: 17px; }
.design-pad-shell { min-width: 0; }
#design-canvas { display: block; width: min(100%, 420px); aspect-ratio: 1; image-rendering: pixelated; border: 2px solid var(--ink); background: #f7f3e8; cursor: crosshair; touch-action: none; box-shadow: 5px 5px 0 var(--ink); }
.design-pad-shell > span { display: block; width: min(100%, 420px); margin-top: 9px; text-align: right; font: 8px ui-monospace, monospace; letter-spacing: .1em; }
.design-sidebar label { display: block; margin-bottom: 13px; font-size: 8px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.design-sidebar input[type="text"], .design-sidebar input[type="number"] { width: 100%; margin-top: 5px; padding: 9px; border: 1px solid var(--ink); background: white; }
.selection-box { margin-bottom: 13px; border: 1px solid var(--ink); padding: 11px; background: rgba(217,255,67,.12); }
.selection-box > strong { font-size: 9px; letter-spacing: .1em; }
.selection-box > p { margin: 5px 0 9px; color: var(--blue); font: 800 9px/1.4 ui-monospace, monospace; }
.selection-fields { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.selection-fields label { margin: 0 0 7px; }
.selection-fields input { min-width: 0; }
.selection-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.selection-actions button { border: 1px solid var(--ink); background: transparent; padding: 7px 5px; cursor: pointer; font-size: 8px; font-weight: 900; text-transform: uppercase; }
.import-box { border: 1px solid var(--ink); padding: 13px; background: rgba(255,255,255,.3); }
.import-box > strong { text-transform: uppercase; font-size: 12px; }
.import-box > p { color: var(--muted); font-size: 9px; line-height: 1.5; }
.import-box .check-label { display: flex; align-items: start; gap: 7px; line-height: 1.4; text-transform: none; letter-spacing: 0; }
.import-size-field { display: none; margin-bottom: 13px; }
.import-size-field > span { font-size: 8px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.import-size-controls { display: grid; grid-template-columns: 1fr 72px; gap: 8px; align-items: center; margin-top: 5px; }
.design-sidebar .import-size-controls input { margin: 0; }
.import-size-controls input[type="range"] { width: 100%; accent-color: var(--blue); }
.import-preview-controls { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.import-preview-controls > strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 800 9px ui-monospace, monospace; }
.import-preview-controls > p { min-height: 28px; margin: 6px 0 9px; color: var(--blue); font: 800 9px/1.45 ui-monospace, monospace; }
.import-preview-controls > p.error { color: var(--orange); }
.import-preview-controls > div { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.import-preview-controls button { border: 1px solid var(--ink); padding: 8px; background: transparent; text-transform: uppercase; font-size: 8px; font-weight: 900; cursor: pointer; }
.import-preview-controls .primary { background: var(--acid); box-shadow: 2px 2px 0 var(--ink); }
.import-preview-controls button:disabled { cursor: not-allowed; opacity: .45; }
#design-canvas.import-preview { cursor: default; box-shadow: 5px 5px 0 var(--blue); }
.board-edit-active #design-canvas { cursor: default; opacity: .55; }
.file-button { display: block; text-align: center; font-size: 8px; }
.studio-tools { display: grid; grid-template-columns: repeat(8, 1fr); border-bottom: 1px solid var(--ink); }
.studio-tools button { border: 0; border-right: 1px solid var(--line); background: transparent; padding: 10px 5px; cursor: pointer; font-size: 18px; }
.studio-tools button:last-child { border-right: 0; }
.studio-tools button span { display: block; font-size: 7px; text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }
.studio-tools button.active { background: var(--acid); }
.studio-tools button:disabled { cursor: not-allowed; opacity: .35; }
.studio-options { display: flex; justify-content: space-between; gap: 15px; align-items: center; padding: 12px 17px; border-bottom: 1px solid var(--line); }
.studio-options label { font-size: 8px; text-transform: uppercase; font-weight: 900; letter-spacing: .08em; }
.studio-options select { margin-left: 7px; border: 1px solid var(--ink); background: var(--paper); padding: 5px; font-size: 9px; }
.history-controls { display: flex; gap: 5px; }
.history-controls button { border: 1px solid var(--ink); background: transparent; padding: 6px 9px; font-size: 8px; font-weight: 850; text-transform: uppercase; cursor: pointer; }
.history-controls button:disabled { opacity: .35; cursor: default; }
.saved-designs { display: grid; grid-template-columns: auto 1fr auto auto auto; gap: 7px; align-items: center; padding: 12px 17px; }
.saved-designs > button:not(.primary), .saved-designs select, .placement-toolbar > button:first-child, .drawing-row button { border: 1px solid var(--ink); background: transparent; padding: 8px 10px; font-size: 8px; font-weight: 850; text-transform: uppercase; cursor: pointer; }
.saved-designs select { min-width: 0; background: var(--paper); }
.saved-designs button:disabled { opacity: .35; cursor: default; }
.placement-toolbar { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 16px 17px; border-bottom: 1px solid var(--line); }
.placement-toolbar p { margin: 0; color: var(--muted); font: 9px/1.5 ui-monospace, monospace; }
.placement-view { display: grid; grid-template-columns: 1fr auto auto; gap: 7px; align-items: center; padding: 10px 17px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.26); }
.placement-view div strong, .placement-view div span { display: block; }
.placement-view div strong { font-size: 8px; letter-spacing: .12em; }
.placement-view div span { margin-top: 3px; color: var(--muted); font: 8px/1.4 ui-monospace, monospace; }
.placement-view button { border: 1px solid var(--ink); background: transparent; padding: 8px 10px; text-transform: uppercase; font-size: 8px; font-weight: 900; cursor: pointer; }
.placement-view button.active { background: var(--blue); color: white; }
.placement-readout { display: grid; grid-template-columns: repeat(3, 1fr) 112px; border-bottom: 1px solid var(--line); }
.placement-readout > div { padding: 13px 16px; border-right: 1px solid var(--line); }
.placement-readout span, .placement-readout strong { display: block; }
.placement-readout span { color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.placement-readout strong { margin-top: 3px; font-size: 17px; }
.placement-nudges { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; }
.placement-nudges button { border: 1px solid var(--ink); background: transparent; cursor: pointer; }
.placement-results { display: flex; align-items: center; gap: 6px; min-height: 0; padding: 0 17px; overflow-x: auto; }
.placement-results:not(:empty) { padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.placement-results p { flex: 0 0 auto; margin-right: 5px; font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.placement-results button { flex: 0 0 auto; border: 1px solid var(--ink); background: white; padding: 7px; font: 8px ui-monospace, monospace; cursor: pointer; }
.placement-results button.active { background: var(--blue); color: white; }
.draft-checkout { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; padding: 14px 17px; }
.draft-checkout p { margin: 0; font: 9px/1.5 ui-monospace, monospace; color: var(--muted); }
.draft-checkout .primary { min-width: 175px; }
.studio-note { margin: 0; padding: 0 17px 14px; color: var(--muted); font-size: 8px; line-height: 1.5; }
.drawing-vault { padding: 17px; border-bottom: 1px solid var(--line); }
.drawing-vault h3 { margin: 0 0 12px; text-transform: uppercase; font-size: 14px; }
.drawing-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; border-top: 1px dotted var(--line); padding: 9px 0; }
.drawing-row strong, .drawing-row span { display: block; }
.drawing-row strong { font-size: 10px; }
.drawing-row span { margin-top: 3px; color: var(--muted); font: 8px ui-monospace, monospace; }
.drawing-row button { background: var(--orange); color: white; }
.drawing-row button:disabled { background: transparent; color: var(--muted); opacity: .65; cursor: default; }

body.studio-active { height: 100vh; overflow: hidden; }
.studio-active .layout { grid-template-columns: 1fr; height: calc(100vh - 74px); min-height: 0; overflow: hidden; }
.studio-active .left-rail, .studio-active .right-rail { display: none; }
.studio-active .board-column { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(520px, 650px); grid-template-rows: 35px minmax(0, 1fr); gap: 9px 18px; height: 100%; min-height: 0; padding: 10px 18px 14px; overflow: hidden; }
.studio-active .board-toolbar { grid-column: 1; grid-row: 1; }
.studio-active .board-frame { grid-column: 1; grid-row: 2; align-self: start; width: min(100%, calc(100vh - 145px)); min-width: 0; margin: 0 auto; }
.studio-active .palette { grid-column: 2; grid-row: 1; grid-template-columns: repeat(24, minmax(0, 1fr)); align-self: stretch; margin: 0; box-shadow: 3px 3px 0 var(--ink); }
.studio-active .palette .swatch:nth-child(12n) { border-right: 1px solid rgba(0,0,0,.28); }
.studio-active .palette .swatch:nth-child(24n) { border-right: 0; }
.studio-active .studio-panel { grid-column: 2; grid-row: 2; align-self: stretch; min-height: 0; height: 100%; margin: 0; overflow: auto; box-shadow: 4px 4px 0 var(--ink); }
.studio-active .studio-note { display: none; }
.studio-active .drawing-vault { padding: 8px 12px; }
.studio-active .drawing-vault .eyebrow { margin-bottom: 3px; font-size: 8px; }
.studio-active .drawing-vault h3 { margin-bottom: 5px; font-size: 11px; }
.studio-active #drawing-list { max-height: 68px; overflow: auto; }
.studio-active .drawing-row { padding: 5px 0; }
.studio-active .studio-heading { padding: 9px 12px; }
.studio-active .studio-heading .eyebrow { margin-bottom: 2px; font-size: 8px; }
.studio-active .studio-heading h2 { font-size: 15px; }
.studio-active .draft-total strong { font-size: 21px; }
.studio-active .studio-steps button { padding: 8px 10px; }
.studio-active .design-workspace { grid-template-columns: minmax(180px, .8fr) minmax(220px, 1fr); gap: 10px; padding: 10px 12px; }
.studio-active.board-edit-active .design-workspace { grid-template-columns: 1fr; }
.studio-active.board-edit-active .design-pad-shell { display: none; }
.studio-active .edit-surface { padding: 7px 12px; }
.studio-active #design-canvas { width: min(100%, clamp(180px, calc(100vh - 560px), 300px)); }
.studio-active .design-pad-shell > span { width: min(100%, 300px); margin-top: 6px; }
.studio-active .design-sidebar label { margin-bottom: 8px; }
.studio-active .design-sidebar input[type="text"], .studio-active .design-sidebar input[type="number"] { padding: 6px; }
.studio-active .import-box { padding: 9px; }
.studio-active .import-box > p { margin: 5px 0 8px; }
.studio-active .import-size-field { margin-bottom: 8px; }
.studio-active .import-preview-controls { margin-top: 8px; padding-top: 8px; }
.studio-active .import-preview-controls > p { min-height: 0; margin: 4px 0 6px; }
.studio-active .studio-tools button { padding: 6px 4px; font-size: 15px; }
.studio-active .studio-options { padding: 7px 12px; }
.studio-active .saved-designs { padding: 8px 12px; }
.studio-active .placement-toolbar { padding: 10px 12px; }
.studio-active .placement-view { padding: 8px 12px; }
.studio-active .placement-readout > div { padding: 9px 11px; }
.studio-active .draft-checkout { padding: 10px 12px; }

.panel-heading { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--ink); padding-bottom: 9px; }
.panel-heading span { font-size: 9px; letter-spacing: .14em; font-weight: 900; }
.panel-heading strong { font-family: ui-monospace, monospace; color: var(--blue); }
.selection-empty { padding: 55px 20px; text-align: center; font-family: ui-monospace, monospace; font-size: 11px; line-height: 1.7; color: var(--muted); border-bottom: 1px solid var(--line); }
.loupe-shell { display: grid; grid-template-columns: 170px 82px; justify-content: center; gap: 8px; margin: 17px 0 3px; }
#pixel-loupe { width: 170px; height: 170px; image-rendering: pixelated; border: 2px solid var(--ink); background: #f7f3e8; cursor: crosshair; }
.nudge-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 3px; }
.nudge-grid button { border: 1px solid var(--ink); background: transparent; font-weight: 900; cursor: pointer; }
.nudge-grid button:first-child { grid-column: 2; grid-row: 1; }
.nudge-grid button:nth-child(2) { grid-column: 1; grid-row: 2; }
.nudge-grid button:nth-child(3) { grid-column: 2; grid-row: 3; }
.nudge-grid button:nth-child(4) { grid-column: 3; grid-row: 2; }
.pixel-price { padding: 18px 0; display: grid; grid-template-columns: 1fr auto; align-items: end; }
.pixel-price span { grid-column: 1/-1; font-size: 9px; font-weight: 900; letter-spacing: .14em; color: var(--muted); }
.pixel-price strong { font-size: 40px; letter-spacing: -.07em; }
.pixel-price small { background: var(--orange); color: white; padding: 4px 6px; font-size: 8px; font-weight: 900; margin-bottom: 7px; }
.ownership { margin: 0 0 17px; border-top: 1px solid var(--line); }
.ownership div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 8px 0; font-size: 11px; }
.ownership dt { color: var(--muted); }
.ownership dd { font-weight: 800; margin: 0; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.ownership a { color: var(--blue); text-underline-offset: 2px; }
.fine-print { font-size: 9px; line-height: 1.5; color: var(--muted); text-align: center; }
.history-block { margin-top: 24px; }
.history-block h2 { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; border-bottom: 1px solid var(--ink); padding-bottom: 8px; }
.history-block ol { list-style: none; padding: 0; max-height: 160px; overflow: auto; }
.history-block li { display: grid; grid-template-columns: 10px 1fr auto; gap: 7px; padding: 7px 0; border-bottom: 1px dotted var(--line); font-size: 9px; }
.history-block li.history-empty { display: block; color: var(--muted); line-height: 1.5; }
.history-block li > div { min-width: 0; }
.history-block li b, .history-block li time { display: block; }
.history-block li b { overflow: hidden; text-overflow: ellipsis; }
.history-block li a, .leader-row a { color: var(--blue); text-underline-offset: 2px; }
.history-block li time { margin-top: 3px; color: var(--muted); font: 8px ui-monospace, monospace; }
.history-dot { width: 9px; height: 9px; border: 1px solid var(--ink); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 30px 0 10px; border-bottom: 2px solid var(--ink); }
.tabs button { border: 0; background: transparent; padding: 8px; text-transform: uppercase; font-size: 9px; letter-spacing: .1em; font-weight: 900; cursor: pointer; }
.tabs button.active { background: var(--ink); color: white; }
.activity-list, .leader-list { max-height: 315px; overflow: auto; }
.activity-item { display: grid; grid-template-columns: 12px 1fr auto; gap: 7px; align-items: start; border-bottom: 1px solid var(--line); padding: 9px 0; font-size: 9px; }
.activity-item i { width: 10px; height: 10px; border: 1px solid var(--ink); }
.activity-item b { display: block; overflow: hidden; text-overflow: ellipsis; }
.activity-item span { color: var(--muted); }
.leader-row { display: grid; grid-template-columns: 25px 1fr auto; border-bottom: 1px solid var(--line); padding: 9px 0; font-size: 10px; }
.leader-row strong:first-child { color: var(--orange); }

footer { border-top: 2px solid var(--ink); min-height: 38px; padding: 10px 24px; display: flex; justify-content: space-between; font-family: ui-monospace, monospace; font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
footer nav { display: flex; gap: 16px; }
footer a { color: inherit; }

dialog { border: 2px solid var(--ink); padding: 0; background: var(--paper); box-shadow: 10px 10px 0 var(--ink); max-width: min(520px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(18,18,18,.72); backdrop-filter: blur(3px); }
.dialog-shell { padding: 32px; min-width: min(450px, calc(100vw - 40px)); position: relative; }
.dialog-shell h2 { font-size: 32px; letter-spacing: -.05em; margin: 0 0 8px; text-transform: uppercase; }
.dialog-shell > p:not(.eyebrow) { font-size: 11px; line-height: 1.6; }
.dialog-close { position: absolute; top: 11px; right: 12px; border: 0; background: transparent; font-size: 25px; cursor: pointer; }
.pack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 22px 0; }
.pack { border: 1px solid var(--ink); padding: 14px 8px; background: transparent; cursor: pointer; }
.pack.recommended:not(:disabled) { border-width: 2px; }
.pack:not(:disabled):hover, .pack:not(:disabled):focus-visible { background: var(--acid); }
.pack:disabled { cursor: not-allowed; opacity: .42; }
.pack strong, .pack span { display: block; }
.pack strong { font-size: 19px; }
.pack span { font-size: 8px; text-transform: uppercase; margin-top: 3px; }
.custom-credit { display: grid; grid-template-columns: 1fr 130px auto; gap: 9px; align-items: end; border-top: 1px dashed var(--line); padding-top: 16px; }
.custom-credit > div strong, .custom-credit > div span { display: block; }
.custom-credit > div strong { font-size: 11px; text-transform: uppercase; }
.custom-credit > div span { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.custom-credit-input { display: flex !important; align-items: center; margin: 0 !important; border: 1px solid var(--ink); background: white; }
.custom-credit-input span { padding-left: 10px; font-size: 14px; }
.custom-credit-input input { min-width: 0; border: 0; margin: 0; padding-left: 5px; }
.custom-credit-input:has(input:disabled) { cursor: not-allowed; opacity: .42; }
.custom-credit .primary { min-height: 42px; }
.checkout-pause { border: 2px solid var(--orange); padding: 11px; color: var(--orange); font-weight: 800; }
.dialog-shell label.delivery-consent { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 9px; align-items: start; border-top: 1px dashed var(--line); padding-top: 13px; font: 10px/1.45 ui-monospace, monospace; }
.dialog-shell .delivery-consent input { width: 18px; height: 18px; margin: 0; padding: 0; accent-color: var(--blue); }
.checkout-feedback { border: 2px solid var(--orange); padding: 10px; color: var(--orange); font-weight: 800; }
.mock-warning { border: 1px dashed var(--orange); padding: 9px; color: var(--orange); font-weight: 750; }
.dialog-shell label { display: block; font-size: 10px; font-weight: 800; text-transform: uppercase; margin: 15px 0; }
.dialog-shell label small { color: var(--muted); }
.dialog-shell input { width: 100%; border: 1px solid var(--ink); background: white; padding: 12px; margin-top: 6px; }
.dialog-shell textarea { width: 100%; resize: vertical; border: 1px solid var(--ink); background: white; padding: 10px; margin-top: 6px; font: inherit; }
.action-confirm-shell { max-width: 510px; overflow-wrap: anywhere; }
.action-confirm-note { border-top: 1px dashed var(--line); padding-top: 13px; color: var(--muted); }
.action-confirm-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.action-confirm-buttons button { min-height: 46px; }
.text-button { background: transparent; border-style: dashed; }
.account-danger { border-top: 1px dashed var(--line); margin-top: 18px; padding-top: 14px; }
.account-danger p { font-size: 10px; line-height: 1.5; }
.account-danger button { color: var(--orange); }
.account-email { font-family: ui-monospace, monospace; color: var(--muted); overflow-wrap: anywhere; }
.account-history { border-top: 1px solid var(--ink); margin-top: 22px; padding-top: 12px; }
.account-history h3 { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.account-history ol { list-style: none; padding: 0; margin: 0; max-height: 120px; overflow: auto; }
.account-history li { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dotted var(--line); padding: 7px 0; font-size: 9px; }
.toast { position: fixed; left: 50%; bottom: 25px; transform: translate(-50%, 120px); z-index: 30; background: var(--ink); color: white; padding: 12px 18px; font-size: 11px; font-weight: 750; box-shadow: 5px 5px 0 var(--orange); transition: transform .25s; }
.toast.show { transform: translate(-50%, 0); }
.checkout-body { display: grid; place-items: center; min-height: 100vh; }
.mock-card { width: min(440px, calc(100vw - 36px)); border: 2px solid var(--ink); padding: 35px; box-shadow: var(--shadow); background: white; position: relative; }
.mock-card h1 { font-size: 34px; text-transform: uppercase; letter-spacing: -.05em; }
.dev-ribbon { background: var(--orange); color: white; margin: -35px -35px 28px; padding: 8px; text-align: center; font-weight: 900; letter-spacing: .12em; font-size: 9px; }
.text-link { display: block; text-align: center; margin-top: 20px; color: var(--ink); font-size: 11px; }
.document-body { min-height: 100vh; padding: 28px 16px 60px; overflow: auto; }
.document-shell { width: min(820px, 100%); margin: 0 auto; border: 2px solid var(--ink); background: var(--paper); padding: clamp(24px, 5vw, 58px); box-shadow: 8px 8px 0 var(--ink); }
.document-brand { display: block; width: min(310px, 70%); margin-bottom: 44px; }
.document-brand img { display: block; width: 100%; }
.document-shell h1 { margin: 4px 0 34px; font-size: clamp(38px, 7vw, 68px); line-height: .9; text-transform: uppercase; letter-spacing: -.06em; }
.document-shell section { border-top: 1px solid var(--line); padding: 22px 0 4px; }
.document-shell h2 { margin: 0 0 8px; font-size: 18px; text-transform: uppercase; }
.document-shell p { font-size: 13px; line-height: 1.7; }
.document-meta { color: var(--muted); font-family: ui-monospace, monospace; }
.document-nav { display: flex; flex-wrap: wrap; gap: 18px; border-top: 2px solid var(--ink); margin-top: 30px; padding-top: 18px; }
.document-nav a, .document-shell a { color: inherit; }
.policy-warning { border: 2px solid var(--orange); color: var(--orange); padding: 12px; margin: -16px 0 24px; font-weight: 800; }

@media (max-width: 1100px) {
  .topbar { grid-template-columns: 190px minmax(0, 1fr) max-content; }
  .brand { padding: 14px 16px; }
  .rule-line { padding: 0 7px; font-size: 11px; }
  .rule-line span { margin: 0 7px; }
  .layout { grid-template-columns: minmax(480px, 1fr) 300px; }
  .left-rail { display: none; }
}
@media (max-width: 900px) {
  .topbar { grid-template-columns: 190px 1fr; }
  .rule-line { display: none; }
  .account-bar { grid-column: 2; width: 100%; justify-content: flex-end; }
}
@media (max-width: 790px) {
  .topbar { grid-template-columns: 150px 1fr; height: 62px; }
  .brand { padding: 13px 10px; }
  .rule-line { display: none; }
  .account-bar { grid-column: 2; width: 100%; min-width: 0; }
  .account-bar > button { flex: 1 1 0; min-width: 0; }
  .identity-button { padding: 6px 4px; overflow: hidden; }
  .identity-button span, .identity-button small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .primary.compact, .paint-open { min-width: 0; padding: 8px 4px; font-size: 10px; }
  .layout { display: block; }
  .board-column { padding: 10px 12px 25px; }
  .board-frame { width: 100%; min-width: 0; }
  .right-rail { border: 0; border-top: 2px solid var(--ink); }
  .palette { grid-template-columns: repeat(8, 1fr); }
  .swatch:nth-child(12n) { border-right: 1px solid rgba(0,0,0,.28); }
  .swatch:nth-child(8n) { border-right: 0; }
  .swatch { aspect-ratio: 2.2; }
  .board-toolbar { align-items: flex-start; gap: 6px; }
  .zoom-presets { display: none; }
  .zoom-stepper { display: flex; }
  .live span { display: block; margin: 3px 0 0; }
  .studio-tools { grid-template-columns: repeat(4, 1fr); }
  .studio-tools button:nth-child(4) { border-right: 0; }
  .studio-tools button:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .studio-options, .studio-heading { align-items: stretch; flex-direction: column; }
  .design-workspace { grid-template-columns: 1fr; }
  #design-canvas { width: 100%; }
  .saved-designs { grid-template-columns: 1fr 1fr; }
  .saved-designs select, .saved-designs .primary { grid-column: 1 / -1; }
  .placement-toolbar { grid-template-columns: 1fr; }
  .placement-view { grid-template-columns: 1fr 1fr; }
  .placement-view > div { grid-column: 1 / -1; }
  .placement-readout { grid-template-columns: 1fr 1fr; }
  .draft-total { text-align: left; }
  .draft-checkout { grid-template-columns: 1fr; }
  .custom-credit { grid-template-columns: 1fr; }
  dialog { width: calc(100vw - 24px); max-width: none; }
  .dialog-shell { width: 100%; min-width: 0; padding: 28px 18px 22px; overflow-x: hidden; }
  .dialog-shell h2 { font-size: clamp(25px, 8vw, 32px); }
  .pack-grid { grid-template-columns: repeat(2, 1fr); }
  body.studio-active { height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; }
  .studio-active .layout { height: auto; min-height: calc(100vh - 62px); overflow: visible; }
  .studio-active .board-column { display: flex; flex-direction: column; height: auto; min-height: 0; padding: 10px 12px 25px; overflow: visible; }
  .studio-active .board-frame { width: 100%; min-width: 0; margin: 0 auto; }
  .studio-active .palette { width: 100%; grid-template-columns: repeat(8, 1fr); margin: 35px 0 0; }
  .studio-active .palette .swatch:nth-child(8n) { border-right: 0; }
  .studio-active .studio-panel { width: 100%; height: auto; min-height: 0; margin-top: 18px; overflow: visible; }
  .studio-active .design-workspace { grid-template-columns: 1fr; }
  .studio-active #design-canvas, .studio-active .design-pad-shell > span { width: 100%; }
  .selection-fields { grid-template-columns: repeat(2, 1fr); }
  footer { display: none; }
}
