:root {
  --bg-main: #0b0f17;
  --bg-sidebar: #111726;
  --bg-card: #172033;
  --bg-card-hover: #1e2942;
  --bg-input: #0c121e;
  
  --border-color: #24324f;
  --border-focus: #00e5ff;
  
  --text-main: #e6edf3;
  --text-muted: #8b9bb4;
  --text-dim: #5c6b84;
  
  --accent-cyan: #00e5ff;
  --accent-cyan-glow: rgba(0, 229, 255, 0.25);
  --accent-green: #00ff88;
  --accent-yellow: #ffd000;
  --accent-red: #ff3366;
  --accent-blue: #2979ff;
  
  --panel-active-bg: rgba(0, 229, 255, 0.12);
  --panel-active-border: #00e5ff;
  --panel-inactive-bg: rgba(255, 51, 102, 0.08);
  --panel-inactive-border: rgba(255, 51, 102, 0.4);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Consolas', 'Fira Code', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE e Edge */
}

*::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera, Edge e Electron */
  width: 0;
  height: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-family);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
  scrollbar-width: none;
}

/* Header */
header.app-header {
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  flex-shrink: 0;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 2px solid var(--accent-yellow);
  box-shadow: 0 0 14px rgba(255, 208, 0, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.logo-avatar:hover {
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(255, 208, 0, 0.65);
}

.logo-icon {
  display: none;
}

.logo-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
}
.logo-text h1 span {
  color: var(--accent-yellow);
  text-shadow: 0 0 14px rgba(255, 208, 0, 0.45);
}
.logo-text p {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge-tag {
  background: rgba(0, 229, 255, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 229, 255, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

/* App Layout */
.app-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - 60px);
}

/* Sidebar */
aside.sidebar {
  width: 390px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

aside.sidebar::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.sidebar-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent-cyan);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-group {
  margin-bottom: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 500;
}

input[type="number"], select, input[type="text"] {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: var(--font-mono);
  outline: none;
  transition: all 0.15s ease;
}

input[type="number"]:focus, select:focus, input[type="text"]:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 8px var(--accent-cyan-glow);
}

.preset-buttons {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.btn-preset {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-preset:hover, .btn-preset.active {
  background: var(--accent-cyan);
  color: #000;
  border-color: var(--accent-cyan);
  font-weight: 600;
}

/* Quick Tools */
.quick-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.btn-tool {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.75rem;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}

.btn-tool:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Auto Division Box */
.auto-calc-box {
  background: var(--bg-input);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 12px;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.05);
}

.calc-badge {
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.2);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  margin-top: 6px;
  text-align: center;
  font-weight: 600;
}

/* Stats Card in Sidebar */
.stats-container {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-box {
  background: var(--bg-card);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-cyan);
}

.stat-box.green {
  border-left-color: var(--accent-green);
}
.stat-box.yellow {
  border-left-color: var(--accent-yellow);
}
.stat-box.purple {
  border-left-color: #b388ff;
}

.stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-value {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #fff;
  margin-top: 2px;
}

/* Main Area */
main.main-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
  position: relative;
  overflow: hidden;
}

