:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --line: #d9e0e7;
  --text: #1e2933;
  --muted: #64748b;
  --accent: #14746f;
  --accent-dark: #0f5f5a;
  --danger: #b42318;
  --ok: #15803d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.shell {
  min-height: 100vh;
  padding: 24px;
}

.workspace {
  max-width: 1180px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.top-actions,
.account-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

h1, h2, p {
  margin: 0;
}

h1 {
  font-size: 26px;
  font-weight: 700;
}

h2 {
  font-size: 16px;
}

.topbar p,
#jobUrl {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.icon-btn,
.composer button,
.ghost-btn {
  border: 0;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.ghost-btn {
  height: 38px;
  border-radius: 6px;
  padding: 0 12px;
  background: #334155;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  font-size: 20px;
}

.composer {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
}

.composer input[type="url"] {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  font-size: 15px;
}

.composer button {
  border-radius: 6px;
  font-size: 15px;
}

.account-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.account-head button {
  height: 30px;
  background: #334155;
  padding: 0 10px;
}

.account-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.account-option {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: #fff;
}

.account-option small {
  color: var(--muted);
  font-size: 12px;
}

.modal {
  width: min(520px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
}

.modal::backdrop {
  background: rgb(15 23 42 / 45%);
}

.modal form {
  padding: 18px;
}

.modal header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal header button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: #e2e8f0;
  cursor: pointer;
  font-size: 20px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 6px;
  height: 34px;
  padding: 0 12px;
  cursor: pointer;
}

.tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.tab-panel {
  display: grid;
  gap: 10px;
}

.tab-panel label,
.login-panel label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.tab-panel input,
.login-panel input {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  font-size: 14px;
}

.check-row {
  grid-template-columns: 18px 1fr;
  align-items: center;
  color: var(--text) !important;
}

.check-row input {
  height: auto;
}

.primary,
.login-panel button {
  height: 40px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.oauth-box {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  background: #f8fafc;
}

.oauth-box p,
.form-msg,
#loginMsg {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}

.oauth-box button {
  height: 34px;
  margin-top: 12px;
  border: 0;
  border-radius: 6px;
  background: #334155;
  color: #fff;
  padding: 0 12px;
  cursor: pointer;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-panel {
  width: min(380px, 100%);
  display: grid;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

.login-panel h1 {
  font-size: 22px;
  margin-bottom: 4px;
}

.composer button:hover,
.icon-btn:hover {
  background: var(--accent-dark);
}

.content {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
}

.jobs,
.detail {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 560px;
}

.jobs {
  padding: 16px;
}

.job-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.job-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 10px;
  cursor: pointer;
}

.job-item span,
.job-item small {
  display: block;
}

.job-item small {
  color: var(--muted);
  margin-top: 4px;
}

.detail {
  padding: 18px;
}

.empty {
  height: 520px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.hidden {
  display: none;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.status {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  white-space: nowrap;
}

.status.completed {
  color: var(--ok);
  border-color: #bbf7d0;
}

.status.failed {
  color: var(--danger);
  border-color: #fecaca;
}

.progress {
  height: 8px;
  background: #e8edf2;
  border-radius: 999px;
  overflow: hidden;
  margin: 18px 0;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .2s ease;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.steps li {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #94a3b8;
  margin-top: 5px;
}

.steps li.running .dot {
  background: #c77700;
}

.steps li.completed .dot {
  background: var(--ok);
}

.steps li.failed .dot {
  background: var(--danger);
}

.steps p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.result {
  margin-top: 16px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: auto;
  max-height: 180px;
  font-size: 12px;
}

@media (max-width: 820px) {
  .shell {
    padding: 14px;
  }

  .input-row,
  .content {
    grid-template-columns: 1fr;
  }

  .composer button {
    height: 42px;
  }
}
