:root {
    --font-family-app: 'Avenir Next', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --font-size-xs: 10px;
    --font-size-sm: 12px;
    --font-size-md: 13px;
    --font-size-lg: 16px;
    --font-size-title: 17px;
    --space-1: 2px;
    --space-2: 4px;
    --space-3: 8px;
    --space-4: 10px;
    --space-5: 12px;
    --space-6: 16px;
    --accent: #4a7fd4;
    --accent-focus: #4a90e2;
    --accent-strong: #2459a6;
    --action-danger: #e74c3c;
    --action-danger-hover: #c0392b;
    --action-success-active: #2d4b11;
    --action-success-border: #355814;
    --action-success-hover: #355814;
    --action-success: #40661a;
    --bg-active: #e8e8f0;
    --bg-canvas: #f0f0f0;
    --bg-deep: #eee;
    --bg-error-muted: #fef2f2;
    --bg-hover-alt: #eef;
    --bg-hover-muted: #f5f5fa;
    --bg-hover: #f0f0f8;
    --bg-primary: #f5f5f5;
    --bg-success-muted: #f0fdf4;
    --bg-surface-alt: #fafafa;
    --bg-surface-cool: #f8f8fc;
    --bg-surface-dim: #f2f2f2;
    --bg-surface-info: #f0f4ff;
    --bg-surface: white;
    --bg-warning-muted: #fffbeb;
    --border-active: #6b7280;
    --border-hover: #b6becb;
    --border-input: #e0e0e0;
    --border-soft: #d8dde6;
    --border: #d8dde3;
    --control-bg-hover: #f3f6fb;
    --control-gap: var(--space-3);
    --control-height: 40px;
    --control-height-sm: 32px;
    --control-padding-x: var(--space-4);
    --control-padding-y: var(--space-3);
    --control-shadow-hover: 0 4px 12px rgba(15, 23, 42, 0.10);
    --control-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
    --radius-lg: 8px;
    --radius-md: 6px;
    --radius-pill: 999px;
    --radius-sm: 4px;
    --radius-xl: 12px;
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.2);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.15);
    --text-dim: #515760;
    --text-disabled: #7b818a;
    --text-hover: #2f3640;
    --text-icon: #616875;
    --text-label: #414853;
    --text-light: #7b818a;
    --text-meta: #616875;
    --text-mid: #4f5660;
    --text-muted-alt: #616875;
    --text-muted: #59616d;
    --text-placeholder: #6b7280;
    --text-primary: #333;
    --text-secondary: #444;
    --text-soft: #4a515b;
    --text-subtle: #6b7280;
    --text-very-dim: #6a717d;
    --text-white-kw: #333;
    --text-white: #333;
    --transition-default: 150ms;
    --transition-fast: 120ms;
    --warning: #d4a020;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#privacySecurityModal .modal-content.large{display:flex;flex-direction:column;width:min(800px,calc(100vw - 32px));max-height:calc(100vh - 40px);margin:20px auto;padding:0;overflow:hidden;border-radius:22px}#privacySecurityModal .modal-description,.privacy-security-hero{background:var(--accent-focus);color:var(--bg-surface)}#privacySecurityModal h2{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}#privacySecurityModal .modal-description{margin:0;padding:16px 24px 0}#privacySecurityInterface{min-height:0;overflow:auto}.privacy-security-shell{display:grid;gap:14px}.privacy-security-hero{padding:22px 28px}.privacy-security-kicker,.privacy-security-proof span{display:inline-flex;padding:5px 10px;border-radius:var(--radius-pill);background:rgba(255,255,255,.14);font-weight:800}.privacy-security-hero h3{margin:14px 0 10px;font-size:27px;line-height:1.1}.privacy-security-hero p{margin:0;line-height:1.55}.privacy-security-proof{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}.privacy-security-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;padding:0 24px}.privacy-security-principle{padding:14px;border:1px solid var(--border-soft);border-radius:16px}.privacy-security-principle h3{margin:0 0 8px}.privacy-security-principle p{margin:0;color:var(--text-dim);line-height:1.45}.privacy-security-footer-note{margin:0 24px;padding:14px;border:1px solid var(--border-soft);border-radius:16px}#privacySecurityModal .privacy-security-cta{flex:0 0 auto;margin:14px 24px 20px;border-radius:var(--radius-pill);font-weight:800}@media (max-width:760px){.privacy-security-grid{grid-template-columns:1fr}}
html,body{overflow-x:hidden}
body {
    font-family: var(--font-family-app);
    background: var(--bg-primary);
    color: var(--text-white-kw);
}
button,
input,
select,
textarea {
    font: inherit;
}
.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}
header {
    display: flex;
    align-items: center;
    min-height: 64px;
    padding: 10px 16px;
    gap: 12px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}
.header-left {
    display: grid;
    gap: 2px;
    flex-shrink: 0;
    min-width: 152px;
}
header h1 {
    font-size: var(--font-size-md);
    font-weight: 650;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}
