:root {
  --bg-root: #050711;
  --bg-elevated: #080a18;
  --bg-elevated-soft: #090b1c;
  --bg-accent: linear-gradient(135deg, #4f46e5, #06b6d4);
  --bg-accent-soft: linear-gradient(145deg, #1f2937, #020617);
  --border-subtle: rgba(148, 163, 184, 0.18);
  --border-strong: rgba(148, 163, 184, 0.35);
  --text-primary: #e5e7eb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent: #38bdf8;
  --accent-strong: #4f46e5;
  --danger: #f97373;
  --success: #22c55e;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 60px rgba(15, 23, 42, 0.8);
  --shadow-subtle: 0 10px 35px rgba(15, 23, 42, 0.6);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Inter", "Segoe UI", sans-serif;
  background: radial-gradient(circle at center, #0f172a 0%, #020617 100%);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 22px;
  gap: 16px;
  background:
    radial-gradient(circle at top left, rgba(79, 70, 229, 0.22), transparent 55%),
    radial-gradient(circle at bottom right, rgba(8, 47, 73, 0.4), transparent 60%);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.6));
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: radial-gradient(circle at 0% 0%, #22d3ee, #4f46e5);
  color: white;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.03em;
  box-shadow: 0 10px 35px rgba(59, 130, 246, 0.7);
}

.logo-text {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 14px;
  color: #e5e7eb;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-button,
.ghost-button {
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 120ms ease,
    box-shadow 120ms ease;
}

.primary-button {
  background-image: linear-gradient(135deg, #4f46e5, #38bdf8);
  color: white;
  box-shadow: 0 10px 30px rgba(56, 189, 248, 0.5);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 45px rgba(56, 189, 248, 0.7);
}

.ghost-button {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.55);
  color: var(--text-secondary);
}

.ghost-button-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.ghost-button:hover {
  border-color: rgba(148, 163, 184, 0.95);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-primary);
}

.app-main {
  flex: 1;
  display: grid;
  grid-template-columns: 0.9fr 1.3fr 1.1fr;
  gap: 16px;
  min-height: 0;
}

.panel {
  background: radial-gradient(circle at top left, rgba(2, 6, 23, 0.88), rgba(2, 6, 23, 0.96));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.055), transparent 55%);
  opacity: 0.95;
  pointer-events: none;
}

.panel-sidebar::before {
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.12), transparent 55%);
}

.panel-code::before {
  background: radial-gradient(circle at top right, rgba(79, 70, 229, 0.16), transparent 55%);
}

.panel-header,
.panel-body {
  position: relative;
  z-index: 1;
}

.panel-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.95);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-header h2 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e5e7eb;
}

.panel-subtitle {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.panel-body {
  padding: 12px 12px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.schema-list {
  flex: 1;
  min-height: 0;
  gap: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.schema-item,
.type-btn {
  width: 100%;
  text-align: left;
  border-radius: 10px;
  padding: 3px 8px;
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(31, 41, 55, 0.95);
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    transform 120ms ease,
    box-shadow 120ms ease;
}

/* Sidebar action-button style (aligns with header buttons) */
.panel-sidebar .type-btn {
  border-radius: 999px;
  height: 50px;
  padding: 0 12px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  background: linear-gradient(
    135deg,
    rgba(79, 70, 229, 0.14),
    rgba(56, 189, 248, 0.08)
  );
  border: 1px solid rgba(56, 189, 248, 0.32);
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.55);
}

.panel-sidebar .type-btn:last-child {
  margin-bottom: 0;
}

.panel-sidebar .schema-item-title {
  font-size: 14px;
  font-weight: 700;
}

.panel-sidebar .schema-pill {
  font-size: 11px;
  padding: 2px 8px;
}

/* Scale icons inside sidebar buttons (if present) */
.panel-sidebar .type-btn svg,
.panel-sidebar .type-btn img {
  width: 18px;
  height: 18px;
}

.panel-sidebar .type-btn:hover {
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25), 0 14px 35px rgba(56, 189, 248, 0.12);
  transform: translateY(-0.5px);
}

.panel-sidebar .type-btn.active {
  border-color: rgba(56, 189, 248, 0.9);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.6), 0 18px 50px rgba(56, 189, 248, 0.14);
}

.schema-item:hover {
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35);
}

.schema-item.active {
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 1));
  border-color: rgba(56, 189, 248, 0.9);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.7), 0 12px 40px rgba(15, 23, 42, 0.98);
}

.schema-item-title {
  font-size: 11px;
  line-height: 1.15;
  font-weight: 700;
  color: #e5e7eb;
}

.schema-item-subtitle {
  display: none;
  font-size: 10px;
  color: var(--text-muted);
}

.schema-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0;
  flex: 0 0 auto;
}

.schema-pill {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: var(--text-secondary);
  line-height: 1.2;
}

