:root {
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: #ecf1ff;
  background: #080b12;
  font-synthesis: none;
  --panel: rgba(18, 23, 35, 0.86);
  --panel-border: rgba(255, 255, 255, 0.08);
  --muted: #919bb0;
  --accent: #f48120;
  --accent-strong: #ff9a43;
  --success: #43d39e;
  --danger: #ff647c;
  --blue: #6aa8ff;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 0%, rgba(244, 129, 32, 0.12), transparent 30rem),
    radial-gradient(circle at 85% 18%, rgba(83, 116, 255, 0.1), transparent 32rem),
    #080b12;
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 42px;
  padding: 0 18px;
  color: #12151c;
  font-weight: 700;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease;
}

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

button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.5);
  opacity: 0.5;
  transform: none;
}

button.secondary {
  color: #dfe6f7;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.04);
}

button.danger {
  color: #ffc8d1;
  border: 1px solid rgba(255, 100, 124, 0.25);
  background: rgba(255, 100, 124, 0.1);
}

.shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0 96px;
}

.hero {
  margin-bottom: 34px;
}

.hero-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.22em;
}

.help-trigger {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  color: #dfe6f7;
  font-size: 0.78rem;
}

.help-trigger span {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: var(--accent-strong);
  border: 1px solid rgba(244, 129, 32, 0.3);
  border-radius: 50%;
  font-size: 0.72rem;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.8rem, 8vw, 5.4rem);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

h2 {
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.hero p {
  max-width: 650px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.panel {
  margin-bottom: 18px;
  padding: 24px;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(18px);
}

.auth-panel,
.panel-heading,
.section-heading,
.form-actions,
.job-header,
.job-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.auth-form {
  display: flex;
  width: min(460px, 100%);
  gap: 10px;
}

.auth-form input {
  flex: 1;
}

.muted {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
}

.badge.offline {
  color: #aeb6c8;
  background: rgba(255, 255, 255, 0.06);
}

.badge.online,
.badge.ready {
  color: #83f3c9;
  background: rgba(67, 211, 158, 0.12);
}

.badge.public {
  color: #ffd0a8;
  border: 1px solid rgba(244, 129, 32, 0.18);
  background: rgba(244, 129, 32, 0.09);
}

.badge.error,
.badge.canceled {
  color: #ff9aac;
  background: rgba(255, 100, 124, 0.12);
}

.badge.downloading,
.badge.probing,
.badge.queued,
.badge.uploading {
  color: #a8c9ff;
  background: rgba(106, 168, 255, 0.12);
}

.job-form {
  display: grid;
  margin-top: 24px;
  gap: 18px;
}

.upload-form {
  display: grid;
  margin-top: 24px;
  gap: 18px;
}

.file-picker {
  position: relative;
  min-height: 112px;
  padding: 20px;
  place-content: center;
  text-align: center;
  border: 1px dashed rgba(244, 129, 32, 0.32);
  border-radius: 13px;
  background: rgba(244, 129, 32, 0.035);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.file-picker:hover,
.file-picker:focus-within {
  border-color: rgba(244, 129, 32, 0.68);
  background: rgba(244, 129, 32, 0.065);
}

.file-picker-title {
  color: #f2f5ff;
  font-size: 1rem;
  font-weight: 750;
}

.file-picker input[type="file"] {
  width: min(420px, 100%);
  margin: 4px auto 0;
  padding: 7px;
  color: var(--muted);
  border: 0;
  background: transparent;
}

.file-picker input[type="file"]::file-selector-button {
  min-height: 32px;
  margin-right: 10px;
  padding: 0 11px;
  color: #dfe6f7;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.upload-progress-wrap {
  padding: 14px 15px 5px;
  border: 1px solid var(--panel-border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
}

.upload-progress-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #cbd5e9;
  font-size: 0.8rem;
}

.upload-progress {
  margin: 11px 0 8px;
}

label {
  display: grid;
  gap: 8px;
  color: #cfd7e8;
  font-size: 0.86rem;
  font-weight: 650;
}

input,
textarea {
  width: 100%;
  color: #eef3ff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  outline: none;
  background: rgba(5, 8, 15, 0.65);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input {
  min-height: 44px;
  padding: 0 13px;
}

textarea {
  padding: 12px 13px;
  line-height: 1.5;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: rgba(244, 129, 32, 0.75);
  box-shadow: 0 0 0 3px rgba(244, 129, 32, 0.1);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 18px;
}

.checkbox-label {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.checkbox-label input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

.jobs-section {
  margin-top: 42px;
}

.section-heading {
  margin-bottom: 16px;
}

.jobs {
  display: grid;
  gap: 12px;
}

.job-card {
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: 15px;
  background: rgba(17, 22, 34, 0.72);
}

.job-title {
  min-width: 0;
}

.job-title strong {
  display: block;
  overflow: hidden;
  font-size: 0.96rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-id {
  margin-top: 4px;
  color: #68738a;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
}

.progress {
  height: 7px;
  margin: 18px 0 10px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
}

.progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #ffbd67);
  transition: width 300ms ease;
}

.job-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 0.78rem;
}

.job-footer {
  margin-top: 16px;
  align-items: flex-end;
}

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

.job-actions button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.78rem;
}

.empty-state {
  padding: 56px 24px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 15px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100% - 48px));
  padding: 13px 16px;
  color: #f7f9ff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: #20283a;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.help-dialog {
  width: min(780px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  color: #ecf1ff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0%, rgba(244, 129, 32, 0.1), transparent 24rem),
    #0e131e;
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.62);
}

.help-dialog::backdrop {
  background: rgba(3, 5, 10, 0.76);
  backdrop-filter: blur(7px);
}

.help-dialog[open] {
  animation: help-dialog-in 180ms ease-out;
}

.help-header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(14, 19, 30, 0.94);
  backdrop-filter: blur(18px);
}

