:root {
  --bg-dark: #151a27;
  --bg-panel: #202638;
  --bg-modal: #202638;
  --border-color: #0b0f19;
  --border-light: #3d4667;
  --text-primary: #f6f3df;
  --text-secondary: #b8c1d8;
  --text-muted: #8792ad;
  --accent-color: #4da331;
  --accent-hover: #75d957;
  --input-bg: #111724;
  --panel-deep: #171c2a;
  --shadow: rgba(0, 0, 0, 0.45);
  
  --mc-green: #4da628;
  --mc-green-hover: #5ac032;
  --mc-green-border-bottom: #1e590c;
  --mc-green-border-top: #6ade3b;
  
  --mc-red: #c5281c;
  --mc-red-hover: #e03224;
  --mc-red-border-bottom: #590a05;
  --mc-red-border-top: #ee4a3c;
  
  --mc-grey: #384460;
  --mc-grey-border-bottom: #1d1e24;
  --mc-grey-border-top: #536285;
}

/* Title font loads via FontFace + embedded bytes in builder.js (no CSS url() — breaks on file://). */

.preview-chest-title {
  position: absolute;
  color: #a8a8a8;
  font-family: ChestGuiMinecraft, monospace;
  font-size: 8px;
  line-height: 1;
  text-align: center;
  text-shadow: none;
  white-space: nowrap;
  pointer-events: none;
  z-index: 30;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  font-smooth: never;
  text-rendering: optimizeSpeed;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ========================================
   Obsidian Gold UI Skin
   Visual-only redesign matching JsonUI Maker.
   Keep DOM, preview logic, and export behavior untouched.
   ======================================== */
:root {
  --bg-dark: #0b0b0c;
  --bg-panel: #151515;
  --bg-modal: #151515;
  --border-color: rgba(217, 166, 67, 0.22);
  --border-light: rgba(217, 166, 67, 0.38);
  --text-primary: #f5f0e7;
  --text-secondary: #c8c0b4;
  --text-muted: #81786d;
  --accent-color: #d9a643;
  --accent-hover: #f2cf7a;
  --input-bg: #070707;
  --panel-deep: #101010;
  --shadow: rgba(0, 0, 0, 0.56);

  --mc-green: #d9a643;
  --mc-green-hover: #f2cf7a;
  --mc-green-border-bottom: #6f501d;
  --mc-green-border-top: #f2cf7a;

  --mc-red: #b84f45;
  --mc-red-hover: #d66b5f;
  --mc-red-border-bottom: #5d1e1a;
  --mc-red-border-top: #ef8b80;

  --mc-grey: #242424;
  --mc-grey-border-bottom: #0b0b0c;
  --mc-grey-border-top: #49443b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(75, 163, 49, 0.18), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(63, 195, 215, 0.16), transparent 30%),
    linear-gradient(180deg, #1e2638 0%, var(--bg-dark) 48%, #10141e 100%);
  color: var(--text-primary);
  overflow: hidden;
  font-size: 14px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 64px 64px;
}

.hidden {
  display: none !important;
}

.world-grid {
  position: fixed;
  inset: auto 0 0;
  height: 150px;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.16) 0 50%, transparent 50% 100%),
    linear-gradient(#26344f 0 50%, #1b2335 50% 100%);
  background-size: 80px 80px;
  opacity: 0.35;
}

.floating-block {
  position: fixed;
  width: 28px;
  height: 28px;
  pointer-events: none;
  image-rendering: pixelated;
  background: #4da331;
  box-shadow:
    inset -6px -6px 0 rgba(0,0,0,0.2),
    inset 6px 6px 0 rgba(255,255,255,0.1);
  animation: floatBlock 7s ease-in-out infinite;
}

.block-a {
  left: 4%;
  top: 12%;
}

.block-b {
  right: 9%;
  top: 24%;
  background: #875e33;
  animation-delay: -3s;
}

.builder-topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 78px;
  padding: 14px clamp(16px, 3vw, 36px);
  border-bottom: 4px solid rgba(11, 15, 25, 0.82);
  background: rgba(20, 25, 37, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  background:
    linear-gradient(90deg, transparent 0 25%, #79c64c 25% 75%, transparent 75%),
    linear-gradient(#56a936 0 70%, #2d721f 70%);
  box-shadow:
    0 0 0 4px #24394f,
    6px 6px 0 rgba(0,0,0,0.35);
  image-rendering: pixelated;
}

.brand strong {
  display: block;
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 12px;
}

.mc-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  background: linear-gradient(180deg, #384460, #222a3e);
  box-shadow:
    inset 0 5px 0 rgba(255,255,255,0.18),
    inset 0 -6px 0 rgba(0,0,0,0.28),
    5px 5px 0 var(--shadow);
}

/* App Layout */
.app-container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 360px minmax(560px, 1fr);
  gap: 22px;
  width: min(1320px, calc(100% - 32px));
  height: calc(100vh - 110px);
  margin: 16px auto;
}

.sidebar {
  min-width: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), transparent 120px),
    var(--bg-panel);
  border: 4px solid var(--border-light);
  display: flex;
  flex-direction: column;
  box-shadow:
    inset 0 0 0 3px rgba(255,255,255,0.035),
    10px 10px 0 var(--shadow);
  overflow: hidden;
}

.sidebar-header {
  padding: 20px;
  background: #171e2d;
  border-bottom: 4px solid var(--border-light);
}

.sidebar-header h2 {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.6);
}

.sidebar-header p {
  margin-top: 8px;
  color: var(--text-secondary);
  line-height: 1.5;
  text-transform: none;
}

.sidebar-content {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-footer {
  padding: 20px;
  border-top: 4px solid var(--border-light);
  background-color: #171e2d;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-footer label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 4px;
  text-shadow: 1px 1px 0 #000;
}

.main-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), transparent 120px),
    var(--bg-panel);
  border: 4px solid var(--border-light);
  box-shadow:
    inset 0 0 0 3px rgba(255,255,255,0.035),
    10px 10px 0 var(--shadow);
  overflow: hidden;
}

