:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #17202a; background: #eef1f4; font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #eef1f4; }
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
[hidden] { display: none !important; }
.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 70% 10%, #347a6b 0, transparent 35%), linear-gradient(140deg, #0d2927, #174c45 58%, #102c2b); }
.login-card { width: min(430px, 100%); display: grid; gap: 16px; padding: 34px; border: 1px solid rgba(255,255,255,.22); border-radius: 22px; background: rgba(255,255,255,.96); box-shadow: 0 30px 90px rgba(0,0,0,.28); }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 13px; color: #fff; background: #17675a; font-size: 25px; font-weight: 900; }
.login-card h1 { margin: -4px 0 0; font-size: 25px; letter-spacing: -.03em; }
.login-card p { margin: -8px 0 4px; color: #687780; font-size: 13px; line-height: 1.55; }
.login-security { color: #74847d; text-align: center; font-size: 11px; }
.form-error { min-height: 18px; color: #a23a32; font-size: 12px; font-weight: 700; }
.app-shell { min-height: 100vh; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding: 27px 34px 25px; color: white; background: linear-gradient(115deg, #102b2a 0%, #174d46 58%, #22665a 100%); box-shadow: 0 8px 30px rgba(12,35,35,.18); }
.topbar h1 { margin: 5px 0; font-size: 30px; letter-spacing: -.03em; }
.topbar p { margin: 0; color: #c9dbd7; font-size: 14px; }
.eyebrow, .step { color: #6e817a; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.topbar .eyebrow { color: #8ed0c0; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.safety-badge { display: flex; align-items: center; gap: 9px; padding: 10px 14px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(255,255,255,.08); color: #e9f5f2; font-size: 13px; font-weight: 700; }
.safety-badge span { width: 8px; height: 8px; border-radius: 50%; background: #7ce0a9; box-shadow: 0 0 0 5px rgba(124,224,169,.12); }
.topbar-button { padding: 9px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 9px; color: white; background: rgba(255,255,255,.09); font-size: 12px; font-weight: 700; }
.workspace { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 22px; padding: 24px 28px 34px; }
.connections, .main-panel { display: grid; align-content: start; gap: 18px; }
.card { background: #fff; border: 1px solid #dfe4e7; border-radius: 16px; box-shadow: 0 8px 24px rgba(31,48,59,.055); }
.connection-card, .state-card { padding: 20px; }
.batch-card, .progress-card, .log-card { padding: 22px 24px; }
.card-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.card h2 { margin: 5px 0 0; font-size: 18px; letter-spacing: -.015em; }
.card p { color: #697780; line-height: 1.55; }
.batch-heading p { margin: 7px 0 0; font-size: 13px; }
form, .state-card, .auth-fields { display: grid; gap: 13px; }
.auth-fields[hidden] { display: none; }
.connection-card form { margin-top: 17px; }
label { display: grid; gap: 7px; color: #34434c; font-size: 12px; font-weight: 750; }
input, select, textarea { width: 100%; border: 1px solid #cfd7dc; border-radius: 10px; outline: none; background: #fbfcfd; color: #19242b; transition: .16s border-color, .16s box-shadow, .16s background; }
input, select { padding: 10px 11px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #66757d 50%), linear-gradient(135deg, #66757d 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
textarea { margin-top: 17px; min-height: 180px; padding: 14px; resize: vertical; line-height: 1.55; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
input:focus, select:focus, textarea:focus { border-color: #2e7f70; background-color: #fff; box-shadow: 0 0 0 4px rgba(46,127,112,.11); }
.status-pill, .count-badge { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status-pill.idle { color: #69747c; background: #edf0f2; }
.status-pill.working { color: #8b5b11; background: #fff1d3; }
.status-pill.success { color: #17624a; background: #dff5eb; }
.status-pill.error { color: #9a3c35; background: #fde6e3; }
.count-badge { color: #245e55; background: #e1f3ef; }
.secondary, .primary, .danger, .ghost, .link-button { border-radius: 10px; padding: 10px 13px; font-weight: 800; transition: .16s transform, .16s opacity, .16s background; }
.secondary { color: #fff; background: #245e55; }
.secondary:hover { background: #194c45; }
.primary { padding: 12px 17px; color: #fff; background: #17675a; box-shadow: 0 8px 20px rgba(23,103,90,.18); }
.primary:hover { background: #10584d; transform: translateY(-1px); }
.primary.full { width: 100%; }
.danger { color: #a23a32; background: #fbe9e6; }
.ghost { color: #3e555f; background: #edf2f4; }
.link-button { display: block; color: #3e555f; background: #edf2f4; text-align: center; text-decoration: none; }
button:disabled { cursor: not-allowed; opacity: .48; transform: none; }
.button-row { display: flex; gap: 8px; }
.button-row.compact button { flex: 1; font-size: 12px; padding: 9px 8px; }
.microcopy { margin: 13px 0 0; color: #7b878e; font-size: 11px; }
.microcopy code { color: #375a53; }
.rights-check { grid-template-columns: auto 1fr; align-items: start; gap: 9px; margin-top: 13px; padding: 12px 13px; border-radius: 10px; background: #f6f8f9; font-weight: 600; line-height: 1.45; }
.rights-check input { width: 15px; height: 15px; margin: 2px 0 0; accent-color: #17675a; }
.batch-actions { display: flex; align-items: center; gap: 10px; margin-top: 15px; }
.overall-status { margin-left: auto; color: #697780; font-size: 12px; font-weight: 700; }
.overall-status.error { color: #a23a32; }
.overall-status.success { color: #17624a; }
.progress-card { min-height: 220px; }
.summary { color: #52636d; font-size: 12px; font-weight: 800; }
.table-wrap { margin-top: 16px; overflow: auto; border: 1px solid #e3e8ea; border-radius: 11px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 10px 12px; text-align: left; color: #66757d; background: #f5f7f8; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
td { padding: 11px 12px; border-top: 1px solid #edf0f2; vertical-align: top; }
td.source-cell { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.reason-cell { min-width: 180px; max-width: 360px; color: #7a878e; overflow-wrap: anywhere; }
td.reason-cell.has-error { color: #a63d35; }
.empty-row td { padding: 42px 16px; color: #8a959b; text-align: center; }
.row-status { font-weight: 800; }
.row-status.completed { color: #18714f; }
.row-status.failed { color: #a63d35; }
.row-status.running, .row-status.waiting { color: #9a6718; }
.text-button { padding: 4px; color: #697780; background: transparent; font-size: 12px; }
pre { max-height: 260px; margin: 15px 0 0; padding: 14px; overflow: auto; border-radius: 10px; background: #13211f; color: #c9ded9; white-space: pre-wrap; overflow-wrap: anywhere; font: 11px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
@media (max-width: 1020px) { .workspace { grid-template-columns: 300px minmax(0,1fr); padding-left: 18px; padding-right: 18px; } }
@media (max-width: 800px) {
  .topbar { align-items: flex-start; padding: 22px 18px; }
  .topbar p, .safety-badge { display: none; }
  .topbar h1 { font-size: 23px; }
  .workspace { display: block; padding: 16px; }
  .connections, .main-panel { margin-bottom: 18px; }
  .batch-actions { flex-wrap: wrap; }
  .overall-status { width: 100%; margin-left: 0; }
  .batch-card, .progress-card, .log-card { padding: 18px; }
}
