:root {
  --bg: #1b130d;
  --ink: #2c1a10;
  --ink-soft: #5a4028;
  --paper: #f1d89c;
  --paper-2: #fff2c0;
  --panel-dark: #8b5a2b;
  --panel-mid: #c28b47;
  --wood: #7c4a24;
  --wood-dark: #2a170b;
  --wood-light: #b87934;
  --jade: #2f603f;
  --jade-bright: #73d5ac;
  --red: #b94b33;
  --gold: #e8b45c;
  --line: rgba(42, 23, 11, 0.54);
  --shadow: 6px 6px 0 rgba(0, 0, 0, 0.28);
  --font-ui: "DengXian", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --font-title: "KaiTi", "Kaiti SC", "STKaiti", "FangSong", "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --cursor: url("../../assets/pixel-ui/pixel-cursor.svg") 2 2, auto;
  --cursor-click: url("../../assets/pixel-ui/pixel-cursor.svg") 2 2, pointer;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--paper-2);
  font-family: var(--font-ui);
  cursor: var(--cursor);
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%) 0 0 / 8px 8px,
    linear-gradient(-45deg, rgba(255, 255, 255, 0.018) 25%, transparent 25%) 0 0 / 8px 8px,
    radial-gradient(circle at 82% 8%, rgba(115, 213, 172, 0.13), transparent 26%),
    #1b130d;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  cursor: var(--cursor-click);
}

canvas,
img,
video {
  max-width: 100%;
}

.app-shell {
  width: min(1420px, calc(100vw - 72px));
  min-height: calc(100vh - 36px);
  margin: 18px auto;
  padding: 14px;
  background:
    linear-gradient(90deg, rgba(30, 18, 9, 0.64), rgba(30, 18, 9, 0.18) 48%, rgba(30, 18, 9, 0.5)),
    linear-gradient(180deg, rgba(255, 242, 192, 0.05), transparent 34%, rgba(30, 18, 9, 0.64)),
    #2a2a1d;
  border: 4px solid #3b2414;
  outline: 4px solid #b87934;
  box-shadow:
    0 0 0 4px #1a1009,
    0 28px 0 rgba(0, 0, 0, 0.22),
    0 38px 80px rgba(0, 0, 0, 0.48);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  width: calc(100% - 24px);
  margin: 0 auto;
  padding: 10px 16px;
  color: var(--paper-2);
  background: #7c4a24;
  border: 4px solid #2a170b;
  box-shadow:
    inset 0 4px 0 #b87934,
    inset 0 -4px 0 #4e2d16,
    6px 6px 0 rgba(0, 0, 0, 0.32);
}

.topbar h1,
.panel h2,
.tool-card h3,
.feature-card h3 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1,
.panel h2 {
  font-family: var(--font-title);
  font-weight: 700;
}

.topbar h1 {
  font-size: clamp(26px, 3.2vw, 34px);
  line-height: 1;
  text-shadow: 2px 2px 0 #2a170b;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--jade-bright);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar .eyebrow {
  color: #9de5d5;
}

.topbar-actions,
.button-row,
.inline-controls,
.card-heading,
.panel-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.plain-link,
.text-button {
  color: inherit;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
}

.plain-link,
.text-button {
  color: #2f603f;
  font-weight: 800;
}

.topbar .plain-link {
  color: var(--paper-2);
  text-shadow: 1px 1px 0 #2a170b;
}

.primary-button,
.ghost-button {
  min-height: 38px;
  border: 3px solid #241306;
  padding: 8px 14px;
  font-weight: 800;
  transition: transform 0.12s steps(2), box-shadow 0.12s steps(2), background 0.12s steps(2);
}

.primary-button {
  color: var(--paper-2);
  background:
    linear-gradient(180deg, #b94b33 0 8px, #8d331f 8px calc(100% - 7px), #5c2115 calc(100% - 7px));
  box-shadow:
    inset 0 3px 0 rgba(255, 232, 167, 0.22),
    inset 0 -3px 0 rgba(0, 0, 0, 0.28),
    3px 3px 0 rgba(0, 0, 0, 0.32);
}

.ghost-button {
  color: var(--ink);
  background:
    linear-gradient(180deg, #ffe7a6 0 8px, #e8b45c 8px calc(100% - 7px), #b87934 calc(100% - 7px));
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.22),
    inset 0 -3px 0 rgba(0, 0, 0, 0.18),
    3px 3px 0 rgba(0, 0, 0, 0.26);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-2px);
}

.workspace-layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.sidebar {
  position: sticky;
  top: 18px;
  align-self: start;
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 12px;
  color: var(--ink);
  background: #f1d89c;
  border: 4px solid #2a170b;
  box-shadow:
    inset 0 5px 0 #fff0b8,
    inset 0 -5px 0 #b87934,
    5px 5px 0 rgba(0, 0, 0, 0.26);
}

.nav-group {
  display: grid;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(33, 20, 12, 0.18);
}

.nav-label {
  margin: 0;
  color: #2f603f;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  color: #2a1b12;
  text-align: left;
  border: 3px solid rgba(42, 23, 11, 0.44);
  background: rgba(255, 242, 192, 0.52);
  padding: 9px 10px;
  font-weight: 800;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.12);
}

.nav-item[data-tool-state="done-v1"] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 8px;
  align-items: center;
  border-color: #2f603f;
  box-shadow:
    inset 4px 0 0 #2f603f,
    2px 2px 0 rgba(0, 0, 0, 0.12);
}

.nav-item[data-tool-state="done-v1"]::after {
  content: attr(data-tool-label);
  padding: 2px 5px;
  color: #fff8e7;
  background: #2f603f;
  border: 2px solid #2a170b;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.nav-item.active,
.nav-item:hover {
  color: var(--paper-2);
  background:
    linear-gradient(180deg, #2f603f 0 8px, #22452e 8px calc(100% - 7px), #17301f calc(100% - 7px));
  border-color: #2a170b;
  text-shadow: 1px 1px 0 #102015;
}

.nav-item[data-tool-state="done-v1"].active::after,
.nav-item[data-tool-state="done-v1"]:hover::after {
  color: #2d2118;
  background: #fff0b8;
}

.nav-item[data-phase0-resource="true"] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 8px;
  align-items: center;
  border-color: #2f603f;
  background:
    linear-gradient(90deg, rgba(47, 96, 63, 0.18), rgba(255, 242, 192, 0.56));
  box-shadow:
    inset 4px 0 0 #2f603f,
    2px 2px 0 rgba(0, 0, 0, 0.16);
}

.nav-item[data-phase0-resource="true"]::after {
  content: attr(data-phase0-label);
  padding: 2px 5px;
  color: #2d2118;
  background: #ffcf4a;
  border: 2px solid #2a170b;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.nav-item[data-phase0-resource="true"].active::after,
.nav-item[data-phase0-resource="true"]:hover::after {
  color: #fff8e7;
  background: #b94b33;
}

.main-stage {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.panel {
  display: none;
  padding: 18px;
  color: var(--ink);
  background: #f1d89c;
  border: 4px solid #2a170b;
  box-shadow:
    inset 0 5px 0 #fff0b8,
    inset 0 -5px 0 #b87934,
    6px 6px 0 rgba(0, 0, 0, 0.28);
}

.panel.active {
  display: block;
}

.workshop-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin: 18px auto 0;
  padding: 18px 20px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 242, 192, 0.82), rgba(232, 180, 92, 0.5)),
    #f1d89c;
  border: 4px solid #2a170b;
  box-shadow:
    inset 0 4px 0 #fff0b8,
    inset 0 -4px 0 #b87934,
    5px 5px 0 rgba(0, 0, 0, 0.26);
}

.workshop-footer-brand {
  min-width: 0;
}

.workshop-footer-brand span {
  display: block;
  margin-bottom: 4px;
  color: var(--jade);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.workshop-footer-brand strong {
  display: block;
  margin-bottom: 5px;
  font-family: var(--font-title);
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.05;
}

.workshop-footer-brand p {
  margin: 0;
  color: #5a4028;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.65;
}

.workshop-footer-meta {
  display: grid;
  gap: 7px;
  justify-items: end;
  color: #4b321d;
  font-size: 14px;
  font-weight: 900;
}

.workshop-footer-meta span,
.workshop-footer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
}

.workshop-footer a,
.workshop-footer a:visited {
  color: var(--jade);
  font-weight: 900;
  text-decoration: none;
  cursor: var(--cursor-click);
}

.workshop-footer a:hover,
.workshop-footer a:focus-visible {
  color: #8f2b1d;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.workshop-footer-meta strong {
  color: #8f2b1d;
  font-weight: 900;
}

.panel-title-row {
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-title-row > div {
  min-width: 0;
  max-width: 100%;
}

.panel h2 {
  color: var(--ink);
  font-size: clamp(24px, 3vw, 34px);
  overflow-wrap: anywhere;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 12px;
  color: var(--paper-2);
  background: #2f603f;
  border: 3px solid #2a170b;
  font-weight: 800;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.22);
}

.tool-complete-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-top: 8px;
  padding: 4px 10px;
  color: #fff8e7;
  background:
    linear-gradient(180deg, #2f603f 0 7px, #22452e 7px calc(100% - 6px), #17301f calc(100% - 6px));
  border: 3px solid #2a170b;
  font-size: 13px;
  font-weight: 900;
  box-shadow:
    inset 0 2px 0 rgba(255, 240, 184, 0.22),
    3px 3px 0 rgba(0, 0, 0, 0.22);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

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

.tool-category {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.category-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  color: var(--paper-2);
  background:
    linear-gradient(180deg, #8b572a 0 8px, #623719 8px calc(100% - 7px), #3d2312 calc(100% - 7px));
  border: 4px solid #2a170b;
  box-shadow:
    inset 0 3px 0 rgba(255, 232, 167, 0.24),
    inset 0 -3px 0 rgba(0, 0, 0, 0.28),
    3px 3px 0 rgba(0, 0, 0, 0.26);
}

.category-heading h3,
.category-heading p {
  margin: 0;
}

.category-heading h3 {
  font-size: 20px;
}

.category-heading p {
  color: #ffe9aa;
  line-height: 1.55;
}

.category-count {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--jade-bright);
  font-size: 12px;
  font-weight: 900;
}

.feature-card,
.tool-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 40%),
    var(--paper);
  border: 4px solid #2a170b;
  box-shadow:
    inset 0 4px 0 #fff0b8,
    inset 0 -4px 0 #b87934,
    4px 4px 0 rgba(0, 0, 0, 0.2);
}

.feature-card {
  min-height: 154px;
  padding: 16px;
  cursor: pointer;
  position: relative;
}

.feature-card:hover {
  filter: brightness(1.04);
  transform: translateY(-3px);
}

