/* Chartio 3.2.0 | چارتیو — © 2026 س.مومنی | S.Momeni. All rights reserved. */
/* All UI selectors are scoped under .fcx-app to avoid host-site collisions. */
body.fcx-page {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    overflow: hidden;
    background: #eef2f8;
}

.fcx-app {
    --fcx-bg: #f4f7fb;
    --fcx-grid: #dce4f0;
    --fcx-surface: #ffffff;
    --fcx-surface-2: #f8fafc;
    --fcx-surface-3: #eef3f8;
    --fcx-text: #172033;
    --fcx-muted: #6b768a;
    --fcx-primary: #4f46e5;
    --fcx-primary-hover: #4338ca;
    --fcx-primary-soft: #eeedff;
    --fcx-on-primary: #ffffff;
    --fcx-border: #dce3ed;
    --fcx-border-strong: #c9d2df;
    --fcx-node-bg: #ffffff;
    --fcx-node-border: #aeb9c8;
    --fcx-edge: #9aa8ba;
    --fcx-edge-hover: #6f7f94;
    --fcx-danger: #dc3545;
    --fcx-danger-soft: #fff0f2;
    --fcx-success: #0f9f82;
    --fcx-shadow-sm: 0 5px 18px rgba(36, 48, 70, .08);
    --fcx-shadow-md: 0 16px 42px rgba(28, 39, 60, .14);
    --fcx-radius-sm: 10px;
    --fcx-radius: 14px;
    --fcx-radius-lg: 20px;
    --fcx-font: "Estedad", "Segoe UI", Tahoma, Arial, sans-serif;

    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 520px;
    overflow: hidden;
    direction: rtl;
    isolation: isolate;
    color-scheme: light;
    font-family: var(--fcx-font);
    color: var(--fcx-text);
    background: var(--fcx-bg);
    line-height: 1.5;
    text-align: right;
}

.fcx-app.fcx-dark {
    color-scheme: dark;
    --fcx-bg: #09090b;
    --fcx-grid: #242427;
    --fcx-surface: #111113;
    --fcx-surface-2: #18181b;
    --fcx-surface-3: #202024;
    --fcx-text: #f4f4f5;
    --fcx-muted: #a1a1aa;
    --fcx-primary: #1c39bb;
    --fcx-primary-hover: #294bd3;
    --fcx-primary-soft: #111936;
    --fcx-on-primary: #ffffff;
    --fcx-border: #2b2b30;
    --fcx-border-strong: #45454d;
    --fcx-node-bg: #151517;
    --fcx-node-border: #52525b;
    --fcx-edge: #71717a;
    --fcx-edge-hover: #a1a1aa;
    --fcx-danger: #fb7185;
    --fcx-danger-soft: #35181e;
    --fcx-success: #4f6ee8;
    --fcx-shadow-sm: 0 8px 24px rgba(0, 0, 0, .32);
    --fcx-shadow-md: 0 22px 60px rgba(0, 0, 0, .48);
}

.fcx-app.fcx-dark .fcx-brand-mark {
    color: #ffffff;
    background: linear-gradient(135deg, #1c39bb, #111936);
    box-shadow: 0 8px 24px rgba(28, 57, 187, .24);
}

.fcx-app.fcx-dark .fcx-modal-overlay {
    background: rgba(0, 0, 0, .72);
}

.fcx-app,
.fcx-app * {
    box-sizing: border-box;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* S.Momeni signature: scrolling remains available while its chrome stays invisible. */
.fcx-app::-webkit-scrollbar,
.fcx-app *::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.fcx-app .fcx-fa-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

.fcx-app .fcx-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    flex: 0 0 auto;
    fill: currentColor;
    vertical-align: -0.12em;
    overflow: visible;
}

.fcx-app button,
.fcx-app input,
.fcx-app textarea,
.fcx-app output {
    font: inherit;
}

.fcx-app button,
.fcx-app input,
.fcx-app textarea {
    color: inherit;
}

.fcx-app button:focus-visible,
.fcx-app input:focus-visible,
.fcx-app textarea:focus-visible,
.fcx-app [tabindex]:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--fcx-primary) 32%, transparent);
    outline-offset: 2px;
}

.fcx-app .fcx-shell {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.fcx-app .fcx-sidebar {
    order: -1;
    flex: 0 0 300px;
    width: 300px;
    height: 100%;
    padding: 18px;
    overflow-y: auto;
    background: color-mix(in srgb, var(--fcx-surface) 88%, transparent);
    border-left: 1px solid color-mix(in srgb, var(--fcx-border) 88%, transparent);
    box-shadow: -8px 0 28px rgba(30, 43, 66, .07);
    -webkit-backdrop-filter: blur(18px) saturate(125%);
    backdrop-filter: blur(18px) saturate(125%);
    z-index: 30;
    opacity: 1;
    transition: width .25s ease, flex-basis .25s ease, padding-inline .25s ease, opacity .18s ease, background-color .2s ease, border-color .2s ease, transform .25s ease;
}

.fcx-app .fcx-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 22px;
    padding: 6px 4px 16px;
    border-bottom: 1px solid var(--fcx-border);
}

.fcx-app .fcx-brand-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.fcx-app .fcx-sidebar-toggle {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    padding: 0;
    border: 1px solid var(--fcx-border);
    border-radius: 10px;
    background: var(--fcx-surface-2);
    color: var(--fcx-muted);
    cursor: pointer;
    transition: transform .15s ease, color .15s ease, border-color .15s ease, background-color .15s ease;
}

.fcx-app .fcx-sidebar-toggle:hover {
    color: var(--fcx-primary);
    border-color: var(--fcx-border-strong);
    background: var(--fcx-primary-soft);
}

.fcx-app .fcx-sidebar-toggle:active { transform: scale(.95); }

.fcx-app .fcx-brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--fcx-primary), #7c3aed);
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--fcx-primary) 28%, transparent);
}

.fcx-app .fcx-brand strong,
.fcx-app .fcx-brand span {
    display: block;
}

.fcx-app .fcx-brand strong {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .01em;
}

