:root {
  --panel: var(--card-bg, #ffffff);
  --panel-2: #fafafa;
  --border: #e0e0e0;
  --text: var(--text, #222222);
  --muted: var(--muted, #666666);
  --accent: #ff8800;
  --error: #d64545;
  --success: #2e8b57;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f2f4f8;
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

button {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
}

button:hover { border-color: var(--accent); }

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - 82px);
}

.sidebar {
  background: #ffffff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

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

.sidebar-header h2 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.sidebar-header p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.sidebar-info {
  padding: 16px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.toolbar-title { font-weight: 600; }

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status {
  font-size: 0.9rem;
  color: var(--muted);
}

.editor-area {
  display: grid;
  grid-template-columns: 1.6fr 360px;
  flex: 1;
  min-height: 0;
}

.editor {
  background: #ffffff;
  min-height: 0;
}

#editor {
  width: 100%;
  height: 100%;
}

.diagnostics-pane {
  background: var(--panel);
  border-left: 1px solid var(--border);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.diagnostics-pane h3 { margin: 0; font-size: 1rem; }

.diagnostics-list { display: flex; flex-direction: column; gap: 10px; overflow: auto; }

.diagnostic-item {
  background: rgba(255,107,107,0.1);
  border: 1px solid rgba(255,107,107,0.2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.94rem;
}

.diagnostic-item.warning { background: rgba(255,180,84,0.16); border-color: rgba(255,180,84,0.28); }
.diagnostic-item.error { background: rgba(255,107,107,0.18); border-color: rgba(255,107,107,0.28); }

.diagnostic-item .file {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 6px;
}

@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .editor-area { grid-template-columns: 1fr; }
  .diagnostics-pane { border-left: 0; border-top: 1px solid var(--border); max-height: 240px; }
}