.help-header .eyebrow {
  margin-bottom: 6px;
}

.help-header h2 {
  margin-bottom: 6px;
  font-size: 1.45rem;
  letter-spacing: -0.025em;
}

.help-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.help-close {
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0 0 2px;
  color: #cdd5e7;
  font-size: 1.55rem;
  line-height: 1;
}

.help-body {
  max-height: calc(100vh - 148px);
  padding: 0 28px 36px;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.help-nav {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  margin: 0 -4px;
  padding: 14px 4px;
  overflow-x: auto;
  gap: 7px;
  background: linear-gradient(#0e131e 75%, transparent);
}

.help-nav a {
  flex: 0 0 auto;
  padding: 7px 10px;
  color: #aab5ca;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
}

.help-nav a:hover,
.help-nav a:focus-visible {
  color: #fff;
  border-color: rgba(244, 129, 32, 0.4);
  outline: none;
}

.help-section {
  padding: 32px 0 10px;
  scroll-margin-top: 62px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.help-section:last-child {
  border-bottom: 0;
}

.help-section-heading {
  display: flex;
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 13px;
}

.help-section-heading h3 {
  margin: 0 0 5px;
  font-size: 1.08rem;
}

.help-section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.help-step {
  display: inline-grid;
  min-width: 34px;
  height: 26px;
  place-items: center;
  color: var(--accent-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
  font-weight: 800;
  border: 1px solid rgba(244, 129, 32, 0.24);
  border-radius: 999px;
  background: rgba(244, 129, 32, 0.08);
}

.help-note {
  display: grid;
  grid-template-columns: auto 1fr;
  margin-bottom: 18px;
  padding: 13px 15px;
  gap: 12px;
  color: #cbd5e9;
  font-size: 0.8rem;
  line-height: 1.6;
  border: 1px solid rgba(106, 168, 255, 0.17);
  border-radius: 10px;
  background: rgba(106, 168, 255, 0.07);
}

.help-note strong {
  color: #a8c9ff;
}

.help-note.subtle {
  margin-top: 14px;
  border-color: var(--panel-border);
  background: rgba(255, 255, 255, 0.025);
}

.help-note.subtle strong {
  color: #cbd5e9;
}

.help-dialog code {
  color: #ffd0a8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
}

.code-block {
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: #080c14;
}

.code-toolbar {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 14px;
  color: #7f8aa1;
  font-size: 0.72rem;
  font-weight: 750;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.025);
}

.copy-code {
  min-height: 28px;
  padding: 0 10px;
  font-size: 0.7rem;
}

.code-block pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  color: #d8e1f2;
  font-size: 0.76rem;
  line-height: 1.65;
  tab-size: 2;
}

.code-block pre code {
  color: inherit;
  font-size: inherit;
}

.help-caption {
  margin: 10px 0 20px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

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

.help-mini-card {
  padding: 14px;
  border: 1px solid var(--panel-border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
}

.help-mini-card.recommended {
  border-color: rgba(67, 211, 158, 0.2);
  background: rgba(67, 211, 158, 0.055);
}

.help-mini-card h4 {
  margin: 0 0 7px;
  font-size: 0.82rem;
}

.help-mini-card.recommended h4 {
  color: #83f3c9;
}

.help-mini-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.api-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
}

.api-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.api-table th,
.api-table td {
  padding: 11px 13px;
  font-size: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.api-table tr:last-child td {
  border-bottom: 0;
}

.api-table th {
  color: #7f8aa1;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.025);
}

.api-table td {
  color: #b9c4d8;
}

.api-table td:nth-child(2) {
  white-space: nowrap;
}

.fields-table td:nth-child(2) {
  color: #8592a9;
}

.method {
  display: inline-flex;
  min-width: 48px;
  justify-content: center;
  padding: 3px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.66rem;
  font-weight: 850;
  border-radius: 5px;
}

.method.get,
.method.head {
  color: #a8c9ff;
  background: rgba(106, 168, 255, 0.1);
}

.method.post {
  color: #83f3c9;
  background: rgba(67, 211, 158, 0.1);
}

.method.put {
  color: #ffd0a8;
  background: rgba(244, 129, 32, 0.1);
}

.method.delete {
  color: #ff9aac;
  background: rgba(255, 100, 124, 0.1);
}

.status-flow {
  display: flex;
  margin-top: 18px;
  align-items: center;
  overflow-x: auto;
  gap: 8px;
}

.status-flow span {
  flex: 0 0 auto;
  padding: 6px 9px;
  color: #a8c9ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
  border-radius: 6px;
  background: rgba(106, 168, 255, 0.09);
}

.status-flow span.success {
  color: #83f3c9;
  background: rgba(67, 211, 158, 0.1);
}

.status-flow i {
  color: #5b6579;
  font-style: normal;
}

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

.help-list li {
  position: relative;
  padding-left: 19px;
  color: #b9c4d8;
  font-size: 0.8rem;
  line-height: 1.6;
}

.help-list li::before {
  position: absolute;
  top: 0.62em;
  left: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

@keyframes help-dialog-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 980px);
    padding-top: 44px;
  }

  .panel {
    padding: 18px;
  }

  .auth-panel,
  .panel-heading,
  .form-actions,
  .job-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .auth-form {
    width: 100%;
  }

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

  .job-footer {
    gap: 12px;
  }

  .job-actions {
    justify-content: flex-start;
  }

  .help-dialog {
    width: calc(100vw - 12px);
    max-height: calc(100vh - 12px);
    border-radius: 16px;
  }

  .help-header {
    padding: 20px 18px 17px;
  }

  .help-header p {
    max-width: 240px;
  }

  .help-body {
    max-height: calc(100vh - 125px);
    padding: 0 18px 28px;
  }

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

  .help-note {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .api-table {
    min-width: 610px;
  }

  .fields-table {
    min-width: 640px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