.content-header {
  min-height: 82px;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #171e2d;
  border-bottom: 4px solid var(--border-light);
}

.content-header h2 {
  margin: 4px 0 0;
  font-size: 1.5rem;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.6);
}

.eyebrow {
  margin: 0;
  color: #92dd71;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.preview-size-chip {
  padding: 8px 10px;
  border: 2px solid #496080;
  color: #ffd966;
  background: #111724;
  font-weight: 900;
  text-transform: uppercase;
}

/* UI Elements - Buttons */
.mc-btn {
  width: 100%;
  padding: 12px;
  border: 0;
  background: linear-gradient(180deg, #5fbd3d, var(--mc-green));
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: filter 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-shadow:
    2px 2px 0 rgba(17, 21, 32, 0.95),
    0 1px 0 rgba(255,255,255,0.12);
  image-rendering: pixelated;
  box-shadow:
    inset 0 5px 0 rgba(255,255,255,0.2),
    inset 0 -6px 0 rgba(0,0,0,0.28),
    5px 5px 0 var(--shadow);
}

.mc-btn:hover {
  filter: brightness(1.2);
}

.mc-btn:active {
  filter: brightness(0.9);
  transform: translateY(2px);
}

.mc-btn-red {
  filter: hue-rotate(150deg) saturate(2) brightness(0.9);
}
.mc-btn-red:hover { filter: hue-rotate(150deg) saturate(2) brightness(1.1); }
.mc-btn-red:active { filter: hue-rotate(150deg) saturate(2) brightness(0.8); transform: translateY(2px); }

.mc-btn-grey {
  filter: grayscale(1) brightness(0.8);
}
.mc-btn-grey:hover { filter: grayscale(1) brightness(1); }
.mc-btn-grey:active { filter: grayscale(1) brightness(0.7); transform: translateY(2px); }

.btn-upload {
  width: 100%;
  min-height: 84px;
  padding: 14px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.035) 0 50%, transparent 50% 100%),
    linear-gradient(#20283c 0 50%, #1a2132 50% 100%);
  background-size: 32px 32px;
  border: 3px dashed #6b789d;
  color: var(--text-secondary);
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 #000;
}
.btn-upload:hover {
  background-color: rgba(255,255,255,0.05);
  border-color: #fff;
  color: #fff;
}

.btn-upload-secondary {
  width: 100%;
  min-height: auto;
  margin-top: 8px;
  padding: 10px 12px;
  text-transform: none;
  font-size: 0.9rem;
}

.btn-action {
  width: 100%;
  padding: 12px;
  border: 0;
  background: linear-gradient(180deg, #384460, #222a3e);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  text-shadow: 2px 2px 0 rgba(17, 21, 32, 0.95);
  image-rendering: pixelated;
  box-shadow:
    inset 0 5px 0 rgba(255,255,255,0.16),
    inset 0 -6px 0 rgba(0,0,0,0.28),
    5px 5px 0 var(--shadow);
}
.btn-action:hover { filter: grayscale(1) brightness(1); }
.btn-action:active { transform: translateY(2px); filter: grayscale(1) brightness(0.7); }

.section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.row {
  display: flex;
  gap: 12px;
}

.col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.offset-stepper {
  display: flex;
  align-items: stretch;
  gap: 4px;
}

.offset-stepper input[type="text"] {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.offset-step-btn {
  flex: 0 0 34px;
  padding: 0;
  border: 2px solid #0b0f19;
  border-top-color: var(--mc-grey-border-top);
  border-bottom-color: var(--mc-grey-border-bottom);
  background: var(--mc-grey);
  color: #fff;
  font-size: 1.1rem;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
}

.offset-step-btn:hover {
  background: #4a5678;
}

.offset-step-btn:active {
  transform: translateY(1px);
}

.preview-drag-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: bold;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 #000;
}

input[type="text"], input[type="number"], select {
  width: 100%;
  padding: 10px;
  background-color: var(--input-bg);
  border: 2px solid #0b0f19;
  border-top: 2px solid #070a10;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  font-weight: bold;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

input[readonly] {
  background-color: rgba(0, 0, 0, 0.5);
  color: var(--text-muted);
}

input:focus, select:focus {
  border-color: var(--mc-green);
}

.nav-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--input-bg);
  border: 2px solid #000;
  padding: 4px;
}

.nav-btn {
  border: 0;
  background: linear-gradient(180deg, #384460, #222a3e);
  color: #fff;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-weight: bold;
  image-rendering: pixelated;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 2px 2px 0 #000;
  box-shadow:
    inset 0 4px 0 rgba(255,255,255,0.14),
    inset 0 -5px 0 rgba(0,0,0,0.25);
  transition: filter 0.1s, transform 0.1s;
}

.nav-btn:hover { filter: grayscale(1) brightness(1); }

.nav-delete-btn {
  margin-left: 8px;
  padding: 4px 10px;
  font-size: 0.75rem;
  height: 32px;
  flex-shrink: 0;
}

.nav-btn:active {
  transform: translateY(2px);
  filter: brightness(0.85);
}

#navIndicator {
  font-weight: bold;
  font-size: 0.9rem;
  text-shadow: 1px 1px 0 #000;
}

/* Sliders */
.sliders {
  margin-top: 8px;
}
.slider-box {
  background-color: var(--input-bg);
  border: 2px solid #000;
  padding: 10px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-weight: bold;
  text-shadow: 1px 1px 0 #000;
}
.slider-val {
  color: #92dd71;
}

input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 16px;
  width: 10px;
  background: #fff;
  border: 2px solid #000;
  cursor: pointer;
  margin-top: -6px;
}
input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  background: #000;
}

