:root {
  --bg: #f6f1e8;
  --panel: #fffaf2;
  --panel-strong: #fbf6ec;
  --line: rgba(29, 42, 64, 0.12);
  --ink: #1d2a40;
  --muted: #6f7b8c;
  --primary: #0d7c66;
  --primary-strong: #0b6855;
  --save: #2f6df6;
  --save-strong: #1f59d6;
  --accent: #cf7c31;
  --danger: #b13e3e;
  --danger-soft: rgba(177, 62, 62, 0.12);
  --shadow: 0 18px 48px rgba(18, 28, 45, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Avenir Next", "Helvetica Neue", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(207, 124, 49, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(13, 124, 102, 0.14), transparent 30%),
    var(--bg);
}

body {
  min-height: 100vh;
}

body.dialog-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
}

.hidden {
  display: none !important;
}

.boot-view {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 32px;
}

.hero {
  width: min(1120px, 100%);
  display: grid;
  gap: 24px;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
}

.hero-copy {
  padding: 32px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  letter-spacing: 0.18em;
  font-size: 12px;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0 0 12px;
}

h1 {
  font-size: clamp(38px, 5vw, 68px);
  line-height: 0.95;
}

.hero-text,
.muted {
  color: var(--muted);
}

.card {
  background: rgba(255, 250, 242, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.auth-card {
  padding: 28px;
}

.stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  color: var(--ink);
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 48px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) calc(50% - 3px),
    calc(100% - 14px) calc(50% - 3px);
  background-size: 8px 8px, 8px 8px;
  background-repeat: no-repeat;
}

input:disabled,
select:disabled,
textarea:disabled {
  color: rgba(29, 42, 64, 0.66);
  background: rgba(29, 42, 64, 0.05);
  cursor: not-allowed;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(13, 124, 102, 0.5);
  box-shadow: 0 0 0 4px rgba(13, 124, 102, 0.09);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

button:hover {
  transform: translateY(-1px);
}

.primary {
  background: var(--save);
  color: #fff;
  box-shadow: 0 12px 24px rgba(47, 109, 246, 0.24);
}

.primary:hover {
  background: var(--save-strong);
}

.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.danger,
button[data-action="delete"],
.drawer-close {
  border: 1px solid rgba(177, 62, 62, 0.18);
  background: var(--danger-soft);
  color: var(--danger);
}

.danger:hover,
button[data-action="delete"]:hover,
.drawer-close:hover {
  background: rgba(177, 62, 62, 0.18);
}

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  overflow: hidden;
}

.sidebar {
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16, 29, 52, 0.94), rgba(20, 43, 57, 0.98));
  color: #f4eee4;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  overflow: auto;
}

.sidebar .eyebrow,
.sidebar .muted {
  color: rgba(244, 238, 228, 0.7);
}

.menu {
  display: grid;
  align-content: start;
  gap: 12px;
}

.menu-item {
  text-align: left;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.06);
  color: #fdf9f2;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.12);
}

.main {
  min-height: 0;
  overflow: hidden;
}

.workspace {
  height: 100%;
  padding: 22px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
  min-height: 0;
  overflow: hidden;
}

.sidebar-user {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
}

.sidebar-user .eyebrow {
  margin-bottom: 10px;
}

.sidebar-user-name {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff6e8;
  margin-bottom: 8px;
  word-break: break-word;
}

.sidebar-user-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.sidebar-user-actions .ghost {
  width: 100%;
  color: #fff6e8;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-user-actions .ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

.tabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tab-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fffaf2;
  border: 1px solid var(--line);
  color: var(--ink);
}

.tab-button.active {
  background: var(--ink);
  color: #fffdf8;
}

.tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  font-size: 12px;
}

.tab-button.active .tab-close {
  background: rgba(255, 255, 255, 0.12);
}