.app-build-version {
    width: max-content;
    max-width: 180px;
    padding: 2px 6px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-pill);
    background: var(--bg-surface-alt);
    color: var(--text-dim);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.2;
    white-space: nowrap;
}
.header-center {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}
.flow-name {
    display: inline-flex;
    align-items: center;
    flex: 0 1 min(360px, 42vw);
    min-height: 40px;
    max-width: 100%;
    padding: 0 12px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-pill);
    background: var(--bg-surface-alt);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.header-title-actions {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 8px;
}
.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.zoom-controls {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: 4px;
    min-height: 40px;
    padding: 2px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    box-shadow: none;
}
.undo-redo-controls {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: 4px;
    min-height: 40px;
}
.header-quiet-controls .flow-btn {
    color: var(--text-dim);
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}
.header-overflow {
    position: relative;
    flex-shrink: 0;
}
.header-overflow-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(300px, calc(100vw - 32px));
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
    display: grid;
    gap: 2px;
    z-index: 220;
}
.header-overflow-menu[hidden] {
    display: none;
}
.header-overflow-section {
    display: grid;
    gap: 1px;
    padding-top: 5px;
    margin-top: 4px;
    border-top: 1px solid var(--border);
}
.header-overflow-section:first-child {
    padding-top: 0;
    margin-top: 0;
    border-top: 0;
}
.header-overflow-section-label {
    padding: 3px 8px 2px;
    color: var(--text-dim);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
    text-transform: uppercase;
}
.flow-btn.flow-btn-menu {
    width: 100%;
    justify-content: flex-start;
    min-height: 32px;
    padding: 0 8px;
    border-color: transparent;
    border-radius: var(--radius-md);
    background: transparent;
    box-shadow: none;
    color: var(--text-main);
    font-size: 12px;
}
.flow-btn.flow-btn-menu svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.flow-btn.flow-btn-menu:hover {
    background: var(--control-bg-hover);
    border-color: transparent;
    box-shadow: none;
    color: var(--text-hover);
}
.flow-btn.flow-btn-menu:active {
    background: var(--bg-canvas);
    box-shadow: none;
}
.flow-btn-menu span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.flow-btn-menu.hidden {
    display: none;
}
.workspace {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.bottom-data-viewer{height:260px;min-height:120px;max-height:70vh;background:var(--bg-surface);border-top:1px solid var(--border);flex:0 0 auto;position:relative;display:flex;flex-direction:column;overflow:hidden}
.is-empty{height:48px !important;min-height:48px}
.bottom-data-viewer-resize-handle{position:absolute;top:-5px;left:0;right:0;height:10px;cursor:ns-resize;z-index:5;touch-action:none}
.bottom-data-viewer-resize-handle::before{content:"";position:absolute;top:4px;left:0;right:0;border-top:2px solid transparent}
.bottom-data-viewer-resize-handle:hover::before,
.bottom-data-viewer-resize-handle:focus-visible::before,
.bottom-data-viewer-resize-handle.is-resizing::before {
    border-top-color: var(--accent);
}
body.resizing-bottom-data-viewer {
    cursor: ns-resize;
    user-select: none;
}
.bottom-data-viewer-header{min-height:44px;display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding:8px 14px;border-bottom:1px solid var(--border-input)}
.bottom-data-viewer-title{font-size:13px;font-weight:650;color:var(--text-hover);min-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bottom-data-viewer-meta{color:var(--text-muted);font-size:12px;white-space:nowrap;font-variant-numeric:tabular-nums}
.bottom-data-viewer-tabs{display:inline-flex;flex-wrap:wrap;justify-content:flex-end;gap:4px;margin-left:auto}
.bottom-data-tab{border:1px solid var(--border);background:var(--bg-surface-alt);color:var(--text-muted);border-radius:var(--radius-sm);min-height:28px;padding:4px 12px;font:inherit;font-size:12px;font-weight:600;cursor:pointer}
.bottom-data-tab:hover,
.bottom-data-tab:focus-visible {
    background: var(--control-bg-hover);
    color: var(--text-hover);
}
.bottom-data-tab.active {
    background: var(--text-hover);
    border-color: var(--text-hover);
    color: var(--bg-surface);
}
.bottom-data-tab-secondary{margin-left:4px}
.is-empty :is(.bottom-data-viewer-tabs, .bottom-data-tab-secondary, .bottom-data-viewer-meta, .bottom-data-viewer-body, .bottom-data-viewer-resize-handle) {
    display: none;
}
.bottom-data-viewer-body{flex:1;min-height:0;overflow:auto}
.bottom-data-empty-state{min-height:112px;margin:10px 14px;padding:18px 20px;display:flex;flex-direction:column;justify-content:center;gap:6px;background:var(--bg-surface-alt);border-left:3px solid var(--accent);max-width:560px;}
.bottom-data-empty-title,.bottom-data-empty{font-size:13px}
.bottom-data-empty-title{color:var(--text-hover);font-weight:650}
.bottom-data-empty{margin:0;padding:0;color:var(--text-disabled)}
.bottom-data-table {
    min-width: 100%;
    width: max-content;
    border-collapse: collapse;
    font-size: 12px;
}
.bottom-data-table th {
    background: var(--bg-surface-alt);
    color: var(--text-hover);
    padding: 8px 12px;
    text-align: left;
    font-weight: 650;
    border-bottom: 1px solid var(--border-input);
    position: sticky;
    top: 0;
    z-index: 1;
    white-space: nowrap;
    min-width: 150px;
    border-right: 1px solid #e6e9ef;
}
.bottom-data-table td {
    padding: 7px 12px;
    border-bottom: 1px solid #edf0f4;
    border-right: 1px solid #f0f2f6;
    color: var(--text-soft);
    white-space: nowrap;
    min-width: 150px;
}
.bottom-data-table tbody tr:nth-child(even) td,
.bottom-data-table tbody tr:nth-child(even) .bottom-data-row-index {
    background: #fbfcfe;
}
.bottom-data-table tbody tr:hover td,
.bottom-data-table tbody tr:hover .bottom-data-row-index {
    background: var(--control-bg-hover);
}
.bottom-data-row-index {
    left: 0;
    min-width: 48px !important;
    width: 48px;
    max-width: 48px;
    text-align: right !important;
    color: var(--text-muted) !important;
    font-variant-numeric: tabular-nums;
    border-right: 1px solid var(--border-soft) !important;
    box-shadow: 1px 0 0 rgba(216, 221, 230, 0.55);
}
thead .bottom-data-row-index {
    z-index: 3;
}
tbody .bottom-data-row-index {
    position: sticky;
    z-index: 2;
    padding: 7px 10px;
    background: var(--bg-surface);
    border-bottom: 1px solid #edf0f4;
    font-weight: 550;
}
.toolbox{width:210px;flex:0 0 210px;min-width:0;max-width:210px;background:var(--bg-surface);border-right:1px solid var(--border);overflow:clip auto;scrollbar-gutter:stable;padding:10px}
.toolbox-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 6px 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    min-height: 36px;
    touch-action: manipulation;
}
.toolbox-toggle:active {
    background: var(--bg-hover);
}
.toolbox-toggle svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}
.toolbox-collapsed + .toolbox-toggle svg,
.toolbox-toggle.collapsed svg {
    transform: rotate(180deg);
}
.toolbox-search {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 12px;
    box-sizing: border-box;
    outline: none;
    color: var(--text-hover);
    background: var(--bg-surface);
}
.toolbox-search:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74, 127, 212, 0.14);
}
.select-search-row {
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr) auto;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
}
.select-bulk-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
}
.select-bulk-help {
    color: var(--text-muted);
    font-size: 12px;
}
.select-search-label,
.select-search-status {
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
}
.select-search-input {
    width: 100%;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid var(--border-input);
    border-radius: 8px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 13px;
}
.select-search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74, 127, 212, 0.14);
    outline: none;
}
.select-col-row-hidden {
    display: none;
}
.filter-field-search-row {
    display: grid;
    grid-template-columns: auto minmax(160px, 1fr) auto;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
}
.filter-field-search-label,
.filter-field-search-status,
.filter-field-empty {
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
}
.filter-field-search-input {
    width: 100%;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid var(--border-input);
    border-radius: 8px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 13px;
}
.filter-field-search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74, 127, 212, 0.14);
    outline: none;
}
.filter-field-search-results {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 82px;
    overflow: auto;
    margin: 0 0 10px;
    padding: 6px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: var(--bg-surface-alt);
}
.filter-field-result {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid var(--border-input);
    border-radius: 999px;
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 12px;
    line-height: 1.2;
    padding: 4px 8px;
}
.filter-field-result:hover,
.filter-field-result:focus-visible {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(74, 127, 212, 0.12);
    outline: none;
}
@media (max-width: 640px) {
    .select-search-row,
    .filter-field-search-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}
.tool-group {
    margin-bottom: 4px;
}
.tool-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 10px;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-soft);
    border-left: 3px solid #c3cad5;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: background var(--transition-default);
    user-select: none;
}
.tool-group-header:hover {
    background: var(--bg-canvas);
}
.tool-group-header:focus-visible {
    outline: 2px solid #2e6ec4;
    outline-offset: 2px;
}
.group-icon {
    font-size: 8px;
    color: var(--text-subtle);
    width: 10px;
    text-align: center;
}
.group-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.tool-group-items {
    margin-top: 4px;
    margin-bottom: 4px;
}

.tool-group-minimal {
    margin-top: 8px;
}
.tool-group-items-minimal {
    margin-top: 0;
}
.tool-group-items.collapsed {
    display: none;
}
.tool-item{display:flex;align-items:center;gap:8px;min-width:0;max-width:100%;min-height:40px;padding:8px 10px;margin-bottom:2px;background:var(--bg-surface);border:1px solid var(--border-soft);border-radius:var(--radius-lg);cursor:grab;transition:background var(--transition-default),border-color var(--transition-default),box-shadow var(--transition-default)}
.block-help-tooltip {
    display: none;
}
[data-tooltip]{position:relative}
[data-tooltip]:not([data-tooltip=""]):hover::after,
[data-tooltip]:not([data-tooltip=""]):focus-visible::after,
.form-group[data-tooltip]:not([data-tooltip=""]):focus-within::after{content:attr(data-tooltip);position:absolute;z-index:80;left:0;top:calc(100% + 6px);max-width:260px;width:max-content;padding:7px 9px;border:1px solid var(--border-hover);border-radius:6px;background:var(--text-hover);color:var(--bg-surface);box-shadow:0 6px 18px rgba(0,0,0,0.18);font-size:12px;font-weight:500;line-height:1.35;white-space:normal;overflow-wrap:anywhere;box-sizing:border-box;pointer-events:none}
.tool-item[data-tooltip]:not([data-tooltip=""]):hover::after,
.tool-item[data-tooltip]:not([data-tooltip=""]):focus-visible::after { left: 8px; right: 8px; top: 100%; transform: none; max-width: none; width: auto; }
.form-group[data-tooltip] {
    position: relative;
}
.form-group[data-tooltip]:not([data-tooltip=""]):hover::after,
.form-group[data-tooltip]:not([data-tooltip=""]):focus-within::after {
    left: 0;
    top: calc(100% - 2px);
}
.tool-item:hover {
    background: var(--control-bg-hover);
    border-color: var(--border-hover);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.tool-item:focus-visible {
    outline: 2px solid #2e6ec4;
    outline-offset: 1px;
}
.tool-item:active {
    cursor: grabbing;
}
.tool-item .icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--text-hover);
}
.tool-item .icon svg {
    width: 16px;
    height: 16px;
    display: block;
}
.tool-item-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.canvas {
    flex: 1;
    position: relative;
    overflow: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 30px;
    cursor: default;
    user-select: none;
    contain: layout style;
    --canvas-width: 100%;
    --canvas-height: 100%;
}
.canvas::-webkit-scrollbar {
    width: 0;
    height: 0;
}
.canvas::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: var(--canvas-width, 100%);
    height: var(--canvas-height, 100%);
    pointer-events: none;
    z-index: -1;
}
#canvas-inner {
    transform-origin: 0 0;
    position: relative;
    min-width: 100%;
    min-height: 100%;
}
.canvas.panning {
    cursor: grabbing;
}
#connections-svg {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}
.hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-muted);
    font-size: var(--font-size-md);
    text-align:left;
}
.hint-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}
.block {
    position: absolute;
    width: 92px;
    cursor: move;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    contain: layout style;
    touch-action: none;
    user-select: none;
    will-change: left, top;
}
.block.is-dragging {
    cursor: grabbing;
    z-index: 9;
    user-select: none;
    touch-action: none;
}
.block.is-dragging .block-icon-area {
    transform: scale(1.04);
    box-shadow:var(--shadow-md);
}
.block:hover .block-icon-area {
    box-shadow: 0 3px 12px rgba(0,0,0,0.2);
    transform: scale(1.05);
}
.block.selected .block-icon-area {
    box-shadow: 0 0 0 3px rgba(74,144,226,0.5), 0 2px 8px rgba(0,0,0,0.15);
}
.block:focus-visible .block-icon-area,
.block:focus-within .block-icon-area {
    box-shadow: 0 0 0 3px rgba(46,110,196,0.55), 0 2px 10px rgba(0,0,0,0.2);
}
.block.needs-input .block-icon-area {
    outline: 2px dashed #e0a030;
    outline-offset: 2px;
}
.block.disabled {
    opacity: 0.4;
}
.block.disabled .block-label {
    text-decoration: line-through;
}
.block-icon-area {
    position: relative;
    width: 68px;
    height: 68px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--block-color, #999);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: box-shadow var(--transition-default), transform var(--transition-default);
    overflow:visible;
}
.block-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-surface);
}
.block-icon svg {
    width: 30px;
    height: 30px;
    display: block;
    stroke: var(--bg-surface);
}
.block-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-hover);
    margin-top: 6px;
    text-align: center;
    white-space: nowrap;
    max-width: 128px;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}