/* Workspace Toolbar */
.workspace-toolbar {
  padding: 10px 24px;
  background: rgba(17, 23, 38, 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}

.view-tabs {
  display: flex;
  background: var(--bg-input);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.view-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.view-tab.active {
  background: var(--bg-card);
  color: var(--accent-cyan);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Central Content */
.content-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 14px 20px;
  overflow: hidden;
  position: relative;
  min-height: 0;
}

/* Interactive Grid Editor View */
.grid-editor-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  max-width: 100%;
  overflow: hidden;
}

.editor-topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.grid-instructions {
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.2);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.76rem;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ══ VIEWPORT PAN & ZOOM (ESTILO GOOGLE MAPS) ══ */
.viewport-outer {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 380px;
  background: #05080e;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-color);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.8);
}

.viewport-outer.panning {
  cursor: grabbing !important;
}

/* Controles Flutuantes de Zoom */
.viewport-zoom-controls {
  position: absolute;
  bottom: 14px;
  right: 14px;
  z-index: 25;
  display: flex;
  align-items: center;
  background: rgba(15, 22, 36, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  gap: 5px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.btn-zoom {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-zoom:hover {
  background: var(--accent-cyan);
  color: #000;
  border-color: var(--accent-cyan);
}

.btn-zoom.btn-fit {
  width: auto;
  padding: 0 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-yellow);
}

.btn-zoom.btn-fit:hover {
  background: var(--accent-yellow);
  color: #000;
  border-color: var(--accent-yellow);
}

.zoom-label {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  min-width: 44px;
  text-align: center;
  font-weight: 600;
}

/* Moldura Proporcional do Canvas (ex: 16:9) */
.viewport-container {
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 35px rgba(0, 229, 255, 0.15), 0 0 0 2px rgba(0, 229, 255, 0.4);
  background-color: #020409;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  border-radius: 4px;
  transform-origin: center center;
}

/* O Mundo que recebe Translação e Escala */
.viewport-world {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.interactive-matrix {
  display: grid;
  gap: 2px;
  background: transparent;
  padding: 0;
  border: none;
  outline: none;
}

.panel-cell {
  box-sizing: border-box;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
  position: relative;
  border: 2px solid var(--panel-active-border);
  background: var(--panel-active-bg);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.1);
  overflow: hidden;
  padding: 2px;
}

.panel-cell:hover {
  transform: scale(1.05);
  z-index: 2;
}

.panel-cell.selected {
  border: 2px solid var(--accent-yellow) !important;
  box-shadow: 0 0 16px rgba(255, 208, 0, 0.7) !important;
  transform: scale(1.06);
  z-index: 3;
}

.panel-cell.inactive {
  border: 2px dashed var(--panel-inactive-border);
  background: var(--panel-inactive-bg);
  box-shadow: none;
  opacity: 0.65;
}

.panel-cell.inactive:hover {
  opacity: 0.9;
}

.cell-num {
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

.panel-cell.inactive .cell-num {
  color: var(--accent-red);
  text-decoration: line-through;
}

.cell-pos {
  font-size: 0.62rem;
  color: var(--accent-yellow);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.cell-pixels {
  font-size: 0.58rem;
  color: #fff;
  font-family: var(--font-mono);
  margin-top: 1px;
}

.cell-custom-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--accent-yellow);
  color: #000;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 1px 3px;
  border-radius: 2px;
  line-height: 1;
}

.cell-status {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 600;
}

.panel-cell:not(.inactive) .cell-status {
  background: rgba(0, 229, 255, 0.2);
  color: var(--accent-cyan);
}

.panel-cell.inactive .cell-status {
  background: rgba(255, 51, 102, 0.2);
  color: var(--accent-red);
}

/* Canvas Live Preview View */
.canvas-preview-container {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 100%;
}

.preview-canvas-wrapper {
  background: #000;
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.15);
  border-radius: var(--radius-sm);
  max-width: 90%;
  max-height: 72vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

#previewCanvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.preview-badge-overlay {
  position: absolute;
  bottom: 8px;
  left: 12px;
  background: rgba(0,0,0,0.85);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

/* Footer / Export Drawer */
footer.export-bar {
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.export-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.export-info-text strong {
  font-size: 0.9rem;
  color: #fff;
}

.export-info-text p {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.export-actions {
  display: flex;
  gap: 8px;
}

.btn-export-single {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.btn-export-single:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-export-all {
  background: linear-gradient(135deg, #00e5ff 0%, #00ff88 100%);
  color: #000;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3);
  transition: all 0.15s;
}

.btn-export-all:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 229, 255, 0.45);
}

.btn-export-all:active {
  transform: translateY(0);
}

/* Modal for Image Preview */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-content {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}

.modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1rem;
  color: var(--accent-cyan);
}

.btn-close-modal {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.btn-close-modal:hover {
  color: #fff;
}

.modal-body {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: auto;
}

.modal-body img {
  max-width: 100%;
  max-height: 65vh;
  border: 1px solid var(--border-color);
  box-shadow: 0 5px 25px rgba(0,0,0,0.7);
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Painel Inspector da Placa Selecionada */
.panel-inspector-card {
  width: 100%;
  max-width: 680px;
  background: var(--bg-card);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  margin-top: 8px;
}

.inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.inspector-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-yellow);
  display: flex;
  align-items: center;
  gap: 6px;
}

.inspector-body {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}

.inspector-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inspector-field label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.inspector-field input[type="number"] {
  width: 110px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.inspector-toggle-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.inspector-toggle-btn.active {
  background: rgba(0, 255, 136, 0.15);
  color: var(--accent-green);
  border-color: var(--accent-green);
}

.inspector-toggle-btn.inactive {
  background: rgba(255, 51, 102, 0.15);
  color: var(--accent-red);
  border-color: var(--accent-red);
}

.inspector-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
  width: 100%;
}

.btn-mini-tool {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-mini-tool:hover {
  background: var(--bg-card-hover);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

/* ─── APPLY Button ─────────────────────────── */
.btn-apply-pixels {
  width: 100%;
  background: linear-gradient(135deg, rgba(0,229,255,0.15) 0%, rgba(41,121,255,0.15) 100%);
  border: 1px solid rgba(0,229,255,0.5);
  color: var(--accent-cyan);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.2s;
  text-align: center;
}

.btn-apply-pixels:hover {
  background: linear-gradient(135deg, rgba(0,229,255,0.28) 0%, rgba(41,121,255,0.28) 100%);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0,229,255,0.3);
  transform: translateY(-1px);
}

.btn-apply-pixels:active {
  transform: translateY(0);
}

/* ─── Rubber Band Selection ─────────────────── */
.rubber-band {
  display: none;
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  border: 1.5px dashed var(--accent-cyan);
  background: rgba(0, 229, 255, 0.07);
  border-radius: 2px;
}

/* ─── Célula com Foco (navegação por teclado) ── */
.panel-cell.focused {
  outline: 2px solid var(--accent-yellow);
  outline-offset: 2px;
  z-index: 4;
}

/* ─── Múltipla seleção: brilho cumulativo ────── */
.panel-cell.selected.focused {
  border-color: var(--accent-yellow) !important;
  box-shadow: 0 0 20px rgba(255,208,0,0.85) !important;
  outline: 2px solid #fff;
  outline-offset: 1px;
}

/* ═════════════════════════════════════════════════
   RESPONSIVIDADE MOBILE & TABLET (site_web)
═════════════════════════════════════════════════ */
@media (max-width: 900px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
  }

  header.app-header {
    height: auto;
    padding: 10px 16px;
    gap: 10px;
  }

  .logo-avatar {
    width: 38px;
    height: 38px;
  }

  .logo-text h1 {
    font-size: 1.1rem;
  }

  .logo-text p {
    font-size: 0.65rem;
  }

  .app-container {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  /* No celular, o workspace (Editor/Visualizador) fica no topo e os controles embaixo */
  .main-workspace {
    order: 1;
    min-height: 480px;
    height: auto;
  }

  aside.sidebar {
    order: 2;
    width: 100%;
    border-right: none;
    border-top: 1px solid var(--border-color);
    overflow-y: visible;
  }

  .viewport-outer {
    min-height: 300px;
    height: 52vh;
  }

  .workspace-toolbar {
    padding: 10px 14px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .view-tabs {
    width: 100%;
  }

  .view-tab {
    flex: 1;
    text-align: center;
    font-size: 0.78rem;
    padding: 8px 10px;
  }

  .export-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
  }

  .export-info {
    text-align: center;
  }

  .export-actions {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .btn-export-single, .btn-export-all {
    width: 100%;
    padding: 12px;
    font-size: 0.85rem;
    justify-content: center;
  }

  .preset-buttons {
    grid-template-columns: 1fr 1fr;
  }

  .panel-inspector-card {
    max-width: 100%;
    margin-top: 12px;
  }

  .inspector-body {
    flex-direction: column;
    align-items: stretch;
  }

  .inspector-field input {
    width: 100%;
  }

  .inspector-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .logo-text p {
    display: none;
  }

  .stats-container {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .stat-box {
    padding: 6px 8px;
  }

  .stat-label {
    font-size: 0.62rem;
  }

  .stat-value {
    font-size: 0.92rem;
  }

  .viewport-outer {
    min-height: 260px;
    height: 44vh;
  }
}