.feature-card.done-v1 {
  outline: 3px solid #2f603f;
  outline-offset: -8px;
  background:
    linear-gradient(180deg, rgba(115, 213, 172, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 40%),
    var(--paper);
}

.feature-index {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 28px;
  margin-bottom: 12px;
  color: #fff8e7;
  background: #b94b33;
  border: 3px solid #2a170b;
  font-weight: 900;
}

.feature-card.ready .feature-index {
  background: #2f603f;
}

.feature-card.planned .feature-index {
  background: #8b3f25;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 26px;
  margin-top: 8px;
  padding: 3px 8px;
  color: var(--paper-2);
  background: #2f603f;
  border: 3px solid #2a170b;
  font-size: 12px;
  font-weight: 900;
}

.feature-card.planned .status-tag {
  color: #2d2118;
  background: #e8b45c;
}

.feature-card.duplicate .feature-index {
  background: #9a4a28;
}

.feature-card.focused .feature-index {
  background: #6d5b2d;
}

.feature-card.shanhai-value .feature-index {
  background: #2f603f;
}

.feature-card.duplicate .status-tag {
  color: #2d2118;
  background: #f1c16f;
}

.feature-card.focused .status-tag {
  background: #6d5b2d;
}

.feature-card.shanhai-value .status-tag {
  background: #2f603f;
}

.feature-card.done-v1 .status-tag {
  background: #2f603f;
}

.feature-card.phase0-resource-v1 {
  outline: 4px solid #2f603f;
  outline-offset: -8px;
  background:
    linear-gradient(135deg, rgba(47, 96, 63, 0.18), rgba(255, 207, 74, 0.2) 42%, transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 40%),
    var(--paper);
}

.feature-card.phase0-resource-v1 .feature-index,
.feature-card.phase0-resource-v1 .status-tag {
  background: #2f603f;
}

.feature-card h3,
.tool-card h3 {
  color: #2d2118;
  font-size: 19px;
}

.feature-card p,
.hint {
  color: var(--ink-soft);
  line-height: 1.65;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.feature-note {
  margin: 8px 0 12px;
  color: #5c4b3b;
  line-height: 1.62;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.roadmap-kicker {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-bottom: 14px;
  padding: 12px 14px;
  color: #2d2118;
  background:
    linear-gradient(90deg, rgba(47, 96, 63, 0.18), rgba(232, 180, 92, 0.14)),
    rgba(255, 242, 192, 0.58);
  border: 3px solid rgba(42, 23, 11, 0.38);
  line-height: 1.58;
}

.roadmap-kicker strong {
  color: #205f54;
}

.phase0-resource-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  margin: 0 0 18px;
  background:
    linear-gradient(90deg, rgba(47, 96, 63, 0.22), rgba(255, 207, 74, 0.22)),
    #fff0b8;
  border: 4px solid #2f603f;
  box-shadow:
    inset 0 4px 0 rgba(255, 255, 255, 0.36),
    4px 4px 0 rgba(0, 0, 0, 0.16);
}

.phase0-resource-callout div {
  display: grid;
  gap: 4px;
}

.phase0-resource-callout strong {
  color: #2d2118;
  font-size: 18px;
}

.phase0-resource-callout span:not(.status-tag) {
  color: #4b3b2f;
  line-height: 1.55;
}

.muted-kicker {
  margin-top: 18px;
  background:
    linear-gradient(90deg, rgba(45, 33, 24, 0.1), rgba(185, 75, 51, 0.1)),
    rgba(255, 242, 192, 0.46);
}

.control-note {
  display: block;
  color: #6c5845;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.action-row {
  display: grid;
  grid-template-columns: minmax(128px, max-content) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.action-row p {
  margin: 0;
  color: #5c4b3b;
  line-height: 1.55;
}

.image-action-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin: 12px 0;
  padding: 6px 0 8px;
}

.split-panels,
.tool-grid {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.split-panels,
.tool-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.tool-grid.image-tools {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tool-grid.image-utility-grid {
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
}

.compact-actions-card {
  grid-column: 1 / -1;
  padding: 10px 12px;
}

.compact-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 8px;
}

.mini-tool {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 0;
  padding: 8px;
  background: rgba(255, 255, 255, 0.32);
  border: 2px solid rgba(42, 23, 11, 0.34);
}

.mini-tool h4,
.mini-tool p {
  margin: 0;
}

.mini-tool h4 {
  color: #2d2118;
  font-size: 14px;
}

.mini-tool p,
.mini-tool label {
  color: #5c4b3b;
  line-height: 1.35;
}

.mini-tool p {
  display: none;
}

.mini-tool label {
  display: grid;
  gap: 5px;
  font-weight: 800;
}

.mini-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.mini-fields label,
.mini-tool > label {
  gap: 2px;
  font-size: 12px;
}

.mini-fields input[type="color"] {
  width: 100%;
}

.compact-check {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
}

.compact-check input[type="checkbox"] {
  width: 14px;
  height: 14px;
}

.mini-tool .compact-check {
  display: flex;
  margin: 0;
}

.mini-tool .primary-button {
  width: max-content;
  min-height: 32px;
  padding: 5px 9px;
}

.side-tool-list {
  display: grid;
  grid-auto-rows: 84px;
  gap: 8px;
  margin-top: 18px;
}

.side-tool-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 72px;
  gap: 8px;
  align-items: center;
  min-height: 0;
  height: 100%;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.3);
  border: 2px solid rgba(42, 23, 11, 0.34);
}

.side-tool-row h4,
.side-tool-row p {
  margin: 0;
}

.side-tool-row h4 {
  color: #2d2118;
  font-size: 18px;
}

.side-tool-row p,
.side-tool-fields,
.side-tool-fields span,
.side-tool-fields label {
  color: #5c4b3b;
  line-height: 1.35;
  font-size: 15px;
}

.side-tool-row p,
.side-tool-fields {
  min-width: 0;
  overflow: hidden;
}

.side-tool-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 15px;
}

.side-tool-fields label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 800;
}

.side-tool-fields input:not([type="checkbox"]) {
  width: 68px;
  min-height: 30px;
  padding: 4px 6px;
  font-size: 15px;
}

.side-tool-fields input[type="color"] {
  width: 42px;
  min-height: 30px;
  padding: 2px;
}

.stroke-row-fields {
  display: grid;
  grid-template-columns: max-content 70px max-content 48px;
  gap: 4px 8px;
  align-items: center;
  overflow: visible;
}

.stroke-row-fields span {
  grid-column: 1 / -1;
  line-height: 1.25;
}

.stroke-row-fields label {
  display: contents;
  font-size: 15px;
}

.stroke-row-fields input:not([type="checkbox"]) {
  width: 70px;
  min-height: 32px;
  font-size: 15px;
}

.stroke-row-fields input[type="color"] {
  width: 44px;
  height: 32px;
  min-height: 32px;
  justify-self: start;
}

.scale-row-fields {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  overflow: visible;
}

.scale-row-fields label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 15px;
  white-space: nowrap;
}

.scale-row-fields input:not([type="checkbox"]) {
  width: 58px;
  min-height: 31px;
  padding: 3px 5px;
  font-size: 15px;
}

.scale-row-fields .compact-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  line-height: 1.1;
  white-space: nowrap;
}

.scale-row-fields .compact-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.side-tool-row .primary-button {
  justify-self: end;
  width: 72px;
  min-height: 38px;
  padding: 5px 9px;
  text-align: center;
}

.image-preview-card {
  align-content: start;
}

.tool-card {
  min-width: 0;
  padding: 16px;
}

.placeholder-card {
  min-height: 260px;
}

.scope-list {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0 0 0 18px;
  color: #4b3b2e;
  line-height: 1.62;
}

.scope-list li::marker {
  color: #205f54;
}

.placeholder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.placeholder-grid span {
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 8px;
  color: #2d2118;
  text-align: center;
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid var(--line);
  font-weight: 900;
}

.workshop-upload-box {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 150px;
  padding: 16px;
  text-align: center;
  color: #2d2118;
  background:
    linear-gradient(45deg, rgba(47, 96, 63, 0.08) 25%, transparent 25%) 0 0 / 12px 12px,
    rgba(255, 242, 192, 0.72);
  border: 3px dashed rgba(42, 23, 11, 0.5);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.28);
}

.workshop-upload-box input[type="file"] {
  display: none;
}

.file-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  cursor: var(--cursor-click);
}

.file-action input[type="file"] {
  display: none;
}

.workshop-upload-box strong {
  min-height: 38px;
  padding: 8px 14px;
  color: var(--paper-2);
  background:
    linear-gradient(180deg, #2f603f 0 8px, #22452e 8px calc(100% - 7px), #17301f calc(100% - 7px));
  border: 3px solid #241306;
  box-shadow:
    inset 0 3px 0 rgba(255, 232, 167, 0.2),
    inset 0 -3px 0 rgba(0, 0, 0, 0.28),
    3px 3px 0 rgba(0, 0, 0, 0.26);
}

.workshop-upload-box span {
  max-width: 520px;
  color: #5c4b3b;
  line-height: 1.55;
}

.workshop-textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  padding: 12px;
  color: #2d2118;
  background: #fff3c4;
  border: 3px solid rgba(42, 23, 11, 0.52);
  line-height: 1.55;
  box-shadow: inset 3px 3px 0 rgba(0, 0, 0, 0.08);
}

.audit-control-grid {
  align-items: stretch;
}

.audit-file-list,
.audit-report,
.drop-result-list {
  display: grid;
  gap: 8px;
  min-height: 108px;
  margin-top: 12px;
  padding: 12px;
  color: #5c4b3b;
  background: rgba(255, 242, 192, 0.58);
  border: 3px solid rgba(42, 23, 11, 0.34);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.audit-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.3);
  border: 2px solid rgba(42, 23, 11, 0.24);
}

.audit-file-row strong {
  min-width: 0;
  color: #2d2118;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-file-row span {
  color: #2f603f;
  font-weight: 800;
}

.audit-result-card {
  margin-top: 14px;
}

.audit-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 12px;
}

.audit-summary-grid span {
  min-width: 0;
  min-height: 42px;
  padding: 9px 10px;
  color: #2d2118;
  background: rgba(47, 96, 63, 0.12);
  border: 2px solid rgba(42, 23, 11, 0.28);
  font-weight: 800;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.audit-issue-list,
.audit-ok-list {
  margin: 0;
  padding-left: 22px;
}

.audit-issue-list li::marker {
  color: #b94b33;
}

.audit-ok-list li::marker {
  color: #2f603f;
}

.small-button {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 13px;
}

.button-row.compact {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.mini-toolbar,
.mini-control-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.mini-toolbar strong {
  color: #2d2118;
}

.mini-control-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(180px, 1fr);
  margin-bottom: 10px;
}

.mini-control-row label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #2d2118;
  font-weight: 800;
}

.inline-upload-button {
  min-height: 74px;
  padding: 10px 12px;
  color: #2d2118;
  background: rgba(255, 242, 192, 0.72);
  border: 3px dashed rgba(42, 23, 11, 0.46);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.26);
  cursor: pointer;
}

.inline-upload-button input[type="file"] {
  display: none;
}

.compact-upload {
  min-height: 38px;
  align-items: center;
  display: inline-grid;
  width: max-content;
  max-width: 100%;
}

.compact-upload span {
  color: #5a4028;
  font-size: 12px;
  font-weight: 700;
}

.inline-upload-button span {
  color: #5c4b3b;
  font-size: 13px;
  line-height: 1.45;
}

.audit-preview-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.15fr) minmax(260px, 0.85fr);
  gap: 12px;
  margin-top: 12px;
}

.audit-preview-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  background: rgba(255, 242, 192, 0.46);
  border: 3px solid rgba(42, 23, 11, 0.3);
}

