:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --account-list-max-height: 312px;
  --task-list-max-height: 456px;
}
* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
body { margin: 0; background: #f5f7fb; color: #182033; }
header { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; background: linear-gradient(135deg, #1f5eff, #5936d8); color: white; box-shadow: 0 6px 18px rgba(31, 94, 255, .18); }
h1 { margin: 0; font-size: 22px; }
button { border: 0; border-radius: 8px; padding: 8px 12px; background: #2457ff; color: white; cursor: pointer; font-weight: 600; }
button:hover { filter: brightness(.95); }
button.secondary { background: #eef3ff; color: #2457ff; border: 1px solid #c9d7ff; }
button.danger { background: #fff1f1; color: #b42318; border: 1px solid #ffd0d0; }
input, select, textarea { box-sizing: border-box; width: 100%; border: 1px solid #d9deea; border-radius: 8px; padding: 9px 10px; background: white; color: #182033; }
textarea { resize: vertical; }
label { display: flex; align-items: center; gap: 6px; font-size: 14px; }
label input[type="checkbox"] { width: auto; }
.field { display: grid; align-items: start; gap: 6px; color: #344054; font-weight: 600; }
.field input, .field select, .field textarea { font-weight: 400; }
.grid { display: grid; grid-template-columns: minmax(360px, 440px) minmax(0, 1fr); gap: 14px; align-items: start; padding: 14px; width: 100%; max-width: 100vw; }
.column { min-width: 0; display: grid; gap: 14px; align-content: start; }
.card { min-width: 0; background: white; border: 1px solid #e7eaf2; border-radius: 14px; padding: 14px; box-shadow: 0 8px 24px rgba(24, 32, 51, .06); }
.card h2 { margin: 0 0 12px; font-size: 18px; }
#accountForm, .task-form { display: grid; gap: 10px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.inputs label { display: grid; align-items: start; }
.target-slots-editor { display: grid; gap: 10px; border: 1px dashed #cfd7ea; border-radius: 12px; padding: 12px; background: #fbfcff; }
.section-title { font-weight: 700; color: #344054; }
.target-slots-rows { display: grid; gap: 10px; }
.target-slot-row { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(150px, 1fr) auto; gap: 8px; align-items: end; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; min-width: 0; }
.list, .tasks { display: grid; gap: 10px; align-items: stretch; margin-top: 12px; overflow-y: auto; padding: 2px 6px 2px 2px; scrollbar-gutter: stable; }
#accountsList { max-height: var(--account-list-max-height); }
#tasksList { max-height: var(--task-list-max-height); }
.item, .task { width: 100%; border: 1px solid #e7eaf2; border-radius: 12px; padding: 12px; background: #fbfcff; }
.task { cursor: pointer; }
.task.selected { border-color: #2457ff; box-shadow: inset 0 0 0 1px #2457ff; }
.task-main { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.task small { display: block; margin-top: 4px; color: #667085; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.badge { border-radius: 999px; padding: 3px 9px; font-size: 12px; background: #e8edf8; color: #3b465c; }
.badge.running { background: #fff3cf; color: #8a5a00; }
.badge.completed { background: #d9fbe6; color: #087443; }
.badge.failed { background: #ffe0e0; color: #b42318; }
.badge.stopped, .badge.stopping { background: #eceff5; color: #475467; }
.muted { color: #667085; }
#logBox { min-width: 0; width: 100%; min-height: 260px; max-height: var(--task-list-max-height); overflow: auto; background: #101828; color: #d1e9ff; border-radius: 12px; padding: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 1100px) {
  .grid { grid-template-columns: 1fr; }
  #accountsList { max-height: min(var(--account-list-max-height), 45vh); }
  #tasksList { max-height: min(var(--task-list-max-height), 55vh); }
  .target-slot-row { grid-template-columns: 1fr; }
}
