/**
 * Casual Maze Game - Level Editor UI & Studio Styles
 */

.editor-layout {
  display: grid;
  grid-template-rows: var(--top-bar-height, 42px) 1fr 28px;
  grid-template-columns: 320px 1fr;
  flex: 1;
  width: 100vw;
  height: calc(100vh - var(--top-bar-height, 42px));
  overflow: hidden;
  background: var(--bg);
}


/* Top Toolbar */
.editor-header {
  grid-column: 1 / -1;
  background: var(--card-bg);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  z-index: 100;
}

.editor-header::-webkit-scrollbar {
  display: none;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.editor-title-input {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  font-family: var(--font-main);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  outline: none;
  max-width: 200px;
}

.editor-title-input:hover, .editor-title-input:focus {
  border-color: var(--card-border);
  background: var(--bg);
}

/* Left Sidebar Palette (Issue #90, BL-124) */
.editor-sidebar {
  background: var(--card-bg);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.85rem;
  gap: 0.85rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.editor-sidebar > * {
  flex-shrink: 0;
}

/* Category Navigation Pills (BL-110) */
.sidebar-category-nav {
  display: flex;
  gap: 0.25rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  scrollbar-width: none;
}

.sidebar-category-nav::-webkit-scrollbar {
  display: none;
}

.category-pill {
  flex: 1;
  padding: 0.35rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  transition: all 0.15s ease;
}

.category-pill:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.category-pill.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

/* Real-Time Live Search (BL-110) */
.sidebar-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.sidebar-search-icon {
  position: absolute;
  left: 0.6rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  pointer-events: none;
}

.sidebar-search-input {
  width: 100%;
  padding: 0.4rem 1.8rem 0.4rem 1.8rem;
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sidebar-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.2);
}

.sidebar-search-clear {
  position: absolute;
  right: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
}

.sidebar-search-clear:hover {
  color: #ffffff;
}

.sidebar-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Layer Tabs */
.layer-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  background: var(--bg);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
}

