@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #171916;
  --muted: #6e7169;
  --paper: #f4f4ef;
  --panel: #fbfbf7;
  --line: #d7d8cf;
  --soft-line: #e8e8e1;
  --lime: #b8f23e;
  --lime-dark: #88bd1b;
  --purple: #7659d8;
  --purple-soft: #eee9ff;
  --shadow: 0 18px 45px rgba(26, 28, 20, 0.08);
  --mono: "DM Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Manrope", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 77% 7%, rgba(184, 242, 62, .17), transparent 26rem),
    var(--paper);
  font-family: var(--sans);
  min-width: 320px;
}

button, input { font: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; }

.topbar {
  height: 76px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 clamp(22px, 5vw, 76px);
  border-bottom: 1px solid var(--line);
  background: rgba(248, 248, 243, .84);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
}

.brand strong { font-size: 14px; line-height: 1; letter-spacing: .05em; display: block; }
.brand small { color: var(--muted); font: 10px var(--mono); letter-spacing: .05em; }

.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 5px);
  grid-template-rows: repeat(3, 5px);
  gap: 2px;
  background: var(--ink);
  padding: 7px;
  border-radius: 3px;
}
.brand-mark span { background: var(--lime); }
.brand-mark span:nth-child(2), .brand-mark span:nth-child(4), .brand-mark span:nth-child(8) { opacity: .12; }

