:root {
  color: #e8eeea;
  background: #0a0d0c;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  --panel: #111513;
  --panel-raised: #171c19;
  --field: #0d1210;
  --line: #29312d;
  --line-soft: #202622;
  --muted: #89938e;
  --accent: #9ee66d;
  --warning: #f2bd5e;
  --danger: #ef776e;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

button,
select,
input,
textarea { font: inherit; }

button { cursor: pointer; }
button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible,
.file-picker:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.app-shell {
  display: grid;
  grid-template-rows: 36px minmax(0, 1fr) 28px;
  width: 100%;
  height: 100%;
}

.main-menu-bar {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 0 9px;
  background: #111513;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.app-identity { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.app-identity strong { font-size: 12px; font-weight: 700; letter-spacing: 0.02em; }
.app-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: #0b100c;
  background: var(--accent);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 900;
}

.main-menu-bar nav { display: flex; align-items: stretch; height: 100%; }
.main-menu-bar nav button {
  padding: 0 10px;
  color: #aeb8b3;
  background: transparent;
  border: 0;
  font-size: 11px;
}
.main-menu-bar nav button:hover { color: #fff; background: #1b211e; }

.status-badge {
  padding: 3px 8px;
  color: var(--muted);
  background: #171c19;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 9px;
  white-space: nowrap;
}
.status-badge[data-state="working"] { color: var(--warning); }
.status-badge[data-state="success"] { color: var(--accent); }
.status-badge[data-state="error"] { color: var(--danger); }

.editor-workspace {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr) 440px;
  min-height: 0;
}
.editor-workspace.panel-collapsed { grid-template-columns: 124px minmax(0, 1fr) 0; }
.editor-workspace.panel-collapsed .control-panel { visibility: hidden; overflow: hidden; }

.tools-window,
.control-panel {
  position: relative;
  z-index: 4;
  min-height: 0;
  background: var(--panel);
}

.tools-window {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--line);
}