.tile-preview-canvas,
.animation-preview-canvas,
.nine-slice-canvas,
.phase0-scene-canvas {
  width: 100%;
  min-height: 240px;
  image-rendering: pixelated;
  background:
    linear-gradient(45deg, rgba(42, 23, 11, 0.12) 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(45deg, transparent 75%, rgba(42, 23, 11, 0.12) 75%) 0 0 / 16px 16px,
    #fff3c4;
  border: 3px solid rgba(42, 23, 11, 0.42);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.3);
}

.nine-slice-canvas {
  min-height: 300px;
}

.phase0-scene-canvas {
  aspect-ratio: 16 / 9;
  min-height: auto;
  background: #6f9b5f;
}

.palette-swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.palette-swatch {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 2px 8px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  color: #2d2118;
  background: rgba(255, 255, 255, 0.34);
  border: 2px solid rgba(42, 23, 11, 0.24);
}

.palette-swatch-chip {
  grid-row: 1 / span 2;
  width: 30px;
  height: 30px;
  border: 2px solid #241306;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.24);
}

.palette-swatch strong,
.palette-swatch span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.bitmap-font-canvas {
  width: 100%;
  min-height: 260px;
  image-rendering: pixelated;
  background:
    linear-gradient(45deg, rgba(42, 23, 11, 0.10) 25%, transparent 25%) 0 0 / 16px 16px,
    #fff3c4;
  border: 3px solid rgba(42, 23, 11, 0.42);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.3);
}

.preview-hint {
  margin: 0;
  color: #5c4b3b;
  line-height: 1.55;
}

.audit-json-preview {
  max-width: 100%;
  min-width: 0;
  min-height: 240px;
  max-height: 360px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  color: #2d2118;
  background: #fff3c4;
  border: 3px solid rgba(42, 23, 11, 0.38);
  line-height: 1.48;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#animationAuditPanel .player-sprite-kicker {
  margin-bottom: 14px;
}

#animationAuditPanel .player-sprite-workflow {
  align-items: stretch;
}

#animationAuditPanel .player-grid-controls {
  grid-template-columns: repeat(3, minmax(120px, 1fr));
}

#animationAuditPanel .player-grid-controls label {
  min-width: 0;
}

#animationAuditPanel .player-grid-controls .wide-control {
  grid-column: 1 / -1;
}

#animationAuditPanel .player-grid-controls input {
  width: 100%;
}

.player-mapping-table {
  display: grid;
  gap: 7px;
  overflow-x: auto;
  padding: 10px;
  background:
    linear-gradient(45deg, rgba(47, 96, 63, 0.08) 25%, transparent 25%) 0 0 / 18px 18px,
    rgba(255, 242, 192, 0.46);
  border: 3px solid rgba(42, 23, 11, 0.32);
}

.player-mapping-row {
  display: grid;
  grid-template-columns: minmax(112px, 1.1fr) repeat(7, minmax(62px, 0.7fr));
  gap: 6px;
  align-items: center;
  min-width: 690px;
  padding: 8px;
  color: #2d2118;
  background: rgba(255, 250, 220, 0.72);
  border: 2px solid rgba(42, 23, 11, 0.22);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.24);
}

.player-mapping-row.header {
  color: #fff3c4;
  background: #2f603f;
  border-color: #241306;
  font-weight: 900;
}

.player-mapping-row strong {
  overflow-wrap: anywhere;
}

.player-mapping-row input {
  width: 100%;
  min-width: 0;
  padding: 7px 6px;
  text-align: center;
  color: #241306;
  background: #fff3c4;
  border: 2px solid rgba(42, 23, 11, 0.5);
  font-weight: 800;
}

.player-preview-grid {
  margin-top: 12px;
}

.player-preview-controls {
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: end;
}

.player-animation-canvas {
  min-height: 300px;
  background:
    linear-gradient(45deg, rgba(255, 243, 196, 0.12) 25%, transparent 25%) 0 0 / 18px 18px,
    #241306;
}

.player-layer-stack {
  display: grid;
  gap: 7px;
}

.player-layer-upload {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin: 10px 0 12px;
  padding: 10px;
  background: rgba(122, 170, 95, 0.14);
  border: 2px solid rgba(47, 96, 63, 0.34);
}

.player-layer-upload input[type="file"] {
  display: none;
}

.player-layer-upload select {
  width: 100%;
}

.player-layer-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(190px, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  color: #2d2118;
  background: rgba(255, 250, 220, 0.7);
  border: 2px solid rgba(42, 23, 11, 0.24);
}

.player-layer-row.active {
  background: rgba(122, 170, 95, 0.28);
  border-color: rgba(47, 96, 63, 0.72);
}

.player-layer-row.reserved {
  opacity: 0.78;
}

.player-layer-row.muted {
  filter: saturate(0.78);
}

.player-layer-row span {
  color: #5c4b3b;
  line-height: 1.45;
}

.player-layer-check {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  font-weight: 900;
}

.player-layer-check input {
  width: 16px;
  height: 16px;
  accent-color: #2f603f;
}

.player-layer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.player-layer-actions .small-button {
  min-width: 64px;
  white-space: nowrap;
}

.player-export-list {
  max-height: 360px;
  overflow: auto;
}

.player-export-row {
  grid-template-columns: 46px minmax(70px, 0.45fr) minmax(104px, 0.62fr) minmax(190px, 1.6fr);
  font-size: 13px;
}

.player-export-row span:last-child {
  overflow-wrap: anywhere;
}

.compact-preview {
  min-height: 130px;
  max-height: 220px;
}

.audit-table {
  display: grid;
  gap: 7px;
  min-height: 64px;
  margin-top: 12px;
  padding: 10px;
  color: #5c4b3b;
  background: rgba(255, 242, 192, 0.58);
  border: 3px solid rgba(42, 23, 11, 0.28);
  line-height: 1.5;
  overflow: auto;
}

.audit-table-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.6fr) minmax(120px, 1fr) minmax(120px, 1.3fr) minmax(160px, 1.6fr);
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  color: #2d2118;
  background: rgba(255, 255, 255, 0.32);
  border: 2px solid rgba(42, 23, 11, 0.22);
}

.audit-table-row.header {
  color: var(--paper-2);
  background: #2f603f;
  border-color: #241306;
  font-weight: 900;
}

.audit-table-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.world-map-section {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.world-map-section h3 {
  margin: 0;
  color: #2d2118;
  font-size: 18px;
}

.world-map-region-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 52px;
  padding: 10px;
  color: #5c4b3b;
  background: rgba(255, 242, 192, 0.58);
  border: 3px solid rgba(42, 23, 11, 0.28);
}

.world-map-region-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 5px 9px;
  color: #fff8e7;
  background: #2f603f;
  border: 3px solid #2a170b;
  font-weight: 900;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.world-map-east-axis {
  display: grid;
  gap: 8px;
  min-width: 0;
  min-height: 64px;
  padding: 12px;
  color: #2d2118;
  background:
    linear-gradient(90deg, rgba(47, 96, 63, 0.14), rgba(255, 242, 192, 0.58)),
    rgba(255, 242, 192, 0.58);
  border: 3px solid rgba(42, 23, 11, 0.28);
}

.world-map-east-axis strong {
  min-width: 0;
  color: #2f603f;
  font-size: 18px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.world-map-east-axis p {
  min-width: 0;
  margin: 0;
  color: #5a4028;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.world-map-lane-row {
  grid-template-columns: minmax(130px, 0.8fr) minmax(100px, 0.6fr) minmax(70px, 0.35fr) minmax(260px, 1.8fr);
}

.world-map-overview-panel .tool-card,
.world-map-overview-panel .button-row,
.world-map-overview-panel .compact-upload {
  min-width: 0;
}

.world-map-overview-panel .button-row {
  flex-wrap: wrap;
}

.localization-preview-table .audit-table-row {
  grid-template-columns: minmax(120px, 1.2fr) repeat(2, minmax(110px, 1fr));
}

.localization-issue-row {
  grid-template-columns: minmax(82px, 0.55fr) minmax(150px, 1fr) minmax(220px, 1.9fr);
}

.localization-issue-row span:last-child {
  min-width: 0;
}

.animation-issue-row,
.drop-analysis-row,
.audio-cue-row,
.asset-board-row {
  grid-template-columns: minmax(90px, 0.7fr) minmax(150px, 1fr) minmax(220px, 1.8fr);
}

.audio-cue-row,
.asset-board-row {
  grid-template-columns: minmax(140px, 1fr) minmax(110px, 0.7fr) minmax(150px, 1fr) minmax(220px, 1.6fr);
}

.compact-tool-grid {
  align-items: start;
  margin-top: 8px;
}

.compact-textarea {
  min-height: 118px;
}

.flow-issue-row,
.flow-variable-row,
.save-risk-row {
  grid-template-columns: minmax(92px, 0.6fr) minmax(150px, 1fr) minmax(220px, 1.8fr);
}

.build-check-row,
.save-diff-row {
  grid-template-columns: minmax(96px, 0.7fr) minmax(92px, 0.55fr) minmax(150px, 1fr) minmax(210px, 1.6fr);
}

.crash-row,
.todo-row {
  grid-template-columns: minmax(92px, 0.48fr) minmax(220px, 1.8fr);
}

.status-pass span:first-child,
.diff-added span:first-child {
  color: #235f3e;
  font-weight: 900;
}

.status-warning span:first-child,
.diff-changed span:first-child,
.diff-type_changed span:first-child {
  color: #8a5a16;
  font-weight: 900;
}

.status-missing span:first-child,
.diff-removed span:first-child {
  color: #9b3527;
  font-weight: 900;
}

.compact-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.flow-graph-stage {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(145px, 1fr);
  gap: 10px;
  min-height: 240px;
  padding: 12px;
  color: #5c4b3b;
  background:
    linear-gradient(45deg, rgba(42, 23, 11, 0.08) 25%, transparent 25%) 0 0 / 18px 18px,
    rgba(255, 243, 196, 0.78);
  border: 3px solid rgba(42, 23, 11, 0.36);
  overflow-x: auto;
}

.flow-graph-column {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 145px;
}

.flow-graph-column > strong {
  color: #2f603f;
  font-size: 13px;
}

.flow-node {
  display: grid;
  gap: 5px;
  padding: 10px;
  color: #2d2118;
  background: rgba(255, 255, 255, 0.42);
  border: 3px solid rgba(47, 96, 63, 0.58);
  box-shadow: 3px 3px 0 rgba(42, 23, 11, 0.12);
}

.flow-node.has-issue {
  border-color: #b94b33;
  background: rgba(255, 221, 186, 0.72);
}

.flow-node h4,
.flow-node p {
  margin: 0;
}

.flow-node h4 {
  font-size: 14px;
  line-height: 1.35;
}

.flow-node p,
.flow-node span {
  color: #5c4b3b;
  font-size: 12px;
  line-height: 1.45;
}

.drop-result-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(140px, 1fr) minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  color: #2d2118;
  background: rgba(255, 255, 255, 0.34);
  border: 2px solid rgba(42, 23, 11, 0.26);
}

.drop-result-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.drop-result-bar {
  position: relative;
  height: 18px;
  background: rgba(42, 23, 11, 0.16);
  border: 2px solid rgba(42, 23, 11, 0.36);
}

.drop-result-bar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--rate);
  background:
    linear-gradient(180deg, #73d5ac 0 6px, #2f603f 6px calc(100% - 4px), #1e3b28 calc(100% - 4px));
}

.drop-result-row em {
  color: #5c4b3b;
  font-style: normal;
  line-height: 1.4;
}