/* Preview Area */
.preview-area {
  flex: 1;
  overflow: auto;
  position: relative;
  min-height: 320px;
  padding: 16px;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.14) 0 50%, transparent 50% 100%),
    linear-gradient(#20283c 0 50%, #1a2132 50% 100%);
  background-size: 64px 64px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Internal 256×256 canvas; display size = 256 × zoom (integer px/texel) — sized by JS */
.preview-container {
  position: relative;
  flex-shrink: 0;
  margin: auto;
  width: 256px;
  height: 256px;
  overflow: visible;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.04) 0 50%, transparent 50% 100%),
    linear-gradient(#22293a 0 50%, #1a2030 50% 100%);
  background-size: 64px 64px;
  box-shadow:
    0 0 0 4px #0b0f19,
    0 0 0 8px #3d4667,
    0 8px 0 rgba(0,0,0,0.42);
}

.preview-canvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: block;
  width: 256px;
  height: 256px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
}

.preview-texture-canvas {
  z-index: 2;
}

.preview-reference-canvas {
  z-index: 15;
  opacity: 0.88;
  pointer-events: none;
}

.preview-reference-canvas.hidden {
  opacity: 0;
  visibility: hidden;
}

.preview-texture-canvas.preview-texture-draggable {
  pointer-events: auto;
  cursor: grab;
}

.preview-texture-canvas.preview-texture-dragging {
  cursor: grabbing;
}

body.preview-offset-drag-active {
  cursor: grabbing;
  user-select: none;
}

.preview-slot-canvas {
  z-index: 25;
}

.preview-title-canvas {
  z-index: 30;
}

.layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 256px;
  height: 256px;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
}

.layer.anchor-guides {
  z-index: 22;
  pointer-events: none;
  overflow: visible;
}

.anchor-guide-line {
  position: absolute;
  pointer-events: none;
}

.anchor-guide-line--h {
  left: 0;
  width: 100%;
  height: 0;
  border-top: 2px dashed;
}

.anchor-guide-line--v {
  top: 0;
  height: 100%;
  width: 0;
  border-left: 2px dashed;
}