.main-nav { display: flex; align-self: stretch; gap: 36px; }
.main-nav a {
  display: grid;
  place-items: center;
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.main-nav a:hover, .main-nav a.active { color: var(--ink); }
.main-nav a.active::after { content: ""; height: 2px; background: var(--ink); position: absolute; inset: auto 0 -1px; }

.account-actions { display: flex; justify-content: end; gap: 8px; }
.button {
  border: 1px solid transparent;
  border-radius: 6px;
  min-height: 39px;
  padding: 0 17px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button-ghost { border-color: var(--line); background: rgba(255,255,255,.35); }
.button-ghost:hover { background: white; }
.button-dark { background: var(--ink); color: white; box-shadow: 0 5px 15px rgba(0,0,0,.1); }
.button-lime { background: var(--lime); border-color: #a2dc29; box-shadow: 0 6px 16px rgba(126, 167, 29, .18); }
.button-lime:hover { background: #c2fa4c; box-shadow: 0 8px 20px rgba(126, 167, 29, .25); }
.button span { margin-left: 12px; }
.full-width { width: 100%; margin-top: 4px; }

.profile-button {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.profile-button svg { width: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--lime); display: grid; place-items: center; }

main { width: min(1400px, calc(100% - 48px)); margin: auto; }

.hero {
  min-height: 308px;
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  align-items: end;
  gap: 80px;
  padding: 72px clamp(8px, 2vw, 28px) 48px;
}
.eyebrow, .step-label { font: 500 10px var(--mono); letter-spacing: .13em; margin: 0 0 13px; }
.eyebrow { display: flex; align-items: center; gap: 8px; }
.eyebrow span { display: block; width: 18px; height: 2px; background: var(--lime-dark); }
.hero h1 { font-size: clamp(40px, 5.25vw, 72px); line-height: .98; letter-spacing: -.055em; margin: 0; max-width: 830px; }
.hero h1 em { font-weight: 500; color: var(--lime-dark); font-style: italic; }
.hero-copy { max-width: 430px; padding-bottom: 6px; }
.hero-copy > p { color: #4d504a; line-height: 1.7; font-size: 14px; margin: 0 0 26px; }
.hero-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: var(--muted); font: 10px var(--mono); }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--lime-dark); margin-right: 6px; box-shadow: 0 0 0 4px rgba(136,189,27,.12); }

.workspace {
  display: grid;
  grid-template-columns: 314px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.character-panel { border-right: 1px solid var(--line); padding: 27px 20px 22px; background: #f9f9f5; }
.panel-heading { display: flex; align-items: end; justify-content: space-between; padding: 0 4px 20px; }
.panel-heading h2, .editor-header h2, .color-header h2, .submission-card h2 { margin: 0; font-size: 17px; letter-spacing: -.025em; }
.step-label { color: #898c83; }
.count-badge { font: 10px var(--mono); border: 1px solid var(--line); border-radius: 10px; padding: 3px 7px; color: var(--muted); }

.search-box { height: 40px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 5px; background: white; padding: 0 9px; }
.search-box:focus-within { border-color: #9aa08d; box-shadow: 0 0 0 3px rgba(184,242,62,.2); }
.search-box svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.5; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 11px; }
kbd { font: 9px var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 3px; color: var(--muted); padding: 2px 5px; background: #fafaf7; }

.filter-row { display: flex; gap: 5px; margin: 14px 0 12px; }
.filter { border: 0; background: transparent; border-radius: 4px; padding: 5px 10px; color: var(--muted); font: 10px var(--mono); cursor: pointer; }
.filter.active { background: #e9e9e2; color: var(--ink); }

.catalog-status { display: flex; align-items: center; gap: 7px; min-height: 25px; padding: 0 5px 8px; color: var(--muted); font: 8px var(--mono); }
.catalog-status i { width: 6px; height: 6px; border-radius: 50%; background: #aaa; }
.catalog-status.ready i { background: var(--lime-dark); box-shadow: 0 0 0 3px rgba(136,189,27,.12); }
.catalog-status.error i { background: #dc5b4a; }

.character-list { display: grid; gap: 5px; max-height: 568px; overflow: auto; padding-right: 2px; scrollbar-width: thin; }
.character-item {
  display: grid;
  grid-template-columns: 43px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.character-item:hover { background: #f1f1eb; }
.character-item.active { border-color: #94c92b; background: #f5fee3; box-shadow: inset 3px 0 var(--lime); }
.character-symbol { display: grid; place-items: center; width: 43px; height: 43px; border: 1px solid var(--line); border-radius: 4px; background: white; font-size: 22px; }
.character-item.active .character-symbol { border-color: #b1d466; }
.character-details strong { display: block; font-size: 11px; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 155px; }
.character-details small { display: block; max-width: 165px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 9px var(--mono); color: var(--muted); }
.item-status { width: 7px; height: 7px; border-radius: 50%; background: #d7d8cf; }
.item-status.open { background: var(--lime-dark); }
.width-chip { display: grid; place-items: center; min-width: 20px; height: 18px; padding: 0 4px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); font: 8px var(--mono); }
.result-limit, .empty-list { margin: 10px 5px; color: var(--muted); font: 9px/1.55 var(--mono); }

.request-character { width: 100%; border: 1px dashed #c8c9c0; background: transparent; border-radius: 6px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 13px 12px; margin-top: 14px; text-align: left; cursor: pointer; color: var(--muted); }
.request-character:hover { border-color: var(--lime-dark); background: #f8fde9; }
.request-character > span:first-child { font-size: 20px; }
.request-character strong { display: block; color: var(--ink); font-size: 10px; }
.request-character small { display: block; font-size: 9px; margin-top: 2px; }

.design-panel { padding: clamp(24px, 3vw, 42px); min-width: 0; }
.reference-card { display: grid; grid-template-columns: 210px 1fr; min-height: 190px; border: 1px solid var(--line); background: white; border-radius: 7px; overflow: hidden; }
.reference-glyph-wrap { position: relative; border-right: 1px solid var(--line); display: grid; place-items: center; background-image: linear-gradient(#efefe9 1px, transparent 1px), linear-gradient(90deg, #efefe9 1px, transparent 1px); background-size: 16px 16px; }
.reference-glyph { max-width: 100%; overflow: hidden; text-align: center; font-size: 90px; line-height: 1; font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", "Noto Sans Symbols 2", "Segoe UI Symbol", sans-serif; }
.reference-label { position: absolute; top: 13px; left: 13px; font: 8px/1.4 var(--mono); letter-spacing: .1em; color: #888b83; }
.reference-info { padding: 27px 31px; display: flex; flex-direction: column; justify-content: center; }
.reference-title-row { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.codepoint { font: 10px var(--mono); color: var(--lime-dark); margin: 0 0 6px; letter-spacing: .06em; }
.reference-info h2 { font-size: 29px; line-height: 1.1; margin: 0; letter-spacing: -.04em; }
.reference-info > p { font-size: 12px; color: var(--muted); max-width: 590px; line-height: 1.65; margin: 17px 0; }
.reference-info a { width: max-content; color: var(--ink); font: 9px var(--mono); text-underline-offset: 3px; }
.reference-info a span { margin-left: 5px; }
.emoji-badge { flex: none; font: 9px var(--mono); color: var(--purple); background: var(--purple-soft); border: 1px solid #dcd2ff; border-radius: 4px; padding: 7px 9px; }
.emoji-badge span { margin-right: 3px; }
.emoji-badge.symbol { color: #697069; background: #f1f1ed; border-color: #dedfd8; }

.editor-header { display: flex; justify-content: space-between; align-items: end; margin: 37px 0 19px; }
.editor-header p:last-child, .color-header p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.tool-group { display: flex; border: 1px solid var(--line); border-radius: 5px; padding: 3px; background: #f0f0ea; }
.editor-controls { display: flex; align-items: center; gap: 10px; }
.font-source-button { height: 39px; padding: 0 11px; white-space: nowrap; font: 8px var(--mono); }
.width-control { display: flex; align-items: center; gap: 3px; height: 39px; padding: 3px; border: 1px solid var(--line); border-radius: 5px; background: #f0f0ea; }
.width-control > span { padding: 0 7px; color: var(--muted); font: 8px var(--mono); }
.width-control button { height: 31px; border: 0; border-radius: 3px; padding: 0 9px; color: var(--muted); background: transparent; font: 9px var(--mono); cursor: pointer; }
.width-control button.active { color: var(--ink); background: white; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.tool { height: 31px; border: 0; border-radius: 3px; background: transparent; padding: 0 12px; color: var(--muted); font-size: 10px; cursor: pointer; }
.tool.active { background: white; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.tool-icon { display: inline-block; margin-right: 5px; }
.pencil-icon { width: 8px; height: 8px; background: currentColor; transform: rotate(45deg); }
.eraser-icon { margin-right: 4px; }

.bitmap-editors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 7px; background: white; overflow: hidden; }
.bitmap-card { padding: 20px; min-width: 0; }
.bitmap-card + .bitmap-card { border-left: 1px solid var(--line); }
.bitmap-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.bitmap-card-header h3 { font: 500 10px var(--mono); margin: 0; }
.bitmap-card-header span { color: var(--muted); font: 8px var(--mono); background: #f2f2ed; padding: 4px 6px; border-radius: 3px; }
.bitmap-stage { min-height: 276px; display: grid; place-items: center; background: #f7f7f3; border-radius: 4px; border: 1px solid #ededE7; padding: 10px; overflow: hidden; }
.pixel-grid { --cols: 8; --rows: 8; position: relative; display: grid; grid-template-columns: repeat(var(--cols), 1fr); grid-template-rows: repeat(var(--rows), 1fr); width: 100%; border-top: 1px solid #bdc0b7; border-left: 1px solid #bdc0b7; user-select: none; touch-action: none; cursor: crosshair; background: white; }
.pixel-grid::before, .pixel-grid::after, .color-grid::before, .color-grid::after { content: ""; position: absolute; z-index: 3; left: 0; right: 0; height: 2px; pointer-events: none; }
.pixel-grid::before, .color-grid::before { top: calc(var(--median-y) - 1px); background: #8068d5; }
.pixel-grid::after, .color-grid::after { top: calc(var(--baseline-y) - 1px); background: #656960; }
.outer-guide { position: absolute; z-index: 3; left: 0; right: 0; height: 0; border-top: 1px dashed rgba(91, 97, 86, .72); pointer-events: none; }
.cap-guide { top: var(--cap-y); }
.descender-guide { top: var(--descender-y); }
.pixel { border-right: 1px solid #d5d6cf; border-bottom: 1px solid #d5d6cf; background: white; }
.pixel.on { background: #181a17; }
.pixel:hover { box-shadow: inset 0 0 0 2px rgba(184,242,62,.75); }
.bitmap-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.bitmap-actions > span { display: flex; gap: 5px; }
.bitmap-actions button, .icon-button { border: 0; background: transparent; font: 9px var(--mono); color: var(--muted); cursor: pointer; padding: 3px; }
.bitmap-actions button:hover, .icon-button:hover { color: var(--ink); }
.bitmap-actions .copy-glyph { color: #5f49b6; font-size: 8px; }
.glyph-preview-row { min-height: 116px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 13px; padding: 10px 12px; border-radius: 4px; background: #20221e; }
.glyph-preview-row > div:first-child { min-width: 0; }
.glyph-preview-row span { display: block; color: #aeb1a6; font: 7px var(--mono); letter-spacing: .08em; }
.glyph-preview-row small { display: block; margin-top: 5px; color: #73766f; font: 7px var(--mono); white-space: nowrap; }
.glyph-preview { flex: none; display: grid; grid-template-columns: repeat(var(--cols), 1fr); grid-template-rows: repeat(var(--rows), 1fr); background: #0e0f0d; box-shadow: 0 0 0 1px #393b36; image-rendering: pixelated; }
.glyph-preview i { display: block; min-width: 0; min-height: 0; }
.glyph-preview.color-preview { background-image: linear-gradient(45deg,#292b27 25%,transparent 25%),linear-gradient(-45deg,#292b27 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#292b27 75%),linear-gradient(-45deg,transparent 75%,#292b27 75%); background-size: 8px 8px; background-position: 0 0,0 4px,4px -4px,-4px 0; }
.keyboard-hint { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 18px; color: var(--muted); font: 8px var(--mono); padding: 12px; }
.keyboard-hint kbd { margin-right: 4px; }
.guide-key { display: inline-flex; align-items: center; gap: 5px; }
.guide-key i { display: inline-block; width: 14px; height: 2px; }
.median-key { background: #8068d5; }
.baseline-key { background: #656960; }
.cap-key, .descender-key { height: 1px !important; border-top: 1px dashed rgba(91, 97, 86, .8); }

.color-section { border-top: 1px solid var(--line); margin-top: 27px; padding-top: 30px; }
.color-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.color-spark { color: var(--purple); }
.toggle-control { display: flex; align-items: center; gap: 10px; font-size: 10px; cursor: pointer; }
.toggle-control input { position: absolute; opacity: 0; }
.toggle { width: 35px; height: 20px; border-radius: 20px; background: #caccc3; padding: 3px; transition: background .15s; }
.toggle::after { content: ""; display: block; width: 14px; height: 14px; background: white; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.toggle-control input:checked + .toggle { background: var(--purple); }
.toggle-control input:checked + .toggle::after { transform: translateX(15px); }
.color-workspace { display: grid; gap: 22px; border: 1px solid var(--line); border-radius: 7px; background: white; margin-top: 18px; padding: 22px; transition: opacity .2s; }
.color-workspace.disabled { opacity: .35; pointer-events: none; }
.color-grid-wrap { display: grid; justify-items: center; gap: 8px; border-radius: 4px; background: #f7f7f3; padding: 15px; }
.color-grid-wrap > span { font: 8px var(--mono); color: var(--muted); letter-spacing: .1em; }
.color-grid { --cols: 16; --rows: 16; position: relative; display: grid; grid-template-columns: repeat(var(--cols), 1fr); grid-template-rows: repeat(var(--rows), 1fr); width: 100%; border-top: 1px solid #d3d4cc; border-left: 1px solid #d3d4cc; user-select: none; touch-action: none; cursor: crosshair; background-image: linear-gradient(45deg,#ddd 25%,transparent 25%),linear-gradient(-45deg,#ddd 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ddd 75%),linear-gradient(-45deg,transparent 75%,#ddd 75%); background-size: 10px 10px; background-position: 0 0,0 5px,5px -5px,-5px 0;
}
.color-pixel { border-right: 1px solid rgba(170,170,165,.42); border-bottom: 1px solid rgba(170,170,165,.42); }
.palette-panel { padding: 4px 2px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; }
.palette-heading { display: flex; justify-content: space-between; align-items: center; }
.palette-heading h3 { margin: 0; font-size: 12px; }
.palette-help { display: none; }
.swatches { display: grid; grid-template-columns: repeat(12, 26px); gap: 7px; margin: 0; }
.swatch { width: 26px; height: 26px; border: 2px solid white; border-radius: 4px; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatch.active { box-shadow: 0 0 0 2px var(--ink); }
.custom-color { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 0; font-size: 9px; color: var(--muted); }
.color-input-wrap { display: flex; align-items: center; gap: 7px; }
.color-input-wrap input { width: 23px; height: 23px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.color-input-wrap code { font: 9px var(--mono); color: var(--ink); }
.preview-card { display: flex; align-items: center; gap: 14px; margin-top: 20px; padding: 12px; background: #1c1d1a; color: white; border-radius: 5px; }
.preview-canvas { display: grid; grid-template-columns: repeat(16, 1fr); width: 64px; height: 64px; background-image: linear-gradient(45deg,#30312e 25%,transparent 25%),linear-gradient(-45deg,#30312e 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#30312e 75%),linear-gradient(-45deg,transparent 75%,#30312e 75%); background-size: 8px 8px; background-position: 0 0,0 4px,4px -4px,-4px 0; image-rendering: pixelated; }
.preview-pixel { min-width: 0; }
.preview-card span { display: block; color: #a3a59d; font: 8px var(--mono); margin-bottom: 5px; }
.preview-card strong { font: 500 10px var(--mono); }

.color-editors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--soft-line); padding-top: 21px; }
.color-card { min-width: 0; padding: 0 18px; }
.color-card + .color-card { border-left: 1px solid var(--soft-line); }
.color-card:first-child { padding-left: 0; }
.color-card:last-child { padding-right: 0; }
.color-card .color-grid-wrap { min-height: 265px; }
.color-card .glyph-preview-row { margin-top: 12px; }
.color-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.color-card-header h3 { margin: 0; font: 500 10px var(--mono); }
.color-card-header span { display: flex; align-items: center; gap: 7px; }
.color-card-header button { border: 0; background: transparent; color: var(--muted); font: 8px var(--mono); cursor: pointer; }
.color-card-header button:hover { color: var(--ink); }

.submission-card { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-top: 31px; padding: 24px; border: 1px solid #b7cc85; border-radius: 7px; background: #f4fbe8; }
.submission-copy { display: flex; align-items: center; gap: 15px; }
.submission-icon { width: 33px; height: 33px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--lime); font-weight: 800; }
.submission-card p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.submission-actions { display: flex; flex: none; gap: 8px; }
.button:disabled { cursor: wait; opacity: .58; transform: none; box-shadow: none; }

.submissions-section { scroll-margin-top: 96px; margin-top: 34px; padding: 30px; border: 1px solid var(--line); border-radius: 8px; background: rgba(251,251,247,.72); }
.submissions-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.submissions-heading h2 { margin: 3px 0 0; font-size: 25px; letter-spacing: -.035em; }
.submissions-heading p:not(.step-label) { margin: 8px 0 0; color: var(--muted); font-size: 10px; }
.submission-list { display: grid; gap: 10px; margin-top: 21px; }
.submission-empty { padding: 24px; border: 1px dashed var(--line); border-radius: 6px; color: var(--muted); text-align: center; font-size: 11px; }
.submission-item { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 20px; padding: 15px 17px; border: 1px solid var(--soft-line); border-radius: 6px; background: white; }
.submission-item h3 { margin: 0; font-size: 12px; }
.submission-item p { margin: 5px 0 0; color: var(--muted); font: 8px/1.5 var(--mono); }
.submission-item-actions { display: flex; align-items: center; gap: 10px; }
.submission-state { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 5px 8px; background: #eceee7; color: #5e6258; font: 8px var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.submission-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #9da095; }
.submission-state.submitted { background: #edf8d8; color: #4d6c13; }
.submission-state.submitted::before { background: var(--lime-dark); }
.submission-state.blocked { background: #fbe6e8; color: #9a2634; }
.submission-state.blocked::before { background: #d54a5c; }
.submission-link { color: var(--ink); font-size: 9px; font-weight: 700; }

footer { width: min(1400px, calc(100% - 48px)); margin: 44px auto 0; min-height: 120px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; color: var(--muted); font: 9px/1.6 var(--mono); }
.footer-brand { display: flex; align-items: center; gap: 11px; }
.mini-mark { width: 29px; height: 29px; background: var(--ink); color: var(--lime); display: grid; place-items: center; border-radius: 3px; font-size: 8px; }
footer p span { border: 1px solid var(--line); padding: 2px 5px; border-radius: 3px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(20,22,19,.58); backdrop-filter: blur(5px); }
.modal { width: min(440px, 100%); position: relative; background: var(--panel); border-radius: 9px; padding: 38px; box-shadow: 0 28px 80px rgba(0,0,0,.22); animation: modal-in .2s ease; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-close { position: absolute; right: 16px; top: 13px; border: 0; background: transparent; font-size: 24px; color: var(--muted); cursor: pointer; }
.modal-mark { width: max-content; margin-bottom: 24px; }
.modal h2 { font-size: 28px; letter-spacing: -.04em; margin: 0; }
.modal-intro { color: var(--muted); font-size: 12px; line-height: 1.55; margin: 10px 0 24px; }
.modal form { display: grid; gap: 14px; }
.modal form label { display: grid; gap: 7px; font-size: 10px; font-weight: 700; }
.modal form input { width: 100%; border: 1px solid var(--line); border-radius: 5px; padding: 11px 12px; outline: none; background: white; font-size: 12px; }
.modal form input:focus { border-color: var(--lime-dark); box-shadow: 0 0 0 3px rgba(184,242,62,.19); }
.auth-switch { text-align: center; color: var(--muted); font-size: 10px; margin: 20px 0 0; }
.auth-switch button { padding: 0; border: 0; background: transparent; font-weight: 700; text-decoration: underline; cursor: pointer; }
.fine-print { text-align: center; color: #9a9c95; font-size: 8px; line-height: 1.5; margin: 16px auto 0; max-width: 320px; }
.small-modal { width: min(400px, 100%); }
.toast-region { position: fixed; right: 24px; bottom: 24px; z-index: 70; display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 280px; background: #1b1d19; color: white; padding: 14px 17px; border-radius: 6px; box-shadow: 0 12px 35px rgba(0,0,0,.22); font-size: 11px; animation: toast-in .2s ease; }
.toast::before { content: "✓"; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--lime); color: var(--ink); font-weight: 800; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.hidden { display: none !important; }

@media (max-width: 1050px) {
  .main-nav { display: none; }
  .topbar { grid-template-columns: 1fr auto; }
  .hero { gap: 40px; }
  .workspace { grid-template-columns: 260px minmax(0, 1fr); }
  .character-details strong { max-width: 105px; }
  .bitmap-editors { grid-template-columns: 1fr; }
  .bitmap-card + .bitmap-card { border-left: 0; border-top: 1px solid var(--line); }
  .bitmap-stage { min-height: 210px; }
  .pixel-grid { width: min(100%, 170px); }
  .color-workspace { grid-template-columns: 1fr; }
  .palette-panel { grid-template-columns: 1fr; }
  .swatches { grid-template-columns: repeat(12, 1fr); }
  .color-editors { grid-template-columns: 1fr; gap: 20px; }
  .color-card { padding: 20px 0 0; border-top: 1px solid var(--soft-line); }
  .color-card + .color-card { border-left: 0; }
}

@media (max-width: 760px) {
  .topbar { padding: 0 18px; }
  .account-actions .button-ghost { display: none; }
  main { width: min(100% - 24px, 680px); }
  .hero { grid-template-columns: 1fr; gap: 22px; padding: 48px 4px 35px; }
  .hero-copy { padding: 0; }
  .workspace { grid-template-columns: 1fr; }
  .character-panel { border: 0; border-bottom: 1px solid var(--line); }
  .character-list { grid-template-columns: 1fr 1fr; max-height: 280px; }
  .character-details strong { max-width: 120px; }
  .reference-card { grid-template-columns: 135px 1fr; }
  .reference-glyph { font-size: 60px; }
  .reference-info { padding: 22px; }
  .editor-header, .color-header, .submission-card, .submissions-heading { align-items: flex-start; flex-direction: column; }
  .editor-controls { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .submission-actions { width: 100%; }
  .submission-actions .button { flex: 1; }
  footer { width: calc(100% - 24px); }
}

@media (max-width: 500px) {
  .brand small, .profile-button > span:not(.avatar) { display: none; }
  .hero h1 { font-size: 39px; }
  .character-list { grid-template-columns: 1fr; }
  .reference-card { grid-template-columns: 1fr; }
  .reference-glyph-wrap { height: 145px; border-right: 0; border-bottom: 1px solid var(--line); }
  .design-panel { padding: 18px; }
  .reference-title-row { flex-direction: column; gap: 12px; }
  .keyboard-hint { display: none; }
  .color-workspace { padding: 12px; }
  .swatches { grid-template-columns: repeat(6, 1fr); }
  .swatch { width: 100%; aspect-ratio: 1; height: auto; }
  .submission-actions { flex-direction: column; }
  .submission-item { grid-template-columns: 1fr; }
  .submission-item-actions { justify-content: space-between; }
  footer { flex-direction: column; justify-content: center; align-items: flex-start; gap: 12px; }
  .modal { padding: 28px 22px; }
}