.tools-window > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  height: 34px;
  padding: 9px 9px 7px;
  border-bottom: 1px solid var(--line);
}
.tools-window > header strong { font-size: 11px; }
.tools-window > header span { color: var(--muted); font-size: 8px; }
.tools-window section { padding: 9px 7px 5px; }
.tools-window h2 {
  margin: 0 2px 6px;
  color: #6f7a74;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.modeling-toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.modeling-toolbar button {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  padding: 7px 3px 6px;
  color: #aab5af;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 8px;
}
.modeling-toolbar kbd {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  color: var(--accent);
  background: #0b0f0d;
  border: 1px solid #38413c;
  border-radius: 5px;
  font: 700 10px/1 inherit;
}
.modeling-toolbar button:hover:not(:disabled) { color: #fff; background: #1b211e; }
.modeling-toolbar button[aria-pressed="true"] {
  color: #effbe8;
  background: rgba(158, 230, 109, 0.12);
  border-color: rgba(158, 230, 109, 0.36);
}
.modeling-toolbar button:disabled { opacity: 0.28; cursor: not-allowed; }
.tools-spacer {
  flex: 1;
  min-height: 100px;
  margin: 8px;
  border: 1px dashed #252c28;
  border-radius: 6px;
}
.tools-spacer span { display: block; padding: 9px; color: #49524d; font-size: 8px; text-align: center; }

.viewer {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(82, 112, 95, 0.16), transparent 40%),
    linear-gradient(145deg, #131815, #090c0b 68%);
}
#viewport { display: block; width: 100%; height: 100%; outline: 0; }

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 32px;
  text-align: center;
  pointer-events: none;
}
.empty-icon { color: var(--accent); font-size: 48px; line-height: 1; text-shadow: 0 0 30px rgba(158, 230, 109, 0.22); }
.empty-state h1 { margin: 16px 0 7px; font-size: clamp(20px, 2.5vw, 30px); font-weight: 620; }
.empty-state p { max-width: 420px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

.canvas-hint {
  position: absolute;
  left: 50%;
  bottom: 58px;
  max-width: calc(100% - 24px);
  padding: 6px 10px;
  overflow: hidden;
  color: #aab5af;
  background: rgba(13, 17, 15, 0.78);
  border: 1px solid rgba(111, 130, 120, 0.2);
  border-radius: 5px;
  transform: translateX(-50%);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.viewer-toolbar {
  position: absolute;
  left: 50%;
  bottom: 13px;
  display: flex;
  gap: 2px;
  padding: 3px;
  transform: translateX(-50%);
  background: rgba(17, 22, 19, 0.92);
  border: 1px solid rgba(105, 128, 117, 0.24);
  border-radius: 6px;
  backdrop-filter: blur(10px);
}
.viewer-toolbar button {
  padding: 6px 9px;
  color: #cfd7d2;
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-size: 9px;
}
.viewer-toolbar button:hover:not(:disabled),
.viewer-toolbar button[aria-pressed="true"] { color: #0c130d; background: var(--accent); }
.viewer-toolbar button:disabled { color: #56605b; cursor: not-allowed; }

.control-panel {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 32px rgba(0, 0, 0, 0.18);
}
.dock-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  flex: 0 0 auto;
  border-bottom: 1px solid var(--line);
}
.dock-tabs button {
  min-width: 0;
  padding: 12px 5px 11px;
  color: #87928c;
  background: #0f1311;
  border: 0;
  border-right: 1px solid var(--line-soft);
  border-bottom: 2px solid transparent;
  font-size: 10px;
  white-space: nowrap;
}
.dock-tabs button:last-child { border-right: 0; }
.dock-tabs button:hover { color: #d9e0dc; background: #171c19; }
.dock-tabs button[aria-selected="true"] { color: var(--accent); background: var(--panel); border-bottom-color: var(--accent); }

.dock-content { min-height: 0; overflow-y: auto; scrollbar-color: #3b4540 transparent; scrollbar-width: thin; }
.dock-page { padding: 20px; }
.window-title,
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.window-title { margin-bottom: 16px; }
.window-title h2 { margin: 3px 0 0; font-size: 20px; font-weight: 650; }
.window-title > kbd,
.window-title > span {
  padding: 4px 6px;
  color: var(--muted);
  background: #0d110f;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 9px;
  white-space: nowrap;
}
.window-kicker { color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: 0.12em; }
.section-title h3 { margin: 0; font-size: 11px; }
.section-title span { color: var(--muted); font-size: 9px; }

.dock-page > label,
.tool-option-stack label,
.ai-advanced label { display: block; margin: 10px 0 6px; color: var(--muted); font-size: 9px; }
select,
input,
textarea {
  width: 100%;
  min-width: 0;
  padding: 8px 9px;
  color: #e1e7e3;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 5px;
  transition: border-color 140ms ease, background 140ms ease;
}
select:hover,
input:hover,
textarea:hover:not(:disabled) { border-color: #47534d; }
textarea {
  min-height: 96px;
  resize: vertical;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 9px;
  line-height: 1.5;
}
textarea:disabled { opacity: 0.5; }

.tool-option-stack {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  padding: 10px;
  background: var(--panel-raised);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
}
.tool-option-stack label { display: flex; justify-content: space-between; margin: 0; }
.tool-option-stack output { color: var(--accent); font-variant-numeric: tabular-nums; }
.tool-option-stack input[type="range"] { padding: 0; accent-color: var(--accent); }
.tool-help,
.panel-note {
  margin: 0;
  padding: 9px;
  color: var(--muted);
  background: #0d110f;
  border-left: 2px solid #52615a;
  font-size: 9px;
  line-height: 1.55;
}

.compact-window {
  margin-top: 12px;
  padding: 11px;
  background: var(--panel-raised);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
}
.selection-window > p,
.project-summary > p { margin: 7px 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.selection-window .selection-action-hint {
  padding: 7px 8px;
  color: #aeb8b2;
  background: #0d110f;
  border-left: 2px solid var(--accent);
}
.selection-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 9px; }
.selection-actions button,
.selection-window > button {
  width: 100%;
  margin-top: 3px;
  padding: 7px;
  color: #cbd4cf;
  background: #1c231f;
  border: 1px solid #343e38;
  border-radius: 4px;
  font-size: 9px;
}
.selection-actions button { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 0; }
.selection-actions button:hover:not(:disabled) { color: #ffffff; border-color: #536159; }
.selection-actions .danger-button { color: #ffd0cc; border-color: rgba(239, 119, 110, 0.38); }
.selection-actions .danger-button:hover:not(:disabled) { color: #ffffff; background: rgba(239, 119, 110, 0.16); border-color: var(--danger); }
.selection-actions kbd { padding: 1px 3px; color: #c9d1cd; background: #0d110f; border: 1px solid #455049; border-radius: 2px; font: 7px/1.2 Consolas, monospace; }
.selection-clear-button { color: var(--muted) !important; background: transparent !important; border-color: transparent !important; }
.selection-actions button:disabled,
.selection-window > button:disabled { opacity: 0.32; cursor: not-allowed; }

details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #cdd5d1;
  cursor: pointer;
  font-size: 10px;
  list-style: none;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "›"; color: var(--muted); transform: rotate(90deg); }
details[open] > summary::after { transform: rotate(-90deg); }
.target-window summary span:last-child { margin-left: auto; color: var(--muted); font-size: 9px; }

.selection-empty {
  margin-top: 10px;
  padding: 10px;
  color: var(--muted);
  background: #0d110f;
  border: 1px dashed #35403a;
  border-radius: 5px;
  font-size: 9px;
  line-height: 1.5;
}
.selection-info { margin-top: 10px; padding: 10px; background: #0d110f; border-radius: 5px; }
.selection-info > strong {
  display: block;
  overflow: hidden;
  color: var(--accent);
  font: 10px/1.4 Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.selection-info dl { display: grid; gap: 5px; margin: 9px 0; }
.selection-info dl div { display: flex; justify-content: space-between; gap: 8px; font-size: 9px; }
.selection-info dt { color: var(--muted); }
.selection-info dd { margin: 0; text-align: right; }
.property-list { display: flex; flex-wrap: wrap; gap: 4px; }
.property-list span { padding: 3px 5px; color: #adb8b2; background: #1b221e; border-radius: 3px; font: 8px/1.3 Consolas, monospace; }

.block-state-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; margin-top: 6px; }
.block-state-row button,
.history-row button,
.ai-plan-actions button {
  padding: 7px 8px;
  color: #cad3ce;
  background: #1a211d;
  border: 1px solid #333d37;
  border-radius: 4px;
  font-size: 9px;
}
.block-state-row button:disabled,
.history-row button:disabled,
.ai-plan-actions button:disabled { opacity: 0.32; cursor: not-allowed; }
.panel-note { margin-top: 9px; }
.active-block-card {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) 34px;
  grid-template-rows: auto auto;
  gap: 9px 12px;
  align-items: center;
  padding: 12px;
  background: var(--panel-raised);
  border: 1px solid rgba(158, 230, 109, 0.22);
  border-radius: 6px;
}
.block-preview {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--block-color, #425048);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  image-rendering: pixelated;
}
.block-preview::after { content: ""; position: absolute; inset: 0; box-shadow: inset -5px -6px 0 rgba(0, 0, 0, 0.13), inset 4px 4px 0 rgba(255, 255, 255, 0.08); pointer-events: none; }
.block-preview img { position: absolute; image-rendering: pixelated; }
.block-preview-item,
.block-preview-model { background: #111713; }
.block-preview-item::after,
.block-preview-model::after { display: none; }
.block-icon-item { inset: 4%; width: 92%; height: 92%; object-fit: contain; }
.block-icon-rendered { inset: 0; width: 100%; height: 100%; object-fit: contain; }
.block-preview-large { grid-row: 1 / 3; width: 60px; height: 60px; }
.active-block-info { min-width: 0; }
.active-block-info strong,
.active-block-info code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.active-block-info strong { font-size: 13px; }
.active-block-info code { margin-top: 5px; color: var(--muted); font: 9px/1.35 Consolas, monospace; }
#active-block-favorite {
  width: 34px;
  height: 34px;
  padding: 0;
  color: #aab4af;
  background: #0d110f;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 20px;
}
#active-block-favorite[aria-pressed="true"] { color: var(--warning); }
#pick-target-block {
  grid-column: 2 / 4;
  padding: 8px 10px;
  color: #cbd4cf;
  background: #1b221e;
  border: 1px solid #35413a;
  border-radius: 4px;
  font-size: 9px;
}
#pick-target-block:disabled { opacity: 0.32; cursor: not-allowed; }
.creative-inventory { margin-top: 10px; font-family: Consolas, "Microsoft YaHei UI", sans-serif; }
.block-category-filters {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 2px;
  padding: 0 7px;
}
.block-category-filters button {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 39px;
  padding: 3px;
  color: #252525;
  background: #8b8b8b;
  border: 2px solid;
  border-color: #ffffff #373737 #373737 #ffffff;
  border-radius: 3px 3px 0 0;
  box-shadow: inset 0 0 0 1px #aaaaaa;
}
.block-category-filters button:hover { background: #a8a8a8; }
.block-category-filters button[aria-pressed="true"] {
  z-index: 3;
  height: 42px;
  margin-bottom: -3px;
  background: #c6c6c6;
  border-bottom-color: #c6c6c6;
  box-shadow: none;
}
.category-icon { width: 32px; height: 32px; background: transparent; border: 0; border-radius: 0; }
.category-favorite-icon { color: #ffe25d; font-size: 25px; line-height: 1; text-shadow: 1px 1px #5a4700; }
.creative-inventory-window {
  position: relative;
  z-index: 1;
  padding: 12px 11px 11px;
  color: #3f3f3f;
  background: #c6c6c6;
  border: 2px solid;
  border-color: #ffffff #373737 #373737 #ffffff;
  box-shadow: inset 0 0 0 1px #8b8b8b, 0 3px 12px rgba(0, 0, 0, 0.38);
}
.block-search-row { position: relative; margin-bottom: 9px; }
.block-search-row input {
  width: 100%;
  height: 31px;
  padding: 4px 64px 4px 9px;
  color: #ffffff;
  background: #1f1f1f;
  border: 2px solid;
  border-color: #373737 #ffffff #ffffff #373737;
  border-radius: 0;
  outline: 0;
  font: 11px/1 Consolas, "Microsoft YaHei UI", sans-serif;
}
.block-search-row input:focus { box-shadow: inset 0 0 0 1px #dddddd; }
.block-search-row input::placeholder { color: #a9a9a9; }
.block-search-row span { position: absolute; top: 50%; right: 9px; color: #bdbdbd; font-size: 9px; transform: translateY(-50%); pointer-events: none; }
.creative-grid-frame { position: relative; }
.block-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  grid-auto-rows: 40px;
  width: 100%;
  max-height: 202px;
  overflow-y: auto;
  background: #8b8b8b;
  border: 1px solid #777777;
  scrollbar-color: #8b8b8b #c6c6c6;
  scrollbar-width: thin;
}
.block-grid::-webkit-scrollbar { width: 12px; }
.block-grid::-webkit-scrollbar-track { background: #c6c6c6; border-left: 2px solid #ffffff; }
.block-grid::-webkit-scrollbar-thumb { background: #8b8b8b; border: 2px solid; border-color: #ffffff #373737 #373737 #ffffff; }
.block-card,
.mini-block {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  color: #ffffff;
  background: #8b8b8b;
  border: 2px solid;
  border-color: #373737 #ffffff #ffffff #373737;
  border-radius: 0;
  box-shadow: none;
}
button.block-card:hover,
button.mini-block:hover { background: #b8b8b8; outline: 2px solid rgba(255, 255, 255, 0.82); outline-offset: -3px; }
.block-card[aria-pressed="true"] { background: #b9d68d; outline: 2px solid #ffffa0; outline-offset: -3px; }
.block-card-empty,
.mini-block-empty { pointer-events: none; }
.block-card .block-preview { width: 100%; height: 100%; background: transparent; border: 0; border-radius: 0; }
.block-card-name {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.favorite-mark { position: absolute; top: 1px; right: 2px; color: #fff36b; font-size: 10px; text-shadow: 1px 1px #3b3000; }
.block-browser-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: #f0f0f0;
  background: rgba(40, 40, 40, 0.82);
  font-size: 11px;
  text-shadow: 1px 1px #000;
}
.block-browser-empty[hidden] { display: none; }
.creative-inventory-label { display: flex; align-items: center; justify-content: space-between; margin: 7px 1px 5px; }
.creative-inventory-label strong { color: #3f3f3f; font-size: 12px; font-weight: 400; }
.creative-inventory-label span { color: #666666; font-size: 9px; }
.mini-block-grid { display: flex; flex-wrap: wrap; gap: 4px; min-height: 32px; margin-top: 8px; }
.creative-hotbar { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 0; min-height: 40px; margin: 0; background: #8b8b8b; border: 1px solid #777777; }
.creative-hotbar .mini-block { width: auto; height: 40px; }
.mini-block { width: 40px; height: 40px; }
.mini-block .block-preview { width: 100%; height: 100%; background: transparent; border: 0; border-radius: 0; }
.material-subwindow { margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--line-soft); }
.palette-window > summary { color: #cbd4cf; cursor: pointer; font-size: 11px; }
.palette-window > summary span { float: right; color: var(--muted); font-size: 9px; }
.mini-remove { position: absolute; top: -5px; right: -4px; display: none; width: 13px; height: 13px; color: #fff; background: var(--danger); border-radius: 50%; font: 9px/13px sans-serif; text-align: center; }
.palette-grid .mini-block:hover .mini-remove { display: block; }
.palette-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 5px; margin-top: 8px; }
.palette-toolbar button,
.palette-add-button {
  padding: 6px 7px;
  color: #c5cec9;
  background: #1a211d;
  border: 1px solid #343e38;
  border-radius: 4px;
  font-size: 8px;
}
.palette-add-button { width: 100%; margin-top: 7px; }
.palette-add-button:disabled { opacity: 0.32; cursor: not-allowed; }
.custom-state-window { padding: 9px; }
.minecraft-tooltip {
  position: fixed;
  z-index: 1000;
  min-width: 170px;
  max-width: 310px;
  padding: 8px 10px;
  color: #ffffff;
  background: rgba(16, 0, 16, 0.96);
  border: 2px solid #2d0a63;
  box-shadow: inset 0 0 0 1px #100020, 2px 2px 0 rgba(0, 0, 0, 0.65);
  pointer-events: none;
}
.minecraft-tooltip strong,
.minecraft-tooltip code { display: block; }
.minecraft-tooltip strong { font: 12px/1.35 Consolas, "Microsoft YaHei UI", sans-serif; }
.minecraft-tooltip code { margin-top: 4px; color: #a8a8a8; font: 9px/1.35 Consolas, monospace; overflow-wrap: anywhere; }
.minecraft-tooltip[hidden] { display: none; }
.future-window {
  display: grid;
  place-content: center;
  min-height: 160px;
  margin-top: 14px;
  padding: 18px;
  color: #55605a;
  border: 1px dashed #29312d;
  border-radius: 6px;
  text-align: center;
}
.future-window strong { font-size: 10px; }
.future-window span { max-width: 220px; margin-top: 6px; font-size: 8px; line-height: 1.5; }

.input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.primary-button,
.ai-generate-button,
.export-button {
  color: #0a100b;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 5px;
  font-weight: 750;
}
.primary-button { padding: 7px 11px; }
.primary-button:disabled,
.ai-generate-button:disabled,
.export-button:disabled { opacity: 0.36; cursor: not-allowed; }
.file-picker {
  display: grid;
  place-items: center;
  min-height: 54px;
  margin-top: 8px;
  padding: 10px;
  color: #d9e2dd;
  background: rgba(158, 230, 109, 0.03);
  border: 1px dashed #435048;
  border-radius: 5px;
  cursor: pointer;
  font-size: 10px;
}
.file-picker small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.file-picker:hover { border-color: var(--accent); }
.project-summary { margin-top: 12px; }
.project-summary #texture-source { color: #9fb7aa; }
.review-source-card { margin-bottom: 12px; padding: 10px; color: #dff4d2; background: rgba(158, 230, 109, .06); border: 1px solid rgba(158, 230, 109, .26); border-radius: 6px; }
.review-source-card strong { font-size: 10px; }
.review-source-card p { margin: 5px 0 8px; color: #a9b8af; font-size: 8px; line-height: 1.55; }
.review-source-card a { color: var(--accent); font-size: 8px; text-decoration: underline; }
.review-source-card[data-state="error"] { color: #ffd5d1; background: rgba(239, 119, 110, .06); border-color: rgba(239, 119, 110, .3); }

.history-row { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 5px; margin-top: 12px; }
#edit-count { justify-self: end; color: var(--muted); font-size: 8px; }
#edit-count[data-dirty="true"] { color: var(--warning); }
.export-button { width: 100%; margin-top: 7px; padding: 8px; font-size: 9px; }
.diagnostic-window { padding: 9px; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 10px; }
.metric-grid article { padding: 7px; background: #0d110f; border-radius: 4px; }
.metric-grid span,
.metric-grid strong { display: block; }
.metric-grid span { color: var(--muted); font-size: 8px; }
.metric-grid strong { margin-top: 4px; font-size: 10px; font-variant-numeric: tabular-nums; }

.admission-card { display: flex; gap: 8px; margin-top: 12px; padding: 10px; background: var(--panel-raised); border: 1px solid var(--line); border-radius: 6px; }
.admission-dot { flex: 0 0 auto; width: 6px; height: 6px; margin-top: 4px; background: #69756f; border-radius: 50%; }
.admission-card strong { font-size: 9px; }
.admission-card p { margin: 3px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.admission-card[data-state="success"] { border-color: rgba(158, 230, 109, 0.3); }
.admission-card[data-state="success"] .admission-dot { background: var(--accent); }
.admission-card[data-state="error"] { border-color: rgba(239, 119, 110, 0.35); }
.admission-card[data-state="error"] .admission-dot { background: var(--danger); }

#ai-service-badge[data-provider="openai"] { color: var(--accent); }
#ai-service-badge[data-provider="local"] { color: var(--warning); }
.ai-generate-button { width: 100%; margin-top: 9px; padding: 9px; font-size: 10px; }
.ai-generation-note { margin: 7px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.ai-plan-summary { margin-top: 12px; padding: 10px; background: var(--panel-raised); border: 1px solid var(--line); border-radius: 6px; }
.ai-plan-summary strong { display: block; font-size: 10px; }
.ai-plan-summary p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.ai-plan-summary[data-state="success"] { border-color: rgba(158, 230, 109, 0.34); }
.ai-plan-summary[data-state="success"] strong { color: var(--accent); }
.ai-plan-summary[data-state="error"] { border-color: rgba(239, 119, 110, 0.4); }
.ai-plan-summary[data-state="error"] strong { color: var(--danger); }
.ai-plan-legend { display: flex; gap: 10px; margin: 8px 0 0; color: var(--muted); font-size: 8px; }
.ai-plan-legend span::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 1px; }
.ai-plan-legend span[data-kind="add"]::before { background: #62d98b; }
.ai-plan-legend span[data-kind="remove"]::before { background: #ef776e; }
.ai-plan-legend span[data-kind="replace"]::before { background: #f2bd5e; }
.ai-advanced { padding: 9px; }
.ai-plan-target-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; margin: 10px 0; font-size: 8px; }
.ai-plan-target-row dt { color: var(--muted); }
.ai-plan-target-row dd { margin: 0; overflow: hidden; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.ai-plan-actions { display: grid; grid-template-columns: 1fr 0.8fr 0.9fr; gap: 5px; margin-top: 7px; }
#ai-plan-preview { color: #cceeb7; }
#ai-plan-apply { color: #0a100b; background: var(--accent); border-color: var(--accent); }

.status-bar {
  position: relative;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  min-width: 0;
  padding: 0 10px;
  background: #101412;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.status-progress { display: flex; align-items: center; gap: 8px; min-width: 0; }
.progress-track { flex: 0 0 72px; height: 3px; overflow: hidden; background: #29322e; border-radius: 999px; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--accent); transition: width 160ms ease; }
.status-progress p,
.shortcut-strip { margin: 0; overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.shortcut-strip { color: #69746e; }
.live-metrics { display: flex; gap: 10px; margin: 0; }
.live-metrics div { display: flex; align-items: baseline; gap: 3px; }
.live-metrics dt { color: #65706a; font-size: 7px; }
.live-metrics dd { margin: 0; color: #b9c2bd; font-size: 8px; font-variant-numeric: tabular-nums; }

@media (max-width: 1000px) {
  .editor-workspace { grid-template-columns: 100px minmax(0, 1fr) 360px; }
  .tools-window > header span { display: none; }
  .shortcut-strip { display: none; }
  .status-bar { grid-template-columns: minmax(0, 1fr) auto; }
}

@media (max-width: 760px) {
  html,
  body { overflow: auto; }
  .app-shell { grid-template-rows: 36px auto 28px; height: auto; min-height: 100%; }
  .main-menu-bar nav button:nth-child(n+4) { display: none; }
  .editor-workspace,
  .editor-workspace.panel-collapsed { grid-template-columns: 1fr; grid-template-rows: auto 58vh auto; }
  .tools-window { display: block; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
  .tools-window > header,
  .tools-window h2,
  .tools-spacer { display: none; }
  .tools-window section { display: inline-block; padding: 5px 2px; }
  .modeling-toolbar { display: inline-grid; grid-template-columns: repeat(2, 50px); }
  .modeling-toolbar button { grid-template-columns: 20px 1fr; align-items: center; gap: 3px; padding: 4px; }
  .modeling-toolbar kbd { width: 20px; height: 20px; }
  .control-panel { min-height: 520px; border-top: 1px solid var(--line); border-left: 0; }
  .dock-content { overflow: visible; }
  .viewer-toolbar { max-width: calc(100% - 16px); }
  .viewer-toolbar button { padding: 6px; }
}
