:root {
  --side: #eef8ff;
  --active: #dcecff;
  --page: #ffffff;
  --panel: #f7f9ff;
  --head: #f4f7ff;
  --line: #e8eef7;
  --text: #111827;
  --muted: #7b879a;
  --blue: #1677ff;
  --red: #ff4d4f;
  --green: #52c41a;
  --orange: #faad14;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--side); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled, .text-btn:disabled, .primary:disabled, .secondary:disabled, .danger-btn:disabled,
button.is-disabled, .text-btn.is-disabled { opacity: .45; cursor: not-allowed; }
.login-page { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #edf8ff, #fff); }
.login-card { width: 420px; padding: 34px; border-radius: 10px; background: #fff; box-shadow: 0 18px 50px rgba(15,23,42,.14); }
.login-card h1 { margin: 0 0 6px; font-size: 24px; }
.login-card p { margin: 0 0 24px; color: var(--muted); }

.layout { min-height: 100vh; display: flex; }
.sidebar { display: flex; flex-direction: column; overflow: hidden; position: fixed; inset: 0 auto 0 0; width: 250px; padding: 22px 16px; background: linear-gradient(180deg, #eef4ff 0%, #edfaff 100%); border-right: 1px solid #dbe6f3; }
.sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; margin-top: 8px; }
.brand { flex-shrink: 0; height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 12px; font-size: 18px; font-weight: 700; }
.brand-logo { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--red); color: #fff; }
.nav, .nav-parent { width: 100%; height: 40px; margin-top: 6px; padding: 0 16px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 8px; background: transparent; color: #17233f; text-align: left; }
.nav:hover, .nav.active, .nav-parent.active { background: var(--active); }
.nav .ico, .nav-parent .ico { width: 18px; color: #64748b; }
.nav.sub { height: 36px; padding-left: 48px; font-size: 14px; }
.nav-group { margin-top: 8px; padding-top: 8px; border-top: 1px solid #dbe6f3; }
.schedule-nav-links.is-collapsed { display: none; }
.nav-chevron { margin-left: auto; width: 16px; height: 16px; flex: 0 0 16px; display: grid; place-items: center; line-height: 0; transform-origin: center; }
.nav-chevron svg { display: block; width: 16px; height: 16px; }
.nav-parent[aria-expanded="false"] .nav-chevron { transform: rotate(-90deg); }
.user-box { flex-shrink: 0; margin-top: 12px; min-height: 62px; display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid #d8e4f2; border-radius: 14px; background: rgba(255,255,255,.55); }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: #d7a514; color: #fff; }
.user-box strong, .user-box small { display: block; }
.user-box small { margin-top: 3px; color: #667899; font-size: 12px; }
.logout { margin-left: auto; border: 0; background: transparent; color: #64748b; }

.main { width: calc(100% - 250px); min-height: 100vh; margin-left: 250px; background: var(--side); }
.page { min-height: 100vh; padding: 34px 38px; background: var(--page); border-radius: 22px 0 0 22px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; line-height: 32px; }
.tabs { display: flex; gap: 28px; margin-top: 12px; }
.tab { border: 0; background: transparent; padding: 0 0 8px; color: #111827; }
.tab.active { color: var(--red); border-bottom: 2px solid var(--red); font-weight: 700; }
.head-actions, .toolbar, .filterbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.filterbar { margin-bottom: 18px; gap: 16px 22px; }
.filterbar label, .form-row label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.filterbar > label { min-width: 0; max-width: 100%; }
input, select, textarea { min-height: 36px; border: 1px solid #d6dce6; border-radius: 6px; background: #fff; padding: 0 12px; color: #111827; }
textarea { min-height: 82px; padding-top: 10px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #b7beca; }
.wide { width: 230px; max-width: 100%; }
.filterbar select.wide, .filterbar input.wide {
  width: 230px;
  max-width: min(230px, 100%);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filterbar select.wide option { max-width: 230px; overflow: hidden; text-overflow: ellipsis; }

.search-combobox { position: relative; display: inline-block; width: 230px; max-width: 100%; }
.search-combobox input { width: 100%; }
.search-combobox-list { position: absolute; z-index: 35; top: 100%; left: 0; right: 0; margin-top: 4px; padding: 6px 0; border-radius: 8px; background: #fff; border: 1px solid #e5eaf2; box-shadow: 0 12px 28px rgba(15,23,42,.12); max-height: 220px; overflow: auto; }
.search-combobox-item { display: block; width: 100%; padding: 8px 14px; border: 0; background: transparent; text-align: left; color: #344054; font-size: 14px; cursor: pointer; overflow: hidden; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
.search-combobox-item:hover, .search-combobox-item.is-active { background: #f0f5ff; color: #1d2939; }
.search-combobox-item mark { background: transparent; color: var(--red); font-weight: 600; }
.search-combobox-empty { padding: 10px 14px; color: var(--muted); font-size: 13px; text-align: center; }

.primary, .secondary, .text-btn, .danger-btn, .icon-btn { border: 0; }
.primary, .secondary, .danger-btn { min-height: 36px; border-radius: 999px; padding: 0 18px; }
.primary { background: var(--red); color: #fff; }
.primary:hover { background: #ff6b6d; }
.secondary { background: #eef3fb; color: #344054; }
.danger-btn { background: #fff1f0; color: #d9363e; }
.text-btn { min-height: 28px; padding: 0 6px; background: transparent; color: var(--blue); }
.icon-btn { width: 32px; height: 32px; border-radius: 50%; background: transparent; color: #718096; font-size: 18px; }
.icon-btn:hover { background: #eef3fb; }
.hint { color: var(--muted); font-size: 13px; }

.cards { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 16px; margin-bottom: 22px; }
.metric { min-height: 118px; padding: 24px 26px; border-radius: 10px; background: var(--panel); position: relative; }
.metric span { color: var(--muted); }
.metric strong { display: block; margin-top: 20px; font-size: 34px; }
.metric i { position: absolute; right: 24px; top: 24px; color: #8b9cff; font-style: normal; font-size: 24px; }
.metric.success i { color: #66d49a; }
.metric.warn i { color: #ff9f7f; }
.panel, .soft-panel { margin-bottom: 22px; border-radius: 8px; background: #fff; }
.soft-panel { padding: 22px 28px; background: var(--panel); }
.panel-title { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.chart { height: 290px; position: relative; border-radius: 8px; background: repeating-linear-gradient(to bottom, transparent 0, transparent 68px, #e4eaf5 69px); overflow: hidden; }
.chart::before { content: ""; position: absolute; left: 50px; right: 50px; bottom: 92px; height: 2px; background: linear-gradient(90deg, #22d3ee, #8057ff); }
.seg { display: inline-flex; flex-shrink: 0; padding: 3px; border-radius: 7px; background: #edf1f7; }
.seg button { height: 28px; white-space: nowrap; border: 0; border-radius: 5px; background: transparent; padding: 0 14px; color: #667085; }
.seg button.active { background: #fff; color: #111827; box-shadow: 0 1px 4px rgba(16,24,40,.08); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.dashboard-panel { min-height: 360px; padding: 28px 30px; border-radius: 8px; background: #f5f7fd; overflow: hidden; }
.dashboard-panel .panel-title { margin-bottom: 28px; }
.dashboard-panel h2 { font-size: 20px; }
.panel-link { border: 0; background: transparent; color: #7c879d; font-size: 15px; }
.panel-link:hover { color: var(--blue); }
.today-status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.today-status { min-height: 132px; display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto 1fr; align-items: center; padding: 20px 24px; border-radius: 8px; background: #fff; }
.today-status .dash-icon { font-size: 25px; }
.dash-icon.green { color: #20bf55; }
.dash-icon.orange { color: #ff8a34; }
.dash-icon.red { color: #ff5b64; }
.today-status strong { grid-column: 2; align-self: end; font-size: 34px; font-weight: 500; }
.dashboard-table-wrap { max-height: 274px; overflow: auto; border-radius: 8px; background: #fff; }
/* Keep all recent failures reachable inside the bounded dashboard panel. */
.dashboard-table-wrap.table-scroll { overflow-y: auto; }
.dashboard-table-wrap table { min-width: 650px; }
.dashboard-table-wrap th { background: #fff; color: #17233f; }
.agent-status-content { min-height: 260px; display: flex; align-items: center; justify-content: space-around; gap: 36px; }
.donut { width: 244px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(#4e83ee 0 calc(var(--running) * 1%), #58c778 calc(var(--running) * 1%) calc(var(--idle) * 1%), #f0ad4e calc(var(--idle) * 1%) calc(var(--recovering, var(--idle)) * 1%), #9472bf calc(var(--recovering, var(--idle)) * 1%) calc(var(--maintenance, var(--idle)) * 1%), #dfe6f2 calc(var(--maintenance, var(--idle)) * 1%) 100%); position: relative; }
.donut::after { content: ""; position: absolute; width: 72%; aspect-ratio: 1; border-radius: 50%; background: #f5f7fd; }
.donut div { z-index: 1; text-align: center; }
.donut strong, .donut span { display: block; }
.donut strong { font-size: 36px; }
.donut span { margin-top: 8px; }
.legend { display: grid; gap: 20px; min-width: 130px; }
.legend span { display: flex; align-items: center; gap: 10px; }
.legend i { width: 16px; height: 16px; border-radius: 5px; background: #dfe6f2; }
.legend i.blue { background: #4e83ee; }
.legend i.green { background: #58c778; }
.agent-status-panel .legend i.recovering { background: #f0ad4e; }
.agent-status-panel .legend i.maintenance, .gantt-status-dot.st-maintenance { background: #9472bf; }
.gantt-status-dot.st-recovering { background: #f0ad4e; }
.agent-status-panel .agent-state-label { display: inline; }
.agent-status-panel .agent-state-label b { font-weight: inherit; }
.top-list { min-height: 260px; display: grid; align-content: center; gap: 18px; }
.top-row { display: grid; grid-template-columns: 28px minmax(0, 140px) minmax(0, 1fr) max-content; align-items: center; gap: 12px; }
.top-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-row > div { height: 10px; border-radius: 5px; background: #e5eaf4; overflow: hidden; }
.top-row > div i { display: block; height: 100%; border-radius: inherit; background: #4e83ee; }
.top-row em { color: #667085; font-style: normal; text-align: right; white-space: nowrap; }
.dashboard-empty { min-height: 240px; display: grid; place-items: center; color: #8b95a5; }

.table-scroll { width: 100%; position: relative; overflow-x: auto; overflow-y: hidden; }
table { width: 100%; min-width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 14px; }
th, td { height: 58px; padding: 0 18px; border-bottom: 1px dashed var(--line); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
th { color: #253858; background: var(--head); font-weight: 600; }
th.cell-center, td.cell-center, th.actions, td.actions { text-align: center; }
th.resizable-column { position: relative; }
.column-resizer { position: absolute; z-index: 6; top: 0; right: -5px; width: 10px; height: 100%; cursor: col-resize; touch-action: none; user-select: none; }
.column-resizer::after { content: ""; position: absolute; top: 12px; bottom: 12px; left: 4px; width: 2px; border-radius: 1px; background: transparent; transition: background .15s; }
.column-resizer:hover::after, .column-resizer:focus-visible::after, .column-resizing .column-resizer::after { background: #91caff; }
.column-resizer:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; border-radius: 3px; }
.column-resizing, .column-resizing * { cursor: col-resize !important; user-select: none !important; }
table.has-frozen-actions th.actions, table.has-frozen-actions td.actions { position: sticky; right: 0; width: 1%; min-width: min-content; border-left: 1px solid #dfe7f1; white-space: nowrap; }
table.has-frozen-actions th.actions { z-index: 8; background: var(--head); }
table.has-frozen-actions td.actions { z-index: 4; overflow: visible; background: #fff; }
table.has-frozen-actions td.actions .text-btn,
table.has-frozen-actions td.actions .more-wrap { vertical-align: middle; }
table.has-frozen-actions tr.menu-open td.actions { z-index: 22; }
.dashboard-table-wrap { --table-head-background: #fff; }
.dashboard-table-wrap table.has-frozen-actions th.actions { background: var(--table-head-background); }
tr.menu-open { position: relative; z-index: 20; }
.empty { height: 220px; text-align: center; color: #8b95a5; }
.pager { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 14px; padding: 0 18px 18px; }
.pager .pager-btn { width: auto; min-width: 68px; height: 32px; padding: 0 12px; }
.pager button:disabled { cursor: not-allowed; opacity: .45; }
.pager select { height: 32px; min-width: 102px; }
.page-number { min-width: 32px; height: 32px; padding: 0 8px; display: grid; place-items: center; border: 1px solid var(--blue); border-radius: 6px; color: var(--blue); }
.status { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: 6px; background: #eef2f6; color: #475467; }
.status.online, .status.success, .status.enabled { background: #f0fff0; color: var(--green); border: 1px solid #b7eb8f; }
.status.busy, .status.running, .status.queued { background: #e6f4ff; color: var(--blue); }
.status.failed, .status.offline, .status.disabled { background: #fff1f0; color: #ff4d4f; }
.status.missing { background: #fff1f0; color: #cf1322; border: 1px solid #ffa39e; }
.status.maintenance { background: #f2eafa; color: #6e468a; }
.status.recovering { background: #fff4e3; color: #82501c; }
.status.warning { background: #fff7e6; color: #d46b08; border: 1px solid #ffd591; }
.switch { display: inline-flex; align-items: center; width: 36px; height: 20px; position: relative; vertical-align: middle; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; z-index: 1; cursor: pointer; }
.switch input:focus-visible + span { outline: 2px solid #2563eb; outline-offset: 3px; }
.switch input:disabled { cursor: not-allowed; }
.switch span { position: absolute; inset: 0; border-radius: 10px; background: #cbd2dc; transition: .18s; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.25); transition: .18s; }
.switch input:checked + span { background: #4f82ee; }
.switch input:checked + span::after { transform: translateX(16px); }
.more-wrap { display: inline-block; position: relative; }
.action-menu { position: fixed; display: block; z-index: 100; inset: auto; margin: 0; width: 128px; padding: 8px 0; border: 0; border-radius: 8px; overflow-y: auto; background: #fff; box-shadow: 0 10px 30px rgba(15,23,42,.18); }
.action-menu button { display: block; box-sizing: border-box; width: 100%; height: 36px; padding: 0 18px; border: 0; background: transparent; text-align: left; color: #344054; }
.action-menu button:hover { background: #f5f7fb; }
.danger-text { color: #ff4d4f !important; }

.robot-tabs { display: flex; gap: 24px; margin-bottom: 18px; font-size: 17px; }
.robot-tabs button { border: 0; background: transparent; padding-bottom: 8px; }
.robot-tabs button.active { color: var(--red); border-bottom: 2px solid var(--red); font-weight: 700; }
.pills { display: inline-flex; border-radius: 6px; background: #eef3fb; overflow: hidden; }
.pills button { height: 34px; border: 0; padding: 0 14px; background: transparent; }
.pills button.active { background: #fff; border: 1px solid #d6e4ff; }
.robots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.robot-card { min-height: 172px; padding: 14px; border-radius: 8px; background: var(--panel); }
.robot-screen { height: 88px; display: grid; place-items: center; border-radius: 4px; background: #fff; color: #dbe5ff; font-size: 50px; position: relative; overflow: hidden; }
.robot-screen.clickable { width: 100%; cursor: pointer; background: linear-gradient(180deg, #f4f8ff, #eaf2ff); color: #5b7cbb; font-size: 13px; border: 1px dashed #c9daf5; }
.robot-screen.clickable:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; }
.robot-screen.clickable:hover { background: linear-gradient(180deg, #eaf3ff, #dcecff); border-color: #1677ff; color: #1677ff; }
.robot-screen.offline { opacity: .7; }
.robot-screen-hint { padding: 0 10px; text-align: center; line-height: 1.4; }
.preview-mask { z-index: 40; }
.preview-modal { width: min(1100px, calc(100vw - 48px)); max-height: calc(100vh - 40px); }
.preview-body { padding: 0 !important; background: #0f172a; }
.preview-stage { position: relative; min-height: 420px; display: grid; place-items: center; background: #0f172a; }
.preview-stage img { max-width: 100%; max-height: calc(100vh - 180px); display: none; background: #000; }
.preview-stage img.ready { display: block; }
.preview-status { position: absolute; inset-inline: 16px; text-align: center; overflow-wrap: anywhere; color: #cbd5e1; font-size: 14px; }
.preview-status.error { color: #ff7875; }
.preview-modal .modal-head h3 { display: flex; align-items: center; gap: 10px; }
.preview-modal .modal-foot { justify-content: space-between; }
.robot-line { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 12px; font-weight: 600; min-width: 0; }
.robot-statuses { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 100%; }
.robot-name { display: block; width: 100%; min-width: 0; overflow-wrap: anywhere; line-height: 1.5; }
.robot-line .status { flex-shrink: 0; }
.robot-card small { display: block; margin-top: 8px; color: #667899; overflow-wrap: anywhere; }
.robot-card .robot-remark { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; white-space: pre-wrap; line-height: 1.6; max-height: 4.8em; }
.robot-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.robot-actions button { flex-shrink: 0; white-space: nowrap; }
#agent-edit-error { grid-column: 1 / -1; color: #c93244; overflow-wrap: anywhere; line-height: 1.6; }
.agent-queue-modal { width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 40px); }
.agent-queue-modal .modal-body { overflow: auto; }
.agent-queue-hint { margin-bottom: 12px; }
.agent-queue-empty { overflow-wrap: anywhere; padding: 32px 16px; line-height: 1.7; }
.agent-queue-task-name { display: block; overflow: hidden; text-overflow: ellipsis; }
.agent-queue-status { display: flex; align-items: center; gap: 5px; margin-top: 5px; font-size: 12px; }
.agent-queue-modal table { min-width: 680px; }
.agent-queue-modal td.actions, .agent-queue-modal th.actions { width: 150px; }
.member-list { max-height: 220px; display: grid; gap: 10px; padding: 12px; overflow: auto; border: 1px solid #e5eaf2; border-radius: 6px; }
.credential-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.credential-choice { min-height: 54px; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; }
.credential-choice span { min-width: 0; display: grid; gap: 3px; }
.credential-choice small { color: #7c879d; }
#schedule-form [data-schedule-credentials] .credential-choice { display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-flow: column; grid-auto-columns: max-content; min-width: 0; text-align: left; }
#schedule-form .credential-choice > span { grid-template-columns: minmax(0, 1fr); white-space: normal; overflow-wrap: anywhere; }
#schedule-form .credential-choice > span > strong, #schedule-form .credential-choice > span > small { min-width: 0; }
.input-action { display: flex; align-items: center; gap: 8px; }
.input-action input { flex: 1; min-width: 0; }
.api-trigger-fields { width: 100%; display: grid; gap: 12px; }
.settings-panel { padding: 26px 30px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.settings-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.cache-settings-row { display: flex; align-items: center; gap: 12px; max-width: 360px; }
.cache-settings-row input { flex: 1; min-width: 0; }
.muted-hint { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.credential-actions { white-space: nowrap; }
.member-list label { justify-content: flex-start; }
.upload-form { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.doc-link { color: #2563eb; font-size: 14px; text-decoration: none; white-space: nowrap; }
.doc-link:hover { text-decoration: underline; }

.modal-mask, .drawer-mask { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.42); display: flex; align-items: center; justify-content: center; }
.modal { width: min(940px, calc(100vw - 90px)); max-height: calc(100vh - 70px); display: flex; flex-direction: column; border-radius: 10px; background: #fff; box-shadow: 0 18px 45px rgba(15,23,42,.22); }
.modal.small { width: min(620px, calc(100vw - 32px)); }
.modal-head, .modal-foot { min-height: 64px; display: flex; align-items: center; padding: 0 30px; border-bottom: 1px solid #eef1f5; }
.modal-head button { margin-left: auto; }
.modal-body { padding: 22px 30px; overflow: auto; }
.modal-foot { justify-content: flex-end; gap: 12px; border-top: 1px solid #eef1f5; border-bottom: 0; }
.form-grid { display: grid; gap: 18px; }
.form-row { display: grid; gap: 8px; }
.section-box { padding: 18px 20px; background: #fafbff; border-radius: 4px; }
.section-title { margin-bottom: 14px; font-weight: 700; }
.radio-line, .check-line { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.radio-line label, .check-line label { display: inline-flex; align-items: center; gap: 7px; }
.inline-options { margin-top: 14px; padding: 14px; border: 1px solid #e5eaf2; background: #fff; }
.dashed-picker { width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px dashed #dfe7f1; border-radius: 4px; background: #fff; color: #4b5563; }
.dashed-picker span { color: var(--red); font-size: 22px; }
.picker-panel { margin-top: 10px; padding: 14px; border: 1px solid #e5eaf2; border-radius: 8px; background: #fff; box-shadow: 0 12px 28px rgba(15,23,42,.12); }
.picker-search { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.picker-search input { flex: 1; }
.picker-list { display: grid; gap: 8px; max-height: 230px; overflow: auto; }
.picker-row, .agent-picker-row { min-height: 52px; display: grid; align-items: center; gap: 12px; border: 1px solid #eef1f5; border-radius: 6px; background: #fff; padding: 8px 12px; text-align: left; }
.picker-row { grid-template-columns: 40px 1fr auto; }
.agent-picker-row, .agent-picker-head { grid-template-columns: 1.2fr .8fr 1fr 1fr; }
.agent-picker-head { display: grid; gap: 12px; padding: 8px 12px; background: #f7f9fc; color: #667085; border-radius: 6px; font-size: 13px; }
.picker-row:hover, .agent-picker-row:hover { border-color: #ffccc7; background: #fff7f6; }
.agent-picker-row:disabled { cursor: not-allowed; opacity: .58; background: #f8fafc; }
.agent-picker-row:disabled:hover { border-color: #eef1f5; background: #f8fafc; }
.app-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 7px; background: #eef3ff; color: #3156d4; font-weight: 700; font-size: 12px; }
.hidden { display: none !important; }
.empty-box { padding: 28px; text-align: center; color: var(--muted); background: #fafbff; border-radius: 6px; }
.drawer-mask { justify-content: flex-end; align-items: stretch; }
.drawer { width: calc(100vw - 60px); display: grid; grid-template-rows: 72px 1fr; background: #fff; box-shadow: -10px 0 40px rgba(15,23,42,.22); }
.drawer-head { display: flex; align-items: center; gap: 20px; padding: 0 34px; border-bottom: 1px solid #eef1f5; }
.drawer-head button { margin-left: auto; }
.drawer-body { display: grid; grid-template-columns: 340px 1fr 1.2fr; min-height: 0; }
.drawer-body.run-detail-grid { grid-template-columns: minmax(300px, .7fr) minmax(360px, .9fr) minmax(420px, 1fr); }
.drawer-col { padding: 28px; border-right: 1px solid #eef1f5; overflow: auto; }
.detail-list { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 14px 16px; margin: 22px 0 0; }
.detail-list dt { color: #7c879d; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.artifact-title { margin-top: 28px; }
.artifact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 14px; }
.artifact-grid a { display: grid; gap: 7px; color: #344054; text-decoration: none; }
.artifact-grid img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; border: 1px solid #e5eaf2; border-radius: 6px; background: #101828; }
.video-grid { display: grid; gap: 10px; margin-top: 14px; }
.video-grid video { width: 100%; max-height: 360px; border-radius: 8px; background: #101828; }
.empty-box.compact { margin-top: 22px; padding: 18px; }
.app-detail-modal { width: min(820px, calc(100vw - 90px)); }
.app-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.app-detail-grid > div { min-height: 92px; padding: 18px; border-radius: 6px; background: #f5f7fd; }
.app-detail-grid span, .app-detail-grid strong { display: block; }
.app-detail-grid span { color: #7c879d; }
.app-detail-grid strong { margin-top: 12px; font-size: 18px; overflow-wrap: anywhere; }
.detail-section { margin-top: 22px; }
.detail-section p, .detail-section code { display: block; margin-top: 10px; color: #475467; overflow-wrap: anywhere; }
.log-box { min-height: 180px; max-height: min(52vh, 520px); padding: 16px; border-radius: 8px; background: #101828; color: #d1fadf; overflow: auto; white-space: pre-wrap; }
.live-log-panel .log-box { height: min(56vh, 620px); max-height: min(56vh, 620px); }
.drawer .log-box { max-height: min(46vh, 460px); }
.loading { min-height: 220px; display: grid; place-items: center; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); padding: 10px 16px; border-radius: 8px; background: #111827; color: #fff; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60; }
.toast.show { opacity: 1; }

.param-editor { display: grid; gap: 12px; }
.param-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 13px 14px;
  border: 1px solid #dfe7f2;
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfdff 0%, #f7faff 100%);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.param-row > span {
  min-width: 0;
  display: block;
  color: #20304a;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.param-row > div { min-width: 0; display: grid; gap: 7px; }
.param-row input, .param-row select, .param-row textarea {
  width: 100%;
  min-width: 0;
  border-color: #cfd9e8;
  background: #fff;
}
.param-row input:focus, .param-row select:focus, .param-row textarea:focus {
  border-color: #98b8ee;
  box-shadow: 0 0 0 3px rgba(46, 111, 238, .12);
}

/* 附件参数控件 */
.param-file-widget { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; width: 100%; }
.param-file-list { display: grid; gap: 8px; flex-basis: 100%; min-width: 0; max-width: 100%; }
.param-file-item { display: flex; align-items: center; gap: 8px; min-width: 0; width: 100%; }
.param-file-item > button { flex: 0 0 auto; }
.param-file-widget > .param-file-actions, .param-file-widget > .param-file-limit-hint { flex-basis: 100%; min-width: 0; max-width: 100%; }
.param-file-widget .param-file-actions > button { flex: 0 0 auto; }
.param-file-widget .param-file-actions > .schedule-field-error { flex-basis: 100%; min-width: 0; max-width: 100%; order: 1; margin: 0; white-space: normal; overflow-wrap: anywhere; }
.param-file-name { font-size: 13px; color: #374151; flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.param-file-name.param-file-empty { color: #9ca3af; }
.param-file-widget.param-file-required-error .param-file-name { color: #e02424; }
.param-row textarea { min-height: 72px; font-family: Consolas, "Courier New", monospace; }
.param-row small { color: #667085; line-height: 1.45; overflow-wrap: anywhere; }
.trigger-input-editor { display: grid; gap: 10px; }
.trigger-input-row {
  display: grid;
  grid-template-columns: minmax(140px, .85fr) minmax(180px, 1.15fr) 56px;
  gap: 10px;
  align-items: center;
}
.trigger-input-row input { min-width: 0; width: 100%; }
.trigger-input-add { min-height: 46px; margin-top: 2px; }
.credential-items-editor { display: grid; gap: 10px; }
.credential-item-rows { display: grid; gap: 10px; }
.credential-item-row {
  display: grid;
  grid-template-columns: minmax(140px, .85fr) minmax(180px, 1.15fr) 56px;
  gap: 10px;
  align-items: center;
}
.credential-item-row input { min-width: 0; width: 100%; }
.credential-items-add { min-height: 46px; margin-top: 2px; }
.param-editor.empty .empty-box { margin: 0; }

.workflow-editor-grid { display: grid; grid-template-columns: minmax(360px, .95fr) minmax(420px, 1.05fr); gap: 22px; align-items: start; }
.workflow-step-list { display: grid; gap: 12px; }
.workflow-step-card { cursor: pointer; border: 1px solid transparent; }
.workflow-step-card.active { border-color: #ffccc7; background: #fff7f6; }
.workflow-branch-row { min-height: 52px; display: grid; grid-template-columns: minmax(132px, 150px) minmax(220px, 1.2fr) minmax(120px, .72fr) 24px minmax(180px, .9fr) 62px; gap: 10px; align-items: center; padding: 8px; border: 1px solid #e5eaf2; border-radius: 8px; background: #fff; }
.workflow-branch-row input, .workflow-branch-row select { min-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workflow-branch-row .branch-arrow { color: #667085; text-align: center; }
.workflow-run-detail-grid { grid-template-columns: minmax(320px, .75fr) minmax(420px, 1fr) minmax(520px, 1.1fr); }
.workflow-timeline { display: grid; gap: 8px; margin-top: 14px; }
.workflow-timeline-row { min-height: 44px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid #eef1f5; border-radius: 6px; background: #fff; text-align: left; }
.workflow-timeline-row.active, .workflow-timeline-row:hover { border-color: #ffccc7; background: #fff7f6; }
.workflow-timeline-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workflow-timeline-row small { color: var(--muted); }

.guide-page { margin: 0; background: #f5f7fd; color: #111827; }
.guide-shell { max-width: 960px; margin: 0 auto; padding: 32px 24px 48px; }
.markdown-body { background: #fff; border: 1px solid #e8eef7; border-radius: 10px; padding: 32px 36px; line-height: 1.7; font-size: 15px; overflow-wrap: anywhere; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 { color: #111827; line-height: 1.35; margin: 1.6em 0 0.7em; }
.markdown-body h1 { font-size: 28px; margin-top: 0; padding-bottom: 12px; border-bottom: 1px solid #e8eef7; }
.markdown-body h2 { font-size: 22px; padding-bottom: 8px; border-bottom: 1px solid #eef1f5; }
.markdown-body h3 { font-size: 18px; }
.markdown-body h4 { font-size: 16px; }
.markdown-body p, .markdown-body ul, .markdown-body ol, .markdown-body blockquote, .markdown-body pre, .markdown-body table { margin: 0.85em 0; }
.markdown-body ul, .markdown-body ol { padding-left: 1.4em; }
.markdown-body li + li { margin-top: 0.35em; }
.markdown-body blockquote { padding: 10px 16px; border-left: 4px solid #1677ff; background: #f7f9ff; color: #475467; }
.markdown-body code { font-family: Consolas, "Courier New", monospace; font-size: 0.92em; background: #f4f6fb; padding: 0.15em 0.35em; border-radius: 4px; }
.markdown-body pre { padding: 14px 16px; overflow: auto; overflow-wrap: normal; border-radius: 8px; background: #0f172a; color: #e2e8f0; }
.markdown-body pre code { background: transparent; padding: 0; color: inherit; }
.markdown-body table { width: 100%; border-collapse: collapse; font-size: 14px; }
.markdown-body th, .markdown-body td { border: 1px solid #e5eaf2; padding: 10px 12px; text-align: left; vertical-align: top; }
/* Markdown column alignment is emitted inline for both headings and data. */
.markdown-body th { vertical-align: middle; background: #f4f7ff; color: #344054; }
.markdown-body hr { border: 0; border-top: 1px solid #e8eef7; margin: 28px 0; }
.markdown-body a { color: #1677ff; text-decoration: none; }
.markdown-body a:hover { text-decoration: underline; }
.markdown-body img { max-width: 100%; height: auto; }
@media (max-width: 640px) {
  .guide-shell { padding: 12px 10px 24px; }
  .markdown-body { padding: 20px 16px; }
}

.docs-hub { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; min-height: calc(100vh - 140px); }
.docs-sidebar { background: #fff; border: 1px solid #e8eef7; border-radius: 10px; padding: 12px 10px; overflow: auto; max-height: calc(100vh - 140px); }
.docs-nav-group + .docs-nav-group { margin-top: 14px; padding-top: 12px; border-top: 1px solid #eef1f5; }
.docs-nav-heading { padding: 0 10px 8px; font-size: 12px; font-weight: 600; color: #64748b; letter-spacing: 0.02em; }
.docs-nav-item { width: 100%; margin-top: 4px; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: #17233f; text-align: left; font-size: 14px; cursor: pointer; }
.docs-nav-item:hover, .docs-nav-item.active { background: #eef4ff; color: #1677ff; }
.docs-content { display: flex; flex-direction: column; min-width: 0; min-height: calc(100vh - 140px); background: #fff; border: 1px solid #e8eef7; border-radius: 10px; overflow: hidden; }
.docs-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #e8eef7; background: #fafbff; }
.docs-toolbar h2 { margin: 0; font-size: 18px; font-weight: 600; color: #111827; }
.docs-load-error { margin: 24px; padding: 24px; border: 1px solid #e8eef7; border-radius: 10px; background: #f7f9ff; color: #344054; }
.docs-load-error h3 { margin: 0 0 10px; color: #111827; }
.docs-load-error button { scroll-margin-block: 12px; }
.docs-load-error p { margin: 0 0 16px; line-height: 1.6; }
.docs-frame { flex: 1; width: 100%; min-height: 520px; border: 0; background: #f5f7fd; }

/* ── Gantt (任务排期) ───────────────────────────────────────── */

/* Full-height page wrapper */
.view-gantt { display: flex; flex-direction: column; }
.page:has(.gantt-page) { display: flex; flex-direction: column; height: 100dvh; min-height: 0; overflow: hidden; }
.page:has(.gantt-page) > .page-head { flex-shrink: 0; }
#view-root:has(> .gantt-page) { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.gantt-page { display: flex; flex: 1; flex-direction: column; min-height: 0; overflow: hidden; }

/* ── Toolbar row (1.2×) ── */
.gantt-toolbar-row { display: flex; align-items: center; gap: 10px; flex-shrink: 0; padding: 8px 0 10px; flex-wrap: wrap; max-height: 90px; overflow: auto; }
.gantt-date-control { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 12px; border: 1px solid #d9e3f2; border-radius: 999px; background: linear-gradient(180deg, #fff, #f8fbff); box-shadow: 0 8px 24px rgba(30,64,175,.06); color: #344054; font-size: 14px; font-weight: 600; }
.gantt-date-control input { border: 0; background: transparent; color: #1d2939; font: inherit; outline: none; min-width: 126px; }
.gantt-zoom-btn { padding: 6px 16px; border: 1px solid var(--border); border-radius: 999px; background: #fff; cursor: pointer; font-size: 16px; color: #344054; }
.gantt-zoom-btn.compact { font-size: 14px; padding: 7px 14px; }
.gantt-zoom-btn:hover:not([disabled]) { background: #f0f4ff; }
.gantt-zoom-btn[disabled] { opacity: .4; cursor: default; }
.gantt-zoom-level { font-size: 16px; color: var(--muted); min-width: 72px; text-align: center; font-weight: 600; }
.gantt-follow-check { display: inline-flex; align-items: center; gap: 7px; font-size: 15px; color: #344054; cursor: pointer; user-select: none; margin-left: 6px; }
.gantt-follow-check input { width: 17px; height: 17px; cursor: pointer; accent-color: #1a73e8; }
.gantt-conflict-btn { margin-left: auto; padding: 7px 14px; border: 1px solid #d9e3f2; border-radius: 999px; background: #fff; color: #667085; font-weight: 700; cursor: default; }
.gantt-conflict-btn.has-conflict { cursor: pointer; color: #b42318; border-color: #fecdca; background: #fff6f5; box-shadow: 0 8px 24px rgba(180,35,24,.08); }
.gantt-conflict-btn[disabled] { opacity: .72; }

/* ── Gantt main (flex:1) ── */
.gantt-main { display: flex; flex: 1 1 0; min-height: 0; min-width: 0; overflow-x: auto; overflow-y: hidden; border: 1px solid #aebec5; border-radius: 8px; background: #fff; box-shadow: 0 12px 32px rgba(32,49,58,.10), inset 0 1px 0 rgba(255,255,255,.8); }

/* 4-corner frozen-header grid */
.gantt-grid-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%; flex-shrink: 0; min-height: 0;
}
.gantt-corner {
  position: relative;
  grid-row: 1; grid-column: 1;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; color: var(--muted); font-size: 15px;
  background: #f5f7fd; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
  box-sizing: border-box; z-index: 4;
}
.gantt-column-resizer { position: absolute; top: 0; right: -5px; bottom: 0; width: 10px; cursor: col-resize; touch-action: none; z-index: 5; }
.gantt-column-resizer:hover, .gantt-column-resizer:focus-visible { background: rgba(26,115,232,.25); outline: 2px solid #1a73e8; outline-offset: -3px; }
.gantt-column-resizing, .gantt-column-resizing * { cursor: col-resize !important; user-select: none !important; }
.gantt-header-scroll {
  grid-row: 1; grid-column: 2;
  overflow: hidden; z-index: 3;
}
.gantt-header { position: relative; background: #f5f7fd; border-bottom: 1px solid var(--border); }
.gantt-labels-scroll {
  grid-row: 2; grid-column: 1;
  overflow: hidden; background: #fafbfd; border-right: 1px solid var(--border); box-sizing: border-box; z-index: 3;
}
.gantt-scroll {
  grid-row: 2; grid-column: 2;
  min-width: 0; min-height: 0; overflow: auto; cursor: grab; position: relative; overscroll-behavior: contain;
}
.gantt-scroll:active { cursor: grabbing; }

/* Labels */
.gantt-label { position: relative; display: flex; align-items: center; justify-content: center; padding: 0 48px; font-size: 18px; color: #344054; border-bottom: 1px solid #eef1f5; white-space: nowrap; box-sizing: border-box; }
button.gantt-label { width: 100%; text-align: center; background: transparent; border: 0; border-bottom: 1px solid #eef1f5; border-radius: 0; }
.gantt-label > .robot-drag-handle { position: absolute; left: 14px; }
.gantt-label > .gantt-status-dot { position: absolute; left: 36px; }
.gantt-label-measure { position: fixed; left: 0; top: 0; width: max-content; visibility: hidden; pointer-events: none; }
.gantt-label-measure > .gantt-label { width: max-content; min-width: 110px; }
button.gantt-label:hover { background: #eef4ff; }
button.gantt-label:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; background: #eef4ff; }
.gantt-robot-order-hint { flex-shrink: 0; max-height: 40px; overflow: auto; color: var(--muted); font-size: 12px; line-height: 1.6; margin: 0 0 8px; overflow-wrap: anywhere; }
.gantt-robot-order-name { display: block; overflow-wrap: anywhere; line-height: 1.6; }
.gantt-robot-order-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.gantt-robot-order-actions .secondary { min-height: 40px; }

.gantt-status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.gantt-status-dot.st-online { background: #34A853; }
.gantt-status-dot.st-busy { background: #FBBC04; }
.gantt-status-dot.st-offline { background: #bbb; }

/* Time axis ticks */
.gantt-tick { position: absolute; top: 0; bottom: 0; }
.gantt-tick.major { border-left: 1px solid #c8cdd5; }
.gantt-tick.major span { position: absolute; top: 50%; transform: translateY(-50%); left: 7px; font-size: 16px; color: #475467; white-space: nowrap; font-weight: 500; }
.gantt-tick.mid { border-left: 1px solid #dde1e8; }
.gantt-tick.minor { border-left: 1px dashed #e5e7eb; }

/* Body / grid */
.gantt-body { position: relative; }
.gantt-work-hours { position: absolute; inset-block: 0; border-inline: 1px solid rgba(39,103,216,.07); background: rgba(39,103,216,.025); pointer-events: none; z-index: 0; }
.gantt-grid-line { position: absolute; top: 0; bottom: 0; pointer-events: none; }
.gantt-grid-line.major { border-left: 1px solid #e8eef7; }
.gantt-grid-line.minor { border-left: 1px dashed #f0f2f5; }

/* Now line */
.gantt-now-line { position: absolute; top: 0; bottom: 0; width: 2px; background: #EA4335; z-index: 3; pointer-events: none; }
.gantt-now-line::before { content: ""; position: absolute; top: -5px; left: -4px; width: 10px; height: 10px; background: #EA4335; border-radius: 50%; }

/* Rows */
.gantt-row { position: relative; border-bottom: 1px solid #eef1f5; }
.gantt-row-inner { position: relative; height: 100%; overflow-x: clip; }

/* Estimated execution / retry phases; transparent native hit targets stay independent. */
.gantt-block { position: absolute; border: 0; padding: 0; border-radius: 4px; background: transparent; z-index: 2; cursor: pointer; }
.gantt-block:focus-visible { outline-offset: -2px; }
.gantt-block-visual { position: absolute; top: 0; height: 100%; display: flex; border-radius: 4px; overflow: hidden; pointer-events: none; transition: filter .1s, transform .1s, box-shadow .1s; box-shadow: 0 5px 12px color-mix(in srgb, var(--task-color) 24%, transparent), inset 0 0 0 1px rgba(255,255,255,.22); }
.gantt-block:hover { z-index: 4; }
.gantt-block:hover .gantt-block-visual { filter: brightness(1.03) saturate(1.08); transform: translateY(-2px); box-shadow: 0 8px 18px color-mix(in srgb, var(--task-color) 34%, transparent), 0 0 0 1px color-mix(in srgb, var(--task-color) 70%, #fff); }
.gantt-block.workflow .gantt-block-visual { outline: 2px solid rgba(26,115,232,.28); outline-offset: 1px; }
.gantt-block.conflict .gantt-block-visual { outline: 2px solid rgba(217,45,32,.75); outline-offset: 2px; box-shadow: 0 0 0 1px rgba(255,255,255,.8), 0 8px 18px rgba(217,45,32,.22); }
.gantt-block.cross-start .gantt-block-visual { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.gantt-block.cross-start .gantt-block-visual::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: rgba(255,255,255,.85); z-index: 3; }
.gantt-block.cross-end .gantt-block-visual { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.gantt-block-exec { height: 100%; border-radius: 4px 0 0 4px; flex-shrink: 0; min-width: 3px; }
.gantt-block-buffer {
  height: 100%; border-radius: 0 4px 4px 0; flex-shrink: 0;
  background: repeating-linear-gradient(135deg, var(--hatch-color) 0px, var(--hatch-color) 3px, transparent 3px, transparent 7px);
  opacity: .45;
}
.gantt-block-label { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); padding: 0 6px; box-sizing: border-box; font-size: 12px; line-height: 1.2; color: #fff; background: transparent; text-shadow: 0 1px 2px rgba(0,0,0,.45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.gantt-block-abbr { position: absolute; left: 0; right: 0; top: 0; height: 100%; display: grid; place-items: center; color: #fff; background: transparent; text-shadow: 0 1px 2px rgba(0,0,0,.45); font-size: 9px; font-weight: 800; line-height: 1; pointer-events: none; }
.gantt-block.pulse-focus, .gantt-block.pulse-focus-3 { z-index: 8; }
.gantt-block.pulse-focus .gantt-block-visual { animation: pulse-focus 1.35s ease-out; }
.gantt-block.pulse-focus-3 .gantt-block-visual { animation: pulse-focus 0.45s ease-out 3; }
.gantt-continuation { position: absolute; top: 0; display: grid; width: 16px; height: 100%; place-items: center; background: rgba(18,35,50,.34); color: #fff; font-size: 18px; font-weight: 700; pointer-events: none; z-index: 2; }
.continuation-before { left: 0; border-right: 1px solid rgba(255,255,255,.5); }
.continuation-after { right: 0; border-left: 1px solid rgba(255,255,255,.5); }
.gantt-label-text { display: grid; min-width: 0; gap: 2px; }
.gantt-label-name, .gantt-label-group { display: block; min-width: 0; white-space: pre; overflow: hidden; }
.gantt-label-text { flex: 1 1 auto; text-align: center; }
.gantt-label-group { color: #819198; font-size: 11px; }
.robot-drag-handle { display: grid; width: 14px; flex: 0 0 auto; place-items: center; color: #b3bfce; cursor: grab; font-size: 12px; letter-spacing: -2px; }
.gantt-label[draggable="true"] { cursor: grab; }
.gantt-label.dragging { opacity: .56; }
.gantt-label.drag-over { background: #eaf2ff; box-shadow: inset 0 2px 0 #4f82ee; }

/* ── Legend panel (bottom) ── */
.gantt-legend-panel { flex-shrink: 0; border-top: 1px solid var(--border); padding: 8px 0 0; margin-top: 8px; }
.gantt-legend-head { display: flex; align-items: center; gap: 14px; padding: 0 4px 6px; }
.gantt-legend-title { font-size: 14px; font-weight: 600; color: #344054; }
.gantt-legend-now-hint { display: flex; align-items: center; gap: 5px; font-size: 13px; color: #667085; }
.gantt-legend-now { display: inline-block; width: 2px; height: 13px; background: #EA4335; border-radius: 1px; }
.gantt-legend-search { border: 1px solid var(--border); border-radius: 4px; padding: 4px 10px; font-size: 13px; width: 180px; min-width: 72px; outline: none; margin-left: auto; }
.gantt-legend-search:focus { border-color: #1a73e8; box-shadow: 0 0 0 2px rgba(26,115,232,.15); }
.gantt-legend-scroll { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px 16px; max-height: 92px; overflow-y: auto; overscroll-behavior: contain; padding: 4px; }
.gantt-legend-item { display: flex; align-items: center; gap: 5px; flex-shrink: 0; min-width: 0; max-width: min(320px, 100%); height: 24px; white-space: nowrap; text-align: left; color: #475467; cursor: pointer; border: 0; background: transparent; padding: 2px 4px; font: inherit; font-size: 14px; }
.gantt-legend-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.gantt-legend-item:hover { color: #1a73e8; }
.gantt-legend-item.is-active { outline: 2px solid rgba(26,115,232,.35); border-radius: 4px; }
.gantt-legend-swatch { display: inline-block; width: 18px; height: 11px; border-radius: 2px; flex-shrink: 0; }
.gantt-legend-swatch.hatched {
  background: repeating-linear-gradient(135deg, var(--hatch-color) 0px, var(--hatch-color) 3px, transparent 3px, transparent 7px);
  opacity: .55;
}
.gantt-conflict-list { display: grid; gap: 10px; }
.gantt-conflict-row { border: 1px solid #fecdca; border-radius: 8px; background: #fff6f5; padding: 12px 14px; }
.gantt-conflict-row div { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #344054; }
.gantt-conflict-row span { color: #b42318; font-size: 13px; white-space: nowrap; }
.gantt-conflict-row p { margin: 6px 0 0; color: #667085; }
.gantt-conflict-actions { display: flex; gap: 8px; margin-top: 8px; }
/* Long task and robot names remain readable inside scheduling dialogs. */
.gantt-conflicts-dialog .gantt-conflict-row { min-width: 0; overflow-wrap: anywhere; }
.gantt-conflicts-dialog .gantt-conflict-row > div { flex-wrap: wrap; }
.gantt-conflicts-dialog .gantt-conflict-row span { white-space: normal; }
.gantt-block-detail-dialog .conflict-mini-list,
.gantt-block-detail-dialog .conflict-mini-list button { min-width: 0; max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.detail-item { display: grid; gap: 5px; min-width: 0; padding: 12px; border: 1px solid #e0e7f1; border-radius: 8px; background: #fbfcff; }
.detail-item.full, .conflict-mini-list.full { grid-column: 1 / -1; }
.detail-item span, .conflict-mini-list span { color: #7b879a; font-size: 11px; }
.detail-item strong { overflow-wrap: anywhere; color: #26364f; font-size: 13px; }
.detail-item.danger { border-color: #ffd1d2; background: #fff7f7; }
.detail-item.danger strong { color: #d95055; }
.conflict-mini-list { display: grid; gap: 8px; }
.conflict-mini-list button { display: grid; gap: 6px; padding: 11px 12px; border: 1px solid #e0e7f1; border-radius: 8px; background: #fff; text-align: left; cursor: pointer; }
@keyframes pulse-focus { 0%, 100% { outline: 0 solid rgba(37,99,235,0); } 35% { outline: 5px solid rgba(37,99,235,.34); } }

/* Tooltip */
.gantt-tip { position: fixed; z-index: 50; padding: 10px 14px; border-radius: 6px; background: #1e293b; color: #f1f5f9; font-size: 14px; line-height: 1.6; pointer-events: none; max-width: calc(100vw - 16px); box-sizing: border-box; overflow-wrap: anywhere; opacity: 0; transition: opacity .12s; white-space: normal; box-shadow: 0 4px 14px rgba(0,0,0,.22); }
.gantt-tip.show { opacity: 1; }
.gantt-tip:not(.show) { visibility: hidden; }
.gantt-tip strong { font-weight: 600; font-size: 15px; }

/* Scrollbars */
.gantt-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.gantt-scroll::-webkit-scrollbar-track { background: #f5f7fd; border-radius: 4px; }
.gantt-scroll::-webkit-scrollbar-thumb { background: #c4cdd9; border-radius: 4px; }
.gantt-legend-scroll::-webkit-scrollbar { width: 6px; }
.gantt-legend-scroll::-webkit-scrollbar-track { background: transparent; }
.gantt-legend-scroll::-webkit-scrollbar-thumb { background: #d0d5dd; border-radius: 3px; }

/* ── Batch import modal ── */
#batch-schedule-modal .form-grid { grid-template-columns: minmax(0, 1fr); }
#batch-schedule-modal .form-grid > * { min-width: 0; }
#batch-excel-filename { overflow-wrap: anywhere; }
.batch-preview-wrap { max-height: 320px; overflow: auto; margin-top: 12px; }
.batch-preview-wrap td.error-text { color: #991b1b; font-size: 12px; max-width: 260px; word-break: break-all; }
.batch-result { margin-top: 16px; padding: 14px 18px; border-radius: 6px; font-size: 13px; line-height: 1.7; }
.batch-result.success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.batch-result.warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.batch-result.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.form-row.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .sidebar { width: 220px; }
  .main { width: calc(100% - 220px); margin-left: 220px; }
  .drawer-body { grid-template-columns: 1fr; }
  .drawer-body.run-detail-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: max-content;
    overflow: auto;
  }
  .run-detail-grid > .drawer-col { min-width: 0; overflow: visible; }
  .credential-picker, .settings-grid { grid-template-columns: 1fr; }
  .filterbar select.wide, .filterbar input.wide { width: 200px; max-width: min(200px, 100%); }
  .search-combobox { width: 200px; max-width: min(200px, 100%); }
}
/* Keep the full brand on one line in the 220px intermediate-width sidebar. */
@media (min-width: 721px) and (max-width: 1100px) {
  .sidebar .brand { font-size: 16px; gap: 8px; padding: 0 8px; white-space: nowrap; }
  .sidebar .brand-logo { flex-shrink: 0; }
}
@media (max-width: 720px) {
  .top-row { grid-template-columns: 20px minmax(0, 1fr) max-content; gap: 8px; }
  .top-row > b { grid-row: 1; grid-column: 1; }
  .top-row > span { grid-row: 1; grid-column: 2; }
  .top-row > em { grid-row: 1; grid-column: 3; white-space: nowrap; }
  .top-row > div { grid-row: 2; grid-column: 2 / 4; }
  .filterbar select.wide, .filterbar input.wide { width: 100%; max-width: 100%; }
  .filterbar > label { width: 100%; }
  .filterbar > label select.wide, .filterbar > label input.wide { flex: 1 1 auto; }
  .search-combobox { width: 100%; max-width: 100%; }
}

/* Keep boolean controls compact inside workflow settings. */
.workflow-configuration input[type="checkbox"] { width: 16px; height: 16px; margin: 0; justify-self: start; }
.workflow-configuration .modal-head, .workflow-configuration .modal-foot { flex-shrink: 0; }

.workflow-graph-modal { width: min(1500px, calc(100vw - 32px)); height: calc(100vh - 40px); max-height: calc(100vh - 40px); }
.workflow-graph-modal .modal-head, .workflow-graph-modal .modal-foot { flex-shrink: 0; }
.workflow-graph-tools, .workflow-graph-new { display: flex; gap: 10px; padding: 10px 20px; align-items: center; flex-wrap: wrap; }
.workflow-graph-tools select { max-width: 380px; }
.workflow-graph-new input[type="checkbox"] { width: 16px; height: 16px; }
.workflow-graph-workspace { flex: 1; min-height: 0; display: flex; border-top: 1px solid #e2e8f0; }
.workflow-graph-viewport { flex: 1; min-width: 0; overflow: auto; background: #f5f7fb; }
#workflow-graph-inspector { width: 310px; flex-shrink: 0; overflow: auto; scroll-padding-block: 6px; padding: 16px; border-left: 1px solid #e2e8f0; }
.workflow-graph-route { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.workflow-graph-route select { flex: 1; min-width: 0; }
.workflow-graph-route > select { flex: 1 0 100%; max-width: 100%; }
#workflow-graph-message { margin-right: auto; font-size: 12px; color: #64748b; max-height: 48px; overflow: auto; }
@media (max-width: 700px) { .workflow-graph-workspace { flex-direction: column; } #workflow-graph-inspector { width: auto; max-height: 35%; } }

.workflow-graph-dependency { display: grid; gap: 7px; padding: 10px 0; border-top: 1px solid #e2e8f0; }

.workflow-graph-viewport { overflow: hidden; position: relative; }
#workflow-graph-stage { width: 100%; height: 100%; position: relative; }
#workflow-graph-minimap { position: absolute; right: 12px; bottom: 12px; width: 170px; padding: 8px; border: 1px solid #cbd5e1; border-radius: 8px; background: rgba(255,255,255,.94); box-shadow: 0 3px 12px rgba(15,23,42,.12); font-size: 11px; color: #475569; z-index: 5; }
.workflow-graph-minimap-canvas { position: relative; height: 105px; margin-top: 5px; border: 1px solid #e2e8f0; border-radius: 4px; background: linear-gradient(90deg, transparent 49%, #f1f5f9 50%, transparent 51%), linear-gradient(0deg, transparent 49%, #f1f5f9 50%, transparent 51%); background-size: 25% 25%; }
.workflow-graph-minimap-node { position: absolute; width: 9px; height: 7px; padding: 0; transform: translate(-50%, -50%); border: 1px solid #64748b; border-radius: 2px; background: #cbd5e1; cursor: pointer; }
.workflow-graph-minimap-node.selected { width: 12px; height: 10px; border-color: #2563eb; background: #60a5fa; }

.workflow-graph-search-result { display: block; width: 100%; text-align: left; margin: 8px 0; padding: 8px; }

.workflow-graph-library { width: 210px; flex-shrink: 0; overflow: auto; padding: 12px; border-right: 1px solid #e2e8f0; }
.workflow-graph-library input { width: 100%; margin-top: 8px; }
.workflow-library-task { display: block; width: 100%; margin: 7px 0; padding: 9px; text-align: left; white-space: pre-line; overflow-wrap: anywhere; font-size: 12px; cursor: grab; }
.workflow-library-task:disabled { cursor: default; }
@media (max-width: 700px) { .workflow-graph-library { width: auto; max-height: 150px; flex-shrink: 0; border-right: 0; border-bottom: 1px solid #e2e8f0; } }

.drawer-body.workflow-execution-detail { display: block; padding: 20px; overflow: auto; overflow-wrap: anywhere; }
.drawer-body.workflow-execution-detail h3 { margin: 18px 0 10px; }
.drawer-body.workflow-execution-detail h3:first-child { margin-top: 0; }

/* On narrow screens, allow the full queue timestamp to scroll past actions. */
@media (max-width: 720px) {
  .agent-queue-modal table.has-frozen-actions th.actions,
  .agent-queue-modal table.has-frozen-actions td.actions { position: relative; }
}

/* Keep all account columns reachable when the actions exceed narrow space. */
@media (max-width: 720px) {
  table.accounts-table.has-frozen-actions th.actions,
  table.accounts-table.has-frozen-actions td.actions { position: relative; }
}

.user-profile { min-width: 0; flex: 1; }
.user-profile strong, .user-profile small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-profile > .text-btn { padding: 2px 0; font-size: 12px; }

.user-box .avatar, .user-box .logout { flex-shrink: 0; }
.user-box .logout { white-space: nowrap; }

/* Keep schedule validation feedback inside the styled scrollable form. */
#schedule-form .schedule-field-error { display: block; margin: 6px 0 0; color: #dc3545; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
#schedule-form .schedule-field-invalid { border-color: #dc3545; }
#schedule-form label:has(> .schedule-field-error) { flex-wrap: wrap; }
#schedule-form label > .schedule-field-error { flex-basis: 100%; }

/* Keep full account and application names readable in their existing table bounds. */
#account-table-body tr > td:nth-child(2):not([colspan]),
#app-table-body tr > td:first-child:not([colspan]) { white-space: normal; overflow-wrap: anywhere; text-overflow: clip; padding-top: 10px; padding-bottom: 10px; }

/* Narrow user-resized application columns must still show their full heading. */
table:has(> #app-table-body) > thead th { white-space: normal; overflow-wrap: anywhere; text-overflow: clip; padding-top: 8px; padding-bottom: 8px; }

/* One compact bar: full-height solid execution, empty waiting, same-color striped retries. */
.gantt-phase { position: absolute; inset-block: 0; box-sizing: border-box; min-width: 0; overflow: hidden; }
.gantt-phase-execution { background: var(--task-color); }
.gantt-phase-retry { background: repeating-linear-gradient(135deg, var(--task-color) 0 3px, transparent 3px 7px); opacity: .45; }
.gantt-phase-wait { background: transparent; }
.gantt-phase-wait::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px dashed var(--task-color); }
.gantt-phase-wait span { position: relative; background: var(--page); padding: 1px 3px; }
.gantt-phase-aggregate { background: repeating-linear-gradient(135deg, var(--task-color) 0 3px, transparent 3px 7px); color: var(--text); }
.gantt-estimate-note { margin: 8px 0; color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.gantt-notes { flex-shrink: 0; max-height: 64px; overflow: auto; overscroll-behavior: contain; }
.gantt-notes > .gantt-estimate-note { margin: 6px 0; }
@media (max-width: 700px), (max-height: 700px) {
  .page:has(.gantt-page) { padding: 16px; }
  .page:has(.gantt-page) > .page-head { margin-bottom: 10px; }
  .gantt-legend-head { gap: 8px; }
  .gantt-legend-title, .gantt-legend-now-hint { flex-shrink: 0; font-size: 12px; }
  .gantt-legend-search { width: 150px; }
  .gantt-legend-scroll { max-height: 62px; }
  .gantt-notes { max-height: 42px; font-size: 12px; }
}
@media (max-height: 520px) {
  .page:has(.gantt-page) { padding: 10px 16px; }
  .gantt-toolbar-row { max-height: 76px; padding-top: 0; padding-bottom: 6px; }
  .gantt-robot-order-hint { max-height: 20px; margin-bottom: 6px; }
  .gantt-notes { max-height: 30px; }
  .gantt-legend-panel { padding-top: 4px; margin-top: 4px; }
}
.gantt-retry-list { padding: 0; margin: 8px 0; list-style: none; display: grid; gap: 6px; }
.gantt-retry-list li { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 8px; background: var(--panel); border-radius: 6px; min-width: 0; overflow-wrap: anywhere; }
.gantt-retry-list small { flex-basis: 100%; }
.gantt-retry-paging { display: flex; flex-wrap: wrap; gap: 8px; }

/* Leave room for the keyboard focus ring when schedule actions scroll into view. */
#schedule-table-body button,
#schedule-table-body [data-schedule-toggle],
#schedule-table-body [data-schedule-toggle-anchor] { scroll-margin-block: 8px; }

/* Waiting keeps keyboard focus next to the disabled switch, inside the same column. */
#schedule-table-body [data-schedule-toggle-anchor]:focus { outline: none; }
#schedule-table-body [data-schedule-toggle-anchor]:focus > span { outline: 2px solid #2563eb; outline-offset: 3px; }
@media (max-width: 600px) {
  /* Keep the focused switch above the temporary bottom notification. */
  #schedule-table-body [data-schedule-toggle],
  #schedule-table-body [data-schedule-toggle-anchor] { scroll-margin-block-end: 120px; }
}

/* Settings section hierarchy; field labels retain their normal size. */
.settings-heading-main { font-size: 20px; font-weight: 700; line-height: 1.4; margin: 24px 0 16px; color: var(--text); }
.settings-heading-sub { font-size: 16px; font-weight: 700; line-height: 1.5; margin: 22px 0 12px; color: var(--text); }
#robot-capacity-settings > .settings-heading-main { margin-top: 0; }
