/* Pixel Creator shell and settings panel. Stage styles live in pixel-stage.css. */
:root { --ink: #20192d; --muted: #5f5568; --purple: #4a2b6a; --purple-soft: #f3eef8; --lime: #d9eb9a; --line: #e2dce6; --paper: #f7f5f1; --focus: #7a4fa3; font: 15px/1.45 system-ui, sans-serif; color: var(--ink); background: var(--paper); }
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button, a, input, select { touch-action: manipulation; }
button { min-height: 44px; min-width: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
button:hover:not(:disabled) { border-color: #8b6b9e; }
button:disabled { opacity: .45; cursor: default; }
button[aria-pressed=true] { background: var(--lime); border-color: #9cb064; font-weight: 600; }
button.primary { background: var(--purple); border-color: var(--purple); color: #fff; font-weight: 600; }
button.primary:disabled { background: #8f7fa0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
a { color: var(--purple); }
h1, h2 { margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
[hidden] { display: none !important; }
.muted { color: var(--muted); font-size: .84rem; }
.row, .actions { display: flex; flex-wrap: wrap; gap: 8px; }

.top { height: 56px; display: flex; align-items: center; gap: 18px; padding: 0 18px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; min-height: 44px; font-size: 1.35rem; font-weight: 850; letter-spacing: -.07em; text-decoration: none; color: var(--ink); }
.brand span { color: #885aaa; }
.title { display: flex; gap: 10px; align-items: baseline; flex: 1; min-width: 0; }
.title span { color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back { font-size: .9rem; padding: 12px 0; }

.studio { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; padding: 12px 14px; height: calc(100dvh - 56px); min-height: 560px; }
.panel { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: auto; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.panel > * { flex-shrink: 0; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.steps button { width: 100%; text-align: left; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); padding-bottom: 6px; scrollbar-width: thin; }
.tabs button { flex: 1 1 auto; border-color: transparent; background: transparent; padding: 8px 5px; font-size: .86rem; }
.tabs button[aria-selected=true] { background: var(--purple-soft); border-color: #cbb6dc; font-weight: 650; }
.tab { display: grid; gap: 12px; align-content: start; }
label { display: grid; gap: 4px; font-size: .84rem; }
label.check { display: flex; align-items: center; gap: 8px; min-height: 44px; }
label.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--purple); }
input[type=number], input:not([type]), select { width: 100%; min-height: 44px; padding: 8px; border: 1px solid #cfc6d6; border-radius: 8px; background: #fff; }
input[type=range] { width: 100%; min-height: 44px; accent-color: var(--purple); }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 0; display: grid; gap: 10px; }
legend { font-size: .84rem; font-weight: 650; padding: 0 4px; }
.segmented { display: flex; flex-wrap: wrap; gap: 4px; }
.segmented button { flex: 1 1 auto; }
#crop-canvas { width: 100%; max-width: 100%; min-width: 0; display: block; border-radius: 8px; background: #8f8e92; touch-action: none; cursor: grab; }
.dimensions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.presets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.presets button { display: grid; text-align: left; gap: 0; }
.presets span { font-size: .76rem; color: var(--muted); }
.palette { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.palette li { position: relative; }
.palette li button { width: 100%; display: grid; grid-template-columns: 26px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left; padding: 6px 46px 6px 6px; font-size: .78rem; line-height: 1.2; }
.palette .chip { grid-row: 1 / 3; width: 26px; height: 26px; border-radius: 6px; box-shadow: inset 0 0 0 1px #0002; }
.palette .usage { color: var(--muted); font-size: .7rem; }
.palette li .include { position: absolute; top: 0; right: 0; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; }
.palette li .include input { width: 22px; height: 22px; margin: 0; accent-color: var(--purple); }
.palette li.excluded .name { text-decoration: line-through; }
.palette li.excluded button { background: repeating-linear-gradient(135deg, #fff 0 6px, #f2eff4 6px 12px); }

@media (max-width: 860px) {
  .studio { grid-template-columns: minmax(0, 1fr); height: auto; padding: 8px; gap: 10px; }
  .panel { overflow: visible; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steps button { text-align: center; padding: 8px 4px; font-size: .82rem; }
  .title span { display: none; }
}
@media (max-width: 400px) {
  .top { gap: 10px; padding: 0 10px; }
  .palette li button { font-size: .74rem; }
}
