:root {
    --navy: #173f79;
    --blue: #245ca4;
    --blue-soft: #edf4ff;
    --orange: #ffad0a;
    --orange-deep: #f29400;
    --orange-soft: #fff6df;
    --teal: #23a99a;
    --purple: #7459b8;
    --ink: #18233a;
    --muted: #6e7b94;
    --line: #dfe5ef;
    --line-strong: #cbd4e2;
    --surface: #ffffff;
    --canvas: #f5f8fc;
    --danger: #d84f4f;
    --shadow: 0 10px 30px rgba(31, 58, 97, 0.12);
    --header-height: 68px;
    --sidebar-width: 76px;
    --drawer-width: 440px;
}

* { box-sizing: border-box; }

html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }

body {
    color: var(--ink);
    background: var(--canvas);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.designer-shell { height: 100%; }

.designer-header {
    position: relative;
    z-index: 30;
    display: grid;
    grid-template-columns: 260px minmax(420px, 1fr) auto;
    align-items: center;
    height: var(--header-height);
    padding: 0 18px 0 16px;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 8px rgba(28, 51, 84, 0.05);
    backdrop-filter: blur(12px);
}

.brand { display: inline-flex; align-items: center; gap: 11px; width: fit-content; color: inherit; text-decoration: none; }
.brand-logo { display: grid; place-items: center; width: 36px; height: 36px; color: white; background: var(--navy); border-radius: 10px; box-shadow: 0 6px 14px rgba(23, 63, 121, 0.2); font-size: 15px; font-weight: 850; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; letter-spacing: 0.01em; }
.brand small { margin-top: 2px; color: #8c97aa; font-size: 9px; letter-spacing: 0.12em; }

.design-steps { align-self: stretch; display: flex; justify-content: center; gap: 42px; }
.design-steps button { position: relative; min-width: 76px; padding: 2px 0 0; color: #697690; background: none; border: 0; outline: 0; cursor: pointer; font-size: 15px; }
.design-steps button:hover { color: var(--ink); }
.design-steps button.active { color: var(--ink); font-weight: 720; }
.design-steps button.active::after { content: ""; position: absolute; right: 8px; bottom: 0; left: 8px; height: 4px; background: var(--orange); border-radius: 4px 4px 0 0; }

.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.save-state { display: inline-flex; align-items: center; gap: 7px; margin-right: 3px; color: #78849a; font-size: 11px; white-space: nowrap; }
.save-state i { width: 7px; height: 7px; background: #2fb38d; border-radius: 50%; box-shadow: 0 0 0 4px rgba(47, 179, 141, 0.1); }
.save-state.dirty i { background: var(--orange); box-shadow: 0 0 0 4px rgba(255, 173, 10, 0.12); }

.primary-button, .secondary-button, .danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
    transition: 150ms ease;
}
.primary-button { color: white; background: var(--blue); border: 1px solid var(--blue); box-shadow: 0 4px 12px rgba(36, 92, 164, 0.2); }
.primary-button:hover { background: #194d8e; border-color: #194d8e; }
.primary-button:disabled { opacity: 0.6; cursor: wait; }
.secondary-button { color: #41516d; background: white; border: 1px solid var(--line); }
.secondary-button:hover { color: var(--blue); border-color: #aebbd0; background: #f9fbff; }
.danger-button { color: var(--danger); background: #fff7f7; border: 1px solid #f0d5d5; }
.danger-button:hover { background: #ffeded; }

.designer-body { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); height: calc(100% - var(--header-height)); }

.app-sidebar { position: relative; z-index: 12; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 0 14px; background: white; border-right: 1px solid var(--line); }
.app-sidebar button, .app-sidebar a { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; color: #466184; background: transparent; border: 0; border-radius: 10px; cursor: pointer; font-size: 20px; text-decoration: none; transition: 150ms ease; }
.app-sidebar button:hover, .app-sidebar a:hover { color: var(--navy); background: #f0f4fa; }
.app-sidebar .active { color: var(--navy); background: #eaf0f9; }
.app-sidebar a { color: #31a983; font-size: 13px; }
.sidebar-spacer { flex: 1; }

.flow-glyph { position: relative; display: block; width: 23px; height: 23px; }
.flow-glyph i { position: absolute; width: 7px; height: 7px; background: currentColor; border: 2px solid currentColor; border-radius: 50%; }
.flow-glyph i:nth-child(1) { top: 0; left: 8px; background: white; }
.flow-glyph i:nth-child(2) { bottom: 0; left: 0; background: white; }
.flow-glyph i:nth-child(3) { right: 0; bottom: 0; background: white; }
.flow-glyph::before { content: ""; position: absolute; top: 7px; left: 11px; width: 1px; height: 9px; background: currentColor; }
.flow-glyph::after { content: ""; position: absolute; top: 12px; left: 4px; width: 15px; height: 1px; background: currentColor; }

.designer-main { position: relative; min-width: 0; min-height: 0; }
.flow-workspace { position: absolute; inset: 0; overflow: hidden; background-color: var(--canvas); background-image: radial-gradient(#d5dce8 0.7px, transparent 0.8px); background-size: 18px 18px; }

.canvas-toolbar { position: absolute; z-index: 9; top: 0; right: 0; left: 0; display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 15px 22px; background: linear-gradient(to bottom, rgba(245, 248, 252, 0.98), rgba(245, 248, 252, 0.78), transparent); pointer-events: none; }
.canvas-toolbar > * { pointer-events: auto; }
.canvas-toolbar h1 { margin: 3px 0 0; font-size: 20px; letter-spacing: -0.02em; }
.canvas-kicker, .modal-kicker { color: #8d99ad; font-size: 8px; font-weight: 800; letter-spacing: 0.16em; }
.canvas-toolbar-actions { display: flex; gap: 7px; margin-right: 12px; }
.canvas-toolbar-actions button { min-height: 32px; padding: 0 11px; color: #52627b; background: rgba(255, 255, 255, 0.9); border: 1px solid var(--line); border-radius: 7px; cursor: pointer; font-size: 11px; font-weight: 650; }
.canvas-toolbar-actions button:hover { color: var(--blue); border-color: #b4c0d1; }

.flow-scroll { position: absolute; inset: 0; overflow: auto; padding: 104px 70px 110px; }
.designer-main:has(.property-drawer.open) .flow-scroll { padding-right: calc(var(--drawer-width) + 82px); }
.flow-stage { width: max-content; min-width: 100%; min-height: 100%; display: flex; justify-content: center; transform-origin: top center; transition: transform 180ms ease; }
.flow-builder { width: max-content; min-width: 300px; display: flex; flex-direction: column; align-items: center; }

.node-wrap { position: relative; z-index: 3; display: flex; justify-content: center; }
.flow-node { position: relative; width: 260px; overflow: hidden; background: white; border: 1px solid #dbe2ec; border-radius: 9px; box-shadow: 0 7px 20px rgba(35, 57, 90, 0.1); cursor: pointer; transition: 150ms ease; }
.flow-node:hover { transform: translateY(-1px); box-shadow: 0 10px 25px rgba(35, 57, 90, 0.15); }
.flow-node.selected { outline: 3px solid rgba(36, 92, 164, 0.17); border-color: #7f9fc8; }
.node-header { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 16px; color: white; background: var(--blue); }
.node-header strong { flex: 1; min-width: 0; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.node-header .node-icon { font-size: 17px; line-height: 1; }
.node-remove { display: none; width: 23px; height: 23px; padding: 0; color: rgba(255, 255, 255, 0.88); background: rgba(0, 0, 0, 0.12); border: 0; border-radius: 50%; cursor: pointer; }
.flow-node:hover .node-remove { display: grid; place-items: center; }
.node-remove:hover { background: rgba(0, 0, 0, 0.24); }
.node-body { display: flex; align-items: center; min-height: 43px; padding: 0 14px; color: #748099; background: white; }
.node-assignee { flex: 1; min-width: 0; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.node-stats { display: flex; gap: 10px; color: #8794a9; font-size: 10px; }
.node-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 22px; height: 22px; margin-right: 8px; color: white; background: #657fa3; border: 2px solid white; border-radius: 50%; box-shadow: 0 1px 5px rgba(25, 48, 82, 0.2); font-size: 9px; font-weight: 750; }

.flow-node.start .node-header { background: linear-gradient(105deg, #173e78, #496a98); }
.flow-node.approval .node-header { background: linear-gradient(105deg, var(--orange-deep), #ffb717); }
.flow-node.fill .node-header { background: linear-gradient(105deg, #1c9b8e, #33b7aa); }
.flow-node.copy .node-header { background: linear-gradient(105deg, #6751a3, #8970c8); }
.flow-node.webhook .node-header { background: linear-gradient(105deg, #47627f, #6885a5); }
.flow-node.end { width: 110px; border-radius: 22px; box-shadow: none; cursor: default; }
.flow-node.end:hover { transform: none; }
.flow-node.end .node-body { justify-content: center; min-height: 38px; color: #8490a3; font-weight: 650; }

.add-row { position: relative; z-index: 4; display: flex; justify-content: center; align-items: center; width: 100%; height: 54px; }
.add-row::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: #91a4bf; }
.add-node-button { position: relative; z-index: 2; display: grid; place-items: center; width: 28px; height: 28px; padding: 0 0 2px; color: var(--blue); background: white; border: 1px solid #a8b7ca; border-radius: 50%; box-shadow: 0 3px 10px rgba(36, 67, 109, 0.13); cursor: pointer; font-size: 20px; font-weight: 400; line-height: 1; transition: 150ms ease; }
.add-node-button:hover, .add-node-button.active { color: white; background: var(--orange); border-color: var(--orange); transform: scale(1.08); }

.branch-block { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; min-width: 600px; padding-top: 2px; }
.branch-split { position: relative; z-index: 4; display: flex; align-items: center; gap: 8px; height: 34px; }
.branch-split::before { content: ""; position: absolute; top: -2px; bottom: 17px; left: 50%; width: 1px; background: #91a4bf; z-index: -1; }
.branch-badge, .branch-add { min-height: 28px; padding: 0 10px; color: var(--orange-deep); background: white; border: 1px solid #f3bd59; border-radius: 16px; font-size: 10px; font-weight: 700; }
.branch-badge > button { width: 18px; height: 18px; margin: 0 -5px 0 5px; padding: 0; color: #b37a22; background: #fff5df; border: 0; border-radius: 50%; cursor: pointer; }
.branch-badge > button:hover { color: white; background: var(--danger); }
.branch-add { width: 28px; padding: 0; color: white; background: var(--orange); border-color: var(--orange); cursor: pointer; font-size: 16px; }
.branch-columns { position: relative; display: grid; grid-template-columns: repeat(var(--branch-count), minmax(250px, 1fr)); gap: 36px; padding: 34px 28px 0; }
.branch-columns::before { content: ""; position: absolute; top: 16px; right: calc(28px + 125px); left: calc(28px + 125px); height: 1px; background: #91a4bf; }
.branch-column { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 250px; }
.branch-column::before { content: ""; position: absolute; top: -18px; left: 50%; width: 1px; height: 18px; background: #91a4bf; }
.branch-condition-card { position: relative; z-index: 3; display: flex; align-items: center; width: 250px; min-height: 45px; padding: 7px 11px; color: #3d4b64; background: white; border: 1px solid #d8e0eb; border-radius: 8px; box-shadow: 0 5px 14px rgba(41, 65, 97, 0.08); cursor: pointer; text-align: left; }
.branch-condition-card:hover, .branch-condition-card.selected { border-color: #f0ae32; box-shadow: 0 7px 18px rgba(242, 148, 0, 0.13); }
.condition-symbol { display: grid; place-items: center; flex: 0 0 auto; width: 24px; height: 24px; margin-right: 8px; color: var(--orange-deep); background: var(--orange-soft); border-radius: 7px; font-size: 13px; font-weight: 800; }
.condition-text { flex: 1; min-width: 0; }
.condition-text strong, .condition-text small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.condition-text strong { font-size: 11px; }
.condition-text small { margin-top: 3px; color: #929caf; font-size: 9px; font-weight: 450; }
.condition-edit { color: #8a96a9; font-size: 12px; }
.branch-sequence { display: flex; flex-direction: column; align-items: center; width: 100%; }
.branch-join { position: relative; width: 100%; height: 38px; margin-top: 4px; }
.branch-join::before { content: ""; position: absolute; top: 20px; right: calc(28px + 125px); left: calc(28px + 125px); height: 1px; background: #91a4bf; }
.branch-join::after { content: ""; position: absolute; top: 20px; bottom: -1px; left: 50%; width: 1px; background: #91a4bf; }
.branch-column > .branch-sequence::after { content: ""; width: 1px; height: 20px; background: #91a4bf; }

.node-menu { position: fixed; z-index: 80; width: 278px; max-height: calc(100vh - 24px); padding: 8px; overflow-y: auto; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 46px rgba(29, 50, 82, 0.2); }
.node-menu-heading { padding: 7px 9px 9px; color: #98a2b4; font-size: 9px; font-weight: 800; letter-spacing: 0.12em; }
.node-menu button { display: flex; align-items: center; width: 100%; min-height: 54px; padding: 7px 9px; background: transparent; border: 0; border-radius: 8px; cursor: pointer; text-align: left; }
.node-menu button:hover { background: #f5f8fc; }
.node-menu button > div { min-width: 0; }
.node-menu strong, .node-menu small { display: block; }
.node-menu strong { font-size: 13px; }
.node-menu small { margin-top: 3px; color: #909bae; font-size: 9px; }
.menu-icon { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; margin-right: 10px; color: white; border-radius: 9px; font-size: 15px; }
.menu-icon.approval { background: var(--orange); }
.menu-icon.countersign { background: #6d5ce7; }
.menu-icon.fill { background: var(--teal); }
.menu-icon.copy { background: var(--purple); }
.menu-icon.webhook { background: #54708f; }
.menu-icon.branch { background: #ed8e1a; }
.menu-icon.amount-tier { background: #187b70; }

.property-drawer { position: absolute; z-index: 20; top: 12px; right: 12px; bottom: 12px; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: var(--drawer-width); overflow: hidden; background: white; border: 1px solid #dce3ed; border-radius: 14px; box-shadow: 0 16px 45px rgba(35, 57, 90, 0.16); transform: translateX(calc(100% + 26px)); transition: transform 220ms ease; }
.property-drawer.open { transform: translateX(0); }
.drawer-header { display: flex; align-items: center; justify-content: space-between; min-height: 68px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.drawer-title { display: flex; align-items: center; gap: 11px; }
.drawer-title h2, .drawer-title small { display: block; margin: 0; }
.drawer-title h2 { font-size: 16px; }
.drawer-title small { margin-top: 3px; color: #8c97a9; font-size: 9px; }
.node-type-icon { display: grid; place-items: center; width: 34px; height: 34px; color: var(--blue); background: var(--blue-soft); border-radius: 9px; font-size: 17px; }
.drawer-close, .modal-header > button { width: 30px; height: 30px; padding: 0; color: #637089; background: transparent; border: 0; border-radius: 50%; cursor: pointer; font-size: 23px; }
.drawer-close:hover, .modal-header > button:hover { background: #f0f3f8; }
.drawer-content { overflow-y: auto; }
.drawer-section { padding: 18px; border-bottom: 1px solid #edf0f5; }
.drawer-section h3 { margin: 0 0 13px; font-size: 12px; }
.drawer-section-heading { display: flex; align-items: center; justify-content: space-between; }
.drawer-section-heading small { color: #99a3b4; font-size: 9px; }
.property-grid { display: grid; gap: 13px; }
.property-grid.two { grid-template-columns: 1fr 1fr; }
.form-field { display: grid; gap: 6px; color: #46546d; font-size: 10px; font-weight: 650; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 38px; padding: 8px 10px; color: var(--ink); background: #fbfcfe; border: 1px solid #d9e0ea; border-radius: 7px; outline: none; font-size: 11px; font-weight: 450; transition: 150ms ease; }
.form-field textarea { min-height: 72px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { background: white; border-color: #7d9fc8; box-shadow: 0 0 0 3px rgba(36, 92, 164, 0.09); }
.form-field small { color: #9aa4b4; font-size: 8px; font-weight: 450; line-height: 1.45; }
.employee-picker { position: relative; display: grid; gap: 8px; }
.employee-search-results { position: absolute; z-index: 8; top: 67px; right: 0; left: 0; max-height: 218px; overflow-y: auto; background: white; border: 1px solid #dce3ed; border-radius: 9px; box-shadow: 0 13px 30px rgba(35, 55, 83, .16); }
.employee-search-option { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 9px; width: 100%; padding: 9px 11px; text-align: left; background: white; border: 0; border-bottom: 1px solid #eef1f5; cursor: pointer; }
.employee-search-option:last-child { border-bottom: 0; }
.employee-search-option:hover { background: #f4f8fd; }
.employee-search-option span:not(.employee-avatar), .employee-picker-selected > span { display: grid; gap: 2px; min-width: 0; }
.employee-search-option strong, .employee-picker-selected strong { overflow: hidden; color: #344158; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.employee-search-option small, .employee-picker-selected small { overflow: hidden; color: #8c98aa; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.employee-avatar { width: 34px; height: 34px; object-fit: cover; border-radius: 50%; }
.employee-avatar.fallback { display: grid; place-items: center; color: #275992; background: #e6eff9; font-size: 11px; font-weight: 700; }
.employee-search-state { padding: 14px; color: #8995a7; text-align: center; font-size: 9px; }
.employee-search-state.error { color: var(--danger); }
.employee-picker-selected { display: grid; grid-template-columns: 34px minmax(0, 1fr) 26px; align-items: center; gap: 9px; padding: 9px 10px; background: #f5f8fc; border: 1px solid #e2e8f0; border-radius: 8px; }
.employee-picker-selected > button { width: 26px; height: 26px; padding: 0; color: #8490a3; background: transparent; border: 0; border-radius: 50%; cursor: pointer; font-size: 17px; }
.employee-picker-selected > button:hover { color: var(--danger); background: #fff; }
.employee-picker-empty { padding: 11px; color: #9aa4b4; text-align: center; background: #fafbfd; border: 1px dashed #dfe5ed; border-radius: 8px; font-size: 9px; }
.employee-picker-list { display: grid; gap: 7px; max-height: 210px; overflow-y: auto; }

.drawer-tabs { display: grid; grid-template-columns: repeat(3, 1fr); height: 47px; border-bottom: 1px solid var(--line); }
.drawer-tabs button { position: relative; color: #56647c; background: white; border: 0; cursor: pointer; font-size: 11px; font-weight: 650; }
.drawer-tabs button.active { color: var(--ink); }
.drawer-tabs button.active::after { content: ""; position: absolute; right: 20px; bottom: -1px; left: 20px; height: 3px; background: var(--orange); border-radius: 3px 3px 0 0; }

.permission-table { overflow: hidden; border: 1px solid #e0e5ed; border-radius: 9px; }
.permission-row { display: grid; grid-template-columns: minmax(110px, 1fr) 54px 54px 54px; align-items: center; min-height: 42px; border-bottom: 1px solid #edf0f4; }
.permission-row:last-child { border-bottom: 0; }
.permission-row.header { min-height: 36px; color: #68758d; background: #f7f9fc; font-size: 9px; font-weight: 700; }
.permission-row > span { display: flex; align-items: center; justify-content: center; min-width: 0; height: 100%; padding: 0 7px; border-left: 1px solid #edf0f4; font-size: 9px; }
.permission-row > span:first-child { justify-content: flex-start; border-left: 0; }
.permission-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switch { position: relative; width: 28px; height: 16px; padding: 0; background: #d6dde8; border: 0; border-radius: 12px; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; background: white; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); transition: 140ms ease; }
.switch.on { background: var(--orange); }
.switch.on::after { transform: translateX(12px); }
.switch:disabled { opacity: 0.45; cursor: default; }

.info-card { display: flex; gap: 9px; padding: 11px; color: #66748b; background: #f5f8fc; border-radius: 8px; font-size: 9px; line-height: 1.55; }
.info-card strong { color: var(--blue); }
.drawer-footer { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 8px; min-height: 62px; padding: 12px 16px; background: #fbfcfe; border-top: 1px solid var(--line); }
.drawer-footer .danger-button[hidden] { display: none; }

.modal { width: min(680px, calc(100vw - 40px)); max-height: calc(100vh - 60px); padding: 0; overflow: hidden; color: var(--ink); background: white; border: 0; border-radius: 14px; box-shadow: 0 26px 70px rgba(25, 44, 72, 0.24); }
.modal::backdrop { background: rgba(31, 43, 62, 0.26); backdrop-filter: blur(2px); }
.modal form { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: calc(100vh - 60px); }
.modal-header { display: flex; align-items: center; justify-content: space-between; min-height: 66px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 4px 0 0; font-size: 17px; }
.modal-body { overflow-y: auto; padding: 20px; }
.modal-footer { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 9px; min-height: 62px; padding: 12px 20px; background: #fafbfd; border-top: 1px solid var(--line); }
.danger-link { color: var(--danger); background: transparent; border: 0; cursor: pointer; font-size: 11px; }

.condition-summary { min-height: 54px; margin: 15px 0; padding: 11px 13px; color: #5d6b82; background: #f7f9fc; border: 1px solid #edf0f5; border-radius: 8px; font-size: 10px; line-height: 1.6; }
.condition-summary.empty { display: grid; place-items: center; color: #a1aaba; border-style: dashed; }
.condition-list { display: grid; gap: 9px; }
.condition-row { display: grid; grid-template-columns: minmax(130px, 1fr) 100px minmax(130px, 1fr) 30px; gap: 7px; align-items: center; }
.condition-row select, .condition-row input { width: 100%; min-height: 36px; padding: 7px 9px; background: white; border: 1px solid #dce2eb; border-radius: 7px; outline: none; font-size: 10px; }
.condition-row button { width: 28px; height: 28px; padding: 0; color: #9b6670; background: #fff5f6; border: 0; border-radius: 50%; cursor: pointer; }
.dashed-button { width: 100%; min-height: 40px; margin-top: 10px; color: var(--blue); background: white; border: 1px dashed #b7c4d7; border-radius: 8px; cursor: pointer; font-size: 10px; font-weight: 650; }
.dashed-button:hover { background: var(--blue-soft); }
.logic-setting { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding-top: 15px; border-top: 1px solid #edf0f4; color: #6d798d; font-size: 10px; }
.logic-setting > span { margin-right: auto; font-weight: 700; }
.logic-setting label { display: flex; align-items: center; gap: 5px; }
.logic-setting input { accent-color: var(--orange); }

.publish-note { display: grid; gap: 4px; margin-bottom: 16px; padding: 12px; color: #607089; background: var(--blue-soft); border-radius: 9px; font-size: 10px; }
.publish-note strong { color: var(--blue); font-size: 11px; }
.deploy-modal .form-field { margin-top: 12px; }
.publish-preview { display: flex; justify-content: space-between; margin-top: 15px; padding: 11px 12px; color: #77849a; background: #f7f9fc; border-radius: 8px; font-size: 10px; }
.publish-preview strong { color: var(--ink); }

.canvas-tip { position: absolute; z-index: 8; bottom: 18px; left: 18px; display: flex; align-items: center; gap: 7px; padding: 8px 10px; color: #78849a; background: rgba(255, 255, 255, 0.9); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 4px 13px rgba(31, 52, 82, 0.07); backdrop-filter: blur(8px); font-size: 9px; }
.canvas-tip span { padding: 2px 5px; color: var(--blue); background: var(--blue-soft); border-radius: 4px; font-weight: 750; }
.zoom-controls { position: absolute; z-index: 8; right: 18px; bottom: 18px; display: flex; align-items: center; overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 5px 14px rgba(31, 52, 82, 0.08); }
.zoom-controls button, .zoom-controls span { display: grid; place-items: center; height: 32px; border-right: 1px solid var(--line); }
.zoom-controls button { width: 34px; padding: 0; background: white; border-top: 0; border-bottom: 0; border-left: 0; cursor: pointer; font-size: 17px; }
.zoom-controls span { width: 49px; color: #6f7b8f; font-size: 9px; }
.zoom-controls button:last-child { border-right: 0; }
.zoom-controls button:hover { color: var(--blue); background: var(--blue-soft); }

.toast-region { position: fixed; z-index: 120; top: 82px; left: 50%; display: grid; gap: 8px; transform: translateX(-50%); pointer-events: none; }
.toast { min-width: 220px; max-width: 520px; padding: 10px 14px; color: white; background: #26364e; border-radius: 8px; box-shadow: var(--shadow); font-size: 11px; text-align: center; animation: toast-in 180ms ease; }
.toast.success { background: #247d64; }
.toast.error { background: #b64848; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }

[hidden] { display: none !important; }

@media (max-width: 1180px) {
    .designer-header { grid-template-columns: 210px minmax(360px, 1fr) auto; }
    .design-steps { gap: 20px; }
    .save-state { display: none; }
    .property-drawer { width: 400px; }
}

@media (max-width: 920px) {
    .designer-header { grid-template-columns: 190px 1fr; }
    .design-steps { justify-content: flex-start; overflow-x: auto; }
    .header-actions { position: fixed; right: 12px; bottom: 12px; z-index: 40; padding: 7px; background: white; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
    .header-actions .secondary-button { display: none; }
    .property-drawer { top: 8px; right: 8px; bottom: 8px; width: min(420px, calc(100vw - var(--sidebar-width) - 18px)); }
    .flow-scroll, .designer-main:has(.property-drawer.open) .flow-scroll { padding-right: 30px; padding-left: 30px; }
}