.fcx-app .fcx-brand span {
    margin-top: 1px;
    color: var(--fcx-muted);
    direction: ltr;
    text-align: right;
    font-size: 11px;
}

.fcx-app .fcx-panel-section + .fcx-panel-section {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--fcx-border);
}

.fcx-app .fcx-section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.fcx-app .fcx-section-heading h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}

.fcx-app .fcx-muted {
    color: var(--fcx-muted);
    font-size: 11px;
}

.fcx-app .fcx-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fcx-app .fcx-input-group > label,
.fcx-app .fcx-color-field > span {
    color: var(--fcx-muted);
    font-size: 12px;
    font-weight: 600;
}

.fcx-app input[type="text"],
.fcx-app input[type="search"],
.fcx-app textarea {
    width: 100%;
    border: 1px solid var(--fcx-border);
    border-radius: var(--fcx-radius-sm);
    background: var(--fcx-surface-2);
    color: var(--fcx-text);
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.fcx-app input[type="text"],
.fcx-app input[type="search"] {
    height: 40px;
    padding: 0 12px;
}

.fcx-app textarea {
    min-height: 96px;
    padding: 10px 12px;
    resize: vertical;
    line-height: 1.7;
}

.fcx-app input[type="text"]:focus,
.fcx-app input[type="search"]:focus,
.fcx-app textarea:focus {
    border-color: var(--fcx-primary);
    background: var(--fcx-surface);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--fcx-primary) 12%, transparent);
    outline: none;
}

.fcx-app input::placeholder,
.fcx-app textarea::placeholder {
    color: color-mix(in srgb, var(--fcx-muted) 72%, transparent);
}

.fcx-app .fcx-btn,
.fcx-app .fcx-icon-btn,
.fcx-app .fcx-fab,
.fcx-app .fcx-modal-close {
    border: 0;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.fcx-app .fcx-btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 12px;
    border: 1px solid var(--fcx-border);
    border-radius: 10px;
    background: var(--fcx-surface);
    color: var(--fcx-text);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    transition: transform .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
}

.fcx-app .fcx-btn:hover {
    border-color: var(--fcx-border-strong);
    background: var(--fcx-surface-2);
}

.fcx-app .fcx-btn:active,
.fcx-app .fcx-icon-btn:active {
    transform: translateY(1px);
}

.fcx-app .fcx-btn-primary {
    border-color: var(--fcx-primary);
    background: var(--fcx-primary);
    color: var(--fcx-on-primary);
}

.fcx-app .fcx-btn-primary:hover {
    border-color: var(--fcx-primary-hover);
    background: var(--fcx-primary-hover);
    color: var(--fcx-on-primary);
}

.fcx-app .fcx-btn-danger-ghost {
    border-color: color-mix(in srgb, var(--fcx-danger) 35%, var(--fcx-border));
    color: var(--fcx-danger);
}

.fcx-app .fcx-btn-danger-ghost:hover {
    border-color: color-mix(in srgb, var(--fcx-danger) 55%, var(--fcx-border));
    background: var(--fcx-danger-soft);
}

.fcx-app .fcx-color-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

.fcx-app .fcx-color-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 44px;
    padding: 7px 10px;
    border: 1px solid var(--fcx-border);
    border-radius: 10px;
    background: var(--fcx-surface-2);
}

.fcx-app input[type="color"] {
    width: 30px;
    height: 30px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--fcx-border);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

.fcx-app input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.fcx-app input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 7px; }

.fcx-app .fcx-check-row {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--fcx-surface-2);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.fcx-app .fcx-check-row input {
    width: 17px;
    height: 17px;
    accent-color: var(--fcx-primary);
}

.fcx-app .fcx-properties-panel {
    opacity: .52;
    pointer-events: none;
    filter: saturate(.65);
    transition: opacity .18s ease, filter .18s ease;
}

.fcx-app .fcx-properties-panel.fcx-active {
    opacity: 1;
    pointer-events: auto;
    filter: none;
}


.fcx-app .fcx-main-content {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* S.Momeni signature: collapsed means the canvas receives the full horizontal space. */
.fcx-app.fcx-sidebar-collapsed .fcx-sidebar {
    width: 0;
    flex-basis: 0;
    padding-inline: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateX(100%);
    border-left-color: transparent;
    box-shadow: none;
    pointer-events: none;
}

.fcx-app .fcx-toolbar {
    min-height: 62px;
    padding: 9px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: color-mix(in srgb, var(--fcx-surface) 82%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--fcx-border) 88%, transparent);
    box-shadow: 0 8px 28px rgba(26, 34, 48, .06);
    -webkit-backdrop-filter: blur(18px) saturate(125%);
    backdrop-filter: blur(18px) saturate(125%);
    z-index: 20;
}

.fcx-app .fcx-toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.fcx-app .fcx-icon-btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--fcx-border);
    border-radius: 10px;
    background: var(--fcx-surface);
    color: var(--fcx-text);
    font-size: 14px;
    transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}

.fcx-app .fcx-icon-btn:hover {
    background: var(--fcx-surface-2);
    border-color: var(--fcx-border-strong);
}

.fcx-app .fcx-menu-toggle { display: none; }

.fcx-app.fcx-sidebar-collapsed .fcx-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.fcx-app .fcx-search-wrap {
    position: relative;
    flex: 1 1 280px;
    max-width: 480px;
    min-width: 160px;
    margin-inline: auto;
}

.fcx-app .fcx-search-wrap input {
    padding-inline-start: 38px;
    background: var(--fcx-surface-2);
}

.fcx-app .fcx-search-icon {
    position: absolute;
    inset-inline-start: 12px;
    top: 50%;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    color: var(--fcx-muted);
    font-size: 15px;
    pointer-events: none;
}

.fcx-app .fcx-toggle-switch {
    position: relative;
    width: 58px;
    height: 30px;
    flex: 0 0 58px;
    direction: ltr;
    --fcx-toggle-light: #d8dbe0;
    --fcx-toggle-dark: #28292c;
}