.layer-tab {
  padding: 0.45rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.layer-tab.active {
  background: var(--card-bg);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* Tool Buttons Grid */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.palette-btn {
  background: var(--bg);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 0.6rem 0.5rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.palette-btn:hover {
  border-color: #58a6ff;
  background: var(--card-hover);
}

.palette-btn.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.palette-icon {
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
}

/* Center Canvas Viewport */
.editor-viewport {
  position: relative;
  overflow: hidden;
  background: #090d13;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

#editor-canvas {
  box-shadow: var(--shadow-lg);
  image-rendering: pixelated;
  cursor: crosshair;
}

.viewport-overlay-controls {
  position: absolute;
  bottom: calc(160px + 3.2rem);
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass-bright, rgba(56, 189, 248, 0.3));
  box-shadow: var(--shadow-md), 0 4px 16px rgba(0, 0, 0, 0.4);
  z-index: 25;
  transition: bottom 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.editor-minimap-hud.minimized + .viewport-overlay-controls {
  bottom: 3.4rem;
}

.viewport-control-divider {
  width: 1px;
  height: 18px;
  background: var(--card-border);
  margin: 0 0.15rem;
}

#btn-perspective.active, #btn-hud-perspective.active {
  background: rgba(56, 189, 248, 0.22);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
}

/* Floating Visual Layer Switcher HUD (BL-22) */
.layer-switcher-hud {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  z-index: 10;
  user-select: none;
}

.layer-hud-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0.45rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
}

.layer-hud-indicator {
  font-size: 0.7rem;
  line-height: 1;
}

.layer-hud-indicator.ground {
  color: #34d399;
  text-shadow: 0 0 6px rgba(52, 211, 153, 0.8);
}

.layer-hud-indicator.overhead {
  color: #fbbf24;
  text-shadow: 0 0 6px rgba(251, 191, 36, 0.8);
}

.layer-hud-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.layer-hud-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.layer-hud-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.layer-hud-btn.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

.layer-hud-divider {
  width: 1px;
  height: 14px;
  background: var(--card-border);
  margin: 0 0.15rem;
}

/* Sidebar Accordion Cards (BL-104) */
.sidebar-accordion {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  background: rgba(22, 27, 34, 0.6);
  backdrop-filter: blur(8px);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-accordion:hover {
  border-color: rgba(56, 189, 248, 0.25);
}

.sidebar-accordion-header {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: none;
  border-bottom: 1px solid transparent;
  padding: 0.55rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  user-select: none;
  transition: background 0.15s ease;
}

.sidebar-accordion-header:hover {
  background: rgba(255, 255, 255, 0.07);
}

.sidebar-accordion.active .sidebar-accordion-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.accordion-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.accordion-chevron {
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.sidebar-accordion:not(.active) .accordion-chevron {
  transform: rotate(-90deg);
}

.accordion-badge {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent);
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
}

.sidebar-accordion-content {
  padding: 0.65rem;
  display: block;
}

.sidebar-accordion:not(.active) .sidebar-accordion-content {
  display: none;
}

/* Floating Interactive Mini-Map Overview HUD (BL-103, BL-110) */
.editor-minimap-hud {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 16px rgba(56, 189, 248, 0.15);
  border-radius: var(--radius-md);
  z-index: 20;
  overflow: hidden;
  user-select: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.minimap-hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.minimap-hud-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.minimap-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
  transition: color 0.15s ease;
}

.minimap-toggle-btn:hover {
  color: #ffffff;
}

.minimap-canvas-container {
  position: relative;
  width: 160px;
  height: 160px;
  background: #090d13;
  display: flex;
  align-items: center;
  justify-content: center;
}

#editor-minimap-canvas {
  display: block;
  width: 160px;
  height: 160px;
  cursor: crosshair;
}

.minimap-hint {
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

.editor-minimap-hud.minimized .minimap-canvas-container {
  display: none;
}

/* Bottom Status Bar (AAA Studio Telemetry - BL-102) */
.editor-status-bar {
  grid-column: 1 / -1;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  z-index: 50;
  user-select: none;
}

.status-bar-left, .status-bar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.status-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.status-pip {
  font-size: 0.65rem;
  line-height: 1;
}

.status-pip.ground {
  color: #34d399;
  text-shadow: 0 0 6px rgba(52, 211, 153, 0.6);
}

.status-pip.overhead {
  color: #fbbf24;
  text-shadow: 0 0 6px rgba(251, 191, 36, 0.6);
}

.status-hint {
  color: var(--text-muted);
  font-size: 0.68rem;
  opacity: 0.85;
}

.status-version-badge {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
}

/* Entity Inspector Drawer / Modal */
.entity-props-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-row label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.targets-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 160px;
  overflow-y: auto;
  background: var(--bg);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
}

.target-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  background: var(--card-bg);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
}

/* Validation Badge & States */
.validation-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.validation-badge.valid {
  border-color: rgba(52, 211, 153, 0.4);
  color: var(--emerald);
  background: rgba(52, 211, 153, 0.08);
}

.validation-badge.warning {
  border-color: rgba(251, 191, 36, 0.4);
  color: var(--gold);
  background: rgba(251, 191, 36, 0.08);
}

.validation-badge.error {
  border-color: rgba(248, 113, 113, 0.4);
  color: var(--rose);
  background: rgba(248, 113, 113, 0.08);
}

/* Diagnostic Auto-Fixer Button (BL-21) */
#btn-auto-fix {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-color: rgba(168, 85, 247, 0.4);
  color: #c084fc;
  background: rgba(168, 85, 247, 0.08);
  font-weight: 600;
  transition: all 0.2s ease;
}

#btn-auto-fix:hover {
  border-color: #c084fc;
  background: rgba(168, 85, 247, 0.18);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

#btn-auto-fix.has-issues {
  animation: pulse-autofix 2s infinite ease-in-out;
}

@keyframes pulse-autofix {
  0%, 100% { box-shadow: 0 0 4px rgba(168, 85, 247, 0.2); }
  50% { box-shadow: 0 0 12px rgba(168, 85, 247, 0.55); border-color: #c084fc; }
}

/* Disabled Undo/Redo Buttons */
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Projects Manager Styles */
.saved-projects-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 180px;
  overflow-y: auto;
  background: var(--bg);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
}

.saved-project-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.saved-project-card:hover {
  border-color: var(--accent);
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.5rem;
}

.template-card {
  background: var(--bg);
  border: 1px solid var(--card-border);
  padding: 0.6rem 0.4rem;
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: all 0.15s ease;
}

.template-card:hover {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.05);
}

