:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --border: #d7dde5;
  --text: #1f2933;
  --muted: #637083;
  --brand: #095d9d;
  --brand-dark: #064775;
  --success-bg: #eaf7ee;
  --success-text: #276738;
  --error-text: #FF0000;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

a {
  color: var(--brand);
}

.topbar {
  background: var(--brand);
  color: #ffffff;
  border-bottom: 1px solid var(--brand-dark);
}

.topbar-inner {
  width: 90%;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
}

.topbar a {
  color: #ffffff;
}

.topbar-link {
  padding: 0;
  border: 0;
  background: none;
  color: #ffffff;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.container {
  width: 90%;
  margin: 0 auto;
  padding: 24px;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
}

.panel h2,
.panel h1 {
  margin: 0 0 14px;
  font-size: 18px;
}

.subpanel h3 {
  margin: 0;
  font-size: 16px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-header h2 {
  margin: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success-text);
  font-size: 13px;
  font-weight: 600;
}

.status-in-progress {
  background: #e7f1fb;
  color: #0a5b95;
}

.status-succeeded {
  background: #eaf7ee;
  color: #276738;
}

.status-failed {
  background: #fdeceb;
  color: #9f2f24;
}

.status-active-with-errors {
  background: #fff3df;
  color: #8a5200;
}

.status-queued {
  background: #f7f0ff;
  color: #67418c;
}

.status-unknown,
.status-neutral {
  background: #eef2f6;
  color: #415064;
}

.job-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef2f6;
  color: #415064;
  font-weight: 650;
}

.status-query-running,
.status-transfer-submitting,
.status-transfer-submitted,
.status-transfer-in-progress {
  background: #e7f1fb;
  color: #0a5b95;
}

.status-query-complete,
.status-transfer-succeeded {
  background: #eaf7ee;
  color: #276738;
}

.status-query-failed,
.status-transfer-auth-failed,
.status-transfer-failed {
  background: #fdeceb;
  color: #9f2f24;
}

.status-transfer-active-with-errors {
  background: #fff3df;
  color: #8a5200;
}

.status-transfer-queued {
  background: #f7f0ff;
  color: #67418c;
}

.notice {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  background: #ffffff;
}

.notice-success {
  border-color: #9bcda8;
  background: #eaf7ee;
  color: #276738;
}

.notice-error {
  border-color: #e1aaa5;
  background: #fdeceb;
  color: #84271f;
}

.meta {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
}

.meta-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 12px;
}

.meta-row dt {
  color: var(--muted);
}

.meta-row dd {
  margin: 0;
  min-width: 0;
}

code {
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}

form {
  margin: 0;
}

.request-stack {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.subpanel {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}

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

.subpanel-section-header {
  margin-top: 24px;
}

.form-row {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.field-wide {
  grid-column: 1 / -1;
}

.query-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
}

.query-tab {
  flex: 0 0 auto;
  border-color: var(--border);
  background: #ffffff;
  color: var(--brand);
}

.query-tab:hover,
.query-tab.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.query-panel {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f9fbfd;
}

.query-panel[hidden] {
  display: none;
}

.field-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pv-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--brand);
  border-radius: 50%;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  cursor: help;
}

.pv-help-tooltip {
  position: absolute;
  z-index: 10;
  top: 100%;
  left: 0;
  display: none;
  width: 360px;
  max-width: 80vw;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  box-shadow: 0 6px 18px rgb(31 41 51 / 16%);
}

.pv-help:hover .pv-help-tooltip,
.pv-help:focus .pv-help-tooltip,
.pv-help:focus-within .pv-help-tooltip {
  display: block;
}

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

.checkbox-label input {
  min-width: 0;
  min-height: 0;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.inline-form {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.destination-actions {
  display: flex;
  align-items: start;
  flex-direction: column;
  justify-content: start;
  gap: 10px;
  flex-wrap: wrap;
}
.destination-actions .block {
  display: flex;
  align-items: end;
  justify-content: start;
  gap: 10px;
  flex-wrap: wrap;
}

input {
  min-height: 34px;
  min-width: 260px;
  border: 1px solid #b9c3cf;
  border-radius: 4px;
  padding: 6px 9px;
  color: var(--text);
  font: inherit;
}

button,
.button {
  min-height: 34px;
  border: 1px solid var(--brand-dark);
  border-radius: 4px;
  background: var(--brand);
  color: #ffffff;
  padding: 6px 12px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button:hover {
  background: var(--brand-dark);
}

button:disabled,
button:disabled:hover {
  border-color: #c9d2dd;
  background: #e7ecf2;
  color: #6b7787;
  cursor: not-allowed;
}

.button-secondary {
  border-color: var(--border);
  background: #ffffff;
  color: var(--brand);
}

.button-secondary:hover {
  background: #eef5fb;
}

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

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

.helper-error {
  color: #b42318;
}

.result-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.result-item {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  background: #ffffff;
}

.result-title {
  display: block;
  margin-bottom: 4px;
}

.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

@media (max-width: 640px) {
  .topbar-inner,
  .container {
    width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }

  .meta-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  input {
    min-width: 100%;
    width: 100%;
  }

  .form-row {
    align-items: stretch;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .inline-form {
    align-items: stretch;
  }
}
