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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #0f172a;
  color: #f8fafc;
  line-height: 1.5;
  min-height: 100vh;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: #1e293b;
  border-bottom: 1px solid #334155;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-badge {
  background: #3b82f6;
  color: #fff;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
}

.logo-area h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

.nav-btn {
  color: #38bdf8;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-btn:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

.lab-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
  padding: 2rem;
  max-width: 1600px;
  margin: 0 auto;
}

.sidebar-controls {
  background: #1e293b;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #334155;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  height: fit-content;
}

.sidebar-controls h2 {
  font-size: 1.1rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.control-group label {
  font-size: 0.875rem;
  color: #cbd5e1;
}

.control-group select,
.control-group input[type="text"],
.control-group textarea {
  background: #0f172a;
  border: 1px solid #475569;
  color: #f8fafc;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

.control-group input[type="range"] {
  accent-color: #3b82f6;
}

.hidden {
  display: none !important;
}

.btn-primary {
  background: #2563eb;
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 0.5rem;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.debugger-view {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.debug-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 1.25rem;
}

.debug-card h3 {
  font-size: 1rem;
  color: #38bdf8;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #334155;
}

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

.chunk-box {
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 6px;
  padding: 0.75rem;
  font-size: 0.85rem;
}

.chunk-header {
  font-weight: 600;
  color: #818cf8;
  margin-bottom: 0.4rem;
}

.sim-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sim-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #0f172a;
  padding: 0.5rem 1rem;
  border-radius: 6px;
}

.sim-bar-bg {
  flex: 1;
  background: #334155;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}

.sim-bar-fill {
  background: #38bdf8;
  height: 100%;
}

.code-block {
  background: #0f172a;
  padding: 1rem;
  border-radius: 6px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.85rem;
  color: #a7f3d0;
  white-space: pre-wrap;
  word-break: break-word;
}

.answer-box {
  background: #0f172a;
  padding: 1rem;
  border-radius: 6px;
  border-left: 4px solid #f59e0b;
  font-size: 0.95rem;
}

@media (max-width: 900px) {
  .lab-container {
    grid-template-columns: 1fr;
  }
}