.block-action-btn {
    appearance: none;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    min-width: 30px;
    min-height: 30px;
    padding: 7px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font: inherit;
    line-height: 1;
    touch-action: manipulation;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.block-action-btn svg {
    width: 14px;
    height: 14px;
    display: block;
}
.block-action-btn:hover,
.block-action-btn:focus-visible {
    background: var(--bg-canvas);
    color: var(--text-white-kw);
}
.block-action-btn:focus-visible {
    outline: 2px solid #2e6ec4;
    outline-offset: 1px;
}
.block-action-btn:disabled {
    cursor: not-allowed;
    color: var(--text-disabled);
    opacity: 0.48;
}
.block-action-btn:disabled:hover {
    background: transparent;
    color: var(--text-disabled);
}
.block-metadata:hover {
    background: #f3e5f5;
    color: #7b1fa2;
}
.block-disable {
    font-size: 10px;
}
.block-disable:not(:disabled):hover {
    background: #fff3e0;
    color: #e65100;
}
.block-delete {
    font-size: 13px;
}
.block-delete:not(:disabled):hover {
    background: #fee;
    color: #e44;
}
.block-content,
.block-status {
    display: none;
}
.block-source-label {
    max-width: 116px;
    margin-top: 2px;
    padding: 1px 6px;
    border: 1px solid rgba(34, 87, 122, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 600;
    line-height: 13px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.10);
}
.block-source-label:empty,
.block-source-label[hidden] {
    display: none;
}
.block[data-block-type="input"] .block-label {
    max-width: 136px;
}
.block-badge {
    font-size: 9px;
    color: var(--text-muted-alt);
    margin-top: 1px;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
}
.block-badge:empty {
    display: none;
}
.block-row-badge {
    max-width: 136px;
    min-height: 18px;
    margin-top: 4px;
    padding: 2px 7px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    line-height: 14px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.block-row-badge[data-state="pending"] {
    color: var(--text-very-dim);
    background: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}
.block-validation-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    border: 2px solid var(--bg-surface);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 12px;
    text-align: center;
    pointer-events: none;
    z-index: 4;
    box-shadow: 0 1px 4px rgba(0,0,0,0.22);
}
.block-validation-badge[data-state="blocked"] {
    background: #c62828;
}
.block-validation-badge[data-state="warning"] {
    background: #f57c00;
}
.block-connector {
    position: absolute;
    width: 18px;
    height: 18px;
    background: var(--bg-surface);
    border: 3px solid var(--accent-focus);
    border-radius: 50%;
    cursor: crosshair;
    transition: background var(--transition-default) ease, border-color var(--transition-default) ease, transform var(--transition-default) ease, box-shadow var(--transition-default) ease;
    z-index: 10;
}
.block-connector::before {
    content: '';
    position: absolute;
    inset: -14px;
}
.block-connector:focus-visible {
    outline: 2px solid var(--accent-strong);
    outline-offset: 3px;
}
.block-connector:hover {
    background: #e3f2fd;
    transform: scale(1.2);
    box-shadow: 0 0 6px rgba(74, 144, 226, 0.35);
}
.block-connector.active {
    background: var(--accent-focus);
    border-color: #2171d4;
    transform: scale(1.25);
    box-shadow: 0 0 8px rgba(74, 144, 226, 0.55);
    animation: pulse 1s infinite;
}
.block-connector.target {
    background: #66bb6a;
    border-color: #43a047;
    transform: scale(1.25);
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.55);
}
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(74, 144, 226, 0.6);
    }
    50% {
        box-shadow: 0 0 18px rgba(74, 144, 226, 0.9);
    }
}
.connector-out {
    right: -9px;
    top: 50%;
    transform: translateY(-50%);
}
.connector-out::before {
    inset: -14px -18px -14px -8px;
}
.connector-out:hover,
.connector-out.active {
    transform: translateY(-50%) scale(1.2);
}
.connector-anchor {
    width: 20px;
    height: 20px;
    right: -10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.connector-input-anchor {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.anchor-label {
    font-size: 9px;
    font-weight: 800;
    color: var(--bg-surface);
    pointer-events: none;
    line-height: 1;
}
.connector-in {
    left: -9px;
    top: 50%;
    transform: translateY(-50%);
}
.connector-in::before {
    inset: -14px -8px -14px -18px;
}
.connector-in.connector-input-anchor {
    left: -10px;
}
.connector-in:hover,
.connector-in.target {
    transform: translateY(-50%) scale(1.2);
}
.connection-line {
    position: absolute;
    stroke: #2b9cff;
    stroke-width: 2;
    fill: none;
    pointer-events: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-opacity: 0.4;
    transition: stroke-opacity var(--transition-fast) ease, stroke-width var(--transition-fast) ease;
}
.connection-line.active {
    stroke-opacity: 1;
    stroke-width: 3;
}
.connection-line.selected {
    stroke: #e0a030;
    stroke-opacity: 1;
    stroke-width: 3;
    stroke-dasharray: 6 3;
}
.connection-hit-area {
    stroke: transparent;
    stroke-width: 14;
    fill: none;
    pointer-events: stroke;
    cursor: pointer;
}
.temp-connection-line {
    position: absolute;
    stroke: var(--accent-focus);
    stroke-width: 2;
    fill: none;
    pointer-events: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.5;
    stroke-dasharray: 5, 5;
}
.flow-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-surface);
    box-shadow: var(--control-shadow);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-hover);
    transition: background var(--transition-default), border-color var(--transition-default), box-shadow var(--transition-default), color var(--transition-default), opacity var(--transition-default);
    font-family: inherit;
    touch-action: manipulation;
}
.flow-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.flow-btn svg[fill="currentColor"] {
    fill: currentColor;
    stroke: none;
}
.flow-btn:hover {
    background: var(--control-bg-hover);
    border-color: var(--border-hover);
    box-shadow: var(--control-shadow-hover);
    color: var(--text-white-kw);
}
.flow-btn:active {
    background: var(--bg-canvas);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.flow-btn:focus-visible {
    outline: 2px solid #2e6ec4;
    outline-offset: 2px;
}
.flow-btn:disabled {
    cursor: not-allowed;
    color: var(--text-disabled);
    background: var(--bg-surface-alt);
    border-color: var(--border-soft);
    box-shadow: none;
    opacity: 0.72;
}
.flow-btn:disabled:hover {
    color: var(--text-disabled);
    background: var(--bg-surface-alt);
    border-color: var(--border-soft);
    box-shadow: none;
}
.icon-flow-btn {
    width: 40px;
    padding: 0;
}
.run-btn {
    background: var(--action-success);
    color: var(--bg-surface);
    border-color: var(--action-success-border);
    font-weight: 600;
}
.run-btn:hover {
    background: var(--action-success-hover);
    color: var(--bg-surface);
    border-color: var(--action-success-hover);
}
.run-btn:active {
    background: var(--action-success-active);
}
.run-btn svg { width: 12px; height: 12px; }
.run-btn.running { animation: pulse-run 0.6s ease-in-out; }
@keyframes pulse-run {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); box-shadow: 0 0 12px rgba(104,162,37,0.5); }
    100% { transform: scale(1); }
}
.preview-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 12px;
    border-bottom: 2px solid #eee;
}
.preview-tab {
    padding: 6px 16px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted-alt);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color var(--transition-default), border-color var(--transition-default), background var(--transition-default);
    font-family: inherit;
}
.preview-tab:hover {
    color: var(--text-hover);
}
.preview-tab.active {
    color: #2e6ec4;
    border-bottom-color: #2e6ec4;
}
.profile-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.profile-table th {
    background: var(--bg-primary);
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: var(--text-hover);
    border-bottom: 2px solid var(--border-input);
    white-space: nowrap;
}
.profile-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}
.profile-table tr:hover td {
    background: var(--bg-surface-alt);
}
.profile-col-name {
    font-weight: 600;
    color: var(--text-white-kw);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.profile-type {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}
.profile-type-string { background: #e3f2fd; color: #1565c0; }
.profile-type-number { background: #e8f5e9; color: #2e7d32; }
.profile-type-date { background: #fff3e0; color: #e65100; }
.profile-type-boolean { background: #f3e5f5; color: #7b1fa2; }
.profile-top-values {
    color: var(--text-muted);
    font-size: 11px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.profile-summary {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted-alt);
}
.hint-link,
.template-gallery-close,
.config-panel-close,
.close {
    appearance: none;
    border: none;
    background: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: inherit;
    line-height: 1;
    touch-action: manipulation;
}
.hint-link {
    color: #2e6ec4;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-size: 13px;
    padding: 0;
}
.hint-link:hover {
    color: #1a4f8a;
}
.hint-link:focus-visible {
    outline: 2px solid #2e6ec4;
    outline-offset: 2px;
    border-radius: 3px;
}
.template-gallery-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.template-gallery {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 820px;
    max-width: 90vw;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.template-gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}
.template-gallery-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-white-kw);
}
.template-gallery-close {
    cursor: pointer;
    font-size: 22px;
    color: var(--text-subtle);
    min-width: 32px;
    min-height: 32px;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-default), color var(--transition-default);
}
.template-gallery-close:hover {
    background: var(--bg-canvas);
    color: var(--text-white-kw);
}
.template-gallery-close:focus-visible {
    outline: 2px solid #2e6ec4;
    outline-offset: 2px;
}
.template-gallery-grid {
    padding: 16px 20px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}
.template-gallery-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px 0;
}
.template-gallery-search {
    flex: 1;
    min-width: 180px;
    border: 1px solid #d8d8d8;
    border-radius: var(--radius-lg);
    padding: 9px 12px;
    font-size: 13px;
}
.template-gallery-search:focus {
    outline: none;
    border-color: #2e6ec4;
    box-shadow: 0 0 0 2px rgba(46, 110, 196, 0.15);
}
.template-gallery-count {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
}
.template-card {
    border: 1px solid #e5e5e5;
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color var(--transition-default), background var(--transition-default), box-shadow var(--transition-default);
}
.template-card:hover {
    border-color: #2e6ec4;
    background: #f8fbff;
    box-shadow: 0 2px 8px rgba(46,110,196,0.12);
}
.template-card:focus-visible {
    outline: 2px solid #2e6ec4;
    outline-offset: 2px;
}
.template-card-preview {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.template-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border: 1px solid #e5e5e5;
}
.template-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-white-kw);
    margin-bottom: 2px;
}
.template-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}
.template-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}
.template-card-category {
    font-size: 11px;
    font-weight: 600;
    color: #2e6ec4;
    background: #edf4ff;
    border-radius: var(--radius-pill);
    padding: 3px 8px;
}
.template-card-count {
    font-size: 11px;
    color: var(--text-dim);
}
.template-gallery-empty {
    grid-column: 1 / -1;
    border: 1px dashed #d7d7d7;
    border-radius: var(--radius-lg);
    padding: 16px;
    color: var(--text-dim);
    font-size: 13px;
    text-align: center;
}
.tool-container {
    position: absolute;
    border: 2px dashed rgba(100, 100, 200, 0.4);
    border-radius: var(--radius-lg);
    background: rgba(100, 100, 200, 0.04);
    z-index: 0;
    pointer-events: none;
}
.tool-container-title {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px 6px 0 0;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    pointer-events: auto;
    cursor: move;
    user-select: none;
}
.tool-container-toggle {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 10px;
    opacity: 0.8;
}
.tool-container-label {
    flex: 1;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    outline: none;
    cursor: text;
    min-width: 40px;
}
.tool-container-label:focus {
    cursor: text;
    border-bottom: 1px solid rgba(255,255,255,0.5);
}
.tool-container-delete {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    opacity: 0;
    font-size: 14px;
    transition: opacity var(--transition-default);
}
.tool-container-title:hover .tool-container-delete {
    opacity: 0.7;
}
.tool-container-delete:hover {
    opacity: 1 !important;
}
.tool-container.collapsed {
    height: auto !important;
    min-height: 0;
    border-style: solid;
    background: none;
}
.annotation {
    position: absolute;
    background: #fff9c4;
    border: 1px solid #e6d54d;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    min-width: 120px;
    min-height: 60px;
    z-index: 5;
    font-size: 12px;
    display: flex;
    flex-direction: column;
}
.annotation.dragging {
    opacity: 0.8;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.annotation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 6px;
    border-bottom: 1px solid #e6d54d;
    background: #fff3a0;
    border-radius: 3px 3px 0 0;
    flex-shrink: 0;
}
.annotation-drag-handle {
    cursor: grab;
    color: var(--text-subtle);
    font-size: 11px;
    user-select: none;
}
.annotation-drag-handle:active {
    cursor: grabbing;
}
.annotation-delete {
    cursor: pointer;
    color: var(--text-very-dim);
    font-size: 14px;
    line-height: 1;
    padding: 0 2px;
    border-radius: 3px;
    transition: color var(--transition-default), background var(--transition-default), opacity var(--transition-default);
}
.annotation-delete:hover {
    color: #c00;
    background: rgba(200,0,0,0.1);
}
.annotation-body {
    padding: 6px 8px;
    outline: none;
    color: var(--text-hover);
    line-height: 1.4;
    min-height: 36px;
    word-break: break-word;
    white-space: pre-wrap;
    resize: vertical;
    overflow: auto;
}
.annotation-body:empty::before {
    content: 'Type a note...';
    color: var(--text-very-dim);
    font-style: italic;
}
.annotation-body:focus {
    background: #fffde7;
}
.recent-flows-dropdown {
    position: fixed;
    z-index: 1000;
    background: var(--bg-surface);
    border: 1px solid #ddd;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    min-width: 280px;
    max-width: 360px;
    max-height: 400px;
    overflow-y: auto;
    padding: 4px 0;
}
.recent-flow-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
    border-bottom: 1px solid #f0f0f0;
}
.recent-flow-item:last-child {
    border-bottom: none;
}
.recent-flow-info {
    appearance: none;
    border: 0;
    background: transparent;
    text-align: left;
    flex: 1;
    min-width: 0;
    cursor: pointer;
    padding: 2px 0;
}
.recent-flow-info:focus-visible,
.recent-flow-remove:focus-visible {
    outline: 2px solid var(--accent-focus);
    outline-offset: 2px;
}
.recent-flow-info:hover .recent-flow-name {
    color: #2e6ec4;
}
.recent-flow-name {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-white-kw);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--transition-default);
}
.recent-flow-meta {
    display: block;
    font-size: 11px;
    color: var(--text-muted-alt);
    margin-top: 2px;
}
.recent-flow-remove {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--text-very-dim);
    font-size: 16px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-default), color var(--transition-default);
}
.recent-flow-remove:hover {
    background: #fee;
    color: #c00;
}
.zoom-btn {
    min-width: 40px;
    padding: 0 10px;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}