.fcx-app .fcx-switch-label {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 30px;
    border: 2px solid var(--fcx-toggle-dark);
    border-radius: 999px;
    background-color: var(--fcx-toggle-dark);
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04), var(--fcx-shadow-sm);
}

.fcx-app .fcx-toggle-checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.fcx-app .fcx-toggle-slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    transition: background-color .3s ease;
}

.fcx-app .fcx-toggle-checkbox:checked ~ .fcx-toggle-slider {
    background-color: var(--fcx-toggle-light);
}

.fcx-app .fcx-toggle-slider::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 7px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--fcx-toggle-dark);
    box-shadow: inset 7px -3px 0 0 var(--fcx-toggle-light);
    transition: transform .3s ease, box-shadow .3s ease, background-color .3s ease;
}

.fcx-app .fcx-toggle-checkbox:checked ~ .fcx-toggle-slider::before {
    transform: translateX(27px);
    background-color: var(--fcx-toggle-dark);
    box-shadow: none;
}

.fcx-app .fcx-toggle-checkbox:focus-visible ~ .fcx-toggle-slider {
    outline: 3px solid color-mix(in srgb, var(--fcx-primary) 38%, transparent);
    outline-offset: 3px;
}

.fcx-app .fcx-workspace-container {
    position: relative;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
    background: var(--fcx-bg);
    touch-action: none;
    outline: none;
}

.fcx-app .fcx-workspace-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
    color: var(--fcx-grid);
}

.fcx-app .fcx-grid-fill-minor {
    fill: url(#fcx-grid-minor-pattern);
}

.fcx-app .fcx-grid-fill-major {
    fill: url(#fcx-grid-major-pattern);
}

.fcx-app .fcx-grid-line {
    fill: none;
    stroke: currentColor;
    shape-rendering: geometricPrecision;
}

.fcx-app .fcx-grid-line-minor {
    opacity: .58;
}

.fcx-app .fcx-grid-line-major {
    opacity: .95;
}

.fcx-app .fcx-workspace-origin {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    width: 30px;
    height: 30px;
    transform: translate3d(0, 0, 0) translate(-50%, -50%);
    border: 1px solid color-mix(in srgb, var(--fcx-muted) 48%, transparent);
    border-radius: 50%;
    opacity: .82;
    pointer-events: none;
    will-change: transform;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .12));
}

.fcx-app .fcx-workspace-origin::before,
.fcx-app .fcx-workspace-origin::after {
    content: "";
    position: absolute;
    background: color-mix(in srgb, var(--fcx-muted) 58%, transparent);
}

.fcx-app .fcx-workspace-origin::before {
    top: 50%;
    left: -7px;
    width: 42px;
    height: 1px;
    transform: translateY(-50%);
}

.fcx-app .fcx-workspace-origin::after {
    top: -7px;
    left: 50%;
    width: 1px;
    height: 42px;
    transform: translateX(-50%);
}

.fcx-app .fcx-workspace-origin span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: var(--fcx-muted);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--fcx-surface) 76%, transparent);
}

.fcx-app .fcx-workspace {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    width: 100%;
    height: 100%;
    user-select: none;
}

.fcx-app .fcx-canvas-hint {
    position: absolute;
    bottom: 18px;
    right: 18px;
    z-index: 4;
    padding: 7px 10px;
    border: 1px solid var(--fcx-border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--fcx-surface) 78%, transparent);
    color: var(--fcx-muted);
    box-shadow: var(--fcx-shadow-sm);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    backdrop-filter: blur(12px) saturate(120%);
    font-size: 11px;
    pointer-events: none;
}

.fcx-app .fcx-node-rect {
    stroke: var(--fcx-node-border);
    stroke-width: 1.6;
    cursor: move;
    rx: 12;
    ry: 12;
    transition: stroke .14s ease, filter .14s ease;
}

.fcx-app .fcx-node-rect.fcx-selected {
    stroke: var(--fcx-primary);
    stroke-width: 2.7;
    filter: drop-shadow(0 7px 10px color-mix(in srgb, var(--fcx-primary) 22%, transparent));
}

.fcx-app .fcx-node-text {
    font-family: var(--fcx-font);
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
    user-select: none;
}

.fcx-app .fcx-desc-icon {
    cursor: pointer;
    opacity: .88;
    transition: opacity .15s ease;
}

.fcx-app .fcx-desc-icon:hover { opacity: 1; }

.fcx-app .fcx-port {
    fill: var(--fcx-surface);
    stroke: var(--fcx-node-border);
    stroke-width: 2;
    cursor: crosshair;
    transition: fill .14s ease, stroke .14s ease, r .14s ease;
}

.fcx-app .fcx-port:hover {
    fill: var(--fcx-primary);
    stroke: var(--fcx-primary);
}

.fcx-app .fcx-port.fcx-active-port {
    fill: #f59e0b;
    stroke: #f59e0b;
}

.fcx-app .fcx-edge-path {
    fill: none;
    stroke: var(--fcx-edge-custom-color, var(--fcx-edge));
    stroke-width: var(--fcx-edge-width, 2.5px);
    stroke-linecap: round;
    stroke-linejoin: round;
    cursor: pointer;
    transition: stroke .14s ease, filter .14s ease;
}

.fcx-app .fcx-edge-path:hover {
    stroke: var(--fcx-edge-custom-color, var(--fcx-edge-hover));
    filter: drop-shadow(0 0 2px color-mix(in srgb, currentColor 16%, transparent));
}

.fcx-app .fcx-edge-path.fcx-selected { stroke: var(--fcx-primary); }

.fcx-app .fcx-edge-path.fcx-edge-dashed { stroke-dasharray: 10 8; }

.fcx-app .fcx-edge-path.fcx-path-active {
    stroke: var(--fcx-primary);
    stroke-width: 3.7;
    filter: drop-shadow(0 0 5px color-mix(in srgb, var(--fcx-primary) 34%, transparent));
}

.fcx-app .fcx-edge-label-group {
    pointer-events: none;
}