.video-stepper,
.sheet-stepper,
.gif-stepper,
.image2-stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.video-step,
.sheet-step,
.gif-step,
.image2-step {
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 8px 10px;
  color: #6c5845;
  text-align: center;
  background: rgba(255, 255, 255, 0.34);
  border: 2px solid rgba(42, 23, 11, 0.34);
  font-weight: 900;
  box-shadow: inset 0 -3px 0 rgba(42, 23, 11, 0.08);
}

.video-step.is-active,
.sheet-step.is-active,
.gif-step.is-active,
.image2-step.is-active {
  color: #fff8e7;
  background:
    linear-gradient(180deg, rgba(115, 213, 172, 0.18), rgba(47, 96, 63, 0.82)),
    #2f603f;
  border-color: #1d1711;
  text-shadow: 1px 1px 0 #1d1711;
}

.video-step.is-done,
.sheet-step.is-done,
.gif-step.is-done,
.image2-step.is-done {
  color: #2d2118;
  background: rgba(115, 213, 172, 0.3);
  border-color: rgba(47, 96, 63, 0.58);
}

.video-ingest-zone,
.sheet-ingest-zone,
.gif-import-card,
.image2-ingest-zone {
  outline: 2px dashed transparent;
  outline-offset: -8px;
  transition: background 0.16s ease, outline-color 0.16s ease, box-shadow 0.16s ease;
}

.video-ingest-zone.dragging,
.sheet-ingest-zone.dragging,
.gif-import-card.dragging,
.image2-ingest-zone.dragging {
  background: rgba(47, 143, 125, 0.1);
  outline-color: rgba(47, 143, 125, 0.78);
  box-shadow: inset 0 0 0 4px rgba(255, 248, 231, 0.58);
}

.video-upload-box,
.sheet-upload-box,
.image2-upload-box {
  min-height: 168px;
  min-width: 0;
  place-content: center;
  justify-items: center;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(47, 143, 125, 0.08), rgba(201, 95, 54, 0.08)),
    rgba(255, 255, 255, 0.36);
}

.video-upload-box .primary-button,
.sheet-upload-box .primary-button,
.image2-upload-box .primary-button {
  justify-self: center;
  margin-top: 4px;
}

.sheet-upload-box .file-readout {
  width: min(100%, 430px);
  min-width: 0;
  margin-inline: auto;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.sheet-upload-box .control-note {
  max-width: 430px;
  margin-inline: auto;
}

.video-ingest-zone.dragging .video-upload-box,
.sheet-ingest-zone.dragging .sheet-upload-box {
  background: rgba(47, 143, 125, 0.14);
  border-color: #2f8f7d;
}

.video-progress {
  display: block;
  width: 100%;
  height: 18px;
  margin: 12px 0 4px;
  overflow: hidden;
  accent-color: var(--jade);
  background: #fff8e7;
  border: 2px solid rgba(33, 20, 12, 0.42);
}

.video-result-summary,
.sheet-result-summary,
.gif-status-bar,
.gif-result-summary {
  min-height: 58px;
  margin: 12px 0;
  padding: 12px;
  color: #205f54;
  background: rgba(215, 240, 229, 0.54);
  border: 2px solid rgba(47, 96, 63, 0.42);
  font-weight: 800;
  line-height: 1.55;
}

.video-estimate {
  margin: 10px 0 0;
  padding: 10px 12px;
  color: #31523b;
  background: rgba(115, 213, 172, 0.16);
  border: 2px solid rgba(47, 96, 63, 0.32);
  font-weight: 800;
  line-height: 1.5;
}

.control-grid.video-param-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.video-param-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.video-param-row label,
.video-prefix-field {
  min-width: 0;
}

.video-param-grid .control-note {
  min-height: 34px;
  line-height: 1.45;
}

.video-prefix-field {
  max-width: calc(50% - 6px);
}

.video-frame-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 8px;
  padding: 10px;
  background: rgba(255, 248, 231, 0.5);
  border: 2px solid rgba(42, 23, 11, 0.3);
}

.video-frame-tools strong,
.video-frame-tools span {
  display: block;
}

.video-frame-tools span {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
}

.video-frame-tools button:disabled,
#cancelVideoExtractBtn:disabled {
  opacity: 0.54;
  cursor: not-allowed;
  transform: none;
}

.video-frame-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 8px;
  max-height: 268px;
  margin-bottom: 12px;
  overflow: auto;
}

.video-frame-button {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 7px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.42);
  border: 2px solid rgba(42, 23, 11, 0.28);
  cursor: var(--cursor-pointer), pointer;
  box-shadow: inset 0 -2px 0 rgba(42, 23, 11, 0.12);
}

.video-frame-button:hover,
.video-frame-button:focus-visible,
.frame-card.selectable:hover,
.frame-card.selectable:focus-visible {
  border-color: var(--jade);
  outline: 2px solid rgba(115, 213, 172, 0.36);
  outline-offset: 1px;
}

.video-frame-button.is-selected,
.frame-card.is-selected {
  color: #fff8e7;
  background:
    linear-gradient(180deg, rgba(47, 143, 125, 0.18), rgba(47, 96, 63, 0.82)),
    #2f603f;
  border-color: #1d1711;
  box-shadow: inset 0 0 0 2px rgba(255, 248, 231, 0.35), 3px 3px 0 rgba(33, 20, 12, 0.32);
}

.video-frame-button canvas {
  width: 100%;
  height: 58px;
  object-fit: contain;
  image-rendering: pixelated;
}

.video-frame-button span {
  min-width: 0;
  color: inherit;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-preview-shell,
.sheet-preview-shell {
  position: relative;
}

.video-preview-shell .preview-canvas,
.sheet-preview-shell .preview-canvas {
  min-height: 280px;
}

.video-empty-state {
  position: absolute;
  inset: 16px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 18px;
  color: #6c5845;
  text-align: center;
  background: rgba(255, 248, 231, 0.78);
  border: 2px dashed rgba(42, 23, 11, 0.38);
  font-weight: 800;
  line-height: 1.55;
}

.video-empty-state[hidden] {
  display: none;
}

.sheet-empty-state {
  position: static;
  min-height: 122px;
  margin-top: 10px;
}

.sheet-selection-tools,
.sheet-nudge-panel,
.sheet-animation-toolbar {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(255, 248, 231, 0.46);
  border: 2px solid rgba(42, 23, 11, 0.34);
}

.sheet-selection-tools .hint {
  margin: 8px 0 0;
}

.compact-row {
  margin: 4px 0 8px;
}

.sheet-range-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.sheet-range-index {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.sheet-axis-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.sheet-axis-toggle label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 36px;
  padding: 5px 8px;
  color: #2d2118;
  background: rgba(255, 248, 231, 0.72);
  border: 2px solid rgba(42, 23, 11, 0.36);
  font-size: 13px;
  font-weight: 900;
}

.sheet-axis-toggle input {
  width: 14px;
  height: 14px;
  min-height: 0;
  accent-color: var(--jade);
}

.sheet-range-tools button {
  min-height: 36px;
  padding: 6px 10px;
  width: 100%;
  min-width: 0;
  line-height: 1.25;
  white-space: normal;
}

.sheet-range-tools .sheet-replace-selection {
  color: #fff8e7;
  background:
    linear-gradient(180deg, rgba(201, 95, 54, 0.28), rgba(121, 47, 32, 0.88)),
    #7a2f20;
  text-shadow: 1px 1px 0 #1d1711;
}

.sheet-adjust-grid label {
  min-width: 0;
}

.sheet-adjust-grid input {
  box-sizing: border-box;
}

.sheet-adjust-grid .control-note {
  min-height: 36px;
}

.sheet-nudge-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 12px;
  align-items: center;
}

.sheet-nudge-panel h4 {
  margin: 0 0 4px;
  color: #2d2118;
}

.nudge-pad {
  display: grid;
  grid-template-columns: repeat(3, 38px);
  grid-template-rows: repeat(2, 36px);
  gap: 4px;
  justify-content: end;
}

.nudge-pad button {
  min-height: 34px;
  padding: 0;
}

.nudge-pad button:first-child {
  grid-column: 2;
}

.nudge-pad button:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
}

.nudge-pad button:nth-child(3) {
  grid-column: 3;
  grid-row: 2;
}

.nudge-pad button:nth-child(4) {
  grid-column: 2;
  grid-row: 2;
}

.sheet-animation-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}

.sheet-animation-toolbar label {
  display: grid;
  gap: 4px;
  min-width: 118px;
  color: #2d2118;
  font-weight: 800;
}

.sheet-animation-toolbar input,
.sheet-animation-toolbar select {
  min-height: 34px;
  padding: 5px 7px;
}

.image-ingest-zone {
  outline: 2px dashed transparent;
  outline-offset: -8px;
  transition: background 0.16s ease, outline-color 0.16s ease, box-shadow 0.16s ease;
}

.image-ingest-zone.dragging,
.image-ingest-zone:focus-visible {
  background: rgba(47, 143, 125, 0.1);
  outline-color: rgba(47, 143, 125, 0.78);
  box-shadow: inset 0 0 0 4px rgba(255, 248, 231, 0.58);
}

.upload-box {
  display: grid;
  gap: 9px;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  margin: 14px 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.34);
  border: 3px dashed rgba(47, 143, 125, 0.7);
}

#imageUploadBox {
  min-height: 190px;
  align-content: center;
  justify-items: center;
  text-align: center;
}

#imageUploadBox > span {
  max-width: 380px;
}

#imageUploadBox > * {
  min-width: 0;
  max-width: 100%;
}

.upload-box.compact {
  min-height: 132px;
  align-content: center;
  text-align: center;
}

.image-ingest-zone.dragging .upload-box {
  background: rgba(47, 143, 125, 0.12);
  border-color: #2f8f7d;
}

.gif-import-card.dragging .upload-box {
  background: rgba(47, 143, 125, 0.14);
  border-color: #2f8f7d;
}

.upload-box strong {
  color: #2d2118;
  font-size: 18px;
}

.upload-box > span,
.upload-box > em,
.file-readout {
  color: #5c4b3b;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.upload-box > em {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}

.upload-box .primary-button {
  width: max-content;
}

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

.file-readout {
  margin: 4px 0 0;
  font-weight: 800;
}

#imageUploadBox .file-readout,
#imageUploadBox .file-meta {
  max-width: 430px;
  text-align: center;
}

.file-meta:empty {
  display: none;
}

.card-heading {
  justify-content: space-between;
  margin-bottom: 12px;
}

.drop-zone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 154px;
  padding: 20px;
  text-align: center;
  border: 3px dashed rgba(47, 143, 125, 0.7);
  background:
    linear-gradient(135deg, rgba(47, 143, 125, 0.08), rgba(201, 95, 54, 0.08)),
    rgba(255, 255, 255, 0.38);
}

.drop-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-zone.dragging {
  background: rgba(47, 143, 125, 0.18);
}

.drop-zone strong,
.drop-zone span {
  pointer-events: none;
}

.drop-zone span {
  margin-top: 6px;
  color: var(--ink-soft);
}

.stash-list,
.frame-gallery,
.frame-list,
.gpt-grid {
  display: grid;
  gap: 10px;
}

.stash-list {
  max-height: 216px;
  overflow: auto;
}

.stash-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid var(--line);
}