.zoom-indicator {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    min-width: 36px;
    text-align: center;
}
.config-panel {
    --config-panel-width: 400px;
    width: 0;
    flex-shrink: 0;
    position: relative;
    background: var(--bg-surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    transition: opacity 0.2s ease;
}
.config-panel.open {
    width: clamp(320px, var(--config-panel-width), min(720px, calc(100vw - 420px)));
}
.config-panel.open.wide {
    --config-panel-width: 540px;
}
.config-panel-resize-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -7px;
    z-index: 20;
    width: 14px;
    min-width: 14px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: ew-resize;
    touch-action: none;
}
.config-panel-resize-handle::before {
    content: "";
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 6px;
    border-left: 2px solid transparent;
}
.config-panel-resize-handle:hover::before,
.config-panel-resize-handle:focus-visible::before,
.config-panel-resize-handle.is-resizing::before {
    border-left-color: var(--accent);
}
.config-panel-resize-handle:focus-visible {
    outline: 2px solid #2e6ec4;
    outline-offset: -1px;
}
body.resizing-config-panel {
    cursor: ew-resize;
    user-select: none;
}
.config-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    min-width: min(100%, 320px);
}
.config-panel.wide .config-panel-header {
    min-width: min(100%, 320px);
}
.config-panel-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--text-hover);
}
.config-panel-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}
.config-panel-title {
    flex: 1;
    margin: 0;
    color: var(--text-white-kw);
}
.panel-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 8px; border-bottom: 1px solid var(--border); min-width: min(100%, 320px); }
.panel-actions .block-action-btn { min-height: 34px; padding: 5px 7px; font-size: 12px; font-weight: 600; color: var(--text-hover); background: var(--bg-surface); border: 2px solid var(--border-hover); }
.panel-actions .block-help { color: #1976d2; border-color: #1976d2; }
.panel-actions .block-delete { color: #d32f2f; border-color: #d32f2f; }
.config-panel-close {
    color: var(--text-subtle);
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    min-width: 28px;
    min-height: 28px;
    padding: 4px;
    flex-shrink: 0;
    margin-left: 4px;
}
.config-panel-close:hover {
    color: var(--text-white-kw);
}
.config-panel-close:focus-visible {
    outline: 2px solid #2e6ec4;
    outline-offset: 2px;
    border-radius: 3px;
}
.config-panel-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    min-width: min(100%, 320px);
    -webkit-overflow-scrolling: touch;
}
.config-panel.wide .config-panel-body {
    min-width: min(100%, 320px);
}
.config-panel-footer {
    flex-shrink: 0;
    padding: 12px 16px;
    border-top: 1px solid var(--border-input);
    background: var(--bg-surface-alt);
    min-width: min(100%, 320px);
}
.config-panel.wide .config-panel-footer {
    min-width: min(100%, 320px);
}
.config-panel-footer:empty {
    display: none;
}
.config-panel-footer[hidden],
.panel-internal-apply {
    display: none !important;
}
.panel-actions>.config-panel-save{color:var(--action-success);background:var(--bg-surface);border-color:var(--action-success-border)}
.panel-actions>.config-panel-save:hover,
.panel-actions>.config-panel-save:focus-visible{color:#0f7a4f;background:#eaf7f1;border-color:#15a36b}
.config-panel-status {
    font-size: 12px;
    color: var(--text-muted);
}
.tool-config-save-hint {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-input);
    border-radius: 6px;
    padding: 8px 10px;
    margin: -4px 0 12px;
}
.config-panel-status[data-state="dirty"] {
    color: var(--warning);
}
.config-panel-status[data-state="saved"] {
    color: var(--action-success);
}
.block-help-section {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-input);
    font-size: 12px;
    line-height: 1.35;
    color: var(--text-secondary);
}
.block-help-eyebrow {
    margin-bottom: 3px;
    color: var(--text-muted);
    font-size: 11px;
}
.block-help-section h4 {
    margin: 0 0 2px;
    font-size: 13px;
    font-weight: 650;
    color: var(--text-primary);
}
.block-help-section p {
    margin: 0;
}
.block-help-grid {
    display: grid;
    gap: 8px;
    margin-top: 9px;
}
.block-help-toggle h5 {
    margin: 0 0 2px;
    font-size: 12px;
    font-weight: 650;
    color: var(--text-primary);
}
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
}
.modal.open {
    display: block;
}
.modal-content {
    background-color: var(--bg-surface);
    margin: 10% auto;
    padding: 30px;
    border-radius: var(--radius-lg);
    width: min(400px, 90vw);
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.modal-content.large {
    width: 80%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 0;
}
.modal-header {
    position: relative;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-input);
    flex-shrink: 0;
}
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px 24px;
}
.modal-action-top {
    position: absolute;
    top: 16px;
    right: 50px;
    padding: 6px 14px;
    background: var(--accent-focus);
    color: var(--bg-surface);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background var(--transition-default);
}
.modal-action-top:hover {
    background: #357abd;
}
.close {
    color: var(--text-subtle);
    position: absolute;
    top: 16px;
    right: 18px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    min-width: 32px;
    min-height: 32px;
    padding: 4px;
    border-radius: var(--radius-sm);
}
.close:hover {
    color: var(--text-white-kw);
}
.close:focus-visible {
    outline: 2px solid #2e6ec4;
    outline-offset: 2px;
    border-radius: 3px;
}
.modal h2 {
    font-size: 16px;
    margin-bottom: 0;
    font-weight: 600;
    padding-right: 100px;
}
.file-input-hidden {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    width: 1px;
    height: 1px;
    overflow: hidden;
    border: 0;
    padding: 0;
}
.file-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-primary);
    border: 1px solid #d0d0d0;
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    margin-bottom: 12px;
    transition: background var(--transition-default), border-color var(--transition-default);
}
.file-upload-btn:hover {
    background: #eaeaea;
    border-color: var(--text-very-dim);
}
.file-upload-btn svg {
    flex-shrink: 0;
}
#fileInfo {
    font-size: 13px;
    color: var(--text-dim);
}
.target-template-section {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
}
.target-template-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-hover);
    white-space: nowrap;
}
.target-template-btn {
    padding: 5px 10px;
    font-size: 11px;
}
.target-template-info {
    font-size: 12px;
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#dataDisplay {
    overflow-x: auto;
    max-height: 500px;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
table th {
    background: #f8f8f8;
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border-input);
    position: sticky;
    top: 0;
    color: var(--text-hover);
}
table td {
    padding: 6px 10px;
    border-bottom: 1px solid #f0f0f0;
}
table tr:hover {
    background: var(--bg-surface-alt);
}
#applyAutomapper:hover {
    background: #3a7bc8;
}
#applyAutomapper:active {
    background: #2d6aa8;
}
.modal-description {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 15px;
}
.quick-add-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 320px;
}
.quick-add-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d8d8d8;
    border-radius: var(--radius-md);
    font-size: 14px;
    outline: none;
}
.quick-add-input:focus {
    border-color: var(--accent-focus);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}