.fcx-app .fcx-edge-label-bg {
    fill: color-mix(in srgb, var(--fcx-surface) 94%, transparent);
    stroke: var(--fcx-border);
    stroke-width: 1;
    filter: drop-shadow(0 2px 5px color-mix(in srgb, #000 12%, transparent));
}

.fcx-app .fcx-edge-label-text {
    fill: var(--fcx-text);
    font-family: var(--fcx-font);
    font-size: 12px;
    font-weight: 650;
    direction: rtl;
    unicode-bidi: plaintext;
}

.fcx-app .fcx-edge-label-group.fcx-selected .fcx-edge-label-bg,
.fcx-app .fcx-edge-label-group.fcx-path-active .fcx-edge-label-bg {
    stroke: var(--fcx-primary);
    stroke-width: 1.5;
}

.fcx-app .fcx-edge-label-group.fcx-selected .fcx-edge-label-text,
.fcx-app .fcx-edge-label-group.fcx-path-active .fcx-edge-label-text {
    fill: var(--fcx-primary);
}


.fcx-app .fcx-temp-edge {
    fill: none;
    stroke: #f59e0b;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 6 6;
    pointer-events: none;
}


.fcx-app .fcx-selection-marquee {
    position: absolute;
    z-index: 7;
    display: none;
    border: 1px solid color-mix(in srgb, var(--fcx-primary) 78%, white 8%);
    border-radius: 4px;
    background: color-mix(in srgb, var(--fcx-primary) 12%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fcx-surface) 22%, transparent);
    pointer-events: none;
}

.fcx-app .fcx-selection-marquee.fcx-active { display: block; }

.fcx-app .fcx-edge-properties-panel {
    opacity: .55;
    pointer-events: none;
}

.fcx-app .fcx-edge-properties-panel.fcx-active {
    opacity: 1;
    pointer-events: auto;
}

.fcx-app .fcx-line-style-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.fcx-app .fcx-line-style-btn {
    display: grid;
    gap: 7px;
    align-items: center;
    justify-items: center;
    min-height: 62px;
    padding: 8px;
    border: 1px solid var(--fcx-border);
    border-radius: 11px;
    background: var(--fcx-surface-2);
    color: var(--fcx-muted);
    cursor: pointer;
    transition: border-color .14s ease, background-color .14s ease, color .14s ease, box-shadow .14s ease;
}

.fcx-app .fcx-line-style-btn:hover {
    color: var(--fcx-text);
    border-color: var(--fcx-border-strong);
}


.fcx-app .fcx-field-label {
    display: block;
    margin-top: 2px;
    color: var(--fcx-text);
    font-size: 12px;
    font-weight: 700;
}

.fcx-app .fcx-edge-direction-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.fcx-app .fcx-edge-direction-btn,
.fcx-app .fcx-compact-choice {
    min-width: 0;
    min-height: 44px;
    border: 1px solid var(--fcx-border);
    border-radius: 10px;
    background: var(--fcx-surface-2);
    color: var(--fcx-muted);
    cursor: pointer;
    font: inherit;
    transition: border-color .14s ease, background-color .14s ease, color .14s ease, box-shadow .14s ease;
}

.fcx-app .fcx-edge-direction-btn {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 5px;
    padding: 7px 9px;
}

.fcx-app .fcx-direction-preview {
    direction: ltr;
    font-size: 18px;
    line-height: 1;
    font-family: Arial, sans-serif;
    color: currentColor;
}

.fcx-app .fcx-edge-direction-btn:hover,
.fcx-app .fcx-compact-choice:hover {
    color: var(--fcx-text);
    border-color: var(--fcx-border-strong);
}

.fcx-app .fcx-edge-direction-btn.fcx-active,
.fcx-app .fcx-compact-choice.fcx-active {
    color: var(--fcx-primary);
    border-color: color-mix(in srgb, var(--fcx-primary) 70%, var(--fcx-border));
    background: color-mix(in srgb, var(--fcx-primary) 10%, var(--fcx-surface));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--fcx-primary) 9%, transparent);
}

.fcx-app .fcx-edge-appearance-grid {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
}

.fcx-app .fcx-edge-thickness-field {
    display: grid;
    gap: 7px;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--fcx-border);
    border-radius: 11px;
    background: var(--fcx-surface-2);
}

.fcx-app .fcx-edge-thickness-field > span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--fcx-muted);
    font-size: 11px;
}

.fcx-app .fcx-edge-thickness-field output {
    direction: ltr;
    color: var(--fcx-text);
    font-variant-numeric: tabular-nums;
}

.fcx-app .fcx-edge-thickness-field input[type="range"] {
    width: 100%;
    min-width: 0;
}

.fcx-app .fcx-mother-traversal-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.fcx-app .fcx-panel-help {
    margin: 9px 0 0;
    color: var(--fcx-muted);
    font-size: 10.5px;
    line-height: 1.8;
}

.fcx-app .fcx-line-style-btn.fcx-active {
    color: var(--fcx-primary);
    border-color: color-mix(in srgb, var(--fcx-primary) 70%, var(--fcx-border));
    background: color-mix(in srgb, var(--fcx-primary-soft) 72%, var(--fcx-surface));
    box-shadow: 0 5px 14px color-mix(in srgb, var(--fcx-primary) 13%, transparent);
}

.fcx-app .fcx-line-preview {
    display: block;
    width: 52px;
    height: 0;
    border-top: 3px solid currentColor;
}

.fcx-app .fcx-line-preview-dashed { border-top-style: dashed; }

.fcx-app .fcx-canvas-tools {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 8;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 6px;
    border: 1px solid var(--fcx-border);
    border-radius: 13px;
    background: color-mix(in srgb, var(--fcx-surface) 78%, transparent);
    box-shadow: var(--fcx-shadow-sm);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    backdrop-filter: blur(14px) saturate(120%);
    direction: ltr;
}

.fcx-app .fcx-canvas-tool {
    position: relative;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--fcx-muted);
    cursor: pointer;
    transition: color .16s ease, background-color .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.fcx-app .fcx-canvas-tool:hover {
    color: var(--fcx-text);
    background: color-mix(in srgb, var(--fcx-surface-3) 82%, transparent);
}

