:root { color-scheme: light; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #172033; background: #f5f7fb; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: linear-gradient(135deg, #f8fafc 0%, #eef5ff 100%); }
.login-screen { min-height: 100vh; padding: 24px; place-content: center; background: radial-gradient(circle at 20% 10%, #e2edff, transparent 35%), linear-gradient(135deg, #f8fafc, #edf4ff); }
.login-screen:not([hidden]) { display: grid; }
.login-card { width: min(420px, 92vw); padding: 38px; border: 1px solid #dce5f0; border-radius: 20px; background: #fff; box-shadow: 0 24px 70px rgba(31,53,86,.14); }
.login-mark { display: grid; width: 50px; height: 50px; margin-bottom: 20px; place-items: center; border-radius: 14px; background: #2878eb; color: #fff; font-size: 24px; }
.login-card h1 { font-size: 27px; }
.login-card > p:not(.eyebrow) { margin: 10px 0 26px; color: #667085; line-height: 1.5; }
.login-card label { display: block; margin-bottom: 16px; }
.login-card .primary-button { width: 100%; margin-top: 6px; padding: 13px; }
#login-error { display: block; min-height: 18px; margin-top: 12px; color: #c43232; text-align: center; font-size: 12px; font-weight: 700; }
.shell { min-height: 100vh; padding: 34px; }
.header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; padding-right: 56px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.eyebrow, .section-label { margin: 0 0 6px; color: #667085; font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
h1 { margin: 0; font-size: 30px; letter-spacing: -.03em; }
.status { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid #b7ebc6; border-radius: 999px; background: #ecfdf3; color: #087a3f; font-size: 13px; font-weight: 700; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 4px rgba(18,183,106,.12); }
.tabs { display: flex; gap: 4px; margin-bottom: 22px; padding: 4px; width: fit-content; border: 1px solid #dfe5ed; border-radius: 12px; background: #fff; }
.tab { padding: 9px 17px; border: 0; border-radius: 8px; background: transparent; color: #667085; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.tab.active { background: #2878eb; color: #fff; box-shadow: 0 3px 10px rgba(40,120,235,.22); }
.view { display: none; }
.view.active { display: block; }
.context { display: grid; grid-template-columns: 2fr 1fr 2fr; overflow: hidden; margin-bottom: 22px; border: 1px solid #e1e7ef; border-radius: 14px; background: #fff; box-shadow: 0 6px 24px rgba(31,42,68,.05); }
.context div { min-width: 0; padding: 16px 20px; border-right: 1px solid #e8edf3; }
.context div:last-child { border: 0; }
.context span { display: block; margin-bottom: 5px; color: #7a8699; font-size: 12px; }
.context strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.workspace { display: grid; grid-template-columns: 260px 1fr; min-height: 520px; overflow: hidden; border: 1px solid #e1e7ef; border-radius: 16px; background: #fff; box-shadow: 0 10px 36px rgba(31,42,68,.07); }
aside { padding: 24px 18px; border-right: 1px solid #e8edf3; background: #fafbfc; }
ol { display: grid; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
li { display: flex; align-items: center; gap: 11px; padding: 12px; border-radius: 10px; color: #667085; font-size: 14px; font-weight: 600; }
li span { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 8px; background: #e9edf3; font-size: 12px; }
li.active { background: #eaf2ff; color: #175cd3; }
li.active span { background: #2878eb; color: #fff; }
article { padding: 48px; }
.placeholder-label { display: inline-block; padding: 7px 10px; border-radius: 8px; background: #fff3df; color: #a55b0a; font-size: 12px; font-weight: 700; }
h2 { margin: 20px 0 10px; font-size: 27px; letter-spacing: -.025em; }
article > p { max-width: 680px; margin: 0; color: #667085; font-size: 16px; line-height: 1.65; }
.empty-state { display: flex; align-items: center; gap: 16px; max-width: 680px; margin-top: 36px; padding: 24px; border: 1px dashed #b9c5d6; border-radius: 14px; background: #f8fafc; }
.empty-state > span { display: grid; width: 50px; height: 50px; place-items: center; border-radius: 13px; background: #e9f1ff; color: #2267cc; font-size: 24px; }
.empty-state strong, .empty-state small { display: block; }
.empty-state small { margin-top: 5px; color: #7a8699; font-size: 13px; }
.restart-button { width: 100%; margin-top: 22px; padding: 10px; border: 1px solid #d4dce7; border-radius: 9px; background: #fff; color: #526067; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.script-player { display: flex; min-height: 520px; flex-direction: column; }
.player-topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.script-progress { color: #7a8699; font-size: 12px; font-weight: 700; }
.script-text { max-width: 850px; margin-top: 6px; padding: 26px 28px; border-left: 4px solid #2878eb; border-radius: 0 14px 14px 0; background: #f5f8fd; color: #253047; font-size: 20px; line-height: 1.65; white-space: pre-wrap; }
.script-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; max-width: 850px; margin-top: 28px; }
.script-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; max-width: 850px; margin-top: 20px; }
.script-field { display: block; padding: 14px; border: 1px solid #dbe3ed; border-radius: 11px; background: #fff; }
.script-field input, .script-field select { margin-top: 7px; }
.script-field .saving { border-color: #e4a83d; background: #fffaf0; }
.script-field .saved { border-color: #39a963; background: #f1fbf4; }
.choice-button { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 16px 18px; border: 1px solid #ccd7e5; border-radius: 12px; background: #fff; color: #344054; font: inherit; text-align: left; cursor: pointer; }
.choice-button:hover { border-color: #2878eb; box-shadow: 0 5px 18px rgba(40,120,235,.12); }
.choice-button span { font-size: 15px; font-weight: 800; }
.choice-button small { grid-column: 1; color: #7a8699; font-size: 12px; }
.choice-button b { grid-column: 2; grid-row: 1 / 3; align-self: center; color: #2878eb; font-size: 20px; }
.choice-button.primary-choice { border-color: #a9c8f5; background: #f1f6ff; }
.script-finish { display: flex; align-items: center; gap: 14px; padding: 20px; border: 1px solid #b9e5c7; border-radius: 12px; background: #f0fbf4; color: #087a3f; }
.script-finish > span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; background: #d9f5e2; font-size: 20px; }
.script-finish strong, .script-finish small { display: block; }
.script-finish small { margin-top: 4px; color: #528368; }
.player-actions { display: flex; gap: 10px; margin-top: auto; padding-top: 32px; }
.player-actions button:disabled { cursor: not-allowed; opacity: .45; }
.settings-card { padding: 30px; border: 1px solid #e1e7ef; border-radius: 16px; background: #fff; box-shadow: 0 10px 36px rgba(31,42,68,.07); }
.settings-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 26px; border-bottom: 1px solid #e8edf3; }
.settings-head h2 { margin: 0 0 8px; }
.settings-head p:last-child, .editor-title p { margin: 0; color: #667085; font-size: 14px; }
.amo-connection { display: grid; grid-template-columns: minmax(260px, 1.2fr) minmax(220px, .8fr) minmax(300px, 1.2fr); align-items: end; gap: 16px; margin-top: 22px; padding: 20px; border: 1px solid #cfe0f6; border-radius: 13px; background: #f5f9ff; }
.amo-connection h3 { margin: 0 0 5px; }
.amo-connection p:last-child { margin: 0; color: #667085; font-size: 12px; }
.amo-connection label { margin: 0; }
.subdomain-input { display: flex; align-items: center; }
.subdomain-input input { border-radius: 10px 0 0 10px; }
.subdomain-input b { padding: 12px 10px; border: 1px solid #ccd5e0; border-left: 0; border-radius: 0 10px 10px 0; background: #fff; color: #667085; font-size: 13px; white-space: nowrap; }
.connection-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
#amo-connection-status { color: #526067; font-size: 12px; font-weight: 700; }
.save-status { min-height: 20px; color: #087a3f; font-size: 13px; font-weight: 700; }
.form-grid { display: grid; gap: 22px; max-width: 720px; padding: 28px 0; }
label > span { display: block; margin-bottom: 8px; color: #344054; font-size: 13px; font-weight: 700; }
input, textarea { width: 100%; padding: 11px 13px; border: 1px solid #ccd5e0; border-radius: 10px; outline: 0; color: #172033; background: #fff; font: inherit; font-size: 14px; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; }
input:focus, textarea:focus { border-color: #2878eb; box-shadow: 0 0 0 3px rgba(40,120,235,.12); }
.stages-editor { padding-top: 26px; border-top: 1px solid #e8edf3; }
.editor-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.editor-title h3 { margin: 0 0 5px; font-size: 17px; }
.stage-rows { display: grid; gap: 9px; max-width: 720px; margin-top: 20px; }
.stage-row { display: grid; grid-template-columns: 34px 1fr 38px; align-items: center; gap: 10px; }
.stage-number { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: #eaf2ff; color: #175cd3; font-size: 12px; font-weight: 800; }
.remove-stage { width: 36px; height: 36px; border: 0; border-radius: 9px; background: #fff0f0; color: #c43232; font-size: 22px; cursor: pointer; }
.primary-button, .secondary-button { border-radius: 10px; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.primary-button { padding: 11px 18px; border: 0; background: #2878eb; color: #fff; box-shadow: 0 5px 14px rgba(40,120,235,.2); }
.secondary-button { padding: 9px 13px; border: 1px solid #cad5e2; background: #fff; color: #344054; }
.form-actions { margin-top: 28px; padding-top: 22px; border-top: 1px solid #e8edf3; }
.scenario-meta { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(320px, 1.5fr) auto; align-items: end; gap: 14px; padding: 22px 0; }
.flow-editor { display: grid; grid-template-columns: minmax(650px, 1fr) 340px; min-height: 650px; overflow: hidden; border: 1px solid #dfe6ef; border-radius: 14px; }
.flow-area { min-width: 0; background: #f6f8fb; }
.flow-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 66px; padding: 12px 16px; border-bottom: 1px solid #dfe6ef; background: #fff; }
.flow-toolbar strong, .flow-toolbar small { display: block; }
.flow-toolbar small { margin-top: 4px; color: #7a8699; font-size: 12px; }
.flow-viewport { height: 584px; overflow: auto; background-color: #f7f9fc; background-image: radial-gradient(#cad4e2 1px, transparent 1px); background-size: 20px 20px; }
.flow-canvas { position: relative; width: 1900px; height: 760px; }
.flow-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.edge-path { fill: none; stroke: #8da2bd; stroke-width: 2.2; }
#arrow path { fill: #7187a4; }
.edge-label rect { fill: #fff; stroke: #b8c6d8; stroke-width: 1px; filter: drop-shadow(0 2px 4px rgba(46,61,84,.12)); }
.edge-label text { fill: #344054; text-anchor: middle; font-size: 11px; font-weight: 800; }
.toolbar-actions { display: flex; gap: 8px; }
.flow-node { position: absolute; width: 230px; height: 112px; padding: 15px 18px; border: 2px solid #cfd8e5; border-radius: 13px; background: #fff; color: #172033; box-shadow: 0 8px 22px rgba(46,61,84,.1); text-align: left; cursor: grab; touch-action: none; user-select: none; }
.flow-node:hover { border-color: #92b7ee; box-shadow: 0 10px 26px rgba(37,93,170,.14); }
.flow-node.selected { border-color: #2878eb; box-shadow: 0 0 0 4px rgba(40,120,235,.13), 0 10px 28px rgba(37,93,170,.16); }
.flow-node.dragging { cursor: grabbing; opacity: .92; z-index: 3; }
.flow-node .node-kind { display: inline-block; margin-bottom: 9px; padding: 3px 7px; border-radius: 6px; background: #eaf2ff; color: #175cd3; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.flow-node.type-client { border-color: #e2bd73; background: #fffdf7; }
.flow-node.type-client .node-kind { background: #fff0d8; color: #a85b00; }
.flow-node.type-manager .node-kind { background: #eaf2ff; color: #175cd3; }
.flow-node.type-finish .node-kind { background: #e7f8ed; color: #087a3f; }
.flow-node strong, .flow-node small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-node strong { margin-bottom: 5px; font-size: 14px; }
.flow-node small { color: #7a8699; font-size: 11px; }
.node-port { position: absolute; right: -7px; top: calc(50% - 6px); width: 12px; height: 12px; border: 2px solid #fff; border-radius: 50%; background: #7187a4; box-shadow: 0 0 0 1px #8fa1b8; }
.node-inspector { overflow: auto; padding: 22px; border: 0; border-left: 1px solid #dfe6ef; background: #fff; }
.inspector-empty { display: grid; min-height: 500px; place-content: center; color: #7a8699; text-align: center; }
.inspector-empty > span { color: #a8b6c8; font-size: 42px; }
.inspector-empty strong { margin: 10px 0 5px; color: #344054; }
.inspector-empty p { max-width: 240px; margin: 0; font-size: 13px; line-height: 1.5; }
.inspector-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid #e8edf3; }
.inspector-heading h3 { margin: 0; }
.node-inspector label { display: block; margin-bottom: 18px; }
.variable-insert { display: grid; grid-template-columns: 1fr; gap: 8px; margin: -8px 0 20px; }
.variable-insert > button { width: 100%; white-space: nowrap; }
.picker-combobox { position: relative; min-width: 0; }
.picker-combobox > input { width: 100%; }
.compact-picker-results { position: fixed; z-index: 300; width: 360px; max-height: 360px; overflow: auto; padding: 7px; border: 1px solid #ccd6e2; border-radius: 11px; background: #fff; box-shadow: 0 14px 38px rgba(31,42,68,.22); }
.variable-result-group > strong { display: block; padding: 8px 9px 5px; color: #98a2b3; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.variable-result-group > button { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 7px; background: transparent; color: #344054; font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
.variable-result-group > button:hover { background: #eaf2ff; color: #175cd3; }
.variable-empty { padding: 24px 10px; color: #98a2b3; font-size: 12px; text-align: center; }
.node-fields-editor { margin: 0 0 20px; padding: 18px 0; border-top: 1px solid #e8edf3; border-bottom: 1px solid #e8edf3; }
.field-picker-group h3 { position: sticky; top: 0; z-index: 1; margin: 0 -7px 4px; padding: 10px 12px 7px; background: #fff; color: #667085; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.field-picker-group button { display: grid; width: 100%; grid-template-columns: 1fr auto; gap: 3px 12px; padding: 11px 12px; border: 0; border-radius: 9px; background: transparent; color: #344054; text-align: left; cursor: pointer; }
.field-picker-group button:hover { background: #edf4ff; color: #175cd3; }
.field-picker-group button span { font-size: 13px; font-weight: 700; }
.field-picker-group button small { color: #98a2b3; font-size: 10px; }
.field-picker-group button b { grid-column: 2; grid-row: 1 / 3; align-self: center; font-size: 18px; }
.picker-empty { padding: 45px 20px; color: #98a2b3; text-align: center; }
.node-field-row { display: grid; grid-template-columns: .8fr 1.2fr 28px; gap: 6px; margin-top: 8px; }
.node-field-row input, .node-field-row select { min-width: 0; padding: 8px; font-size: 11px; }
.node-field-row button { width: 27px; height: 27px; align-self: center; border: 0; border-radius: 7px; background: #fff0f0; color: #c43232; cursor: pointer; }
select { width: 100%; padding: 11px 13px; border: 1px solid #ccd5e0; border-radius: 10px; background: #fff; color: #172033; font: inherit; font-size: 14px; }
.icon-danger { width: 34px; height: 34px; border: 0; border-radius: 9px; background: #fff0f0; color: #c43232; font-size: 22px; cursor: pointer; }
.transitions { padding-top: 18px; border-top: 1px solid #e8edf3; }
.inspector-subhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.inspector-subhead button { border: 0; background: transparent; color: #175cd3; font-size: 12px; font-weight: 800; cursor: pointer; }
.transition-row { display: grid; grid-template-columns: minmax(75px, .7fr) 16px minmax(90px, 1fr) 28px; align-items: center; gap: 6px; margin-bottom: 8px; }
.transition-row input { padding: 8px; font-size: 12px; }
.transition-row strong { overflow: hidden; color: #526067; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.transition-row button { width: 27px; height: 27px; border: 0; border-radius: 7px; background: #fff0f0; color: #c43232; cursor: pointer; }
.no-transitions { margin: 0; color: #98a2b3; font-size: 12px; }
@media (max-width: 720px) { .shell { padding: 20px; } .header { align-items: flex-start; flex-direction: column; } .context { grid-template-columns: 1fr; } .context div { border-right: 0; border-bottom: 1px solid #e8edf3; } .workspace { grid-template-columns: 1fr; } aside { display: none; } article { padding: 28px; } .script-text { font-size: 17px; } }
@media (max-width: 1050px) { .scenario-meta { grid-template-columns: 1fr; } .flow-editor { grid-template-columns: 1fr; } .node-inspector { display: block; min-height: 420px; border-left: 0; border-top: 1px solid #dfe6ef; } }
@media (max-width: 1200px) { .amo-connection { grid-template-columns: 1fr; } .connection-actions { grid-column: 1; } }