/* If your sidebar items use <small> or <p>, hide them for compactness */
.panel-sidebar .schema-item small,
.panel-sidebar .schema-item p,
.panel-sidebar .type-btn small,
.panel-sidebar .type-btn p {
  display: none;
}

.schema-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-sidebar {
  box-shadow: inset -1px 0 0 rgba(15, 23, 42, 0.9);
}

.google-test-footer {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.google-test-button {
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.7);
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.98));
  color: #e5e7eb;
  font-size: 12px;
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 120ms ease;
}

.google-test-button:hover {
  border-color: rgba(96, 165, 250, 1);
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 1));
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.45);
  transform: translateY(-0.5px);
}

.google-icon {
  position: relative;
  width: 16px;
  height: 16px;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 1px;
}

.google-icon span {
  width: 7px;
  height: 7px;
  border-radius: 2px;
}

.google-icon .g-blue {
  background: #4285f4;
}
.google-icon .g-red {
  background: #ea4335;
}
.google-icon .g-yellow {
  background: #fbbc05;
}
.google-icon .g-green {
  background: #34a853;
}

.schema-badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(55, 65, 81, 0.9);
  color: var(--text-secondary);
}

.form-body {
  overflow-y: auto;
  padding-right: 6px;
}

.schema-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 10px;
  border-radius: 12px;
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.96));
  border: 1px solid rgba(31, 41, 55, 0.95);
}

.form-field-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.field-label {
  font-size: 12px;
  font-weight: 500;
  color: #e5e7eb;
}

.field-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-muted);
}

.field-required {
  color: var(--danger);
  font-weight: 500;
}

.field-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.field-input {
  width: 100%;
  padding: 7px 9px;
  border-radius: 9px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.96);
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease;
}

.field-input::placeholder {
  color: rgba(148, 163, 184, 0.55);
}

.field-input:focus {
  border-color: rgba(56, 189, 248, 0.85);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.6);
  background: rgba(15, 23, 42, 1);
}

.field-input[type="number"] {
  -moz-appearance: textfield;
}

.field-input[type="number"]::-webkit-inner-spin-button,
.field-input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.panel-code {
  background: radial-gradient(circle at top right, #020617, #020617);
}

.code-body {
  padding: 10px;
  gap: 0;
}

.code-editor-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.92));
  border: 1px solid rgba(31, 41, 55, 0.98);
  border-bottom: none;
}

.code-chrome-dots {
  display: flex;
  gap: 5px;
}

.code-chrome-dots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #4b5563;
}

.code-chrome-dots span:nth-child(1) {
  background: #f97373;
}
.code-chrome-dots span:nth-child(2) {
  background: #facc15;
}
.code-chrome-dots span:nth-child(3) {
  background: #22c55e;
}

.code-chrome-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.code-editor {
  margin: 0;
  padding: 10px 12px 12px;
  border-radius: 0 0 14px 14px;
  background: radial-gradient(circle at top left, #020617, #020617);
  border: 1px solid rgba(31, 41, 55, 0.98);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 12px;
  line-height: 1.5;
  color: #e5e7eb;
  overflow: auto;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.9);
}

.code-editor code {
  white-space: pre;
}

.code-line-number {
  display: inline-block;
  width: 24px;
  padding-right: 8px;
  color: #4b5563;
  user-select: none;
}

.token-key {
  color: #93c5fd;
}

.token-string {
  color: #22c55e;
}

.token-punctuation {
  color: #6b7280;
}

.token-boolean,
.token-null,
.token-number {
  color: #facc15;
}

.pill {
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 500;
  border: 1px solid transparent;
}

.pill-success {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.8);
  color: #bbf7d0;
}

.pill-error {
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(248, 113, 113, 0.9);
  color: #fecaca;
}

.code-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Scrollbars */

.schema-list::-webkit-scrollbar,
.form-body::-webkit-scrollbar,
.code-editor::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.schema-list::-webkit-scrollbar-track,
.form-body::-webkit-scrollbar-track,
.code-editor::-webkit-scrollbar-track {
  background: transparent;
}

.schema-list::-webkit-scrollbar-thumb,
.form-body::-webkit-scrollbar-thumb,
.code-editor::-webkit-scrollbar-thumb {
  background: rgba(55, 65, 81, 0.9);
  border-radius: 999px;
}

.schema-list::-webkit-scrollbar-thumb:hover,
.form-body::-webkit-scrollbar-thumb:hover,
.code-editor::-webkit-scrollbar-thumb:hover {
  background: rgba(75, 85, 99, 1);
}

/* Layout responsiveness */

@media (max-width: 1200px) {
  .app-main {
    grid-template-columns: 0.95fr 1.05fr 1.05fr;
  }
}

@media (max-width: 980px) {
  .app-shell {
    padding: 12px;
  }

  .app-main {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(0, auto);
  }

  .panel {
    min-height: 220px;
  }
}

