:root {
  --ide-bg: #f8f9fa;
  --ide-surface: #ffffff;
  --ide-border: #d1d5db;
  --ide-text: #111827;
  --ide-muted: #6b7280;
  --ide-accent: #0d9488;
  --ide-accent-hover: #0f766e;
  --ide-danger: #dc2626;
  --ide-success: #16a34a;
  --ide-warning: #d97706;
  --ide-sidebar-width: 260px;
  --ide-panel-header-height: 44px;
  --ide-font-mono:
    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    monospace;
  --ide-radius: 8px;
}

.ide-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--ide-bg);
  color: var(--ide-text);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
}

.ide-disclaimer {
  background: #fff7ed;
  border-bottom: 1px solid #fed7aa;
  color: #7c2d12;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ide-disclaimer a {
  color: #9a3412;
  text-decoration: underline;
}

.ide-header {
  height: var(--ide-panel-header-height);
  background: var(--ide-surface);
  border-bottom: 1px solid var(--ide-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}

.ide-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ide-logo {
  font-weight: 700;
  color: var(--ide-accent);
  text-decoration: none;
  font-size: 1.1rem;
}

.ide-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ide-muted);
  border: 1px solid var(--ide-border);
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
}

.ide-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ide-btn {
  appearance: none;
  border: 1px solid var(--ide-border);
  background: var(--ide-surface);
  color: var(--ide-text);
  border-radius: var(--ide-radius);
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.ide-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.ide-btn-primary {
  background: var(--ide-accent);
  border-color: var(--ide-accent);
  color: #fff;
}

.ide-btn-primary:hover {
  background: var(--ide-accent-hover);
  border-color: var(--ide-accent-hover);
}

.ide-main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.ide-sidebar {
  width: var(--ide-sidebar-width);
  background: var(--ide-surface);
  border-right: 1px solid var(--ide-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ide-sidebar-section {
  border-bottom: 1px solid var(--ide-border);
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}

.ide-sidebar-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ide-muted);
  padding: 0.75rem 1rem 0.4rem;
  font-weight: 600;
}

.ide-file-tree {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ide-file-tree li {
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ide-file-tree li:hover {
  background: #f3f4f6;
}

.ide-file-tree li.active {
  background: #e0f2fe;
  color: #0369a1;
}

.ide-file-tree .folder {
  font-weight: 600;
  color: var(--ide-text);
}

.ide-editor-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ide-tabs {
  display: flex;
  background: var(--ide-surface);
  border-bottom: 1px solid var(--ide-border);
  overflow-x: auto;
}

.ide-tab {
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  border-right: 1px solid var(--ide-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  background: #f3f4f6;
}

.ide-tab.active {
  background: var(--ide-surface);
  border-bottom: 1px solid var(--ide-surface);
  margin-bottom: -1px;
}

.ide-tab-close {
  font-size: 1rem;
  line-height: 1;
  color: var(--ide-muted);
}

.ide-tab-close:hover {
  color: var(--ide-danger);
}

.ide-editor {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

.ide-line-numbers {
  width: 3.5rem;
  background: #f3f4f6;
  border-right: 1px solid var(--ide-border);
  padding: 0.75rem 0.5rem;
  text-align: right;
  font-family: var(--ide-font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ide-muted);
  user-select: none;
  overflow: hidden;
}

.ide-code-input {
  flex: 1;
  resize: none;
  border: none;
  outline: none;
  padding: 0.75rem 1rem;
  font-family: var(--ide-font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ide-text);
  background: var(--ide-surface);
  white-space: pre;
  overflow: auto;
  tab-size: 4;
}

.ide-bottom-panel {
  height: 220px;
  background: var(--ide-surface);
  border-top: 1px solid var(--ide-border);
  display: flex;
  flex-direction: column;
}

.ide-panel-tabs {
  display: flex;
  background: #f3f4f6;
  border-bottom: 1px solid var(--ide-border);
}

.ide-panel-tab {
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  cursor: pointer;
  border-right: 1px solid var(--ide-border);
}

.ide-panel-tab.active {
  background: var(--ide-surface);
}

.ide-panel-content {
  flex: 1;
  overflow: auto;
  padding: 0.75rem 1rem;
  font-family: var(--ide-font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.ide-panel-content .error {
  color: var(--ide-danger);
}

.ide-panel-content .success {
  color: var(--ide-success);
}

.ide-panel-content .warning {
  color: var(--ide-warning);
}

.ide-right-sidebar {
  width: 300px;
  background: var(--ide-surface);
  border-left: 1px solid var(--ide-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.ide-right-sidebar-section {
  border-bottom: 1px solid var(--ide-border);
  padding: 1rem;
}

.ide-right-sidebar-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ide-muted);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.ide-form-group {
  margin-bottom: 0.75rem;
}

.ide-form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--ide-muted);
  margin-bottom: 0.25rem;
}

.ide-form-group input,
.ide-form-group select,
.ide-form-group textarea {
  width: 100%;
  border: 1px solid var(--ide-border);
  border-radius: var(--ide-radius);
  padding: 0.4rem 0.55rem;
  font-size: 0.85rem;
  background: var(--ide-surface);
  color: var(--ide-text);
  box-sizing: border-box;
}

.ide-form-group input:focus,
.ide-form-group select:focus,
.ide-form-group textarea:focus {
  outline: none;
  border-color: var(--ide-accent);
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.15);
}

.ide-network-card {
  background: #f3f4f6;
  border: 1px solid var(--ide-border);
  border-radius: var(--ide-radius);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
}

.ide-network-card strong {
  display: block;
  margin-bottom: 0.25rem;
}

.ide-network-card code {
  display: block;
  font-family: var(--ide-font-mono);
  background: #e5e7eb;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  margin-top: 0.25rem;
  word-break: break-all;
}

.ide-ref-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ide-ref-list li {
  margin-bottom: 0.5rem;
}

.ide-ref-list a {
  color: var(--ide-accent);
  text-decoration: none;
  font-size: 0.85rem;
}

.ide-ref-list a:hover {
  text-decoration: underline;
}

.ide-hidden {
  display: none !important;
}

@media (max-width: 1024px) {
  .ide-sidebar,
  .ide-right-sidebar {
    display: none;
  }
}