.tab-panels {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.tab-panel {
  display: none;
  min-height: 0;
}

.tab-panel.active {
  display: block;
  height: 100%;
  overflow: hidden;
}

.panel-card {
  padding: 18px;
  background: rgba(255, 250, 242, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.list-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.section-grid {
  display: grid;
  gap: 16px;
}

.section-grid.two {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.compact-toolbar {
  margin-bottom: 8px;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.drawer-header-toolbar {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.tiny-action {
  padding: 7px 11px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.2;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 12px;
  margin-bottom: 14px;
}

.filter-actions {
  display: flex;
  align-items: flex-end;
}

.table-shell {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(29, 42, 64, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  line-height: 1.5;
}

.data-table th {
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(255, 250, 242, 0.97);
  box-shadow: inset 0 -1px 0 var(--line);
}

.data-table td > *:first-child:last-child {
  margin-top: 0;
  margin-bottom: 0;
}

.data-table tbody tr:hover {
  background: rgba(13, 124, 102, 0.05);
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 40px;
}

.inline-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
}

.result-set-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.param-card-grid {
  --param-card-title-size: 14px;
  --param-card-state-size: 15px;
  --param-card-label-size: 13px;
  --param-card-input-size: 15px;
  --param-card-button-size: 14px;
  display: grid;
  grid-template-columns: repeat(var(--param-grid-cols, 1), minmax(0, 1fr));
  gap: 10px;
}

.param-card-grid[data-cols="2"] {
  --param-card-title-size: 13px;
  --param-card-state-size: 14px;
  --param-card-label-size: 12px;
  --param-card-input-size: 14px;
  --param-card-button-size: 13px;
}

.param-card-grid[data-cols="3"] {
  --param-card-title-size: 12.5px;
  --param-card-state-size: 13.5px;
  --param-card-label-size: 12px;
  --param-card-input-size: 14px;
  --param-card-button-size: 13px;
}

.param-card-grid[data-cols="4"] {
  --param-card-title-size: 12px;
  --param-card-state-size: 13px;
  --param-card-label-size: 11px;
  --param-card-input-size: 13px;
  --param-card-button-size: 12px;
}

.param-card {
  display: grid;
  gap: 5px;
  padding: 9px;
  border: 1px solid rgba(29, 42, 64, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  align-content: start;
}

.param-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: nowrap;
}

.param-card-head-left,
.param-card-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  min-width: 0;
}

.param-card-title {
  font-size: var(--param-card-title-size);
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.param-card-required {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: var(--param-card-state-size);
  font-weight: 600;
  white-space: nowrap;
}

.param-card-required input[type="checkbox"] {
  width: 13px;
  height: 13px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--primary);
}

.param-card-required-state {
  line-height: 1;
}

.param-card-field {
  display: grid;
  gap: 2px;
}

.param-card-field > span:first-child {
  font-size: var(--param-card-label-size);
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.param-card-meta {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.param-card input,
.param-card select,
.param-card textarea {
  padding: 6px 9px;
  min-height: 34px;
  border-radius: 9px;
  font-size: var(--param-card-input-size);
}

.json-example-field textarea {
  min-height: 74px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.param-card .custom-select-trigger {
  min-height: 34px;
  padding: 6px 9px;
  border-radius: 9px;
  gap: 7px;
}

.param-card .custom-select-label {
  font-size: var(--param-card-input-size);
}

.param-card .ghost,
.param-card .danger {
  min-height: 26px;
  padding: 4px 7px;
  border-radius: 8px;
  font-size: var(--param-card-button-size);
  line-height: 1.1;
  white-space: nowrap;
}

.result-set-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(29, 42, 64, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
}

.result-set-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.result-set-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.result-set-card .danger {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.status-pill {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(13, 124, 102, 0.1);
  color: var(--primary-strong);
}

.status-pill.paused {
  background: rgba(177, 62, 62, 0.12);
  color: var(--danger);
}

.helper {
  font-size: 13px;
  color: var(--muted);
}

.native-select-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.custom-select {
  position: relative;
}

.custom-select-trigger {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: none;
}

.custom-select-trigger:hover {
  transform: none;
}

.custom-select-trigger:focus {
  outline: none;
  border-color: rgba(13, 124, 102, 0.5);
  box-shadow: 0 0 0 4px rgba(13, 124, 102, 0.09);
}

.custom-select-label {
  flex: 1;
  text-align: left;
}

.custom-select-label.placeholder {
  color: var(--muted);
}

.custom-select-caret {
  width: 12px;
  height: 12px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.7;
  flex-shrink: 0;
}

.custom-select.open .custom-select-caret {
  transform: rotate(-135deg) translateY(-1px);
}

.custom-select.disabled .custom-select-trigger {
  color: rgba(29, 42, 64, 0.66);
  background: rgba(29, 42, 64, 0.05);
  cursor: not-allowed;
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(29, 42, 64, 0.12);
  border-radius: 16px;
  background: rgba(255, 250, 242, 0.98);
  box-shadow: 0 18px 36px rgba(18, 28, 45, 0.14);
  backdrop-filter: blur(8px);
}

.custom-select-option {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  background: transparent;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.custom-select-option:hover {
  transform: none;
  background: rgba(13, 124, 102, 0.08);
}

.custom-select-option.selected {
  background: rgba(13, 124, 102, 0.12);
  color: var(--primary-strong);
}

.custom-select-option[data-disabled="true"] {
  color: var(--muted);
  cursor: not-allowed;
}

.custom-select-option-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.editor-grid {
  display: grid;
  gap: 12px;
}

.compact-grid {
  gap: 8px;
}

.compact-grid > label {
  align-content: start;
}

.compact-grid > label > span:first-child {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
}

.guide-card {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(29, 42, 64, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.compact-guide {
  margin-top: -2px;
}

.inline-guide {
  margin-bottom: 14px;
}

.field-help-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.compact-help-row {
  justify-content: flex-start;
  padding: 0;
}

.guide-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.guide-item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px dashed rgba(29, 42, 64, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
}

.guide-item h4 {
  margin: 0;
  font-size: 15px;
}

.guide-code {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: #181d28;
  color: #eaf5f2;
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.grid-2 {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-4 {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-span-2 {
  grid-column: span 2;
}

.grid-span-3 {
  grid-column: span 3;
}

.sql-response-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.86fr) minmax(0, 1fr);
  align-items: stretch;
}

.editor-split-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
}

.editor-inline-field {
  display: block;
  gap: 8px;
}

.sql-response-grid .compact-toolbar {
  min-height: 56px;
  margin-bottom: 0;
}

.editor-inline-field textarea {
  min-height: 260px;
}

.sql-response-grid .editor-inline-field textarea {
  height: 260px;
  min-height: 260px;
}

.compact-side-toolbar {
  justify-content: flex-start;
}

.checkbox-list {
  display: grid;
  gap: 10px;
  max-height: 240px;
  overflow: auto;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.checkbox-item {
  display: flex;
  gap: 10px;
  align-items: center;
}

.compact-checkbox-item {
  min-height: 48px;
  justify-content: space-between;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  align-self: end;
}

.compact-checkbox-item > span {
  font-size: 14px;
  color: var(--ink);
}

.checkbox-inline {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.checkbox-item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  accent-color: var(--primary);
}

.permission-list {
  gap: 12px;
}

.permission-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px dashed rgba(29, 42, 64, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.permission-text {
  line-height: 1.5;
  word-break: break-word;
}

.message {
  max-width: 1120px;
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(13, 124, 102, 0.1);
  color: var(--primary-strong);
}

.system-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.system-config-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(29, 42, 64, 0.1);
  background: rgba(255, 255, 255, 0.62);
}

.json-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  background: #181d28;
  color: #eaf5f2;
  font-family: "SFMono-Regular", "Menlo", monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.json-box.compact {
  margin-top: 8px;
  max-height: 280px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.6;
}

.log-viewer {
  display: grid;
  gap: 16px;
}

.job-step-list,
.job-run-viewer,
.job-run-detail {
  display: grid;
  gap: 14px;
}

.job-step-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(29, 42, 64, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.64);
}

.job-step-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
}

.job-step-config,
.job-json-grid {
  display: grid;
  gap: 10px;
}

.job-json-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.job-step-config textarea {
  min-height: 108px;
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 12px;
  line-height: 1.6;
}

.log-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.log-summary-card,
.log-entry-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(29, 42, 64, 0.1);
  background: rgba(255, 255, 255, 0.62);
}

.log-entry-list {
  display: grid;
  gap: 14px;
}

.log-entry-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.log-entry-head h4 {
  margin: 0 0 6px;
}

.log-entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.log-entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(18, 28, 45, 0.4);
  backdrop-filter: blur(8px);
}

.dialog-shell {
  width: min(520px, 100%);
  padding: 24px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background:
    radial-gradient(circle at top right, rgba(207, 124, 49, 0.15), transparent 34%),
    rgba(255, 250, 242, 0.96);
  box-shadow: 0 24px 60px rgba(18, 28, 45, 0.22);
}

.dialog-shell.wide {
  width: min(920px, 100%);
}

.dialog-head {
  margin-bottom: 14px;
}

.dialog-head .eyebrow {
  margin-bottom: 8px;
}

.dialog-body {
  color: var(--ink);
  line-height: 1.7;
  white-space: pre-wrap;
}

.dialog-body.rich {
  white-space: normal;
}

.sql-example-list {
  display: grid;
  gap: 14px;
  padding-bottom: 8px;
}

.sql-example-card {
  padding: 16px;
  border: 1px solid rgba(29, 42, 64, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  overflow: hidden;
}

.sql-example-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.sql-example-head h4 {
  margin: 0 0 6px;
}

.sql-example-copy {
  flex-shrink: 0;
}

.sql-example-code {
  margin: 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: #18202b;
  color: #edf7f4;
  width: 100%;
  max-width: 100%;
  overflow: auto;
  font-size: 13px;
  line-height: 1.7;
  font-family: "SFMono-Regular", "Menlo", monospace;
}

.dialog-prompt {
  margin-top: 16px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 1800;
  background: rgba(18, 28, 45, 0.28);
  backdrop-filter: blur(4px);
}

.drawer-shell {
  position: absolute;
  top: 0;
  right: 0;
  width: min(720px, 100%);
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  background:
    radial-gradient(circle at top right, rgba(207, 124, 49, 0.14), transparent 28%),
    rgba(255, 250, 242, 0.98);
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 50px rgba(18, 28, 45, 0.18);
}

.drawer-shell.wide {
  width: min(70vw, 1440px);
  max-width: 100%;
}

.drawer-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 16px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.drawer-head-actions {
  min-width: 0;
}

.drawer-head-main {
  min-width: 0;
  text-align: center;
}

.drawer-head-main h3 {
  margin: 0;
}

.drawer-head-main .helper {
  margin-top: 4px;
}

.drawer-close {
  flex-shrink: 0;
  justify-self: end;
}

.drawer-body {
  overflow: auto;
  padding: 16px 20px 22px;
}

.drawer-body .panel-card {
  padding: 16px;
}

.drawer-body .data-table th,
.drawer-body .data-table td {
  padding: 10px 8px;
}

.api-editor-form {
  min-height: 100%;
}

.api-editor-form .toolbar h3 {
  font-size: 18px;
  margin-bottom: 4px;
}

.api-editor-form .toolbar .ghost {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
}

.api-editor-form .toolbar .tiny-action,
.drawer-header-toolbar .tiny-action {
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 12px;
}

.api-editor-form .toolbar-actions {
  gap: 8px;
}

@media (max-width: 980px) {
  .hero,
  .app-shell,
  .section-grid.two,
  .grid-2,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .sql-response-grid {
    grid-template-columns: 1fr;
  }

  .param-card-grid,
  .result-set-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .log-summary-grid,
  .log-entry-grid,
  .job-json-grid {
    grid-template-columns: 1fr;
  }

  .grid-span-2,
  .grid-span-3 {
    grid-column: auto;
  }

  .log-entry-head {
    flex-direction: column;
  }

  .sql-example-head {
    flex-direction: column;
  }

  .sql-example-copy {
    width: 100%;
  }

  .drawer-head {
    grid-template-columns: 1fr;
  }

  .drawer-head-actions,
  .drawer-close {
    justify-self: stretch;
  }

  .drawer-head-main {
    order: -1;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .app-shell {
    grid-template-rows: auto 1fr;
  }
}

@media (max-width: 640px) {
  .param-card-grid,
  .result-set-grid {
    grid-template-columns: 1fr;
  }

  .param-card-meta {
    grid-template-columns: 1fr;
  }

  .param-card-head {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .param-card-head-left,
  .param-card-head-actions {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .job-step-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