.stash-thumb,
.frame-thumb {
  width: 48px;
  height: 48px;
  object-fit: contain;
  image-rendering: pixelated;
  background:
    linear-gradient(45deg, #ded1bd 25%, transparent 25%) 0 0 / 12px 12px,
    linear-gradient(45deg, transparent 75%, #ded1bd 75%) 0 0 / 12px 12px,
    linear-gradient(45deg, transparent 75%, #ded1bd 75%) 6px 6px / 12px 12px,
    #fff8e7;
}

.stash-meta {
  min-width: 0;
}

.stash-meta strong,
.stash-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stash-meta span {
  color: var(--ink-soft);
  font-size: 12px;
}

.field-label,
.control-grid label,
.inline-controls label {
  color: #2d2118;
  font-weight: 800;
}

.field-label {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

input,
select {
  min-height: 36px;
  width: 100%;
  color: #1d1711;
  background: #fff8e7;
  border: 2px solid rgba(33, 20, 12, 0.38);
  padding: 6px 8px;
}

input[type="checkbox"] {
  width: auto;
  min-height: auto;
}

input[type="color"] {
  width: 46px;
  padding: 2px;
}

.map-mode-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
  margin: 14px 0 16px;
  padding: 6px;
  background: rgba(55, 34, 18, 0.16);
  border: 3px solid #2a170b;
  box-shadow: inset 0 2px 0 rgba(255, 248, 231, 0.36);
}

.map-mode-tab {
  min-height: 42px;
  color: #fff4cf;
  background:
    linear-gradient(180deg, rgba(255, 227, 144, 0.18), transparent 42%),
    #6b3f1f;
  border: 3px solid #2a170b;
  font-weight: 900;
  text-shadow: 1px 1px 0 #2a170b;
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, 0.22),
    2px 2px 0 rgba(0, 0, 0, 0.22);
  cursor: var(--cursor-pointer), pointer;
}

.map-mode-tab.active {
  color: #fff8e7;
  background:
    linear-gradient(180deg, rgba(115, 213, 172, 0.18), transparent 48%),
    #174b31;
  text-shadow: 1px 1px 0 #0e2619;
  box-shadow:
    inset 0 4px 0 rgba(115, 213, 172, 0.7),
    inset 0 -4px 0 rgba(0, 0, 0, 0.26),
    2px 2px 0 rgba(0, 0, 0, 0.24);
}

.map-workflow {
  display: none;
}

.map-workflow.active {
  display: block;
}

.map-ingest-zone {
  outline: 2px dashed transparent;
  outline-offset: -8px;
  transition: background 0.16s ease, outline-color 0.16s ease, box-shadow 0.16s ease;
}

.map-upload-box {
  min-height: 132px;
  margin: 12px 0 10px;
  place-content: center;
  justify-items: center;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(47, 143, 125, 0.1), rgba(225, 166, 73, 0.1)),
    rgba(255, 255, 255, 0.38);
}

.map-upload-box .primary-button {
  justify-self: center;
}

.map-compact-upload {
  min-height: 108px;
  padding: 14px;
}

.map-ingest-zone.dragging .map-upload-box {
  background: rgba(47, 143, 125, 0.16);
  border-color: #2f8f7d;
  box-shadow: inset 0 0 0 4px rgba(255, 248, 231, 0.62);
}

.map-file-summary {
  margin: 10px 0;
  padding: 10px 12px;
  color: #205f54;
  background: rgba(215, 240, 229, 0.54);
  border: 2px solid rgba(47, 96, 63, 0.42);
  font-weight: 900;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#mapSelectedTileStatus {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.map-file-list {
  display: grid;
  gap: 6px;
  max-height: 132px;
  overflow: auto;
  margin: 10px 0 12px;
}

.map-file-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid var(--line);
}

.map-file-item strong,
.map-file-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-file-item span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.map-simple-controls .map-mode-field {
  grid-column: 1 / -1;
}

.map-expand-settings {
  align-items: start;
}

.map-expand-settings .map-split-field {
  grid-column: 1 / -1;
  grid-row: auto;
}

.map-expand-settings .map-overlap-x-field {
  grid-column: auto;
}

.map-expand-settings .map-overlap-y-field {
  grid-column: auto;
}

.map-selected-upload {
  margin-top: 10px;
}

.button-row.map-action-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  margin-top: 12px;
}

.map-action-bar button {
  width: 100%;
  min-height: 40px;
  padding-inline: 8px;
  white-space: normal;
}

.button-row.map-selected-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.map-selected-actions #removeMapTileBtn {
  grid-column: 1 / -1;
}

.map-expansion-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 14px;
  align-items: start;
  margin-top: 14px;
}

.map-stage-card {
  min-width: 0;
}

.map-expansion-stage-shell {
  min-height: 460px;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 14px;
  background:
    linear-gradient(45deg, rgba(42, 23, 11, 0.07) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(45deg, transparent 75%, rgba(42, 23, 11, 0.07) 75%) 0 0 / 18px 18px,
    linear-gradient(45deg, transparent 75%, rgba(42, 23, 11, 0.07) 75%) 9px 9px / 18px 18px,
    rgba(255, 248, 231, 0.62);
  border: 3px solid rgba(42, 23, 11, 0.52);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.2);
}

.map-expansion-stage {
  width: 100%;
  min-height: 420px;
  display: grid;
  place-items: center;
}

.map-expansion-stage-inner {
  position: relative;
  min-width: 120px;
  min-height: 120px;
}

.map-tile-cell {
  position: absolute;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0;
  color: #2d2118;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), transparent 46%),
    rgba(255, 248, 231, 0.78);
  border: 3px dashed rgba(47, 96, 63, 0.74);
  box-shadow:
    inset 0 0 0 3px rgba(255, 248, 231, 0.52),
    3px 3px 0 rgba(0, 0, 0, 0.18);
  cursor: var(--cursor-pointer), pointer;
}

.map-tile-cell.center {
  border-style: solid;
  border-color: #2a170b;
  cursor: default;
}

.map-tile-cell.uploaded {
  border-style: solid;
  border-color: #2f8f7d;
  background: rgba(115, 213, 172, 0.22);
}

.map-tile-cell.selected {
  outline: 4px solid #ffd56d;
  outline-offset: 3px;
  z-index: 4;
}

.map-tile-cell img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  image-rendering: pixelated;
}

.map-tile-cell span {
  position: relative;
  z-index: 1;
  padding: 4px 7px;
  color: #fff8e7;
  background: rgba(42, 23, 11, 0.76);
  border: 2px solid rgba(255, 248, 231, 0.44);
  font-size: 12px;
  font-weight: 900;
  text-shadow: 1px 1px 0 #1d1711;
}

.map-feather-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.map-feather-controls span {
  grid-column: 1 / -1;
  color: #2d2118;
  font-weight: 900;
}

.map-feather-controls button {
  min-height: 32px;
  color: #2d2118;
  background: rgba(255, 248, 231, 0.72);
  border: 2px solid rgba(42, 23, 11, 0.48);
  font-weight: 900;
  cursor: var(--cursor-pointer), pointer;
}

.map-feather-controls button:disabled {
  color: rgba(45, 33, 24, 0.46);
  cursor: not-allowed;
  opacity: 0.58;
}

.color-picker-field {
  display: grid;
  grid-template-columns: max-content 38px;
  gap: 6px 10px;
  align-items: center;
  width: max-content;
  color: #2d2118;
  font-weight: 800;
}

.color-picker-field .control-note {
  grid-column: 1 / -1;
}

.color-picker-field input[type="color"] {
  width: 38px;
  height: 30px;
  min-height: 30px;
  padding: 2px;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.control-grid label {
  display: grid;
  gap: 6px;
}

.control-grid .check-line {
  display: flex;
}

.inline-controls {
  flex-wrap: wrap;
  margin: 10px 0;
}

.inline-controls label {
  display: grid;
  gap: 6px;
  min-width: 132px;
  max-width: 260px;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 14px;
  color: #2d2118;
  font-weight: 800;
}

.check-line span {
  color: #6c5845;
  font-size: 12px;
  font-weight: 600;
}

#sheetPanel .sheet-export-check {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto max-content minmax(180px, 1fr);
  align-items: center;
  column-gap: 8px;
  margin: 0;
}

#sheetPanel .sheet-export-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--jade);
}

#sheetPanel .sheet-export-check strong {
  color: #2d2118;
  white-space: nowrap;
}

#sheetPanel .sheet-export-check span {
  font-size: 13px;
  line-height: 1.4;
}

.control-grid .map-color-field,
.control-grid .map-check-line {
  min-height: 76px;
  margin: 0;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.3);
  border: 2px solid rgba(99, 65, 32, 0.28);
  box-shadow: inset 0 2px 0 rgba(255, 248, 231, 0.48);
}

.control-grid .map-color-field {
  width: auto;
  grid-template-columns: minmax(0, 1fr) 42px;
}

.control-grid .map-color-field input[type="color"] {
  justify-self: end;
}

.control-grid .map-check-line {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
}

.control-grid .map-check-line input[type="checkbox"] {
  grid-row: 1 / 3;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--jade);
}

.control-grid .map-check-line strong {
  line-height: 1.25;
}

.control-grid .map-check-line span {
  grid-column: 2;
  line-height: 1.45;
}

.range-control {
  display: block;
  width: 100%;
  margin: 8px 0 14px;
  accent-color: var(--jade);
}

.button-row {
  flex-wrap: wrap;
  margin: 12px 0;
}

video {
  display: block;
  width: 100%;
  max-height: 260px;
  margin-top: 12px;
  background: #1d1711;
  border: 2px solid #21140c;
}

.preview-canvas,
.animation-canvas {
  display: block;
  width: 100%;
  min-height: 220px;
  max-height: 520px;
  background: rgba(255, 255, 255, 0.42);
  border: 2px solid var(--line);
  image-rendering: pixelated;
  object-fit: contain;
}

#imagePreviewCanvas {
  cursor: default;
  min-height: 430px;
  height: 430px;
  max-height: 470px;
}

#imagePreviewCanvas.brush-active {
  cursor: none;
}

#imagePreviewCanvas.patch-selecting {
  cursor: crosshair;
}

.brush-cursor {
  position: fixed;
  z-index: 10000;
  display: block;
  pointer-events: none;
  border: 2px solid rgba(255, 248, 231, 0.96);
  border-radius: 999px;
  background: rgba(47, 143, 125, 0.1);
  box-shadow:
    0 0 0 2px rgba(42, 23, 11, 0.82),
    inset 0 0 0 1px rgba(47, 143, 125, 0.75);
  transform: translateZ(0);
}

.brush-cursor[data-mode="erase"] {
  background: rgba(150, 45, 30, 0.08);
  box-shadow:
    0 0 0 2px rgba(42, 23, 11, 0.82),
    inset 0 0 0 1px rgba(201, 95, 54, 0.85);
}

.brush-cursor[hidden] {
  display: none;
}

.animation-canvas {
  min-height: 150px;
  margin: 12px 0;
}