.anchor-guide-line--target-chest { border-color: #5cff6a; }
.anchor-guide-line--target-inv { border-color: #4ec8ff; }
.anchor-guide-line--placed-chest { border-color: #ff8c3a; }
.anchor-guide-line--placed-inv { border-color: #e86cff; }

.anchor-guide-label {
  position: absolute;
  font-size: 10px;
  font-weight: bold;
  padding: 1px 4px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  white-space: nowrap;
  text-shadow: 1px 1px 0 #000;
  line-height: 1.2;
}

.anchor-guide-legend {
  position: absolute;
  right: 4px;
  bottom: 4px;
  font-size: 9px;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.8);
  color: #ccc;
  line-height: 1.35;
  max-width: 200px;
}

.preview-controls {
  height: 60px;
  background-color: #171e2d;
  border-top: 4px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.preview-controls.preview-meta {
  height: 44px;
}

.preview-scale-info {
  font-size: 0.85rem;
  color: #92dd71;
  font-weight: bold;
  text-shadow: 1px 1px 0 #000;
}

.zoom-btn {
  border: 0;
  background: linear-gradient(180deg, #384460, #222a3e);
  color: #fff;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.2rem;
  image-rendering: pixelated;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 2px 2px 0 #000;
  box-shadow:
    inset 0 4px 0 rgba(255,255,255,0.14),
    inset 0 -5px 0 rgba(0,0,0,0.25),
    4px 4px 0 rgba(0,0,0,0.35);
  transition: filter 0.1s, transform 0.1s;
}
.zoom-btn:hover { filter: grayscale(1) brightness(1); }
.zoom-btn:active { transform: translateY(2px); filter: grayscale(1) brightness(0.7); }

/* Modal */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.modal-content {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), transparent 120px),
    var(--bg-panel);
  width: 900px;
  max-width: 95vw;
  height: 80vh;
  border: 4px solid var(--border-light);
  display: flex;
  flex-direction: column;
  image-rendering: pixelated;
  box-shadow:
    inset 0 0 0 3px rgba(255,255,255,0.035),
    12px 12px 0 rgba(0,0,0,0.55);
}

.modal-header {
  padding: 20px;
  border-bottom: 2px solid #111;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 { font-size: 1.2rem; display: flex; align-items: center; gap: 8px; text-shadow: 2px 2px 0 #000;}
.close-btn { background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; text-shadow: 2px 2px 0 #000;}
.close-btn:hover { color: var(--mc-red-hover); }

.modal-tabs {
  display: flex;
  background-color: #171e2d;
  border-bottom: 2px solid #111;
  padding: 0 20px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-weight: bold;
  font-size: 1rem;
  padding: 15px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  text-shadow: 1px 1px 0 #000;
}

.tab-btn:hover {
  color: var(--text-primary);
  background-color: rgba(255,255,255,0.05);
}

.tab-btn.active {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-color);
  background-color: rgba(60, 164, 60, 0.1);
}

.modal-toolbar {
  padding: 15px 20px;
  display: flex;
  gap: 20px;
  align-items: center;
  background-color: #171e2d;
  border-bottom: 2px solid var(--border-color);
}
.modal-toolbar input[type="text"] { flex: 1; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: bold;
  text-shadow: 1px 1px 0 #000;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 15px;
}

.grid-item.analyzing {
  opacity: 0.72;
  pointer-events: none;
}

.grid-item.analyzing .img-wrapper::after {
  content: '…';
  position: absolute;
  font-size: 1.4rem;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
}

.zip-analyze-status {
  flex: 1;
  text-align: right;
  font-size: 0.85rem;
  color: #9aa5b8;
  text-shadow: 1px 1px 0 #000;
  padding: 0 8px;
}

.zip-analyze-status.is-busy {
  color: #f0ad4e;
}

.btn-primary:disabled,
.btn-primary[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.35);
}

.grid-item {
  background-color: var(--mc-grey);
  border: 2px solid #000;
  border-bottom: 4px solid var(--mc-grey-border-bottom);
  border-top: 4px solid var(--mc-grey-border-top);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.1s;
  position: relative;
}

.grid-item:hover {
  background-color: #4a4d5a;
}

.grid-item.selected {
  border-color: var(--mc-green);
  background-color: rgba(77, 166, 40, 0.2);
}

.grid-item input[type="checkbox"] {
  position: absolute;
  top: 10px;
  align-self: center;
  transform: scale(1.5);
  pointer-events: none;
}

.grid-item .img-wrapper {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 15px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.grid-item .info {
  text-align: center;
}
.grid-item .hex { color: #5bc0be; font-family: monospace; font-size: 0.9rem; margin-bottom: 4px; text-shadow: 1px 1px 0 #000;}
.grid-item .symbol { color: #fff; font-size: 1.1rem; text-shadow: 1px 1px 0 #000;}

.modal-footer {
  padding: 20px;
  border-top: 4px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #171e2d;
}

.footer-buttons {
  display: flex;
  gap: 10px;
}

.btn-cancel {
  border: 0;
  background: linear-gradient(180deg, #d1523f, #a33125);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  padding: 10px 20px;
  text-shadow: 2px 2px 0 rgba(17, 21, 32, 0.95);
  image-rendering: pixelated;
  box-shadow:
    inset 0 5px 0 rgba(255,255,255,0.16),
    inset 0 -6px 0 rgba(0,0,0,0.28),
    5px 5px 0 var(--shadow);
  transition: filter 0.1s;
}
.btn-cancel:hover { filter: hue-rotate(150deg) saturate(2) brightness(1.1); }
.btn-cancel:active { transform: translateY(2px); filter: hue-rotate(150deg) saturate(2) brightness(0.8); }

.btn-primary, .btn-secondary {
  padding: 10px 20px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 2px 2px 0 #3b3b3b;
  image-rendering: pixelated;
  border: 0;
  background: linear-gradient(180deg, #5fbd3d, var(--mc-green));
  box-shadow:
    inset 0 5px 0 rgba(255,255,255,0.16),
    inset 0 -6px 0 rgba(0,0,0,0.28),
    5px 5px 0 var(--shadow);
  transition: filter 0.1s;
}

.btn-primary { 
  color: white; 
}
.btn-primary:hover { filter: brightness(1.2); }
.btn-primary:active { transform: translateY(2px); filter: brightness(0.9); }

.btn-secondary { 
  color: #fff; 
  background: linear-gradient(180deg, #384460, #222a3e);
}
.btn-secondary:hover { filter: brightness(1.12); }
.btn-secondary:active { transform: translateY(2px); filter: brightness(0.9); }

/* MC Notification System */
.mc-notification {
  position: fixed;
  top: -150px; /* Hidden state */
  right: 20px;
  width: 420px;
  background-color: var(--bg-panel);
  border: 4px solid var(--border-light);
  image-rendering: pixelated;
  display: flex;
  padding: 10px;
  gap: 15px;
  z-index: 9999;
  transition: top 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  filter: drop-shadow(0 10px 30px rgba(0,0,0,0.8));
}

.mc-notification.show {
  top: 20px;
}

.mc-notif-avatar {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  background:
    linear-gradient(90deg, transparent 0 25%, #79c64c 25% 75%, transparent 75%),
    linear-gradient(#56a936 0 70%, #2d721f 70%);
  border: 2px solid #2a2b33;
  box-shadow: inset -8px -8px 0 rgba(0,0,0,0.22);
}

.mc-notif-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  image-rendering: pixelated;
}

.mc-notif-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mc-notif-content h3 {
  color: #ffaa00; /* Gold */
  font-size: 1.1rem;
  margin-bottom: 5px;
  text-shadow: 2px 2px 0 #000;
}

.mc-notif-content p {
  color: #ffffff;
  font-size: 0.9rem;
  line-height: 1.4;
  text-shadow: 1px 1px 0 #000;
}

@keyframes floatBlock {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-18px);
  }
}

@media (max-width: 1100px) {
  body {
    overflow: auto;
  }

  .app-container {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh - 110px);
  }

  .sidebar {
    order: 2;
  }

  .main-content {
    order: 1;
    min-height: 680px;
  }

  .preview-area {
    min-height: 590px;
  }
}

@media (max-width: 720px) {
  .builder-topbar {
    align-items: stretch;
    height: auto;
    flex-direction: column;
  }

  .app-container {
    width: min(100% - 20px, 1320px);
  }

  .modal-toolbar,
  .modal-footer,
  .footer-buttons {
    align-items: stretch;
    flex-direction: column;
  }
}

.field-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

.field-hint code {
  font-size: 10px;
  color: var(--text-secondary);
}

.glyph-font-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.glyph-group-label {
  font-size: 11px;
  color: var(--text-muted);
}

.glyph-font-toolbar select {
  min-width: 140px;
  padding: 6px 8px;
  font-size: 12px;
}

.glyph-sheet-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.glyph-sheet-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 3px;
}

.glyph-sheet-item.muted {
  color: var(--text-muted);
}

.glyph-sheet-thumb {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  object-fit: contain;
  flex-shrink: 0;
}

.glyph-sheet-remove {
  margin-left: auto;
  padding: 2px 8px;
  font-size: 10px;
}

.profile-options-section {
  border: 2px solid var(--border-light);
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.profile-subsection {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.profile-subsection:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.subsection-title {
  display: block;
  font-size: 11px;
  font-weight: bold;
  color: var(--accent-hover);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.btn-small {
  padding: 6px 10px;
  font-size: 12px;
}

.profile-heads-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.profile-head-card {
  background: var(--input-bg);
  border: 1px solid var(--border-light);
  padding: 8px;
  border-radius: 3px;
}

.profile-head-card h4 {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.profile-head-card .row {
  margin-bottom: 4px;
}

.profile-head-card .remove-head-btn {
  margin-top: 6px;
  width: 100%;
}

.layer.profile-overlay {
  pointer-events: none;
  z-index: 15;
}

.profile-viewport-marker {
  position: absolute;
  border: 2px dashed #75d957;
  background: rgba(77, 166, 49, 0.15);
  box-sizing: border-box;
  pointer-events: auto;
  cursor: move;
}

.profile-gamertag-marker {
  position: absolute;
  font-size: 11px;
  color: #3f3f3f;
  background: rgba(255, 255, 255, 0.5);
  padding: 2px 4px;
  pointer-events: none;
  white-space: nowrap;
}

.profile-doll-head,
.profile-doll-static {
  position: absolute;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center;
}

.profile-doll-body {
  position: absolute;
  pointer-events: none;
  background: rgba(139, 139, 139, 0.18);
  border: 1px dashed rgba(220, 220, 230, 0.55);
  box-sizing: border-box;
}

/* Skin-painted paper-doll simulation (clipped by the viewport marker) */
.profile-steve-canvas {
  position: absolute;
  pointer-events: none;
  image-rendering: pixelated;
  z-index: 3;
}

.profile-doll-uuid {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #9a9a9a;
  border: 2px dashed #555;
  color: #222;
  font-size: 8px;
  text-align: center;
  pointer-events: none;
}

.profile-doll-caption {
  position: absolute;
  left: 0;
  bottom: -14px;
  font-size: 9px;
  color: #a8e88a;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 1px 0 #000;
}

/* Final obsidian/gold overrides. Keep at end. */
body {
  background:
    linear-gradient(45deg, rgba(255,255,255,0.018) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.018) 75%),
    radial-gradient(circle at 12% 8%, rgba(217,166,67,0.16), transparent 25%),
    radial-gradient(circle at 86% 14%, rgba(255,255,255,0.05), transparent 28%),
    #0b0b0c !important;
  background-size: 34px 34px, auto, auto, auto;
  color: var(--text-primary);
}

body::before {
  background-image:
    linear-gradient(rgba(217,166,67,0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(217,166,67,0.026) 1px, transparent 1px);
  background-size: 48px 48px;
}

.world-grid,
.floating-block {
  display: none;
}

.builder-topbar {
  border-bottom: 1px solid rgba(217,166,67,0.36);
  background:
    linear-gradient(90deg, rgba(217,166,67,0.12), transparent 22%, transparent 78%, rgba(217,166,67,0.08)),
    linear-gradient(180deg, rgba(22,22,24,0.98), rgba(10,10,11,0.92));
  box-shadow: 0 12px 36px rgba(0,0,0,0.38);
}

.brand-mark {
  border-radius: 8px;
  background: linear-gradient(180deg, #f2cf7a, #d9a643 58%, #8f6a2c) !important;
  box-shadow: 0 0 0 2px rgba(217,166,67,0.25), 0 0 22px rgba(217,166,67,0.26) !important;
}

.brand strong,
.sidebar-header h2,
.preview-header h2,
.modal-header h2 {
  color: #f5f0e7;
  text-shadow: 0 0 12px rgba(217,166,67,0.18);
}

.brand small,
.sidebar-header p,
.field-hint,
.empty-state,
.muted,
.zip-analyze-status {
  color: var(--text-muted) !important;
}

.app-container {
  gap: 16px;
}

.sidebar,
.preview-panel,
.modal-content,
.config-card,
.manager-card,
.profile-head-card,
.section,
.profile-subsection,
.head-preview-panel,
.additional-textures-list,
.detected-layout,
.glyph-sheet-list,
.textures-grid,
.sessions-grid,
.imports-grid {
  position: relative;
  border: 1px solid rgba(217,166,67,0.22) !important;
  border-radius: 14px !important;
  background:
    linear-gradient(135deg, rgba(217,166,67,0.045), transparent 50%, rgba(255,255,255,0.025)),
    rgba(14,14,15,0.88) !important;
  box-shadow: 0 18px 46px rgba(0,0,0,0.42) !important;
}

.sidebar::before,
.preview-panel::before,
.modal-content::before,
.section::before,
.config-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  background:
    linear-gradient(#d9a643,#d9a643) left top / 22px 2px no-repeat,
    linear-gradient(#d9a643,#d9a643) left top / 2px 22px no-repeat,
    linear-gradient(#d9a643,#d9a643) right top / 22px 2px no-repeat,
    linear-gradient(#d9a643,#d9a643) right top / 2px 22px no-repeat,
    linear-gradient(#d9a643,#d9a643) left bottom / 22px 2px no-repeat,
    linear-gradient(#d9a643,#d9a643) left bottom / 2px 22px no-repeat,
    linear-gradient(#d9a643,#d9a643) right bottom / 22px 2px no-repeat,
    linear-gradient(#d9a643,#d9a643) right bottom / 2px 22px no-repeat;
  opacity: 0.36;
  filter: drop-shadow(0 0 5px rgba(217,166,67,0.24));
  z-index: 0;
}

.sidebar > *,
.preview-panel > *,
.modal-content > *,
.section > *,
.config-card > * {
  position: relative;
  z-index: 1;
}

.sidebar-header,
.sidebar-footer,
.preview-header,
.modal-header,
.modal-footer {
  border-color: rgba(217,166,67,0.22) !important;
  background:
    linear-gradient(90deg, rgba(217,166,67,0.075), transparent 55%, rgba(255,255,255,0.025)),
    rgba(255,255,255,0.028) !important;
}

label,
.subsection-title,
.glyph-group-label {
  color: #d9a643 !important;
  letter-spacing: 0.08em;
}

input,
select,
textarea {
  color: #f5f0e7 !important;
  border: 1px solid rgba(217,166,67,0.22) !important;
  border-radius: 10px !important;
  background: #070707 !important;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #d9a643 !important;
  box-shadow: 0 0 0 3px rgba(217,166,67,0.11) !important;
}

.mc-link-btn,
.btn-primary,
.btn-upload,
#btnGenPack,
.btn-secondary,
.btn-upload-secondary,
.nav-btn,
.offset-step-btn,
.tab-btn,
.btn-cancel,
button {
  border: 1px solid rgba(217,166,67,0.28) !important;
  border-radius: 10px !important;
  color: #f5f0e7;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.02)),
    rgba(12,12,13,0.88) !important;
  box-shadow: none !important;
  text-transform: none;
}

.btn-primary,
.btn-upload,
#btnGenPack,
.tab-btn.active {
  color: #181108 !important;
  background: linear-gradient(180deg, #f2cf7a, #d9a643 58%, #8f6a2c) !important;
  border-color: rgba(242,207,122,0.48) !important;
}

.btn-secondary:hover,
.btn-upload-secondary:hover,
.nav-btn:hover,
.offset-step-btn:hover,
.mc-link-btn:hover,
button:hover {
  border-color: rgba(217,166,67,0.46) !important;
  background:
    linear-gradient(180deg, rgba(217,166,67,0.10), rgba(255,255,255,0.025)),
    rgba(12,12,13,0.94) !important;
}

.btn-cancel,
.nav-delete-btn,
.remove-head-btn,
.delete-session-btn {
  color: #f2b0aa !important;
  border-color: rgba(214,107,95,0.38) !important;
}

.preview-area,
.preview-canvas-wrap,
.preview-canvas-shell,
.preview-wrapper,
.image-grid,
.grid-item,
.slot-overlay,
.slot-candidate,
.slot-cell {
  border-color: rgba(217,166,67,0.22) !important;
}

.preview-area,
.preview-wrapper {
  background:
    linear-gradient(rgba(217,166,67,0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(217,166,67,0.026) 1px, transparent 1px),
    #090909 !important;
  background-size: 48px 48px, 48px 48px, auto;
}

.grid-item,
.image-card,
.session-card,
.config-item {
  background:
    linear-gradient(135deg, rgba(217,166,67,0.045), transparent),
    rgba(11,11,12,0.86) !important;
}

.grid-item.selected,
.session-card.selected,
.config-item.selected {
  border-color: #d9a643 !important;
  box-shadow: inset 4px 0 0 #d9a643, 0 0 16px rgba(217,166,67,0.12) !important;
}

.profile-viewport-marker {
  border-color: #d9a643;
  background: rgba(217,166,67,0.14);
}

.profile-doll-caption {
  color: #f2cf7a;
}

.notification,
.toast {
  border: 1px solid rgba(217,166,67,0.34) !important;
  border-radius: 12px !important;
  background:
    linear-gradient(135deg, rgba(217,166,67,0.10), rgba(255,255,255,0.025)),
    rgba(12,12,13,0.98) !important;
}

/* Final readability + preview pass. */
body,
button,
input,
select,
textarea {
  font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
}

.app-container {
  grid-template-columns: minmax(350px, 390px) minmax(640px, 1fr);
  height: calc(100vh - 104px);
}

.builder-topbar {
  height: 70px;
  padding-block: 10px;
}

.brand {
  min-width: 0;
}

.brand strong {
  font-size: 17px;
  letter-spacing: 0.05em;
}

.brand small {
  max-width: 520px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-header {
  padding: 18px 20px 14px;
}

.sidebar-header h2 {
  font-size: 16px;
  line-height: 1.2;
}

.sidebar-header p,
.field-hint,
.profile-head-card h4,
.glyph-sheet-list,
.detected-layout,
.additional-textures-list {
  font-size: 12px;
  line-height: 1.45;
}

.sidebar-content {
  gap: 14px;
  padding: 18px;
}

.row {
  gap: 10px;
}

label,
.subsection-title,
.glyph-group-label {
  font-size: 11px;
  line-height: 1.25;
  text-shadow: none;
}

.checkbox-label {
  align-items: flex-start;
  line-height: 1.35;
}

input,
select,
textarea {
  min-height: 38px;
  padding: 9px 10px;
  font-size: 13px !important;
  font-weight: 600;
}

.offset-stepper {
  gap: 6px;
}

.offset-step-btn,
.nav-btn {
  min-width: 34px;
  height: 38px;
  line-height: 1;
}

.btn-upload,
.btn-secondary,
.btn-upload-secondary,
.btn-primary,
#btnGenPack,
.btn-cancel,
.mc-link-btn,
button {
  min-height: 38px;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.btn-upload {
  min-height: 66px;
}

.nav-control {
  gap: 8px;
  border-color: rgba(217,166,67,0.22) !important;
  border-radius: 12px;
  background: rgba(7,7,7,0.76) !important;
}

#navIndicator {
  min-width: 54px;
  color: #f2cf7a;
  font-size: 13px;
  text-align: center;
  text-shadow: none;
}

.preview-panel {
  min-width: 0;
}

.preview-header {
  min-height: 68px;
  padding: 14px 18px;
}

.preview-header h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
}

.preview-size-chip {
  max-width: 420px;
  padding: 7px 10px;
  border: 1px solid rgba(217,166,67,0.34);
  border-radius: 999px;
  color: #f2cf7a;
  background: rgba(7,7,7,0.76);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-area {
  min-height: 560px;
  padding: 24px;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.preview-container {
  width: 512px;
  height: 512px;
  border-radius: 10px;
  background:
    linear-gradient(rgba(217,166,67,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(217,166,67,0.035) 1px, transparent 1px),
    #070707 !important;
  background-size: 32px 32px, 32px 32px, auto;
  box-shadow:
    0 0 0 1px rgba(217,166,67,0.28),
    0 0 0 8px rgba(217,166,67,0.045),
    0 22px 44px rgba(0,0,0,0.42) !important;
}

.preview-canvas {
  width: 512px;
  height: 512px;
}

.preview-controls.preview-meta {
  padding: 10px 18px 14px;
  border-top: 1px solid rgba(217,166,67,0.18);
  background: rgba(7,7,7,0.52);
}

.preview-scale-info {
  color: #9f9588;
  font-size: 12px;
  line-height: 1.4;
}

.modal-content {
  width: min(1120px, calc(100vw - 36px));
}

.modal-header h2 {
  font-size: 20px;
  line-height: 1.2;
  text-shadow: none;
}

.grid-item .hex {
  color: #d9a643 !important;
  font-size: 12px;
  text-shadow: none;
}

.grid-item .symbol {
  font-size: 16px;
  text-shadow: none;
}

.profile-viewport-marker {
  border-style: solid;
}

/* Final typography/color correction: UI uses normal app typography, not Minecraft text styling. */
:root {
  --ui-font: "Segoe UI", Inter, Arial, Helvetica, sans-serif;
  --ui-panel-black: #0c0c0d;
  --ui-panel-soft: #151515;
  --ui-gold: #d9a643;
  --ui-gold-light: #f2cf7a;
  --ui-text: #f5f0e7;
  --ui-muted: #bdb4a8;
}

body,
.builder-topbar,
.sidebar,
.preview-panel,
.modal-content,
.mc-link-btn,
.btn-primary,
.btn-secondary,
.btn-upload,
.btn-upload-secondary,
.btn-cancel,
.nav-btn,
.offset-step-btn,
button,
input,
select,
textarea,
label,
h1,
h2,
h3,
h4,
p,
small,
strong,
span {
  font-family: var(--ui-font) !important;
  text-shadow: none !important;
}

.preview-chest-title {
  font-family: ChestGuiMinecraft, monospace !important;
}

.mc-link-btn,
.btn-primary,
.btn-secondary,
.btn-upload,
.btn-upload-secondary,
.btn-cancel,
.nav-btn,
.offset-step-btn,
.tab-btn,
button {
  min-height: 38px !important;
  color: var(--ui-text) !important;
  border: 1px solid rgba(217,166,67,0.30) !important;
  border-radius: 10px !important;
  background:
    linear-gradient(180deg, rgba(217,166,67,0.10), rgba(255,255,255,0.018)),
    var(--ui-panel-black) !important;
  box-shadow: none !important;
  image-rendering: auto !important;
  letter-spacing: 0.02em !important;
  font-weight: 700 !important;
  text-transform: none !important;
}

.btn-primary,
.btn-upload,
#btnGenPack,
.tab-btn.active {
  color: #16100a !important;
  background: linear-gradient(180deg, var(--ui-gold-light), var(--ui-gold) 58%, #8f6a2c) !important;
  border-color: rgba(242,207,122,0.54) !important;
}

.btn-cancel,
.nav-delete-btn,
.remove-head-btn,
.delete-session-btn {
  color: #f1b7ae !important;
  border-color: rgba(184,79,69,0.42) !important;
  background:
    linear-gradient(180deg, rgba(184,79,69,0.09), rgba(255,255,255,0.012)),
    #0b0b0c !important;
}

.sidebar,
.preview-panel,
.modal-content,
.section,
.profile-subsection,
.profile-head-card,
.head-preview-panel,
.additional-textures-list,
.detected-layout,
.glyph-sheet-list,
.textures-grid,
.sessions-grid,
.imports-grid,
.grid-item,
.session-card,
.config-item,
.nav-control,
.slider-box,
.notification,
.toast {
  border-color: rgba(217,166,67,0.22) !important;
  background:
    linear-gradient(135deg, rgba(217,166,67,0.04), transparent 58%),
    var(--ui-panel-black) !important;
}

.sidebar-header,
.sidebar-footer,
.preview-header,
.modal-header,
.modal-footer,
.content-header {
  border-color: rgba(217,166,67,0.22) !important;
  background:
    linear-gradient(90deg, rgba(217,166,67,0.06), transparent 62%),
    rgba(10,10,11,0.96) !important;
}

input,
select,
textarea {
  font-weight: 500 !important;
  color: var(--ui-text) !important;
  border-color: rgba(217,166,67,0.24) !important;
  background: #070707 !important;
}

label,
.subsection-title,
.glyph-group-label,
.eyebrow,
.preview-size-chip,
.slider-val,
#navIndicator {
  color: var(--ui-gold) !important;
}

.sidebar-header p,
.field-hint,
.empty-state,
.muted,
.zip-analyze-status,
.preview-scale-info,
.profile-head-card h4,
.detected-layout,
.glyph-sheet-list,
.additional-textures-list {
  color: var(--ui-muted) !important;
}

.brand strong,
.sidebar-header h2,
.preview-header h2,
.modal-header h2,
.content-header h2 {
  font-weight: 760 !important;
  letter-spacing: -0.01em !important;
  text-transform: none !important;
}

.brand-mark {
  background: linear-gradient(180deg, var(--ui-gold-light), var(--ui-gold) 58%, #8f6a2c) !important;
  box-shadow: 0 0 0 1px rgba(217,166,67,0.34), 0 0 18px rgba(217,166,67,0.16) !important;
}

.preview-area,
.preview-container {
  border-color: rgba(217,166,67,0.22) !important;
  background:
    linear-gradient(rgba(217,166,67,0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(217,166,67,0.026) 1px, transparent 1px),
    #090909 !important;
  background-size: 32px 32px, 32px 32px, auto;
}

.grid-item .hex,
code {
  font-family: "Segoe UI Mono", Consolas, monospace !important;
}

/* ============================================================
   Converter-aligned CHROME redesign — buttons, header, inputs,
   panels, exact novaic crate icon.
   CHROME ONLY. Never touches .preview-* / canvases / PREVIEW_*
   constants / slot positions / apple icons / colored slot overlays.
   All button IDs, handlers, and features remain unchanged.
   ============================================================ */
:root {
  --cv-bevel: inset 0 2px 0 rgba(255,255,255,.16), inset 0 -3px 0 rgba(0,0,0,.35);
}

/* --- Exact novaic crate icon (from the handoff, scaled) --- */
.brand-mark {
  width: 34px !important; height: 34px !important; flex: none !important;
  border-radius: 8px !important; overflow: hidden !important; background: none !important;
  box-shadow: 0 0 0 1px rgba(217,166,67,.34), 0 6px 16px -6px rgba(217,166,67,.55) !important;
}
.brand-mark .crate-flat { position: relative; width: 100px; height: 100px; transform: scale(.34); transform-origin: top left; }
.brand-mark .crate-flat .panel { position: absolute; inset: 6px;
  background-image: repeating-linear-gradient(0deg, rgba(0,0,0,.10) 0 1px, transparent 1px 22px), linear-gradient(160deg, #C8912E, #8E641F);
  border: 3px solid #F2CE77; box-shadow: inset 0 0 0 2px rgba(0,0,0,.28); }
.brand-mark .crate-flat .gv { position: absolute; left: 41px; top: 6px; bottom: 6px; width: 18px; background: linear-gradient(180deg,#7C561B,#5A3E14); }
.brand-mark .crate-flat .gh { position: absolute; top: 41px; left: 6px; right: 6px; height: 18px; background: linear-gradient(90deg,#7C561B,#5A3E14); }
.brand-mark .crate-flat .rv { position: absolute; width: 9px; height: 9px; background: #F2CE77; }
.brand-mark .crate-flat .rv.tl { left: 14px; top: 14px; } .brand-mark .crate-flat .rv.tr { right: 14px; top: 14px; }
.brand-mark .crate-flat .rv.bl { left: 14px; bottom: 14px; } .brand-mark .crate-flat .rv.br { right: 14px; bottom: 14px; }
.brand-mark .crate-flat .gem { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; transform: translate(-50%,-50%) rotate(45deg);
  background: linear-gradient(135deg,#FCE6A2,#E3AE42); box-shadow: 0 0 0 2px rgba(0,0,0,.35), inset 0 0 0 3px rgba(120,80,20,.55); }

/* --- Header --- */
.builder-topbar {
  background: linear-gradient(180deg, rgba(22,22,24,.98), rgba(10,10,11,.92)) !important;
  border-bottom: 1px solid rgba(217,166,67,.32) !important;
}
.brand strong { color: #f5f0e7 !important; letter-spacing: -.01em !important; }
.brand small { color: #8a8172 !important; }

/* --- Buttons: primary (gold, chiseled) --- */
.btn-primary, .btn-action {
  color: #1a1204 !important; font-weight: 700 !important;
  background: linear-gradient(180deg, #f2cf7a, #8f6a2c) !important; border: 0 !important;
  border-radius: 10px !important;
  box-shadow: var(--cv-bevel), 0 8px 20px -10px rgba(217,166,67,.6) !important;
}
.btn-primary:hover, .btn-action:hover { filter: brightness(1.05) !important; }

/* --- Secondary / neutral --- */
.btn-secondary, .nav-btn, .mc-link-btn, .btn-upload-secondary, .tab-btn {
  color: #f5f0e7 !important; background: #1f1c17 !important;
  border: 1px solid rgba(217,166,67,.3) !important; border-radius: 9px !important; box-shadow: none !important;
}
.btn-secondary:hover, .nav-btn:hover, .mc-link-btn:hover, .btn-upload-secondary:hover, .tab-btn:hover {
  background: #272219 !important; border-color: rgba(217,166,67,.5) !important; color: #ffe9a8 !important;
}
.tab-btn.active { color: #1a1204 !important; background: linear-gradient(180deg, #f2cf7a, #8f6a2c) !important; border-color: transparent !important; box-shadow: var(--cv-bevel) !important; }

/* --- Import (dashed) buttons --- */
.btn-upload {
  color: #f5f0e7 !important; border: 1.5px dashed rgba(217,166,67,.4) !important; border-radius: 11px !important;
  background: repeating-linear-gradient(45deg, rgba(217,166,67,.03) 0 10px, transparent 10px 20px) !important;
}
.btn-upload:hover { border-color: #d9a643 !important; background: rgba(217,166,67,.07) !important; }

/* --- Danger --- */
.btn-cancel, .nav-delete-btn {
  color: #f5f0e7 !important; background: #241614 !important; border: 1px solid rgba(194,81,70,.42) !important; border-radius: 9px !important;
}
.btn-cancel:hover, .nav-delete-btn:hover { border-color: rgba(194,81,70,.7) !important; color: #ffb4ac !important; }

/* --- Stepper +/- --- */
.offset-step-btn {
  color: #d9a643 !important; background: #1f1c17 !important; border: 1px solid rgba(217,166,67,.3) !important;
}
.offset-step-btn:hover { background: #272219 !important; }
.close-btn { color: #c8c0b4 !important; }
.close-btn:hover { color: #ffe9a8 !important; }

/* --- Inputs / selects (chrome only; NOT canvases) --- */
input[type="text"], input[type="number"], input[type="search"], select, textarea {
  color: #f5f0e7 !important; background: #0e0d0a !important;
  border: 1px solid rgba(217,166,67,.3) !important; border-radius: 9px !important;
}
input[type="text"]:focus, input[type="number"]:focus, input[type="search"]:focus, select:focus, textarea:focus {
  outline: 2px solid #f2cf7a !important; outline-offset: 1px !important;
}

/* --- Section headers / panels: gold hairline --- */
.sidebar-header, .content-header { border-color: rgba(217,166,67,.16) !important; }
.modal-content { border: 1px solid rgba(217,166,67,.32) !important; border-radius: 16px !important; }
