:root {
  --ink: #172033;
  --ink-soft: #3b4a61;
  --muted: #6b7c93;
  --muted-2: #94a3b8;
  --line: #e3eaf2;
  --line-strong: #cbd5e1;
  --bg: #f2f6fb;
  --card: #ffffff;
  --brand: #0f2a44;
  --brand-2: #0d9488;
  --brand-3: #14b8a6;
  --blue: #1d4ed8;
  --ok: #047857;
  --ok-bg: #ecfdf5;
  --warn: #a16207;
  --warn-bg: #fffbeb;
  --err: #b91c1c;
  --err-bg: #fef2f2;
  --shadow-sm: 0 2px 8px rgba(15, 42, 68, .045);
  --shadow: 0 20px 50px rgba(15, 42, 68, .08);
  --radius: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
a { color: inherit; }
code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #eef2f7;
  color: #334155;
  font-family: Consolas, "Cascadia Mono", "Courier New", monospace;
  font-size: .92em;
}
.page-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(800px 500px at 8% -8%, rgba(20, 184, 166, .13), transparent 60%),
    radial-gradient(760px 460px at 96% 4%, rgba(29, 78, 216, .09), transparent 60%),
    linear-gradient(180deg, #f7faff 0%, #f2f6fb 60%, #eef3f9 100%);
}
.app { width: min(1500px, 100%); margin: 0 auto; padding: 18px 24px 34px; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 8px 4px 20px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  flex: none;
  border-radius: 13px;
  color: #d7fff9;
  background: linear-gradient(145deg, #0f2a44, #0f766e);
  box-shadow: 0 8px 20px rgba(15, 42, 68, .18);
}
.brand-mark svg { width: 27px; height: 27px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { font-size: 17px; letter-spacing: .01em; }
.brand-text span { margin-top: 2px; color: var(--muted); font-size: 11.5px; letter-spacing: .08em; }
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.engine-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid #d8e4ef;
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.engine-badge.ok { color: #065f46; border-color: #a7f3d0; background: #ecfdf5; }
.engine-badge.bad { color: #9f1239; border-color: #fecdd3; background: #fff1f2; }
.engine-dot { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; }
.engine-badge.ok .engine-dot { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .16); }
.engine-badge.bad .engine-dot { background: #f43f5e; }
.engine-badge.checking .engine-dot { animation: pulse 1.2s infinite; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-sm { padding: 6px 11px; border-radius: 8px; font-size: 12.5px; }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #0f766e, #0d9488);
  box-shadow: 0 6px 16px rgba(13, 148, 136, .23);
}
.btn-primary:hover { box-shadow: 0 9px 22px rgba(13, 148, 136, .3); }
.btn-ghost { border-color: var(--line-strong); background: rgba(255, 255, 255, .78); }
.btn-ghost:hover { border-color: #94a3b8; background: #fff; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.icon-btn:hover { background: #eef3f8; color: var(--ink); }
.icon-btn.danger:hover { background: #fef2f2; color: var(--err); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- layout */
.layout {
  display: grid;
  grid-template-columns: minmax(350px, 420px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.left-column { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.workbench { min-width: 0; }
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.upload-panel { padding: 20px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-head.compact { align-items: center; padding: 17px 18px 13px; }
.eyebrow {
  margin: 0;
  color: var(--brand-2);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.panel-head h2 { margin: 1px 0 0; font-size: 18px; font-weight: 680; letter-spacing: -.01em; }
.step-pill {
  padding: 4px 9px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
}

/* ---------------------------------------------------------------- upload */
.drop-grid { display: grid; gap: 10px; margin-top: 17px; }
.dropzone {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 13px 14px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  background: #fbfdff;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--brand-3);
  background: #f0fdfa;
}
.dropzone.dragover { box-shadow: 0 0 0 4px rgba(20, 184, 166, .1); }
.dropzone.has-file {
  border-style: solid;
  border-color: #99f6e4;
  background: linear-gradient(135deg, #f0fdfa, #f8fffe);
}
.dz-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 11px;
  color: #0f766e;
  background: #ccfbf1;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.dz-icon.syntax { color: #1e40af; background: #dbeafe; }
.dz-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.dz-title { font-size: 13.5px; font-weight: 650; }
.dz-hint { margin-top: 3px; color: var(--muted); font-size: 11.5px; }
.dz-file {
  display: none;
  margin-top: 4px;
  color: #0f766e;
  font-size: 11.5px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.dropzone.has-file .dz-file { display: block; }
.dropzone.has-file .dz-hint { display: none; }
.dz-check {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .16s ease, transform .16s ease;
}
.dropzone.has-file .dz-check { opacity: 1; transform: scale(1); }
.form-hint {
  margin: 9px 2px 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}
.form-hint.bad { color: var(--err); }
.field-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 8px 10px;
  margin-top: 14px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}
.field-row label { color: var(--ink-soft); font-size: 12.5px; font-weight: 600; }
.field-row input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  outline: none;
}
.field-row input:focus { border-color: var(--brand-3); box-shadow: 0 0 0 3px rgba(20, 184, 166, .12); }
.field-note { grid-column: 2; color: var(--muted-2); font-size: 10.5px; }
.alert {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 12.5px;
  line-height: 1.55;
}
.alert.error { border-color: #fecaca; background: var(--err-bg); color: #7f1d1d; }
#formAlert { white-space: pre-line; }
.alert.warn { border-color: #fde68a; background: var(--warn-bg); color: #78350f; }
.alert.info { border-color: #a5f3fc; background: #ecfeff; color: #155e75; }
.alert-head { display: flex; flex-direction: column; gap: 2px; }
.alert-head strong { font-size: 12.5px; }
.alert details { margin-top: 8px; }
.alert summary { cursor: pointer; font-weight: 600; }
.alert pre {
  max-height: 220px;
  margin: 7px 0 0;
  padding: 9px;
  overflow: auto;
  border-radius: 7px;
  background: #1e293b;
  color: #e2e8f0;
  font: 11.5px/1.55 Consolas, "Courier New", monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.alert ul { margin: 5px 0 0; padding-left: 18px; }
.alert li + li { margin-top: 3px; }
.submit-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.btn-primary#submitBtn { min-width: 142px; padding: 11px 17px; font-size: 13.5px; }
.btn-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
#submitBtn.loading .btn-spinner { display: inline-block; }
#submitBtn.loading .btn-arrow { display: none; }
.btn-arrow { font-size: 16px; line-height: 1; opacity: .8; }
.submit-note { color: var(--muted); font-size: 11.5px; }
.samples { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 11px; margin-top: 18px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 11px; }
.samples span { letter-spacing: .06em; }
.samples a { color: #0f766e; text-decoration: none; font-size: 11.5px; font-weight: 600; }
.samples a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- jobs list */
.services-strip { display: none; }
.jobs-panel { overflow: hidden; }
.job-list { max-height: 440px; overflow: auto; padding: 0 10px 11px; }
.job-list-empty { padding: 26px 16px; color: var(--muted-2); font-size: 12.5px; text-align: center; }
.job-item {
  display: block;
  width: 100%;
  padding: 11px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.job-item + .job-item { margin-top: 3px; }
.job-item:hover { background: #f7fafd; border-color: #edf2f8; }
.job-item.active { background: #f0fdfa; border-color: #99f6e4; }
.job-item-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.job-item-name { min-width: 0; font-size: 12.8px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-item-time { flex: none; color: var(--muted-2); font-size: 10.5px; }
.job-item-bottom { display: flex; align-items: center; gap: 7px; margin-top: 5px; color: var(--muted); font-size: 10.8px; }
.job-item-bottom .syntax-tag { display: inline-block; padding: 1px 5px; border-radius: 4px; background: #eef2f7; color: #475569; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; }
.job-item-bottom .sep { color: #cbd5e1; }
.job-item-bottom .mini-status { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.status-tiny { width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; }
.status-tiny.queued { background: #f59e0b; }
.status-tiny.running { background: #0ea5e9; animation: pulse 1.2s infinite; }
.status-tiny.succeeded { background: #10b981; }
.status-tiny.failed { background: #ef4444; }

/* ---------------------------------------------------------------- empty state */
.empty-state { min-height: 570px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 46px 30px; text-align: center; }
.empty-illustration {
  position: relative;
  width: 150px;
  height: 132px;
  margin-bottom: 20px;
}
.empty-illustration .paper {
  position: absolute;
  left: 26px;
  top: 8px;
  width: 96px;
  height: 116px;
  border: 1px solid #dbe5ef;
  border-radius: 12px;
  background: linear-gradient(160deg, #fff, #f8fbfe);
  box-shadow: 0 18px 35px rgba(15, 42, 68, .09);
  transform: rotate(-4deg);
}
.empty-illustration .paper::before,
.empty-illustration .paper::after {
  content: "";
  position: absolute;
  left: 16px;
  height: 6px;
  border-radius: 3px;
  background: #e2e8f0;
}
.empty-illustration .paper::before { top: 22px; width: 48px; background: #99f6e4; }
.empty-illustration .paper::after { top: 36px; width: 62px; }
.empty-illustration .bar { position: absolute; bottom: 31px; width: 14px; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, #2dd4bf, #0d9488); }
.empty-illustration .b1 { left: 40px; height: 26px; }
.empty-illustration .b2 { left: 61px; height: 40px; opacity: .8; }
.empty-illustration .b3 { left: 82px; height: 56px; opacity: .65; }
.empty-illustration .spark {
  position: absolute;
  right: 2px;
  top: 4px;
  width: 26px;
  height: 26px;
  background: radial-gradient(circle, #5eead4 0 2px, transparent 2.5px);
  background-size: 13px 13px;
  opacity: .8;
}
.empty-state h2 { margin: 0; font-size: 21px; font-weight: 680; letter-spacing: -.015em; }
.empty-state p { max-width: 540px; margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.empty-features { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 20px; }
.empty-features span { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fbfdff; color: var(--muted); font-size: 11px; }

/* ---------------------------------------------------------------- job view */
#jobView { display: flex; flex-direction: column; gap: 16px; }
.job-header { padding: 20px 22px 18px; }
.job-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.job-heading-main { min-width: 0; }
.job-heading h2 { margin: 7px 0 2px; font-size: 22px; font-weight: 690; letter-spacing: -.02em; overflow-wrap: anywhere; }
.job-heading p { margin: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.job-heading-meta { display: flex; align-items: center; gap: 6px; flex: none; color: var(--muted-2); font-size: 10.5px; }
.job-heading-meta code { background: transparent; padding: 0; color: var(--muted-2); font-size: 10px; }
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}
.status-badge .status-dot { width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; }
.status-badge.queued { background: #fffbeb; color: #a16207; }
.status-badge.queued .status-dot { background: #f59e0b; }
.status-badge.running { background: #eff6ff; color: #1d4ed8; }
.status-badge.running .status-dot { background: #3b82f6; animation: pulse 1.2s infinite; }
.status-badge.succeeded { background: #ecfdf5; color: #047857; }
.status-badge.succeeded .status-dot { background: #10b981; }
.status-badge.failed { background: #fef2f2; color: #b91c1c; }
.status-badge.failed .status-dot { background: #ef4444; }
.stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}
.stepper li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; color: var(--muted-2); font-style: normal; }
.stepper li::before {
  content: "";
  position: absolute;
  top: 12px;
  left: calc(-50% + 14px);
  width: calc(100% - 28px);
  height: 2px;
  background: #e8eef5;
  z-index: 0;
}
.stepper li:first-child::before { display: none; }
.stepper li span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 2px solid #e2e8f0;
  border-radius: 50%;
  background: #fff;
  color: #94a3b8;
  font-size: 10.5px;
  font-weight: 700;
}
.stepper li em { font-style: normal; font-size: 10.5px; white-space: nowrap; }
.stepper li.done { color: #0f766e; }
.stepper li.done span { border-color: #5eead4; background: #ccfbf1; color: #0f766e; }
.stepper li.done::before { background: #99f6e4; }
.stepper li.active { color: #1d4ed8; }
.stepper li.active span { border-color: #3b82f6; background: #eff6ff; color: #1d4ed8; box-shadow: 0 0 0 4px rgba(59,130,246,.1); }
.stepper li.error { color: var(--err); }
.stepper li.error span { border-color: #fca5a5; background: #fef2f2; color: var(--err); }
.stats-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; margin-top: 19px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--line); }
.stat { padding: 9px 12px; background: #fbfdff; }
.stat span { display: block; color: var(--muted-2); font-size: 10px; }
.stat strong { display: block; margin-top: 1px; color: var(--brand); font-size: 16px; font-weight: 680; font-variant-numeric: tabular-nums; }
.job-header .alert { margin-top: 13px; }

/* ---------------------------------------------------------------- result */
.result-panel { overflow: hidden; }
.result-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.result-title h2 { margin: 0; font-size: 16px; font-weight: 680; }
.toolbar-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.result-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 14px 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
}
.result-tab {
  appearance: none;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  padding: 9px 12px 8px;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}
.result-tab:hover { color: var(--ink); }
.result-tab.active { color: var(--brand-2); border-bottom-color: var(--brand-2); }
.result-tab:focus-visible { outline: 2px solid rgba(20,184,166,.35); outline-offset: -2px; border-radius: 6px 6px 0 0; }
.result-body { background: #fff; }
.sub-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 45px;
  padding: 7px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  flex-wrap: wrap;
}
.sub-meta { color: var(--muted); font-size: 11px; line-height: 1.5; }
.sub-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.segmented { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; }
.segmented-btn {
  appearance: none;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 5px 9px;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.segmented-btn:hover:not(:disabled) { color: var(--ink); }
.segmented-btn.active { color: var(--brand-2); background: #fff; box-shadow: 0 1px 2px rgba(15, 42, 68, .1); }
.segmented-btn:disabled { opacity: .4; cursor: not-allowed; }
.check-inline { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; white-space: nowrap; cursor: pointer; }
.check-inline input { accent-color: var(--brand-2); margin: 0; }
.tab-empty { padding: 46px 22px; text-align: center; color: var(--muted); font-size: 12px; line-height: 1.7; }
.tab-empty.error { color: var(--err); }
.result-frame-wrap { position: relative; background: #f8fafc; min-height: 620px; }
#reportFrame { display: block; width: 100%; height: 780px; border: 0; background: #fff; }
.frame-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 30px;
  background: rgba(248, 250, 252, .94);
  text-align: center;
  transition: opacity .2s ease;
}
.frame-overlay.hidden { opacity: 0; pointer-events: none; }
.frame-overlay strong { font-size: 14px; }
.frame-overlay span:last-child { max-width: 400px; color: var(--muted); font-size: 12px; }
.loader {
  width: 30px;
  height: 30px;
  margin-bottom: 4px;
  border: 3px solid #dbeafe;
  border-top-color: #0d9488;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ---------------------------------------------------------------- footer */
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px 8px;
  padding: 24px 10px 0;
  color: var(--muted-2);
  font-size: 10.5px;
}
.footer a { color: #0f766e; text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer-sep { opacity: .5; }

/* ---------------------------------------------------------------- modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(4px);
  animation: fadeIn .15s ease;
}
.modal {
  width: min(430px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  padding: 21px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .25);
  animation: popIn .18s ease;
}
.modal-wide { width: min(950px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.modal-head h2 { margin: 1px 0 0; font-size: 19px; font-weight: 680; }
.modal-head .icon-btn { font-size: 20px; line-height: 1; }
.modal-copy { margin: 14px 0 16px; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.input-label { display: block; margin-bottom: 6px; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.text-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  outline: none;
}
.text-input:focus { border-color: var(--brand-3); box-shadow: 0 0 0 3px rgba(20,184,166,.12); }
#userIdField { margin-top: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 17px; }

/* ---------------------------------------------------------------- preview / code / logs */
.data-table-wrap { max-height: 640px; overflow: auto; background: #fff; }
.data-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 11.5px; }
.data-table th,
.data-table td { padding: 7px 10px; border-bottom: 1px solid #eef2f7; text-align: left; vertical-align: top; }
.data-table thead th { position: sticky; top: 0; z-index: 2; background: #f1f5f9; border-bottom: 1px solid var(--line-strong); font-weight: 650; white-space: nowrap; }
.data-table th.row-no,
.data-table td.row-no {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 46px;
  min-width: 46px;
  text-align: right;
  color: var(--muted-2);
  background: #fbfdff;
  border-right: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.data-table thead th.row-no { z-index: 3; background: #e8eff7; }
.data-table tbody tr:hover td { background: #f8fafc; }
.data-table tbody tr:hover td.row-no { background: #f1f5f9; }
.data-table td { max-width: 320px; overflow: hidden; color: var(--ink-soft); text-overflow: ellipsis; white-space: nowrap; }
.col-name { display: block; }
.col-label { display: block; margin-top: 2px; color: var(--muted-2); font-size: 10px; font-weight: 400; }
.cell-null { color: #cbd5e1; }
.code-wrap { max-height: 660px; overflow: auto; background: #0f172a; }
.code-line {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  color: #dbeafe;
  font: 11.5px/1.65 Consolas, "Cascadia Mono", "Courier New", monospace;
}
.line-no {
  padding: 0 10px;
  border-right: 1px solid #1e293b;
  background: #0b1220;
  color: #64748b;
  text-align: right;
  user-select: none;
}
.line-text { padding: 0 12px; white-space: pre; }
.code-wrap .tab-empty,
.log-view .tab-empty { color: #94a3b8; }
.log-view { min-height: 280px; max-height: 660px; overflow: auto; background: #0f172a; color: #dbeafe; }
.log-view .line-text { white-space: pre-wrap; word-break: break-word; }
.log-line.error { background: rgba(239, 68, 68, .14); }
.log-line.error .line-text { color: #fecaca; }
.log-line.warn { background: rgba(245, 158, 11, .09); }
.log-line.warn .line-text { color: #fde68a; }
.line-notice {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 6px 12px;
  background: #1e293b;
  color: #fbbf24;
  font-size: 10.5px;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 40px));
  padding: 10px 17px;
  border-radius: 10px;
  background: #0f172a;
  color: #f8fafc;
  box-shadow: 0 12px 30px rgba(15,23,42,.28);
  font-size: 12.5px;
  line-height: 1.5;
  animation: toastIn .2s ease;
}
.toast.success { background: #065f46; }
.toast.error { background: #991b1b; }

/* ---------------------------------------------------------------- animations */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1120px) {
  .layout { grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); }
  .job-heading h2 { font-size: 19px; }
}
@media (max-width: 920px) {
  .app { padding: 14px 14px 28px; }
  .layout { grid-template-columns: 1fr; }
  .left-column { order: 2; }
  .workbench { order: 1; }
  .empty-state { min-height: 320px; padding: 32px 20px; }
  .empty-illustration { transform: scale(.8); margin-bottom: 4px; }
  #reportFrame { height: 640px; }
  .job-list { max-height: 300px; }
}
@media (max-width: 640px) {
  .topbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .top-actions { width: 100%; justify-content: flex-start; }
  .brand-text span { display: none; }
  .upload-panel { padding: 16px; }
  .dropzone { grid-template-columns: 42px minmax(0, 1fr) 20px; min-height: 70px; padding: 11px 12px; }
  .dz-icon { width: 42px; height: 42px; font-size: 9px; }
  .submit-row { align-items: flex-start; flex-direction: column; gap: 7px; }
  .field-row { grid-template-columns: 1fr; }
  .field-note { grid-column: 1; }
  .job-header { padding: 16px; }
  .stepper li em { font-size: 9px; }
  .stats-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .result-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { justify-content: flex-start; }
  .result-tabs { padding: 6px 8px 0; }
  .result-tab { padding: 8px 9px 7px; font-size: 12px; }
  .sub-toolbar { align-items: flex-start; flex-direction: column; padding: 8px 12px; }
  .sub-actions { width: 100%; margin-left: 0; }
  .data-table-wrap { max-height: 72vh; }
  .code-wrap, .log-view { max-height: 68vh; }
  .code-line { grid-template-columns: 40px minmax(0, 1fr); }
  .line-no { padding: 0 7px; }
  .line-text { padding: 0 9px; }
  #reportFrame { height: 540px; }
  .modal { padding: 17px; }
}