.fcx-app .fcx-canvas-tool.fcx-active {
    color: var(--fcx-on-primary);
    border-color: color-mix(in srgb, var(--fcx-primary) 76%, var(--fcx-border));
    background: var(--fcx-primary);
    box-shadow: 0 5px 14px color-mix(in srgb, var(--fcx-primary) 24%, transparent);
}

.fcx-app .fcx-canvas-tool:active { transform: scale(.95); }
.fcx-app .fcx-canvas-tool .fcx-icon { font-size: 16px; }

.fcx-app .fcx-canvas-tool kbd {
    position: absolute;
    right: 2px;
    bottom: 1px;
    min-width: 11px;
    padding: 0;
    border: 0;
    background: transparent;
    color: currentColor;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 7px;
    font-weight: 800;
    line-height: 1;
    opacity: .72;
}

.fcx-app .fcx-workspace-container.fcx-tool-pan .fcx-workspace,
.fcx-app .fcx-workspace-container.fcx-tool-pan .fcx-node-rect,
.fcx-app .fcx-workspace-container.fcx-tool-pan .fcx-edge-path,
.fcx-app .fcx-workspace-container.fcx-tool-pan .fcx-port {
    cursor: grab;
}

.fcx-app .fcx-workspace-container.fcx-tool-pan.fcx-is-panning .fcx-workspace,
.fcx-app .fcx-workspace-container.fcx-tool-pan.fcx-is-panning .fcx-node-rect,
.fcx-app .fcx-workspace-container.fcx-tool-pan.fcx-is-panning .fcx-edge-path,
.fcx-app .fcx-workspace-container.fcx-tool-pan.fcx-is-panning .fcx-port {
    cursor: grabbing;
}

.fcx-app .fcx-node-status-icon {
    color: var(--fcx-primary);
    fill: currentColor;
    filter: drop-shadow(0 1px 1px color-mix(in srgb, #000 18%, transparent));
}

.fcx-app .fcx-node-pin-icon {
    pointer-events: none;
}

.fcx-app .fcx-node-info-icon {
    cursor: pointer;
    opacity: .88;
    transition: opacity .15s ease;
}

.fcx-app .fcx-node-info-icon:hover { opacity: 1; }

.fcx-app .fcx-node-mother-icon {
    color: var(--fcx-primary);
    pointer-events: none;
    filter: drop-shadow(0 2px 4px color-mix(in srgb, var(--fcx-primary) 30%, transparent));
}

.fcx-app .fcx-node-rect.fcx-mother-node {
    stroke: color-mix(in srgb, var(--fcx-primary) 72%, var(--fcx-node-border));
    stroke-width: 2.1;
}

.fcx-app .fcx-node-rect.fcx-path-node {
    stroke: color-mix(in srgb, var(--fcx-primary) 82%, white 6%);
    stroke-width: 2.3;
    filter: drop-shadow(0 0 7px color-mix(in srgb, var(--fcx-primary) 22%, transparent));
}

.fcx-app .fcx-node-rect.fcx-path-mother {
    stroke: var(--fcx-primary);
    stroke-width: 3;
    filter: drop-shadow(0 0 10px color-mix(in srgb, var(--fcx-primary) 34%, transparent));
}

.fcx-app .fcx-node-rect.fcx-path-node.fcx-selected {
    stroke-width: 3.2;
    filter: drop-shadow(0 0 11px color-mix(in srgb, var(--fcx-primary) 38%, transparent));
}


.fcx-app .fcx-viewport-controls {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 8;
    display: flex;
    align-items: stretch;
    gap: 8px;
    direction: ltr;
}

.fcx-app .fcx-zoom-control {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 8px 10px;
    border: 1px solid var(--fcx-border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--fcx-surface) 78%, transparent);
    box-shadow: var(--fcx-shadow-sm);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    backdrop-filter: blur(14px) saturate(120%);
    color: var(--fcx-muted);
    direction: ltr;
}

.fcx-app .fcx-zoom-step {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 30px;
    flex: 0 0 28px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--fcx-muted);
    cursor: pointer;
    transition: color .15s ease, background-color .15s ease, transform .15s ease, opacity .15s ease;
}

.fcx-app .fcx-zoom-step:hover:not(:disabled) {
    color: var(--fcx-primary);
    background: var(--fcx-primary-soft);
}

.fcx-app .fcx-zoom-step:active:not(:disabled) { transform: scale(.92); }

.fcx-app .fcx-zoom-step:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.fcx-app .fcx-center-view-btn {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    padding: 0;
    border: 1px solid var(--fcx-border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--fcx-surface) 78%, transparent);
    color: var(--fcx-text);
    box-shadow: var(--fcx-shadow-sm);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    backdrop-filter: blur(14px) saturate(120%);
    cursor: pointer;
    transition: transform .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.fcx-app .fcx-center-view-btn:hover {
    transform: translateY(-1px);
    border-color: var(--fcx-border-strong);
    background: var(--fcx-surface-2);
    box-shadow: 0 5px 14px rgba(0, 0, 0, .1);
}

.fcx-app .fcx-center-view-btn:active { transform: translateY(0) scale(.96); }
.fcx-app .fcx-center-view-btn:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--fcx-primary) 28%, transparent);
    outline-offset: 2px;
}

.fcx-app .fcx-zoom-control output {
    min-width: 38px;
    color: var(--fcx-muted);
    font-size: 10px;
    text-align: center;
}

.fcx-app #fcx-zoom-slider {
    width: 100px;
    height: 4px;
    margin: 0;
    accent-color: var(--fcx-primary);
}

.fcx-app .fcx-dropdown,
.fcx-app .fcx-context-menu {
    display: none;
    position: fixed;
    min-width: 190px;
    max-width: min(340px, calc(100vw - 20px));
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--fcx-border);
    border-radius: 13px;
    background: color-mix(in srgb, var(--fcx-surface) 88%, transparent);
    box-shadow: var(--fcx-shadow-md);
    -webkit-backdrop-filter: blur(18px) saturate(125%);
    backdrop-filter: blur(18px) saturate(125%);
    z-index: 3000;
}

