
:root { --bg: #0b0b0d; --panel: #1c1c1e; --fg: #ffffff; --muted: #8e8e93; --accent: #0a84ff;
        --danger: #ff453a; --border: #2c2c2e; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--fg);
       font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }
.wrap { max-width: 640px; margin: 0 auto; padding: 48px 20px 64px; }
h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -0.01em; }
.lead { color: var(--muted); margin: 0 0 32px; font-size: 15px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 24px; }
label.field { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=password] {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: #000; color: var(--fg); font-size: 15px; margin-bottom: 18px;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
details { margin-bottom: 18px; }
summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.methods { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 18px; }
.method { font-size: 14px; display: flex; align-items: center; gap: 6px; }
.note { color: var(--muted); font-size: 12px; }
.hint { color: var(--muted); font-size: 12px; margin: -12px 0 18px; }
input[type=file] {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--border);
  background: #000; color: var(--fg); font-size: 13px; margin-bottom: 16px;
}
.guide { background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
         padding: 4px 24px; margin-bottom: 24px; }
.guide ol { margin: 0 0 12px; padding-left: 20px; font-size: 14px; color: var(--fg); }
.guide li { margin-bottom: 8px; }
.guide li:last-child { margin-bottom: 0; }
.upload-progress { margin: 6px 0 18px; }
.upload-progress-track { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.upload-progress-fill { height: 100%; width: 0%; background: var(--accent); transition: width .15s linear; }
.upload-progress-text { margin-top: 6px; font-size: 12px; color: var(--muted); }
button { width: 100%; padding: 13px; border: 0; border-radius: 10px; background: var(--accent);
         color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button.secondary { background: var(--border); color: var(--fg); font-size: 14px; padding: 11px; }
.error { color: var(--danger); font-size: 14px; margin-top: 12px; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border);
  border-top-color: var(--accent); animation: spin 0.8s linear infinite; display: inline-block;
  vertical-align: -3px; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }
#run-title { font-size: 18px; font-weight: 600; margin: 0 0 4px; }
#elapsed { color: var(--muted); font-size: 13px; }
#stages { margin: 18px 0 0; }
.stage { margin-bottom: 18px; }
.stage:last-child { margin-bottom: 0; }
.stage-head { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 6px; }
.stage-icon { width: 14px; text-align: center; flex-shrink: 0; font-size: 12px; }
.stage-title { flex: 1; }
.stage-pct { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.stage-bar-track { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.stage-bar-fill { height: 100%; width: 0%; background: var(--accent); transition: width .3s ease; }
.stage-detail { margin-top: 5px; font-size: 12px; color: var(--muted); }
.stage-pending .stage-title, .stage-pending .stage-icon { opacity: .45; }
.stage-pending .stage-bar-fill { background: var(--border); }
.stage-ok .stage-icon { color: #32d74b; }
.stage-failed .stage-icon, .stage-failed .stage-pct { color: var(--danger); }
.stage-failed .stage-bar-fill { background: var(--danger); }
.substeps { margin: 10px 0 0 22px; display: flex; flex-direction: column; gap: 7px; }
.substep-head { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.substep-icon { width: 12px; text-align: center; flex-shrink: 0; font-size: 10px; }
.substep-title { flex: 1; color: var(--muted); font-size: 12px; }
.substep-bar-track { height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.substep-bar-fill { height: 100%; width: 0%; background: var(--accent); transition: width .3s ease; }
.substep-pending .substep-title, .substep-pending .substep-icon { opacity: .45; }
.substep-pending .substep-bar-fill { background: var(--border); }
.substep-ok .substep-icon { color: #32d74b; }
.substep-ok .substep-bar-fill { background: #32d74b; }
.substep-failed .substep-icon { color: var(--danger); }
.substep-failed .substep-bar-fill { background: var(--danger); }
.log-details { margin-top: 18px; }
pre#log {
  margin: 8px 0 0; padding: 14px; background: #000; border-radius: 10px; border: 1px solid var(--border);
  max-height: 320px; overflow: auto; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap; word-break: break-all; color: #c7c7cc;
}
#result-actions { margin-top: 16px; }
#result-actions a { color: var(--accent); text-decoration: none; font-size: 14px; }
#error-note { color: var(--danger); font-size: 14px; margin-top: 14px; }
#reset-form { margin-top: 18px; }
#js-banner {
  display: none; position: fixed; left: 0; right: 0; top: 0; z-index: 999; background: var(--danger);
  color: #fff; padding: 10px 16px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap; word-break: break-all;
}
[hidden] { display: none !important; }