.checker {
  background:
    linear-gradient(45deg, #d7c8ae 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(45deg, transparent 75%, #d7c8ae 75%) 0 0 / 18px 18px,
    linear-gradient(45deg, transparent 75%, #d7c8ae 75%) 9px 9px / 18px 18px,
    #fff8e7;
}

.preview-edit-panel {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.36);
  border: 1px solid var(--line);
}

.preview-edit-panel h3 {
  margin: 0;
  font-size: 17px;
}

.chroma-key-panel,
.manual-repair-panel,
.crop-select-panel {
  gap: 6px;
  padding: 9px 10px;
}

.chroma-key-panel .feature-note,
.manual-repair-panel .feature-note,
.crop-select-panel .feature-note {
  margin: 1px 0 2px;
  font-size: 14px;
  line-height: 1.35;
}

.manual-repair-panel h3,
.chroma-key-panel h3,
.crop-select-panel h3 {
  font-size: 17px;
}

.chroma-key-panel .control-grid,
.manual-repair-panel .inline-controls {
  gap: 7px;
  margin: 3px 0;
}

.chroma-key-panel .chroma-key-grid {
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: start;
  gap: 8px 12px;
}

.chroma-key-panel .color-picker-field {
  width: 100%;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: start;
}

.chroma-key-panel .color-picker-field .field-title,
.chroma-key-panel .chroma-key-grid > label {
  color: #2d2118;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
}

.chroma-key-panel .color-picker-field input[type="color"] {
  width: 42px;
  height: 32px;
  min-height: 32px;
}

.chroma-key-panel .chroma-key-grid > label input {
  width: 100%;
}

.manual-repair-panel .inline-controls {
  display: grid;
  grid-template-columns: minmax(142px, 1fr) minmax(112px, 0.68fr) minmax(142px, 0.78fr);
  align-items: start;
}

.chroma-key-panel .control-note,
.manual-repair-panel .control-note:not(#brushColorHelp) {
  display: none;
}

.chroma-key-panel .range-control {
  margin: 0;
}

.chroma-key-panel .action-row {
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 8px;
  margin-top: 2px;
}

.chroma-key-panel .action-row p {
  font-size: 13px;
  line-height: 1.3;
}

.chroma-key-panel input,
.chroma-key-panel select,
.manual-repair-panel input,
.manual-repair-panel select,
.mini-tool input,
.mini-tool select {
  min-height: 32px;
  padding: 5px 7px;
}

.chroma-key-panel .control-note,
.manual-repair-panel .control-note,
.mini-tool .control-note {
  font-size: 11px;
  line-height: 1.32;
}

.manual-repair-panel .inline-controls label {
  min-width: 0;
  max-width: none;
  font-size: 15px;
}

.manual-repair-panel .brush-color-field {
  align-content: start;
  gap: 6px;
}

.manual-repair-panel .brush-color-field .field-title {
  color: #2d2118;
  font-weight: 900;
}

.brush-source-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 30px;
  padding: 4px 8px;
  color: #fff8e7;
  background: #2f603f;
  border: 2px solid #2a170b;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.18);
}

#brushColorHelp {
  max-width: 148px;
  color: #5c4b3b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.28;
}

.manual-repair-panel select,
.manual-repair-panel input:not([type="color"]) {
  min-height: 34px;
  font-size: 15px;
}

.manual-repair-panel input[type="color"] {
  width: 44px;
  min-height: 36px;
}

.selection-status {
  min-height: 24px;
  margin: 8px 0 0;
  color: #205f54;
  font-weight: 800;
}

.selection-status.compact {
  min-height: auto;
  margin: 0;
  font-size: 13px;
  line-height: 1.3;
}

.crop-select-panel {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.crop-select-panel .button-row {
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
}

.crop-select-panel .ghost-button,
.crop-select-panel .primary-button {
  min-height: 34px;
  padding: 6px 10px;
}

.crop-select-panel .selection-status {
  grid-column: 1 / -1;
}

.workflow-steps {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.workflow-steps span {
  display: block;
  padding: 10px 12px;
  color: #2d2118;
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid var(--line);
  font-weight: 800;
}

.output-strip {
  margin-top: 0;
}

body[data-active-panel="imagePanel"] .output-strip {
  display: none;
}

body[data-active-panel="videoPanel"] .output-strip {
  display: none;
}

body[data-active-panel="gifPanel"] .output-strip {
  display: none;
}

body[data-active-panel="animationAuditPanel"] .output-strip {
  display: none;
}

body[data-active-panel="tileAuditPanel"] .output-strip {
  display: none;
}

body[data-active-panel="aiTilesetAtlasPanel"] .output-strip {
  display: none;
}

body[data-active-panel="localizationQaPanel"] .output-strip {
  display: none;
}

body[data-active-panel="balanceSimPanel"] .output-strip {
  display: none;
}

body[data-active-panel="flowGraphPanel"] .output-strip {
  display: none;
}

body[data-active-panel="buildChecklistPanel"] .output-strip {
  display: none;
}

body[data-active-panel="saveDiffPanel"] .output-strip {
  display: none;
}

body[data-active-panel="crashLogPanel"] .output-strip {
  display: none;
}

body[data-active-panel="mapPanel"] .output-strip {
  display: none;
}

body[data-active-panel="sheetPanel"] .output-strip {
  display: none;
}

.output-strip .card-heading {
  align-items: flex-start;
}

.output-strip .feature-note {
  margin: 4px 0 0;
}

.frame-empty {
  margin: 12px 0 0;
  padding: 12px;
  color: #6c5845;
  background: rgba(255, 255, 255, 0.38);
  border: 1px dashed var(--line);
  line-height: 1.55;
}

.frame-empty[hidden] {
  display: none;
}

.gif-import-grid {
  align-items: stretch;
}

.gif-import-card {
  display: grid;
  align-content: start;
}

.gif-import-card > .button-row {
  justify-content: center;
  flex-wrap: wrap;
}

.gif-workbench-grid {
  align-items: start;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
}

.card-title-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.status-pill {
  flex: 0 0 auto;
  min-width: 56px;
  padding: 5px 8px;
  color: #fff8e7;
  text-align: center;
  background: #2f603f;
  border: 2px solid #2a170b;
  font-size: 12px;
  font-weight: 900;
}

.gif-param-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  margin: 10px 0;
}

.gif-param-strip label {
  min-width: 0;
  color: #2d2118;
  font-size: 13px;
  font-weight: 900;
}

.gif-param-strip input:not([type="checkbox"]) {
  min-height: 32px;
  margin-top: 4px;
}

.gif-frame-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
  max-height: 410px;
  overflow: auto;
  margin-top: 12px;
}

.gif-frame-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  background: rgba(255, 255, 255, 0.44);
  border: 2px solid rgba(42, 23, 11, 0.24);
  cursor: grab;
}

.gif-frame-card:active {
  cursor: grabbing;
}

.gif-frame-card.dragging {
  opacity: 0.52;
  outline: 3px dashed rgba(47, 143, 125, 0.7);
}

.gif-frame-card canvas {
  display: block;
  width: 100%;
  height: 76px;
  object-fit: contain;
  image-rendering: pixelated;
  background:
    linear-gradient(45deg, #ded1bd 25%, transparent 25%) 0 0 / 12px 12px,
    linear-gradient(45deg, transparent 75%, #ded1bd 75%) 0 0 / 12px 12px,
    linear-gradient(45deg, transparent 75%, #ded1bd 75%) 6px 6px / 12px 12px,
    #fff8e7;
  border: 1px solid rgba(42, 23, 11, 0.18);
}

.gif-frame-card strong,
.gif-frame-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gif-frame-card strong {
  color: #2d2118;
  font-size: 12px;
}

.gif-frame-card span {
  color: #6c5845;
  font-size: 11px;
  font-weight: 800;
}

.gif-frame-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.gif-frame-actions button {
  min-height: 30px;
  padding: 4px 6px;
  font-size: 12px;
}

.gif-preview-shell {
  position: relative;
}

.gif-preview-shell .preview-canvas {
  min-height: 300px;
}

.frame-gallery {
  grid-template-columns: repeat(auto-fill, minmax(94px, 1fr));
  max-height: 300px;
  overflow: auto;
}

.frame-card {
  padding: 8px;
  min-width: 0;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid var(--line);
}

.frame-card.selectable {
  cursor: var(--cursor-pointer), pointer;
}

.frame-card canvas,
.frame-card img {
  display: block;
  width: 100%;
  height: 74px;
  object-fit: contain;
  image-rendering: pixelated;
}

.frame-card span {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.frame-card.is-selected span {
  color: #fff8e7;
}

.frame-list {
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  max-height: 360px;
  overflow: auto;
}

#sheetPanel #sheetFrameList {
  grid-template-columns: repeat(var(--sheet-grid-cols, 1), minmax(72px, 1fr));
  padding-bottom: 8px;
}

#sheetPanel #sheetFrameList.sheet-dense-grid {
  grid-template-columns: repeat(var(--sheet-grid-cols, 1), minmax(0, 1fr));
  gap: 6px;
}

#sheetPanel #sheetFrameList.sheet-dense-grid .sheet-frame-tile {
  gap: 3px;
  padding: 3px;
}

#sheetPanel #sheetFrameList.sheet-dense-grid .sheet-frame-toggle {
  justify-content: center;
  min-height: 16px;
}

#sheetPanel #sheetFrameList.sheet-dense-grid .sheet-frame-toggle span {
  display: none;
}

#sheetPanel #sheetFrameList.sheet-dense-grid .sheet-frame-button {
  gap: 2px;
  padding: 3px;
}

#sheetPanel #sheetFrameList.sheet-dense-grid .sheet-frame-button canvas {
  height: 42px;
}

#sheetPanel #sheetFrameList.sheet-dense-grid .sheet-frame-button span {
  font-size: 11px;
}

.sheet-frame-tile {
  position: relative;
  display: grid;
  gap: 5px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.46);
  border: 2px solid transparent;
}

.sheet-frame-tile.active {
  border-color: var(--jade);
}

.sheet-frame-tile.is-disabled {
  opacity: 0.52;
  filter: grayscale(0.55);
}

.sheet-frame-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #2d2118;
  font-size: 12px;
  font-weight: 900;
}

.sheet-frame-toggle input {
  width: 14px;
  height: 14px;
  accent-color: var(--jade);
}

.sheet-frame-button {
  display: grid;
  gap: 4px;
  padding: 6px;
  width: 100%;
  background: rgba(255, 255, 255, 0.46);
  border: 2px solid transparent;
}

.sheet-frame-button.active {
  border-color: var(--jade);
}

.sheet-frame-button canvas {
  width: 100%;
  height: 58px;
  object-fit: contain;
  image-rendering: pixelated;
}

.sheet-frame-button span {
  color: var(--ink-soft);
  font-size: 12px;
}

.sheet-preview-bg-paper {
  background: #f1d89c !important;
}

.sheet-preview-bg-dark {
  background: #1d1711 !important;
}

.sheet-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.sheet-preview-grid h4 {
  margin: 0 0 6px;
  color: #2d2118;
}

.compact-canvas {
  width: auto;
  height: auto;
  min-height: 0;
  max-width: 100%;
  max-height: 360px;
}

.image2-workbench {
  align-items: start;
}

.image2-gpt-hub {
  display: grid;
  gap: 14px;
  margin: 14px 0;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(215, 240, 229, 0.38)),
    #f4dda8;
  border: 4px solid #2a170b;
  box-shadow:
    inset 0 4px 0 rgba(255, 248, 231, 0.62),
    inset 0 -4px 0 rgba(184, 121, 52, 0.28),
    4px 4px 0 rgba(0, 0, 0, 0.22);
}

.image2-hub-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.image2-hub-heading h3,
.image2-blueprint-panel h3 {
  margin: 0;
}