.fcx-app .fcx-dropdown button {
    display: block;
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    border: 0;
    border-bottom: 1px solid var(--fcx-border);
    background: transparent;
    color: var(--fcx-text);
    text-align: right;
    cursor: pointer;
}

.fcx-app .fcx-dropdown button:hover { background: var(--fcx-surface-2); }
.fcx-app .fcx-dropdown button:last-child { border-bottom: 0; }

.fcx-app .fcx-empty-msg {
    padding: 12px;
    color: var(--fcx-muted);
    text-align: center;
    font-size: 11px;
}

.fcx-app .fcx-context-menu-item {
    min-height: 42px;
    padding: 10px 13px;
    border-bottom: 1px solid var(--fcx-border);
    color: var(--fcx-text);
    cursor: pointer;
    font-size: 12px;
    transition: background-color .12s ease;
}

.fcx-app .fcx-context-menu-item:last-child { border-bottom: 0; }
.fcx-app .fcx-context-menu-item:hover { background: var(--fcx-surface-2); }
.fcx-app .fcx-context-menu-item.fcx-bold { font-weight: 700; }
.fcx-app .fcx-context-menu-item.fcx-danger { color: var(--fcx-danger); }
.fcx-app .fcx-context-menu-item.fcx-danger:hover { background: var(--fcx-danger-soft); }

.fcx-app .fcx-modal-overlay {
    position: absolute;
    inset: 0;
    z-index: 4000;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(7, 12, 22, .62);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}

.fcx-app .fcx-modal-overlay.fcx-active {
    opacity: 1;
    pointer-events: auto;
}

.fcx-app .fcx-modal-content {
    position: relative;
    width: min(760px, 94vw);
    max-height: min(82vh, 760px);
    overflow-y: auto;
    padding: 24px;
    border: 1px solid var(--fcx-border);
    border-radius: var(--fcx-radius-lg);
    background: color-mix(in srgb, var(--fcx-surface) 90%, transparent);
    box-shadow: var(--fcx-shadow-md);
    -webkit-backdrop-filter: blur(22px) saturate(120%);
    backdrop-filter: blur(22px) saturate(120%);
    transform: translateY(8px) scale(.985);
    transition: transform .18s ease;
}

.fcx-app .fcx-modal-overlay.fcx-active .fcx-modal-content {
    transform: none;
}

.fcx-app .fcx-modal-content h2 {
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--fcx-border);
    font-size: 18px;
}


.fcx-app .fcx-text-entry-modal-content {
    width: min(520px, 94vw);
}

.fcx-app .fcx-text-entry-fields {
    gap: 9px;
}

.fcx-app .fcx-text-entry-fields textarea {
    min-height: 150px;
}

.fcx-app .fcx-text-entry-fields [hidden] {
    display: none !important;
}

.fcx-app .fcx-field-error {
    min-height: 20px;
    margin: 0;
    color: var(--fcx-danger);
    font-size: 11px;
    line-height: 1.6;
}

.fcx-app .fcx-modal-actions {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--fcx-border);
}

.fcx-app .fcx-modal-content ul {
    margin: 16px 0 0;
    padding-right: 20px;
    line-height: 1.95;
    font-size: 13px;
}

.fcx-app .fcx-modal-close {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--fcx-surface-2);
    color: var(--fcx-muted);
    font-size: 14px;
    line-height: 1;
}

.fcx-app .fcx-modal-close:hover {
    background: var(--fcx-danger-soft);
    color: var(--fcx-danger);
}

.fcx-app .fcx-version-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--fcx-primary-soft);
    color: var(--fcx-primary);
    font-size: 10px;
    font-weight: 700;
}

.fcx-app .fcx-description-content {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.9;
    font-size: 13px;
}

.fcx-app .fcx-description-content a {
    color: var(--fcx-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.fcx-app .fcx-fab {
    position: absolute;
    left: 18px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    color: #fff;
    box-shadow: var(--fcx-shadow-md);
    z-index: 1000;
    font-size: 18px;
    font-weight: 700;
    transition: transform .15s ease, filter .15s ease;
}

.fcx-app .fcx-fab:hover { transform: translateY(-2px); filter: brightness(1.04); }
.fcx-app .fcx-help-fab { bottom: 56px; background: var(--fcx-primary); }
.fcx-app .fcx-log-fab { bottom: 108px; background: var(--fcx-success); }

.fcx-app .fcx-footer-meta {
    position: absolute;
    bottom: 14px;
    left: 16px;
    z-index: 8;
    display: flex;
    align-items: center;
    gap: 7px;
    direction: ltr;
}

.fcx-app .fcx-credit {
    color: var(--fcx-muted);
    text-decoration: none;
    font-size: 10px;
}

.fcx-app .fcx-credit:hover { color: var(--fcx-primary); }

.fcx-app .fcx-footer-version {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border: 1px solid color-mix(in srgb, var(--fcx-primary) 25%, var(--fcx-border));
    border-radius: 999px;
    background: color-mix(in srgb, var(--fcx-primary-soft) 76%, var(--fcx-surface));
    color: var(--fcx-primary);
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .03em;
}

.fcx-app .fcx-sidebar-backdrop {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 25;
    background: rgba(5, 10, 18, .55);
}

.fcx-app .fcx-tour-overlay {
    position: absolute;
    inset: 0;
    z-index: 9998;
    visibility: hidden;
    opacity: 0;
    background: rgba(5, 10, 20, .68);
    -webkit-backdrop-filter: blur(1.5px);
    backdrop-filter: blur(1.5px);
    pointer-events: none;
    transition: opacity .36s cubic-bezier(.22, 1, .36, 1), visibility 0s linear .36s;
}

.fcx-app .fcx-tour-overlay.fcx-active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition-delay: 0s;
}

.fcx-app .fcx-tour-tooltip {
    position: fixed;
    z-index: 10001;
    width: min(350px, calc(100vw - 30px));
    padding: 18px;
    border: 1px solid color-mix(in srgb, var(--fcx-primary) 48%, var(--fcx-border));
    border-radius: 18px;
    background: color-mix(in srgb, var(--fcx-surface) 91%, transparent);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .26);
    -webkit-backdrop-filter: blur(20px) saturate(125%);
    backdrop-filter: blur(20px) saturate(125%);
    color: var(--fcx-text);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px) scale(.975);
    transition:
        top .46s cubic-bezier(.22, 1, .36, 1),
        left .46s cubic-bezier(.22, 1, .36, 1),
        opacity .26s ease,
        transform .38s cubic-bezier(.22, 1, .36, 1),
        visibility 0s linear .32s;
    will-change: top, left, transform, opacity;
}

