/* ==========================================================================
   3D VISION LAB — STYLING SYSTEM
   ========================================================================== */

:root {
  --bg-primary: #0a0c10;
  --bg-surface: #12161f;
  --bg-card: rgba(23, 28, 41, 0.75);
  --bg-card-hover: rgba(32, 39, 58, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(99, 102, 241, 0.4);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  --success: #10b981;
  --warning: #f59e0b;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

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

.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 26px;
  filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
}

.logo-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.status-badges {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-mps {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

.badge-model {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

/* -------------------------------------------------------------
   Layout Structure
   ------------------------------------------------------------- */
.app-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.sidebar-panel {
  width: 380px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  flex-shrink: 0;
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

/* -------------------------------------------------------------
   Dropzone
   ------------------------------------------------------------- */
.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  background: rgba(0, 0, 0, 0.2);
  position: relative;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: var(--shadow-glow);
}

.file-input-hidden {
  display: none;
}

.upload-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.dropzone-text {
  font-size: 13px;
  color: var(--text-primary);
}

.dropzone-subtext {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.dropzone-preview {
  position: relative;
  width: 100%;
  height: 130px;
}

.dropzone-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.clear-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  border: none;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

/* -------------------------------------------------------------
   Sample Gallery
   ------------------------------------------------------------- */
.samples-container {
  margin-top: 12px;
}

.samples-header {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.samples-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.sample-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
  cursor: pointer;
  background: #000;
  transition: transform 0.2s, border-color 0.2s;
}

.sample-item:hover {
  transform: scale(1.05);
  border-color: var(--accent-primary);
}

.sample-item.active {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-primary);
}

.sample-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sample-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  font-size: 8px;
  background: rgba(0, 0, 0, 0.7);
  padding: 2px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* -------------------------------------------------------------
   Settings & Buttons
   ------------------------------------------------------------- */
.setting-row {
  margin-bottom: 16px;
}

.setting-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.select-input {
  width: 100%;
  background: rgba(10, 12, 18, 0.8);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12px;
  font-family: var(--font-sans);
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.select-input:focus {
  border-color: var(--accent-primary);
}

.checkbox-row {
  margin-top: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--accent-primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.setting-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.token-link {
  font-size: 11px;
  color: #06b6d4;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s;
}

.token-link:hover {
  text-decoration: underline;
  opacity: 0.85;
}

.text-input {
  width: 100%;
  background: rgba(10, 12, 18, 0.8);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12px;
  font-family: var(--font-mono);
  outline: none;
  transition: border-color 0.2s;
}

.text-input:focus {
  border-color: var(--accent-primary);
}

.cloud-links-group {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.link-chip {
  display: block;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  text-decoration: none;
  transition: all 0.2s;
}

.link-chip:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.mono-value {
  font-family: var(--font-mono);
  color: var(--accent-primary);
  font-weight: 600;
}

.slider {
  width: 100%;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

.primary-btn {
  width: 100%;
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-glow);
  transition: opacity 0.2s, transform 0.15s;
}

.primary-btn:hover:not(:disabled) {
  opacity: 0.95;
  transform: translateY(-1px);
}

.primary-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

/* -------------------------------------------------------------
   Telemetry Cards
   ------------------------------------------------------------- */
.telemetry-card {
  margin-top: auto;
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.metric-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.metric-val {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 4px;
}

/* -------------------------------------------------------------
   Right: 3D Viewport
   ------------------------------------------------------------- */
.viewport-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #06070a;
}

.viewport-header {
  height: 54px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: rgba(18, 22, 31, 0.6);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.viewport-title {
  font-size: 14px;
  font-weight: 600;
}

.viewport-status {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 10px;
}

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

.tool-btn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.tool-btn.active {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border-color: var(--accent-primary);
}

.viewport-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#canvas3d {
  width: 100%;
  height: 100%;
  display: block;
}

.viewport-hint {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: rgba(18, 22, 31, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  pointer-events: none;
}

.download-bar {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 10;
}

.download-btn {
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-obj {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid var(--border-color);
}

.btn-obj:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-glb {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.btn-glb:hover {
  opacity: 0.95;
}

/* -------------------------------------------------------------
   Loading Overlay
   ------------------------------------------------------------- */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 7, 10, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 15;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.hidden {
  display: none !important;
}

/* -------------------------------------------------------------
   Serverless / Client WebGPU Callout
   ------------------------------------------------------------- */
.serverless-callout {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 11px;
  color: #34d399;
  line-height: 1.4;
  margin-top: 10px;
}

.serverless-callout strong {
  color: #6ee7b7;
}

/* -------------------------------------------------------------
   Resource Warning Modal Dialog
   ------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 8, 0.82);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background: #0f131d;
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7), 0 0 30px rgba(245, 158, 11, 0.15);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  overflow: hidden;
  animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(245, 158, 11, 0.05);
}

.modal-icon-badge {
  font-size: 26px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 3px;
}

.modal-subtitle {
  font-size: 11px;
  color: #f59e0b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-body {
  padding: 20px 24px;
}

.modal-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}

.modal-warning-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.modal-warning-box ul {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: #fde68a;
  line-height: 1.6;
}

.modal-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px 0;
}

.modal-checkbox-label input[type="checkbox"] {
  accent-color: #f59e0b;
  width: 17px;
  height: 17px;
  cursor: pointer;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: rgba(10, 12, 18, 0.6);
}

.secondary-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.primary-btn-sm {
  background: linear-gradient(135deg, #d97706, #b45309);
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35);
  transition: all 0.2s;
}

.primary-btn-sm:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

/* ==========================================================================
   Accessibility & Focus-Visible States
   ========================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 20px;
  background: var(--accent-primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  z-index: 1000;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible,
.dropzone:focus-visible,
.viewport-container:focus-visible {
  outline: 2px solid #38bdf8 !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.45) !important;
}

/* Touch Ergonomics on 3D Viewport */
#canvas3d {
  touch-action: none;
}

/* ==========================================================================
   WebGPU Compatibility Notice Banner
   ========================================================================== */
.compatibility-banner {
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: #e2e8f0;
  z-index: 15;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.banner-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.banner-text {
  flex-grow: 1;
  line-height: 1.4;
}

.banner-dismiss {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s;
}

.banner-dismiss:hover {
  color: var(--text-primary);
}

/* ==========================================================================
   Toast Notification System
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 76px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  max-width: 380px;
  width: calc(100% - 48px);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: rgba(18, 24, 38, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.25s ease;
}

@keyframes toastIn {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.toast-exit {
  transform: translateX(60px);
  opacity: 0;
}

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-body {
  flex-grow: 1;
}

.toast-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.toast-msg {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  margin-left: 4px;
}

.toast-close:hover {
  color: var(--text-primary);
}

.toast-success {
  border-left: 3px solid #10b981;
}

.toast-error {
  border-left: 3px solid #ef4444;
}

.toast-warning {
  border-left: 3px solid #f59e0b;
}

.toast-info {
  border-left: 3px solid #38bdf8;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.app-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 10px 24px;
  flex-shrink: 0;
  z-index: 10;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 11.5px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.footer-separator {
  opacity: 0.4;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-link:hover {
  color: #38bdf8;
  text-decoration: underline;
}

/* ==========================================================================
   Responsive & Mobile Ergonomics
   ========================================================================== */
@media (max-width: 960px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
  }

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

  .sidebar-panel {
    width: 100%;
    max-width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    overflow: visible;
    padding: 16px;
  }

  .viewport-panel {
    width: 100%;
    height: auto;
    min-height: 520px;
    padding: 16px;
  }

  .viewport-container {
    height: 500px;
  }

  .app-header {
    padding: 0 16px;
  }

  .logo-subtitle {
    display: none;
  }

  .status-badges .badge-mps {
    display: none;
  }
}

@media (max-width: 580px) {
  .viewport-container {
    height: 380px;
  }

  .download-bar {
    flex-direction: column;
    left: 12px;
    right: 12px;
    transform: none;
    bottom: 12px;
  }

  .download-btn {
    width: 100%;
    justify-content: center;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .viewport-actions {
    flex-wrap: wrap;
  }

  .tool-btn {
    font-size: 11px;
    padding: 6px 10px;
  }

  .modal-card {
    max-width: calc(100% - 24px);
    margin: 12px;
  }

  .modal-footer {
    flex-direction: column;
    gap: 8px;
  }

  .modal-footer button {
    width: 100%;
  }
}
