:root {
  color-scheme: dark;
  --base: #101318;
  --panel: #191e26;
  --panel-alt: #232b36;
  --edge: #343e4d;
  --text: #f1f3f6;
  --muted: #aebacb;
  --accent: #a7edcf;
  --warning: #ffd399;
  font-family: Inter, "Segoe UI", "Malgun Gothic", system-ui, sans-serif;
  color: var(--text);
  background: var(--base);
  font-size: 15px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button, .primary, .button, input, select, textarea {
  min-height: 44px;
  padding: .55rem .72rem;
  border: 1px solid var(--edge);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-alt);
}
input, select, textarea { min-width: 0; }
button, .button, .primary {
  cursor: pointer;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
}
button:hover, .button:hover, .primary:hover { border-color: var(--accent); text-decoration: none; }
button:disabled { opacity: .48; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.primary { background: var(--accent); border-color: var(--accent); color: #10271e; }
.quiet { background: transparent; }
.top { border-bottom: 1px solid var(--edge); background: var(--panel); }
.top-inner {
  max-width: 1160px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: calc(.6rem + env(safe-area-inset-top)) 1.25rem .6rem;
}
.brand { color: var(--text); display: flex; align-items: center; gap: .7rem; margin-right: auto; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand small { color: var(--accent); font-size: .68rem; letter-spacing: .11em; font-weight: 700; display: block; }
.brand strong { font-size: 1.13rem; }
.mark {
  width: 32px;
  height: 32px;
  background: var(--accent);
  clip-path: polygon(25% 0,75% 0,75% 25%,100% 25%,100% 75%,75% 75%,75% 100%,25% 100%,25% 75%,0 75%,0 25%,25% 25%,25% 50%,50% 50%,50% 75%,75% 75%,75% 50%,50% 50%,50% 25%,25% 25%);
}
nav { display: flex; gap: .25rem; }
nav a {
  color: var(--muted);
  min-height: 44px;
  padding: .45rem .8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  border-radius: 8px;
  font-weight: 650;
}
nav a:hover { color: var(--text); text-decoration: none; }
nav a span { font-size: 1.22rem; line-height: 1; }
nav a[aria-current=page] { background: #203830; color: var(--accent); }
.layout { max-width: 1160px; padding: 1.5rem 1.25rem 3rem; margin: auto; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.68rem, 5vw, 2.4rem); line-height: 1.16; overflow-wrap: anywhere; }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; line-height: 1.28; }
p, dd { line-height: 1.55; overflow-wrap: anywhere; }
small, .sub, .muted { color: var(--muted); }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: .65rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head p { margin-top: .35rem; }
.panel { min-width: 0; padding: .9rem; border: 1px solid var(--edge); border-radius: 12px; background: var(--panel); }
.panel > h2 { margin-bottom: .75rem; }
.panel.stack > h2 { margin-bottom: 0; }
.login { max-width: 420px; margin: min(12vh, 8rem) auto 1rem; padding: 1.25rem; }
.login h1 { margin: .4rem 0 1.25rem; }
form, .stack { display: grid; gap: .7rem; min-width: 0; }
label { display: grid; gap: .34rem; min-width: 0; }
label input, label select, label textarea { width: 100%; }
textarea { resize: vertical; }
details summary { cursor: pointer; color: var(--accent); min-height: 44px; padding: .65rem 0; }
details .stack { margin: .5rem 0; }
.disclosure { padding-block: 0; }
.disclosure summary { font-weight: 650; }
#notice, .editor-error { padding: .7rem .9rem; background: #26362f; border: 1px solid var(--edge); border-radius: 8px; margin-bottom: .8rem; }
#notice[data-error=true], .editor-error { background: #49262f; }
.login:not([hidden]) + #notice:not([hidden]) { max-width: 420px; margin: .5rem auto; }
.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: .85rem; align-items: start; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; margin-bottom: 1rem; }
.metric { display: grid; gap: .15rem; color: var(--muted); overflow-wrap: anywhere; }
.metric strong { font-size: 1.5rem; color: var(--text); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 208px), 1fr)); gap: .7rem; }
.card, .version-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  overflow-wrap: anywhere;
}
.card:hover, .version-card:hover, .version-card[aria-current=true] {
  border-color: var(--accent);
  text-decoration: none;
}
.card > .thumb { aspect-ratio: 1; border-radius: 11px 11px 0 0; }
.missing-thumb { display: grid; place-items: center; padding: .55rem; text-align: center; color: var(--muted); background: var(--panel-alt); }
.card-body { display: grid; align-content: start; gap: .38rem; padding: .65rem; }
.thumb { position: relative; display: block; min-width: 0; }
.thumb img { position: absolute; inset: 8%; width: 84%; height: 84%; object-fit: contain; }
.checker {
  background-color: #141a22;
  background-image: conic-gradient(#222b37 25%, transparent 0 50%, #222b37 0 75%, transparent 0);
  background-size: 20px 20px;
  border-radius: 7px;
}
img.pixel, canvas { image-rendering: pixelated; }
.row, .tools, .filters { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; }
.filters { margin-bottom: .8rem; }
.asset-filters { display: grid; grid-template-columns: minmax(0, 2fr) repeat(5, minmax(0, 1fr)); }
.result-count { display: block; margin-bottom: .45rem; }
.badge { display: inline-block; padding: .17rem .42rem; color: #d6e1ee; background: #303c4c; border-radius: 5px; font-size: .76rem; white-space: nowrap; }
.badge[data-state=approved] { color: #bfeecf; background: #234439; }
.badge[data-state=review], .badge[data-state=needs-review], .badge[data-state=held] { color: var(--warning); background: #493626; }
.badge[data-state=failed], .badge[data-state=rejected] { color: #ffd2d7; background: #542e38; }
.task-list { display: grid; gap: .45rem; }
.task-card { display: flex; align-items: center; gap: .7rem; min-width: 0; padding: .45rem; border: 1px solid var(--edge); border-radius: 9px; }
.task-card .thumb { width: 68px; height: 68px; }
.task-copy { display: grid; justify-items: start; gap: .18rem; min-width: 0; overflow-wrap: anywhere; }
.task-copy a { display: flex; align-items: center; min-height: 44px; font-weight: 650; }
.line { display: flex; justify-content: space-between; align-items: start; gap: .5rem; padding: .5rem 0; border-bottom: 1px solid var(--edge); min-height: 44px; }
.line:last-child { border-bottom: 0; }
.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.workflow { max-width: 640px; margin-inline: auto; }
.workflow .page-head { margin-bottom: .2rem; }
.workflow textarea { line-height: 1.55; }
.request-summary { color: var(--muted); min-height: 1.55em; }
.request-dimensions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; }
.base-card { display: flex; align-items: center; gap: .75rem; padding: .55rem; color: var(--text); border: 1px solid var(--edge); border-radius: 10px; }
.base-card .thumb { flex: 0 0 56px; height: 56px; }
.base-card strong, .base-card small { display: block; overflow-wrap: anywhere; }
.ref-image:not(:empty) { width: 56px; height: 56px; }
.ref-image .thumb { height: 100%; }
.result-preview { justify-items: start; }
.result-preview .thumb { width: 100%; height: clamp(160px, 42vw, 270px); }
.review-memo .row { margin-top: .45rem; }
.asset-detail { max-width: 840px; margin: auto; display: grid; gap: .75rem; }
.asset-head { gap: .32rem; justify-items: start; }
.asset-head > a { margin-top: -.4rem; }
.text-control { display: inline-flex; align-items: center; min-height: 44px; }
.asset-head .row .text-control { min-height: 36px; padding-inline: .35rem; }
.current-label { color: var(--accent); }
.asset-detail > div:empty { display: none; }
.stage { display: grid; place-items: center; overflow: hidden; }
.hero-stage { height: clamp(240px, 48vw, 382px); }
.stage img { display: block; object-fit: contain; }
.preview-specs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .35rem; }
.preview-specs > div { display: grid; align-content: start; gap: .18rem; padding: .3rem .15rem; }
.preview-specs small { font-size: .76rem; }
.preview-specs strong { font-size: .86rem; }
.version-strip { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(99px, 25%, 144px); gap: .48rem; overflow-x: auto; padding: 3px 3px .55rem; scroll-snap-type: x proximity; }
.version-card { align-items: start; gap: .26rem; padding: .4rem; scroll-snap-align: start; }
.version-card .thumb { width: 100%; aspect-ratio: 1; }
.version-card[aria-current=true] { background: #20352f; }
.compare-choices, .compare-board, .compare-toggle { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.compare-choice { display: flex; min-width: 0; gap: .45rem; align-items: end; }
.compare-choice .thumb { width: 48px; height: 48px; flex: 0 0 48px; }
.compare-choice label { width: 100%; }
.compare-stage { height: 270px; }
.compare-toggle { display: none; }
.active, button[aria-pressed=true] { border-color: var(--accent); color: var(--accent); background: #203830; }
.kv { display: grid; grid-template-columns: minmax(4rem, auto) minmax(0, 1fr); gap: .35rem .65rem; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; }
input[type=color] { width: 48px; padding: .25rem; }
.inline { display: inline-flex; align-items: center; gap: .4rem; }
.inline input { width: 22px; min-height: 22px; accent-color: var(--accent); }
.section-gap { margin-top: .85rem; }
body.editing { overflow: hidden; }
body.editing .top { visibility: hidden; }
.pixel-editor {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  padding: 0;
  color: var(--text);
  background: var(--base);
}
.pixel-editor[open] { display: flex; flex-direction: column; }
.editor-head {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: calc(.45rem + env(safe-area-inset-top)) max(.55rem, env(safe-area-inset-right)) .45rem max(.55rem, env(safe-area-inset-left));
  border-bottom: 1px solid var(--edge);
  background: var(--panel);
}
.editor-head > div { min-width: 0; margin-right: auto; }
.editor-head h1 { font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-head small { font-size: .76rem; }
.editor-head button { min-width: 44px; padding-inline: .5rem; }
.editor-error { margin: .4rem; }
.editor-view { position: relative; min-height: 0; flex: 1; }
.editor-stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; user-select: none; cursor: crosshair; }
.editor-stage[data-tool=hand] { cursor: grab; }
.editor-stage[data-tool=hand]:active { cursor: grabbing; }
.pixel-plane { position: absolute; top: 0; left: 0; border-radius: 0; outline: 1px solid var(--edge); pointer-events: none; }
.pixel-plane canvas { width: 100%; height: 100%; display: block; }
.pixel-grid, .pixel-selection { position: absolute; pointer-events: none; }
.pixel-grid {
  inset: 0;
  display: none;
  opacity: var(--grid-opacity);
  background-image:
    linear-gradient(to right, #abc6e5 1px, transparent 1px),
    linear-gradient(to bottom, #abc6e5 1px, transparent 1px),
    linear-gradient(to right, #9cb4d677 1px, transparent 1px),
    linear-gradient(to bottom, #9cb4d677 1px, transparent 1px);
  background-size: calc(4 * var(--zoom)) 100%, 100% calc(4 * var(--zoom)), var(--zoom) 100%, 100% var(--zoom);
}
.pixel-plane[data-grid=true] .pixel-grid { display: block; }
.pixel-selection { width: var(--zoom); height: var(--zoom); outline: 1px solid #fff; outline-offset: -1px; box-shadow: 0 0 0 1px #101318; }
.editor-footer {
  position: relative;
  display: grid;
  gap: .35rem;
  padding: .45rem max(.55rem, env(safe-area-inset-right)) calc(.45rem + env(safe-area-inset-bottom)) max(.55rem, env(safe-area-inset-left));
  border-top: 1px solid var(--edge);
  background: var(--panel);
}
.editor-readout { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .15rem .6rem; }
.editor-readout small { font-variant-numeric: tabular-nums; }
.editor-controls, .editor-toolstrip, .editor-palette { display: flex; align-items: center; gap: .35rem; }
.editor-controls > button { min-width: 44px; }
.editor-toolstrip > button { flex: 1; padding-inline: .25rem; white-space: nowrap; }
.editor-toolstrip input { flex: 0 0 44px; }
.editor-options { margin-left: auto; }
.editor-options summary { padding: .55rem; border: 1px solid var(--edge); border-radius: 8px; }
.editor-options-body {
  position: absolute;
  z-index: 1;
  bottom: 100%;
  right: .55rem;
  left: .55rem;
  padding: .65rem;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 8px;
}
.editor-palette { overflow-x: auto; padding: 2px 2px 4px; }
.swatch { position: relative; flex: 0 0 44px; padding: 0; }
.swatch::after { content: ""; width: 23px; height: 23px; border: 1px solid #9aa7b5; border-radius: 3px; background: var(--swatch); }
@media (min-width: 701px) {
  .editor-footer { grid-template-columns: 1fr auto; }
  .editor-palette { grid-column: 1 / -1; }
  .editor-readout { align-items: center; justify-content: start; }
  .editor-options-body { left: auto; width: 365px; }
}
@media (max-width: 700px) {
  .top-inner { padding-inline: .8rem; }
  nav {
    position: fixed;
    z-index: 3;
    bottom: 0;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: .3rem .45rem calc(.3rem + env(safe-area-inset-bottom));
    background: var(--panel);
    border-top: 1px solid var(--edge);
  }
  nav a { flex-direction: column; min-height: 51px; padding: .25rem; gap: .18rem; font-size: .8rem; }
  .layout { padding: 1rem .75rem calc(5rem + env(safe-area-inset-bottom)); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asset-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asset-filters input { grid-column: 1 / -1; }
  .panel { padding-inline: .65rem; }
  .compare-board { grid-template-columns: minmax(0, 1fr); }
  .compare-board[data-active="0"] [data-side="1"], .compare-board[data-active="1"] [data-side="0"] { display: none; }
  .compare-toggle { display: grid; }
  .compare-choice { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: .3rem; }
  .compare-choice .thumb { width: 36px; height: 44px; }
  .compare-choice select { padding-inline: .35rem; }
}
@media (max-height: 500px) {
  .editor-footer { display: flex; flex-wrap: wrap; }
  .editor-readout { flex: 1 0 100%; }
  .editor-palette { width: 100%; }
}
