:root {
  color-scheme: dark;
  --bg: #0b0c0f;
  --surface: #111318;
  --surface-subtle: #0e1014;
  --border: #252832;
  --border-strong: #353947;
  --text: #f2f3f5;
  --muted: #8c929f;
  --accent: #6f76f6;
  --accent-hover: #8187ff;
  --success: #55c987;
  --danger: #ee7184;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.site-header { border-bottom: 1px solid var(--border); background: #0c0d11; }
.header-inner {
  width: min(960px, calc(100% - 40px));
  height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-actions { display: flex; align-items: center; gap: 14px; }
.language-switcher { display: inline-flex; border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.language-switcher button { border: 0; border-right: 1px solid var(--border); padding: 6px 9px; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; }
.language-switcher button:last-child { border-right: 0; }
.language-switcher button.active { color: var(--text); background: #1a1d25; }
.text-button { padding: 5px 0; border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; }
.text-button:hover { color: var(--text); }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand img { width: 36px; height: 36px; object-fit: contain; }
.brand span { display: flex; flex-direction: column; gap: 1px; }
.brand strong { font-size: 14px; letter-spacing: .01em; }
.brand small { color: var(--muted); font-size: 11px; }
.customer-label { color: var(--muted); font-size: 12px; }

.shell { width: min(1040px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 32px; }
.intro { margin-bottom: 25px; }
.intro h1 { margin: 0 0 8px; font-size: 30px; line-height: 1.2; letter-spacing: -.025em; }
.intro p { max-width: 610px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.intro .eyebrow, .eyebrow { margin-bottom: 7px; color: #aeb2ff; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.instructions { margin: 0 0 18px; padding: 18px 20px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-subtle); }
.instructions h2 { margin: 0 0 12px; font-size: 14px; }
.instructions ol { margin: 0; padding-left: 19px; columns: 2; column-gap: 38px; color: #c6c9d1; font-size: 11px; line-height: 1.55; }
.instructions li { margin: 0 0 7px; break-inside: avoid; }
.instructions code { color: #b8bcff; font-size: 9px; overflow-wrap: anywhere; }
.queue-rule { margin: 9px 0 0; padding-top: 10px; border-top: 1px solid var(--border); color: var(--muted); font-size: 10px; }

.notice { margin: 0 0 16px; padding: 11px 13px; border: 1px solid #56303a; border-radius: 6px; color: #f2a8b3; background: #1b1115; font-size: 13px; }
.notice.info { color: #c9cbff; border-color: #34385d; background: #121529; }

.workspace { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.workspace-section { min-width: 0; min-height: 390px; padding: 24px; }
.workspace-section + .workspace-section { border-left: 1px solid var(--border); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 22px; }
.section-heading h2 { margin: 0 0 5px; font-size: 16px; letter-spacing: -.01em; }
.section-heading p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.secure-label, .limit-label { flex: 0 0 auto; color: #b6bac5; border: 1px solid var(--border); border-radius: 4px; padding: 5px 7px; font-size: 10px; }

.drop-zone {
  min-height: 145px;
  padding: 20px;
  border: 1px dashed var(--border-strong);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  cursor: pointer;
  background: var(--surface-subtle);
  transition: border-color .15s, background .15s;
}
.drop-zone:hover, .drop-zone.dragging { border-color: var(--accent); background: #111422; }
.drop-zone input { position: absolute; opacity: 0; pointer-events: none; }
.drop-zone strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.drop-zone span { color: var(--muted); font-size: 11px; }
.privacy-note { margin: 13px 0 17px; color: var(--muted); font-size: 10px; line-height: 1.5; }

.primary-button, .secondary-button {
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 650;
  transition: background .15s, border-color .15s;
}
.primary-button { width: 100%; min-height: 42px; padding: 10px 16px; color: #fff; background: var(--accent); font-size: 13px; }
.primary-button:hover { background: var(--accent-hover); }
.primary-button:disabled { opacity: .45; cursor: not-allowed; }
.secondary-button { min-height: 36px; padding: 8px 11px; border-color: var(--border-strong); background: transparent; color: #d8dae0; font-size: 11px; }
.secondary-button:hover { border-color: #555b6d; background: #171920; }
.secondary-button.danger { color: #f3a0ac; margin-right: auto; }

.status-badge { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 4px; padding: 5px 7px; color: var(--muted); font-size: 10px; font-weight: 700; }
.status-badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-badge.running, .status-badge.queued { color: #b3b7ff; border-color: #373b65; }
.status-badge.completed { color: var(--success); border-color: #28513a; }
.status-badge.failed, .status-badge.cancelled, .status-badge.timeout { color: var(--danger); border-color: #5b3039; }

.empty-state { min-height: 285px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.empty-state strong { font-size: 13px; }
.empty-state p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.job-reference { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 14px; align-items: center; padding-bottom: 17px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.job-reference span { color: var(--muted); font-size: 10px; }
.job-reference code { overflow: hidden; text-overflow: ellipsis; text-align: right; color: #c5c8d0; font-size: 10px; }
.progress-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 9px; }
.progress-header > div { display: flex; flex-direction: column; gap: 4px; }
.progress-header span { color: var(--muted); font-size: 10px; }
.progress-header strong { font-size: 13px; }
#progress-percent { color: #b9bcff; font-size: 11px; }
.progress-track { height: 4px; background: #252832; overflow: hidden; margin-bottom: 22px; }
#progress-fill { width: 0; height: 100%; background: var(--accent); transition: width .35s ease; }
.metrics { display: grid; grid-template-columns: repeat(3,1fr); margin: 0 0 23px; padding: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.metrics div { padding: 13px 10px; border-right: 1px solid var(--border); }
.metrics div:first-child { padding-left: 0; }
.metrics div:last-child { border-right: 0; }
.metrics dt { color: var(--muted); font-size: 9px; }
.metrics dd { margin: 6px 0 0; font-size: 16px; font-weight: 700; }
.metrics .success dd { color: var(--success); }
.metrics .failed dd { color: var(--danger); }
.actions { min-height: 36px; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.dm-line { margin: -8px 0 18px; color: var(--muted); font-size: 10px; }
.dm-line strong { color: #cfd1d8; }

.history-section { margin-top: 18px; padding: 22px 24px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.history-section .section-heading { margin-bottom: 14px; }
.history-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 10px; }
th { padding: 9px 10px; color: var(--muted); text-align: left; font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 10px; color: #cbd0d8; border-bottom: 1px solid #1d2027; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.history-empty { margin: 18px 0 4px; color: var(--muted); text-align: center; font-size: 11px; }

.service-note { margin: 15px 0 0; color: #686e79; font-size: 10px; text-align: center; }
footer { padding: 18px; color: #555b66; text-align: center; font-size: 10px; }

.denied-page { display: grid; place-items: center; padding: 20px; }
.denied-panel { width: min(380px, 100%); text-align: center; }
.denied-logo { width: 64px; height: 64px; object-fit: contain; }
.denied-brand { margin: 6px 0 28px; color: var(--muted); font-size: 12px; }
.denied-panel h1 { margin: 0 0 10px; font-size: 26px; }
.denied-panel > p:not(.denied-brand) { margin: 0 0 24px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.denied-panel .primary-button { max-width: 180px; margin: 0 auto; }

.auth-page { display: grid; place-items: center; padding: 20px; }
.auth-panel { width: min(410px, 100%); padding: 28px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.auth-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 26px; }
.auth-top img { width: 56px; height: 56px; object-fit: contain; }
.auth-panel h1 { margin: 0 0 10px; font-size: 27px; }
.auth-panel > p:not(.eyebrow) { margin: 0 0 22px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.auth-panel .primary-button { width: 100%; }
.auth-panel .auth-note { margin: 15px 0 0 !important; text-align: center; font-size: 10px !important; }
.auth-logout { display: block; margin: 14px auto 0; }

@media (max-width: 760px) {
  .shell { padding-top: 32px; }
  .workspace { grid-template-columns: 1fr; }
  .workspace-section { min-height: auto; }
  .workspace-section + .workspace-section { border-left: 0; border-top: 1px solid var(--border); }
  .empty-state { min-height: 180px; }
  .instructions ol { columns: 1; }
}

@media (max-width: 480px) {
  .header-inner, .shell { width: min(100% - 28px, 1040px); }
  .customer-label, .secure-label, .limit-label { display: none; }
  .header-actions { gap: 9px; }
  .brand small { display: none; }
  .workspace-section { padding: 19px; }
  .metrics div { padding: 12px 7px; }
  .actions { align-items: stretch; flex-direction: column; }
  .actions .secondary-button { width: 100%; }
  .secondary-button.danger { margin: 0; }
}
