/* Shared refinements keep the existing task console's palette and controls. */
.app-version-search { padding: 16px 30px 12px; flex-shrink: 0; border-bottom: 1px solid #eef1f5; }
.app-version-search > label { display: block; margin-bottom: 8px; font-size: 14px; }
.app-version-search .picker-search { gap: 10px; margin-bottom: 0; }
.app-version-search .picker-search input { min-width: 0; }
.app-version-search .picker-search button { flex-shrink: 0; }
.app-version-search .muted-hint { margin-top: 6px; overflow-wrap: anywhere; }
.app-version-modal .modal-body { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.app-version-modal .table-scroll { min-height: 0; overflow: auto; }
.app-version-modal table { table-layout: auto; }
.app-version-modal th:nth-child(2) { width: 160px; min-width: 160px; }
.app-version-modal td:nth-child(2) { white-space: normal; overflow-wrap: anywhere; }
.app-version-modal .app-version-label { display: inline-block; padding-block: 6px; line-height: 1.5; overflow-wrap: anywhere; cursor: pointer; }
.app-version-choice input { vertical-align: middle; width: 16px; height: 16px; margin: 0; accent-color: var(--blue); }
.app-version-modal .modal-body > .hint { flex-shrink: 0; margin-top: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.app-version-mobile-label { display: none; }
@media (max-width: 600px) { .app-version-search { padding: 14px 18px 12px; } }
/* Stack each version on narrow screens so notes use the available reading width. */
@media (max-width: 600px) {
  .app-version-modal table, .app-version-modal tbody { display: block; width: 100% !important; min-width: 0; }
  .app-version-modal thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .app-version-modal .column-resizer { display: none; }
  .app-version-modal [data-app-version-row]:not([hidden]) { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; padding: 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 8px; }
  .app-version-modal td, .app-version-modal td:nth-child(2) { display: block; width: 100%; min-width: 0; height: auto; padding: 0; border: 0; white-space: normal; overflow: visible; overflow-wrap: anywhere; }
  .app-version-modal .app-version-notes { grid-column: 1 / -1; margin-top: 10px; line-height: 1.6; }
  .app-version-modal table.has-frozen-actions td.app-version-actions { grid-column: 1 / -1; width: 100% !important; min-width: 0; margin-top: 10px; border: 0; position: static; z-index: auto; white-space: normal; }
  .app-version-modal .app-version-actions:empty { display: none; }
  .app-version-modal .app-version-mobile-label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; }
  .app-version-modal .app-version-label { display: block; }

  .app-version-modal #app-version-empty:not([hidden]) { display: block; padding: 12px; line-height: 1.6; }
}
:root {
  --control-ring: rgba(22, 119, 255, .2);
  --control-radius: 8px;
}
#self-password-error { color: #c93244; margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
#self-password-error:focus { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

button, input, select, textarea { transition: border-color .15s, background-color .15s, box-shadow .15s; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
.log-box:focus-visible,
#developer-doc-title:focus-visible,
[role="button"]:focus-visible,
.modal[tabindex="-1"][role="dialog"]:focus-visible,
.modal[tabindex="-1"][role="alertdialog"]:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
/* Popup rows fill their scroll container; keep the keyboard ring inside it. */
.search-combobox-item:focus-visible { outline-offset: -2px; }
/* Navigation buttons touch their scroll viewport; keep the full ring visible. */
.sidebar-nav .nav:focus-visible { outline-offset: -2px; }
/* Keep complete live-log task names readable inside the bounded candidate list. */
#live-log-task-list .search-combobox-item { white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus {
  border-color: #83b5ff;
  box-shadow: 0 0 0 3px var(--control-ring);
}
input[type="checkbox"], input[type="radio"] { min-height: auto; accent-color: #4f82ee; }
button:disabled { box-shadow: none; }
.workflow-configuration :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea):disabled {
  background-color: #f0f3f8;
  color: #64748b;
  border-color: #d6dce6;
  cursor: not-allowed;
}

.page-head, .panel-title, .filterbar, .toolbar { min-width: 0; }
.page-head { gap: 18px; flex-wrap: wrap; }
/* Dashboard links keep a full pointer target even when only their text is visible. */
.dashboard-panel .panel-link { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 6px; border-radius: 6px; line-height: 20px; }
.head-actions, .toolbar { row-gap: 10px; }
.form-row, .form-grid, .settings-grid > *, .section-box, .drawer-col { min-width: 0; }
.form-row :is(input, select, textarea), .settings-grid :is(input, select, textarea) { min-width: 0; max-width: 100%; }
.section-box { border-radius: var(--control-radius); }
.section-box .hint, .muted-hint { line-height: 1.65; overflow-wrap: anywhere; }
.modal-head, .modal-foot { flex-shrink: 0; gap: 12px; }
.modal-head h3 { min-width: 0; overflow-wrap: anywhere; line-height: 1.5; }
.modal-head .icon-btn { flex-shrink: 0; }
.modal-body { min-height: 0; overscroll-behavior: contain; }
.modal-foot { flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.modal-foot .hint, .modal-foot > span { min-width: 0; line-height: 1.5; }
.modal-foot button { flex-shrink: 0; }

/* Loading and auxiliary dialogs must never expose browser-default buttons. */
.modal button:not([class]), .drawer button:not([class]) {
  min-height: 34px;
  padding: 6px 16px;
  border: 0;
  border-radius: 999px;
  background: #eef3fb;
  color: #344054;
}
.modal button:not([class]):hover, .drawer button:not([class]):hover { background: #e2ecfa; }

.live-log-panel .panel-title { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
.live-log-panel .panel-title > div { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
#live-log-meta { min-width: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.65; }
.settings-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.settings-grid { align-items: start; }
.settings-panel > .section-title { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.settings-panel > .section-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.settings-panel .muted-hint { margin: 10px 0 14px; line-height: 1.7; overflow-wrap: anywhere; }
.settings-panel > .settings-module + .settings-module { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.settings-panel > .settings-module > .settings-heading-main { margin-top: 0; }
.maintenance-heading { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.maintenance-heading .settings-heading-main { margin: 0; }
.maintenance-status { padding: 3px 10px; border-radius: 999px; background: var(--panel, #f4f7ff); color: var(--muted); font-size: 13px; }
.maintenance-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; border: 0; padding: 0; margin: 14px 0 0; min-width: 0; }
.maintenance-legend { padding: 0 0 8px; color: var(--muted); font-size: 13px; }
.maintenance-mode { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.maintenance-mode:has(input:checked) { border-color: var(--blue); background: rgba(79, 130, 238, .04); }
.maintenance-mode > span { display: flex; align-items: center; gap: 8px; }
.maintenance-mode input { flex: 0 0 auto; margin: 0; width: 14px; height: 14px; }
.maintenance-mode small { color: var(--muted); line-height: 1.65; }
[data-global-form][hidden], [data-subset-form][hidden] { display: none; }
.global-status-in-subset::before { content: '全局状态 · '; }
.scope-selector { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.scope-selector .maintenance-legend { padding: 0; }
.scope-selector strong { font-size: 14px; overflow-wrap: anywhere; }
.scope-dialog { width: min(800px, 95vw); }
.scope-dialog .modal-body { display: grid; gap: 10px; min-height: 0; overflow: auto; }
.scope-summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.scope-sheet { min-width: 0; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.scope-sheet .scope-columns { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1.25fr); align-items: center; gap: 12px; padding-inline: 10px; }
/* Give each heading the same usable grid width as a bordered, scrollable data row. */
.agent-picker-head, .agent-picker-row { text-align: left; }
.agent-picker-head > :nth-child(2), .agent-picker-row > :nth-child(2) { text-align: center; }
.agent-picker-head { border: 1px solid transparent; overflow: hidden; scrollbar-gutter: stable; }
.agent-picker-head + .picker-list { scrollbar-gutter: stable; grid-template-columns: minmax(0, 1fr); }
.scope-sheet .scope-name { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 6px; min-width: 0; cursor: pointer; }
.scope-name > input[type=checkbox] { justify-self: center; }
.scope-name-text { min-width: 0; }
.scope-name-text small, .scope-row .scope-extra, .scope-row .status { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.scope-name-text strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; font-weight: 500; line-height: 1.25; }
.scope-name-text small { display: none; color: var(--muted); }
.scope-rows { --row-height: 52px; --row-gap: 6px; display: grid; gap: var(--row-gap); max-height: calc(5 * var(--row-height) + 4 * var(--row-gap)); margin-top: 4px; overflow-y: auto; scrollbar-gutter: stable; overscroll-behavior: contain; }
.scope-rows > .hint { padding: 8px 12px; }
.scope-sheet .scope-row { height: var(--row-height); min-height: 0; box-sizing: border-box; cursor: pointer; content-visibility: auto; contain-intrinsic-size: auto var(--row-height); }
.scope-row:has(input:checked) { border-color: var(--blue); background: var(--head); }
.scope-row:focus-within { outline: 2px solid var(--blue); outline-offset: -2px; }
.scope-state { min-width: 0; }
.scope-row .status { margin-inline: auto; width: fit-content; max-width: 100%; line-height: 22px; }
@media (max-width: 560px) {
  .scope-sheet .scope-columns { grid-template-columns: minmax(0, 1fr) minmax(65px, 30%); gap: 6px; }
  .scope-sheet .scope-extra { display: none; }
  .scope-name-text small { display: block; }
  .scope-rows { --row-height: 66px; }
  .scope-dialog .modal-foot { padding-inline: 12px; gap: 6px; }
  .scope-dialog .modal-foot button { padding-inline: 10px; }
}
.scope-dialog input[type=checkbox] { margin: 0; width: 16px; height: 16px; accent-color: var(--blue); }
.scope-dialog .modal-foot { flex-wrap: wrap; }
.scope-use-all { margin-right: auto; }
.recovery-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.maintenance-mode.agent-choice { flex-direction: row; align-items: center; gap: 8px; min-width: 0; }
.agent-choice > span { display: block; min-width: 0; overflow-wrap: anywhere; }
.agent-choice input { accent-color: var(--blue); }
.agent-choice:hover, .agent-choice:focus-within { border-color: var(--blue); }
.maintenance-blockers { margin: 8px 0; padding-left: 22px; color: var(--muted); line-height: 1.7; overflow-wrap: anywhere; }
@media (max-width: 900px) { .maintenance-modes { grid-template-columns: 1fr; } }
.settings-panel .settings-actions { margin-top: 16px; }
.settings-panel .check-line { flex-wrap: wrap; row-gap: 10px; }
.settings-panel .cache-settings-row { flex-wrap: wrap; }
.settings-panel .cache-settings-row > button { flex-shrink: 0; }
.settings-panel .backup-restore-row > select { flex: 1 1 220px; min-width: 0; }
.settings-panel .form-row:has(#backup-estimate) { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.settings-panel .form-row:has(#backup-estimate) > label { grid-column: 1 / -1; }
.settings-panel #backup-estimate { overflow-wrap: anywhere; line-height: 1.5; }
.settings-panel [data-settings-action="preview"] { justify-self: end; margin-left: 0 !important; }
.docs-toolbar { flex-wrap: wrap; }
.docs-toolbar h2 { min-width: 0; overflow-wrap: anywhere; }
.docs-toolbar button { flex-shrink: 0; }
.drawer-head { min-width: 0; gap: 14px; }
.drawer-head .hint { min-width: 0; overflow-wrap: anywhere; }
.drawer-col > h3 { font-size: 18px; line-height: 1.5; margin-bottom: 12px; }
.drawer-col > h3:not(:first-child), #offline-alerts-panel { margin-top: 24px; }
.drawer-col .detail-list { margin-top: 18px; margin-bottom: 24px; }
#offline-alerts-panel h3 { display: flex; align-items: center; gap: 8px; font-size: 18px; margin-bottom: 10px; }
#offline-alerts-panel h3 .text-btn { font-size: 13px; }
#offline-alerts-panel p { line-height: 1.7; margin-bottom: 8px; }
#run-detail-log-pane > .hint { line-height: 1.65; }

.audit-dialog { width: min(1060px, calc(100vw - 48px)); }
.audit-dialog .hint { line-height: 1.7; }
.audit-dialog .modal-body > p { margin-bottom: 16px; font-size: 13px; line-height: 1.7; color: var(--muted); }
.audit-table { width: 100%; table-layout: fixed; min-width: 0; }
.audit-table th, .audit-table td { padding-top: 12px; padding-bottom: 12px; white-space: normal; overflow-wrap: anywhere; }
.audit-table td { vertical-align: top; }
.audit-table .audit-time { width: 170px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.audit-table .audit-actor { width: 140px; }
.audit-table .audit-fields { line-height: 1.7; }

@media (max-width: 1100px) {
  .page { padding: 26px 24px; }
  .filterbar { gap: 12px 16px; }
  .modal { max-height: calc(100dvh - 32px); }
  .docs-hub { grid-template-columns: 210px minmax(0, 1fr); }
  .audit-table .audit-time { width: 150px; font-size: 12px; }
  .audit-table .audit-actor { width: 110px; }
}
@media (max-width: 720px) {
  .page { padding: 20px 16px; }
  .modal-mask { padding: 12px; }
  .modal { width: 100%; max-height: calc(100dvh - 24px); }
  .modal-head, .modal-foot { padding-left: 18px; padding-right: 18px; }
  .modal-body { padding: 18px; }
  .form-row.two-col { grid-template-columns: minmax(0, 1fr); }
  .audit-dialog { width: 100%; }
  .audit-table { min-width: 560px; }
  .docs-hub { grid-template-columns: minmax(0, 1fr); }
  .docs-sidebar { max-height: 220px; }
  .docs-content { min-height: 65vh; }
}

/* System fault notification channels: state and save feedback. */
#system-fault-settings .fault-channel-grid { margin-top: 16px; align-items: start; }
#system-fault-settings .fault-channel { min-width: 0; padding: 18px; border: 1px solid #dce5f5; border-radius: 12px; background: #fff; }
#system-fault-settings .fault-channel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
#system-fault-settings .fault-channel-head label { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
#system-fault-settings .fault-channel-head input[type="checkbox"] { flex-shrink: 0; }
#system-fault-settings .fault-channel .hint { margin-top: 8px; }
#system-fault-settings .fault-channel-state { white-space: nowrap; padding: 3px 9px; border-radius: 20px; background: #edf3ff; color: #536889; font-size: 12px; }
#system-fault-settings [hidden] { display: none !important; }
#notification-settings-form .notification-save-feedback { min-height: 20px; margin: 12px 0; color: #45628d; font-size: 13px; }
#notification-settings-form .notification-save-feedback.is-error { color: #c93244; }
#cache-save-feedback, #capacity-save-feedback, .settings-save-feedback { margin: 12px 0; color: #45628d; font-size: 13px; line-height: 1.6; }
#cache-save-feedback:empty, #capacity-save-feedback:empty, .settings-save-feedback:empty { display: none; }
#cache-save-feedback.is-error, #capacity-save-feedback.is-error, .settings-save-feedback.is-error { color: #c93244; }
#notification-settings-form[aria-busy="true"] { opacity: .8; }
@media (max-width: 760px) { #system-fault-settings .fault-channel-grid { grid-template-columns: 1fr; } }

/* A narrow API editor keeps its readonly field above the action buttons. */
@media (max-width: 600px) {
  #schedule-form .api-trigger-fields .form-row { grid-template-columns: minmax(0, 1fr); }
  #schedule-form .api-trigger-fields .input-action { min-width: 0; flex-wrap: wrap; }
  #schedule-form .api-trigger-fields .input-action > input:not([type="hidden"]) { flex-basis: 100%; width: 100%; }
  #schedule-form .api-trigger-fields .input-action > button { flex-shrink: 0; }
}

/* These two editors keep wheel scrolling inside their form while open. */
html:has(> body > #modal-root > .modal-mask > :is(#cred-form, #schedule-form)) { overflow: hidden; }
#modal-root > .modal-mask > :is(#cred-form, #schedule-form) > .modal-body { overscroll-behavior: contain; }

/* Execution evidence owns scrolling while its drawer is open. Removing it restores the page. */
html:has(> body > #modal-root > .drawer-mask[data-execution-detail]) { overflow: hidden; }
#modal-root > .drawer-mask[data-execution-detail] .drawer-body,
#modal-root > .drawer-mask[data-execution-detail] .drawer-col { overscroll-behavior: contain; }

/* Legacy history keeps its close action inside the viewport as evidence columns wrap. */
[data-execution-detail] .drawer:has(> .workflow-run-detail-grid) { grid-template-columns: minmax(0, 1fr); }

/* Execution titles and actions keep their width; long task names use the remaining space. */
@media (min-width: 721px) {
  [data-execution-detail] .drawer { grid-template-rows: auto minmax(0, 1fr); }
  [data-execution-detail] .drawer-head { flex-wrap: wrap; min-height: 72px; padding-top: 14px; padding-bottom: 14px; }
  [data-execution-detail] .drawer-head h3 { flex: 0 0 auto; margin: 0; white-space: nowrap; }
  [data-execution-detail] .drawer-head .hint { flex: 1 1 280px; }
  [data-execution-detail] .drawer-head button { flex: 0 0 auto; margin-left: 0; white-space: nowrap; }
}

/* Narrow screens keep the workspace usable instead of reserving a fixed sidebar. */
/* Give logs a full row when three detail columns would squeeze timestamps and names. */
@media (min-width: 721px) and (max-width: 1280px) {
  .drawer-body.run-detail-grid,
  .drawer-body.workflow-run-detail-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-auto-rows: max-content;
    overflow: auto;
  }
  .run-detail-grid > .drawer-col, .workflow-run-detail-grid > .drawer-col { overflow: visible; }
  .run-detail-grid > .drawer-col:nth-child(3), .workflow-run-detail-grid > .drawer-col:nth-child(3) { grid-column: 1 / -1; border-top: 1px solid #eef1f5; }
  .drawer-body.run-detail-grid:has(> .drawer-col:nth-child(2):last-child) { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .layout { display: block; }
  .drawer { width: calc(100vw - 24px); grid-template-rows: auto minmax(0, 1fr); }
  .drawer-head { position: relative; flex-wrap: wrap; gap: 10px; padding: 16px; }
  .drawer-head:has(+ [data-run-read-loading]) { min-height: 58px; }
  .drawer-head h3 { flex: 1 1 100%; margin: 0; padding-right: 30px; overflow-wrap: anywhere; }
  .drawer-head .hint { flex-basis: 100%; }
  .drawer-head button { margin-left: 0; flex-shrink: 0; white-space: nowrap; }
  .drawer-head .icon-btn { position: absolute; right: 10px; top: 10px; }
  .drawer-col { padding: 20px 16px; }
  .drawer-body.workflow-run-detail-grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; overflow: auto; }
  .workflow-run-detail-grid > .drawer-col { overflow: visible; border-right: 0; border-bottom: 1px solid #eef1f5; }
  .workflow-execution-detail table { display: block; width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; }
  .sidebar { position: static; width: 100%; padding: 12px 16px; border-right: 0; border-bottom: 1px solid #dbe6f3; }
  .sidebar-nav { display: flex; flex-wrap: wrap; gap: 6px; max-height: 156px; overflow-y: auto; margin-top: 12px; }
  .nav-group { display: contents; }
  .nav-parent { display: none; }
  .schedule-nav-links, .schedule-nav-links.is-collapsed { display: contents; }
  .sidebar-nav .nav { width: auto; height: 36px; margin: 0; padding: 0 12px; flex: 0 0 auto; }
  .user-box { margin-top: 12px; }
  .main { width: 100%; min-width: 0; margin-left: 0; }
  .page { border-radius: 16px 16px 0 0; }
  .filterbar > label { white-space: nowrap; }
  .filterbar > label > :not(select):not(input) { min-width: 0; flex: 1 1 auto; }
  .upload-form { width: 100%; margin-left: 0; flex-wrap: wrap; }
  .upload-form button { flex-shrink: 0; white-space: nowrap; }
  .login-page { padding: 16px; }
  .login-card { width: min(420px, 100%); padding: 28px 24px; }
  .credential-item-row { grid-template-columns: minmax(0, 1fr) 56px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
  .credential-item-row input { grid-column: 1 / -1; }
  .credential-item-row button { grid-column: 2; justify-self: end; }
}
@media (max-width: 1280px) {
  /* Keep row controls reachable without an action column covering them. */
  table.has-frozen-actions th.actions, table.has-frozen-actions td.actions { position: relative; right: auto; box-shadow: none; }
}
@media (min-width: 721px) and (max-width: 1280px) {
  .workflow-execution-detail table { display: block; width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; }
}
.toast {
  width: max-content;
  max-width: calc(100vw - 32px);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.workflow-list-read-error,
.app-list-read-error,
.accounts-list-read-error {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: var(--control-radius);
  background: #fef2f2;
  color: #991b1b;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

@media (max-width: 600px) {
  body:has(#modal-root .modal-mask) .toast {
    bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  }
}

.workflow-detail-name { display: block; margin-top: 4px; font-size: 12px; line-height: 1.6; font-weight: 400; color: #7183a1; overflow-wrap: anywhere; }
.workflow-node-tools { margin: 16px 0 8px; padding: 10px 12px; border: 1px solid #dfe7f1; border-radius: 8px; background: #f8fafc; }
.workflow-node-summary { margin: 0 0 8px; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.workflow-node-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.workflow-node-controls label { flex: 0 0 auto; font-size: 13px; }
.workflow-node-controls input { flex: 1 1 180px; width: auto; min-width: 0; min-height: 36px; }
.workflow-node-controls select { flex: 0 0 auto; width: auto; min-height: 36px; }
.workflow-node-status { display: inline-flex; flex: 0 0 auto; flex-wrap: nowrap; align-items: center; gap: 8px; }
.workflow-node-controls button { flex: 0 0 auto; min-height: 36px; margin: 0; }
[data-execution-detail] .drawer-body.workflow-execution-detail:has([data-workflow-node-locate]) { scroll-padding-block: 8px; }
.workflow-node-tools > .hint { margin: 8px 0 0; min-height: 18px; }
.workflow-node-table tr[hidden] { display: none; }
.workflow-node-table .workflow-node-ordinal { font-variant-numeric: tabular-nums; }
.workflow-node-identity { display: block; color: #7183a1; font-size: 11px; overflow-wrap: anywhere; }
.workflow-node-table .workflow-node-located { background: #edf4ff; outline: 1px solid #87b0ff; outline-offset: -1px; }

/* Read-only history keeps the detail entry visible while its table scrolls. */
[data-workflow-history-body] table {
  display: table;
  min-width: 650px;
  max-width: none;
  overflow: visible;
}
[data-workflow-history-body] table.has-frozen-actions th.actions,
[data-workflow-history-body] table.has-frozen-actions td.actions {
  position: sticky;
  right: 0;
}

/* Read failures need space between wrapped guidance and the retry control. */
.drawer-body > .hint[role="alert"],
.drawer-col > .hint[role="alert"] {
  line-height: 1.6;
  margin: 0 0 12px;
}

/* Long backup names must wrap without widening the restore form. */
#backup-restore-form .modal-body { grid-template-columns: minmax(0, 1fr); }
#backup-restore-form .hint { min-width: 0; overflow-wrap: anywhere; }

/* Keep long alert histories readable and paging reachable at either end. */
#offline-alerts-panel .offline-alert-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
#offline-alerts-panel .offline-alert-toolbar h3 { margin: 0; flex-wrap: wrap; }
#offline-alerts-panel .offline-alert-toolbar h3 .hint { font-size: 13px; font-weight: 400; }
#offline-alerts-panel .offline-alert-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#offline-alerts-panel .offline-alert-actions .text-btn { font-size: 13px; }
#offline-alerts-panel .offline-alert-card { margin-top: 10px; padding: 10px 12px; text-align: left; background: #fafbff; border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere; }
#offline-alerts-panel .offline-alert-card strong { display: block; color: var(--text); font-size: 14px; line-height: 1.45; }
#offline-alerts-panel .offline-alert-card p { margin: 3px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
#offline-alerts-panel .offline-alert-footer { display: flex; justify-content: flex-end; margin-top: 12px; }

/* Keep account identity visible while operators inspect a scrolled row. */
@media (min-width: 721px) {
  table.accounts-table.has-frozen-identity th:first-child,
  table.accounts-table.has-frozen-identity td:first-child:not([colspan]) {
    position: sticky;
    left: 0;
    box-shadow: 1px 0 0 #dfe7f1;
  }
  table.accounts-table.has-frozen-identity th:first-child { z-index: 9; background: var(--head); }
  table.accounts-table.has-frozen-identity td:first-child:not([colspan]) { z-index: 5; background: #fff; }
}

/* Keep the complete pointer target inside its header, clear of sticky actions. */
th.resizable-column > .column-resizer { right: 0; }

/* A long robot name must remain readable without editing the task. */
.schedule-hold-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; margin: 4px 0; white-space: normal; line-height: 1.35; }
.schedule-hold-summary .status { min-height: 21px; padding-inline: 6px; font-size: 12px; }
.schedule-hold-summary small { color: var(--muted); overflow-wrap: anywhere; }
td.schedule-target-cell { white-space: normal; overflow-wrap: anywhere; line-height: 1.5; padding-top: 8px; padding-bottom: 8px; }
td.schedule-target-cell > .status:not(.warning) { white-space: nowrap; overflow-wrap: normal; }

/* Keep today's four task statistics readable on narrow operator screens. */
@media (max-width: 480px) {
  .today-panel .today-status-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .today-panel .today-status {
    min-height: 64px;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    grid-template-rows: auto;
    column-gap: 10px;
    padding: 12px 16px;
  }
  .today-panel .today-status .dash-icon {
    grid-column: 1;
    grid-row: 1;
    font-size: 24px;
  }
  .today-panel .today-status > span:not(.dash-icon) {
    min-width: 0;
    grid-column: 2;
    grid-row: 1;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }
  .today-panel .today-status strong {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    font-size: 24px;
    line-height: 1.25;
  }
}

.audit-dialog .modal-head { flex-wrap: wrap; row-gap: 8px; padding-top: 12px; padding-bottom: 12px; }
.audit-dialog .audit-column-nav { display: flex; align-items: center; flex-wrap: wrap; flex-basis: 100%; gap: 8px; min-width: 0; }
.audit-dialog .audit-column-nav[hidden] { display: none; }
.audit-dialog .audit-column-nav > span { color: var(--muted); font-size: 12px; margin-right: auto; }
.audit-dialog .audit-column-nav > button { flex-shrink: 0; margin-left: 0; min-height: 34px; }
.audit-dialog .audit-column-viewport { overflow-x: auto; overflow-y: hidden; }

.live-log-auto-scroll { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.live-log-auto-scroll input { width: auto; min-height: 0; margin: 0; cursor: pointer; }
.live-log-panel #live-log-box > span { white-space: pre-wrap; overflow-wrap: anywhere; }

.live-log-task-pages { display: inline-flex; align-items: center; gap: 8px; flex-wrap: nowrap; white-space: nowrap; }
.live-log-task-pages[hidden] { display: none; }
.live-log-task-pages .hint { min-width: 88px; text-align: center; }
@media (max-width: 600px) { .live-log-task-pages { order: -1; width: 100%; justify-content: flex-start; } }

/* Both log views use the same keyboard-friendly search and reading controls. */
.log-search-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; margin: 10px 0; }
.log-search-controls[hidden] { display: none; }
[data-log-search="open"][hidden], [data-log-action="open-search"][hidden] { display: none; }
.log-search-controls > label:not(.log-scroll-toggle) { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; min-width: 0; max-width: 100%; font-size: 13px; }
.log-search-controls > label:has(input:not([type="checkbox"])) { flex: 1 1 160px; }
.log-search-controls input:not([type="checkbox"]) { flex: 1 1 160px; width: auto; min-width: 0; min-height: 36px; }
.log-search-controls > button { flex: 0 0 auto; margin: 0; min-height: 36px; }
.log-search-controls:has(input[aria-label="搜索日志内容"]) { padding: 6px 8px; border: 1px solid #dfe7f1; border-radius: 8px; background: #f8fafc; }
.log-search-counter { flex: 0 0 auto; min-width: 40px; text-align: center; white-space: nowrap; color: #52627a; font-size: 12px; font-variant-numeric: tabular-nums; }
.log-search-controls > .log-search-nav,
.log-search-controls > .log-search-close { width: 34px; min-width: 34px; min-height: 34px; padding: 4px; border-radius: 6px; font-size: 18px; line-height: 1; }
.log-search-controls > .log-search-close { border-left: 1px solid #dfe7f1; }
.log-search-nav:focus-visible, .log-search-close:focus-visible { outline: 2px solid #3984ff; outline-offset: 2px; }
.log-scroll-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-size: 13px; white-space: nowrap; cursor: pointer; }
.log-scroll-toggle input { width: auto; min-height: 0; margin: 0; }
.log-search-feedback { margin: 6px 0 10px; min-height: 18px; color: #52627a; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.log-search-match { background: #ffe58f; color: #182230; border-radius: 2px; padding: 0 1px; }
.log-search-current { background: rgba(69, 134, 255, .14); outline: 1px solid #87b0ff; outline-offset: 1px; }
@media (max-width: 480px) {
  .log-search-controls:has(input[aria-label="搜索日志内容"]) { gap: 6px; }
  .log-search-controls > label:has(input:not([type="checkbox"])) { flex-basis: 100%; }
}

/* Whole-flow confirmation keeps long task names and root IDs inside narrow dialogs. */
.workflow-stop-confirm-dialog .modal-body p { overflow-wrap: anywhere; }

.robot-card { display: flex; flex-direction: column; }
.robot-card .robot-actions { margin-top: auto; padding-top: 10px; }
.dashed-picker { min-width: 0; max-width: 100%; white-space: normal; }
.dashed-picker > b { min-width: 0; overflow-wrap: anywhere; }
.dashed-picker > span { flex: 0 0 auto; }

/* Empty messages stay inside the visible viewport when saved columns are wide. */
:is(.table-scroll, .dashboard-table-wrap):has(> table .table-empty-label) { container-type: inline-size; }
:is(.table-scroll, .dashboard-table-wrap) td.empty:has(> .table-empty-label) { text-align: left; overflow: visible; }
:is(.table-scroll, .dashboard-table-wrap) .table-empty-label {
  display: block;
  position: sticky;
  left: 18px;
  width: max(0px, calc(100cqi - 36px));
  max-width: 100%;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Picker contents must not enlarge the modal grid; long rows scroll inside their panel. */
.form-row:has(> .dashed-picker) { grid-template-columns: minmax(0, 1fr); }
.form-row > .picker-panel { min-width: 0; max-width: 100%; overflow-x: auto; }

/* Keep long application names readable beside the selection action. */
#schedule-app-picker .picker-row { grid-template-columns: 40px minmax(0, 1fr) minmax(40px, max-content); min-width: 0; }
#schedule-app-picker .app-icon { justify-self: center; }
#schedule-app-picker .picker-row > span:not(.app-icon) { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
#schedule-app-picker .picker-row :is(strong, small) { display: block; }
#schedule-app-picker .picker-row > em { text-align: center; white-space: nowrap; font-style: normal; color: #1677ff; }
.param-file-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }

/* Scroll the robot heading with its rows instead of compressing just the heading. */
.form-row > .picker-panel:has(> .agent-picker-head) > :is(.agent-picker-head, .picker-list) { min-width: 620px; }
.form-row > .picker-panel :is(.agent-picker-head, .agent-picker-row) { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1fr); }
.form-row > .picker-panel .agent-picker-row > span { min-width: 0; white-space: normal; overflow-wrap: anywhere; }

/* An empty robot collection has no wide data columns to scroll. */
#schedule-agent-picker:has(> #schedule-target-picker-list > .empty-box:not(.hidden)) > :is(.agent-picker-head, .picker-list) { min-width: 0; }
#schedule-target-picker-list > .empty-box { white-space: normal; overflow-wrap: anywhere; }

/* Keep long task names inside the deletion confirmation text. */
.modal[aria-labelledby="schedule-delete-title"] .modal-body p { overflow-wrap: anywhere; }

/* Artifact anchors need the same usable hit area and focus treatment as actions. */
[data-execution-detail] a.text-btn {
  display: inline-block;
  vertical-align: middle;
  max-width: 100%;
  min-height: 32px;
  padding: 4px 8px;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
  border-radius: 6px;
  background: #f4f7ff;
  text-decoration: none;
}
[data-execution-detail] a.text-btn:hover { background: #e8f2ff; }
[data-execution-detail] a.text-btn:active { background: #dcecff; }
[data-execution-detail] a.text-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
[data-execution-detail] p:has(> a.text-btn) { margin: 8px 0; }

/* Make the entire enable-on-save label comfortable to click. */
#schedule-form label:has(> input[name="enabled"]) {
  min-height: 32px;
  align-items: center;
}
.workflow-list-panel .action-menu button:focus-visible { outline-offset: -2px; }

/* Keep schedule picker keyboard rings inside their own scrolling lists. */
#schedule-form :is(.picker-row, .agent-picker-row):focus-visible { outline-offset: -2px; }
/* Reserve focus-scroll space above the footer without changing modal layout. */
#schedule-form > .modal-body { scroll-padding-block-end: 16px; }

/* A durable, keyboard-reachable action while this session's draft cancel is pending. */
.parameter-draft-retry {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 12px;
  border: 1px solid #f4cc81;
  border-radius: var(--control-radius);
  background: #fff8e8;
  color: #713f12;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.parameter-draft-retry > span { flex: 1 1 180px; min-width: 0; }
.parameter-draft-retry > button { flex: 0 0 auto; min-height: 32px; }
body > .parameter-draft-retry {
  position: fixed;
  z-index: 55;
  right: 16px;
  bottom: 16px;
  max-width: min(460px, calc(100vw - 32px));
}
.modal-body > .parameter-draft-retry { margin: 12px 0; }

/* Execution records expose full names and errors without changing other tables. */
.runs-record-table { min-width: 1500px; }
.runs-record-table :is(.run-record-name, .run-record-agent, .run-record-error-cell) {
  padding-block: 12px;
  white-space: normal;
  overflow-wrap: anywhere;
  text-overflow: clip;
}
.runs-record-table :is(.run-record-error, .run-record-agents) {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f4f7ff;
}
.runs-record-table :is(.run-record-error, .run-record-agents) > summary {
  min-height: 32px;
  padding: 6px 10px;
  color: #1677ff;
  cursor: pointer;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.runs-record-table :is(.run-record-error, .run-record-agents) > summary:hover { background: #e8f2ff; }
.runs-record-table :is(.run-record-error, .run-record-agents) > summary:active { background: #dcecff; }
.runs-record-table :is(.run-record-error, .run-record-agents) > pre {
  max-height: 260px;
  margin: 0;
  padding: 10px;
  border-top: 1px solid var(--line);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: auto;
  font: inherit;
  line-height: 1.6;
  color: var(--text);
  background: #fff;
}
.runs-record-table :is(.run-record-error, .run-record-agents) > :is(summary, pre):focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
  border-radius: 5px;
}

.recovery-operations:not(:empty) { display: grid; gap: 12px; margin-top: 16px; }
.recovery-card { display: grid; gap: 8px; min-width: 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; }
.recovery-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.recovery-card p { margin: 0; overflow-wrap: anywhere; }
.recovery-card small { color: var(--muted); line-height: 1.65; }
.recovery-card > button { justify-self: start; }

/* Task editor credential cards and their local selection dialog. */
[data-schedule-credentials] .credential-choice, .schedule-credential-dialog .credential-choice { padding-inline: 16px; color: inherit; text-align: left; }
.schedule-credential-remove { flex: none; margin-left: auto; padding: 6px 11px; border: 0; border-radius: 4px; background: transparent; color: #667085; font-size: 14px; }
.schedule-credential-remove:hover, .schedule-credential-remove:focus-visible { color: #ba3034; }
.schedule-credential-add { min-height: 61px; border-radius: 6px; color: #4b5563; }
.schedule-credential-add span { color: inherit; }
.schedule-credential-add:hover { border-color: #8a9bb6; background: #fcfdff; }
.schedule-credential-dialog { color: inherit; width: min(620px, calc(100% - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid #dfe6ef; border-radius: 10px; box-shadow: 0 16px 64px #17294626; }
.schedule-credential-dialog[open] { display: flex; flex-direction: column; }
.schedule-credential-dialog::backdrop { background: rgb(23 34 52 / 32%); }
.schedule-credential-dialog header, .schedule-credential-dialog footer { padding: 16px 20px; }
.schedule-credential-dialog h2 { margin: 0 0 14px; font-size: 16px; }
.schedule-credential-dialog .picker-search { margin-bottom: 0; }
.schedule-credential-dialog .picker-search button { flex-shrink: 0; }
.schedule-credential-dialog input[type=search] { min-width: 0; min-height: 36px; font-size: 14px; }
.schedule-credential-dialog .credential-picker {
  --visible-rows: 4;
  --row-height: 61px;
  --row-gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(var(--row-height), auto);
  gap: var(--row-gap);
  align-content: start;
  height: calc(var(--visible-rows) * (var(--row-height) + var(--row-gap)) - var(--row-gap));
  min-height: 0;
  margin: 12px 0 16px;
  padding: 0 20px;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}
@media (max-width: 600px) {
  .schedule-credential-dialog .credential-picker { --visible-rows: 8; grid-template-columns: minmax(0, 1fr); }
}
.schedule-credential-dialog .credential-choice > span { overflow-wrap: anywhere; }
.schedule-credential-dialog [aria-pressed="true"] { border-color: #7299ee; background: #edf3ff; box-shadow: inset 0 0 0 1px #7299ee; }
.schedule-credential-dialog .credential-picker p { grid-column: 1 / -1; color: #64748b; font-size: 14px; }
.schedule-credential-dialog footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; border-top: 1px solid #e8eef7; }
.schedule-credential-dialog output { margin-right: auto; font-size: 13px; color: #596579; }

/* Keep the task filters above their actions as the available space changes. */
.schedule-list-filters { gap: 12px 16px; margin-bottom: 12px; }
.schedule-list-filters > label { white-space: nowrap; }
.schedule-list-filters > label:has(.search-combobox) { flex: 1 1 148px; }
.schedule-list-filters > label:has(#schedule-filter-name) { flex-grow: 1.25; }
.schedule-list-filters .search-combobox { flex: 1; min-width: 0; }
.schedule-list-filters .search-combobox input.wide { width: 100%; max-width: 100%; }
.schedule-list-filters > [data-schedule-action="audit"] { margin-inline-start: auto; }
.schedule-list-actions { justify-content: flex-end; gap: 10px; }
@media (max-width: 640px) {
  .schedule-list-filters > label:has(.search-combobox) { flex-basis: 100%; max-width: none; }
}

.agent-list-toolbar { flex-wrap: nowrap; gap: 12px; }
.agent-list-toolbar > .pills { min-width: 0; overflow-x: auto; }
.agent-list-toolbar > .pills button, .agent-list-toolbar > button { flex: none; white-space: nowrap; }
.agent-list-toolbar > label { flex: 0 1 308px; min-width: 160px; white-space: nowrap; }
.agent-list-toolbar .search-combobox { min-width: 0; flex: 1; }
.agent-list-toolbar .search-combobox input.wide { width: 100%; max-width: 100%; }
@media (max-width: 640px) {
  .agent-list-toolbar { gap: 6px; }
  .agent-list-toolbar > label { min-width: 72px; flex-basis: 115px; }
  .agent-list-toolbar > label > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .agent-list-toolbar > button { padding-inline: 10px; }
}
