@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap");

html {
  --radius: 10px;
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1419;
  --surface: #1a222d;
  --surface2: #232d3b;
  --border: #2d3a4d;
  --text: #e7ecf3;
  --muted: #8b9cb3;
  --accent: #2dd4bf;
  --accent-dim: #14a89b;
  --danger: #f87171;
  --row-hover: rgba(45, 212, 191, 0.06);
  --tab-active-bg: rgba(45, 212, 191, 0.1);
  --btn-primary-fg: #04201c;
  --btn-primary-grad-end: #0d8f84;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f0f4f8;
  --surface: #ffffff;
  --surface2: #e8eef5;
  --border: #c5d0df;
  --text: #15202b;
  --muted: #5a6e85;
  --accent: #0d9488;
  --accent-dim: #0f766e;
  --danger: #b91c1c;
  --row-hover: rgba(13, 148, 136, 0.09);
  --tab-active-bg: rgba(13, 148, 136, 0.14);
  --btn-primary-fg: #ffffff;
  --btn-primary-grad-end: #0f766e;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.app {
  max-width: min(100%, 1680px);
  margin: 0 auto;
  padding: 1.25rem 1.25rem 2rem;
}

.header {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.header-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.header-brand {
  flex: 1;
  min-width: min(100%, 280px);
}

.header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.btn-theme {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
}

.btn-theme:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.btn-theme__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-theme__icon svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 62ch;
}

.tagline code {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--accent);
  background: var(--surface2);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.workspace-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.workspace-toolbar__hint strong {
  color: var(--accent);
}

.btn--toolbar {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
}

.workspace-panels {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: min(78vh, 920px);
  gap: 0;
  width: 100%;
}

.workspace-col {
  display: flex;
  flex-direction: column;
  min-width: 200px;
  flex: 1 1 0%;
  min-height: 0;
}

.workspace-col__chrome {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
  margin-bottom: 0.4rem;
  min-height: 2rem;
}

.workspace-col__drag,
.workspace-col__collapse {
  font-family: inherit;
  font-size: 0.75rem;
  line-height: 1;
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  cursor: grab;
}

.workspace-col__collapse {
  cursor: pointer;
}

.workspace-col__drag:active {
  cursor: grabbing;
}

.workspace-col__drag:hover,
.workspace-col__collapse:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
}

.workspace-col__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workspace-col__body > .panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.workspace-col.is-collapsed {
  flex: 0 0 3rem !important;
  min-width: 3rem;
}

.workspace-col.is-collapsed .workspace-col__body {
  display: none;
}

.workspace-col.is-collapsed .workspace-col__chrome {
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
  margin-bottom: 0;
  padding-top: 0.25rem;
}

.workspace-col.is-collapsed .workspace-col__collapse {
  transform: rotate(-90deg);
}

.workspace-col.is-drag-source {
  opacity: 0.88;
}

.workspace-col.is-drop-target {
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
}

.panel-resizer {
  flex: 0 0 8px;
  margin: 0 -4px;
  cursor: col-resize;
  align-self: stretch;
  background: transparent;
  position: relative;
  z-index: 3;
  border-radius: 2px;
  touch-action: none;
}

.panel-resizer:hover,
.panel-resizer.is-active {
  background: var(--accent);
  opacity: 0.35;
}