/* Validation Diagnostics List */
.diag-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 240px;
  overflow-y: auto;
}

.diag-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  line-height: 1.4;
}

.diag-item.error {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #fca5a5;
}

.diag-item.warning {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #fde68a;
}

.diag-item.info {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #bae6fd;
}

/* Color Palette Subgrid & Preset Swatches (BL-110) */
.color-palette-subgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.color-palette-subgrid button {
  padding: 0.45rem 0.35rem;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid var(--card-border);
  background: var(--bg);
  cursor: pointer;
  color: var(--text);
  transition: all 0.15s ease;
  user-select: none;
  min-height: 34px;
}

.color-palette-subgrid button:hover {
  border-color: var(--accent);
  background: var(--card-hover);
}

.color-palette-subgrid button.active {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.18);
  box-shadow: 0 0 6px var(--accent-glow);
}

/* Playtest Modal Specifics */
.playtest-options-grid {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.playtest-section-card {
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.key-inventory-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.4rem;
  max-height: 140px;
  overflow-y: auto;
}

.key-chk-card {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease;
}

.key-chk-card:hover {
  border-color: var(--accent);
}

.key-chk-card input[type="checkbox"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
}

/* Architect Guide Modal */
.guide-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.guide-card {
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.guide-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.guide-card p, .guide-card li {
  font-size: 0.825rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
}

.guide-card ul {
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
}

.guide-card strong {
  color: var(--text);
}

.shortcut-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.shortcut-table th, .shortcut-table td {
  padding: 0.45rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
}

.shortcut-table th {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.shortcut-table kbd {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 4px;
  padding: 0.15rem 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
}

/* Brush Size Selector */
.brush-size-group {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.25rem;
  background: var(--bg);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
}

.brush-size-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.4rem 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.brush-size-btn:hover {
  background: var(--card-hover);
  color: var(--text);
}

.brush-size-btn.active {
  background: var(--accent);
  color: #022014;
  box-shadow: var(--shadow-sm);
}

/* Modal Tabbed Navigation */
.modal-tabs {
  display: flex;
  gap: 0.35rem;
  border-bottom: 1px solid var(--card-border);
  padding: 0 1rem;
  background: var(--bg);
  overflow-x: auto;
}

.modal-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.modal-tab-btn:hover {
  color: var(--text);
}

.modal-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.modal-tab-pane {
  display: none;
  flex-direction: column;
  gap: 1rem;
}

.modal-tab-pane.active {
  display: flex;
}

/* Dimension Presets */
.dim-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.dim-preset-btn {
  background: var(--bg);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.dim-preset-btn:hover {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent);
}

/* Zoom Level Readout Badge */
.zoom-level-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  border-left: 1px solid var(--card-border);
  border-right: 1px solid var(--card-border);
}

/* Official Preset Cards & Filters */
.preset-filter-pills button.active {
  background: var(--accent);
  color: #022014;
  border-color: var(--accent);
  font-weight: 700;
}

.official-preset-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  gap: 0.75rem;
  transition: all 0.15s ease;
}

.official-preset-card:hover {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.04);
}

.official-preset-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.official-preset-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.official-preset-badge.tutorial {
  color: var(--gold);
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.08);
}

.official-preset-badge.zone_1 {
  color: var(--accent);
  border-color: rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.08);
}

.official-preset-badge.zone_2 {
  color: var(--emerald);
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.08);
}

.official-preset-badge.zone_3 {
  color: var(--rose);
  border-color: rgba(244, 63, 94, 0.3);
  background: rgba(244, 63, 94, 0.08);
}

/* =========================================================
 * MODERN ARCHITECT STUDIO TOOLBAR & SIDEBAR POLISH
 * ========================================================= */

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.toolbar-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 0.2rem;
}

.editor-header {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-glass-bright, rgba(56, 189, 248, 0.2));
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.editor-sidebar {
  background: rgba(13, 19, 31, 0.95);
  border-right: 1px solid var(--border-glass-bright, rgba(56, 189, 248, 0.15));
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.3) transparent;
}

.palette-btn {
  transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1), background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.palette-btn:hover {
  transform: translateY(-1px);
}

.palette-btn:active {
  transform: scale(0.97);
}

.palette-btn.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

.editor-status-bar {
  background: rgba(10, 15, 26, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}


