:root {
  --bg: #f2f4f8;
  --card: #ffffff;
  --line: #e3e7ee;
  --text: #1f2937;
  --muted: #7a8699;
  --accent: #4d79f6;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, system-ui, sans-serif; }
.container { max-width: 1280px; margin: 18px auto; padding: 0 16px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
h1 { margin: 0; font-size: 36px; font-weight: 800; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.user-chip { border: 1px solid #d7dde8; background: #fff; color: #4b5563; border-radius: 10px; padding: 8px 12px; font-size: 12px; }
.logout-btn { border: 1px solid #466ee6; background: #4d79f6; color: #fff; border-radius: 10px; padding: 8px 16px; font-size: 13px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-top: 10px; }
.card-title { font-weight: 700; margin-bottom: 10px; font-size: 20px; }
#uploadSection .card-title, #tasksSection .card-title { font-size: 30px; }
.upload-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
input[type=file] { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; min-width: 330px; }
button { border: 1px solid #2a67dc; background: var(--accent); color: #fff; border-radius: 10px; padding: 8px 14px; cursor: pointer; }
button.ghost { background: #fff; color: #334155; border: 1px solid var(--line); }
.muted { color: var(--muted); }

.tasks-list { display: flex; flex-direction: column; gap: 8px; }
.task-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; }
.task-item.active { border-color: #c9d9ff; background: #f7faff; box-shadow: inset 0 0 0 1px #e2ebff; }
.task-left { min-width: 0; }
.task-id-row { display: flex; align-items: center; gap: 8px; }
.task-id-row::before { content: '↗'; color: #9aa7bb; font-size: 12px; line-height: 1; border: 1px solid #d9e0ea; border-radius: 999px; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; }
.task-id-link { font-weight: 700; font-size: 14px; word-break: break-all; color: #111827; text-decoration: none; }
.open-new { font-size: 13px; color: #7f8ea3; text-decoration: none; border: 1px solid #d9e0ea; border-radius: 8px; padding: 0 6px; line-height: 18px; }
.open-new:hover { color: #334155; border-color: #c5cfde; }
.task-name { font-size: 13px; color: #374151; margin-top: 2px; }
.task-meta { font-size: 12px; color: var(--muted); }
.status-pill { border-radius: 999px; padding: 4px 14px; font-size: 12px; border: 1px solid; white-space: nowrap; font-weight: 600; text-transform: lowercase; }
.status-succeeded { color: #1d7f45; background: #e8f8ee; border-color: #b8e7c8; }
.status-running, .status-submitted_to_sec, .status-queued { color: #9a6b00; background: #fff8e1; border-color: #efdda8; }
.status-failed, .status-failed_invalid_output, .status-blocked { color: #b42318; background: #fff0ef; border-color: #ffcfc9; }

.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.files-box { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #fbfcfe; font-size: 13px; }
.result-wrap { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 12px; }
.result-human { white-space: pre-wrap; line-height: 1.45; }
.result-raw { white-space: pre-wrap; background: #f8fafc; border-radius: 8px; padding: 10px; }
.actions-row { margin-top: 10px; }
a { color: #2457c5; text-decoration: none; }
a:hover { text-decoration: underline; }

body.standalone-task .container { max-width: 980px; margin-top: 6px; }
body.standalone-task .topbar { display: none; }
body.standalone-task #detailCard { margin-top: 0; }
body.standalone-task .detail-head { margin-bottom: 4px; }