.quick-add-hint {
    font-size: 12px;
    color: #6b6b6b;
}
.quick-add-list {
    border: 1px solid var(--border-input);
    border-radius: var(--radius-lg);
    overflow: auto;
    max-height: 360px;
}
.quick-add-item {
    width: 100%;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    cursor: pointer;
}
.quick-add-item:last-child {
    border-bottom: 0;
}
.quick-add-item:hover {
    background: #f5f8ff;
}
.quick-add-item.active {
    background: #eaf2ff;
    box-shadow: inset 3px 0 0 var(--accent-focus);
}
.quick-add-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-white-kw);
}
.quick-add-item-meta {
    font-size: 11px;
    color: #6f6f6f;
}
.quick-add-empty {
    padding: 14px;
    font-size: 13px;
    color: #6f6f6f;
}
.shortcut-help-intro {
    margin-bottom: 12px;
    font-size: 13px;
    color: #5a5a5a;
}
.shortcut-help-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.shortcut-help-table th,
.shortcut-help-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #ececec;
    text-align: left;
    vertical-align: top;
}
.shortcut-help-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-dim);
    background: #f7f7f7;
}
.shortcut-help-table td:first-child {
    width: 160px;
}
.shortcut-help-table kbd {
    display: inline-block;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid #d1d1d1;
    background: #fff;
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    color: var(--text-secondary);
    white-space: nowrap;
}
.btn {
    padding: 8px 16px;
    color: var(--bg-surface);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: opacity var(--transition-default);
}
.btn:hover {
    opacity: 0.9;
}
.btn-primary {
    background: var(--accent-focus);
}
.btn-success {
    background: #2ecc71;
}
.btn-info {
    background: #3498db;
}
.btn-danger {
    background: var(--action-danger);
}
.btn-danger-dark {
    background: var(--action-danger-hover);
}
.btn-warning {
    background: #e67e22;
    color: var(--bg-surface);
}
.btn-warning:hover {
    background: #d35400;
}
.btn-warning-dark {
    background: var(--action-danger-hover);
    color: var(--bg-surface);
}
.btn-warning-dark:hover {
    background: #a93226;
}
.btn-outline {
    background: transparent;
    border: 1px solid #999;
    color: var(--text-hover);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
}
.btn-outline:hover {
    background: var(--bg-canvas);
    border-color: var(--text-dim);
}
.btn-template {
    background: #8e44ad;
    color: var(--bg-surface);
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}
.btn-template:hover { background: #7d3c98; }
.btn-template:disabled { background: var(--border-hover); cursor: not-allowed; }
.template-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-input);
}
.template-upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.template-status {
    font-size: 12px;
    color: var(--text-muted-alt);
}
.template-status.loaded {
    color: #27ae60;
    font-weight: 600;
}
.template-status.error {
    color: var(--action-danger);
}
.export-format-options {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 3px;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    background: var(--bg-canvas);
    width: 100%;
}
.export-format-option {
    display: inline-flex;
    align-items: center;
    min-width: 62px;
    justify-content: center;
    padding: 6px 10px;
    border-radius: calc(var(--radius-sm) - 1px);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}