.fcx-app .fcx-tour-tooltip.fcx-active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    transition-delay: 0s;
}

.fcx-app .fcx-tour-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--fcx-muted);
    font-size: 10px;
}

.fcx-app .fcx-tour-progress {
    flex: 1;
    height: 4px;
    overflow: hidden;
    border-radius: 99px;
    background: var(--fcx-surface-3);
}

.fcx-app .fcx-tour-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--fcx-primary);
    transition: width .42s cubic-bezier(.22, 1, .36, 1);
}

.fcx-app .fcx-tour-copy {
    transition: opacity .2s ease, transform .28s cubic-bezier(.22, 1, .36, 1);
}

.fcx-app .fcx-tour-copy.fcx-changing {
    opacity: .18;
    transform: translateY(4px);
}

.fcx-app .fcx-tour-tooltip h3 {
    margin: 0 0 8px;
    color: var(--fcx-text);
    font-size: 16px;
}

.fcx-app .fcx-tour-tooltip p {
    margin: 0 0 16px;
    color: var(--fcx-muted);
    line-height: 1.85;
    font-size: 12px;
}

.fcx-app .fcx-tour-buttons {
    display: flex;
    gap: 8px;
}

.fcx-app .fcx-tour-buttons .fcx-btn { flex: 1; }

.fcx-app .fcx-tour-highlight {
    z-index: 10000 !important;
    box-shadow:
        0 0 0 3px color-mix(in srgb, var(--fcx-primary) 88%, white 12%),
        0 0 0 9px color-mix(in srgb, var(--fcx-primary) 14%, transparent),
        0 18px 50px rgba(0, 0, 0, .16) !important;
    transition: box-shadow .35s ease, transform .35s cubic-bezier(.22, 1, .36, 1) !important;
    animation: fcx-tour-pulse 2.4s ease-in-out infinite;
}

@keyframes fcx-tour-pulse {
    0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--fcx-primary) 88%, white 12%), 0 0 0 9px color-mix(in srgb, var(--fcx-primary) 14%, transparent), 0 18px 50px rgba(0, 0, 0, .16); }
    50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--fcx-primary) 88%, white 12%), 0 0 0 14px color-mix(in srgb, var(--fcx-primary) 7%, transparent), 0 18px 50px rgba(0, 0, 0, .16); }
}

@media (prefers-reduced-motion: reduce) {
    .fcx-app .fcx-tour-overlay,
    .fcx-app .fcx-tour-tooltip,
    .fcx-app .fcx-tour-copy,
    .fcx-app .fcx-tour-progress span,
    .fcx-app .fcx-tour-highlight {
        transition: none !important;
        animation: none !important;
    }
}

@media (max-width: 1100px) {
    .fcx-app .fcx-toolbar { gap: 7px; }
    .fcx-app .fcx-toolbar .fcx-btn { padding-inline: 9px; }
    .fcx-app .fcx-search-wrap { min-width: 130px; }
}

@media (max-width: 860px) {
    .fcx-app .fcx-menu-toggle { display: inline-flex; align-items: center; gap: 6px; }

    .fcx-app .fcx-sidebar {
        position: absolute;
        top: 0;
        right: 0;
        transform: translateX(105%);
        width: min(310px, 88vw);
        flex-basis: auto;
        box-shadow: -18px 0 45px rgba(0, 0, 0, .22);
        opacity: 1;
    }

    .fcx-app .fcx-sidebar.fcx-active { transform: translateX(0); }
    .fcx-app .fcx-sidebar-backdrop.fcx-active { display: block; }

    .fcx-app .fcx-toolbar {
        min-height: 62px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
    }

    .fcx-app .fcx-search-wrap {
        flex: 0 0 170px;
        margin-inline: 0;
    }

    .fcx-app .fcx-toolbar-actions { margin-inline-start: auto; }
    .fcx-app .fcx-canvas-hint { display: none; }
}

@media (max-width: 560px) {
    .fcx-app { min-height: 480px; }
    .fcx-app .fcx-toolbar { padding-inline: 8px; }
    .fcx-app .fcx-menu-toggle span { display: none; }
    .fcx-app .fcx-search-wrap { flex-basis: 145px; }
    .fcx-app .fcx-viewport-controls { top: 10px; right: 10px; gap: 6px; }
    .fcx-app .fcx-center-view-btn { width: 42px; height: 42px; flex-basis: 42px; }
    .fcx-app .fcx-zoom-control { min-height: 42px; padding-block: 6px; }
    .fcx-app .fcx-canvas-tools { top: 10px; left: 10px; }
    .fcx-app #fcx-zoom-slider { width: 72px; }
    .fcx-app .fcx-modal-content { padding: 18px; }
    .fcx-app .fcx-fab { left: 12px; }
    .fcx-app .fcx-footer-meta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .fcx-app *,
    .fcx-app *::before,
    .fcx-app *::after {
        scroll-behavior: auto !important;
        transition-duration: .001ms !important;
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
    }
}


