:root {
  color-scheme: light;
  --page: #f6f7f9; --surface: #fff; --subtle: #f8f9fb;
  --line: #e8ebef; --line-strong: #d8dde4; --text: #18202a;
  --muted: #7a8592; --soft: #a8b0ba; --primary: #2864dc;
  --primary-soft: #eef4ff; --green: #16815f; --green-soft: #ebf8f3;
  --amber: #ad6b12; --amber-soft: #fff7e9; --red: #c74453; --red-soft: #fff0f2;
  --violet: #6655c5; --violet-soft: #f2f0ff;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { min-width: 760px; background: var(--page); color: var(--text); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .42; }
.hidden { display: none !important; }
.workspace { display: grid; grid-template-columns: 350px minmax(0, 1fr); width: 100%; height: 100vh; }
.sidebar { display: flex; min-width: 0; min-height: 0; flex-direction: column; border-right: 1px solid var(--line); background: var(--surface); }

.brandbar, .detail-header { flex: 0 0 66px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); }
.brandbar { display: flex; align-items: center; justify-content: space-between; padding: 0 18px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; background: #18202a; color: white; font: 750 10px/1 ui-monospace, monospace; }
.brand h1 { margin: 0; font-size: 14px; letter-spacing: .03em; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 9px; }
.brand-actions { display: flex; align-items: center; gap: 10px; }
.settings-button { display: inline-flex; height: 28px; align-items: center; gap: 4px; padding: 0 7px; border: 1px solid var(--line); border-radius: 7px; background: white; color: #596572; font-size: 9px; }
.settings-button:hover { border-color: var(--line-strong); background: var(--subtle); color: var(--primary); }
.run-badge { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; }
.run-badge span { width: 6px; height: 6px; border-radius: 50%; background: var(--soft); }
.run-badge.loading span, .run-badge.running span { background: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); animation: pulse 1.3s infinite; }
.run-badge.paused span { background: var(--amber); }.run-badge.completed span { background: var(--green); }.run-badge.error span { background: var(--red); }
@keyframes pulse { 50% { opacity: .35; } }

.control-panel { position: relative; flex: 0 0 auto; padding: 15px 16px 14px; border-bottom: 1px solid var(--line); }
.compact-controls { display: grid; grid-template-columns: minmax(110px, 1fr) 76px 50px; align-items: end; gap: 7px; }
.field-label, .compact-field span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.keyword-picker { position: relative; min-width: 0; }
.keyword-button, .compact-field input { width: 100%; height: 34px; border: 1px solid var(--line-strong); border-radius: 7px; background: white; color: var(--text); outline: none; }
.keyword-button { display: flex; align-items: center; justify-content: space-between; min-width: 0; padding: 0 9px; text-align: left; }
.keyword-button > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-field input { padding: 0 5px; text-align: center; }
.keyword-button:focus, .compact-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.primary-button, .secondary-button { height: 34px; padding: 0 9px; border-radius: 7px; font-size: 10px; font-weight: 650; white-space: nowrap; }
.primary-button { border: 1px solid var(--primary); background: var(--primary); color: white; }
.secondary-button { border: 1px solid var(--line-strong); background: white; color: #4f5b68; }
.primary-button:hover:not(:disabled) { background: #2056c2; }.secondary-button:hover:not(:disabled) { border-color: #b5bec9; background: var(--subtle); }
.keyword-menu { position: absolute; z-index: 20; top: 55px; left: 0; width: 286px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 10px; background: white; box-shadow: 0 14px 40px rgb(25 34 44 / 14%); }
.keyword-menu-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 11px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.keyword-menu-head button, .keyword-actions button { border: 0; background: transparent; color: var(--primary); font-size: 9px; }
.keyword-list { max-height: 260px; overflow-y: auto; }
.keyword-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-bottom: 1px solid var(--line); }
.keyword-row:last-child { border-bottom: 0; }.keyword-row.selected { background: var(--primary-soft); }
.keyword-pick { min-width: 0; padding: 10px 11px; border: 0; background: transparent; text-align: left; }
.keyword-pick strong, .keyword-pick span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.keyword-pick strong { font-size: 11px; }.keyword-pick span { margin-top: 3px; color: var(--muted); font-size: 8px; }
.keyword-actions { display: flex; padding-right: 7px; }.keyword-actions button:last-child { color: var(--red); }
.keyword-empty { padding: 18px; color: var(--muted); font-size: 10px; text-align: center; }
.control-options { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.control-options > span { overflow: hidden; color: var(--soft); font: 8px/1.2 ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }
.switch-row { display: flex; align-items: center; gap: 7px; color: #5f6a77; font-size: 9px; cursor: pointer; white-space: nowrap; }
.switch-row input { position: absolute; opacity: 0; }.switch { width: 26px; height: 16px; padding: 2px; border-radius: 99px; background: #d7dce2; }
.switch::after { content: ""; display: block; width: 12px; height: 12px; border-radius: 50%; background: white; box-shadow: 0 1px 3px #0002; transition: transform .17s; }
.switch-row input:checked + .switch { background: var(--primary); }.switch-row input:checked + .switch::after { transform: translateX(10px); }
.progress-block { margin-top: 12px; }.progress-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.progress-meta strong { color: #4d5865; font: 650 9px/1 ui-monospace, monospace; }.progress-track { height: 4px; margin-top: 7px; overflow: hidden; border-radius: 9px; background: #edf0f3; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--primary); transition: width .3s; }
.alert { position: absolute; z-index: 30; top: calc(100% + 8px); left: 12px; right: 12px; padding: 10px; border: 1px solid #ffd0d6; border-radius: 8px; background: var(--red-soft); box-shadow: 0 8px 24px #0001; color: var(--red); font-size: 10px; line-height: 1.45; }

.results-list-panel { display: flex; min-height: 0; flex: 1 1 auto; flex-direction: column; overflow: hidden; }
.list-heading { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; padding: 14px 16px 8px; }
.list-heading strong { font-size: 12px; }.list-heading p { margin: 3px 0 0; color: var(--muted); font-size: 8px; }
.select-all, .filter-bar label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; }
input[type="checkbox"] { accent-color: var(--primary); }
.filter-bar { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; padding: 0 16px 9px; }
.filter-bar select { height: 27px; min-width: 118px; padding: 0 7px; border: 1px solid var(--line); border-radius: 6px; background: white; color: #586472; font-size: 9px; }
.bulk-bar { display: flex; flex: 0 0 36px; align-items: center; gap: 7px; padding: 0 16px 8px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.text-button { border: 0; background: transparent; color: var(--primary); font-size: 9px; }.send-button { height: 27px; margin-left: auto; padding: 0 9px; border: 1px solid #ddd8f8; border-radius: 6px; background: var(--violet-soft); color: var(--violet); font-size: 9px; font-weight: 650; }
.result-list { min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.result-item { display: grid; grid-template-columns: 19px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 62px; padding: 9px 12px 9px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.result-item:hover { background: var(--subtle); }.result-item.focused { background: var(--primary-soft); box-shadow: inset 3px 0 var(--primary); }.result-item.checked:not(.focused) { background: #f8f7ff; }
.result-checkbox { display: grid; place-items: center; }.result-main { min-width: 0; }.result-main strong, .result-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-main strong { font-size: 10px; }.result-main span { margin-top: 4px; color: var(--muted); font: 8px/1.3 ui-monospace, monospace; }
.result-side { display: grid; justify-items: end; gap: 6px; }.result-side small { color: var(--soft); font-size: 7px; }
.status-pill { padding: 3px 6px; border-radius: 99px; background: #f0f2f5; color: #68737f; font-size: 8px; white-space: nowrap; }
.status-pill.running, .status-pill.proxy { background: var(--primary-soft); color: var(--primary); }.status-pill.success { background: var(--green-soft); color: var(--green); }.status-pill.failed { background: var(--amber-soft); color: var(--amber); }.status-pill.error { background: var(--red-soft); color: var(--red); }
.empty-list { display: grid; min-height: 190px; place-content: center; text-align: center; }.empty-list strong { color: #687481; font-size: 11px; }.empty-list span { margin-top: 5px; color: var(--soft); font-size: 9px; }

.detail-panel { display: flex; min-width: 0; min-height: 0; flex-direction: column; background: var(--page); }
.detail-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 28px; }
.detail-title { min-width: 0; }.detail-title > span { display: block; color: #404b57; font-size: 13px; font-weight: 700; }
.detail-title a { display: block; max-width: min(70vw, 900px); margin-top: 5px; overflow: hidden; color: var(--muted); font: 9px/1.2 ui-monospace, monospace; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.detail-title a:hover { color: var(--primary); }.detail-head-actions { display: flex; align-items: center; gap: 12px; }.detail-position { color: var(--muted); font: 9px/1 ui-monospace, monospace; }
.detail-action { height: 31px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 7px; background: white; color: #4e5965; font-size: 9px; font-weight: 650; white-space: nowrap; }.detail-action:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.detail-content { min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 26px clamp(24px, 4vw, 54px) 44px; }
.detail-empty { display: grid; min-height: calc(100vh - 150px); place-content: center; justify-items: center; text-align: center; }.empty-icon { display: grid; width: 52px; height: 52px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--soft); font-size: 22px; }
.detail-empty h3 { margin: 15px 0 6px; font-size: 15px; }.detail-empty p { max-width: 360px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.detail-overview { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }.soft-status { color: var(--muted); font-size: 9px; }.detail-overview h2 { margin: 6px 0 0; font-size: clamp(22px, 3vw, 34px); letter-spacing: -.04em; word-break: break-all; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(80px, 1fr)); min-width: min(520px, 55%); overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--line); gap: 1px; }
.detail-stat { min-width: 0; padding: 11px 12px; background: white; }.detail-stat span { display: block; color: var(--muted); font-size: 8px; }.detail-stat strong { display: block; margin-top: 6px; overflow: hidden; font: 630 10px/1.25 ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }
.nodes-section { margin-top: 24px; }.node-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 11px; }.node-toolbar h3 { margin: 0; font-size: 12px; }.node-toolbar > div > span { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; }
.node-filters { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: white; }.node-filters button { height: 28px; padding: 0 9px; border: 0; border-right: 1px solid var(--line); background: white; color: var(--muted); font-size: 8px; }.node-filters button:last-child { border-right: 0; }.node-filters button.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.node-table { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: white; }.node-row { display: grid; grid-template-columns: minmax(150px, 1.3fr) minmax(120px, 1fr) 90px; align-items: center; gap: 14px; min-height: 44px; padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 9px; }.node-row:last-child { border-bottom: 0; }.node-row-head { min-height: 34px; background: var(--subtle); color: var(--muted); font-size: 8px; }.node-row strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }.node-row code { color: #4d5966; font-size: 9px; }.node-result { justify-self: start; padding: 3px 6px; border-radius: 99px; background: var(--green-soft); color: var(--green); }.node-row.failed .node-result { background: var(--amber-soft); color: var(--amber); }.node-row.node_error .node-result { background: var(--red-soft); color: var(--red); }.node-empty { padding: 35px; color: var(--muted); font-size: 10px; text-align: center; }
.outcome-box { margin-top: 24px; padding: 18px; border: 1px solid #ffd0d6; border-radius: 9px; background: var(--red-soft); }.outcome-box strong { font-size: 11px; }.outcome-box p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; word-break: break-word; }
.node-loading { margin-top: 24px; padding: 34px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--muted); font-size: 10px; text-align: center; }

.keyword-dialog, .settings-dialog { padding: 0; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 22px 70px #1114; }.keyword-dialog::backdrop, .settings-dialog::backdrop { background: #1b243044; backdrop-filter: blur(3px); }
.keyword-dialog { width: min(390px, calc(100vw - 30px)); }.keyword-dialog form { padding: 20px; }.keyword-dialog h3 { margin: 0 0 14px; font-size: 14px; }.keyword-dialog input { width: 100%; height: 39px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 7px; outline: none; }.keyword-dialog input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }.keyword-dialog form > div { display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px; }
.settings-dialog { width: min(720px, calc(100vw - 34px)); max-height: min(820px, calc(100vh - 34px)); overflow: hidden; }
.settings-dialog form { display: flex; max-height: min(820px, calc(100vh - 34px)); flex-direction: column; }
.settings-head { display: flex; flex: 0 0 auto; align-items: flex-start; justify-content: space-between; padding: 21px 24px 17px; border-bottom: 1px solid var(--line); }.settings-head > div > span { color: var(--primary); font-size: 8px; font-weight: 700; letter-spacing: .1em; }.settings-head h2 { margin: 4px 0 0; font-size: 18px; }.settings-head p { margin: 5px 0 0; color: var(--muted); font-size: 9px; }.icon-button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--muted); font-size: 18px; line-height: 1; }
.settings-body { min-height: 0; overflow-y: auto; padding: 0 24px; }.settings-section { padding: 20px 0; border-bottom: 1px solid var(--line); }.settings-section:last-child { border-bottom: 0; }.settings-section-title { display: flex; align-items: baseline; gap: 9px; margin-bottom: 13px; }.settings-section-title strong { font-size: 12px; }.settings-section-title span { color: var(--muted); font-size: 8px; }
.settings-fields { display: grid; gap: 11px; }.settings-fields.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }.settings-fields .full { grid-column: 1 / -1; }
.setting-field { display: grid; gap: 5px; }.setting-field > span, .template-label > span { color: #596572; font-size: 9px; font-weight: 600; }.setting-field input { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 7px; outline: none; }.setting-field input:focus, .template-editor textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.setting-switch { display: flex; min-height: 36px; align-items: center; gap: 9px; padding-top: 15px; cursor: pointer; }.setting-switch > input { position: absolute; opacity: 0; }.setting-switch > span:last-child strong, .setting-switch > span:last-child small { display: block; }.setting-switch strong { font-size: 9px; }.setting-switch small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.template-editor { display: grid; gap: 8px; }.template-label { display: flex; align-items: baseline; justify-content: space-between; }.template-label small { color: var(--muted); font-size: 8px; }.template-variables { display: flex; flex-wrap: wrap; gap: 5px; }.template-variables button { height: 25px; padding: 0 8px; border: 1px solid #dce5f5; border-radius: 6px; background: var(--primary-soft); color: var(--primary); font-size: 8px; }.template-editor textarea { width: 100%; min-height: 134px; resize: vertical; padding: 10px 11px; border: 1px solid var(--line-strong); border-radius: 8px; color: #33404d; font: 10px/1.6 ui-monospace, monospace; outline: none; }
.template-options { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }.template-options label { display: flex; align-items: center; gap: 6px; color: #596572; font-size: 9px; }.template-options small { color: var(--amber); font-size: 8px; }.template-preview { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--subtle); }.template-preview > span { display: block; padding: 7px 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 8px; }.template-preview pre { min-height: 68px; max-height: 150px; margin: 0; overflow: auto; padding: 10px; color: #45515e; font: 9px/1.55 ui-monospace, monospace; white-space: pre-wrap; word-break: break-word; }
.settings-footer { display: flex; flex: 0 0 58px; align-items: center; justify-content: flex-end; gap: 8px; padding: 0 24px; border-top: 1px solid var(--line); background: white; }.settings-footer > span { margin-right: auto; color: var(--green); font-size: 9px; }

@media (max-width: 1050px) { .workspace { grid-template-columns: 330px minmax(0,1fr); }.detail-overview { align-items: flex-start; flex-direction: column; }.detail-grid { width: 100%; min-width: 0; }.node-toolbar { align-items: flex-start; flex-direction: column; gap: 10px; } }