.image2-gpt-slot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.image2-gpt-slot {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 12px;
  color: #2d2118;
  background: rgba(255, 248, 231, 0.66);
  border: 2px solid rgba(42, 23, 11, 0.38);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.42);
}

.image2-gpt-slot.configured {
  border-color: rgba(47, 96, 63, 0.72);
  background: rgba(215, 240, 229, 0.72);
}

.image2-gpt-slot-head {
  display: grid;
  gap: 4px;
}

.image2-gpt-slot-head span {
  color: #2f8f7d;
  font-size: 12px;
  font-weight: 900;
}

.image2-gpt-slot-head strong {
  font-size: 16px;
}

.image2-gpt-slot-head em {
  width: max-content;
  padding: 3px 7px;
  color: #fff8e7;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
  background: #623719;
  border: 2px solid #2a170b;
}

.image2-gpt-slot.configured .image2-gpt-slot-head em {
  background: #2f603f;
}

.image2-gpt-slot p,
.image2-gpt-slot label {
  margin: 0;
  color: #5c4b3b;
  line-height: 1.48;
}

.image2-gpt-slot label {
  display: grid;
  gap: 5px;
  font-weight: 800;
}

.image2-gpt-slot input {
  min-width: 0;
}

.image2-blueprint-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.36);
  border: 2px dashed rgba(47, 96, 63, 0.5);
}

.image2-blueprint-output {
  width: 100%;
  min-height: 220px;
  color: #1d1711;
  background: #fff8e7;
  border: 2px solid rgba(33, 20, 12, 0.34);
  padding: 10px;
  line-height: 1.55;
  resize: vertical;
}

.image2-param-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.image2-style-field {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  font-weight: 800;
}

.image2-style-field textarea,
.image2-prompt-output {
  width: 100%;
  color: #1d1711;
  background: #fff8e7;
  border: 2px solid rgba(33, 20, 12, 0.34);
  padding: 10px;
  line-height: 1.58;
  resize: vertical;
}

.image2-check-options {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.image2-check-options label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  color: #4b3b2e;
  background: rgba(255, 255, 255, 0.32);
  border: 2px solid rgba(42, 23, 11, 0.22);
  line-height: 1.45;
}

.image2-check-options input {
  margin-top: 3px;
  accent-color: var(--jade);
}

.image2-reference-list {
  display: grid;
  gap: 8px;
  min-height: 54px;
  margin: 12px 0 16px;
  padding: 10px;
  color: #5c4b3b;
  background: rgba(255, 255, 255, 0.34);
  border: 2px dashed rgba(47, 96, 63, 0.42);
}

.image2-reference-list span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.image2-result-card {
  align-content: start;
}

.image2-prompt-output {
  min-height: 320px;
  font-size: 14px;
}

.image2-result-summary {
  margin: 12px 0 16px;
  padding: 10px 12px;
  color: #205f54;
  background: rgba(115, 213, 172, 0.16);
  border: 2px solid rgba(47, 96, 63, 0.42);
  font-weight: 800;
  line-height: 1.55;
}

.image2-template-card {
  margin-top: 14px;
}

.gpt-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.gpt-card {
  display: grid;
  gap: 12px;
  min-height: 260px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(215, 240, 229, 0.58));
  border: 2px solid var(--line);
}

.gpt-card textarea {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  color: #1d1711;
  background: #fff8e7;
  border: 2px solid rgba(33, 20, 12, 0.34);
  padding: 10px;
  line-height: 1.55;
}

.image2-grid-fix-guide {
  margin: 14px 0;
}

.image2-grid-fix-workbench {
  align-items: start;
}

.image2-grid-fix-ingest,
.image2-grid-fix-output {
  outline: 2px dashed transparent;
  outline-offset: -8px;
  transition: background 0.16s ease, outline-color 0.16s ease, box-shadow 0.16s ease;
}

.image2-grid-fix-ingest.dragging {
  background: rgba(47, 143, 125, 0.1);
  outline-color: rgba(47, 143, 125, 0.78);
  box-shadow:
    inset 0 4px 0 #fff0b8,
    inset 0 -4px 0 #b87934,
    inset 0 0 0 4px rgba(255, 248, 231, 0.58),
    4px 4px 0 rgba(0, 0, 0, 0.2);
}

.image2-grid-fix-upload {
  min-height: 164px;
  background:
    linear-gradient(135deg, rgba(47, 143, 125, 0.08), rgba(201, 95, 54, 0.08)),
    rgba(255, 255, 255, 0.36);
}

.image2-grid-fix-param-grid,
.image2-grid-fix-manual-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px;
}

.image2-grid-fix-status,
.image2-grid-fix-report {
  margin: 12px 0 0;
  padding: 12px;
  color: #205f54;
  background: rgba(215, 240, 229, 0.54);
  border: 2px solid rgba(47, 96, 63, 0.42);
  font-weight: 800;
  line-height: 1.55;
}

.image2-grid-fix-report {
  color: #4b3b2e;
  background: rgba(255, 248, 231, 0.52);
  border-color: rgba(42, 23, 11, 0.3);
}

.image2-grid-fix-report ul {
  margin: 0;
  padding-left: 18px;
}

.image2-grid-fix-preview-grid {
  margin-top: 14px;
  align-items: start;
}

.image2-grid-fix-canvas {
  min-height: 360px;
  max-height: 560px;
  background:
    linear-gradient(45deg, rgba(47, 96, 63, 0.08) 25%, transparent 25%) 0 0 / 14px 14px,
    rgba(255, 248, 231, 0.64);
}

.image2-grid-fix-result-preview {
  display: grid;
  grid-template-columns: minmax(150px, 0.75fr) minmax(0, 1.25fr);
  gap: 12px;
  align-items: start;
}

.image2-grid-fix-result-preview h4 {
  margin: 0 0 8px;
  color: #2d2118;
}

.image2-grid-fix-frame-canvas {
  min-height: 220px;
  max-height: 320px;
}

.image2-grid-fix-frame-card {
  margin-top: 14px;
}

.image2-grid-fix-frame-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  margin-top: 12px;
  padding: 10px;
  background: rgba(255, 248, 231, 0.42);
  border: 2px solid rgba(42, 23, 11, 0.28);
}

.image2-grid-fix-frame-tile {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  color: #4b3b2e;
  background: rgba(255, 255, 255, 0.36);
  border: 2px solid rgba(42, 23, 11, 0.25);
  box-shadow: inset 0 -2px 0 rgba(42, 23, 11, 0.1);
  cursor: var(--cursor-click), pointer;
}

.image2-grid-fix-frame-tile.active {
  color: #fff8e7;
  background:
    linear-gradient(180deg, rgba(47, 143, 125, 0.18), rgba(47, 96, 63, 0.82)),
    #2f603f;
  border-color: #1d1711;
  box-shadow: inset 0 0 0 2px rgba(255, 248, 231, 0.35), 3px 3px 0 rgba(33, 20, 12, 0.28);
}

.image2-grid-fix-frame-tile canvas {
  width: 100%;
  height: 72px;
  object-fit: contain;
  image-rendering: pixelated;
  background:
    linear-gradient(45deg, #d7c8ae 25%, transparent 25%) 0 0 / 12px 12px,
    linear-gradient(45deg, transparent 75%, #d7c8ae 75%) 0 0 / 12px 12px,
    linear-gradient(45deg, transparent 75%, #d7c8ae 75%) 6px 6px / 12px 12px,
    #fff8e7;
}

.image2-grid-fix-frame-tile span {
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
}

.asset-slice-panel .tool-card {
  align-content: start;
}

.asset-slice-ingest.dragging .asset-slice-upload-box {
  background: rgba(47, 143, 125, 0.14);
  border-color: #2f8f7d;
  box-shadow: inset 0 0 0 4px rgba(255, 248, 231, 0.62);
}

.asset-slice-upload-box {
  min-height: 176px;
  place-content: center;
  justify-items: center;
}

.asset-slice-mode-grid,
.asset-slice-param-grid {
  align-items: stretch;
}

.asset-slice-source-card {
  margin-top: 14px;
}

.asset-slice-source-canvas {
  display: block;
  width: 100%;
  min-height: 360px;
  max-height: 680px;
  image-rendering: pixelated;
  background:
    linear-gradient(45deg, rgba(47, 96, 63, 0.08) 25%, transparent 25%) 0 0 / 14px 14px,
    linear-gradient(45deg, transparent 75%, rgba(47, 96, 63, 0.08) 75%) 0 0 / 14px 14px,
    #fff8e7;
  border: 3px solid rgba(42, 23, 11, 0.48);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.32);
  cursor: crosshair;
}

.asset-slice-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
  max-height: 430px;
  overflow: auto;
  padding: 4px;
}

#assetSliceEmptyState {
  position: static;
  min-height: 120px;
  margin-top: 10px;
}

.asset-slice-item {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  color: #4b3b2e;
  text-align: left;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent 52%),
    rgba(255, 248, 231, 0.72);
  border: 2px solid rgba(42, 23, 11, 0.36);
  cursor: pointer;
}

.asset-slice-item.active {
  color: #fff8e7;
  background:
    linear-gradient(180deg, rgba(47, 143, 125, 0.18), rgba(47, 96, 63, 0.82)),
    #2f603f;
  outline: 3px solid #ffcf4a;
  outline-offset: 2px;
}

.asset-slice-item canvas {
  width: 100%;
  height: 74px;
  object-fit: contain;
  image-rendering: pixelated;
  background:
    linear-gradient(45deg, rgba(42, 23, 11, 0.08) 25%, transparent 25%) 0 0 / 12px 12px,
    linear-gradient(45deg, transparent 75%, rgba(42, 23, 11, 0.08) 75%) 0 0 / 12px 12px,
    rgba(255, 248, 231, 0.82);
  border: 1px solid rgba(42, 23, 11, 0.32);
}

.asset-slice-item span,
.asset-slice-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-slice-item small {
  color: inherit;
  opacity: 0.78;
}

.asset-slice-preview-canvas {
  min-height: 260px;
  max-height: 420px;
}

.asset-slice-manifest-preview {
  min-height: 180px;
}

.ai-tileset-atlas-panel .tool-card {
  align-content: start;
}

.ai-tileset-atlas-workbench {
  align-items: stretch;
}

.ai-tileset-ingest.drag-over .workshop-upload-box {
  border-color: #2f603f;
  background:
    linear-gradient(45deg, rgba(47, 96, 63, 0.16) 25%, transparent 25%) 0 0 / 12px 12px,
    rgba(255, 242, 192, 0.92);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.34),
    0 0 0 3px rgba(47, 96, 63, 0.18);
}

.ai-tileset-color-grid input[type="color"] {
  width: 54px;
  min-height: 38px;
  padding: 3px;
  border: 2px solid rgba(42, 23, 11, 0.56);
}

.ai-tileset-setting-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ai-tileset-source-card {
  margin-top: 14px;
}