/* FlowChart 2.8 responsive refinements */
@media (max-width: 860px) {
    .fcx-app .fcx-sidebar {
        width: min(330px, calc(100vw - 20px));
        max-width: 100%;
        padding: 16px;
        overscroll-behavior: contain;
    }

    .fcx-app .fcx-toolbar {
        min-height: auto;
        padding: 8px 10px;
        flex-wrap: wrap;
        align-content: center;
        gap: 7px;
        overflow: visible;
    }

    .fcx-app .fcx-toolbar-group,
    .fcx-app .fcx-toolbar-actions,
    .fcx-app .fcx-toggle-switch,
    .fcx-app .fcx-menu-toggle {
        flex: 0 0 auto;
    }

    .fcx-app .fcx-toolbar-actions { margin-inline-start: 0; }

    .fcx-app .fcx-search-wrap {
        order: 20;
        flex: 1 0 100%;
        width: 100%;
        max-width: none;
        min-width: 0;
        margin: 0;
    }

    .fcx-app .fcx-search-wrap input { height: 38px; }

    .fcx-app .fcx-dropdown,
    .fcx-app .fcx-context-menu {
        max-height: min(52vh, 360px);
        overscroll-behavior: contain;
    }
}

@media (max-width: 700px) {
    .fcx-app .fcx-toolbar { gap: 6px; }

    .fcx-app .fcx-toolbar .fcx-btn {
        width: 40px;
        min-width: 40px;
        height: 40px;
        min-height: 40px;
        padding: 0;
    }

    .fcx-app .fcx-toolbar .fcx-btn > span { display: none; }
    .fcx-app .fcx-toolbar .fcx-icon-btn { width: 40px; height: 40px; }

    .fcx-app .fcx-toggle-switch {
        width: 54px;
        flex-basis: 54px;
    }

    .fcx-app .fcx-switch-label { height: 30px; }

    .fcx-app .fcx-canvas-tool {
        width: 42px;
        height: 42px;
    }

    .fcx-app .fcx-center-view-btn {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

    .fcx-app .fcx-zoom-control {
        min-height: 44px;
        padding: 7px 9px;
    }

    .fcx-app .fcx-modal-overlay { padding: 10px; }
    .fcx-app .fcx-modal-content {
        width: min(100%, 760px);
        max-height: calc(100% - 4px);
        overscroll-behavior: contain;
    }
}

@media (max-width: 560px) {
    .fcx-app { min-height: 420px; }

    .fcx-app .fcx-sidebar {
        width: min(328px, calc(100vw - 12px));
        padding: 14px;
    }

    .fcx-app .fcx-toolbar {
        padding: 7px 8px;
        row-gap: 6px;
    }

    .fcx-app .fcx-search-wrap input { height: 36px; }

    .fcx-app .fcx-canvas-tools {
        top: 8px;
        left: 8px;
        gap: 4px;
        padding: 5px;
        border-radius: 12px;
    }

    .fcx-app .fcx-viewport-controls {
        top: 8px;
        right: 8px;
        gap: 5px;
        max-width: calc(100% - 78px);
    }

    .fcx-app .fcx-center-view-btn {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
        border-radius: 11px;
    }

    .fcx-app .fcx-zoom-control {
        min-width: 0;
        min-height: 40px;
        gap: 6px;
        padding: 6px 8px;
        border-radius: 11px;
    }

    .fcx-app #fcx-zoom-slider {
        width: clamp(62px, 20vw, 82px);
        min-width: 0;
    }

    .fcx-app .fcx-zoom-control output { min-width: 34px; }

    .fcx-app .fcx-modal-overlay {
        align-items: end;
        padding: 8px;
    }

    .fcx-app .fcx-modal-content {
        width: 100%;
        max-height: calc(100% - 8px);
        padding: 18px 16px;
        border-radius: 18px 18px 12px 12px;
    }

    .fcx-app .fcx-text-entry-fields textarea { min-height: 120px; }

    .fcx-app .fcx-modal-actions {
        position: sticky;
        bottom: 0;
        padding-bottom: 2px;
        background: color-mix(in srgb, var(--fcx-surface) 92%, transparent);
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
    }

    .fcx-app .fcx-context-menu-item,
    .fcx-app .fcx-dropdown button { min-height: 46px; }

    .fcx-app .fcx-fab {
        width: 40px;
        height: 40px;
        left: 10px;
        border-radius: 12px;
    }

    .fcx-app .fcx-help-fab { bottom: 50px; }
    .fcx-app .fcx-log-fab { bottom: 96px; }
}

@media (max-width: 400px) {
    .fcx-app .fcx-toolbar { gap: 5px; }

    .fcx-app .fcx-toolbar .fcx-btn,
    .fcx-app .fcx-toolbar .fcx-icon-btn {
        width: 38px;
        min-width: 38px;
        height: 38px;
        min-height: 38px;
    }

    .fcx-app .fcx-toggle-switch {
        width: 52px;
        flex-basis: 52px;
        transform: scale(.94);
        transform-origin: center;
    }

    .fcx-app .fcx-zoom-step { width: 26px; flex-basis: 26px; }
    .fcx-app #fcx-zoom-slider { width: 72px; }
    .fcx-app .fcx-zoom-control output { min-width: 32px; }
    .fcx-app .fcx-tour-tooltip { width: calc(100vw - 16px); padding: 15px; }
}

@media (max-height: 560px) and (max-width: 860px) {
    .fcx-app .fcx-toolbar { padding-block: 5px; }
    .fcx-app .fcx-search-wrap input { height: 34px; }
    .fcx-app .fcx-sidebar { padding-block: 12px; }
    .fcx-app .fcx-panel-section + .fcx-panel-section { margin-top: 14px; padding-top: 14px; }
}

@supports (height: 100dvh) {
    body.fcx-page > .fcx-app { height: 100dvh; }
}

/* FlowChart 3.0.0 — autosave recovery */
.fcx-app .fcx-restore-modal-content { max-width: 480px; }
.fcx-app .fcx-restore-summary { margin: 12px 0 20px; color: var(--fcx-muted); line-height: 1.9; }

@media (max-width: 420px) {
    .fcx-app .fcx-edge-appearance-grid { grid-template-columns: 74px minmax(0, 1fr); }
    .fcx-app .fcx-edge-direction-btn { padding-inline: 7px; font-size: 11px; }
}