.export-format-option--disabled {
    cursor: not-allowed;
    opacity: 0.45;
}
.export-format-option:has(input:checked) {
    background: var(--bg-surface);
    color: var(--text-primary);
    box-shadow: var(--control-shadow);
}
.export-format-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.export-auto-run {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}
.export-auto-run input {
    width: 15px;
    height: 15px;
    accent-color: var(--accent-focus);
}
.btn-apply {
    margin-top: 20px;
}
.btn-row {
    display: flex;
    gap: 10px;
}
.btn-row-top {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}
.export-section {
    margin-top: 20px;
    border-top: 1px solid #ddd;
    padding-top: 20px;
}
#flowValidationModal{background:var(--polish-overlay);backdrop-filter:var(--polish-blur)}#flowValidationModal .modal-content.large{width:min(920px,calc(100vw - 40px));max-height:min(86vh,760px);margin:6vh auto;padding:0;overflow:hidden;border:1px solid var(--polish-border-soft);border-radius:var(--polish-radius-modal);box-shadow:var(--polish-shadow-modal)}#flowValidationModal h2{margin:0;padding:20px 56px 0 22px;font-size:1.25rem;letter-spacing:-.03em}#flowValidationModal .modal-description{margin:4px 0 0;padding:0 56px 16px 22px;color:var(--text-secondary);border-bottom:1px solid var(--polish-border-soft)}.flow-validation-interface{min-height:260px;background:var(--polish-gradient-surface)}.flow-validation-shell{display:grid;gap:14px;padding:16px 20px 20px}.flow-validation-hero,.flow-validation-issues-panel,.flow-validation-stat,.flow-validation-issue-card{border:1px solid var(--polish-border-card);background:var(--polish-surface);box-shadow:var(--polish-shadow-card)}.flow-validation-hero{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 16px;border-radius:16px}.flow-validation-shell[data-state=blocked] .flow-validation-hero,.flow-validation-stat[data-kind="blocking"],.flow-validation-stat[data-kind="missing"],.flow-validation-issue-card.is-blocking{border-color:var(--polish-danger);background:var(--polish-danger-muted)}.flow-validation-hero-copy{display:grid;grid-template-columns:auto minmax(0,1fr);gap:12px}.flow-validation-state-dot{width:12px;height:12px;margin-top:5px;border-radius:999px;background:var(--polish-success);box-shadow:var(--polish-ring-success)}.flow-validation-shell[data-state=blocked] .flow-validation-state-dot{background:var(--polish-danger);box-shadow:var(--polish-ring-danger)}.flow-validation-eyebrow,.flow-validation-section-kicker{color:var(--polish-accent);font-size:.66rem;font-weight:800;letter-spacing:.09em;text-transform:uppercase}.flow-validation-shell[data-state=blocked] .flow-validation-eyebrow,.flow-validation-shell[data-state=blocked] .flow-validation-section-kicker,.flow-validation-stat[data-kind="blocking"] .flow-validation-stat-value,.flow-validation-stat[data-kind="missing"] .flow-validation-stat-value{color:var(--polish-danger-strong)}.flow-validation-hero h3,.flow-validation-issues-header h4{margin:2px 0 0;font-size:1rem;font-weight:760;letter-spacing:-.02em}.flow-validation-hero p{margin:4px 0 0;max-width:560px;color:var(--text-secondary);font-size:.82rem;line-height:1.42}.flow-validation-hero-actions{display:flex;gap:8px}.flow-validation-hero-actions .btn{min-height:34px;font-weight:650}.flow-validation-hero-actions .btn:disabled{cursor:not-allowed;color:var(--polish-danger-strong);border-color:var(--polish-danger);background:var(--polish-danger-muted);opacity:1}.flow-validation-summary{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}.flow-validation-stat{min-width:0;border-radius:14px;padding:10px 11px}.flow-validation-stat[data-kind="ready"]{border-color:var(--polish-success);background:var(--polish-success-muted)}.flow-validation-shell[data-state=blocked] .flow-validation-stat[data-kind="ready"]{border-color:var(--polish-warning-border);background:var(--polish-warning-muted)}.flow-validation-stat-label{overflow:hidden;color:var(--text-secondary);font-size:.63rem;font-weight:760;letter-spacing:.07em;text-transform:uppercase;text-overflow:ellipsis;white-space:nowrap}.flow-validation-stat-value{margin-top:4px;font-size:1.38rem;font-weight:800;font-variant-numeric:tabular-nums;letter-spacing:-.035em;line-height:1}.flow-validation-stat-hint{margin-top:5px;overflow:hidden;color:var(--text-muted);font-size:.69rem;text-overflow:ellipsis;white-space:nowrap}.flow-validation-issues-panel{overflow:hidden;border-radius:16px}.flow-validation-issues-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border-bottom:1px solid var(--polish-border-soft);background:var(--polish-surface-raised)}.flow-validation-ready-pill,.flow-status{display:inline-flex;align-items:center;border-radius:var(--radius-pill);font-size:.69rem;font-weight:800;letter-spacing:.03em;text-transform:uppercase}.flow-validation-ready-pill{min-height:26px;padding:4px 10px}.flow-validation-ready-pill[data-state=ready],.flow-status-supported{color:var(--polish-success-strong);background:var(--polish-success-muted)}.flow-validation-ready-pill[data-state=blocked],.flow-status-unsupported{color:var(--polish-danger-strong);background:var(--polish-danger-muted)}.flow-validation-empty{display:grid;gap:4px;padding:18px 16px;color:var(--text-secondary);font-size:.82rem}.flow-validation-issue-list{display:grid;gap:8px;max-height:390px;overflow:auto;padding:10px}.flow-validation-issue-card{display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,.42fr);gap:12px;align-items:center;border-left-width:4px;border-radius:14px;padding:11px 12px}.flow-validation-issue-card.is-warning{border-left-color:var(--polish-warning);background:var(--polish-warning-muted)}.flow-validation-issue-topline{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.flow-validation-block-id{color:var(--polish-text-muted);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace;font-size:.72rem;font-weight:760}.flow-validation-block-type,.flow-manual-action{color:var(--text-secondary);font-size:.75rem}.flow-validation-block-type{font-weight:650}.flow-validation-issue-reason{margin-top:5px;font-size:.82rem;font-weight:620;line-height:1.35}.flow-validation-issue-action{display:flex;align-items:center;justify-content:flex-end;gap:10px;min-width:0}.flow-validation-issue-action .btn{flex-shrink:0;font-weight:650}.flow-status{min-height:22px;padding:3px 8px}.flow-status-partial{color:var(--polish-warning-text);background:var(--polish-warning-muted)}@media (max-width: 720px){#flowValidationModal .modal-content.large{width:calc(100vw - 20px);margin:10px auto}.flow-validation-shell{padding:12px}.flow-validation-hero{align-items:stretch;flex-direction:column}.flow-validation-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.flow-validation-issue-card{grid-template-columns:1fr}.flow-validation-issue-action{justify-content:flex-start}}
.flow-recipe-inline-hint {
    margin-top: 6px;
    font-size: 11px;
    color: #8a5a00;
}
.flow-recipe-row td {
    background: #fcfcff;
    padding: 10px;
}
.flow-recipe-box {
    border: 1px solid #e7e7f2;
    background: #f7f8ff;
    border-radius: var(--radius-md);
    padding: 10px 12px;
}
.flow-recipe-title {
    font-size: 13px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 4px;
}
.flow-recipe-summary {
    font-size: 12px;
    color: #44546a;
    margin-bottom: 8px;
}
.flow-recipe-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #5d6d86;
    margin-top: 8px;
    margin-bottom: 4px;
}
.flow-recipe-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.flow-recipe-chip {
    background: var(--bg-surface);
    border: 1px solid #d4dbed;
    border-radius: var(--radius-pill);
    padding: 3px 9px;
    font-size: 11px;
    color: #334155;
}
.flow-recipe-steps {
    margin: 4px 0 0 18px;
    padding: 0;
}
.flow-recipe-steps li {
    font-size: 12px;
    color: #364152;
    margin-bottom: 4px;
}
.flow-recipe-note {
    margin-top: 8px;
    font-size: 11px;
    color: #6b7280;
}
.export-heading {
    margin-bottom: 10px;
    font-size: 14px;
}
.form-group {
    margin-bottom: 15px;
}
.form-label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
}
.form-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    font-size: 13px;
}
.form-help {
    font-size: 11px;
    color: var(--text-muted-alt);
    margin-top: 5px;
}
.u-mb-15 { margin-bottom: 15px; }
.u-mb-20 { margin-bottom: 20px; }
.u-mt-10 { margin-top: 10px; }
.u-mt-12 { margin-top: 12px; }
.u-mt-15 { margin-top: 15px; }
.u-mr-8 { margin-right: 8px; }
.u-fw-600 { font-weight: 600; }
.u-flex-1 { flex: 1; }
.u-flex-2 { flex: 2; }
.u-flex-gap30 { display: flex; gap: 30px; }
.u-flex-wrap-gap8 { display: flex; flex-wrap: wrap; gap: 8px; }
.u-flex-center-pointer { display: flex; align-items: center; cursor: pointer; }
.u-row-gap8 { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.u-grid-2-gap10-mb12 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.u-text-error { color: #e44; }
.u-muted-italic { color: var(--text-subtle); font-style: italic; }
.u-muted-13-mb10 { color: var(--text-dim); font-size: 13px; margin-bottom: 10px; }
.u-center-muted { text-align: center; color: var(--text-muted-alt); }
.u-note { margin-top: 15px; color: var(--text-dim); font-size: 12px; }
.u-help-12 { font-size: 12px; color: var(--text-dim); margin-top: 8px; }
.u-help-12-mt5 { font-size: 12px; color: var(--text-dim); margin-top: 5px; }
.u-placeholder { color: var(--text-subtle); font-size: 13px; text-align: center; }
.u-title-14 { font-size: 14px; margin-bottom: 10px; font-weight: 600; }
.u-title-13 { font-size: 13px; margin-bottom: 8px; font-weight: 600; }
.u-label-strong { display: block; margin-bottom: 5px; font-weight: 600; }
.u-label-14 { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; }
.u-input-plain { width: 100%; padding: 8px; border: 1px solid var(--border-input); border-radius: var(--radius-sm); }
.u-input { width: 100%; padding: 8px; border: 1px solid var(--border-input); border-radius: var(--radius-sm); font-size: 13px; }
.u-input-mb15 { width: 100%; padding: 8px; border: 1px solid var(--border-input); border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 15px; }
.u-input-sm { width: 100%; padding: 6px; border: 1px solid var(--border-input); border-radius: var(--radius-sm); font-size: 13px; }
.u-flex-input { flex: 1; padding: 8px; border: 1px solid var(--border-input); border-radius: 3px; font-size: 13px; }
.u-btn-neutral { margin-top: 10px; padding: 8px 15px; background: var(--bg-canvas); border: 1px solid var(--border-input); border-radius: var(--radius-sm); cursor: pointer; font-size: 12px; }
.u-btn-danger-sm { padding: 8px; background: var(--action-danger); color: var(--bg-surface); border: none; border-radius: 3px; cursor: pointer; font-size: 12px; }
.u-btn-xs { font-size: 11px; padding: 2px 8px; }
.u-panel-scroll { border: 1px solid var(--border-input); border-radius: var(--radius-sm); padding: 15px; background: var(--bg-surface); max-height: 400px; overflow-y: auto; }
.u-table-compact { width: 100%; border-collapse: collapse; background: var(--bg-surface); font-size: 12px; }
.u-cell-border { padding: 8px; border: 1px solid var(--border-input); }
.u-cell-8 { padding: 8px; border-bottom: 1px solid #f0f0f0; }
.u-th-compact { text-align: left; padding: 4px 8px; }
.u-th-border { text-align: left; padding: 6px; border-bottom: 2px solid var(--border); }
.u-td-border { padding: 4px 6px; border-bottom: 1px solid var(--border); }
.text-input-editor {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    white-space: pre;
    resize: vertical;
}
.text-input-current-data {
    margin-top: 4px;
    color: var(--text-muted-alt);
    font-size: 12px;
}
.automapper-summary {
    background: #f0f8ff;
    padding: 12px;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--accent-focus);
    margin-bottom: 15px;
}
.automapper-grid-header,
.automapper-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
    gap: 15px;
    align-items: center;
    border-radius: var(--radius-sm);
}
.automapper-grid-header {
    margin-bottom: 10px;
    padding: 10px;
    background: var(--bg-primary);
    font-weight: 600;
    font-size: 13px;
}
.automapper-row {
    padding: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-input);
    margin-bottom: 8px;
}
.automapper-out-col {
    font-weight: 500;
}
.automapper-arrow {
    color: var(--text-dim);
    font-size: 18px;
}
.automapper-input-col {
    color: var(--text-white-kw);
}
.automapper-input-col--unmatched {
    color: var(--text-subtle);
    font-style: italic;
}
.automapper-match {
    display: flex;
    align-items: center;
    gap: 5px;
}
.automapper-match-icon {
    font-size: 16px;
}
.automapper-match-text {
    font-size: 11px;
    font-weight: 500;
}
.automapper-match--exact {
    color: #2ecc71;
}
.automapper-match--partial {
    color: #f39c12;
}
.automapper-match--fuzzy {
    color: #e67e22;
}
.automapper-match--unmatched {
    color: var(--text-disabled);
}
.automapper-unmapped {
    margin-top: 20px;
    padding: 12px;
    background: #e8f5e9;
    border-radius: var(--radius-sm);
    border-left: 4px solid #4caf50;
}
.automapper-unmapped-help {
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-dim);
}
.automapper-unmapped-list {
    margin-top: 8px;
    font-size: 12px;
}
.automapper-unmapped-chip {
    display: inline-block;
    padding: 4px 8px;
    background: var(--bg-surface);
    border-radius: 3px;
    margin-right: 5px;
    margin-bottom: 5px;
}
.output-preview-panel {
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    padding: 20px;
    background: #f9f9f9;
}
.output-preview-panel--rejected {
    background: #fff5f5;
}
.output-rejected-title {
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--action-danger);
}
.output-import-path {
    font-size: 12px;
    color: #4a6f2a;
    margin-bottom: 10px;
}
.output-column-chip {
    padding: 6px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    font-size: 12px;
}
.output-column-chip--error {
    background: #ffe6e6;
}
.output-table-head {
    padding: 8px;
    border: 1px solid var(--border-input);
    background: var(--bg-primary);
    text-align: left;
}
.output-table-head--error {
    background: #ffe6e6;
}
.log-output {
    max-height: 500px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 12px;
    background: var(--bg-primary);
    padding: 15px;
    border-radius: var(--radius-sm);
    line-height: 1.6;
}
.hidden {
    display: none;
}
.context-menu {
    position: fixed;
    z-index: 10001;
    background: var(--bg-surface);
    border: 1px solid #ddd;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    padding: 4px 0;
    min-width: 160px;
}
.context-menu-item {
    padding: 7px 14px;
    font-size: 12px;
    color: var(--text-white-kw);
    cursor: pointer;
}
.context-menu-item:hover {
    background: var(--bg-surface-info);
}
.context-menu-item.danger {
    color: #c43030;
}
.context-menu-item.danger:hover {
    background: var(--bg-error-muted);
}
.context-menu-item.disabled {
    color: var(--text-very-dim);
    cursor: default;
}
.context-menu-item.disabled:hover {
    background: transparent;
}
.context-menu-divider {
    height: 1px;
    background: var(--bg-deep);
    margin: 4px 0;
}
#toast-container {
    position: fixed;
    bottom: 56px;
    right: 12px;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    pointer-events: none;
}
.toast {
    padding: 12px 18px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    max-width: 400px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: auto;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: break-word;
}
.toast.show {
    opacity: 1;
    transform: translateY(0);
}
.toast-info {
    background: #2e6ec4;
}
.toast-success {
    background: #1a8a3f;
}
.toast-warn,
.toast-warning {
    background: #b47a1a;
}
.toast-error {
    background: #c43030;
}
.select-col-row.drag-over {
    border-top: 2px solid var(--accent-focus);
}
.drag-handle:active {
    cursor: grabbing;
}
.block.multi-selected .block-icon-area {
    box-shadow: 0 0 0 3px rgba(59,130,246,0.4), 0 2px 8px rgba(0,0,0,0.15);
}
.lasso-rect {
    position: absolute;
    border: 1px dashed #3b82f6;
    background: rgba(59, 130, 246, 0.08);
    pointer-events: none;
    z-index: 5;
}
td.cell-null {
    color: var(--text-disabled);
    font-style: italic;
}
td.cell-number {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: #1a7f37;
}
.bottom-data-table td.cell-number {
    text-align: left;
}
td.cell-bool-true {
    color: #1a7f37;
    font-weight: 600;
}
td.cell-bool-false {
    color: #cf222e;
    font-weight: 600;
}
.formula-no-input {
    color: #e44;
    padding: 8px 0;
}
.formula-expr-row {
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 10px;
    background: var(--bg-surface-alt);
}
.formula-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.formula-row-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-hover);
}
.formula-remove-row {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-subtle);
    padding: 0 4px;
    line-height: 1;
}
.formula-remove-row:hover {
    color: #e44;
}
.formula-field-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 3px;
    margin-top: 6px;
}
.formula-output-col {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    font-size: 13px;
}
.formula-expr-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 12px;
    resize: vertical;
    min-height: 38px;
}
.formula-expr-input:focus,
.formula-output-col:focus {
    outline: none;
    border-color: #b5302a;
    box-shadow: 0 0 0 2px rgba(181, 48, 42, 0.15);
}
.formula-add-row {
    margin-bottom: 12px;
    font-size: 13px;
}
.formula-columns-ref {
    margin-bottom: 12px;
}
.formula-section-label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
}
.formula-col-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
}
.formula-col-badge {
    display: inline-block;
    padding: 3px 8px;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 3px;
    font-size: 12px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    cursor: pointer;
    user-select: none;
    transition: background var(--transition-default), border-color var(--transition-default);
}
.formula-col-badge:hover {
    background: var(--bg-hover-alt);
    border-color: #99c;
}
.formula-ac-dropdown {
    position: absolute;
    z-index: 1000;
    background: var(--bg, #fff);
    border: 1px solid var(--border, #d0d0d0);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 200px;
    overflow-y: auto;
    font-size: 12px;
}
.formula-ac-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    cursor: pointer;
    gap: 8px;
}
.formula-ac-item:hover,
.formula-ac-selected {
    background: var(--hover, #f0f4ff);
}
.formula-ac-label {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-weight: 600;
    white-space: nowrap;
}
.formula-ac-detail {
    color: var(--text-secondary, #888);
    font-size: 11px;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.formula-syntax-ref {
    margin-top: 8px;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    font-size: 12px;
}
.formula-syntax-ref summary {
    padding: 8px 10px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-hover);
    user-select: none;
}
.formula-syntax-ref summary:hover {
    color: var(--text-white-kw);
}
.formula-syntax-body {
    padding: 8px 12px 12px;
    border-top: 1px solid var(--border-input);
    background: var(--bg-surface-alt);
    line-height: 1.6;
}
.formula-syntax-body p {
    margin-bottom: 6px;
}
.formula-syntax-body code {
    background: var(--bg-deep);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 11px;
}
.touch-drag-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.85;
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    padding: 6px 10px;
    font-size: 12px;
    white-space: nowrap;
}
.block.long-press-active {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.canvas.touch-panning {
    cursor: move;
}
@media (max-width: 980px) {
    header {
        flex-wrap: wrap;
        align-items: flex-start;
    }
    .header-center {
        order: 2;
        flex-basis: 100%;
    }
    .header-actions {
        order: 3;
        width: 100%;
    }
}
@media (max-width: 768px) {
    .workspace { flex-direction: column; }
    .bottom-data-viewer {
        height: 220px;
    }
    .bottom-data-viewer-header {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }
    .bottom-data-viewer-title {
        flex: 1 1 100%;
        max-width: 100%;
    }
    .bottom-data-viewer-meta {
        margin-left: 0;
    }
    .toolbox {
        width: 100%;
        max-height: 168px;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 8px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transition: max-height 0.2s ease, padding 0.2s ease;
    }
    .toolbox.toolbox-collapsed {
        max-height: 0;
        padding: 0 8px;
        border-bottom: none;
        overflow: hidden;
    }
    .toolbox-toggle {
        display: flex;
    }
    .tool-group-items:not(.collapsed) {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }
    .tool-item {
        flex: 1 1 148px;
        min-width: 0;
        margin-bottom: 0;
        font-size: 11px;
    }
    header {
        padding: 10px 12px;
        gap: 8px;
    }
    header h1 {
        font-size: 15px;
    }
    .header-center {
        order: 2;
        display: flex;
        flex-basis: 100%;
    }
    .flow-name {
        flex: 1 1 160px;
    }
    .header-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    .zoom-controls {
        order: 2;
    }
    .header-actions .flow-btn,
    .header-title-actions > .flow-btn,
    .header-title-actions .undo-redo-controls .flow-btn,
    .zoom-btn,
    .config-panel-close,
    .template-gallery-close,
    .close {
        min-height: 44px;
        min-width: 44px;
    }
    .header-overflow-menu {
        position: fixed;
        top: 76px;
        right: 12px;
        left: 12px;
        width: auto;
    }
    .config-panel,
    .config-panel.open,
    .config-panel.open.wide {
        width: 100% !important;
        max-width: 100%;
    }
    .config-panel-header,
    .panel-actions,
    .config-panel-body,
    .config-panel-footer,
    .config-panel.wide .config-panel-header,
    .config-panel.wide .config-panel-body,
    .config-panel.wide .config-panel-footer {
        min-width: 0;
        width: 100%;
    }
    .config-panel {
        max-height: 60vh;
        border-left: none;
        border-top: 1px solid var(--border);
        -webkit-overflow-scrolling: touch;
    }
    .config-panel-resize-handle {
        display: none;
    }
    .canvas {
        padding: 10px;
    }
    .modal-content {
        margin: 5% auto;
        padding: 20px;
        width: min(400px, calc(100vw - 24px));
        max-height: 90vh;
    }
    .modal-content.large {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        max-height: 90vh;
    }
}
@media (max-width: 480px) {
    .toolbox {
        max-height: 184px;
    }
    .header-center {
        flex-wrap: wrap;
    }
    .flow-name {
        flex-basis: 100%;
    }
    .header-title-actions {
        width: 100%;
    }
    .header-title-actions > .flow-btn,
    .header-overflow .flow-btn {
        flex: 1 1 calc(50% - 8px);
    }
    .header-overflow-menu .flow-btn-menu {
        flex: none;
    }
    .header-title-actions .undo-redo-controls {
        flex: 0 0 auto;
    }
    .header-title-actions .undo-redo-controls .flow-btn {
        flex: 0 0 44px;
    }
    .modal-content {
        margin: 2% auto;
        padding: 16px;
        border-radius: var(--radius-md);
    }
    .modal-content.large {
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
    }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
.svg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}
.cursor-grabbing { cursor: grabbing; }
.cursor-move { cursor: move; }
.drag-opacity { opacity: 0.4; }
.visibility-hidden { visibility: hidden; }
.icon-18 { width: 18px; height: 18px; }
.u-text-center { text-align: center; }
.u-text-xs-muted { font-size: 12px; color: var(--text-dim); }
.drag-list-item {
    padding: 6px 10px;
    margin-bottom: 4px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: grab;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.grid-row-layout {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}