.ai-tileset-source-canvas {
  display: block;
  width: 100%;
  min-height: 320px;
  max-height: 620px;
  margin-top: 12px;
  background:
    linear-gradient(45deg, #d7c8ae 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(45deg, transparent 75%, #d7c8ae 75%) 0 0 / 18px 18px,
    linear-gradient(45deg, transparent 75%, #d7c8ae 75%) 9px 9px / 18px 18px,
    #fff8e7;
  border: 3px solid rgba(42, 23, 11, 0.52);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.28),
    3px 3px 0 rgba(33, 20, 12, 0.16);
  cursor: crosshair;
  image-rendering: pixelated;
  object-fit: contain;
}

.ai-tileset-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 8px;
  max-height: 210px;
  overflow: auto;
  margin-top: 12px;
  padding: 10px;
  background: rgba(255, 248, 231, 0.46);
  border: 2px solid rgba(42, 23, 11, 0.28);
}

.ai-tileset-tile-button {
  min-height: 38px;
  padding: 7px 8px;
  color: #4b3b2e;
  background:
    linear-gradient(180deg, rgba(255, 221, 140, 0.9), rgba(222, 169, 82, 0.9)),
    #e5b05d;
  border: 3px solid #241306;
  box-shadow:
    inset 0 3px 0 rgba(255, 248, 231, 0.42),
    inset 0 -3px 0 rgba(72, 36, 18, 0.22),
    2px 2px 0 rgba(33, 20, 12, 0.24);
  font-weight: 900;
  cursor: var(--cursor-click), pointer;
}

.ai-tileset-tile-button.ready {
  color: #fff8e7;
  background:
    linear-gradient(180deg, #2f603f 0 8px, #22452e 8px calc(100% - 6px), #17301f calc(100% - 6px));
}

.ai-tileset-tile-button.empty {
  color: #6c5845;
  background:
    repeating-linear-gradient(45deg, rgba(42, 23, 11, 0.08) 0 6px, transparent 6px 12px),
    rgba(255, 248, 231, 0.64);
}

.ai-tileset-tile-button.active {
  color: #1d1711;
  outline: 3px solid #ffcf4a;
  outline-offset: 2px;
  transform: translate(-1px, -1px);
}

.ai-tileset-output-card {
  min-width: 0;
  margin-top: 14px;
}

.ai-tileset-output-canvas,
.ai-tileset-final-canvas {
  min-height: 280px;
  max-height: 520px;
  border: 3px solid rgba(42, 23, 11, 0.48);
}

.ai-tileset-final-canvas {
  min-height: 220px;
}

.manifest-preview {
  min-height: 220px;
  max-height: 360px;
  margin: 12px 0 0;
  padding: 12px;
  color: #2d2118;
  background: #fff3c4;
  border: 3px solid rgba(42, 23, 11, 0.38);
  line-height: 1.48;
  overflow: auto;
  white-space: pre-wrap;
}

.wardrobe-layer-panel .roadmap-kicker {
  margin-bottom: 14px;
}

.wardrobe-layer-workbench,
.wardrobe-layer-edit-grid {
  align-items: stretch;
}

.wardrobe-layer-ingest.drag-over .workshop-upload-box {
  border-color: #2f603f;
  background:
    linear-gradient(45deg, rgba(47, 96, 63, 0.16) 25%, transparent 25%) 0 0 / 12px 12px,
    rgba(255, 242, 192, 0.92);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.34),
    0 0 0 3px rgba(47, 96, 63, 0.18);
}

.wardrobe-layer-settings,
.wardrobe-layer-transform-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wardrobe-layer-canvas {
  min-height: 520px;
  max-height: 680px;
  cursor: default;
  touch-action: none;
}

.wardrobe-layer-canvas.dragging {
  cursor: grabbing;
}

.wardrobe-layer-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  margin: 12px 0;
  overflow: auto;
}

.wardrobe-layer-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  text-align: left;
  color: #2d2118;
  background: rgba(255, 255, 255, 0.38);
  border: 2px solid rgba(42, 23, 11, 0.35);
  cursor: pointer;
  cursor: var(--cursor-click);
}

.wardrobe-layer-item.is-active {
  border-color: #2f603f;
  box-shadow: inset 0 0 0 2px rgba(47, 96, 63, 0.22);
}

.wardrobe-layer-thumb {
  width: 48px;
  height: 48px;
  background:
    linear-gradient(45deg, #d7c8ae 25%, transparent 25%) 0 0 / 12px 12px,
    linear-gradient(45deg, transparent 75%, #d7c8ae 75%) 0 0 / 12px 12px,
    #fff8e7;
  border: 2px solid rgba(42, 23, 11, 0.45);
  image-rendering: pixelated;
  object-fit: contain;
}

.wardrobe-layer-meta {
  min-width: 0;
}

.wardrobe-layer-meta strong,
.wardrobe-layer-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wardrobe-layer-meta span {
  color: #6d5c4d;
  font-size: 12px;
  line-height: 1.5;
}

.wardrobe-layer-order {
  color: var(--paper-2);
  background: #2f603f;
  border: 2px solid #2a170b;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 900;
}

.danger-button {
  min-height: 36px;
  padding: 7px 14px;
  color: #fff8e7;
  background:
    linear-gradient(180deg, #9a2f1d 0 8px, #74301f 8px calc(100% - 7px), #4f2118 calc(100% - 7px));
  border: 3px solid #241306;
  box-shadow:
    inset 0 3px 0 rgba(255, 232, 167, 0.2),
    inset 0 -3px 0 rgba(0, 0, 0, 0.28),
    3px 3px 0 rgba(0, 0, 0, 0.26);
  font-weight: 900;
  cursor: pointer;
  cursor: var(--cursor-click);
}

.job-log {
  min-height: 280px;
  margin: 0;
  padding: 12px;
  color: #cdeee6;
  white-space: pre-wrap;
  background: #1d1711;
  border: 2px solid #21140c;
  overflow: auto;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 50;
  min-width: 220px;
  max-width: min(560px, calc(100vw - 32px));
  padding: 12px 16px;
  color: #fff8e7;
  background: #205f54;
  border: 3px solid #1d1711;
  box-shadow: 5px 5px 0 rgba(33, 20, 12, 0.28);
  opacity: 0;
  transform: translate(-50%, 18px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1220px) {
  .side-tool-list {
    grid-auto-rows: 112px;
  }

  .side-tool-row {
    grid-template-columns: 78px minmax(0, 1fr) 68px;
    gap: 6px;
  }

  .scale-row-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 6px;
    overflow: hidden;
  }

  .scale-row-fields label {
    display: grid;
    gap: 1px;
    font-size: 14px;
  }

  .scale-row-fields input:not([type="checkbox"]) {
    width: 100%;
    min-height: 29px;
    font-size: 14px;
  }

  .scale-row-fields .compact-check {
    grid-column: 1 / -1;
    font-size: 14px;
  }

  .stroke-row-fields {
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 4px 8px;
  }

  .stroke-row-fields span {
    grid-column: 1 / -1;
  }

  .stroke-row-fields label {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    grid-column: 1 / -1;
    align-items: center;
  }

  .stroke-row-fields input:not([type="checkbox"]) {
    width: 100%;
  }

  .stroke-row-fields input[type="color"] {
    width: 44px;
  }
}

@media (max-width: 1100px) {
  .workspace-layout {
    grid-template-columns: 1fr;
  }

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

  .nav-item {
    text-align: center;
  }

  .feature-grid,
  .gpt-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .image2-gpt-slot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-grid.image-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-grid.three,
  .gif-workbench-grid {
    grid-template-columns: 1fr;
  }

  .gif-param-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sheet-preview-grid {
    grid-template-columns: 1fr;
  }

  .tool-grid.image-utility-grid {
    grid-template-columns: 1fr;
  }

  .compact-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sheet-range-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sheet-range-index {
    grid-column: 1 / -1;
  }

  .map-expansion-layout {
    grid-template-columns: 1fr;
  }

  .audit-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .audit-preview-grid {
    grid-template-columns: 1fr;
  }

  .ai-tileset-setting-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .audit-table-row {
    grid-template-columns: minmax(100px, 0.7fr) minmax(120px, 1fr) minmax(160px, 1.5fr);
  }

  .audit-table-row span:last-child {
    grid-column: 1 / -1;
  }

  .drop-result-row {
    grid-template-columns: minmax(120px, 0.8fr) minmax(140px, 1fr);
  }

  .drop-result-row em {
    grid-column: 1 / -1;
  }

  .image2-grid-fix-result-preview {
    grid-template-columns: 1fr;
  }

  .ai-tileset-setting-grid {
    grid-template-columns: 1fr;
  }

  .ai-tileset-source-canvas {
    min-height: 220px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100vw - 32px, 1420px);
    padding-top: 9px;
  }

  .topbar {
    width: calc(100% - 12px);
    padding: 12px 14px;
  }

  .topbar,
  .panel-title-row,
  .topbar-actions {
    align-items: flex-start;
  }

  .topbar,
  .panel-title-row,
  .category-heading,
  .phase0-resource-callout,
  .workshop-footer {
    flex-direction: column;
  }

  .workshop-footer {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .workshop-footer-meta {
    justify-items: center;
  }

  .panel h2 {
    font-size: 26px;
    line-height: 1.22;
  }

  .sidebar,
  .feature-grid,
  .split-panels,
  .tool-grid.two,
  .tool-grid.three,
  .tool-grid.image-tools,
  .tool-grid.image-utility-grid,
    .map-mode-tabs,
    .sheet-stepper,
    .gif-stepper,
    .image2-stepper,
    .image2-gpt-slot-grid,
    .gif-workbench-grid,
  .image2-grid-fix-result-preview,
  .gif-param-strip,
  .map-expansion-layout,
  .gpt-grid,
  .control-grid,
  .placeholder-grid,
  .roadmap-kicker {
    grid-template-columns: 1fr;
  }

  .compact-action-grid,
  .mini-fields {
    grid-template-columns: 1fr;
  }

  .image-action-pair {
    grid-template-columns: 1fr;
  }

  .sheet-range-tools,
  .sheet-axis-toggle {
    grid-template-columns: 1fr;
  }

  .side-tool-row {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: auto;
    height: auto;
  }

  .side-tool-list {
    grid-auto-rows: auto;
  }

  .map-expansion-stage-shell {
    min-height: 320px;
    padding: 10px;
  }

  .map-expansion-stage {
    min-height: 280px;
  }

  .map-feather-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-tool-fields {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-expand-settings .map-split-field,
  .map-expand-settings .map-overlap-x-field,
  .map-expand-settings .map-overlap-y-field {
    grid-column: auto;
    grid-row: auto;
  }

  .button-row.map-action-bar {
    grid-template-columns: 1fr;
  }

  .manual-repair-panel .inline-controls {
    grid-template-columns: 1fr;
  }

  #sheetPanel .sheet-export-check {
    grid-template-columns: auto 1fr;
    align-items: start;
  }

  #sheetPanel .sheet-export-check span {
    grid-column: 1 / -1;
  }

  .video-stepper {
    grid-template-columns: 1fr;
  }

  .video-param-row {
    grid-template-columns: 1fr;
  }

  .video-prefix-field {
    max-width: none;
  }

  .card-title-row {
    flex-direction: column;
  }

  .video-frame-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .sidebar {
    max-height: 260px;
    overflow: auto;
  }

  .panel,
  .tool-card {
    padding: 12px;
  }

  .action-row {
    grid-template-columns: 1fr;
  }

  .audit-summary-grid,
  .audit-file-row,
  .mini-control-row,
  .audit-table-row,
  .localization-preview-table .audit-table-row,
  .drop-result-row {
    grid-template-columns: 1fr;
  }

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

  .audit-file-row strong {
    white-space: normal;
  }
}
