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

/* Header */
.jsc-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;
}
.jsc-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.jsc-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.jsc-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

/* Main layout */
.jsc-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  flex: 1;
  overflow: hidden;
}

/* Panels */
.jsc-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.jsc-panel-input {
  border-right: 1px solid var(--border);
}
.jsc-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  gap: 8px;
  flex-wrap: wrap;
}
.jsc-panel-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.jsc-panel-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

/* Input textarea */
.jsc-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;
}
.jsc-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}
.jsc-textarea.jsc-input-error {
  box-shadow: inset 0 0 0 2px var(--red);
}

/* Output area */
.jsc-output-wrap {
  flex: 1;
  overflow: auto;
  background: var(--bg);
  position: relative;
}
pre.jsc-output {
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text);
  min-height: 100%;
  margin: 0;
}

/* Tab bar for schema format */
.jsc-tabs {
  display: flex;
  gap: 0;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.jsc-tabs::-webkit-scrollbar {
  height: 4px;
}
.jsc-tabs::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}
.jsc-tab {
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  font-family: var(--font-sans);
  white-space: nowrap;
  flex-shrink: 0;
}
.jsc-tab:hover {
  color: var(--text);
  background: var(--surface-3);
}
.jsc-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* Options panel */
.jsc-options {
  display: flex;
  gap: 12px;
  padding: 8px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  align-items: center;
}
.jsc-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.jsc-option label {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 5px;
}
.jsc-option input[type="checkbox"] {
  accent-color: var(--accent);
  cursor: pointer;
  width: 14px;
  height: 14px;
}
.jsc-option select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  font-size: 11px;
  font-family: var(--font-sans);
  cursor: pointer;
  outline: none;
}
.jsc-option select:focus {
  border-color: var(--accent);
}

/* SQL dialect selector */
.jsc-dialect-select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 11px;
  font-family: var(--font-sans);
  cursor: pointer;
  outline: none;
  margin-left: 4px;
}
.jsc-dialect-select:focus {
  border-color: var(--accent);
}

/* Status bar */
.jsc-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);
  gap: 8px;
}

/* Empty state */
.jsc-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;
}
.jsc-empty-state svg {
  opacity: 0.3;
  margin-bottom: 8px;
}
.jsc-empty-state p {
  font-size: 14px;
}
.jsc-empty-state .jsc-hint {
  font-size: 12px;
  opacity: 0.6;
}

/* Error / validation messages */
.jsc-error {
  color: var(--red);
  font-style: italic;
}
.jsc-valid {
  color: var(--green);
}

/* Syntax highlighting for output */
.jsc-syn-key { color: #9cdcfe; }
.jsc-syn-str { color: #ce9178; }
.jsc-syn-num { color: #b5cea8; }
.jsc-syn-bool { color: #569cd6; }
.jsc-syn-null { color: #808080; }
.jsc-syn-kw { color: #c586c0; }
.jsc-syn-type { color: #4ec9b0; }
.jsc-syn-comment { color: #6a9955; font-style: italic; }
.jsc-syn-decorator { color: #dcdcaa; }
.jsc-syn-func { color: #dcdcaa; }
.jsc-syn-brace { color: var(--text-muted); }
.jsc-syn-punct { color: var(--text-muted); }

/* Auto-convert toggle */
.jsc-auto-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
}
.jsc-auto-toggle label {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Badge for inferred types */
.jsc-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  background: var(--accent-light);
  color: var(--accent);
  margin-left: 6px;
}

/* Input panel bottom bar */
.jsc-input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 11px;
  color: var(--text-muted);
  gap: 8px;
}
.jsc-input-footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.jsc-input-footer-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Options expand/collapse */
.jsc-options-toggle {
  padding: 3px 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-sans);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.jsc-options-toggle:hover {
  color: var(--text);
  border-color: var(--accent);
}
.jsc-options-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease;
}
.jsc-options-panel.open {
  max-height: 120px;
}

/* Responsive */
@media (max-width: 768px) {
  .jsc-main {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }
  .jsc-panel-input {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .jsc-header {
    padding: 10px 12px;
  }
  .jsc-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .jsc-tab {
    padding: 6px 10px;
    font-size: 11px;
  }
  .jsc-options {
    padding: 6px 12px;
    gap: 8px;
  }
  .jsc-option {
    font-size: 10px;
  }
  .jsc-panel-header {
    padding: 6px 12px;
  }
  .jsc-panel-actions {
    gap: 4px;
  }
}
