:root {
  --ink: #17231f;
  --muted: #68736e;
  --paper: #f4f2ec;
  --panel: #fffefa;
  --line: #deded6;
  --green: #1c6048;
  --green-soft: #e4f0e9;
  --red: #a34135;
  --red-soft: #f7e6e2;
  --amber: #9a6d18;
  --amber-soft: #f7efd8;
  --shadow: 0 12px 34px rgba(29, 43, 37, .07);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button:disabled { cursor: not-allowed; opacity: .45; }
.topbar { height: 70px; padding: 0 max(24px, calc((100vw - 1240px) / 2)); background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 42px; position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.03em; font-size: 17px; }
.brand span { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--ink); color: white; font-size: 11px; letter-spacing: .02em; }
nav { display: flex; align-self: stretch; gap: 28px; flex: 1; }
nav a { color: var(--muted); display: grid; place-items: center; border-bottom: 2px solid transparent; font-size: 13px; font-weight: 600; }
nav a:hover, nav a.active { color: var(--ink); border-color: var(--green); }
.shell { max-width: 1240px; margin: 0 auto; padding: 46px 24px 80px; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 20%, #e7ede7, var(--paper) 48%); }
.auth-card { width: min(440px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 38px; box-shadow: var(--shadow); }
.auth-brand { margin-bottom: 44px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(31px, 4vw, 46px); letter-spacing: -.055em; line-height: 1.02; margin-bottom: 10px; }
h2 { font-size: 18px; letter-spacing: -.025em; margin-bottom: 8px; }
.kicker { margin-bottom: 10px; color: var(--green); text-transform: uppercase; letter-spacing: .16em; font-size: 10px; font-weight: 800; }
.muted, .hint, .page-note { color: var(--muted); line-height: 1.55; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.page-head h1 { margin-bottom: 0; }
.page-note { max-width: 420px; margin: 0 0 3px; text-align: right; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 26px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.card-head h2 { margin: 0; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.stack { display: grid; gap: 18px; margin-top: 24px; }
.stack.compact { grid-template-columns: 1fr auto; align-items: end; }
label { color: #4f5c56; display: grid; gap: 7px; font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 9px; padding: 11px 12px; outline: none; transition: border .15s, box-shadow .15s; }
textarea { resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: #76a18e; box-shadow: 0 0 0 3px rgba(47, 121, 88, .1); }
.button { border: 1px solid transparent; border-radius: 9px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; cursor: pointer; font-weight: 750; font-size: 12px; }
.button.primary { background: var(--green); color: white; }
.button.primary:hover { background: #154c39; }
.button.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.button.small { min-height: 32px; padding: 0 11px; font-size: 11px; }
.button.large { min-height: 48px; padding: 0 26px; }
.link { padding: 0; border: 0; background: transparent; color: var(--green); font-weight: 750; font-size: 12px; cursor: pointer; }
.link.danger { color: var(--red); }
.flash, .notice { border: 1px solid #cfd9d1; background: var(--green-soft); color: #275a43; border-radius: 10px; padding: 12px 14px; margin-bottom: 20px; font-weight: 650; }
.flash.error { background: var(--red-soft); border-color: #ebc4bc; color: var(--red); }
.notice { background: var(--amber-soft); border-color: #ead89e; color: #745415; }
.notice.success { background: var(--green-soft); border-color: #cfd9d1; color: #275a43; }
.count { min-width: 27px; height: 27px; padding: 0 8px; display: grid; place-items: center; background: var(--paper); border-radius: 999px; color: var(--muted); font-size: 11px; font-weight: 800; }
.account-list, .preset-list { border-top: 1px solid var(--line); }
.account-row, .preset-row { min-height: 68px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); }
.account-row div, .preset-row div, .job-row > span { display: grid; gap: 4px; }
small { color: var(--muted); font-size: 10px; font-weight: 550; }
.status { width: max-content; border-radius: 999px; padding: 5px 9px; background: var(--paper); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 9px; font-weight: 850; }
.status.live, .status.done { background: var(--green-soft); color: var(--green); }
.status.dead, .status.error, .status.canceled { background: var(--red-soft); color: var(--red); }
.status.queued { background: var(--amber-soft); color: var(--amber); }
.status.running { background: #e4edf6; color: #345d86; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.job-form { display: grid; gap: 20px; }
.section-title { display: flex; align-items: start; gap: 14px; margin-bottom: 22px; }
.section-title > span, .advanced summary b { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--green); font-size: 9px; }
.section-title p { color: var(--muted); margin: 0; font-size: 12px; }
fieldset { border: 0; padding: 0; margin: 0 0 24px; }
legend { color: #4f5c56; font-size: 12px; font-weight: 700; margin-bottom: 10px; }
.checks { display: flex; flex-wrap: wrap; gap: 9px; }
.checks label { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #fff; padding: 9px 11px; border-radius: 8px; font-weight: 650; cursor: pointer; }
.checks input { width: auto; margin: 0; accent-color: var(--green); }
.field-grid { display: grid; gap: 15px; }
.field-grid.four { grid-template-columns: repeat(4, 1fr); }
.advanced { padding: 0; }
.advanced summary { padding: 22px 26px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none; }
.advanced summary span { display: flex; align-items: center; gap: 14px; }
.advanced summary small { text-transform: uppercase; letter-spacing: .1em; }
.advanced-body { border-top: 1px solid var(--line); padding: 26px; }
.toggles { margin-top: 22px; }
.action-card { display: grid; grid-template-columns: 1fr 330px auto; gap: 24px; align-items: end; }
.action-card h2 { margin: 0; }
.table-card { padding: 0; overflow: hidden; }
.table-card .card-head { padding: 22px 24px; margin: 0; border-bottom: 1px solid var(--line); }
.live-indicator { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; font-weight: 750; }
.live-indicator i { width: 7px; height: 7px; border-radius: 50%; background: #39a36c; box-shadow: 0 0 0 4px #ddf2e6; }
.job-row { display: grid; grid-template-columns: 70px minmax(230px, 1fr) 90px 90px 90px 100px; align-items: center; gap: 18px; min-height: 72px; padding: 12px 24px; border-bottom: 1px solid var(--line); }
.job-header { min-height: 42px; background: #f7f6f1; color: var(--muted); text-transform: uppercase; letter-spacing: .09em; font-size: 9px; font-weight: 800; }
.progress { height: 5px; background: #e5e7e2; border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--green); border-radius: inherit; transition: width .35s ease; }
.progress-cell { gap: 7px !important; }
.source-columns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
code { border-radius: 5px; background: #eeeee8; padding: 2px 5px; color: #46544d; font-size: 11px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
details summary { cursor: pointer; font-weight: 750; }
.narrow { max-width: 700px; }
@media (max-width: 900px) {
  .topbar { padding: 0 16px; gap: 16px; }
  nav { gap: 12px; overflow-x: auto; }
  nav a { white-space: nowrap; }
  .topbar form { display: none; }
  .split, .action-card { grid-template-columns: 1fr; }
  .field-grid.four { grid-template-columns: repeat(2, 1fr); }
  .job-table { overflow-x: auto; }
  .job-row { min-width: 820px; }
}
@media (max-width: 620px) {
  .shell { padding: 30px 14px 60px; }
  .brand { font-size: 0; }
  .page-head { align-items: start; flex-direction: column; }
  .page-note { text-align: left; }
  .field-grid.four { grid-template-columns: 1fr; }
  .stack.compact { grid-template-columns: 1fr; }
}