@media (max-width: 1000px) {
  .workspace-panels {
    flex-direction: column;
    min-height: 0;
  }

  .panel-resizer {
    display: none;
  }

  .workspace-col {
    flex: 1 1 auto !important;
    min-width: 100%;
    min-height: 260px;
  }

  .workspace-col.is-collapsed {
    flex: 0 0 auto !important;
    min-height: 0;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

.panel h2 code {
  font-family: var(--mono);
  font-size: 0.92em;
  color: var(--accent);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.panel-head h2 {
  margin: 0;
}

.panel-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 1rem 0 0.65rem;
}

.sub-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.curl-vars-wrap {
  margin-bottom: 0.5rem;
}

.curl-meta-field {
  margin-top: 0.25rem;
}

.place-section {
  margin-bottom: 1.25rem;
}

.place-section:last-child {
  margin-bottom: 0;
}

.place-section__title {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.place-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.78rem;
  font-family: var(--mono);
}

.place-table th,
.place-table td {
  padding: 0.45rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.place-table th {
  background: var(--surface2);
  color: var(--muted);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}

.place-col-alan {
  width: 22%;
  color: var(--muted);
}

.place-table code {
  display: inline-block;
  vertical-align: top;
  padding: 0.2rem 0.35rem;
  background: var(--surface2);
  border-radius: 4px;
  color: var(--accent);
  font-size: 0.76rem;
  white-space: pre;
  overflow-x: auto;
  max-width: 100%;
  word-break: normal;
}

.badge {
  font-family: var(--mono);
  font-size: 0.75rem;
  background: var(--surface2);
  color: var(--accent);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.field {
  margin-bottom: 0.85rem;
}

.field label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.field--inline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}

.field--inline label {
  margin-bottom: 0.35rem;
}

.field--inline .ml {
  margin-left: 0;
}

select,
textarea,
.input-sm {
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 100%;
}

select {
  padding: 0.45rem 0.6rem;
  max-width: 100%;
}

.field--inline select {
  width: auto;
  min-width: 120px;
}

#placeholder-fmt {
  min-width: 12.5rem;
  padding-left: 0.65rem;
  padding-right: 2rem;
  font-family: var(--mono);
  font-size: 0.85rem;
}

textarea {
  resize: vertical;
  min-height: 180px;
  padding: 0.65rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.45;
}

.textarea-compact {
  min-height: 5.5rem;
  font-size: 0.8rem;
}

.input-sm {
  padding: 0.45rem 0.6rem;
  flex: 1;
  min-width: 140px;
  max-width: 220px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap:0.5rem;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text);
}

.checkbox input {
  accent-color: var(--accent);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.row-actions--wrap {
  flex-wrap: wrap;
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.btn {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
}

.btn:hover:not(:disabled) {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  background: linear-gradient(180deg, var(--accent-dim), var(--btn-primary-grad-end));
  border-color: var(--accent);
  color: var(--btn-primary-fg);
}

html[data-theme="dark"] .btn--primary:hover:not(:disabled) {
  color: #021512;
  filter: brightness(1.06);
}

html[data-theme="light"] .btn--primary:hover:not(:disabled) {
  filter: brightness(1.05);
}

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

.status--err {
  color: var(--danger);
}

.status--ok {
  color: var(--accent);
}

.table-wrap {
  overflow: auto;
  max-height: min(52vh, 520px);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.var-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  font-family: var(--mono);
}

.var-table th,
.var-table td {
  padding: 0.45rem 0.55rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.var-table th {
  background: var(--surface2);
  color: var(--muted);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}

.var-table tbody tr:hover {
  background: var(--row-hover);
}

.col-on {
  width: 52px;
  text-align: center;
}

.var-table input[type="text"] {
  width: 100%;
  min-width: 120px;
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.var-table input[type="checkbox"] {
  accent-color: var(--accent);
}

.value-cell {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.placeholder-row td {
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.85rem;
  text-align: center;
  padding: 1.25rem;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.tab {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.65rem;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--tab-active-bg);
}

.tab-panels {
  position: relative;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.code-out {
  margin: 0;
  min-height: 200px;
  max-height: min(48vh, 480px);
  overflow: auto;
  padding: 0.75rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre;
  word-break: normal;
}

.out-actions {
  margin-top: 0.65rem;
}

.xray-wrap {
  min-height: 200px;
  max-height: min(48vh, 480px);
  overflow: auto;
  padding: 0.5rem 0.65rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.xray-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  font-family: var(--mono);
}

.xray-table th,
.xray-table td {
  padding: 0.55rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.xray-table th {
  position: sticky;
  top: 0;
  background: var(--surface2);
  color: var(--muted);
  font-weight: 600;
  z-index: 1;
}

.xray-table th:first-child {
  width: 32%;
}

.xray-line {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
  flex-wrap: nowrap;
  min-width: 0;
}

.xray-line:last-child {
  margin-bottom: 0;
}

.xray-line code {
  flex: 1;
  min-width: 0;
  padding: 0.25rem 0.4rem;
  background: var(--surface2);
  border-radius: 6px;
  color: var(--accent);
  font-size: 0.76rem;
  white-space: pre;
  overflow-x: auto;
  word-break: normal;
}

.xray-id-val {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.25rem 0.4rem;
  background: var(--surface2);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.76rem;
  white-space: pre;
  overflow-x: auto;
  word-break: normal;
}

.xray-id-cell {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  min-width: 0;
}

.btn-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--muted);
  cursor: pointer;
}

.btn-icon:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
}

.btn-icon svg {
  width: 1rem;
  height: 1rem;
}

.xray-placeholder {
  margin: 0;
  padding: 1.25rem;
  text-align: center;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.88rem;
}

.footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

.footer code {
  font-family: var(--mono);
  color: var(--accent);
}
