
:root {
  --bg: #f4f7fb;
  --bg-soft: #f9fbfe;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --panel-soft: #f3f7fd;
  --text: #142033;
  --muted: #68768c;
  --line: #d8e2ef;
  --line-strong: #c9d6e8;
  --accent: #2968f2;
  --accent-2: #63a6ff;
  --accent-soft: #edf4ff;
  --ok: #15735a;
  --ok-soft: #eaf7f1;
  --warn: #a56307;
  --warn-soft: #fff6e8;
  --error: #c03a2b;
  --error-soft: #fff1ef;
  --shadow: 0 18px 50px rgba(28, 43, 72, 0.10);
  --shadow-soft: 0 10px 30px rgba(31, 45, 74, 0.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #f7faff 0%, #f2f6fb 100%);
  color: var(--text);
  min-height: 100vh;
}
.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top left, rgba(103, 166, 255, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(41, 104, 242, 0.10), transparent 20%),
    linear-gradient(180deg, rgba(255,255,255,0.58), rgba(255,255,255,0));
}
.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 22px;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(216, 226, 239, 0.85);
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px);
}
.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
}
.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.brand-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.brand {
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}
.sub {
  color: var(--muted);
  font-size: .95rem;
}
.main-shell {
  position: relative;
  padding-top: 28px;
  padding-bottom: 52px;
}
.hero {
  display: grid;
  grid-template-columns: 1.6fr .9fr;
  gap: 18px;
  margin-bottom: 20px;
}
.hero-copy {
  min-height: 240px;
}
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid rgba(216, 226, 239, 0.95);
  border-radius: 26px;
  box-shadow: var(--shadow-soft);
  padding: 24px;
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
}
.card-hero {
  background: linear-gradient(135deg, rgba(255,255,255,0.96) 0%, rgba(244,249,255,0.96) 100%);
}
.card-form {
  height: 100%;
}
.card-sidepanel {
  background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(247,250,255,0.96) 100%);
}
.card-job-header {
  background: linear-gradient(180deg, rgba(255,255,255,0.97) 0%, rgba(246,250,255,0.96) 100%);
}
.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .84rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
h1, h2, h3 {
  margin: 0 0 12px;
  line-height: 1.08;
}
h1 {
  font-size: clamp(2rem, 4vw, 2.7rem);
  letter-spacing: -0.03em;
}
h2 { font-size: 1.28rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 12px; }
.lead {
  font-size: 1.05rem;
  color: #304158;
  max-width: 760px;
}
.muted { color: var(--muted); }
.ok, .warn, .error {
  padding: 13px 15px;
  border-radius: 16px;
  border: 1px solid transparent;
  margin: 14px 0;
}
.ok { color: var(--ok); background: var(--ok-soft); border-color: #c9eadf; }
.warn { color: var(--warn); background: var(--warn-soft); border-color: #f4ddaf; }
.error { color: var(--error); background: var(--error-soft); border-color: #f0c7c1; }
.stack > * + * { margin-top: 16px; }
.grid-2col {
  display: grid;
  grid-template-columns: 1.5fr .9fr;
  gap: 18px;
}
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.upload-card {
  display: block;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 20px;
  background: linear-gradient(180deg, #fcfdff 0%, #f6f9fd 100%);
}
.upload-title {
  display: block;
  font-weight: 800;
  margin-bottom: 5px;
}
.upload-desc {
  display: block;
  color: var(--muted);
  margin-bottom: 12px;
  font-size: .93rem;
}
label { display: block; }
label > span:first-child {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}
input[type="file"], textarea {
  width: 100%;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
textarea { min-height: 110px; resize: vertical; }
button {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: white;
  border: 0;
  border-radius: 16px;
  padding: 13px 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(41, 104, 242, 0.22);
}
button:hover { filter: brightness(1.03); }
.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  text-align: left;
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
tr:hover td { background: rgba(243, 247, 253, 0.7); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
code.inline {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 8px;
}
pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}
.log-box {
  max-height: 520px;
  overflow: auto;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 700;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}
.badge-queued { color: var(--warn); background: var(--warn-soft); }
.badge-running { color: var(--accent); background: var(--accent-soft); }
.badge-completed { color: var(--ok); background: var(--ok-soft); }
.badge-failed { color: var(--error); background: var(--error-soft); }
.header-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.9);
  color: var(--muted);
  font-size: .92rem;
}
.header-chip-accent {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: #cfe0ff;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.hero-side {
  display: grid;
  gap: 14px;
  align-content: start;
}
.mini-stat {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}
.mini-label {
  font-size: .86rem;
  color: var(--muted);
}
.steps-mini {
  display: grid;
  gap: 12px;
}
.step-mini {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.step-mini:last-child { border-bottom: 0; }
.step-mini span {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 900;
}
.step-mini p { color: var(--muted); margin: 4px 0 0; }
.row-between {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}
.wrap-gap { align-items: stretch; }
.compact-gap { align-items: center; }
.status-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}
.timer-card {
  min-width: 220px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
.timer-label {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 4px;
}
.timer-value {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: .04em;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.summary-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}
.summary-label {
  display: block;
  color: var(--muted);
  font-size: .86rem;
  margin-bottom: 6px;
}
.progress-header { margin-top: 18px; }
.progress-shell {
  width: 100%;
  height: 16px;
  background: #edf3fc;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0 20px;
}
.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #79dbb3 0%, #3f8cff 55%, #7b67ff 100%);
  transition: width .35s ease;
}
.timeline {
  display: grid;
  gap: 12px;
  margin: 14px 0 8px;
}
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 14px;
  align-items: start;
}
.timeline-rail {
  position: absolute;
  left: 8px;
  top: 12px;
  bottom: -12px;
  width: 2px;
  background: linear-gradient(180deg, #dce7f7 0%, #c8daf6 100%);
}
.timeline-item:last-child .timeline-rail { display: none; }
.timeline-dot {
  position: relative;
  z-index: 1;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-top: 4px;
  background: linear-gradient(180deg, #4d89ff 0%, #2d6eff 100%);
  box-shadow: 0 0 0 7px rgba(41, 104, 242, 0.10);
}
.timeline-content {
  border: 1px solid var(--line);
  background: #fcfdff;
  border-radius: 16px;
  padding: 13px 15px;
}
.timeline-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.details-grid {
  align-items: stretch;
}
.output-groups {
  display: grid;
  gap: 14px;
}
.output-group {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, #fcfdff 0%, #f6f9fd 100%);
  padding: 16px;
}
.output-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.output-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.output-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.output-list li:last-child { border-bottom: 0; }
.list-plain {
  list-style: none;
  padding: 0;
  margin: 0;
}
.list-plain li + li { margin-top: 8px; }
.hidden { display: none; }
@media (max-width: 960px) {
  .hero, .grid-2col { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upload-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .row-between, .section-head, .header-row { flex-direction: column; }
  .status-panel { align-items: stretch; }
  .timer-card { width: 100%; }
  .summary-grid { grid-template-columns: 1fr; }
  .form-actions { align-items: stretch; }
}


.step-tracker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 10px 0 18px;
}
.step-chip {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fcfdff;
}
.step-chip-index {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-weight: 800;
  background: #eef3fb;
  color: #4f627d;
}
.step-pending { background: #fcfdff; }
.step-active {
  border-color: #bfd2ff;
  background: linear-gradient(180deg, #ffffff 0%, #eef5ff 100%);
  box-shadow: 0 10px 20px rgba(41, 104, 242, 0.08);
}
.step-active .step-chip-index { background: var(--accent-soft); color: var(--accent); }
.step-done {
  border-color: #cfe8dc;
  background: linear-gradient(180deg, #ffffff 0%, #effaf4 100%);
}
.step-done .step-chip-index { background: var(--ok-soft); color: var(--ok); }
.step-skipped {
  border-color: #eadfc2;
  background: linear-gradient(180deg, #ffffff 0%, #fff8ea 100%);
}
.step-skipped .step-chip-index { background: var(--warn-soft); color: var(--warn); }
.step-failed {
  border-color: #efc8c2;
  background: linear-gradient(180deg, #ffffff 0%, #fff3f0 100%);
}
.step-failed .step-chip-index { background: var(--error-soft); color: var(--error); }


.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 20px rgba(21, 46, 87, 0.06);
}
.ghost-button:hover {
  text-decoration: none;
  transform: translateY(-1px);
}
.ghost-button-accent {
  border-color: #cfe0ff;
  background: linear-gradient(180deg, #ffffff 0%, #edf4ff 100%);
  color: var(--accent);
}
.mini-foot {
  font-size: .82rem;
  color: var(--muted);
  word-break: break-word;
}
.header-inline-actions {
  align-items: center;
  margin-top: 14px;
}
.header-inline-actions p {
  margin: 0;
}
.table-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.annotations-summary-grid {
  margin-top: 18px;
}
.annotations-controls {
  align-items: end;
}
.annotations-search-box {
  min-width: 260px;
  max-width: 360px;
  width: 100%;
}
.search-label {
  display: block;
  margin-bottom: 6px;
  font-size: .9rem;
  color: var(--muted);
  font-weight: 700;
}
.annotations-table-wrap {
  max-height: 72vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.annotations-table {
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.annotations-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, #ffffff 0%, #f5f8ff 100%);
  box-shadow: inset 0 -1px 0 var(--line);
}
.annotations-table td,
.annotations-table th {
  white-space: nowrap;
}
.annotations-table tbody tr:nth-child(even) td {
  background: rgba(248, 250, 255, 0.75);
}
.annotations-table tbody tr:hover td {
  background: rgba(234, 241, 255, 0.9);
}
.hidden-inline {
  display: none !important;
}
@media (max-width: 900px) {
  .annotations-controls {
    align-items: stretch;
  }
  .annotations-search-box {
    max-width: none;
  }
  .header-inline-actions {
    align-items: start;
  }
}

.hidden-inline { display: none !important; }
.button-secondary,
.button-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(21, 46, 87, 0.06);
}
.button-secondary:hover,
.button-danger:hover {
  filter: brightness(1.01);
}
.button-danger {
  color: var(--error);
  border-color: #edcdc9;
  background: linear-gradient(180deg, #fff 0%, #fff4f2 100%);
}
.info-box {
  color: var(--accent);
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
  border: 1px solid #cfe0ff;
  padding: 13px 15px;
  border-radius: 16px;
}
.editor-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  flex-wrap: wrap;
  margin-top: 18px;
}
.editor-toolbar-left,
.editor-toolbar-right {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}
.compact-search-box {
  min-width: 260px;
}
.delimiter-select-wrap select,
.annotations-search-box input {
  width: 100%;
  min-width: 160px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
.annotations-editor-wrap {
  max-height: 75vh;
}
.annotations-editor-table td[contenteditable="true"],
.annotations-editor-table th[contenteditable="true"] {
  outline: none;
  background: rgba(255,255,255,0.92);
}
.annotations-editor-table td[contenteditable="true"]:focus,
.annotations-editor-table th[contenteditable="true"]:focus {
  background: #eef5ff;
  box-shadow: inset 0 0 0 2px rgba(41, 104, 242, 0.18);
}
.annotations-editor-table .action-col {
  position: sticky;
  right: 0;
  z-index: 3;
  min-width: 110px;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%);
  box-shadow: inset 1px 0 0 var(--line);
}
.annotations-editor-table tbody .action-col {
  z-index: 1;
}
.row-delete-button {
  border: 1px solid #eed0cb;
  color: var(--error);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: .85rem;
  font-weight: 700;
  box-shadow: none;
}
.row-delete-button:hover {
  background: #fff6f5;
}
@media (max-width: 720px) {
  .editor-toolbar-left,
  .editor-toolbar-right { width: 100%; }
  .button-secondary,
  .button-danger { width: 100%; }
}
