.dc-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.dc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

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

.dc-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dc-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.dc-tab-toggle {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: 8px;
}

.dc-tab-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
  font-family: var(--font-sans);
  white-space: nowrap;
}

.dc-tab-btn:hover {
  color: var(--text);
  background: var(--surface-3);
}

.dc-tab-btn.active {
  background: var(--accent);
  color: #080b14;
  font-weight: 600;
}

/* ── Main Layout ── */

.dc-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  flex: 1;
  overflow: hidden;
}

.dc-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.dc-panel-input {
  border-right: 1px solid var(--border);
}

.dc-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.dc-panel-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.dc-panel-actions {
  display: flex;
  gap: 6px;
}

/* ── Input ── */

.dc-textarea {
  width: 100%;
  flex: 1;
  background: var(--bg);
  color: var(--text);
  border: none;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  resize: none;
  outline: none;
  tab-size: 2;
  min-height: 0;
}

.dc-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

/* ── Presets ── */

.dc-presets {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  overflow-x: auto;
  flex-shrink: 0;
}

.dc-presets-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.dc-preset-btn {
  padding: 4px 10px;
  border: 1px solid var(--border-light);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  font-family: var(--font-sans);
  white-space: nowrap;
  flex-shrink: 0;
}

.dc-preset-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

/* ── Output ── */

.dc-output-wrap {
  flex: 1;
  overflow: auto;
  background: var(--bg);
  position: relative;
}

pre.dc-output {
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre;
  color: var(--text);
  min-height: 100%;
  margin: 0;
  overflow-x: auto;
}

.dc-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  gap: 8px;
  padding: 40px;
  text-align: center;
}

.dc-empty-state svg {
  opacity: 0.3;
  margin-bottom: 8px;
}

.dc-empty-state p {
  font-size: 14px;
}

.dc-hint {
  font-size: 12px;
  opacity: 0.6;
}

/* ── Error Panel ── */

.dc-error-panel {
  padding: 12px 16px;
  background: color-mix(in srgb, var(--red) 8%, var(--surface));
  border-bottom: 1px solid color-mix(in srgb, var(--red) 25%, var(--border));
  color: var(--red);
  font-size: 12px;
  font-family: var(--font-mono);
  line-height: 1.6;
}

.dc-error {
  color: var(--red);
  font-style: italic;
}

/* ── Status Bar ── */

.dc-status-bar {
  padding: 6px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Syntax Highlighting ── */

.dc-hl-key {
  color: var(--accent);
}

.dc-hl-colon {
  color: var(--text-muted);
}

.dc-hl-str {
  color: var(--green);
}

.dc-hl-num {
  color: var(--orange);
}

.dc-hl-bool {
  color: var(--orange);
}

.dc-hl-null {
  color: var(--red);
}

.dc-hl-dash {
  color: var(--text-muted);
}

.dc-hl-sep {
  color: var(--text-muted);
  font-weight: 600;
}

.dc-hl-comment {
  color: var(--text-muted);
  font-style: italic;
}

/* ── Responsive ── */

@media (max-width: 768px) {
  .dc-main {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }

  .dc-panel-input {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .dc-header {
    padding: 10px 14px;
  }

  .dc-header-left {
    flex-wrap: wrap;
    gap: 8px;
  }

  .dc-tab-toggle {
    width: 100%;
  }

  .dc-tab-btn {
    flex: 1;
    text-align: center;
    font-size: 11px;
    padding: 6px 8px;
  }

  .dc-presets {
    padding: 6px 12px;
    gap: 4px;
  }

  .dc-preset-btn {
    font-size: 10px;
    padding: 3px 8px;
  }

  .dc-textarea {
    font-size: 12px;
    padding: 12px;
  }

  pre.dc-output {
    font-size: 12px;
    padding: 12px;
  }

  .dc-status-bar {
    font-size: 11px;
    padding: 4px 12px;
  }
}
